Skip to content

Commit 407a46a

Browse files
committed
integrate in demo app
(cherry picked from commit 83885db)
1 parent 4d47a5c commit 407a46a

File tree

5 files changed

+1605
-2371
lines changed

5 files changed

+1605
-2371
lines changed

packages/demo/package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"webpack-dev-server": "4.7.4"
2525
},
2626
"dependencies": {
27+
"@0xpass/webauthn-signer": "2.0.0",
2728
"@blocto/dappauth": "^2.1.0",
2829
"@safe-global/safe-apps-provider": "^0.18.0",
2930
"@safe-global/safe-apps-sdk": "^8.1.0",
@@ -32,15 +33,14 @@
3233
"@web3-onboard/blocto": "^2.1.1",
3334
"@web3-onboard/capsule": "2.2.0-alpha.1",
3435
"@web3-onboard/cede-store": "^2.3.1",
35-
"@web3-onboard/core": "2.22.1",
3636
"@web3-onboard/coinbase": "^2.4.1",
37+
"@web3-onboard/core": "2.22.1",
3738
"@web3-onboard/dcent": "^2.2.7",
3839
"@web3-onboard/enkrypt": "^2.1.1",
3940
"@web3-onboard/fortmatic": "^2.1.1",
4041
"@web3-onboard/frame": "^2.1.1",
4142
"@web3-onboard/frontier": "^2.1.1",
4243
"@web3-onboard/gas": "^2.2.1",
43-
"@web3-onboard/wagmi": "^2.0.1",
4444
"@web3-onboard/gnosis": "^2.3.1",
4545
"@web3-onboard/infinity-wallet": "^2.1.1",
4646
"@web3-onboard/injected-wallets": "^2.11.1",
@@ -52,6 +52,7 @@
5252
"@web3-onboard/mew-wallet": "^2.1.1",
5353
"@web3-onboard/okx": "2.0.0-alpha.1",
5454
"@web3-onboard/particle-network": "^2.1.1",
55+
"@web3-onboard/passport": "^2.1.1",
5556
"@web3-onboard/phantom": "^2.1.1",
5657
"@web3-onboard/portis": "^2.2.1",
5758
"@web3-onboard/sequence": "^2.1.1",
@@ -62,12 +63,14 @@
6263
"@web3-onboard/trust": "^2.1.1",
6364
"@web3-onboard/uauth": "^2.2.1",
6465
"@web3-onboard/venly": "^2.1.1",
66+
"@web3-onboard/wagmi": "^2.0.1",
6567
"@web3-onboard/walletconnect": "^2.6.1",
6668
"@web3-onboard/web3auth": "^2.4.0-alpha.1",
6769
"@web3-onboard/xdefi": "^2.1.1",
6870
"@web3-onboard/zeal": "^2.1.1",
69-
"@web3-onboard/passport": "^2.1.1",
70-
"@0xpass/webauthn-signer": "2.0.0",
71+
"@web3auth/base": "^8.6.2",
72+
"@web3auth/ethereum-provider": "^8.6.2",
73+
"react": ">=18.2",
7174
"vconsole": "^3.15.1"
7275
},
7376
"license": "MIT",

packages/demo/src/App.svelte

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@
6262
} from '@web3-onboard/wagmi'
6363
import { parseEther, isHex, fromHex } from 'viem'
6464
import passportModule, { Network } from '@web3-onboard/passport'
65+
import { EthereumPrivateKeyProvider } from '@web3auth/ethereum-provider'
66+
import { CHAIN_NAMESPACES } from '@web3auth/base'
6567
import { WebauthnSigner } from '@0xpass/webauthn-signer'
6668
6769
if (window.innerWidth < 700) {
@@ -165,9 +167,27 @@
165167
apiKey: 'pk_test_886ADCAB855632AA'
166168
})
167169
170+
const privateKeyProvider = new EthereumPrivateKeyProvider({
171+
config: {
172+
chainConfig: {
173+
chainId: `0x1`,
174+
rpcTarget: `https://mainnet.infura.io/v3/${infura_key}`,
175+
chainNamespace: CHAIN_NAMESPACES.EIP155,
176+
displayName: "Ethereum Mainnet",
177+
blockExplorerUrl: "https://etherscan.io",
178+
ticker: "ETH",
179+
tickerName: "Ether",
180+
logo: "https://images.toruswallet.io/ethereum.svg"
181+
},
182+
},
183+
});
184+
185+
// must access via http://localhost:8080 to be whitelisted
168186
const web3auth = web3authModule({
169187
clientId:
170-
'DJuUOKvmNnlzy6ruVgeWYWIMKLRyYtjYa9Y10VCeJzWZcygDlrYLyXsBQjpJ2hxlBO9dnl8t9GmAC2qOP5vnIGo'
188+
'BErDmyuxFPtpvM_Isiy8RHNWOWYvkAUehrgmO0rDoe5yr33ixt5s98eT_qePTyRsgpN7SVQwrEUMx7gON0jBDQI',
189+
privateKeyProvider: privateKeyProvider,
190+
web3AuthNetwork: 'sapphire_devnet',
171191
})
172192
173193
const arcanaAuth = arcanaAuthModule({
@@ -570,7 +590,7 @@
570590
await wagmiSignMessage(wagmiConfig, {
571591
message: signMsg,
572592
connector: wagmiConnector
573-
})
593+
}).then(console.log)
574594
// try {
575595
// recoveredAddress = recoverAddress(
576596
// arrayify(hashMessage(signMsg)),

0 commit comments

Comments
 (0)