add bsc network to privy

This commit is contained in:
shialoth 2025-02-13 21:53:43 +05:30
parent b719dc6ffa
commit aa9d6ef719
3 changed files with 71 additions and 116 deletions

View File

@ -2,6 +2,8 @@
import { PrivyProvider } from '@privy-io/react-auth'; import { PrivyProvider } from '@privy-io/react-auth';
import { ReactNode , useEffect } from 'react'; import { ReactNode , useEffect } from 'react';
// Replace this with any of the networks listed at https://github.com/wevm/viem/blob/main/src/chains/index.ts
import {bsc} from 'viem/chains';
export function Providers({ children }: { children: ReactNode }) { export function Providers({ children }: { children: ReactNode }) {
useEffect(() => { useEffect(() => {
@ -33,17 +35,8 @@ export function Providers({ children }: { children: ReactNode }) {
"mfa": { "mfa": {
"noPromptOnMfaRequired": false "noPromptOnMfaRequired": false
}, },
"networkConfigs": { defaultChain: bsc,
defaultNetwork: 56, supportedChains: [bsc]
supportedNetworks: [
{
chainId: 56,
name: 'BNB Smart Chain',
rpcUrl: 'https://bsc-dataseed.binance.org/',
blockExplorerUrl: 'https://bscscan.com'
}
]
}
}} }}
> >
{children} {children}

169
package-lock.json generated
View File

@ -34,7 +34,8 @@
"tailwind-merge": "^2.6.0", "tailwind-merge": "^2.6.0",
"tailwindcss-animate": "^1.0.7", "tailwindcss-animate": "^1.0.7",
"three": "^0.172.0", "three": "^0.172.0",
"uuid": "^11.0.5" "uuid": "^11.0.5",
"viem": "^2.23.2"
}, },
"devDependencies": { "devDependencies": {
"@types/js-cookie": "^3.0.6", "@types/js-cookie": "^3.0.6",
@ -51,7 +52,8 @@
"node_modules/@adraffy/ens-normalize": { "node_modules/@adraffy/ens-normalize": {
"version": "1.11.0", "version": "1.11.0",
"resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.11.0.tgz", "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.11.0.tgz",
"integrity": "sha512-/3DDPKHqqIqxUULp8yP4zODUY1i+2xvVWsv8A79xGWdCAG+8sb0hRh0Rk2QyOJUnnbyPUAZYcpBuRe3nS2OIUg==" "integrity": "sha512-/3DDPKHqqIqxUULp8yP4zODUY1i+2xvVWsv8A79xGWdCAG+8sb0hRh0Rk2QyOJUnnbyPUAZYcpBuRe3nS2OIUg==",
"license": "MIT"
}, },
"node_modules/@ai-sdk/provider": { "node_modules/@ai-sdk/provider": {
"version": "1.0.4", "version": "1.0.4",
@ -1601,11 +1603,12 @@
} }
}, },
"node_modules/@noble/curves": { "node_modules/@noble/curves": {
"version": "1.8.0", "version": "1.8.1",
"resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.8.0.tgz", "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.8.1.tgz",
"integrity": "sha512-j84kjAbzEnQHaSIhRPUmB3/eVXu2k3dKPl2LOrR8fSOIL+89U+7lV117EWHtq/GHM3ReGHM46iRBdZfpc4HRUQ==", "integrity": "sha512-warwspo+UYUPep0Q+vtdVB4Ugn8GGQj8iyB3gnRWsztmUHTI3S1nhdiWNsPUGL0vud7JlRRk1XEu7Lq1KGTnMQ==",
"license": "MIT",
"dependencies": { "dependencies": {
"@noble/hashes": "1.7.0" "@noble/hashes": "1.7.1"
}, },
"engines": { "engines": {
"node": "^14.21.3 || >=16" "node": "^14.21.3 || >=16"
@ -1615,9 +1618,10 @@
} }
}, },
"node_modules/@noble/hashes": { "node_modules/@noble/hashes": {
"version": "1.7.0", "version": "1.7.1",
"resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.7.0.tgz", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.7.1.tgz",
"integrity": "sha512-HXydb0DgzTpDPwbVeDGCG1gIu7X6+AuU6Zl6av/E/KG8LMsvPntvq+w17CHRpKBmN6Ybdrt1eP3k4cj8DJa78w==", "integrity": "sha512-B8XBPsn4vT/KJAGqDzbwztd+6Yte3P4V7iafm24bxgDe/mlRuK6xmWPuCNrKt2vDafZ8MfJLlchDG/vYafQEjQ==",
"license": "MIT",
"engines": { "engines": {
"node": "^14.21.3 || >=16" "node": "^14.21.3 || >=16"
}, },
@ -4330,9 +4334,10 @@
"integrity": "sha512-x+BLw/opaz9LiVyrMsP75nO1Rg0QfrACUYIbVSfGwY/w0DiWIPYYrpte6us//KZXinxFAOJl0+C17L1Vi2vmDw==" "integrity": "sha512-x+BLw/opaz9LiVyrMsP75nO1Rg0QfrACUYIbVSfGwY/w0DiWIPYYrpte6us//KZXinxFAOJl0+C17L1Vi2vmDw=="
}, },
"node_modules/abitype": { "node_modules/abitype": {
"version": "1.0.7", "version": "1.0.8",
"resolved": "https://registry.npmjs.org/abitype/-/abitype-1.0.7.tgz", "resolved": "https://registry.npmjs.org/abitype/-/abitype-1.0.8.tgz",
"integrity": "sha512-ZfYYSktDQUwc2eduYu8C4wOs+RDPmnRYMh7zNfzeMtGGgb0U+6tLGjixUic6mXf5xKKCcgT5Qp6cv39tOARVFw==", "integrity": "sha512-ZeiI6h3GnW06uYDLx0etQtX/p8E24UaHHBj57RSjK7YBFe7iuVn07EDpOeP451D06sF27VOz9JJPlIKJmXgkEg==",
"license": "MIT",
"funding": { "funding": {
"url": "https://github.com/sponsors/wevm" "url": "https://github.com/sponsors/wevm"
}, },
@ -9512,15 +9517,16 @@
} }
}, },
"node_modules/ox": { "node_modules/ox": {
"version": "0.6.0", "version": "0.6.7",
"resolved": "https://registry.npmjs.org/ox/-/ox-0.6.0.tgz", "resolved": "https://registry.npmjs.org/ox/-/ox-0.6.7.tgz",
"integrity": "sha512-blUzTLidvUlshv0O02CnLFqBLidNzPoAZdIth894avUAotTuWziznv6IENv5idRuOSSP3dH8WzcYw84zVdu0Aw==", "integrity": "sha512-17Gk/eFsFRAZ80p5eKqv89a57uXjd3NgIf1CaXojATPBuujVc/fQSVhBeAU9JCRB+k7J50WQAyWTxK19T9GgbA==",
"funding": [ "funding": [
{ {
"type": "github", "type": "github",
"url": "https://github.com/sponsors/wevm" "url": "https://github.com/sponsors/wevm"
} }
], ],
"license": "MIT",
"dependencies": { "dependencies": {
"@adraffy/ens-normalize": "^1.10.1", "@adraffy/ens-normalize": "^1.10.1",
"@noble/curves": "^1.6.0", "@noble/curves": "^1.6.0",
@ -9540,33 +9546,36 @@
} }
}, },
"node_modules/ox/node_modules/@scure/base": { "node_modules/ox/node_modules/@scure/base": {
"version": "1.2.1", "version": "1.2.4",
"resolved": "https://registry.npmjs.org/@scure/base/-/base-1.2.1.tgz", "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.2.4.tgz",
"integrity": "sha512-DGmGtC8Tt63J5GfHgfl5CuAXh96VF/LD8K9Hr/Gv0J2lAoRGlPOMpqMpMbCTOoOJMZCk2Xt+DskdDyn6dEFdzQ==", "integrity": "sha512-5Yy9czTO47mqz+/J8GM6GIId4umdCk1wc1q8rKERQulIoc8VP9pzDcghv10Tl2E7R96ZUx/PhND3ESYUQX8NuQ==",
"license": "MIT",
"funding": { "funding": {
"url": "https://paulmillr.com/funding/" "url": "https://paulmillr.com/funding/"
} }
}, },
"node_modules/ox/node_modules/@scure/bip32": { "node_modules/ox/node_modules/@scure/bip32": {
"version": "1.6.1", "version": "1.6.2",
"resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.6.1.tgz", "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.6.2.tgz",
"integrity": "sha512-jSO+5Ud1E588Y+LFo8TaB8JVPNAZw/lGGao+1SepHDeTs2dFLurdNIAgUuDlwezqEjRjElkCJajVrtrZaBxvaQ==", "integrity": "sha512-t96EPDMbtGgtb7onKKqxRLfE5g05k7uHnHRM2xdE6BP/ZmxaLtPek4J4KfVn/90IQNrU1IOAqMgiDtUdtbe3nw==",
"license": "MIT",
"dependencies": { "dependencies": {
"@noble/curves": "~1.8.0", "@noble/curves": "~1.8.1",
"@noble/hashes": "~1.7.0", "@noble/hashes": "~1.7.1",
"@scure/base": "~1.2.1" "@scure/base": "~1.2.2"
}, },
"funding": { "funding": {
"url": "https://paulmillr.com/funding/" "url": "https://paulmillr.com/funding/"
} }
}, },
"node_modules/ox/node_modules/@scure/bip39": { "node_modules/ox/node_modules/@scure/bip39": {
"version": "1.5.1", "version": "1.5.4",
"resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.5.1.tgz", "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.5.4.tgz",
"integrity": "sha512-GnlufVSP9UdAo/H2Patfv22VTtpNTyfi+I3qCKpvuB5l1KWzEYx+l2TNpBy9Ksh4xTs3Rn06tBlpWCi/1Vz8gw==", "integrity": "sha512-TFM4ni0vKvCfBpohoh+/lY05i9gRbSwXWngAsF4CABQxoaOHijxuaZ2R6cStDQ5CHtHO9aGJTr4ksVJASRRyMA==",
"license": "MIT",
"dependencies": { "dependencies": {
"@noble/hashes": "~1.7.0", "@noble/hashes": "~1.7.1",
"@scure/base": "~1.2.1" "@scure/base": "~1.2.4"
}, },
"funding": { "funding": {
"url": "https://paulmillr.com/funding/" "url": "https://paulmillr.com/funding/"
@ -12110,24 +12119,24 @@
} }
}, },
"node_modules/viem": { "node_modules/viem": {
"version": "2.22.8", "version": "2.23.2",
"resolved": "https://registry.npmjs.org/viem/-/viem-2.22.8.tgz", "resolved": "https://registry.npmjs.org/viem/-/viem-2.23.2.tgz",
"integrity": "sha512-iB3PW/a/qzpYbpjo3R662u6a/zo6piZHez/N/bOC25C79FYXBCs8mQDqwiHk3FYErUhS4KVZLabKV9zGMd+EgQ==", "integrity": "sha512-NVmW/E0c5crMOtbEAqMF0e3NmvQykFXhLOc/CkLIXOlzHSA6KXVz3CYVmaKqBF8/xtjsjHAGjdJN3Ru1kFJLaA==",
"funding": [ "funding": [
{ {
"type": "github", "type": "github",
"url": "https://github.com/sponsors/wevm" "url": "https://github.com/sponsors/wevm"
} }
], ],
"license": "MIT",
"dependencies": { "dependencies": {
"@noble/curves": "1.7.0", "@noble/curves": "1.8.1",
"@noble/hashes": "1.6.1", "@noble/hashes": "1.7.1",
"@scure/bip32": "1.6.0", "@scure/bip32": "1.6.2",
"@scure/bip39": "1.5.0", "@scure/bip39": "1.5.4",
"abitype": "1.0.7", "abitype": "1.0.8",
"isows": "1.0.6", "isows": "1.0.6",
"ox": "0.6.0", "ox": "0.6.7",
"webauthn-p256": "0.0.10",
"ws": "8.18.0" "ws": "8.18.0"
}, },
"peerDependencies": { "peerDependencies": {
@ -12139,70 +12148,37 @@
} }
} }
}, },
"node_modules/viem/node_modules/@noble/curves": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.7.0.tgz",
"integrity": "sha512-UTMhXK9SeDhFJVrHeUJ5uZlI6ajXg10O6Ddocf9S6GjbSBVZsJo88HzKwXznNfGpMTRDyJkqMjNDPYgf0qFWnw==",
"dependencies": {
"@noble/hashes": "1.6.0"
},
"engines": {
"node": "^14.21.3 || >=16"
},
"funding": {
"url": "https://paulmillr.com/funding/"
}
},
"node_modules/viem/node_modules/@noble/curves/node_modules/@noble/hashes": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.6.0.tgz",
"integrity": "sha512-YUULf0Uk4/mAA89w+k3+yUYh6NrEvxZa5T6SY3wlMvE2chHkxFUUIDI8/XW1QSC357iA5pSnqt7XEhvFOqmDyQ==",
"engines": {
"node": "^14.21.3 || >=16"
},
"funding": {
"url": "https://paulmillr.com/funding/"
}
},
"node_modules/viem/node_modules/@noble/hashes": {
"version": "1.6.1",
"resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.6.1.tgz",
"integrity": "sha512-pq5D8h10hHBjyqX+cfBm0i8JUXJ0UhczFc4r74zbuT9XgewFo2E3J1cOaGtdZynILNmQ685YWGzGE1Zv6io50w==",
"engines": {
"node": "^14.21.3 || >=16"
},
"funding": {
"url": "https://paulmillr.com/funding/"
}
},
"node_modules/viem/node_modules/@scure/base": { "node_modules/viem/node_modules/@scure/base": {
"version": "1.2.1", "version": "1.2.4",
"resolved": "https://registry.npmjs.org/@scure/base/-/base-1.2.1.tgz", "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.2.4.tgz",
"integrity": "sha512-DGmGtC8Tt63J5GfHgfl5CuAXh96VF/LD8K9Hr/Gv0J2lAoRGlPOMpqMpMbCTOoOJMZCk2Xt+DskdDyn6dEFdzQ==", "integrity": "sha512-5Yy9czTO47mqz+/J8GM6GIId4umdCk1wc1q8rKERQulIoc8VP9pzDcghv10Tl2E7R96ZUx/PhND3ESYUQX8NuQ==",
"license": "MIT",
"funding": { "funding": {
"url": "https://paulmillr.com/funding/" "url": "https://paulmillr.com/funding/"
} }
}, },
"node_modules/viem/node_modules/@scure/bip32": { "node_modules/viem/node_modules/@scure/bip32": {
"version": "1.6.0", "version": "1.6.2",
"resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.6.0.tgz", "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.6.2.tgz",
"integrity": "sha512-82q1QfklrUUdXJzjuRU7iG7D7XiFx5PHYVS0+oeNKhyDLT7WPqs6pBcM2W5ZdwOwKCwoE1Vy1se+DHjcXwCYnA==", "integrity": "sha512-t96EPDMbtGgtb7onKKqxRLfE5g05k7uHnHRM2xdE6BP/ZmxaLtPek4J4KfVn/90IQNrU1IOAqMgiDtUdtbe3nw==",
"license": "MIT",
"dependencies": { "dependencies": {
"@noble/curves": "~1.7.0", "@noble/curves": "~1.8.1",
"@noble/hashes": "~1.6.0", "@noble/hashes": "~1.7.1",
"@scure/base": "~1.2.1" "@scure/base": "~1.2.2"
}, },
"funding": { "funding": {
"url": "https://paulmillr.com/funding/" "url": "https://paulmillr.com/funding/"
} }
}, },
"node_modules/viem/node_modules/@scure/bip39": { "node_modules/viem/node_modules/@scure/bip39": {
"version": "1.5.0", "version": "1.5.4",
"resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.5.0.tgz", "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.5.4.tgz",
"integrity": "sha512-Dop+ASYhnrwm9+HA/HwXg7j2ZqM6yk2fyLWb5znexjctFY3+E+eU8cIWI0Pql0Qx4hPZCijlGq4OL71g+Uz30A==", "integrity": "sha512-TFM4ni0vKvCfBpohoh+/lY05i9gRbSwXWngAsF4CABQxoaOHijxuaZ2R6cStDQ5CHtHO9aGJTr4ksVJASRRyMA==",
"license": "MIT",
"dependencies": { "dependencies": {
"@noble/hashes": "~1.6.0", "@noble/hashes": "~1.7.1",
"@scure/base": "~1.2.1" "@scure/base": "~1.2.4"
}, },
"funding": { "funding": {
"url": "https://paulmillr.com/funding/" "url": "https://paulmillr.com/funding/"
@ -12456,21 +12432,6 @@
"node": ">=8.0.0" "node": ">=8.0.0"
} }
}, },
"node_modules/webauthn-p256": {
"version": "0.0.10",
"resolved": "https://registry.npmjs.org/webauthn-p256/-/webauthn-p256-0.0.10.tgz",
"integrity": "sha512-EeYD+gmIT80YkSIDb2iWq0lq2zbHo1CxHlQTeJ+KkCILWpVy3zASH3ByD4bopzfk0uCwXxLqKGLqp2W4O28VFA==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/wevm"
}
],
"dependencies": {
"@noble/curves": "^1.4.0",
"@noble/hashes": "^1.4.0"
}
},
"node_modules/webidl-conversions": { "node_modules/webidl-conversions": {
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",

View File

@ -35,7 +35,8 @@
"tailwind-merge": "^2.6.0", "tailwind-merge": "^2.6.0",
"tailwindcss-animate": "^1.0.7", "tailwindcss-animate": "^1.0.7",
"three": "^0.172.0", "three": "^0.172.0",
"uuid": "^11.0.5" "uuid": "^11.0.5",
"viem": "^2.23.2"
}, },
"devDependencies": { "devDependencies": {
"@types/js-cookie": "^3.0.6", "@types/js-cookie": "^3.0.6",