@b3dotfun/sdk 0.1.70-alpha.2 → 0.1.70-alpha.21
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/README.md +3 -3
- package/constants/chains/b3Chain.js +3 -1
- package/dist/cjs/anyspend/constants/rpc.d.ts +3 -1
- package/dist/cjs/anyspend/constants/rpc.js +6 -2
- package/dist/cjs/anyspend/react/components/AnySpend.d.ts +9 -1
- package/dist/cjs/anyspend/react/components/AnySpend.js +123 -46
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +8 -10
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +15 -3
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +78 -25
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +32 -13
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.js +32 -10
- package/dist/cjs/anyspend/react/components/QRDeposit.d.ts +22 -3
- package/dist/cjs/anyspend/react/components/QRDeposit.js +25 -16
- package/dist/cjs/anyspend/react/components/checkout/CryptoPayPanel.js +18 -11
- package/dist/cjs/anyspend/react/components/common/PureTransferView.d.ts +30 -0
- package/dist/cjs/anyspend/react/components/common/PureTransferView.js +64 -0
- package/dist/cjs/anyspend/react/components/common/TokenBalance.js +4 -5
- package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +3 -3
- package/dist/cjs/anyspend/react/hooks/useSigMint.d.ts +1 -1
- package/dist/cjs/anyspend/utils/address.d.ts +2 -1
- package/dist/cjs/anyspend/utils/address.js +12 -9
- package/dist/cjs/anyspend/utils/chain.d.ts +84 -1
- package/dist/cjs/anyspend/utils/chain.js +73 -3
- package/dist/cjs/anyspend/utils/token.d.ts +2 -0
- package/dist/cjs/anyspend/utils/token.js +15 -1
- package/dist/cjs/app.shared.d.ts +9 -1
- package/dist/cjs/app.shared.js +19 -0
- package/dist/cjs/global-account/app.native.d.ts +1 -1
- package/dist/cjs/global-account/better-auth-client.d.ts +3314 -36
- package/dist/cjs/global-account/better-auth-client.js +28 -3
- package/dist/cjs/global-account/bsmnt.d.ts +2 -2
- package/dist/cjs/global-account/bsmnt.native.d.ts +1 -1
- package/dist/cjs/global-account/client-manager.d.ts +7 -5
- package/dist/cjs/global-account/client-manager.js +51 -4
- package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.js +6 -11
- package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +11 -0
- package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.js +12 -0
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +12 -2
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +25 -3
- package/dist/cjs/global-account/react/components/B3Provider/BetterAuthProvider.js +45 -4
- package/dist/cjs/global-account/react/components/B3Provider/RelayKitProviderWrapper.d.ts +1 -2
- package/dist/cjs/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +11 -5
- package/dist/cjs/global-account/react/components/ManageAccount/ContentTokens.js +23 -15
- package/dist/cjs/global-account/react/components/ManageAccount/NFTContent.js +2 -2
- package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +8 -6
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.js +1 -1
- package/dist/cjs/global-account/react/components/ManageAccount/TokenContent.js +17 -8
- package/dist/cjs/global-account/react/components/Send/Send.js +15 -11
- package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthSignIn.js +3 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +1 -5
- package/dist/cjs/global-account/react/components/SignInWithB3/components/AuthButton.js +2 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.js +1 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/utils/signInUtils.d.ts +3 -2
- package/dist/cjs/global-account/react/components/SignInWithB3/utils/signInUtils.js +3 -3
- package/dist/cjs/global-account/react/components/index.d.ts +1 -1
- package/dist/cjs/global-account/react/components/index.js +3 -3
- package/dist/cjs/global-account/react/hooks/index.d.ts +2 -3
- package/dist/cjs/global-account/react/hooks/index.js +7 -10
- package/dist/cjs/global-account/react/hooks/useAuth.d.ts +5 -4
- package/dist/cjs/global-account/react/hooks/useAuth.js +1 -0
- package/dist/cjs/global-account/react/hooks/useAuthentication.d.ts +3 -2
- package/dist/cjs/global-account/react/hooks/useAuthentication.js +2 -1
- package/dist/cjs/global-account/react/hooks/useBetterAuth.d.ts +1657 -22
- package/dist/cjs/global-account/react/hooks/useBetterAuth.js +7 -7
- package/dist/cjs/global-account/react/hooks/useClient.d.ts +3 -3
- package/dist/cjs/global-account/react/hooks/useFirstEOA.d.ts +4 -7666
- package/dist/cjs/global-account/react/hooks/useFirstEOA.js +1 -0
- package/dist/cjs/global-account/react/hooks/useNativeBalance.js +2 -2
- package/dist/cjs/global-account/react/hooks/usePortfolioBalance.d.ts +15 -0
- package/dist/cjs/global-account/react/hooks/usePortfolioBalance.js +76 -0
- package/dist/cjs/global-account/react/hooks/usePortfolioCollectibles.d.ts +12 -0
- package/dist/cjs/global-account/react/hooks/usePortfolioCollectibles.js +178 -0
- package/dist/cjs/global-account/react/hooks/useSiwe.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/useSiwe.native.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/useTWAuth.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/useUnifiedChainSwitchAndExecute.d.ts +1 -0
- package/dist/cjs/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +37 -27
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +14 -2
- package/dist/cjs/global-account/types/b3-api.types.d.ts +5 -0
- package/dist/cjs/global-account/types/feature-flags.d.ts +5 -5
- package/dist/cjs/notifications/services/api.js +1 -0
- package/dist/cjs/shared/constants/chains/b3Chain.d.ts +30 -54
- package/dist/cjs/shared/constants/chains/b3Chain.js +5 -41
- package/dist/cjs/shared/constants/chains/supported.d.ts +1 -49
- package/dist/cjs/shared/constants/chains/supported.js +8 -36
- package/dist/cjs/shared/constants/index.d.ts +4 -0
- package/dist/cjs/shared/utils/chain-transformers.d.ts +4 -4
- package/dist/cjs/shared/utils/chain-transformers.js +38 -37
- package/dist/cjs/shared/utils/thirdweb-insights.js +2 -2
- package/dist/cjs/shared/utils/upload.d.ts +9 -0
- package/dist/cjs/shared/utils/upload.js +34 -0
- package/dist/cjs/shared/utils/zerionPositions.d.ts +96 -0
- package/dist/cjs/shared/utils/zerionPositions.js +188 -0
- package/dist/esm/anyspend/constants/rpc.d.ts +3 -1
- package/dist/esm/anyspend/constants/rpc.js +5 -1
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +9 -1
- package/dist/esm/anyspend/react/components/AnySpend.js +124 -47
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +9 -11
- package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +15 -3
- package/dist/esm/anyspend/react/components/AnySpendDeposit.js +80 -27
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +33 -14
- package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.js +33 -11
- package/dist/esm/anyspend/react/components/QRDeposit.d.ts +22 -3
- package/dist/esm/anyspend/react/components/QRDeposit.js +27 -18
- package/dist/esm/anyspend/react/components/checkout/CryptoPayPanel.js +21 -14
- package/dist/esm/anyspend/react/components/common/PureTransferView.d.ts +30 -0
- package/dist/esm/anyspend/react/components/common/PureTransferView.js +61 -0
- package/dist/esm/anyspend/react/components/common/TokenBalance.js +6 -7
- package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +3 -3
- package/dist/esm/anyspend/react/hooks/useSigMint.d.ts +1 -1
- package/dist/esm/anyspend/utils/address.d.ts +2 -1
- package/dist/esm/anyspend/utils/address.js +9 -6
- package/dist/esm/anyspend/utils/chain.d.ts +84 -1
- package/dist/esm/anyspend/utils/chain.js +73 -5
- package/dist/esm/anyspend/utils/token.d.ts +2 -0
- package/dist/esm/anyspend/utils/token.js +13 -0
- package/dist/esm/app.shared.d.ts +9 -1
- package/dist/esm/app.shared.js +17 -0
- package/dist/esm/global-account/app.native.d.ts +1 -1
- package/dist/esm/global-account/better-auth-client.d.ts +3314 -36
- package/dist/esm/global-account/better-auth-client.js +27 -4
- package/dist/esm/global-account/bsmnt.d.ts +2 -2
- package/dist/esm/global-account/bsmnt.native.d.ts +1 -1
- package/dist/esm/global-account/client-manager.d.ts +7 -5
- package/dist/esm/global-account/client-manager.js +51 -5
- package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +6 -11
- package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +11 -0
- package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.js +11 -0
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +12 -2
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +26 -4
- package/dist/esm/global-account/react/components/B3Provider/BetterAuthProvider.js +46 -5
- package/dist/esm/global-account/react/components/B3Provider/RelayKitProviderWrapper.d.ts +1 -2
- package/dist/esm/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +11 -5
- package/dist/esm/global-account/react/components/ManageAccount/ContentTokens.js +24 -16
- package/dist/esm/global-account/react/components/ManageAccount/NFTContent.js +3 -3
- package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +9 -7
- package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.js +1 -1
- package/dist/esm/global-account/react/components/ManageAccount/TokenContent.js +18 -9
- package/dist/esm/global-account/react/components/Send/Send.js +16 -12
- package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthSignIn.js +3 -1
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +1 -5
- package/dist/esm/global-account/react/components/SignInWithB3/components/AuthButton.js +2 -1
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.js +1 -0
- package/dist/esm/global-account/react/components/SignInWithB3/utils/signInUtils.d.ts +3 -2
- package/dist/esm/global-account/react/components/SignInWithB3/utils/signInUtils.js +3 -3
- package/dist/esm/global-account/react/components/index.d.ts +1 -1
- package/dist/esm/global-account/react/components/index.js +1 -1
- package/dist/esm/global-account/react/hooks/index.d.ts +2 -3
- package/dist/esm/global-account/react/hooks/index.js +2 -3
- package/dist/esm/global-account/react/hooks/useAuth.d.ts +5 -4
- package/dist/esm/global-account/react/hooks/useAuth.js +1 -0
- package/dist/esm/global-account/react/hooks/useAuthentication.d.ts +3 -2
- package/dist/esm/global-account/react/hooks/useAuthentication.js +2 -1
- package/dist/esm/global-account/react/hooks/useBetterAuth.d.ts +1657 -22
- package/dist/esm/global-account/react/hooks/useBetterAuth.js +8 -8
- package/dist/esm/global-account/react/hooks/useClient.d.ts +3 -3
- package/dist/esm/global-account/react/hooks/useFirstEOA.d.ts +4 -7666
- package/dist/esm/global-account/react/hooks/useFirstEOA.js +1 -0
- package/dist/esm/global-account/react/hooks/useNativeBalance.js +1 -1
- package/dist/esm/global-account/react/hooks/usePortfolioBalance.d.ts +15 -0
- package/dist/esm/global-account/react/hooks/usePortfolioBalance.js +72 -0
- package/dist/esm/global-account/react/hooks/usePortfolioCollectibles.d.ts +12 -0
- package/dist/esm/global-account/react/hooks/usePortfolioCollectibles.js +175 -0
- package/dist/esm/global-account/react/hooks/useSiwe.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/useSiwe.native.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/useTWAuth.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/useUnifiedChainSwitchAndExecute.d.ts +1 -0
- package/dist/esm/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +37 -27
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +14 -2
- package/dist/esm/global-account/types/b3-api.types.d.ts +5 -0
- package/dist/esm/global-account/types/feature-flags.d.ts +5 -5
- package/dist/esm/notifications/services/api.js +1 -0
- package/dist/esm/shared/constants/chains/b3Chain.d.ts +30 -54
- package/dist/esm/shared/constants/chains/b3Chain.js +4 -38
- package/dist/esm/shared/constants/chains/supported.d.ts +1 -49
- package/dist/esm/shared/constants/chains/supported.js +7 -35
- package/dist/esm/shared/constants/index.d.ts +4 -0
- package/dist/esm/shared/utils/chain-transformers.d.ts +4 -4
- package/dist/esm/shared/utils/chain-transformers.js +38 -37
- package/dist/esm/shared/utils/thirdweb-insights.js +2 -2
- package/dist/esm/shared/utils/upload.d.ts +9 -0
- package/dist/esm/shared/utils/upload.js +31 -0
- package/dist/esm/shared/utils/zerionPositions.d.ts +96 -0
- package/dist/esm/shared/utils/zerionPositions.js +180 -0
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/constants/rpc.d.ts +3 -1
- package/dist/types/anyspend/react/components/AnySpend.d.ts +9 -1
- package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +15 -3
- package/dist/types/anyspend/react/components/QRDeposit.d.ts +22 -3
- package/dist/types/anyspend/react/components/common/PureTransferView.d.ts +30 -0
- package/dist/types/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +3 -3
- package/dist/types/anyspend/react/hooks/useSigMint.d.ts +1 -1
- package/dist/types/anyspend/utils/address.d.ts +2 -1
- package/dist/types/anyspend/utils/chain.d.ts +84 -1
- package/dist/types/anyspend/utils/token.d.ts +2 -0
- package/dist/types/app.shared.d.ts +9 -1
- package/dist/types/global-account/app.native.d.ts +1 -1
- package/dist/types/global-account/better-auth-client.d.ts +3314 -36
- package/dist/types/global-account/bsmnt.d.ts +2 -2
- package/dist/types/global-account/bsmnt.native.d.ts +1 -1
- package/dist/types/global-account/client-manager.d.ts +7 -5
- package/dist/types/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +11 -0
- package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +12 -2
- package/dist/types/global-account/react/components/B3Provider/RelayKitProviderWrapper.d.ts +1 -2
- package/dist/types/global-account/react/components/SignInWithB3/utils/signInUtils.d.ts +3 -2
- package/dist/types/global-account/react/components/index.d.ts +1 -1
- package/dist/types/global-account/react/hooks/index.d.ts +2 -3
- package/dist/types/global-account/react/hooks/useAuth.d.ts +5 -4
- package/dist/types/global-account/react/hooks/useAuthentication.d.ts +3 -2
- package/dist/types/global-account/react/hooks/useBetterAuth.d.ts +1657 -22
- package/dist/types/global-account/react/hooks/useClient.d.ts +3 -3
- package/dist/types/global-account/react/hooks/useFirstEOA.d.ts +4 -7666
- package/dist/types/global-account/react/hooks/usePortfolioBalance.d.ts +15 -0
- package/dist/types/global-account/react/hooks/usePortfolioCollectibles.d.ts +12 -0
- package/dist/types/global-account/react/hooks/useSiwe.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useSiwe.native.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useTWAuth.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useUnifiedChainSwitchAndExecute.d.ts +1 -0
- package/dist/types/global-account/react/stores/useModalStore.d.ts +14 -2
- package/dist/types/global-account/types/b3-api.types.d.ts +5 -0
- package/dist/types/global-account/types/feature-flags.d.ts +5 -5
- package/dist/types/shared/constants/chains/b3Chain.d.ts +30 -54
- package/dist/types/shared/constants/chains/supported.d.ts +1 -49
- package/dist/types/shared/constants/index.d.ts +4 -0
- package/dist/types/shared/utils/chain-transformers.d.ts +4 -4
- package/dist/types/shared/utils/upload.d.ts +9 -0
- package/dist/types/shared/utils/zerionPositions.d.ts +96 -0
- package/node_modules/@b3/chain-registry/chains.json +1225 -0
- package/node_modules/@b3/chain-registry/dist/chains.json +1225 -0
- package/node_modules/@b3/chain-registry/dist/index.cjs +1676 -0
- package/node_modules/@b3/chain-registry/dist/index.d.cts +195 -0
- package/node_modules/@b3/chain-registry/dist/index.d.ts +195 -0
- package/node_modules/@b3/chain-registry/dist/index.mjs +1604 -0
- package/node_modules/@b3/chain-registry/dist/src/index.d.ts +193 -0
- package/node_modules/@b3/chain-registry/dist/src/index.js +408 -0
- package/node_modules/@b3/chain-registry/package.json +66 -0
- package/node_modules/@b3/chain-registry/src/index.test.ts +432 -0
- package/node_modules/@b3/chain-registry/src/index.ts +672 -0
- package/package.json +81 -30
- package/src/anyspend/README.md +2 -2
- package/src/anyspend/constants/rpc.ts +5 -2
- package/src/anyspend/docs/components.md +6 -6
- package/src/anyspend/docs/contributing.md +1 -1
- package/src/anyspend/docs/hooks.md +3 -3
- package/src/anyspend/docs/installation.md +2 -2
- package/src/anyspend/react/components/AnySpend.tsx +163 -47
- package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +10 -11
- package/src/anyspend/react/components/AnySpendDeposit.tsx +130 -31
- package/src/anyspend/react/components/AnySpendStakeB3.tsx +55 -14
- package/src/anyspend/react/components/AnySpendStakeB3ExactIn.tsx +55 -11
- package/src/anyspend/react/components/QRDeposit.tsx +101 -22
- package/src/anyspend/react/components/__tests__/QRDeposit.test.tsx +331 -0
- package/src/anyspend/react/components/checkout/CryptoPayPanel.tsx +38 -16
- package/src/anyspend/react/components/common/PureTransferView.tsx +212 -0
- package/src/anyspend/react/components/common/TokenBalance.tsx +10 -7
- package/src/anyspend/react/hooks/useAnyspendQuote.ts +13 -13
- package/src/anyspend/react/hooks/useCreateDepositFirstOrder.ts +4 -4
- package/src/anyspend/services/gas.test.ts +95 -18
- package/src/anyspend/types/api_req_res.ts +10 -5
- package/src/anyspend/utils/__tests__/address.test.ts +39 -0
- package/src/anyspend/utils/__tests__/deprecatedChains.test.ts +44 -0
- package/src/anyspend/utils/__tests__/toRegistryChainId.test.ts +17 -0
- package/src/anyspend/utils/address.ts +8 -6
- package/src/anyspend/utils/chain.ts +79 -3
- package/src/anyspend/utils/token.ts +14 -0
- package/src/app.shared.ts +21 -1
- package/src/global-account/app.native.ts +5 -1
- package/src/global-account/better-auth-client.ts +30 -4
- package/src/global-account/bsmnt.native.ts +5 -1
- package/src/global-account/bsmnt.ts +9 -2
- package/src/global-account/client-manager.ts +74 -9
- package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +6 -11
- package/src/global-account/react/components/B3Provider/B3ConfigProvider.tsx +12 -0
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +40 -4
- package/src/global-account/react/components/B3Provider/BetterAuthProvider.tsx +51 -5
- package/src/global-account/react/components/B3Provider/RelayKitProviderWrapper.tsx +11 -11
- package/src/global-account/react/components/ManageAccount/ContentTokens.tsx +50 -21
- package/src/global-account/react/components/ManageAccount/NFTContent.tsx +5 -3
- package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +10 -6
- package/src/global-account/react/components/ManageAccount/SettingsProfileCard.tsx +1 -1
- package/src/global-account/react/components/ManageAccount/TokenContent.tsx +22 -9
- package/src/global-account/react/components/Send/Send.tsx +39 -15
- package/src/global-account/react/components/SignInWithB3/BetterAuthSignIn.tsx +12 -1
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +1 -4
- package/src/global-account/react/components/SignInWithB3/components/AuthButton.tsx +9 -1
- package/src/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.tsx +1 -0
- package/src/global-account/react/components/SignInWithB3/utils/signInUtils.ts +4 -4
- package/src/global-account/react/components/index.ts +1 -1
- package/src/global-account/react/components/ui/button.tsx +1 -2
- package/src/global-account/react/hooks/__tests__/useUnifiedChainSwitchAndExecute.test.tsx +156 -0
- package/src/global-account/react/hooks/index.ts +2 -3
- package/src/global-account/react/hooks/useAuth.ts +5 -4
- package/src/global-account/react/hooks/useAuthentication.ts +5 -4
- package/src/global-account/react/hooks/useBetterAuth.ts +10 -10
- package/src/global-account/react/hooks/useClient.ts +11 -2
- package/src/global-account/react/hooks/useFirstEOA.tsx +9 -2
- package/src/global-account/react/hooks/useNativeBalance.tsx +1 -1
- package/src/global-account/react/hooks/usePortfolioBalance.ts +89 -0
- package/src/global-account/react/hooks/usePortfolioCollectibles.ts +212 -0
- package/src/global-account/react/hooks/useSiwe.native.tsx +1 -1
- package/src/global-account/react/hooks/useSiwe.tsx +1 -1
- package/src/global-account/react/hooks/useTWAuth.tsx +1 -1
- package/src/global-account/react/hooks/useUnifiedChainSwitchAndExecute.ts +47 -31
- package/src/global-account/react/stores/useModalStore.ts +14 -2
- package/src/global-account/types/b3-api.types.ts +5 -1
- package/src/notifications/services/api.ts +1 -0
- package/src/shared/constants/chains/b3Chain.ts +4 -43
- package/src/shared/constants/chains/supported.ts +9 -48
- package/src/shared/constants/index.ts +8 -0
- package/src/shared/react/hooks/__tests__/useCurrencyConversion.test.ts +54 -43
- package/src/shared/utils/__tests__/zerionPositions.test.ts +248 -0
- package/src/shared/utils/chain-transformers.ts +41 -39
- package/src/shared/utils/thirdweb-insights.ts +2 -2
- package/src/shared/utils/upload.ts +48 -0
- package/src/shared/utils/zerionPositions.ts +247 -0
- package/src/styles/index.css +27 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Privy.d.ts +0 -10
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +0 -46
- package/dist/cjs/global-account/react/hooks/useHandleConnectWithPrivy.d.ts +0 -11
- package/dist/cjs/global-account/react/hooks/useHandleConnectWithPrivy.js +0 -70
- package/dist/cjs/global-account/react/hooks/useSimBalance.d.ts +0 -59
- package/dist/cjs/global-account/react/hooks/useSimBalance.js +0 -98
- package/dist/cjs/global-account/react/hooks/useSimCollectibles.d.ts +0 -45
- package/dist/cjs/global-account/react/hooks/useSimCollectibles.js +0 -190
- package/dist/cjs/global-account/react/utils/simdune.d.ts +0 -7
- package/dist/cjs/global-account/react/utils/simdune.js +0 -21
- package/dist/cjs/global-account/types/chain-networks.d.ts +0 -44
- package/dist/cjs/global-account/types/chain-networks.js +0 -48
- package/dist/cjs/shared/generated/chain-networks.json +0 -684
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Privy.d.ts +0 -10
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +0 -43
- package/dist/esm/global-account/react/hooks/useHandleConnectWithPrivy.d.ts +0 -11
- package/dist/esm/global-account/react/hooks/useHandleConnectWithPrivy.js +0 -67
- package/dist/esm/global-account/react/hooks/useSimBalance.d.ts +0 -59
- package/dist/esm/global-account/react/hooks/useSimBalance.js +0 -93
- package/dist/esm/global-account/react/hooks/useSimCollectibles.d.ts +0 -45
- package/dist/esm/global-account/react/hooks/useSimCollectibles.js +0 -187
- package/dist/esm/global-account/react/utils/simdune.d.ts +0 -7
- package/dist/esm/global-account/react/utils/simdune.js +0 -17
- package/dist/esm/global-account/types/chain-networks.d.ts +0 -44
- package/dist/esm/global-account/types/chain-networks.js +0 -45
- package/dist/esm/shared/generated/chain-networks.json +0 -684
- package/dist/types/global-account/react/components/SignInWithB3/SignInWithB3Privy.d.ts +0 -10
- package/dist/types/global-account/react/hooks/useHandleConnectWithPrivy.d.ts +0 -11
- package/dist/types/global-account/react/hooks/useSimBalance.d.ts +0 -59
- package/dist/types/global-account/react/hooks/useSimCollectibles.d.ts +0 -45
- package/dist/types/global-account/react/utils/simdune.d.ts +0 -7
- package/dist/types/global-account/types/chain-networks.d.ts +0 -44
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Privy.tsx +0 -63
- package/src/global-account/react/hooks/useHandleConnectWithPrivy.tsx +0 -79
- package/src/global-account/react/hooks/useSimBalance.ts +0 -164
- package/src/global-account/react/hooks/useSimCollectibles.ts +0 -238
- package/src/global-account/react/utils/simdune.ts +0 -20
- package/src/global-account/types/chain-networks.ts +0 -54
- package/src/shared/generated/chain-networks.json +0 -684
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type B3TokenBalance } from "@b3dotfun/sdk/shared/utils/zerionPositions";
|
|
2
|
+
/**
|
|
3
|
+
* Holdings for a wallet, optionally narrowed to specific chains.
|
|
4
|
+
*
|
|
5
|
+
* Read `isError` before reading `data`: a failed read and an empty wallet are different facts, and
|
|
6
|
+
* rendering the first as the second tells the user they hold nothing when nobody knows.
|
|
7
|
+
*/
|
|
8
|
+
export declare function usePortfolioBalance(address?: string, chainIds?: number[]): import("@tanstack/react-query").UseQueryResult<B3TokenBalance[], Error>;
|
|
9
|
+
/**
|
|
10
|
+
* One token's balance for a wallet, served from the same per-wallet fetch as {@link usePortfolioBalance}.
|
|
11
|
+
*
|
|
12
|
+
* `tokenAddress` may be a contract address or the chain's native sentinel; matching is
|
|
13
|
+
* case-insensitive because callers pass addresses in whatever casing their source used.
|
|
14
|
+
*/
|
|
15
|
+
export declare function usePortfolioTokenBalance(walletAddress?: string, tokenAddress?: string, chainId?: number): import("@tanstack/react-query").UseQueryResult<B3TokenBalance | undefined, Error>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SimpleHashNFTResponse } from "@b3dotfun/sdk/global-account/types/simplehash.types";
|
|
2
|
+
/**
|
|
3
|
+
* NFTs held by a wallet, in the SimpleHash shape `AccountAssets` already renders.
|
|
4
|
+
*
|
|
5
|
+
* Chain narrowing happens here rather than in the request: the upstream rejects some valid chain
|
|
6
|
+
* slugs outright and fails the whole request when one is present, so asking for a subset can cost
|
|
7
|
+
* you the whole answer.
|
|
8
|
+
*/
|
|
9
|
+
export declare function usePortfolioCollectibles(address?: string, chainIds?: number[], options?: {
|
|
10
|
+
limit?: number;
|
|
11
|
+
filterSpam?: boolean;
|
|
12
|
+
}): import("@tanstack/react-query").UseQueryResult<SimpleHashNFTResponse, Error>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Account } from "thirdweb/wallets";
|
|
2
2
|
export declare function useSiwe(): {
|
|
3
|
-
authenticate: (account: Account, partnerId: string) => Promise<
|
|
3
|
+
authenticate: (account: Account, partnerId: string) => Promise<Record<string, any>>;
|
|
4
4
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Account } from "thirdweb/wallets";
|
|
2
2
|
export declare function useSiwe(): {
|
|
3
|
-
authenticate: (account: Account, partnerId: string) => Promise<
|
|
3
|
+
authenticate: (account: Account, partnerId: string) => Promise<Record<string, any>>;
|
|
4
4
|
};
|
|
@@ -3,5 +3,5 @@ import { Wallet } from "thirdweb/wallets";
|
|
|
3
3
|
* @deprecated Use useAuth() instead
|
|
4
4
|
*/
|
|
5
5
|
export declare function useTWAuth(): {
|
|
6
|
-
authenticate: (wallet: Wallet, partnerId: string) => Promise<
|
|
6
|
+
authenticate: (wallet: Wallet, partnerId: string) => Promise<Record<string, any>>;
|
|
7
7
|
};
|
|
@@ -5,6 +5,7 @@ export interface UnifiedTransactionParams {
|
|
|
5
5
|
}
|
|
6
6
|
export declare function useUnifiedChainSwitchAndExecute(): {
|
|
7
7
|
switchChainAndExecute: (targetChainId: number, params: UnifiedTransactionParams) => Promise<string | undefined>;
|
|
8
|
+
switchChainAndExecuteWithGlobalAccount: (targetChainId: number, params: UnifiedTransactionParams, expectedGlobalAccountAddress?: string) => Promise<string | undefined>;
|
|
8
9
|
switchChainAndExecuteWithEOA: (targetChainId: number, params: UnifiedTransactionParams) => Promise<string | undefined>;
|
|
9
10
|
isSwitchingOrExecuting: boolean;
|
|
10
11
|
isActiveSmartWallet: boolean | undefined;
|
|
@@ -617,8 +617,16 @@ export interface AnySpendDepositModalProps extends BaseModalProps {
|
|
|
617
617
|
destinationTokenAddress: string;
|
|
618
618
|
/** The destination chain ID */
|
|
619
619
|
destinationTokenChainId: number;
|
|
620
|
+
/**
|
|
621
|
+
* When false, the destination token is user-selectable even though a default destination token is
|
|
622
|
+
* provided (the provided destination is used only as the initial/default value). Used by the
|
|
623
|
+
* wallet-funding deposit flow so the user can change the receive token away from the default
|
|
624
|
+
* (Base USDC). Defaults to true (locked destination). Does not affect the QR/pure-transfer path. */
|
|
625
|
+
lockDestinationToken?: boolean;
|
|
620
626
|
/** Callback when deposit succeeds */
|
|
621
627
|
onSuccess?: (amount: string) => void;
|
|
628
|
+
/** Callback when the modal's close control is pressed. */
|
|
629
|
+
onClose?: () => void;
|
|
622
630
|
/** Callback for opening a custom modal (e.g., for special token handling) */
|
|
623
631
|
onOpenCustomModal?: () => void;
|
|
624
632
|
/** Custom footer content */
|
|
@@ -641,8 +649,6 @@ export interface AnySpendDepositModalProps extends BaseModalProps {
|
|
|
641
649
|
showChainSelection?: boolean;
|
|
642
650
|
/** Whether to show the "Fund with Fiat" option in the deposit options list. Defaults to true */
|
|
643
651
|
showFiatOption?: boolean;
|
|
644
|
-
/** Minimum pool size for filtering tokens (default: 1,000,000) */
|
|
645
|
-
minPoolSize?: number;
|
|
646
652
|
/** Custom title for chain selection step */
|
|
647
653
|
chainSelectionTitle?: string;
|
|
648
654
|
/** Custom description for chain selection step */
|
|
@@ -661,6 +667,12 @@ export interface AnySpendDepositModalProps extends BaseModalProps {
|
|
|
661
667
|
classes?: AnySpendAllClasses;
|
|
662
668
|
/** Whether to allow direct transfer without swap */
|
|
663
669
|
allowDirectTransfer?: boolean;
|
|
670
|
+
/**
|
|
671
|
+
* When true, the QR-deposit path is a PURE TRANSFER: the destination token/chain
|
|
672
|
+
* mirror the user's selected source token, so the exact token they send lands in
|
|
673
|
+
* their wallet on the same chain (no swap/bridge).
|
|
674
|
+
*/
|
|
675
|
+
pureTransferOnly?: boolean;
|
|
664
676
|
/** Opaque metadata passed to the order for callbacks (e.g., workflow form data) */
|
|
665
677
|
callbackMetadata?: Record<string, unknown>;
|
|
666
678
|
}
|
|
@@ -3,9 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
type ObjectId = string;
|
|
5
5
|
interface PartnerIds {
|
|
6
|
+
/** @deprecated Privy is no longer used for authentication. This field exists for legacy data compatibility only. */
|
|
6
7
|
privyId?: string;
|
|
7
8
|
thirdwebId?: string;
|
|
8
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Privy is no longer used for authentication. This type exists for legacy data compatibility only.
|
|
12
|
+
*/
|
|
9
13
|
interface PrivyLinkedAccount {
|
|
10
14
|
type: string;
|
|
11
15
|
address?: string;
|
|
@@ -45,6 +49,7 @@ interface User {
|
|
|
45
49
|
createdAt: number;
|
|
46
50
|
updatedAt: number;
|
|
47
51
|
partnerIds: PartnerIds;
|
|
52
|
+
/** @deprecated Privy is no longer used for authentication. This field exists for legacy data compatibility only. */
|
|
48
53
|
privyLinkedAccounts?: PrivyLinkedAccount[];
|
|
49
54
|
twProfiles?: TWProfile[];
|
|
50
55
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Static } from "@feathersjs/typebox";
|
|
2
|
-
export declare const featureFlagsSchema: import("@
|
|
3
|
-
_id: import("@
|
|
4
|
-
id: import("@
|
|
5
|
-
enabled: import("@
|
|
6
|
-
description: import("@
|
|
2
|
+
export declare const featureFlagsSchema: import("@sinclair/typebox").TObject<{
|
|
3
|
+
_id: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TObject<{}>]>;
|
|
4
|
+
id: import("@sinclair/typebox").TString<string>;
|
|
5
|
+
enabled: import("@sinclair/typebox").TBoolean;
|
|
6
|
+
description: import("@sinclair/typebox").TString<string>;
|
|
7
7
|
}>;
|
|
8
8
|
export type FeatureFlags = Static<typeof featureFlagsSchema>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ChainNetworks } from "@b3dotfun/sdk/global-account/types/chain-networks";
|
|
2
1
|
import { Chain as ThirdwebChain } from "thirdweb";
|
|
3
2
|
import { Chain } from "viem";
|
|
4
3
|
export declare const nullAddress = "0x0000000000000000000000000000000000000000";
|
|
@@ -33,17 +32,29 @@ export declare const b3Mainnet: {
|
|
|
33
32
|
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
34
33
|
rpcUrls: {
|
|
35
34
|
readonly default: {
|
|
36
|
-
readonly http: readonly ["https://
|
|
37
|
-
readonly ws: readonly ["wss://
|
|
35
|
+
readonly http: readonly ["https://mainnet-rpc.b3.fun"];
|
|
36
|
+
readonly ws: readonly ["wss://mainnet-rpc.b3.fun/ws"];
|
|
38
37
|
};
|
|
39
38
|
};
|
|
40
39
|
sourceId?: number | undefined | undefined;
|
|
40
|
+
supportsTransactionReplacementDetection?: boolean | undefined | undefined;
|
|
41
41
|
testnet?: boolean | undefined | undefined;
|
|
42
42
|
custom?: Record<string, unknown> | undefined;
|
|
43
|
+
extendSchema?: Record<string, unknown> | undefined;
|
|
43
44
|
fees?: import("viem").ChainFees<undefined> | undefined;
|
|
44
45
|
formatters?: undefined;
|
|
46
|
+
prepareTransactionRequest?: ((args: import("viem").PrepareTransactionRequestParameters, options: {
|
|
47
|
+
client: import("viem").Client;
|
|
48
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
49
|
+
}) => Promise<import("viem").PrepareTransactionRequestParameters>) | [fn: ((args: import("viem").PrepareTransactionRequestParameters, options: {
|
|
50
|
+
client: import("viem").Client;
|
|
51
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
52
|
+
}) => Promise<import("viem").PrepareTransactionRequestParameters>) | undefined, options: {
|
|
53
|
+
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
54
|
+
}] | undefined;
|
|
45
55
|
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
|
|
46
|
-
|
|
56
|
+
verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined;
|
|
57
|
+
readonly rpc: "https://mainnet-rpc.b3.fun";
|
|
47
58
|
readonly icon: {
|
|
48
59
|
readonly url: "https://cdn.b3.fun/b3_logo.svg";
|
|
49
60
|
readonly width: 32;
|
|
@@ -51,55 +62,8 @@ export declare const b3Mainnet: {
|
|
|
51
62
|
readonly format: "svg";
|
|
52
63
|
};
|
|
53
64
|
};
|
|
54
|
-
export declare const getViemChainConfig: (config: ChainNetworks) => {
|
|
55
|
-
blockExplorers: {
|
|
56
|
-
readonly default: {
|
|
57
|
-
readonly name: string;
|
|
58
|
-
readonly url: string;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
blockTime?: number | undefined | undefined;
|
|
62
|
-
contracts?: {
|
|
63
|
-
[x: string]: import("viem").ChainContract | {
|
|
64
|
-
[sourceId: number]: import("viem").ChainContract | undefined;
|
|
65
|
-
} | undefined;
|
|
66
|
-
ensRegistry?: import("viem").ChainContract | undefined;
|
|
67
|
-
ensUniversalResolver?: import("viem").ChainContract | undefined;
|
|
68
|
-
multicall3?: import("viem").ChainContract | undefined;
|
|
69
|
-
erc6492Verifier?: import("viem").ChainContract | undefined;
|
|
70
|
-
} | undefined;
|
|
71
|
-
ensTlds?: readonly string[] | undefined;
|
|
72
|
-
id: number;
|
|
73
|
-
name: string;
|
|
74
|
-
nativeCurrency: {
|
|
75
|
-
symbol: string;
|
|
76
|
-
name: string;
|
|
77
|
-
decimals: number;
|
|
78
|
-
};
|
|
79
|
-
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
80
|
-
rpcUrls: {
|
|
81
|
-
readonly default: {
|
|
82
|
-
readonly http: readonly [string];
|
|
83
|
-
readonly ws: readonly [string];
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
sourceId?: number | undefined | undefined;
|
|
87
|
-
testnet: true | undefined;
|
|
88
|
-
custom?: Record<string, unknown> | undefined;
|
|
89
|
-
fees?: import("viem").ChainFees<undefined> | undefined;
|
|
90
|
-
formatters?: undefined;
|
|
91
|
-
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
|
|
92
|
-
readonly rpc: string;
|
|
93
|
-
readonly icon: {
|
|
94
|
-
format: string;
|
|
95
|
-
url: string;
|
|
96
|
-
width: number;
|
|
97
|
-
height: number;
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
65
|
export declare const thirdwebB3Testnet: ThirdwebChain;
|
|
101
66
|
export declare const thirdwebB3Mainnet: ThirdwebChain;
|
|
102
|
-
export declare const getThirdwebChainConfig: (config: ChainNetworks) => ThirdwebChain;
|
|
103
67
|
export declare const b3Chain: Chain | {
|
|
104
68
|
blockExplorers: {
|
|
105
69
|
readonly default: {
|
|
@@ -128,17 +92,29 @@ export declare const b3Chain: Chain | {
|
|
|
128
92
|
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
129
93
|
rpcUrls: {
|
|
130
94
|
readonly default: {
|
|
131
|
-
readonly http: readonly ["https://
|
|
132
|
-
readonly ws: readonly ["wss://
|
|
95
|
+
readonly http: readonly ["https://mainnet-rpc.b3.fun"];
|
|
96
|
+
readonly ws: readonly ["wss://mainnet-rpc.b3.fun/ws"];
|
|
133
97
|
};
|
|
134
98
|
};
|
|
135
99
|
sourceId?: number | undefined | undefined;
|
|
100
|
+
supportsTransactionReplacementDetection?: boolean | undefined | undefined;
|
|
136
101
|
testnet?: boolean | undefined | undefined;
|
|
137
102
|
custom?: Record<string, unknown> | undefined;
|
|
103
|
+
extendSchema?: Record<string, unknown> | undefined;
|
|
138
104
|
fees?: import("viem").ChainFees<undefined> | undefined;
|
|
139
105
|
formatters?: undefined;
|
|
106
|
+
prepareTransactionRequest?: ((args: import("viem").PrepareTransactionRequestParameters, options: {
|
|
107
|
+
client: import("viem").Client;
|
|
108
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
109
|
+
}) => Promise<import("viem").PrepareTransactionRequestParameters>) | [fn: ((args: import("viem").PrepareTransactionRequestParameters, options: {
|
|
110
|
+
client: import("viem").Client;
|
|
111
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
112
|
+
}) => Promise<import("viem").PrepareTransactionRequestParameters>) | undefined, options: {
|
|
113
|
+
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
114
|
+
}] | undefined;
|
|
140
115
|
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
|
|
141
|
-
|
|
116
|
+
verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined;
|
|
117
|
+
readonly rpc: "https://mainnet-rpc.b3.fun";
|
|
142
118
|
readonly icon: {
|
|
143
119
|
readonly url: "https://cdn.b3.fun/b3_logo.svg";
|
|
144
120
|
readonly width: 32;
|
|
@@ -1,48 +1,7 @@
|
|
|
1
1
|
import type { Chain as ThirdwebChain } from "thirdweb";
|
|
2
2
|
export declare const supportedChains: import("viem").Chain[];
|
|
3
3
|
export declare const supportedChainsTW: ThirdwebChain[];
|
|
4
|
-
export declare const supportedChainNetworks:
|
|
5
|
-
formatters?: Record<string, any> | undefined;
|
|
6
|
-
contracts?: Record<string, {
|
|
7
|
-
blockCreated?: number | undefined;
|
|
8
|
-
address: string;
|
|
9
|
-
}> | undefined;
|
|
10
|
-
sourceId?: number | undefined;
|
|
11
|
-
testnet?: boolean | undefined;
|
|
12
|
-
fees?: Record<string, any> | undefined;
|
|
13
|
-
color?: string | undefined;
|
|
14
|
-
testnetConfigID?: number | undefined;
|
|
15
|
-
badge?: string | undefined;
|
|
16
|
-
enabledFeatures?: string[] | undefined;
|
|
17
|
-
blockExplorers: {
|
|
18
|
-
default: string;
|
|
19
|
-
explorerTitle: string;
|
|
20
|
-
};
|
|
21
|
-
id: number;
|
|
22
|
-
name: string;
|
|
23
|
-
nativeCurrency: {
|
|
24
|
-
symbol: string;
|
|
25
|
-
name: string;
|
|
26
|
-
decimals: number;
|
|
27
|
-
};
|
|
28
|
-
rpcUrls: {
|
|
29
|
-
default: {
|
|
30
|
-
http: string;
|
|
31
|
-
ws: string;
|
|
32
|
-
};
|
|
33
|
-
backups: {
|
|
34
|
-
type: "http" | "ws";
|
|
35
|
-
uri: string;
|
|
36
|
-
}[];
|
|
37
|
-
};
|
|
38
|
-
_id: string | {};
|
|
39
|
-
icon: {
|
|
40
|
-
format: string;
|
|
41
|
-
url: string;
|
|
42
|
-
width: number;
|
|
43
|
-
height: number;
|
|
44
|
-
};
|
|
45
|
-
}[];
|
|
4
|
+
export declare const supportedChainNetworks: import("@b3/chain-registry/runtime").ChainDefinition[];
|
|
46
5
|
export declare const coingeckoChains: Record<number, {
|
|
47
6
|
coingecko_id: string;
|
|
48
7
|
name: string;
|
|
@@ -56,14 +15,7 @@ export declare function getCoingeckoChainInfo(chainId: number): {
|
|
|
56
15
|
export declare const b3MainnetThirdWeb: Readonly<import("thirdweb/chains").ChainOptions & {
|
|
57
16
|
rpc: string;
|
|
58
17
|
}>;
|
|
59
|
-
export declare const b3TestnetThirdWeb: Readonly<import("thirdweb/chains").ChainOptions & {
|
|
60
|
-
rpc: string;
|
|
61
|
-
}>;
|
|
62
18
|
export declare const b3Mainnet: import("viem").Chain;
|
|
63
|
-
export declare const b3Testnet: import("viem").Chain;
|
|
64
19
|
export declare const baseMainnet: import("viem").Chain;
|
|
65
|
-
/**
|
|
66
|
-
* Get a Thirdweb chain by chain ID from supportedChainsTW
|
|
67
|
-
*/
|
|
68
20
|
export declare function getThirdwebChain(chainId: number): ThirdwebChain;
|
|
69
21
|
export declare function getChainLogo(chainId: number): string;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import type { Wallet } from "thirdweb/wallets";
|
|
1
2
|
export * from "./currency";
|
|
2
3
|
export declare const siteURL = "https://basement.fun";
|
|
3
4
|
export declare const b3CoinIcon = "https://cdn.b3.fun/b3-coin-3d.png";
|
|
4
5
|
export declare const ecosystemWalletId: `ecosystem.${string}`;
|
|
6
|
+
export type EcosystemWallet = Wallet<`ecosystem.${string}`> & {
|
|
7
|
+
getAuthToken: () => string | null;
|
|
8
|
+
};
|
|
5
9
|
export declare const tokenIcons: {
|
|
6
10
|
ETH: string;
|
|
7
11
|
WETH: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ChainDefinition } from "@b3/chain-registry";
|
|
2
2
|
import type { Chain as ThirdwebChain } from "thirdweb";
|
|
3
|
-
import { Chain } from "viem";
|
|
4
|
-
export declare function toViemChain(
|
|
5
|
-
export declare function toThirdwebChain(
|
|
3
|
+
import type { Chain } from "viem";
|
|
4
|
+
export declare function toViemChain(chain: ChainDefinition): Chain;
|
|
5
|
+
export declare function toThirdwebChain(chain: ChainDefinition): ThirdwebChain;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface UploadOptions {
|
|
2
|
+
baseUrl?: string;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Upload a file to the B3 uploads service (Cloudflare R2).
|
|
6
|
+
* Returns the public URL of the uploaded asset.
|
|
7
|
+
*/
|
|
8
|
+
export declare function uploadFile(file: File, options?: UploadOptions): Promise<string>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical browser-side translation of Zerion wallet positions into B3 balance rows.
|
|
3
|
+
*
|
|
4
|
+
* This lives in the published SDK because every browser consumer needs it — the apps in this repo
|
|
5
|
+
* and the sites that install `@b3dotfun/sdk` from npm — and the in-repo Zerion client is a private
|
|
6
|
+
* workspace package that a published package cannot depend on. Backend services keep their own
|
|
7
|
+
* translation: pulling a browser SDK into a Node service to share one function is a worse trade
|
|
8
|
+
* than the second copy.
|
|
9
|
+
*
|
|
10
|
+
* Only the HTTP layer differs between callers. The rules below — which row counts as the chain's
|
|
11
|
+
* native coin, and which rows have no usable identity — must not be re-derived anywhere else.
|
|
12
|
+
*/
|
|
13
|
+
/** Address B3 uses for a chain's native coin on EVM. Matches NATIVE_TOKEN_ADDRESSES. */
|
|
14
|
+
export declare const EVM_NATIVE_TOKEN_ADDRESS = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
15
|
+
export declare const SOLANA_NATIVE_TOKEN_ADDRESS: "So11111111111111111111111111111111111111112";
|
|
16
|
+
export declare const SOLANA_ZERION_SLUG: "solana";
|
|
17
|
+
/** Solana's chain id as the chain registry defines it — the id every balance row is keyed by. */
|
|
18
|
+
export declare const SOLANA_CHAIN_ID: 7565164;
|
|
19
|
+
export declare function zerionSlugToChainId(slug: string): number | undefined;
|
|
20
|
+
export declare function chainIdToZerionSlug(chainId: number): string | undefined;
|
|
21
|
+
export interface ZerionPositionQuantity {
|
|
22
|
+
int?: string;
|
|
23
|
+
decimals?: number;
|
|
24
|
+
}
|
|
25
|
+
export interface ZerionPositionImplementation {
|
|
26
|
+
chain_id?: string;
|
|
27
|
+
address?: string | null;
|
|
28
|
+
decimals?: number;
|
|
29
|
+
}
|
|
30
|
+
export interface ZerionPositionFungibleInfo {
|
|
31
|
+
name?: string;
|
|
32
|
+
symbol?: string;
|
|
33
|
+
icon?: {
|
|
34
|
+
url?: string;
|
|
35
|
+
} | null;
|
|
36
|
+
implementations?: ZerionPositionImplementation[];
|
|
37
|
+
}
|
|
38
|
+
export interface ZerionPositionLike {
|
|
39
|
+
id?: string;
|
|
40
|
+
attributes?: {
|
|
41
|
+
quantity?: ZerionPositionQuantity;
|
|
42
|
+
value?: number | null;
|
|
43
|
+
price?: number | null;
|
|
44
|
+
fungible_info?: ZerionPositionFungibleInfo;
|
|
45
|
+
flags?: {
|
|
46
|
+
displayable?: boolean;
|
|
47
|
+
is_trash?: boolean;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
relationships?: {
|
|
51
|
+
chain?: {
|
|
52
|
+
data?: {
|
|
53
|
+
id?: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/** One spendable holding. `amount` is the raw integer; pair it with `decimals` to display. */
|
|
59
|
+
export interface B3TokenBalance {
|
|
60
|
+
chain: string;
|
|
61
|
+
chain_id: number;
|
|
62
|
+
address: string;
|
|
63
|
+
amount: string;
|
|
64
|
+
symbol: string;
|
|
65
|
+
decimals: number;
|
|
66
|
+
/**
|
|
67
|
+
* Whether `address` is the native-coin sentinel rather than a real contract. Callers deciding
|
|
68
|
+
* between a value-bearing send and an ERC-20 `transfer` MUST branch on this, never on the
|
|
69
|
+
* sentinel string: getting it backwards spends gas and moves nothing.
|
|
70
|
+
*/
|
|
71
|
+
is_native: boolean;
|
|
72
|
+
name?: string;
|
|
73
|
+
price_usd?: number;
|
|
74
|
+
value_usd?: number;
|
|
75
|
+
token_metadata?: {
|
|
76
|
+
logo: string;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
export declare function nativeTokenAddressForChain(slug: string): string;
|
|
80
|
+
/**
|
|
81
|
+
* Whether `balance` is the token identified by `tokenAddress`.
|
|
82
|
+
*
|
|
83
|
+
* Native coins are matched on the row's `is_native` flag rather than its printed address, because
|
|
84
|
+
* the caller and the adapter rarely spell the native coin the same way.
|
|
85
|
+
*/
|
|
86
|
+
export declare function balanceMatchesToken(balance: B3TokenBalance, tokenAddress: string): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Adapt raw Zerion positions into balance rows, dropping any row we cannot describe honestly.
|
|
89
|
+
*
|
|
90
|
+
* A row is dropped when its chain slug is absent or unmapped, or when neither the quantity nor the
|
|
91
|
+
* chain implementation carries decimals — an amount rendered against a guessed scale is a wrong
|
|
92
|
+
* number presented as a real one, which is worse for the reader than a missing row.
|
|
93
|
+
*
|
|
94
|
+
* @param slugToChainId overrides slug resolution; return undefined to skip a chain entirely.
|
|
95
|
+
*/
|
|
96
|
+
export declare function adaptZerionPositions(positions: ZerionPositionLike[], slugToChainId?: (slug: string) => number | undefined): B3TokenBalance[];
|