- Notifications
You must be signed in to change notification settings - Fork 541
feat: add Venly connector to packages #1660
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
Merged
Merged
Changes from 10 commits
Commits
Show all changes
21 commits Select commit Hold shift + click to select a range
e5079c7 feat: add venly connector
davidzwfu cb5066a chore: add venly.md to docs
davidzwfu 2103a83 Update docs/src/routes/docs/[...4]wallets/venly.md
d958272 Update packages/venly/README.md
7bf9484 Update packages/venly/package.json
90da946 dynamically import @venly/web3-provider
davidzwfu 46bc0b5 add details for VenlyProviderOptions
7ba73bb environment as optional param
1637b4b add VenlyProviderOptions details to package README.md
davidzwfu d233924 Merge branch 'develop' of https://github.com/ArkaneNetwork/web3-onboa…
davidzwfu a53190d simplify VenlyOptions - only clientId required. update documentation …
davidzwfu 9f8f9ef update @venly/web3-provider to latest release
davidzwfu 57666f6 add environment option with typescript documentation
davidzwfu 69d8def add venly to demo-app. update config and core.md for zlib
davidzwfu 83d9295 Merge remote-tracking branch 'upstream/develop' into develop
davidzwfu 3f2b26d Merge branch 'develop' into develop
78d007c update demo clientId. update README. fix issues with switching enviro…
davidzwfu f35fe6e Merge branch 'develop' into develop
e8d6ec5 Add venly to internal demo and test
Adamj1232 1f048c2 Merge branch 'develop' into develop
c30dd3a update web3-provider to 3.1.1 which fixes/updates chain switching. Up…
davidzwfu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| # 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 | ||
| environment?: string | ||
| } | ||
| ``` | ||
| | ||
| `clientId` - The Client ID used to connect with Venly. See [here](https://docs.venly.io/widget/deep-dive/authentication#client-id) for more information. | ||
| | ||
| `environment` - The environment to which you want to connect, possible values are `staging` and `production`. Default set to `production`. | ||
| | ||
| ## 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) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # @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` | ||
| | ||
| ## Options | ||
| | ||
| ```typescript | ||
| type VenlyProviderOptions = { | ||
davidzwfu marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| clientId: string | ||
| environment: string | ||
| } | ||
| ``` | ||
| | ||
| `clientId` - The Client ID used to connect with Venly. See [here](https://docs.venly.io/widget/deep-dive/authentication#client-id) for more information. | ||
| | ||
| `environment` - The environment to which you want to connect, possible values are `staging` and `production`. Default set to `production`. | ||
| | ||
| ## 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) | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| 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. Outdated Show resolved Hide resolved | ||
| "@web3-onboard/common": "^2.3.1" | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| 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> | ||
| ` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| 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. Outdated Show resolved Hide resolved | ||
| clientId: string | ||
| secretType?: any | ||
| environment?: string | ||
| } | ||
davidzwfu marked this conversation as resolved. Outdated 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| 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"], | ||
| } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.