Skip to content

Commit 6e2ea6e

Browse files
committed
feat(support set available network list): support set available network list to limit network
1 parent 3fbe249 commit 6e2ea6e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

example/basic-dapp/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,11 @@ async function walletInitialized() {
547547
provider.request({ method: 'cfx_netVersion' }),
548548
provider.request({
549549
method: 'cfx_accounts',
550+
params: [
551+
{
552+
availableNetwork: [1, 1029],
553+
},
554+
],
550555
}),
551556
])
552557

@@ -599,6 +604,11 @@ async function walletInitialized() {
599604
try {
600605
const [connectedAddress] = await provider.request({
601606
method: 'cfx_accounts',
607+
params: [
608+
{
609+
availableNetwork: [1],
610+
},
611+
],
602612
})
603613
const tx = {
604614
from: connectedAddress,

0 commit comments

Comments
 (0)