Skip to content

Commit b5bae29

Browse files
authored
Merge branch 'develop' into feat/add-bloom-wallet
2 parents e9ac58a + 3fcee26 commit b5bae29

File tree

150 files changed

+2412
-1286
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+2412
-1286
lines changed

.circleci/config.yml

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ commands:
167167
jobs:
168168
build-core:
169169
docker:
170-
- image: cimg/node:16.13.1
170+
- image: cimg/node:16.15.1
171171
working_directory: ~/web3-onboard-monorepo/packages/core
172172
steps:
173173
- node-build-steps
@@ -275,7 +275,7 @@ jobs:
275275
- node-build-steps
276276
build-react:
277277
docker:
278-
- image: cimg/node:16.13.1
278+
- image: cimg/node:16.15.1
279279
working_directory: ~/web3-onboard-monorepo/packages/react
280280
steps:
281281
- node-build-steps
@@ -293,7 +293,7 @@ jobs:
293293
- node-build-steps
294294
build-web3auth:
295295
docker:
296-
- image: cimg/node:16.18.1
296+
- image: cimg/node:18.0.0
297297
working_directory: ~/web3-onboard-monorepo/packages/web3auth
298298
steps:
299299
- node-build-steps
@@ -305,7 +305,7 @@ jobs:
305305
- node-build-steps
306306
build-vue:
307307
docker:
308-
- image: cimg/node:16.13.1
308+
- image: cimg/node:16.15.1
309309
working_directory: ~/web3-onboard-monorepo/packages/vue
310310
steps:
311311
- node-build-steps
@@ -341,7 +341,7 @@ jobs:
341341
- node-build-steps
342342
build-uauth:
343343
docker:
344-
- image: cimg/node:16.13.1
344+
- image: cimg/node:18.0.0
345345
working_directory: ~/web3-onboard-monorepo/packages/uauth
346346
steps:
347347
- node-build-steps
@@ -395,7 +395,7 @@ jobs:
395395
- node-build-steps
396396
build-arcana-auth:
397397
docker:
398-
- image: cimg/node:16.13.1
398+
- image: cimg/node:18.0.0
399399
working_directory: ~/web3-onboard-monorepo/packages/arcana-auth
400400
steps:
401401
- node-build-steps
@@ -407,7 +407,7 @@ jobs:
407407
- node-build-steps
408408
build-venly:
409409
docker:
410-
- image: cimg/node:16.13.1
410+
- image: cimg/node:18.18.2
411411
working_directory: ~/web3-onboard-monorepo/packages/venly
412412
steps:
413413
- node-build-steps
@@ -432,7 +432,7 @@ jobs:
432432
resource_class: large
433433
build-solid:
434434
docker:
435-
- image: cimg/node:16.14.2
435+
- image: cimg/node:16.15.1
436436
working_directory: ~/web3-onboard-monorepo/packages/solid
437437
steps:
438438
- node-build-steps
@@ -448,6 +448,12 @@ jobs:
448448
working_directory: ~/web3-onboard-monorepo/packages/particle-network
449449
steps:
450450
- node-build-steps
451+
build-wagmi:
452+
docker:
453+
- image: cimg/node:18.0.0
454+
working_directory: ~/web3-onboard-monorepo/packages/wagmi
455+
steps:
456+
- node-build-steps
451457
build-passport:
452458
docker:
453459
- image: cimg/node:18.0.0
@@ -458,7 +464,7 @@ jobs:
458464
# Build staging/Alpha releases
459465
build-staging-core:
460466
docker:
461-
- image: cimg/node:16.13.1
467+
- image: cimg/node:16.15.1
462468
working_directory: ~/web3-onboard-monorepo/packages/core
463469
steps:
464470
- node-staging-build-steps
@@ -566,7 +572,7 @@ jobs:
566572
- node-staging-build-steps
567573
build-staging-react:
568574
docker:
569-
- image: cimg/node:16.13.1
575+
- image: cimg/node:16.15.1
570576
working_directory: ~/web3-onboard-monorepo/packages/react
571577
steps:
572578
- node-staging-build-steps
@@ -584,7 +590,7 @@ jobs:
584590
- node-staging-build-steps
585591
build-staging-web3auth:
586592
docker:
587-
- image: cimg/node:16.18.1
593+
- image: cimg/node:18.0.0
588594
working_directory: ~/web3-onboard-monorepo/packages/web3auth
589595
steps:
590596
- node-staging-build-steps
@@ -596,7 +602,7 @@ jobs:
596602
- node-staging-build-steps
597603
build-staging-vue:
598604
docker:
599-
- image: cimg/node:16.13.1
605+
- image: cimg/node:16.15.1
600606
working_directory: ~/web3-onboard-monorepo/packages/vue
601607
steps:
602608
- node-staging-build-steps
@@ -632,7 +638,7 @@ jobs:
632638
- node-staging-build-steps
633639
build-staging-uauth:
634640
docker:
635-
- image: cimg/node:16.13.1
641+
- image: cimg/node:18.0.0
636642
working_directory: ~/web3-onboard-monorepo/packages/uauth
637643
steps:
638644
- node-staging-build-steps
@@ -686,7 +692,7 @@ jobs:
686692
- node-staging-build-steps
687693
build-staging-arcana-auth:
688694
docker:
689-
- image: cimg/node:16.13.1
695+
- image: cimg/node:18.0.0
690696
working_directory: ~/web3-onboard-monorepo/packages/arcana-auth
691697
steps:
692698
- node-staging-build-steps
@@ -698,7 +704,7 @@ jobs:
698704
- node-staging-build-steps
699705
build-staging-venly:
700706
docker:
701-
- image: cimg/node:16.13.1
707+
- image: cimg/node:18.18.2
702708
working_directory: ~/web3-onboard-monorepo/packages/venly
703709
steps:
704710
- node-staging-build-steps
@@ -722,7 +728,7 @@ jobs:
722728
- node-staging-build-steps
723729
build-staging-solid:
724730
docker:
725-
- image: cimg/node:16.14.2
731+
- image: cimg/node:16.15.1
726732
working_directory: ~/web3-onboard-monorepo/packages/solid
727733
steps:
728734
- node-staging-build-steps
@@ -738,6 +744,12 @@ jobs:
738744
working_directory: ~/web3-onboard-monorepo/packages/particle-network
739745
steps:
740746
- node-staging-build-steps
747+
build-staging-wagmi:
748+
docker:
749+
- image: cimg/node:18.0.0
750+
working_directory: ~/web3-onboard-monorepo/packages/wagmi
751+
steps:
752+
- node-staging-build-steps
741753
build-staging-passport:
742754
docker:
743755
- image: cimg/node:18.0.0
@@ -753,6 +765,7 @@ workflows:
753765
<<: *deploy_production_filters
754766
- build-staging-common:
755767
<<: *deploy_staging_filters
768+
756769
core:
757770
jobs:
758771
- build-core:
@@ -1030,6 +1043,12 @@ workflows:
10301043
<<: *deploy_production_filters
10311044
- build-staging-particle:
10321045
<<: *deploy_staging_filters
1046+
wagmi:
1047+
jobs:
1048+
- build-wagmi:
1049+
<<: *deploy_production_filters
1050+
- build-staging-wagmi:
1051+
<<: *deploy_staging_filters
10331052
passport:
10341053
jobs:
10351054
- build-passport:

docs/src/routes/docs/[...1]overview/[...1]introduction/+page.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ const MAINNET_RPC_URL = 'https://mainnet.infura.io/v3/<INFURA_KEY>'
102102
const injected = injectedModule()
103103

104104
const onboard = Onboard({
105+
// This javascript object is unordered meaning props do not require a certain order
105106
wallets: [injected],
106107
chains: [
107108
{

docs/src/routes/docs/[...2]getting-started/[...1]installation/+page.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ const appMetadata = {
110110

111111
```ts
112112
const onboard = Onboard({
113+
// This javascript object is unordered meaning props do not require a certain order
113114
wallets,
114115
chains,
115116
appMetadata

docs/src/routes/docs/[...3]modules/[...1]core/+page.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,7 @@ import injectedModule from '@web3-onboard/injected-wallets'
621621
const injected = injectedModule()
622622

623623
const onboard = Onboard({
624+
// This javascript object is unordered meaning props do not require a certain order
624625
// head to https://explorer.blocknative.com/account to sign up for free
625626
apiKey: 'xxx387fb-bxx1-4xxc-a0x3-9d37e426xxxx'
626627
wallets: [injected],

docs/src/routes/docs/[...3]modules/[...3]react/+page.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const rpcUrl = `https://mainnet.infura.io/v3/${infuraKey}`
4646

4747
// initialize Onboard
4848
init({
49+
// This javascript object is unordered meaning props do not require a certain order
4950
apiKey,
5051
wallets: [injected],
5152
chains: [
@@ -724,3 +725,31 @@ export default {
724725
}
725726
}
726727
```
728+
729+
## `useWagmiConfig`
730+
731+
This hook allows you to get the WagmiConfig (Config from the Wagmi project) from @web3-onboard/core if W3O has been initialized with the [WAGMI property imported and passing into the web3-onboard/core config](../../modules/wagmi.md#usage).
732+
733+
```typescript
734+
import { sendTransaction as wagmiSendTransaction } from '@web3-onboard/wagmi'
735+
import { parseEther } from 'viem'
736+
import { useWagmiConfig, wallets } from '@web3-onboard/react'
737+
import type { WagmiConfig } from '@web3-onboard/core'
738+
739+
type useWagmiConfig = (): WagmiConfig
740+
741+
const wagmiConfig = useWagmiConfig()
742+
const w3OWallets = useWallets()
743+
744+
const sendTransaction = async () => {
745+
// current primary wallet - as multiple wallets can connect this value is the currently active
746+
const [currentPrimaryWallet] = w3OWallets
747+
const result = await wagmiSendTransaction(wagmiConfig, {
748+
to: toAddress,
749+
// desired connector to send txn from
750+
account: currentPrimaryWallet.accounts[0],
751+
value: parseEther('0.001')
752+
})
753+
console.log(result)
754+
}
755+
```
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
title: wagmi
3+
---
4+
5+
# {$frontmatter.title}
6+
7+
A module for connecting wallets using WAGMI which returns a WAGMI config object to be used with [@wagmi/core](https://wagmi.sh/core/getting-started) functions.
8+
9+
### Install
10+
11+
<Tabs values={['yarn', 'npm']}>
12+
<TabPanel value="yarn">
13+
14+
```sh copy
15+
yarn add @web3-onboard/wagmi
16+
```
17+
18+
</TabPanel>
19+
<TabPanel value="npm">
20+
21+
```sh copy
22+
npm install @web3-onboard/wagmi
23+
```
24+
25+
</TabPanel>
26+
</Tabs>
27+
28+
## Usage
29+
30+
This example assumes you have already setup web3-onboard to connect wallets to your dapp.
31+
For more information see [web3-onboard docs](https://onboard.blocknative.com/docs/modules/core#install).
32+
33+
```ts
34+
import Onboard from '@web3-onboard/core'
35+
import injectedModule from '@web3-onboard/injected-wallets'
36+
import wagmi from '@web3-onboard/wagmi'
37+
import { parseEther } from 'viem'
38+
import {
39+
sendTransaction as wagmiSendTransaction,
40+
switchChain,
41+
disconnect,
42+
getConnectors
43+
} from '@web3-onboard/wagmi'
44+
import { parseEther, isHex, fromHex } from 'viem'
45+
46+
const injected = injectedModule()
47+
48+
const onboard = Onboard({
49+
// This javascript object is unordered meaning props do not require a certain order
50+
// ... other Onboard options
51+
wagmi,
52+
wallets: [injected],
53+
chains: [
54+
{
55+
id: '0x1',
56+
token: 'ETH',
57+
label: 'Ethereum',
58+
rpcUrl: 'https://mainnet.infura.io/v3/17c1e1500e384acfb6a72c5d2e67742e'
59+
}
60+
]
61+
// ... other Onboard options
62+
})
63+
64+
const sendTransaction = async () => {
65+
// current primary wallet - as multiple wallets can connect this value is the currently active
66+
const [currentPrimaryWallet] = onboard.state.get().wallets
67+
const wagmiConfig = onboard.state.get().wagmiConfig
68+
const result = await wagmiSendTransaction(wagmiConfig, {
69+
to: toAddress,
70+
// desired connector to send txn from
71+
account: currentPrimaryWallet.accounts[0],
72+
value: parseEther('0.001')
73+
})
74+
console.log(result)
75+
}
76+
77+
async function switchWagmiChain(chainId) {
78+
let chainAsNumber
79+
if (isHex(chainId)) {
80+
chainAsNumber = fromHex(chainId, 'number')
81+
} else if (!isHex(chainId) && typeof chainId === 'number') {
82+
chainAsNumber = chainId
83+
} else {
84+
throw new Error('Invalid chainId')
85+
}
86+
const wagmiConfig = onboard.state.get().wagmiConfig
87+
await switchChain(wagmiConfig, { chainId: chainAsNumber })
88+
}
89+
90+
async function disconnectWallet() {
91+
const wagmiConfig = onboard.state.get().wagmiConfig
92+
const disconnectThisWallet = getConnectors(wagmiConfig).find(
93+
(connector) => connector.name === label
94+
)
95+
disconnect(wagmiConfig, { connector: disconnectThisWallet })
96+
}
97+
```

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"devDependencies": {
6464
"prettier": "^2.4.1",
6565
"prettier-plugin-svelte": "^2.4.0",
66-
"typescript": "^4.5.5"
66+
"typescript": "^4.9.4"
6767
},
6868
"peerDependencies": {
6969
"react": "*",

packages/arcana-auth/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/arcana-auth",
3-
"version": "2.0.0",
3+
"version": "2.1.0-alpha.2",
44
"license": "MIT",
55
"description": "Arcana wallet is a built-in, secure Web3 wallet that users can access instantly when logging into an app integrated with the Arcana Auth SDK. It offers a customizable interface that can be branded to match the app's style. Users don't need to generate or manage cryptographic keys or remember passphrases. The wallet uses advanced distributed key generation, giving users full control over their wallets while onboarding Web3 apps using familiar Web2 authentication methods. It is user-friendly, secure, and puts users in control of their Web3 experience.",
66
"private": false,
@@ -13,10 +13,10 @@
1313
"type-check": "tsc --noEmit"
1414
},
1515
"dependencies": {
16-
"@arcana/auth": "^1.0.7",
17-
"@web3-onboard/common": "2.3.3"
16+
"@arcana/auth": "^1.0.10",
17+
"@web3-onboard/common": "2.4.0-alpha.2"
1818
},
1919
"devDependencies": {
20-
"typescript": "^5.1.6"
20+
"typescript": "^5.4.5"
2121
}
2222
}

0 commit comments

Comments
 (0)