thirdweb 5.37.1-nightly-26d825bc4f0475523ea761aa18ab979557295c28-20240722000339 → 5.38.1-nightly-5fabe6661399615b393d1055a722b9de59bf19bb-20240724000323
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/adapters/ethers5.js +3 -1
- package/dist/cjs/adapters/ethers5.js.map +1 -1
- package/dist/cjs/chains/chain-definitions/astria-evm-dusknet.js +16 -0
- package/dist/cjs/chains/chain-definitions/astria-evm-dusknet.js.map +1 -0
- package/dist/cjs/chains/chain-definitions/blast-sepolia.js +17 -0
- package/dist/cjs/chains/chain-definitions/blast-sepolia.js.map +1 -0
- package/dist/cjs/chains/chain-definitions/celo.js +20 -0
- package/dist/cjs/chains/chain-definitions/celo.js.map +1 -0
- package/dist/cjs/chains/chain-definitions/cronos.js +20 -0
- package/dist/cjs/chains/chain-definitions/cronos.js.map +1 -0
- package/dist/cjs/chains/chain-definitions/degen.js +15 -0
- package/dist/cjs/chains/chain-definitions/degen.js.map +1 -0
- package/dist/cjs/chains/chain-definitions/fantom-testnet.js +21 -0
- package/dist/cjs/chains/chain-definitions/fantom-testnet.js.map +1 -0
- package/dist/cjs/chains/chain-definitions/fantom.js +20 -0
- package/dist/cjs/chains/chain-definitions/fantom.js.map +1 -0
- package/dist/cjs/chains/chain-definitions/frame-testnet.js +21 -0
- package/dist/cjs/chains/chain-definitions/frame-testnet.js.map +1 -0
- package/dist/cjs/chains/chain-definitions/gnosis-chiado-testnet.js +17 -0
- package/dist/cjs/chains/chain-definitions/gnosis-chiado-testnet.js.map +1 -0
- package/dist/cjs/chains/chain-definitions/gnosis.js +16 -0
- package/dist/cjs/chains/chain-definitions/gnosis.js.map +1 -0
- package/dist/cjs/chains/chain-definitions/god-woken-testnet-v1.js +21 -0
- package/dist/cjs/chains/chain-definitions/god-woken-testnet-v1.js.map +1 -0
- package/dist/cjs/chains/chain-definitions/god-woken.js +20 -0
- package/dist/cjs/chains/chain-definitions/god-woken.js.map +1 -0
- package/dist/cjs/chains/chain-definitions/hokum-testnet.js +21 -0
- package/dist/cjs/chains/chain-definitions/hokum-testnet.js.map +1 -0
- package/dist/cjs/chains/chain-definitions/localhost.js +16 -0
- package/dist/cjs/chains/chain-definitions/localhost.js.map +1 -0
- package/dist/cjs/chains/chain-definitions/loot.js +20 -0
- package/dist/cjs/chains/chain-definitions/loot.js.map +1 -0
- package/dist/cjs/chains/chain-definitions/manta-pacific-testnet.js +17 -0
- package/dist/cjs/chains/chain-definitions/manta-pacific-testnet.js.map +1 -0
- package/dist/cjs/chains/chain-definitions/manta-pacific.js +16 -0
- package/dist/cjs/chains/chain-definitions/manta-pacific.js.map +1 -0
- package/dist/cjs/chains/chain-definitions/moonbeam.js +20 -0
- package/dist/cjs/chains/chain-definitions/moonbeam.js.map +1 -0
- package/dist/cjs/chains/chain-definitions/palm-testnet.js +21 -0
- package/dist/cjs/chains/chain-definitions/palm-testnet.js.map +1 -0
- package/dist/cjs/chains/chain-definitions/palm.js +20 -0
- package/dist/cjs/chains/chain-definitions/palm.js.map +1 -0
- package/dist/cjs/chains/chain-definitions/polygon-zkevm-testnet.js +17 -0
- package/dist/cjs/chains/chain-definitions/polygon-zkevm-testnet.js.map +1 -0
- package/dist/cjs/chains/chain-definitions/polygon-zkevm.js +16 -0
- package/dist/cjs/chains/chain-definitions/polygon-zkevm.js.map +1 -0
- package/dist/cjs/chains/chain-definitions/rari-testnet.js +21 -0
- package/dist/cjs/chains/chain-definitions/rari-testnet.js.map +1 -0
- package/dist/cjs/chains/chain-definitions/rari.js +20 -0
- package/dist/cjs/chains/chain-definitions/rari.js.map +1 -0
- package/dist/cjs/chains/chain-definitions/scroll-alpha-testnet.js +21 -0
- package/dist/cjs/chains/chain-definitions/scroll-alpha-testnet.js.map +1 -0
- package/dist/cjs/chains/chain-definitions/scroll-sepolia-testnet.js +21 -0
- package/dist/cjs/chains/chain-definitions/scroll-sepolia-testnet.js.map +1 -0
- package/dist/cjs/chains/chain-definitions/scroll.js +20 -0
- package/dist/cjs/chains/chain-definitions/scroll.js.map +1 -0
- package/dist/cjs/chains/chain-definitions/xai-sepolia.js +17 -0
- package/dist/cjs/chains/chain-definitions/xai-sepolia.js.map +1 -0
- package/dist/cjs/chains/chain-definitions/xai.js +20 -0
- package/dist/cjs/chains/chain-definitions/xai.js.map +1 -0
- package/dist/cjs/chains/chain-definitions/zk-candy-sepolia.js +21 -0
- package/dist/cjs/chains/chain-definitions/zk-candy-sepolia.js.map +1 -0
- package/dist/cjs/exports/chains.js +62 -1
- package/dist/cjs/exports/chains.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/openOauthSignInWindow.js +4 -1
- package/dist/cjs/react/web/wallets/shared/openOauthSignInWindow.js.map +1 -1
- package/dist/cjs/utils/any-evm/compute-published-contract-deploy-info.js +1 -0
- package/dist/cjs/utils/any-evm/compute-published-contract-deploy-info.js.map +1 -1
- package/dist/cjs/utils/bytecode/resolveImplementation.js +20 -22
- package/dist/cjs/utils/bytecode/resolveImplementation.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/getLoginPath.js +4 -5
- package/dist/cjs/wallets/in-app/core/authentication/getLoginPath.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/type.js +1 -7
- package/dist/cjs/wallets/in-app/core/authentication/type.js.map +1 -1
- package/dist/cjs/wallets/in-app/native/auth/native-auth.js +9 -32
- package/dist/cjs/wallets/in-app/native/auth/native-auth.js.map +1 -1
- package/dist/cjs/wallets/in-app/native/helpers/auth/middleware.js +1 -5
- package/dist/cjs/wallets/in-app/native/helpers/auth/middleware.js.map +1 -1
- package/dist/cjs/wallets/in-app/native/native-connector.js +6 -7
- package/dist/cjs/wallets/in-app/native/native-connector.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/lib/auth/{discord.js → oauth.js} +32 -12
- package/dist/cjs/wallets/in-app/web/lib/auth/oauth.js.map +1 -0
- package/dist/cjs/wallets/in-app/web/lib/web-connector.js +6 -12
- package/dist/cjs/wallets/in-app/web/lib/web-connector.js.map +1 -1
- package/dist/esm/adapters/ethers5.js +3 -1
- package/dist/esm/adapters/ethers5.js.map +1 -1
- package/dist/esm/chains/chain-definitions/astria-evm-dusknet.js +13 -0
- package/dist/esm/chains/chain-definitions/astria-evm-dusknet.js.map +1 -0
- package/dist/esm/chains/chain-definitions/blast-sepolia.js +14 -0
- package/dist/esm/chains/chain-definitions/blast-sepolia.js.map +1 -0
- package/dist/esm/chains/chain-definitions/celo.js +17 -0
- package/dist/esm/chains/chain-definitions/celo.js.map +1 -0
- package/dist/esm/chains/chain-definitions/cronos.js +17 -0
- package/dist/esm/chains/chain-definitions/cronos.js.map +1 -0
- package/dist/esm/chains/chain-definitions/degen.js +12 -0
- package/dist/esm/chains/chain-definitions/degen.js.map +1 -0
- package/dist/esm/chains/chain-definitions/fantom-testnet.js +18 -0
- package/dist/esm/chains/chain-definitions/fantom-testnet.js.map +1 -0
- package/dist/esm/chains/chain-definitions/fantom.js +17 -0
- package/dist/esm/chains/chain-definitions/fantom.js.map +1 -0
- package/dist/esm/chains/chain-definitions/frame-testnet.js +18 -0
- package/dist/esm/chains/chain-definitions/frame-testnet.js.map +1 -0
- package/dist/esm/chains/chain-definitions/gnosis-chiado-testnet.js +14 -0
- package/dist/esm/chains/chain-definitions/gnosis-chiado-testnet.js.map +1 -0
- package/dist/esm/chains/chain-definitions/gnosis.js +13 -0
- package/dist/esm/chains/chain-definitions/gnosis.js.map +1 -0
- package/dist/esm/chains/chain-definitions/god-woken-testnet-v1.js +18 -0
- package/dist/esm/chains/chain-definitions/god-woken-testnet-v1.js.map +1 -0
- package/dist/esm/chains/chain-definitions/god-woken.js +17 -0
- package/dist/esm/chains/chain-definitions/god-woken.js.map +1 -0
- package/dist/esm/chains/chain-definitions/hokum-testnet.js +18 -0
- package/dist/esm/chains/chain-definitions/hokum-testnet.js.map +1 -0
- package/dist/esm/chains/chain-definitions/localhost.js +13 -0
- package/dist/esm/chains/chain-definitions/localhost.js.map +1 -0
- package/dist/esm/chains/chain-definitions/loot.js +17 -0
- package/dist/esm/chains/chain-definitions/loot.js.map +1 -0
- package/dist/esm/chains/chain-definitions/manta-pacific-testnet.js +14 -0
- package/dist/esm/chains/chain-definitions/manta-pacific-testnet.js.map +1 -0
- package/dist/esm/chains/chain-definitions/manta-pacific.js +13 -0
- package/dist/esm/chains/chain-definitions/manta-pacific.js.map +1 -0
- package/dist/esm/chains/chain-definitions/moonbeam.js +17 -0
- package/dist/esm/chains/chain-definitions/moonbeam.js.map +1 -0
- package/dist/esm/chains/chain-definitions/palm-testnet.js +18 -0
- package/dist/esm/chains/chain-definitions/palm-testnet.js.map +1 -0
- package/dist/esm/chains/chain-definitions/palm.js +17 -0
- package/dist/esm/chains/chain-definitions/palm.js.map +1 -0
- package/dist/esm/chains/chain-definitions/polygon-zkevm-testnet.js +14 -0
- package/dist/esm/chains/chain-definitions/polygon-zkevm-testnet.js.map +1 -0
- package/dist/esm/chains/chain-definitions/polygon-zkevm.js +13 -0
- package/dist/esm/chains/chain-definitions/polygon-zkevm.js.map +1 -0
- package/dist/esm/chains/chain-definitions/rari-testnet.js +18 -0
- package/dist/esm/chains/chain-definitions/rari-testnet.js.map +1 -0
- package/dist/esm/chains/chain-definitions/rari.js +17 -0
- package/dist/esm/chains/chain-definitions/rari.js.map +1 -0
- package/dist/esm/chains/chain-definitions/scroll-alpha-testnet.js +18 -0
- package/dist/esm/chains/chain-definitions/scroll-alpha-testnet.js.map +1 -0
- package/dist/esm/chains/chain-definitions/scroll-sepolia-testnet.js +18 -0
- package/dist/esm/chains/chain-definitions/scroll-sepolia-testnet.js.map +1 -0
- package/dist/esm/chains/chain-definitions/scroll.js +17 -0
- package/dist/esm/chains/chain-definitions/scroll.js.map +1 -0
- package/dist/esm/chains/chain-definitions/xai-sepolia.js +14 -0
- package/dist/esm/chains/chain-definitions/xai-sepolia.js.map +1 -0
- package/dist/esm/chains/chain-definitions/xai.js +17 -0
- package/dist/esm/chains/chain-definitions/xai.js.map +1 -0
- package/dist/esm/chains/chain-definitions/zk-candy-sepolia.js +18 -0
- package/dist/esm/chains/chain-definitions/zk-candy-sepolia.js.map +1 -0
- package/dist/esm/exports/chains.js +30 -0
- package/dist/esm/exports/chains.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/openOauthSignInWindow.js +5 -2
- package/dist/esm/react/web/wallets/shared/openOauthSignInWindow.js.map +1 -1
- package/dist/esm/utils/any-evm/compute-published-contract-deploy-info.js +1 -0
- package/dist/esm/utils/any-evm/compute-published-contract-deploy-info.js.map +1 -1
- package/dist/esm/utils/bytecode/resolveImplementation.js +20 -22
- package/dist/esm/utils/bytecode/resolveImplementation.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/wallets/in-app/core/authentication/getLoginPath.js +2 -3
- package/dist/esm/wallets/in-app/core/authentication/getLoginPath.js.map +1 -1
- package/dist/esm/wallets/in-app/core/authentication/type.js +0 -6
- package/dist/esm/wallets/in-app/core/authentication/type.js.map +1 -1
- package/dist/esm/wallets/in-app/native/auth/native-auth.js +11 -34
- package/dist/esm/wallets/in-app/native/auth/native-auth.js.map +1 -1
- package/dist/esm/wallets/in-app/native/helpers/auth/middleware.js +2 -6
- package/dist/esm/wallets/in-app/native/helpers/auth/middleware.js.map +1 -1
- package/dist/esm/wallets/in-app/native/native-connector.js +7 -8
- package/dist/esm/wallets/in-app/native/native-connector.js.map +1 -1
- package/dist/esm/wallets/in-app/web/lib/auth/{discord.js → oauth.js} +27 -9
- package/dist/esm/wallets/in-app/web/lib/auth/oauth.js.map +1 -0
- package/dist/esm/wallets/in-app/web/lib/web-connector.js +7 -13
- package/dist/esm/wallets/in-app/web/lib/web-connector.js.map +1 -1
- package/dist/types/adapters/ethers5.d.ts.map +1 -1
- package/dist/types/chains/chain-definitions/astria-evm-dusknet.d.ts +27 -0
- package/dist/types/chains/chain-definitions/astria-evm-dusknet.d.ts.map +1 -0
- package/dist/types/chains/chain-definitions/blast-sepolia.d.ts +27 -0
- package/dist/types/chains/chain-definitions/blast-sepolia.d.ts.map +1 -0
- package/dist/types/chains/chain-definitions/celo.d.ts +27 -0
- package/dist/types/chains/chain-definitions/celo.d.ts.map +1 -0
- package/dist/types/chains/chain-definitions/cronos.d.ts +27 -0
- package/dist/types/chains/chain-definitions/cronos.d.ts.map +1 -0
- package/dist/types/chains/chain-definitions/degen.d.ts +27 -0
- package/dist/types/chains/chain-definitions/degen.d.ts.map +1 -0
- package/dist/types/chains/chain-definitions/fantom-testnet.d.ts +27 -0
- package/dist/types/chains/chain-definitions/fantom-testnet.d.ts.map +1 -0
- package/dist/types/chains/chain-definitions/fantom.d.ts +27 -0
- package/dist/types/chains/chain-definitions/fantom.d.ts.map +1 -0
- package/dist/types/chains/chain-definitions/frame-testnet.d.ts +27 -0
- package/dist/types/chains/chain-definitions/frame-testnet.d.ts.map +1 -0
- package/dist/types/chains/chain-definitions/gnosis-chiado-testnet.d.ts +27 -0
- package/dist/types/chains/chain-definitions/gnosis-chiado-testnet.d.ts.map +1 -0
- package/dist/types/chains/chain-definitions/gnosis.d.ts +27 -0
- package/dist/types/chains/chain-definitions/gnosis.d.ts.map +1 -0
- package/dist/types/chains/chain-definitions/god-woken-testnet-v1.d.ts +27 -0
- package/dist/types/chains/chain-definitions/god-woken-testnet-v1.d.ts.map +1 -0
- package/dist/types/chains/chain-definitions/god-woken.d.ts +27 -0
- package/dist/types/chains/chain-definitions/god-woken.d.ts.map +1 -0
- package/dist/types/chains/chain-definitions/hokum-testnet.d.ts +27 -0
- package/dist/types/chains/chain-definitions/hokum-testnet.d.ts.map +1 -0
- package/dist/types/chains/chain-definitions/localhost.d.ts +27 -0
- package/dist/types/chains/chain-definitions/localhost.d.ts.map +1 -0
- package/dist/types/chains/chain-definitions/loot.d.ts +27 -0
- package/dist/types/chains/chain-definitions/loot.d.ts.map +1 -0
- package/dist/types/chains/chain-definitions/manta-pacific-testnet.d.ts +27 -0
- package/dist/types/chains/chain-definitions/manta-pacific-testnet.d.ts.map +1 -0
- package/dist/types/chains/chain-definitions/manta-pacific.d.ts +27 -0
- package/dist/types/chains/chain-definitions/manta-pacific.d.ts.map +1 -0
- package/dist/types/chains/chain-definitions/moonbeam.d.ts +27 -0
- package/dist/types/chains/chain-definitions/moonbeam.d.ts.map +1 -0
- package/dist/types/chains/chain-definitions/palm-testnet.d.ts +27 -0
- package/dist/types/chains/chain-definitions/palm-testnet.d.ts.map +1 -0
- package/dist/types/chains/chain-definitions/palm.d.ts +27 -0
- package/dist/types/chains/chain-definitions/palm.d.ts.map +1 -0
- package/dist/types/chains/chain-definitions/polygon-zkevm-testnet.d.ts +27 -0
- package/dist/types/chains/chain-definitions/polygon-zkevm-testnet.d.ts.map +1 -0
- package/dist/types/chains/chain-definitions/polygon-zkevm.d.ts +27 -0
- package/dist/types/chains/chain-definitions/polygon-zkevm.d.ts.map +1 -0
- package/dist/types/chains/chain-definitions/rari-testnet.d.ts +27 -0
- package/dist/types/chains/chain-definitions/rari-testnet.d.ts.map +1 -0
- package/dist/types/chains/chain-definitions/rari.d.ts +27 -0
- package/dist/types/chains/chain-definitions/rari.d.ts.map +1 -0
- package/dist/types/chains/chain-definitions/scroll-alpha-testnet.d.ts +27 -0
- package/dist/types/chains/chain-definitions/scroll-alpha-testnet.d.ts.map +1 -0
- package/dist/types/chains/chain-definitions/scroll-sepolia-testnet.d.ts +27 -0
- package/dist/types/chains/chain-definitions/scroll-sepolia-testnet.d.ts.map +1 -0
- package/dist/types/chains/chain-definitions/scroll.d.ts +27 -0
- package/dist/types/chains/chain-definitions/scroll.d.ts.map +1 -0
- package/dist/types/chains/chain-definitions/xai-sepolia.d.ts +27 -0
- package/dist/types/chains/chain-definitions/xai-sepolia.d.ts.map +1 -0
- package/dist/types/chains/chain-definitions/xai.d.ts +27 -0
- package/dist/types/chains/chain-definitions/xai.d.ts.map +1 -0
- package/dist/types/chains/chain-definitions/zk-candy-sepolia.d.ts +27 -0
- package/dist/types/chains/chain-definitions/zk-candy-sepolia.d.ts.map +1 -0
- package/dist/types/exports/chains.d.ts +30 -0
- package/dist/types/exports/chains.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/openOauthSignInWindow.d.ts.map +1 -1
- package/dist/types/utils/any-evm/compute-published-contract-deploy-info.d.ts.map +1 -1
- package/dist/types/utils/bytecode/resolveImplementation.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/wallets/in-app/core/authentication/getLoginPath.d.ts +2 -1
- package/dist/types/wallets/in-app/core/authentication/getLoginPath.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/authentication/type.d.ts +1 -2
- package/dist/types/wallets/in-app/core/authentication/type.d.ts.map +1 -1
- package/dist/types/wallets/in-app/native/auth/native-auth.d.ts +1 -1
- package/dist/types/wallets/in-app/native/auth/native-auth.d.ts.map +1 -1
- package/dist/types/wallets/in-app/native/helpers/auth/middleware.d.ts.map +1 -1
- package/dist/types/wallets/in-app/native/native-connector.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/lib/auth/{discord.d.ts → oauth.d.ts} +6 -3
- package/dist/types/wallets/in-app/web/lib/auth/oauth.d.ts.map +1 -0
- package/dist/types/wallets/in-app/web/lib/web-connector.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/adapters/ethers5.ts +4 -1
- package/src/chains/chain-definitions/astria-evm-dusknet.ts +13 -0
- package/src/chains/chain-definitions/blast-sepolia.ts +14 -0
- package/src/chains/chain-definitions/celo.ts +17 -0
- package/src/chains/chain-definitions/cronos.ts +17 -0
- package/src/chains/chain-definitions/degen.ts +12 -0
- package/src/chains/chain-definitions/fantom-testnet.ts +18 -0
- package/src/chains/chain-definitions/fantom.ts +17 -0
- package/src/chains/chain-definitions/frame-testnet.ts +18 -0
- package/src/chains/chain-definitions/gnosis-chiado-testnet.ts +14 -0
- package/src/chains/chain-definitions/gnosis.ts +13 -0
- package/src/chains/chain-definitions/god-woken-testnet-v1.ts +18 -0
- package/src/chains/chain-definitions/god-woken.ts +17 -0
- package/src/chains/chain-definitions/hokum-testnet.ts +18 -0
- package/src/chains/chain-definitions/localhost.ts +13 -0
- package/src/chains/chain-definitions/loot.ts +17 -0
- package/src/chains/chain-definitions/manta-pacific-testnet.ts +14 -0
- package/src/chains/chain-definitions/manta-pacific.ts +13 -0
- package/src/chains/chain-definitions/moonbeam.ts +17 -0
- package/src/chains/chain-definitions/palm-testnet.ts +18 -0
- package/src/chains/chain-definitions/palm.ts +17 -0
- package/src/chains/chain-definitions/polygon-zkevm-testnet.ts +14 -0
- package/src/chains/chain-definitions/polygon-zkevm.ts +13 -0
- package/src/chains/chain-definitions/rari-testnet.ts +18 -0
- package/src/chains/chain-definitions/rari.ts +17 -0
- package/src/chains/chain-definitions/scroll-alpha-testnet.ts +18 -0
- package/src/chains/chain-definitions/scroll-sepolia-testnet.ts +18 -0
- package/src/chains/chain-definitions/scroll.ts +17 -0
- package/src/chains/chain-definitions/xai-sepolia.ts +14 -0
- package/src/chains/chain-definitions/xai.ts +17 -0
- package/src/chains/chain-definitions/zk-candy-sepolia.ts +18 -0
- package/src/exports/chains.ts +31 -0
- package/src/react/web/wallets/shared/openOauthSignInWindow.ts +5 -2
- package/src/utils/any-evm/compute-published-contract-deploy-info.ts +1 -0
- package/src/utils/bytecode/resolveImplementation.test.ts +53 -0
- package/src/utils/bytecode/resolveImplementation.ts +23 -24
- package/src/version.ts +1 -1
- package/src/wallets/in-app/core/authentication/getLoginPath.ts +4 -3
- package/src/wallets/in-app/core/authentication/type.ts +1 -11
- package/src/wallets/in-app/native/auth/native-auth.ts +10 -47
- package/src/wallets/in-app/native/helpers/auth/middleware.ts +2 -9
- package/src/wallets/in-app/native/native-connector.ts +6 -19
- package/src/wallets/in-app/web/lib/auth/{discord.ts → oauth.ts} +46 -10
- package/src/wallets/in-app/web/lib/web-connector.ts +6 -13
- package/dist/cjs/wallets/in-app/web/lib/auth/discord.js.map +0 -1
- package/dist/cjs/wallets/in-app/web/lib/auth/utils.js +0 -18
- package/dist/cjs/wallets/in-app/web/lib/auth/utils.js.map +0 -1
- package/dist/esm/wallets/in-app/web/lib/auth/discord.js.map +0 -1
- package/dist/esm/wallets/in-app/web/lib/auth/utils.js +0 -14
- package/dist/esm/wallets/in-app/web/lib/auth/utils.js.map +0 -1
- package/dist/types/wallets/in-app/web/lib/auth/discord.d.ts.map +0 -1
- package/dist/types/wallets/in-app/web/lib/auth/utils.d.ts +0 -6
- package/dist/types/wallets/in-app/web/lib/auth/utils.d.ts.map +0 -1
- package/src/wallets/in-app/web/lib/auth/utils.ts +0 -19
@@ -0,0 +1,17 @@
|
|
1
|
+
import { defineChain } from "../utils.js";
|
2
|
+
|
3
|
+
export const palm = /* @__PURE__ */ defineChain({
|
4
|
+
id: 11297108109,
|
5
|
+
name: "Palm",
|
6
|
+
nativeCurrency: {
|
7
|
+
name: "PALM",
|
8
|
+
symbol: "PALM",
|
9
|
+
decimals: 18,
|
10
|
+
},
|
11
|
+
blockExplorers: [
|
12
|
+
{
|
13
|
+
name: "Chainlens",
|
14
|
+
url: "https://palm.chainlens.com",
|
15
|
+
},
|
16
|
+
],
|
17
|
+
});
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { defineChain } from "../utils.js";
|
2
|
+
|
3
|
+
export const polygonZkEvmTestnet = /*@__PURE__*/ defineChain({
|
4
|
+
id: 1442,
|
5
|
+
name: "Polygon zkEVM Testnet",
|
6
|
+
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
|
7
|
+
blockExplorers: [
|
8
|
+
{
|
9
|
+
name: "Polygon zkEVM explorer",
|
10
|
+
url: "https://explorer.public.zkevm-test.net",
|
11
|
+
},
|
12
|
+
],
|
13
|
+
testnet: true,
|
14
|
+
});
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { defineChain } from "../utils.js";
|
2
|
+
|
3
|
+
export const polygonZkEvm = /*@__PURE__*/ defineChain({
|
4
|
+
id: 1101,
|
5
|
+
name: "Polygon zkEVM",
|
6
|
+
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
|
7
|
+
blockExplorers: [
|
8
|
+
{
|
9
|
+
name: "blockscout",
|
10
|
+
url: "https://zkevm.polygonscan.com",
|
11
|
+
},
|
12
|
+
],
|
13
|
+
});
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { defineChain } from "../utils.js";
|
2
|
+
|
3
|
+
export const rariTestnet = /*@__PURE__*/ defineChain({
|
4
|
+
id: 1918988905,
|
5
|
+
name: "RARIchain Testnet",
|
6
|
+
nativeCurrency: {
|
7
|
+
name: "Ether",
|
8
|
+
symbol: "ETH",
|
9
|
+
decimals: 18,
|
10
|
+
},
|
11
|
+
blockExplorers: [
|
12
|
+
{
|
13
|
+
name: "rarichain-testnet-explorer",
|
14
|
+
url: "https://explorer.rarichain.org",
|
15
|
+
},
|
16
|
+
],
|
17
|
+
testnet: true,
|
18
|
+
});
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { defineChain } from "../utils.js";
|
2
|
+
|
3
|
+
export const rari = /* @__PURE__ */ defineChain({
|
4
|
+
id: 1380012617,
|
5
|
+
name: "Rarichain",
|
6
|
+
nativeCurrency: {
|
7
|
+
name: "Ether",
|
8
|
+
symbol: "ETH",
|
9
|
+
decimals: 18,
|
10
|
+
},
|
11
|
+
blockExplorers: [
|
12
|
+
{
|
13
|
+
name: "rarichain-explorer",
|
14
|
+
url: "https://mainnet.explorer.rarichain.org",
|
15
|
+
},
|
16
|
+
],
|
17
|
+
});
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { defineChain } from "../utils.js";
|
2
|
+
|
3
|
+
export const scrollAlphaTestnet = /*@__PURE__*/ defineChain({
|
4
|
+
id: 534353,
|
5
|
+
name: "Scroll Alpha Testnet",
|
6
|
+
nativeCurrency: {
|
7
|
+
name: "Ether",
|
8
|
+
symbol: "ETH",
|
9
|
+
decimals: 18,
|
10
|
+
},
|
11
|
+
blockExplorers: [
|
12
|
+
{
|
13
|
+
name: "Scroll Alpha Testnet Block Explorer",
|
14
|
+
url: "https://alpha-blockscout.scroll.io",
|
15
|
+
},
|
16
|
+
],
|
17
|
+
testnet: true,
|
18
|
+
});
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { defineChain } from "../utils.js";
|
2
|
+
|
3
|
+
export const scrollSepoliaTestnet = /*@__PURE__*/ defineChain({
|
4
|
+
id: 534353,
|
5
|
+
name: "Scroll Sepolia Testnet",
|
6
|
+
nativeCurrency: {
|
7
|
+
name: "Ether",
|
8
|
+
symbol: "ETH",
|
9
|
+
decimals: 18,
|
10
|
+
},
|
11
|
+
blockExplorers: [
|
12
|
+
{
|
13
|
+
name: "Scroll Sepolia Etherscan",
|
14
|
+
url: "https://sepolia.scrollscan.com",
|
15
|
+
},
|
16
|
+
],
|
17
|
+
testnet: true,
|
18
|
+
});
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { defineChain } from "../utils.js";
|
2
|
+
|
3
|
+
export const scroll = /*@__PURE__*/ defineChain({
|
4
|
+
id: 534352,
|
5
|
+
name: "Scroll",
|
6
|
+
nativeCurrency: {
|
7
|
+
name: "Ether",
|
8
|
+
symbol: "ETH",
|
9
|
+
decimals: 18,
|
10
|
+
},
|
11
|
+
blockExplorers: [
|
12
|
+
{
|
13
|
+
name: "Scrollscan",
|
14
|
+
url: "https://scrollscan.com",
|
15
|
+
},
|
16
|
+
],
|
17
|
+
});
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { defineChain } from "../utils.js";
|
2
|
+
|
3
|
+
export const xaiSepolia = /* @__PURE__ */ defineChain({
|
4
|
+
id: 37714555429,
|
5
|
+
name: "Xai Sepolia",
|
6
|
+
nativeCurrency: { name: "sXAI", symbol: "sXAI", decimals: 18 },
|
7
|
+
blockExplorers: [
|
8
|
+
{
|
9
|
+
name: "Blockscout",
|
10
|
+
url: "https://testnet-explorer-v2.xai-chain.net",
|
11
|
+
},
|
12
|
+
],
|
13
|
+
testnet: true,
|
14
|
+
});
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { defineChain } from "../utils.js";
|
2
|
+
|
3
|
+
export const xai = /*@__PURE__*/ defineChain({
|
4
|
+
id: 660279,
|
5
|
+
name: "Xai Mainnet",
|
6
|
+
nativeCurrency: {
|
7
|
+
decimals: 18,
|
8
|
+
name: "XAI token",
|
9
|
+
symbol: "XAI",
|
10
|
+
},
|
11
|
+
blockExplorers: [
|
12
|
+
{
|
13
|
+
name: "Blockscout",
|
14
|
+
url: "https://explorer.xai-chain.net",
|
15
|
+
},
|
16
|
+
],
|
17
|
+
});
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { defineChain } from "../utils.js";
|
2
|
+
|
3
|
+
export const zkCandySepolia = /*@__PURE__*/ defineChain({
|
4
|
+
id: 302,
|
5
|
+
name: "zkCandy Sepolia Testnet",
|
6
|
+
nativeCurrency: {
|
7
|
+
decimals: 18,
|
8
|
+
name: "Ether",
|
9
|
+
symbol: "ETH",
|
10
|
+
},
|
11
|
+
blockExplorers: [
|
12
|
+
{
|
13
|
+
name: "zkCandy Block Explorer",
|
14
|
+
url: "https://sepolia.explorer.zkcandy.io",
|
15
|
+
},
|
16
|
+
],
|
17
|
+
testnet: true,
|
18
|
+
});
|
package/src/exports/chains.ts
CHANGED
@@ -26,6 +26,22 @@ export { optimismSepolia } from "../chains/chain-definitions/optimism-sepolia.js
|
|
26
26
|
export { optimism } from "../chains/chain-definitions/optimism.js";
|
27
27
|
export { lineaSepolia } from "../chains/chain-definitions/linea-sepolia.js";
|
28
28
|
export { linea } from "../chains/chain-definitions/linea.js";
|
29
|
+
export { astriaEvmDusknet } from "../chains/chain-definitions/astria-evm-dusknet.js";
|
30
|
+
export { fantom } from "../chains/chain-definitions/fantom.js";
|
31
|
+
export { polygonZkEvm } from "../chains/chain-definitions/polygon-zkevm.js";
|
32
|
+
export { gnosis } from "../chains/chain-definitions/gnosis.js";
|
33
|
+
export { mantaPacific } from "../chains/chain-definitions/manta-pacific.js";
|
34
|
+
export { xai } from "../chains/chain-definitions/xai.js";
|
35
|
+
export { celo } from "../chains/chain-definitions/celo.js";
|
36
|
+
export { cronos } from "../chains/chain-definitions/cronos.js";
|
37
|
+
export { degen } from "../chains/chain-definitions/degen.js";
|
38
|
+
export { scroll } from "../chains/chain-definitions/scroll.js";
|
39
|
+
export { moonbeam } from "../chains/chain-definitions/moonbeam.js";
|
40
|
+
export { loot } from "../chains/chain-definitions/loot.js";
|
41
|
+
export { palm } from "../chains/chain-definitions/palm.js";
|
42
|
+
export { rari } from "../chains/chain-definitions/rari.js";
|
43
|
+
export { godWoken } from "../chains/chain-definitions/god-woken.js";
|
44
|
+
|
29
45
|
// mumbai = alias for polygonMumbai
|
30
46
|
export {
|
31
47
|
polygonMumbai,
|
@@ -40,3 +56,18 @@ export { bsc } from "../chains/chain-definitions/bsc.js";
|
|
40
56
|
export { bscTestnet } from "../chains/chain-definitions/bsc-testnet.js";
|
41
57
|
export { zkSync } from "../chains/chain-definitions/zksync.js";
|
42
58
|
export { zkSyncSepolia } from "../chains/chain-definitions/zksync-sepolia.js";
|
59
|
+
export { localhost } from "../chains/chain-definitions/localhost.js";
|
60
|
+
export { zkCandySepolia } from "../chains/chain-definitions/zk-candy-sepolia.js";
|
61
|
+
export { fantomTestnet } from "../chains/chain-definitions/fantom-testnet.js";
|
62
|
+
export { polygonZkEvmTestnet } from "../chains/chain-definitions/polygon-zkevm-testnet.js";
|
63
|
+
export { gnosisChiadoTestnet } from "../chains/chain-definitions/gnosis-chiado-testnet.js";
|
64
|
+
export { blastSepolia } from "../chains/chain-definitions/blast-sepolia.js";
|
65
|
+
export { mantaPacificTestnet } from "../chains/chain-definitions/manta-pacific-testnet.js";
|
66
|
+
export { xaiSepolia } from "../chains/chain-definitions/xai-sepolia.js";
|
67
|
+
export { scrollAlphaTestnet } from "../chains/chain-definitions/scroll-alpha-testnet.js";
|
68
|
+
export { scrollSepoliaTestnet } from "../chains/chain-definitions/scroll-sepolia-testnet.js";
|
69
|
+
export { palmTestnet } from "../chains/chain-definitions/palm-testnet.js";
|
70
|
+
export { rariTestnet } from "../chains/chain-definitions/rari-testnet.js";
|
71
|
+
export { frameTestnet } from "../chains/chain-definitions/frame-testnet.js";
|
72
|
+
export { hokumTestnet } from "../chains/chain-definitions/hokum-testnet.js";
|
73
|
+
export { godWokenTestnetV1 } from "../chains/chain-definitions/god-woken-testnet-v1.js";
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { ThirdwebClient } from "../../../../client/client.js";
|
2
|
-
import {
|
2
|
+
import { getSocialAuthLoginPath } from "../../../../wallets/in-app/core/authentication/getLoginPath.js";
|
3
3
|
import type { InAppWalletSocialAuth } from "../../../../wallets/in-app/core/wallet/types.js";
|
4
4
|
import type { Ecosystem } from "../../../../wallets/in-app/web/types.js";
|
5
5
|
import type { Theme } from "../../../core/design-system/index.js";
|
@@ -30,8 +30,11 @@ function getOauthLoginPath(
|
|
30
30
|
ecosystem?: Ecosystem,
|
31
31
|
) {
|
32
32
|
switch (authOption) {
|
33
|
+
case "apple":
|
34
|
+
case "facebook":
|
35
|
+
case "google":
|
33
36
|
case "discord":
|
34
|
-
return
|
37
|
+
return getSocialAuthLoginPath(authOption, client, ecosystem);
|
35
38
|
default:
|
36
39
|
return "";
|
37
40
|
}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import type { AbiConstructor } from "abitype";
|
2
|
+
import { describe, expect, it } from "vitest";
|
3
|
+
import {
|
4
|
+
DUMMY_BYTECODE,
|
5
|
+
ERC1967_PROXY_BYTECODE,
|
6
|
+
ERC1967_PROXY_CONSTRUCTOR_ABI,
|
7
|
+
} from "../../../test/src/abis/proxy.js";
|
8
|
+
import { ANVIL_CHAIN } from "../../../test/src/chains.js";
|
9
|
+
import { TEST_CLIENT } from "../../../test/src/test-clients.js";
|
10
|
+
import {
|
11
|
+
NFT_DROP_CONTRACT,
|
12
|
+
NFT_DROP_IMPLEMENTATION,
|
13
|
+
} from "../../../test/src/test-contracts.js";
|
14
|
+
import { TEST_ACCOUNT_A } from "../../../test/src/test-wallets.js";
|
15
|
+
import { getContract } from "../../contract/contract.js";
|
16
|
+
import { deployContract } from "../../contract/deployment/deploy-with-abi.js";
|
17
|
+
import { resolveImplementation } from "./resolveImplementation.js";
|
18
|
+
|
19
|
+
describe("Resolve implementation", async () => {
|
20
|
+
it("should extract implementation address for minimal proxy contract", async () => {
|
21
|
+
const resolved = resolveImplementation(NFT_DROP_CONTRACT);
|
22
|
+
expect((await resolved).address).to.equal(NFT_DROP_IMPLEMENTATION);
|
23
|
+
});
|
24
|
+
|
25
|
+
it("should extract implementation address for ERC1967 proxy contract", async () => {
|
26
|
+
const implementationAddress = await deployContract({
|
27
|
+
client: TEST_CLIENT,
|
28
|
+
chain: ANVIL_CHAIN,
|
29
|
+
account: TEST_ACCOUNT_A,
|
30
|
+
bytecode: DUMMY_BYTECODE,
|
31
|
+
constructorAbi: {} as AbiConstructor,
|
32
|
+
constructorParams: [],
|
33
|
+
});
|
34
|
+
|
35
|
+
const proxyAddress = await deployContract({
|
36
|
+
client: TEST_CLIENT,
|
37
|
+
chain: ANVIL_CHAIN,
|
38
|
+
account: TEST_ACCOUNT_A,
|
39
|
+
bytecode: ERC1967_PROXY_BYTECODE,
|
40
|
+
constructorAbi: ERC1967_PROXY_CONSTRUCTOR_ABI as AbiConstructor,
|
41
|
+
constructorParams: [implementationAddress, ""],
|
42
|
+
});
|
43
|
+
|
44
|
+
const proxy = getContract({
|
45
|
+
chain: ANVIL_CHAIN,
|
46
|
+
address: proxyAddress,
|
47
|
+
client: TEST_CLIENT,
|
48
|
+
});
|
49
|
+
|
50
|
+
const resolved = await resolveImplementation(proxy);
|
51
|
+
expect(resolved.address).to.equal(implementationAddress);
|
52
|
+
});
|
53
|
+
});
|
@@ -42,40 +42,39 @@ export async function resolveImplementation(
|
|
42
42
|
}
|
43
43
|
|
44
44
|
// check other proxy types
|
45
|
+
let implementationAddress: string | undefined;
|
45
46
|
if (beacon && beacon !== AddressZero) {
|
46
47
|
// In case of a BeaconProxy, it is setup as BeaconProxy --> Beacon --> Implementation
|
47
48
|
// Hence we replace the proxy address with Beacon address, and continue further resolving below
|
48
49
|
// biome-ignore lint/style/noParameterAssign: we purposefully mutate the contract object here
|
49
50
|
contract = { ...contract, address: beacon };
|
51
|
+
|
52
|
+
implementationAddress = await getImplementationFromContractCall(contract);
|
53
|
+
} else {
|
54
|
+
implementationAddress = await getImplementationFromStorageSlot(contract);
|
50
55
|
}
|
51
|
-
const implementations = await Promise.all([
|
52
|
-
getImplementationFromStorageSlot(contract),
|
53
|
-
getImplementationFromContractCall(contract),
|
54
|
-
]);
|
55
|
-
// this seems inefficient
|
56
|
-
for (const implementationAddress of implementations) {
|
57
|
-
if (
|
58
|
-
implementationAddress &&
|
59
|
-
isAddress(implementationAddress) &&
|
60
|
-
implementationAddress !== AddressZero
|
61
|
-
) {
|
62
|
-
const implementationBytecode = await getBytecode({
|
63
|
-
...contract,
|
64
|
-
address: implementationAddress,
|
65
|
-
});
|
66
|
-
// return the original contract bytecode if the implementation bytecode is empty
|
67
|
-
if (implementationBytecode === "0x") {
|
68
|
-
return {
|
69
|
-
address: contract.address,
|
70
|
-
bytecode: originalBytecode,
|
71
|
-
};
|
72
|
-
}
|
73
56
|
|
57
|
+
if (
|
58
|
+
implementationAddress &&
|
59
|
+
isAddress(implementationAddress) &&
|
60
|
+
implementationAddress !== AddressZero
|
61
|
+
) {
|
62
|
+
const implementationBytecode = await getBytecode({
|
63
|
+
...contract,
|
64
|
+
address: implementationAddress,
|
65
|
+
});
|
66
|
+
// return the original contract bytecode if the implementation bytecode is empty
|
67
|
+
if (implementationBytecode === "0x") {
|
74
68
|
return {
|
75
|
-
address:
|
76
|
-
bytecode:
|
69
|
+
address: contract.address,
|
70
|
+
bytecode: originalBytecode,
|
77
71
|
};
|
78
72
|
}
|
73
|
+
|
74
|
+
return {
|
75
|
+
address: implementationAddress,
|
76
|
+
bytecode: implementationBytecode,
|
77
|
+
};
|
79
78
|
}
|
80
79
|
|
81
80
|
return { address: contract.address, bytecode: originalBytecode };
|
package/src/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const version = "5.
|
1
|
+
export const version = "5.38.1-nightly-5fabe6661399615b393d1055a722b9de59bf19bb-20240724000323";
|
@@ -1,13 +1,14 @@
|
|
1
1
|
import type { ThirdwebClient } from "../../../../client/client.js";
|
2
2
|
import { getThirdwebBaseUrl } from "../../../../utils/domains.js";
|
3
|
+
import type { SocialAuthOption } from "../../../../wallets/types.js";
|
3
4
|
import type { Ecosystem } from "../../web/types.js";
|
4
5
|
|
5
|
-
|
6
|
-
|
6
|
+
export const getSocialAuthLoginPath = (
|
7
|
+
authOption: SocialAuthOption,
|
7
8
|
client: ThirdwebClient,
|
8
9
|
ecosystem?: Ecosystem,
|
9
10
|
) => {
|
10
|
-
const baseUrl = `${getThirdwebBaseUrl("inAppWallet")}/api/2024-05-05/login
|
11
|
+
const baseUrl = `${getThirdwebBaseUrl("inAppWallet")}/api/2024-05-05/login/${authOption}?clientId=${client.clientId}`;
|
11
12
|
if (ecosystem?.partnerId) {
|
12
13
|
return `${baseUrl}&ecosystemId=${ecosystem.id}&ecosystemPartnerId=${ecosystem.partnerId}`;
|
13
14
|
}
|
@@ -65,7 +65,7 @@ export enum AuthProvider {
|
|
65
65
|
}
|
66
66
|
|
67
67
|
export type OauthOption = {
|
68
|
-
|
68
|
+
strategy: SocialAuthOption;
|
69
69
|
redirectUrl: string;
|
70
70
|
};
|
71
71
|
|
@@ -207,13 +207,3 @@ export type GetUser =
|
|
207
207
|
export type GetAuthenticatedUserParams = {
|
208
208
|
client: ThirdwebClient;
|
209
209
|
};
|
210
|
-
|
211
|
-
export const oauthStrategyToAuthProvider: Record<
|
212
|
-
SocialAuthOption,
|
213
|
-
AuthProvider
|
214
|
-
> = {
|
215
|
-
google: AuthProvider.GOOGLE,
|
216
|
-
facebook: AuthProvider.FACEBOOK,
|
217
|
-
apple: AuthProvider.APPLE,
|
218
|
-
discord: AuthProvider.DISCORD,
|
219
|
-
};
|
@@ -3,7 +3,7 @@ import type { CognitoUser } from "amazon-cognito-identity-js";
|
|
3
3
|
import { Auth } from "aws-amplify";
|
4
4
|
import * as WebBrowser from "expo-web-browser";
|
5
5
|
import type { ThirdwebClient } from "../../../../client/client.js";
|
6
|
-
import {
|
6
|
+
import { getSocialAuthLoginPath } from "../../core/authentication/getLoginPath.js";
|
7
7
|
import {
|
8
8
|
AuthProvider,
|
9
9
|
type AuthStoredTokenWithCookieReturnType,
|
@@ -30,10 +30,8 @@ import {
|
|
30
30
|
preAuth,
|
31
31
|
} from "../helpers/auth/middleware.js";
|
32
32
|
import {
|
33
|
-
DOMAIN_URL_2023,
|
34
33
|
ROUTE_AUTH_ENDPOINT_CALLBACK,
|
35
34
|
ROUTE_AUTH_JWT_CALLBACK,
|
36
|
-
ROUTE_HEADLESS_OAUTH_LOGIN,
|
37
35
|
} from "../helpers/constants.js";
|
38
36
|
import { createErrorMessage } from "../helpers/errors.js";
|
39
37
|
import { isDeviceSharePresentForUser } from "../helpers/storage/local.js";
|
@@ -207,48 +205,14 @@ export async function validateEmailOTP(options: {
|
|
207
205
|
}
|
208
206
|
|
209
207
|
export async function socialLogin(
|
210
|
-
|
208
|
+
auth: OauthOption,
|
211
209
|
client: ThirdwebClient,
|
212
210
|
): Promise<AuthStoredTokenWithCookieReturnType> {
|
213
|
-
const
|
214
|
-
const headlessLoginLinkWithParams = `${ROUTE_HEADLESS_OAUTH_LOGIN}?authProvider=${encodedProvider}&baseUrl=${encodeURIComponent(
|
215
|
-
DOMAIN_URL_2023,
|
216
|
-
)}&platform=${encodeURIComponent("mobile")}`;
|
211
|
+
const loginUrl = `${getSocialAuthLoginPath(auth.strategy, client)}&redirectUrl=${encodeURIComponent(auth.redirectUrl)}`;
|
217
212
|
|
218
|
-
const resp = await fetch(headlessLoginLinkWithParams, {
|
219
|
-
headers: {
|
220
|
-
...getSessionHeaders(),
|
221
|
-
},
|
222
|
-
});
|
223
|
-
|
224
|
-
if (!resp.ok) {
|
225
|
-
const error = await resp.json();
|
226
|
-
throw new Error(`Error getting headless sign in link: ${error.message}`);
|
227
|
-
}
|
228
|
-
|
229
|
-
const json = await resp.json();
|
230
|
-
|
231
|
-
const { platformLoginLink } = json;
|
232
|
-
|
233
|
-
// Temporary fork for discord until we migrate all methods to the new auth flow
|
234
|
-
const loginUrl = (() => {
|
235
|
-
if (oauthOptions.provider === AuthProvider.DISCORD) {
|
236
|
-
return `${getDiscordLoginPath(client)}&redirectUrl=${encodeURIComponent(
|
237
|
-
oauthOptions.redirectUrl,
|
238
|
-
)}`;
|
239
|
-
} else {
|
240
|
-
return `${platformLoginLink}?developerClientId=${encodeURIComponent(
|
241
|
-
client.clientId,
|
242
|
-
)}&platform=${encodeURIComponent("mobile")}&redirectUrl=${encodeURIComponent(
|
243
|
-
oauthOptions.redirectUrl,
|
244
|
-
)}&authOption=${encodedProvider}`;
|
245
|
-
}
|
246
|
-
})();
|
247
|
-
|
248
|
-
// TODO platform specific code should be extracted out
|
249
213
|
const result = await WebBrowser.openAuthSessionAsync(
|
250
214
|
loginUrl,
|
251
|
-
|
215
|
+
auth.redirectUrl,
|
252
216
|
{
|
253
217
|
preferEphemeralSession: false,
|
254
218
|
showTitle: false,
|
@@ -262,19 +226,18 @@ export async function socialLogin(
|
|
262
226
|
}
|
263
227
|
|
264
228
|
if (result.type !== "success") {
|
265
|
-
throw new Error(`Can't sign in with ${
|
229
|
+
throw new Error(`Can't sign in with ${auth.strategy}: ${result}`);
|
266
230
|
}
|
267
231
|
|
268
|
-
const
|
232
|
+
const resultURL = new URL(result.url);
|
233
|
+
const authResult = resultURL.searchParams.get("authResult");
|
234
|
+
const error = resultURL.searchParams.get("error");
|
269
235
|
|
270
|
-
|
271
|
-
if (
|
272
|
-
// assume error
|
273
|
-
const error = decodedUrl.split("?error=")?.[1];
|
236
|
+
// assume error
|
237
|
+
if (error) {
|
274
238
|
throw new Error(`Something went wrong: ${error}`);
|
275
239
|
}
|
276
240
|
|
277
|
-
const authResult = parts[1];
|
278
241
|
if (!authResult) {
|
279
242
|
throw new Error("No auth result found");
|
280
243
|
}
|
@@ -11,10 +11,7 @@ import {
|
|
11
11
|
setWallerUserDetails,
|
12
12
|
} from "../storage/local.js";
|
13
13
|
import { setUpNewUserWallet } from "../wallet/creation.js";
|
14
|
-
import {
|
15
|
-
getCognitoRecoveryPasswordV1,
|
16
|
-
getCognitoRecoveryPasswordV2,
|
17
|
-
} from "../wallet/recoveryCode.js";
|
14
|
+
import { getCognitoRecoveryPasswordV2 } from "../wallet/recoveryCode.js";
|
18
15
|
import { setUpShareForNewDevice } from "../wallet/retrieval.js";
|
19
16
|
|
20
17
|
export async function preAuth(args: {
|
@@ -154,11 +151,7 @@ async function getRecoveryCode(
|
|
154
151
|
return recoveryCode;
|
155
152
|
} else {
|
156
153
|
try {
|
157
|
-
|
158
|
-
const code = await (storedToken.authProvider === AuthProvider.DISCORD
|
159
|
-
? getCognitoRecoveryPasswordV2(client)
|
160
|
-
: getCognitoRecoveryPasswordV1(client));
|
161
|
-
return code;
|
154
|
+
return await getCognitoRecoveryPasswordV2(client);
|
162
155
|
} catch (e) {
|
163
156
|
throw new Error("Something went wrong getting cognito recovery code");
|
164
157
|
}
|
@@ -9,7 +9,6 @@ import {
|
|
9
9
|
type PreAuthArgsType,
|
10
10
|
type SendEmailOtpReturnType,
|
11
11
|
UserWalletStatus,
|
12
|
-
oauthStrategyToAuthProvider,
|
13
12
|
} from "../core/authentication/type.js";
|
14
13
|
import type { InAppConnector } from "../core/interfaces/connector.js";
|
15
14
|
import {
|
@@ -114,9 +113,8 @@ export class InAppNativeConnector implements InAppConnector {
|
|
114
113
|
const ExpoLinking = require("expo-linking");
|
115
114
|
const redirectUrl =
|
116
115
|
params.redirectUrl || (ExpoLinking.createURL("") as string);
|
117
|
-
const oauthProvider = oauthStrategyToAuthProvider[strategy];
|
118
116
|
return this.socialLogin({
|
119
|
-
|
117
|
+
strategy,
|
120
118
|
redirectUrl,
|
121
119
|
});
|
122
120
|
}
|
@@ -181,14 +179,9 @@ export class InAppNativeConnector implements InAppConnector {
|
|
181
179
|
return deleteActiveAccount({ client: this.options.client });
|
182
180
|
}
|
183
181
|
|
184
|
-
private async socialLogin(
|
185
|
-
oauthOption: OauthOption,
|
186
|
-
): Promise<AuthLoginReturnType> {
|
182
|
+
private async socialLogin(auth: OauthOption): Promise<AuthLoginReturnType> {
|
187
183
|
try {
|
188
|
-
const { storedToken } = await socialLogin(
|
189
|
-
oauthOption,
|
190
|
-
this.options.client,
|
191
|
-
);
|
184
|
+
const { storedToken } = await socialLogin(auth, this.options.client);
|
192
185
|
const account = await this.getAccount();
|
193
186
|
return {
|
194
187
|
user: {
|
@@ -199,17 +192,11 @@ export class InAppNativeConnector implements InAppConnector {
|
|
199
192
|
},
|
200
193
|
};
|
201
194
|
} catch (error) {
|
202
|
-
console.error(
|
203
|
-
`Error while signing in with: ${oauthOption.provider}. ${error}`,
|
204
|
-
);
|
195
|
+
console.error(`Error while signing in with: ${auth}. ${error}`);
|
205
196
|
if (error instanceof Error) {
|
206
|
-
throw new Error(
|
207
|
-
`Error signing in with ${oauthOption.provider}: ${error.message}`,
|
208
|
-
);
|
197
|
+
throw new Error(`Error signing in with ${auth}: ${error.message}`);
|
209
198
|
}
|
210
|
-
throw new Error(
|
211
|
-
`An unknown error occurred signing in with ${oauthOption.provider}`,
|
212
|
-
);
|
199
|
+
throw new Error(`An unknown error occurred signing in with ${auth}`);
|
213
200
|
}
|
214
201
|
}
|
215
202
|
|