-
Notifications
You must be signed in to change notification settings - Fork 537
feat: add bloom wallet #2209
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
Adamj1232
merged 18 commits into
thirdweb-dev:develop
from
MarkNerdi:feat/add-bloom-wallet
Jun 24, 2024
Merged
feat: add bloom wallet #2209
Changes from 8 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
ab4b170
add bloom package
MarkNerdi 96c53e3
fix indentation
MarkNerdi 070fda5
add icon + fixes
MarkNerdi eee7f9e
add bloom to example app
MarkNerdi 3d97c8d
add bloom documentation
MarkNerdi e9ac58a
fix typescript issue
MarkNerdi b5bae29
Merge branch 'develop' into feat/add-bloom-wallet
MarkNerdi fd72638
Merge branch 'develop' into feat/add-bloom-wallet
Adamj1232 fee24fc
fix bloom dependencies
MarkNerdi 5f7f319
Merge branch 'develop' into feat/add-bloom-wallet
Adamj1232 23db623
Prettier
Adamj1232 c622120
Merge branch 'develop' into feat/add-bloom-wallet
Adamj1232 724b3bf
Merge branch 'develop' into feat/add-bloom-wallet
Adamj1232 6d677e6
Merge branch 'develop' into feat/add-bloom-wallet
Adamj1232 25c9000
add download prompt
MarkNerdi 4f4f2bd
Merge branch 'develop' into feat/add-bloom-wallet
MarkNerdi 7bc9361
Merge branch 'develop' into feat/add-bloom-wallet
Adamj1232 9761530
Merge branch 'develop' into feat/add-bloom-wallet
Adamj1232 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
116 changes: 116 additions & 0 deletions
116
docs/src/routes/docs/[...4]wallets/[...37]bloom/+page.md
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,116 @@ | ||
--- | ||
title: Bloom | ||
--- | ||
|
||
# {$frontmatter.title} | ||
|
||
Wallet module for connecting Bloom to web3-onboard. | ||
|
||
## Install | ||
|
||
<Tabs values={['yarn', 'npm']}> | ||
<TabPanel value="yarn"> | ||
|
||
```sh copy | ||
yarn add @web3-onboard/bloom | ||
``` | ||
|
||
</TabPanel> | ||
<TabPanel value="npm"> | ||
|
||
```sh copy | ||
npm install @web3-onboard/bloom | ||
``` | ||
|
||
</TabPanel> | ||
</Tabs> | ||
|
||
|
||
```typescript | ||
type WalletConnectOptions = { | ||
/** | ||
* Project ID associated with [WalletConnect account](https://cloud.walletconnect.com) | ||
*/ | ||
projectId: string | ||
/** | ||
* Defaults to `appMetadata.explore` that is supplied to the web3-onboard init | ||
* Strongly recommended to provide atleast one URL as it is required by some wallets (i.e. MetaMask) | ||
* To connect with walletconnect | ||
*/ | ||
dappUrl?: string | ||
/** | ||
* List of Required Chain(s) ID for wallets to support in number format (integer or hex) | ||
* Defaults to [1] - Ethereum | ||
*/ | ||
requiredChains?: number[] | undefined | ||
/** | ||
* List of Optional Chain(s) ID for wallets to support in number format (integer or hex) | ||
* Defaults to the chains provided within the web3-onboard init chain property | ||
*/ | ||
optionalChains?: number[] | undefined | ||
/** | ||
* Additional required methods to be added to the default list of ['eth_sendTransaction', 'personal_sign'] | ||
* Passed methods to be included along with the defaults methods - see https://docs.walletconnect.com/2.0/advanced/providers/ethereum#required-and-optional-methods | ||
*/ | ||
additionalRequiredMethods?: string[] | undefined | ||
/** | ||
* Additional methods to be added to the default list of ['eth_sendTransaction', 'eth_signTransaction', 'personal_sign', 'eth_sign', 'eth_signTypedData', 'eth_signTypedData_v4'] | ||
* Passed methods to be included along with the defaults methods - see https://docs.walletconnect.com/2.0/web/walletConnectModal/options | ||
*/ | ||
additionalOptionalMethods?: string[] | undefined | ||
) | ||
``` | ||
|
||
## Usage | ||
|
||
```typescript | ||
import Onboard from '@web3-onboard/core' | ||
import bloomModule from '@web3-onboard/bloom' | ||
|
||
const wcInitOptions = { | ||
/** | ||
* Project ID associated with [WalletConnect account](https://cloud.walletconnect.com) | ||
*/ | ||
projectId: 'abc123...', | ||
/** | ||
* Chains required to be supported by all wallets connecting to your DApp | ||
*/ | ||
requiredChains: [1], | ||
/** | ||
* Chains required to be supported by all wallets connecting to your DApp | ||
*/ | ||
optionalChains: [42161, 8453, 10, 137, 56], | ||
/** | ||
* Defaults to `appMetadata.explore` that is supplied to the web3-onboard init | ||
* Strongly recommended to provide atleast one URL as it is required by some wallets (i.e. MetaMask) | ||
* To connect with WalletConnect | ||
*/ | ||
dappUrl: 'http://YourAwesomeDapp.com' | ||
} | ||
|
||
// initialize the module with options | ||
const bloom = bloomModule(wcInitOptions) | ||
|
||
// can also initialize with no options... | ||
|
||
const onboard = Onboard({ | ||
// ... other Onboard options | ||
wallets: [ | ||
bloom | ||
//... other wallets | ||
] | ||
}) | ||
|
||
const connectedWallets = await onboard.connectWallet() | ||
|
||
// Assuming only wallet connect is connected, index 0 | ||
// `instance` will give insight into the WalletConnect info | ||
// such as namespaces, methods, chains, etc per wallet connected | ||
const { instance } = connectedWallets[0] | ||
|
||
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,94 @@ | ||
# @web3-onboard/bloom | ||
|
||
## Wallet module for connecting Bloom to web3-onboard | ||
|
||
### Install | ||
|
||
`npm i @web3-onboard/core @web3-onboard/bloom` | ||
|
||
## Options | ||
|
||
```typescript | ||
type WalletConnectOptions = { | ||
/** | ||
* Project ID associated with [WalletConnect account](https://cloud.walletconnect.com) | ||
*/ | ||
projectId: string | ||
/** | ||
* Defaults to `appMetadata.explore` that is supplied to the web3-onboard init | ||
* Strongly recommended to provide atleast one URL as it is required by some wallets (i.e. MetaMask) | ||
* To connect with walletconnect | ||
*/ | ||
dappUrl?: string | ||
/** | ||
* List of Required Chain(s) ID for wallets to support in number format (integer or hex) | ||
* Defaults to [1] - Ethereum | ||
*/ | ||
requiredChains?: number[] | undefined | ||
/** | ||
* List of Optional Chain(s) ID for wallets to support in number format (integer or hex) | ||
* Defaults to the chains provided within the web3-onboard init chain property | ||
*/ | ||
optionalChains?: number[] | undefined | ||
/** | ||
* Additional required methods to be added to the default list of ['eth_sendTransaction', 'personal_sign'] | ||
* Passed methods to be included along with the defaults methods - see https://docs.walletconnect.com/2.0/advanced/providers/ethereum#required-and-optional-methods | ||
*/ | ||
additionalRequiredMethods?: string[] | undefined | ||
/** | ||
* Additional methods to be added to the default list of ['eth_sendTransaction', 'eth_signTransaction', 'personal_sign', 'eth_sign', 'eth_signTypedData', 'eth_signTypedData_v4'] | ||
* Passed methods to be included along with the defaults methods - see https://docs.walletconnect.com/2.0/web/walletConnectModal/options | ||
*/ | ||
additionalOptionalMethods?: string[] | undefined | ||
} | ||
``` | ||
|
||
## Usage | ||
|
||
```typescript | ||
import Onboard from '@web3-onboard/core' | ||
import walletConnectModule from '@web3-onboard/walletconnect' | ||
|
||
const wcInitOptions = { | ||
/** | ||
* Project ID associated with [WalletConnect account](https://cloud.walletconnect.com) | ||
*/ | ||
projectId: 'abc123...', | ||
/** | ||
* Chains required to be supported by all wallets connecting to your DApp | ||
*/ | ||
requiredChains: [1], | ||
/** | ||
* Chains required to be supported by all wallets connecting to your DApp | ||
*/ | ||
optionalChains: [42161, 8453, 10, 137, 56], | ||
/** | ||
* Defaults to `appMetadata.explore` that is supplied to the web3-onboard init | ||
* Strongly recommended to provide atleast one URL as it is required by some wallets (i.e. MetaMask) | ||
* To connect with WalletConnect | ||
*/ | ||
dappUrl: 'http://YourAwesomeDapp.com' | ||
} | ||
|
||
// initialize the module with options | ||
const bloom = initBloom(wcInitOptions) | ||
|
||
// can also initialize with no options... | ||
|
||
const onboard = Onboard({ | ||
// ... other Onboard options | ||
wallets: [ | ||
bloom | ||
//... other wallets | ||
] | ||
}) | ||
|
||
const connectedWallets = await onboard.connectWallet() | ||
|
||
// Assuming only wallet connect is connected, index 0 | ||
// `instance` will give insight into the WalletConnect info | ||
// such as namespaces, methods, chains, etc per wallet connected | ||
const { instance } = connectedWallets[0] | ||
|
||
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,77 @@ | ||
{ | ||
"name": "@web3-onboard/bloom", | ||
"version": "2.1.2", | ||
"description": "Unstoppable Domains 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": [ | ||
"Bloom", | ||
"Iota", | ||
"Shimmer", | ||
"Ethereum", | ||
"Web3", | ||
"EVM", | ||
"dapp", | ||
"Multichain", | ||
"Wallet", | ||
"Transaction", | ||
"Provider", | ||
"Hardware Wallet", | ||
"Notifications", | ||
"React", | ||
"Svelte", | ||
"Vue", | ||
"Next", | ||
"Nuxt", | ||
"MetaMask", | ||
"Coinbase", | ||
"WalletConnect", | ||
"Ledger", | ||
"Trezor", | ||
"Connect Wallet", | ||
"Ethereum Hooks", | ||
"Blocknative", | ||
"Mempool", | ||
"pending", | ||
"confirmed", | ||
"Injected Wallet", | ||
"Crypto", | ||
"Crypto Wallet", | ||
"Domain Name", | ||
"Unstoppable Domains", | ||
"Unstoppable" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/blocknative/web3-onboard.git", | ||
"directory": "packages/bloom" | ||
}, | ||
"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", | ||
"@walletconnect/types": "^2.7.0" | ||
}, | ||
"dependencies": { | ||
"@ethersproject/providers": "^5.5.0", | ||
"@walletconnect/client": "^1.8.0", | ||
"@walletconnect/ethereum-provider": "2.9.1", | ||
"@walletconnect/modal": "2.6.1", | ||
"@walletconnect/qrcode-modal": "^1.8.0", | ||
"@web3-onboard/common": "^2.3.3", | ||
"joi": "17.9.1", | ||
"rxjs": "^7.5.2" | ||
} | ||
} |
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,81 @@ | ||
export default ` | ||
<svg | ||
{...props} | ||
width="128" | ||
height="128" | ||
viewBox="0 0 128 128" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<g filter="url(#filter0_b_159_287)"> | ||
<rect width="128" height="128" fill="url(#paint0_linear_159_287)" rx="24" /> | ||
</g> | ||
<path d="M64.0095 66.9176C62.8967 68.9345 63.3836 72.4815 73.6768 85.0003C91.1335 106.073 101.009 90.8424 96.6974 82.7747C106.156 99.536 88.8384 113.724 75.485 107.812C67.9042 104.404 61.7144 93.9026 59.2802 83.8876C55.3855 67.6827 62.549 66.4308 64.0095 66.9176Z" fill="url(#paint1_linear_159_287)" /> | ||
<path d="M64.01 66.9182C65.6096 68.5874 69.087 69.2829 84.1791 63.3017C109.634 53.2171 98.1584 39.0988 89.1866 40.6984C108.034 36.8732 116.241 57.7378 106.435 68.6569C100.871 74.8467 88.978 77.4896 78.6848 76.655C62.0626 75.3336 63.1059 68.1005 64.01 66.9182Z" fill="url(#paint2_linear_159_287)" /> | ||
<path d="M64.0101 66.9177C66.0965 65.944 67.8352 62.8143 66.792 46.6095C65.0533 19.3464 48.0834 25.8145 46.8315 34.8558C49.0571 15.7299 71.3822 14.4085 78.7544 27.0663C82.9273 34.2994 81.745 46.4008 77.7807 55.9289C71.3822 71.3687 64.8447 68.1 64.0101 66.9177Z" fill="url(#paint3_linear_159_287)" /> | ||
<path d="M66.7918 46.6096C65.0531 19.3465 48.0137 25.8146 46.8314 34.856C46.4836 37.6379 46.6227 40.5589 47.1095 43.4799C50.9347 45.2882 54.6208 47.6528 57.8201 50.3652C68.1133 59.1283 66.7223 64.275 65.0531 66.0832C66.5832 64.4141 67.6264 60.0325 66.7918 46.6096Z" fill="url(#paint4_linear_159_287)" /> | ||
<path d="M64.0095 66.9178C63.7313 64.6227 61.2971 62.0494 45.5791 58.0156C19.0811 51.1998 20.0548 69.3521 28.2615 73.3859C10.8048 65.3878 16.4383 43.6885 30.6957 40.6284C38.8329 38.8897 49.9607 43.7582 57.8197 50.4348C70.4776 61.2149 65.4005 66.431 64.0095 66.9178Z" fill="url(#paint5_linear_159_287)" /> | ||
<path d="M64.0093 66.918C61.7142 66.5007 58.515 68.0309 49.8214 81.7319C35.1467 104.822 52.7425 109.551 59.0714 102.944C46.0658 117.063 27.1485 105.031 28.6786 90.4951C29.5132 82.2188 37.6504 73.1078 46.4135 67.7526C60.6014 58.9895 64.0093 65.4575 64.0093 66.918Z" fill="url(#paint6_linear_159_287)" /> | ||
<path d="M84.1786 63.3016C109.633 53.2171 98.1579 39.0292 89.1861 40.6983C86.4737 41.1852 83.6918 42.2979 81.0489 43.6193C80.4925 47.7922 79.3797 52.1042 77.7801 55.9294C72.6335 68.4482 67.3478 68.6569 65.0527 67.6832C67.1392 68.6569 71.6599 68.2396 84.1786 63.3016Z" fill="url(#paint7_linear_159_287)" /> | ||
<path d="M73.6766 85.0007C91.1333 106.074 101.079 90.7732 96.6972 82.7751C95.3757 80.3409 93.4979 78.0458 91.4115 75.9593C87.2385 76.7244 82.857 77.0026 78.6841 76.6548C65.1916 75.6116 63.3834 70.6737 63.592 68.1699C63.3138 70.465 65.1221 74.6379 73.6766 85.0007Z" fill="url(#paint8_linear_159_287)" /> | ||
<path d="M49.8218 81.7319C35.1471 104.822 52.8124 109.621 59.0718 102.944C60.9496 100.927 62.6188 98.4235 63.9402 95.7807C61.9233 92.0946 60.3237 87.9218 59.35 83.8879C56.1508 70.7432 60.3237 67.4744 62.7579 66.918C60.3932 67.4048 56.9853 70.3954 49.8218 81.7319Z" fill="url(#paint9_linear_159_287)" /> | ||
<path d="M45.5101 58.0156C19.0121 51.1999 19.9162 69.4912 28.1925 73.386C30.6963 74.5683 33.5478 75.3333 36.5384 75.7506C39.4594 72.6904 42.8673 69.9086 46.4143 67.683C57.9593 60.589 62.3409 63.51 63.5928 65.666C62.4105 63.6491 58.5157 61.354 45.5101 58.0156Z" fill="url(#paint10_linear_159_287)" /> | ||
<defs> | ||
<filter id="filter0_b_159_287" x="-1.35914" y="-1.35914" width="130.718" height="130.718" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"> | ||
<feFlood flood-opacity="0" result="BackgroundImageFix" /> | ||
<feGaussianBlur in="BackgroundImageFix" stdDeviation="0.67957" /> | ||
<feComposite in2="SourceAlpha" operator="in" result="effect1_backgroundBlur_159_287" /> | ||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_backgroundBlur_159_287" result="shape" /> | ||
</filter> | ||
<linearGradient id="paint0_linear_159_287" x1="19.6779" y1="-83.848" x2="81.6722" y2="122.802" gradientUnits="userSpaceOnUse"> | ||
<stop stop-color="#B882FF" /> | ||
<stop offset="1" stop-color="#2F00A6" /> | ||
</linearGradient> | ||
<linearGradient id="paint1_linear_159_287" x1="59.4545" y1="69.2649" x2="93.9982" y2="104.05" gradientUnits="userSpaceOnUse"> | ||
<stop stop-color="white" stop-opacity="0.1" /> | ||
<stop offset="0.25" stop-color="white" /> | ||
<stop offset="1" stop-color="white" stop-opacity="0.1" /> | ||
</linearGradient> | ||
<linearGradient id="paint2_linear_159_287" x1="64.7702" y1="72.027" x2="108.53" y2="49.9246" gradientUnits="userSpaceOnUse"> | ||
<stop stop-color="white" stop-opacity="0.1" /> | ||
<stop offset="0.25" stop-color="white" /> | ||
<stop offset="1" stop-color="white" stop-opacity="0.1" /> | ||
</linearGradient> | ||
<linearGradient id="paint3_linear_159_287" x1="69.0506" y1="67.6901" x2="61.5513" y2="19.2442" gradientUnits="userSpaceOnUse"> | ||
<stop stop-color="white" stop-opacity="0.1" /> | ||
<stop offset="0.25" stop-color="white" /> | ||
<stop offset="1" stop-color="white" stop-opacity="0.1" /> | ||
</linearGradient> | ||
<linearGradient id="paint4_linear_159_287" x1="59.85" y1="27.6087" x2="55.6723" y2="55.3608" gradientUnits="userSpaceOnUse"> | ||
<stop stop-color="white" stop-opacity="0.9" /> | ||
<stop offset="1" stop-color="white" stop-opacity="0.1" /> | ||
</linearGradient> | ||
<linearGradient id="paint5_linear_159_287" x1="66.3303" y1="62.3729" x2="17.936" y2="54.5358" gradientUnits="userSpaceOnUse"> | ||
<stop stop-color="white" stop-opacity="0.1" /> | ||
<stop offset="0.25" stop-color="white" /> | ||
<stop offset="1" stop-color="white" stop-opacity="0.1" /> | ||
</linearGradient> | ||
<linearGradient id="paint6_linear_159_287" x1="60.3117" y1="63.3084" x2="37.9021" y2="106.909" gradientUnits="userSpaceOnUse"> | ||
<stop stop-color="white" stop-opacity="0.1" /> | ||
<stop offset="0.25" stop-color="white" /> | ||
<stop offset="1" stop-color="white" stop-opacity="0.1" /> | ||
</linearGradient> | ||
<linearGradient id="paint7_linear_159_287" x1="100.047" y1="50.8934" x2="72.3612" y2="55.4953" gradientUnits="userSpaceOnUse"> | ||
<stop stop-color="white" stop-opacity="0.9" /> | ||
<stop offset="1" stop-color="white" stop-opacity="0.1" /> | ||
</linearGradient> | ||
<linearGradient id="paint8_linear_159_287" x1="90.4573" y1="96.2819" x2="77.5244" y2="71.3748" gradientUnits="userSpaceOnUse"> | ||
<stop stop-color="white" stop-opacity="0.9" /> | ||
<stop offset="1" stop-color="white" stop-opacity="0.1" /> | ||
</linearGradient> | ||
<linearGradient id="paint9_linear_159_287" x1="44.197" y1="101.142" x2="63.8895" y2="81.1463" gradientUnits="userSpaceOnUse"> | ||
<stop stop-color="white" stop-opacity="0.9" /> | ||
<stop offset="1" stop-color="white" stop-opacity="0.1" /> | ||
</linearGradient> | ||
<linearGradient id="paint10_linear_159_287" x1="25.3691" y1="58.7338" x2="50.4734" y2="71.2827" gradientUnits="userSpaceOnUse"> | ||
<stop stop-color="white" stop-opacity="0.9" /> | ||
<stop offset="1" stop-color="white" stop-opacity="0.1" /> | ||
</linearGradient> | ||
</defs> | ||
</svg> | ||
` |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.