Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Venly connector to packages #1660

Merged
merged 21 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
e5079c7
feat: add venly connector
davidzwfu Apr 24, 2023
cb5066a
chore: add venly.md to docs
davidzwfu Apr 27, 2023
2103a83
Update docs/src/routes/docs/[...4]wallets/venly.md
davidzwfu Apr 28, 2023
d958272
Update packages/venly/README.md
davidzwfu Apr 28, 2023
7bf9484
Update packages/venly/package.json
davidzwfu Apr 28, 2023
90da946
dynamically import @venly/web3-provider
davidzwfu Apr 28, 2023
46bc0b5
add details for VenlyProviderOptions
davidzwfu Apr 28, 2023
7ba73bb
environment as optional param
davidzwfu Apr 28, 2023
1637b4b
add VenlyProviderOptions details to package README.md
davidzwfu Apr 28, 2023
d233924
Merge branch 'develop' of https://github.com/ArkaneNetwork/web3-onboa…
davidzwfu Apr 28, 2023
a53190d
simplify VenlyOptions - only clientId required. update documentation …
davidzwfu Apr 28, 2023
9f8f9ef
update @venly/web3-provider to latest release
davidzwfu May 15, 2023
57666f6
add environment option with typescript documentation
davidzwfu May 15, 2023
69d8def
add venly to demo-app. update config and core.md for zlib
davidzwfu May 15, 2023
83d9295
Merge remote-tracking branch 'upstream/develop' into develop
davidzwfu May 16, 2023
3f2b26d
Merge branch 'develop' into develop
davidzwfu May 16, 2023
78d007c
update demo clientId. update README. fix issues with switching enviro…
davidzwfu May 22, 2023
f35fe6e
Merge branch 'develop' into develop
davidzwfu May 22, 2023
e8d6ec5
Add venly to internal demo and test
Adamj1232 May 22, 2023
1f048c2
Merge branch 'develop' into develop
davidzwfu Jun 1, 2023
c30dd3a
update web3-provider to 3.1.1 which fixes/updates chain switching. Up…
davidzwfu Jun 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions docs/src/routes/docs/[...4]wallets/venly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Venly

Wallet module for connecting Venly Wallet SDK to web3-onboard. Check out the [Venly Docs](https://docs.venly.io/) for more information.
## Install

<Tabs values={['yarn', 'npm']}>
<TabPanel value="yarn">

```sh copy
yarn add @web3-onboard/venly
```

</TabPanel>
<TabPanel value="npm">

```sh copy
npm install @web3-onboard/venly
```

</TabPanel>
</Tabs>

## Options

```typescript
type VenlyProviderOptions = {
clientId: string
davidzwfu marked this conversation as resolved.
Show resolved Hide resolved
}
```

## Usage

```typescript
import Onboard from '@web3-onboard/core'
import venlyModule from '@web3-onboard/venly'

// initialize the module with options
const venly = venlyModule({
clientId: 'YOUR_CLIENT_ID',
})

const onboard = Onboard({
// ... other Onboard options
wallets: [
venly
//... other wallets
]
})

const connectedWallets = await onboard.connectWallet()
console.log(connectedWallets)
```

## Build Environments
For build env configurations and setups please see the Build Env section [here](/docs/modules/core#build-environments)
31 changes: 31 additions & 0 deletions packages/venly/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# @web3-onboard/venly

## Wallet module for connecting Venly SDK to web3-onboard
See [Venly SDK Docs](https://docs.venly.io/widget/) for complete documentation of Venly usage

### Install

`npm install @web3-onboard/venly`

## Usage

```typescript
import Onboard from '@web3-onboard/core'
import venlyModule from '@web3-onboard/venly'

// initialize the module with options
const venly = venlyModule({
clientId: 'YOUR_CLIENT_ID'
})

const onboard = Onboard({
// ... other Onboard options
wallets: [
venly
//... other wallets
]
})

const connectedWallets = await onboard.connectWallet()
console.log(connectedWallets)
```
51 changes: 51 additions & 0 deletions packages/venly/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "@web3-onboard/venly",
"version": "2.0.0-alpha.1",
"description": "Venly wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
"keywords": [
"Ethereum",
"Web3",
"EVM",
"dapp",
"Multichain",
"Wallet",
"Transaction",
"Provider",
"Notifications",
"React",
"Venly",
"Connect Wallet",
"Ethereum Hooks",
"Blocknative",
"Crypto",
"Crypto Wallet"
],
"repository": {
"type": "git",
"url": "https://github.com/blocknative/web3-onboard.git",
"directory": "packages/venly"
},
"homepage": "https://onboard.blocknative.com",
"bugs": "https://github.com/blocknative/web3-onboard/issues",
"module": "dist/index.js",
"browser": "dist/index.js",
"main": "dist/index.js",
"type": "module",
"typings": "dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "tsc",
"dev": "tsc -w",
"type-check": "tsc --noEmit"
},
"license": "MIT",
"devDependencies": {
"typescript": "^4.5.5"
},
"dependencies": {
"@venly/web3-provider": "^3.0.0-develop.8",
davidzwfu marked this conversation as resolved.
Show resolved Hide resolved
"@web3-onboard/common": "^2.3.1"
}
}
12 changes: 12 additions & 0 deletions packages/venly/src/icon.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export default `
<svg width="100%" height="100%" viewBox="0 0 1080 1080" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="1080" height="1080" fill="url(#paint0_linear)" rx="20%"/>
<path d="M834.167 474.367L760.572 502.319C757.478 503.445 754.478 500.443 755.79 497.348L837.823 298.208C839.042 295.206 836.135 292.111 833.135 293.237L677.227 347.829C674.227 348.861 671.789 351.206 670.57 354.207L564.913 620.884C563.6 624.261 566.882 627.638 570.257 626.418L636.257 602.218C639.914 600.904 643.289 604.844 641.32 608.315L544.381 772.936C542.319 776.5 537.069 776.5 535.006 772.936L438.067 608.221C436.098 604.844 439.38 600.811 443.13 602.124L509.131 626.324C512.506 627.544 515.787 624.167 514.475 620.79L408.723 354.207C407.504 351.206 405.16 348.954 402.067 347.829L246.346 293.237C243.252 292.205 240.439 295.206 241.658 298.208L323.597 497.348C324.816 500.35 321.816 503.445 318.815 502.319L245.689 474.367C241.939 472.96 238.564 476.993 240.627 480.464L458.317 841.035C460.474 844.6 464.318 846.757 468.536 846.757H611.226C615.351 846.757 619.288 844.6 621.445 841.035L839.51 480.464C841.292 476.993 837.917 472.96 834.167 474.367Z" fill="white"/>
<defs>
<linearGradient id="paint0_linear" x1="435.874" y1="-3.23691e-05" x2="1146.57" y2="178.471" gradientUnits="userSpaceOnUse">
<stop stop-color="#7735E8"/>
<stop offset="1" stop-color="#C62CF1"/>
</linearGradient>
</defs>
</svg>
`
36 changes: 36 additions & 0 deletions packages/venly/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { WalletInit } from '@web3-onboard/common';

interface VenlyProviderOptions {
davidzwfu marked this conversation as resolved.
Show resolved Hide resolved
clientId: string
secretType?: any
environment?: string
}
davidzwfu marked this conversation as resolved.
Show resolved Hide resolved

function venly(options: VenlyProviderOptions): WalletInit {
return () => {
return {
label: 'Venly',
getIcon: async () => (await import('./icon.js')).default,
getInterface: async ({ chains }) => {
const { VenlyProvider, SECRET_TYPES } = await import('@venly/web3-provider');
if (!options.secretType) {
const chainId = +chains[0].id;
const chain = SECRET_TYPES[chainId];
if (!chain) throw Error('Chain not supported');
options.secretType = chain.secretType;
options.environment = chain.env;
}

const instance = new VenlyProvider();
const provider = await instance.createProvider(options);

return {
provider,
instance
}
}
}
}
}

export default venly
14 changes: 14 additions & 0 deletions packages/venly/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "../../tsconfig.json",
"include": ["src/**/*"],

"compilerOptions": {
"outDir": "dist",
"rootDir": "src",
"declarationDir": "dist",
"paths": {
"*": ["./src/*", "./node_modules/*"]
},
"typeRoots": ["node_modules/@types"],
}
}