@b3dotfun/sdk 0.1.70-alpha.1 → 0.1.70-alpha.10
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/constants/chains/b3Chain.js +3 -1
- package/dist/cjs/anyspend/constants/rpc.d.ts +2 -1
- package/dist/cjs/anyspend/constants/rpc.js +4 -2
- package/dist/cjs/anyspend/react/components/AnySpendBondKit.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/AnySpendBondKit.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +21 -14
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +9 -3
- package/dist/cjs/anyspend/react/components/AnySpendDepositUpside.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnySpendDepositUpside.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpsideExactIn.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendWorkflowTrigger.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/AnySpendWorkflowTrigger.js +2 -2
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +2 -2
- package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.js +2 -2
- package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckout.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckout.js +2 -2
- package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckoutTrigger.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/checkout/AnySpendCheckoutTrigger.js +2 -2
- package/dist/cjs/anyspend/react/components/checkout/CheckoutPaymentPanel.d.ts +3 -1
- package/dist/cjs/anyspend/react/components/checkout/CheckoutPaymentPanel.js +13 -3
- package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +3 -3
- package/dist/cjs/anyspend/utils/chain.d.ts +39 -1
- package/dist/cjs/anyspend/utils/chain.js +23 -2
- 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 +19 -4
- package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.js +6 -11
- package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +1 -5
- package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.js +1 -2
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +8 -13
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +24 -3
- package/dist/cjs/global-account/react/components/B3Provider/BetterAuthProvider.js +48 -8
- package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.js +1 -1
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +1 -5
- 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 +1 -3
- package/dist/cjs/global-account/react/components/index.d.ts +0 -2
- package/dist/cjs/global-account/react/components/index.js +3 -7
- package/dist/cjs/global-account/react/hooks/index.d.ts +0 -1
- package/dist/cjs/global-account/react/hooks/index.js +2 -4
- package/dist/cjs/global-account/react/hooks/useAuth.d.ts +3 -3
- package/dist/cjs/global-account/react/hooks/useAuthentication.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/useAuthentication.js +1 -1
- package/dist/cjs/global-account/react/hooks/useBetterAuth.d.ts +1656 -21
- package/dist/cjs/global-account/react/hooks/useBetterAuth.js +13 -14
- package/dist/cjs/global-account/react/hooks/useClient.d.ts +3 -3
- package/dist/cjs/global-account/react/hooks/useNativeBalance.js +2 -2
- 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.js +20 -17
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +28 -0
- 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 +6 -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/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/esm/anyspend/constants/rpc.d.ts +2 -1
- package/dist/esm/anyspend/constants/rpc.js +3 -1
- package/dist/esm/anyspend/react/components/AnySpendBondKit.d.ts +1 -1
- package/dist/esm/anyspend/react/components/AnySpendBondKit.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.d.ts +2 -0
- package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +21 -14
- package/dist/esm/anyspend/react/components/AnySpendDeposit.js +10 -4
- package/dist/esm/anyspend/react/components/AnySpendDepositUpside.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnySpendDepositUpside.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnySpendStakeUpsideExactIn.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendWorkflowTrigger.d.ts +3 -1
- package/dist/esm/anyspend/react/components/AnySpendWorkflowTrigger.js +2 -2
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +2 -2
- package/dist/esm/anyspend/react/components/AnyspendSignatureMint.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnyspendSignatureMint.js +2 -2
- package/dist/esm/anyspend/react/components/checkout/AnySpendCheckout.d.ts +3 -1
- package/dist/esm/anyspend/react/components/checkout/AnySpendCheckout.js +2 -2
- package/dist/esm/anyspend/react/components/checkout/AnySpendCheckoutTrigger.d.ts +3 -1
- package/dist/esm/anyspend/react/components/checkout/AnySpendCheckoutTrigger.js +2 -2
- package/dist/esm/anyspend/react/components/checkout/CheckoutPaymentPanel.d.ts +3 -1
- package/dist/esm/anyspend/react/components/checkout/CheckoutPaymentPanel.js +14 -4
- package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +3 -3
- package/dist/esm/anyspend/utils/chain.d.ts +39 -1
- package/dist/esm/anyspend/utils/chain.js +24 -3
- 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 +19 -5
- package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +6 -11
- package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +1 -5
- package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.js +1 -2
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +8 -13
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +25 -4
- package/dist/esm/global-account/react/components/B3Provider/BetterAuthProvider.js +48 -8
- package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.js +1 -1
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +1 -5
- 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 +1 -3
- package/dist/esm/global-account/react/components/index.d.ts +0 -2
- package/dist/esm/global-account/react/components/index.js +0 -2
- package/dist/esm/global-account/react/hooks/index.d.ts +0 -1
- package/dist/esm/global-account/react/hooks/index.js +0 -1
- package/dist/esm/global-account/react/hooks/useAuth.d.ts +3 -3
- package/dist/esm/global-account/react/hooks/useAuthentication.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/useAuthentication.js +1 -1
- package/dist/esm/global-account/react/hooks/useBetterAuth.d.ts +1656 -21
- package/dist/esm/global-account/react/hooks/useBetterAuth.js +13 -14
- package/dist/esm/global-account/react/hooks/useClient.d.ts +3 -3
- package/dist/esm/global-account/react/hooks/useNativeBalance.js +1 -1
- 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.js +20 -17
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +28 -0
- 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 +6 -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/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/styles/index.css +1 -1
- package/dist/types/anyspend/constants/rpc.d.ts +2 -1
- package/dist/types/anyspend/react/components/AnySpendBondKit.d.ts +1 -1
- package/dist/types/anyspend/react/components/AnySpendBuySpin.d.ts +2 -1
- package/dist/types/anyspend/react/components/AnySpendCustomExactIn.d.ts +2 -0
- package/dist/types/anyspend/react/components/AnySpendDepositUpside.d.ts +2 -1
- package/dist/types/anyspend/react/components/AnySpendStakeB3.d.ts +2 -1
- package/dist/types/anyspend/react/components/AnySpendStakeB3ExactIn.d.ts +2 -1
- package/dist/types/anyspend/react/components/AnySpendStakeUpsideExactIn.d.ts +2 -1
- package/dist/types/anyspend/react/components/AnySpendWorkflowTrigger.d.ts +3 -1
- package/dist/types/anyspend/react/components/AnyspendDepositHype.d.ts +2 -1
- package/dist/types/anyspend/react/components/AnyspendSignatureMint.d.ts +2 -1
- package/dist/types/anyspend/react/components/checkout/AnySpendCheckout.d.ts +3 -1
- package/dist/types/anyspend/react/components/checkout/AnySpendCheckoutTrigger.d.ts +3 -1
- package/dist/types/anyspend/react/components/checkout/CheckoutPaymentPanel.d.ts +3 -1
- package/dist/types/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +3 -3
- package/dist/types/anyspend/utils/chain.d.ts +39 -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 +1 -5
- package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +8 -13
- package/dist/types/global-account/react/components/SignInWithB3/utils/signInUtils.d.ts +3 -2
- package/dist/types/global-account/react/components/index.d.ts +0 -2
- package/dist/types/global-account/react/hooks/index.d.ts +0 -1
- package/dist/types/global-account/react/hooks/useAuth.d.ts +3 -3
- package/dist/types/global-account/react/hooks/useAuthentication.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useBetterAuth.d.ts +1656 -21
- package/dist/types/global-account/react/hooks/useClient.d.ts +3 -3
- 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/stores/useModalStore.d.ts +28 -0
- 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 +6 -54
- package/dist/types/shared/constants/chains/supported.d.ts +1 -49
- package/dist/types/shared/utils/chain-transformers.d.ts +4 -4
- package/dist/types/shared/utils/upload.d.ts +9 -0
- package/node_modules/@b3/chain-registry/chains.json +1160 -0
- package/node_modules/@b3/chain-registry/package.json +14 -0
- package/node_modules/@b3/chain-registry/src/index.ts +169 -0
- package/node_modules/@b3/chain-registry/tsconfig.json +16 -0
- package/package.json +76 -28
- package/src/anyspend/constants/rpc.ts +3 -2
- package/src/anyspend/react/components/AnySpendBondKit.tsx +2 -0
- package/src/anyspend/react/components/AnySpendBuySpin.tsx +3 -0
- package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +29 -14
- package/src/anyspend/react/components/AnySpendDeposit.tsx +13 -3
- package/src/anyspend/react/components/AnySpendDepositUpside.tsx +3 -0
- package/src/anyspend/react/components/AnySpendStakeB3.tsx +3 -0
- package/src/anyspend/react/components/AnySpendStakeB3ExactIn.tsx +3 -0
- package/src/anyspend/react/components/AnySpendStakeUpsideExactIn.tsx +3 -0
- package/src/anyspend/react/components/AnySpendWorkflowTrigger.tsx +4 -0
- package/src/anyspend/react/components/AnyspendDepositHype.tsx +3 -0
- package/src/anyspend/react/components/AnyspendSignatureMint.tsx +3 -0
- package/src/anyspend/react/components/checkout/AnySpendCheckout.tsx +4 -0
- package/src/anyspend/react/components/checkout/AnySpendCheckoutTrigger.tsx +4 -0
- package/src/anyspend/react/components/checkout/CheckoutPaymentPanel.tsx +97 -79
- package/src/anyspend/react/hooks/useAnyspendQuote.ts +13 -13
- package/src/anyspend/react/hooks/useCreateDepositFirstOrder.ts +4 -4
- package/src/anyspend/types/api_req_res.ts +10 -5
- package/src/anyspend/utils/chain.ts +26 -1
- 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 +41 -9
- package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +6 -11
- package/src/global-account/react/components/B3Provider/B3ConfigProvider.tsx +0 -6
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +49 -32
- package/src/global-account/react/components/B3Provider/BetterAuthProvider.tsx +53 -8
- package/src/global-account/react/components/ManageAccount/SettingsProfileCard.tsx +1 -1
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +1 -4
- package/src/global-account/react/components/SignInWithB3/utils/signInUtils.ts +2 -4
- package/src/global-account/react/components/index.ts +0 -2
- package/src/global-account/react/components/ui/button.tsx +1 -2
- package/src/global-account/react/hooks/index.ts +0 -1
- package/src/global-account/react/hooks/useAuth.ts +2 -2
- package/src/global-account/react/hooks/useAuthentication.ts +2 -2
- package/src/global-account/react/hooks/useBetterAuth.ts +14 -15
- package/src/global-account/react/hooks/useClient.ts +11 -2
- package/src/global-account/react/hooks/useNativeBalance.tsx +1 -1
- 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 +22 -20
- package/src/global-account/react/stores/useModalStore.ts +28 -0
- 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/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/styles/index.css +27 -0
- package/dist/cjs/global-account/react/components/B3Provider/BetterAuthClientProvider.d.ts +0 -17
- package/dist/cjs/global-account/react/components/B3Provider/BetterAuthClientProvider.js +0 -31
- 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/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/B3Provider/BetterAuthClientProvider.d.ts +0 -17
- package/dist/esm/global-account/react/components/B3Provider/BetterAuthClientProvider.js +0 -27
- 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/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/B3Provider/BetterAuthClientProvider.d.ts +0 -17
- 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/types/chain-networks.d.ts +0 -44
- package/src/global-account/react/components/B3Provider/BetterAuthClientProvider.tsx +0 -40
- 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/types/chain-networks.ts +0 -54
- package/src/shared/generated/chain-networks.json +0 -684
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@b3/chain-registry",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"description": "Canonical chain definitions for all B3OS services",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
|
+
"types": "src/index.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"typecheck": "tsc --noEmit"
|
|
10
|
+
},
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"typescript": "^5.5.2"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import chainsData from "../chains.json";
|
|
2
|
+
|
|
3
|
+
export interface ManualToken {
|
|
4
|
+
address: `0x${string}`;
|
|
5
|
+
symbol: string;
|
|
6
|
+
decimals: number;
|
|
7
|
+
name: string;
|
|
8
|
+
logoUrl?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Known integration tags that can appear in `ChainDefinition.integrations`.
|
|
13
|
+
* Adding a new integration → extend this union. Consumers calling
|
|
14
|
+
* `chainsByIntegration("foo")` get autocomplete + typo safety.
|
|
15
|
+
*/
|
|
16
|
+
export type KnownIntegration =
|
|
17
|
+
| "aerodrome"
|
|
18
|
+
| "anyspend"
|
|
19
|
+
| "cow-swap"
|
|
20
|
+
| "evm-log"
|
|
21
|
+
| "morpho"
|
|
22
|
+
| "railgun"
|
|
23
|
+
| "x402"
|
|
24
|
+
| "zerodev";
|
|
25
|
+
|
|
26
|
+
export interface ChainDefinition {
|
|
27
|
+
chainId: number;
|
|
28
|
+
key: string;
|
|
29
|
+
name: string;
|
|
30
|
+
network: string;
|
|
31
|
+
type: "evm" | "solana";
|
|
32
|
+
isTestnet: boolean;
|
|
33
|
+
integrations: KnownIntegration[];
|
|
34
|
+
nativeCurrency: {
|
|
35
|
+
name: string;
|
|
36
|
+
symbol: string;
|
|
37
|
+
decimals: number;
|
|
38
|
+
};
|
|
39
|
+
explorer: string;
|
|
40
|
+
rpcEnvKey: string | null;
|
|
41
|
+
fallbackRpc: string | null;
|
|
42
|
+
quicknodeSlug: string | null;
|
|
43
|
+
quicknodeRpcPath?: string;
|
|
44
|
+
coingecko: {
|
|
45
|
+
platform: string;
|
|
46
|
+
nativeCoinId: string;
|
|
47
|
+
} | null;
|
|
48
|
+
/**
|
|
49
|
+
* GeckoTerminal network slug (differs from `coingecko.platform`: GT uses
|
|
50
|
+
* "eth", CoinGecko uses "ethereum"). Used for on-chain pool lookups and
|
|
51
|
+
* OHLCV charts. Null when GeckoTerminal does not index this chain.
|
|
52
|
+
*/
|
|
53
|
+
geckoTerminalNetwork?: string | null;
|
|
54
|
+
trustwalletSlug: string | null;
|
|
55
|
+
logoUrl: string | null;
|
|
56
|
+
tags: string[];
|
|
57
|
+
manualTokens?: ManualToken[];
|
|
58
|
+
/**
|
|
59
|
+
* Wrapped-native ERC20 address (e.g. WETH on Ethereum, WPLUME on Plume).
|
|
60
|
+
* Used for GeckoTerminal pool lookups on the native coin and for DEX
|
|
61
|
+
* routing that needs an ERC20 form of the gas token.
|
|
62
|
+
*/
|
|
63
|
+
wrappedNative?: `0x${string}`;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const chains: ChainDefinition[] = chainsData as ChainDefinition[];
|
|
67
|
+
|
|
68
|
+
export const evmChains = chains.filter(c => c.type === "evm");
|
|
69
|
+
|
|
70
|
+
export const chainById = new Map(chains.map(c => [c.chainId, c]));
|
|
71
|
+
|
|
72
|
+
export const CHAIN_IDS: Record<string, number> = Object.fromEntries(chains.map(c => [c.key, c.chainId]));
|
|
73
|
+
|
|
74
|
+
export const CHAIN_NAMES: Record<number, string> = Object.fromEntries(chains.map(c => [c.chainId, c.name]));
|
|
75
|
+
|
|
76
|
+
export const CHAIN_ID_TO_NETWORK: Record<number, string> = Object.fromEntries(chains.map(c => [c.chainId, c.network]));
|
|
77
|
+
|
|
78
|
+
export const FALLBACK_RPC_URLS: Record<number, string> = Object.fromEntries(
|
|
79
|
+
chains.filter(c => c.fallbackRpc).map(c => [c.chainId, c.fallbackRpc!]),
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
export const BLOCK_EXPLORERS: Record<number, string> = Object.fromEntries(chains.map(c => [c.chainId, c.explorer]));
|
|
83
|
+
|
|
84
|
+
export const COINGECKO_MAPPINGS: Record<number, { platform: string; nativeCoinId: string }> = Object.fromEntries(
|
|
85
|
+
chains.filter(c => c.coingecko).map(c => [c.chainId, c.coingecko!]),
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
export const TRUSTWALLET_SLUGS: Record<number, string> = Object.fromEntries(
|
|
89
|
+
chains.filter(c => c.trustwalletSlug).map(c => [c.chainId, c.trustwalletSlug!]),
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
export const CHAIN_TAG_MAP: Record<string, number> = Object.fromEntries(
|
|
93
|
+
chains.flatMap(c => c.tags.map(tag => [tag, c.chainId])),
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
export const LOGO_URLS: Record<number, string> = Object.fromEntries(
|
|
97
|
+
chains.filter(c => c.logoUrl).map(c => [c.chainId, c.logoUrl!]),
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
export function buildQuicknodeUrl(subdomain: string, key: string, chain: ChainDefinition): string | null {
|
|
101
|
+
if (chain.quicknodeSlug === null) return null;
|
|
102
|
+
const network = chain.quicknodeSlug === "" ? "" : `.${chain.quicknodeSlug}`;
|
|
103
|
+
const path = chain.quicknodeRpcPath ?? "";
|
|
104
|
+
return `https://${subdomain}${network}.quiknode.pro/${key}${path}`;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function buildQuicknodeRpcMap(subdomain: string, key: string): Record<number, string> {
|
|
108
|
+
return Object.fromEntries(
|
|
109
|
+
chains.filter(c => c.quicknodeSlug !== null).map(c => [c.chainId, buildQuicknodeUrl(subdomain, key, c)!]),
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function chainsByIntegration(integration: KnownIntegration): ChainDefinition[] {
|
|
114
|
+
return chains.filter(c => c.integrations.includes(integration));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export function chainIdsByIntegration(integration: KnownIntegration): number[] {
|
|
118
|
+
return chainsByIntegration(integration).map(c => c.chainId);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export function chainNamesByIntegration(integration: KnownIntegration): Record<number, string> {
|
|
122
|
+
return Object.fromEntries(chainsByIntegration(integration).map(c => [c.chainId, c.name]));
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export const ZERODEV_SUPPORTED_CHAINS: ChainDefinition[] = chainsByIntegration("zerodev");
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Chains tagged with the "anyspend" integration AND of EVM type — the set
|
|
129
|
+
* consumed by SDK `supportedChains` / `supportedChainsTW` for AnySpend's
|
|
130
|
+
* wallet-switch gate (`useUnifiedChainSwitchAndExecute`). Solana (also tagged
|
|
131
|
+
* anyspend) is excluded here because it's handled by Phantom-based flows that
|
|
132
|
+
* key off `RELAY_SOLANA_MAINNET_CHAIN_ID`, not viem.
|
|
133
|
+
*/
|
|
134
|
+
export const ANYSPEND_EVM_CHAINS: ChainDefinition[] = chainsByIntegration("anyspend").filter(c => c.type === "evm");
|
|
135
|
+
|
|
136
|
+
// Validate at module init: every anyspend EVM chain must have a fallbackRpc.
|
|
137
|
+
// The SDK transformers (toViemChain / toThirdwebChain) assume this invariant
|
|
138
|
+
// holds — catching a missing RPC here is far better than throwing on first
|
|
139
|
+
// pay-button click in production.
|
|
140
|
+
{
|
|
141
|
+
const missingRpc = ANYSPEND_EVM_CHAINS.filter(c => !c.fallbackRpc);
|
|
142
|
+
if (missingRpc.length > 0) {
|
|
143
|
+
throw new Error(
|
|
144
|
+
`chain-registry: anyspend EVM chains missing fallbackRpc: ${missingRpc.map(c => `${c.chainId} (${c.key})`).join(", ")}`,
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Chain IDs that the default indexer (Sim Dune) does not support.
|
|
151
|
+
* These chains require RPC + CoinGecko fallback for balance/metadata.
|
|
152
|
+
*/
|
|
153
|
+
export const MANUAL_CHAIN_IDS: ReadonlySet<number> = new Set(
|
|
154
|
+
chains.filter(c => c.manualTokens && c.manualTokens.length > 0).map(c => c.chainId),
|
|
155
|
+
);
|
|
156
|
+
|
|
157
|
+
export function hasManualTokens(chainId: number): boolean {
|
|
158
|
+
return MANUAL_CHAIN_IDS.has(chainId);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export function getManualTokens(chainId: number): ManualToken[] {
|
|
162
|
+
return chainById.get(chainId)?.manualTokens ?? [];
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export function findManualToken(chainId: number, address: string): ManualToken | null {
|
|
166
|
+
const lower = address.toLowerCase();
|
|
167
|
+
const tokens = getManualTokens(chainId);
|
|
168
|
+
return tokens.find(t => t.address.toLowerCase() === lower) ?? null;
|
|
169
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"declaration": true,
|
|
10
|
+
"declarationMap": true,
|
|
11
|
+
"resolveJsonModule": true,
|
|
12
|
+
"outDir": "./dist",
|
|
13
|
+
"rootDir": "./src"
|
|
14
|
+
},
|
|
15
|
+
"include": ["src/**/*"]
|
|
16
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@b3dotfun/sdk",
|
|
3
|
-
"version": "0.1.70-alpha.
|
|
3
|
+
"version": "0.1.70-alpha.10",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"react-native": "./dist/cjs/index.native.js",
|
|
@@ -12,11 +12,9 @@
|
|
|
12
12
|
"exports": {
|
|
13
13
|
"./index.css": "./dist/styles/index.css",
|
|
14
14
|
".": {
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"require": "./dist/cjs/index.js"
|
|
19
|
-
}
|
|
15
|
+
"types": "./dist/types/index.d.ts",
|
|
16
|
+
"import": "./dist/esm/index.js",
|
|
17
|
+
"require": "./dist/cjs/index.js"
|
|
20
18
|
},
|
|
21
19
|
"./anyspend": {
|
|
22
20
|
"types": "./dist/types/anyspend/index.d.ts",
|
|
@@ -35,6 +33,26 @@
|
|
|
35
33
|
"require": "./dist/cjs/anyspend/react/index.js"
|
|
36
34
|
}
|
|
37
35
|
},
|
|
36
|
+
"./anyspend/react/components": {
|
|
37
|
+
"types": "./dist/types/anyspend/react/components/index.d.ts",
|
|
38
|
+
"import": "./dist/esm/anyspend/react/components/index.js",
|
|
39
|
+
"require": "./dist/cjs/anyspend/react/components/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./anyspend/react/components/*": {
|
|
42
|
+
"types": "./dist/types/anyspend/react/components/*.d.ts",
|
|
43
|
+
"import": "./dist/esm/anyspend/react/components/*.js",
|
|
44
|
+
"require": "./dist/cjs/anyspend/react/components/*.js"
|
|
45
|
+
},
|
|
46
|
+
"./anyspend/react/hooks": {
|
|
47
|
+
"types": "./dist/types/anyspend/react/hooks/index.d.ts",
|
|
48
|
+
"import": "./dist/esm/anyspend/react/hooks/index.js",
|
|
49
|
+
"require": "./dist/cjs/anyspend/react/hooks/index.js"
|
|
50
|
+
},
|
|
51
|
+
"./anyspend/react/hooks/*": {
|
|
52
|
+
"types": "./dist/types/anyspend/react/hooks/*.d.ts",
|
|
53
|
+
"import": "./dist/esm/anyspend/react/hooks/*.js",
|
|
54
|
+
"require": "./dist/cjs/anyspend/react/hooks/*.js"
|
|
55
|
+
},
|
|
38
56
|
"./anyspend/types": {
|
|
39
57
|
"types": "./dist/types/anyspend/types/index.d.ts",
|
|
40
58
|
"import": "./dist/esm/anyspend/types/index.js",
|
|
@@ -45,15 +63,25 @@
|
|
|
45
63
|
"import": "./dist/esm/anyspend/types/*.js",
|
|
46
64
|
"require": "./dist/cjs/anyspend/types/*.js"
|
|
47
65
|
},
|
|
66
|
+
"./anyspend/utils": {
|
|
67
|
+
"types": "./dist/types/anyspend/utils/index.d.ts",
|
|
68
|
+
"import": "./dist/esm/anyspend/utils/index.js",
|
|
69
|
+
"require": "./dist/cjs/anyspend/utils/index.js"
|
|
70
|
+
},
|
|
48
71
|
"./anyspend/utils/*": {
|
|
49
72
|
"types": "./dist/types/anyspend/utils/*.d.ts",
|
|
50
73
|
"import": "./dist/esm/anyspend/utils/*.js",
|
|
51
74
|
"require": "./dist/cjs/anyspend/utils/*.js"
|
|
52
75
|
},
|
|
53
76
|
"./anyspend/constants": {
|
|
54
|
-
"types": "./dist/types/anyspend/constants.d.ts",
|
|
55
|
-
"import": "./dist/esm/anyspend/constants.js",
|
|
56
|
-
"require": "./dist/cjs/anyspend/constants.js"
|
|
77
|
+
"types": "./dist/types/anyspend/constants/index.d.ts",
|
|
78
|
+
"import": "./dist/esm/anyspend/constants/index.js",
|
|
79
|
+
"require": "./dist/cjs/anyspend/constants/index.js"
|
|
80
|
+
},
|
|
81
|
+
"./anyspend/constants/*": {
|
|
82
|
+
"types": "./dist/types/anyspend/constants/*.d.ts",
|
|
83
|
+
"import": "./dist/esm/anyspend/constants/*.js",
|
|
84
|
+
"require": "./dist/cjs/anyspend/constants/*.js"
|
|
57
85
|
},
|
|
58
86
|
"./anyspend/platform": {
|
|
59
87
|
"types": "./dist/types/anyspend/platform/index.d.ts",
|
|
@@ -156,6 +184,11 @@
|
|
|
156
184
|
"import": "./dist/esm/global-account/types/*.js",
|
|
157
185
|
"require": "./dist/cjs/global-account/types/*.js"
|
|
158
186
|
},
|
|
187
|
+
"./global-account/utils/*": {
|
|
188
|
+
"types": "./dist/types/global-account/utils/*.d.ts",
|
|
189
|
+
"import": "./dist/esm/global-account/utils/*.js",
|
|
190
|
+
"require": "./dist/cjs/global-account/utils/*.js"
|
|
191
|
+
},
|
|
159
192
|
"./global-account/app": {
|
|
160
193
|
"react-native": {
|
|
161
194
|
"types": "./dist/types/global-account/app.native.d.ts",
|
|
@@ -235,15 +268,10 @@
|
|
|
235
268
|
"import": "./dist/esm/shared/constants/*.js",
|
|
236
269
|
"require": "./dist/cjs/shared/constants/*.js"
|
|
237
270
|
},
|
|
238
|
-
"./shared/constants/chains
|
|
239
|
-
"types": "./dist/types/shared/constants/chains
|
|
240
|
-
"import": "./dist/esm/shared/constants/chains
|
|
241
|
-
"require": "./dist/cjs/shared/constants/chains
|
|
242
|
-
},
|
|
243
|
-
"./shared/constants/chains/supported": {
|
|
244
|
-
"types": "./dist/types/shared/constants/chains/supported.d.ts",
|
|
245
|
-
"import": "./dist/esm/shared/constants/chains/supported.js",
|
|
246
|
-
"require": "./dist/cjs/shared/constants/chains/supported.js"
|
|
271
|
+
"./shared/constants/chains/*": {
|
|
272
|
+
"types": "./dist/types/shared/constants/chains/*.d.ts",
|
|
273
|
+
"import": "./dist/esm/shared/constants/chains/*.js",
|
|
274
|
+
"require": "./dist/cjs/shared/constants/chains/*.js"
|
|
247
275
|
},
|
|
248
276
|
"./shared/thirdweb/*": {
|
|
249
277
|
"types": "./dist/types/shared/thirdweb/*.d.ts",
|
|
@@ -270,11 +298,6 @@
|
|
|
270
298
|
"import": "./dist/esm/shared/react/stores/index.js",
|
|
271
299
|
"require": "./dist/cjs/shared/react/stores/index.js"
|
|
272
300
|
},
|
|
273
|
-
"./types/chain-networks": {
|
|
274
|
-
"types": "./dist/types/generated/chain-networks.d.ts",
|
|
275
|
-
"import": "./dist/esm/generated/chain-networks.js",
|
|
276
|
-
"require": "./dist/cjs/generated/chain-networks.js"
|
|
277
|
-
},
|
|
278
301
|
"./bondkit/components/TradingView/TradingView": {
|
|
279
302
|
"types": "./dist/types/bondkit/components/TradingView/TradingView.d.ts",
|
|
280
303
|
"import": "./dist/esm/bondkit/components/TradingView/TradingView.js",
|
|
@@ -291,6 +314,26 @@
|
|
|
291
314
|
"import": "./dist/esm/global-account/react/hooks/useSiwe.js",
|
|
292
315
|
"require": "./dist/cjs/global-account/react/hooks/useSiwe.js"
|
|
293
316
|
}
|
|
317
|
+
},
|
|
318
|
+
"./global-account/react/hooks/*": {
|
|
319
|
+
"types": "./dist/types/global-account/react/hooks/*.d.ts",
|
|
320
|
+
"import": "./dist/esm/global-account/react/hooks/*.js",
|
|
321
|
+
"require": "./dist/cjs/global-account/react/hooks/*.js"
|
|
322
|
+
},
|
|
323
|
+
"./global-account/react/utils/*": {
|
|
324
|
+
"types": "./dist/types/global-account/react/utils/*.d.ts",
|
|
325
|
+
"import": "./dist/esm/global-account/react/utils/*.js",
|
|
326
|
+
"require": "./dist/cjs/global-account/react/utils/*.js"
|
|
327
|
+
},
|
|
328
|
+
"./global-account/react/stores": {
|
|
329
|
+
"types": "./dist/types/global-account/react/stores/index.d.ts",
|
|
330
|
+
"import": "./dist/esm/global-account/react/stores/index.js",
|
|
331
|
+
"require": "./dist/cjs/global-account/react/stores/index.js"
|
|
332
|
+
},
|
|
333
|
+
"./global-account/react/stores/*": {
|
|
334
|
+
"types": "./dist/types/global-account/react/stores/*.d.ts",
|
|
335
|
+
"import": "./dist/esm/global-account/react/stores/*.js",
|
|
336
|
+
"require": "./dist/cjs/global-account/react/stores/*.js"
|
|
294
337
|
}
|
|
295
338
|
},
|
|
296
339
|
"files": [
|
|
@@ -311,6 +354,7 @@
|
|
|
311
354
|
"@feathersjs/socketio-client": "5.0.33",
|
|
312
355
|
"@feathersjs/typebox": "5.0.33",
|
|
313
356
|
"@fingerprintjs/fingerprintjs-pro-react": "^2.7.0",
|
|
357
|
+
"@headlessui/react": "^2.2.10",
|
|
314
358
|
"@hey-api/client-fetch": "0.8.3",
|
|
315
359
|
"@hey-api/openapi-ts": "0.64.13",
|
|
316
360
|
"@lottiefiles/dotlottie-react": "0.7.2",
|
|
@@ -353,8 +397,12 @@
|
|
|
353
397
|
"torph": "^0.0.9",
|
|
354
398
|
"typescript": "5.8.2",
|
|
355
399
|
"vaul": "^1.1.2",
|
|
356
|
-
"zustand": "4.5.6"
|
|
400
|
+
"zustand": "4.5.6",
|
|
401
|
+
"@b3/chain-registry": "0.0.1"
|
|
357
402
|
},
|
|
403
|
+
"bundledDependencies": [
|
|
404
|
+
"@b3/chain-registry"
|
|
405
|
+
],
|
|
358
406
|
"devDependencies": {
|
|
359
407
|
"@feathersjs/authentication-client": "5.0.33",
|
|
360
408
|
"@feathersjs/feathers": "5.0.33",
|
|
@@ -399,7 +447,6 @@
|
|
|
399
447
|
},
|
|
400
448
|
"peerDependencies": {
|
|
401
449
|
"@fingerprintjs/fingerprintjs-pro-react": "^2.7.0",
|
|
402
|
-
"@privy-io/react-auth": "^2.8.0",
|
|
403
450
|
"@react-three/postprocessing": "2.16.6",
|
|
404
451
|
"@tanstack/react-query": "5.55.0",
|
|
405
452
|
"@wagmi/core": "2.20.3",
|
|
@@ -427,14 +474,15 @@
|
|
|
427
474
|
"prebuild": "pnpm clean",
|
|
428
475
|
"fix-dist": "[ -d ./dist/react/src ] && cp -r ./dist/react/src/* ./dist/ && rm -rf ./dist/react || echo \"No react directory found\"",
|
|
429
476
|
"build": "pnpm clean && pnpm lint && pnpm build:types && pnpm build:cjs && pnpm build:esm && pnpm build:css",
|
|
430
|
-
"build:types": "tsc -p tsconfig.cjs.json --emitDeclarationOnly --declarationDir dist/types",
|
|
431
|
-
"build:cjs": "tsc -p tsconfig.cjs.json --outDir dist/cjs --module commonjs && tsc-alias -p tsconfig.cjs.json --outDir dist/cjs && mkdir -p dist/cjs/shared/generated && cp src/shared/generated/
|
|
432
|
-
"build:esm": "tsc -p tsconfig.esm.json --outDir dist/esm --module esnext
|
|
477
|
+
"build:types": "tsc -p tsconfig.cjs.json --skipLibCheck --emitDeclarationOnly --declarationDir dist/types || true",
|
|
478
|
+
"build:cjs": "(tsc -p tsconfig.cjs.json --skipLibCheck --outDir dist/cjs --module commonjs || true) && tsc-alias -p tsconfig.cjs.json --outDir dist/cjs && mkdir -p dist/cjs/shared/generated && cp src/shared/generated/coingecko-chains.json dist/cjs/shared/generated/ && ([ -d src/bondkit/json_abis ] && mkdir -p dist/cjs/bondkit/json_abis && cp -r src/bondkit/json_abis/* dist/cjs/bondkit/json_abis/ || echo \"No bondkit json_abis\")",
|
|
479
|
+
"build:esm": "(tsc -p tsconfig.esm.json --skipLibCheck --outDir dist/esm --module esnext || true) && tsc-alias -p tsconfig.esm.json --outDir dist/esm && mkdir -p dist/esm/shared/generated && cp src/shared/generated/coingecko-chains.json dist/esm/shared/generated/ && ([ -d src/bondkit/json_abis ] && mkdir -p dist/esm/bondkit/json_abis && cp -r src/bondkit/json_abis/* dist/esm/bondkit/json_abis/ || echo \"No bondkit json_abis\") && node scripts/fix-esm-imports.js",
|
|
433
480
|
"build:css": "postcss src/styles/index.css -o dist/styles/index.css",
|
|
434
481
|
"dev:cjs": "tsc-watch -p tsconfig.cjs.json --onSuccess \"tsc-alias -p tsconfig.cjs.json --outDir dist/cjs\"",
|
|
435
482
|
"dev:esm": "tsc-watch -p tsconfig.esm.json --onSuccess \"tsc-alias -p tsconfig.esm.json --outDir dist/esm\"",
|
|
436
483
|
"dev": "concurrently \"pnpm dev:cjs\" \"pnpm dev:esm\" \"pnpm dev:css\"",
|
|
437
484
|
"dev:css": "postcss src/styles/index.css -o dist/styles/index.css --watch",
|
|
485
|
+
"preflight": "node scripts/preflight-publish.js",
|
|
438
486
|
"release:test": "pnpm version prerelease --preid test && git push --follow-tags && pnpm publish --tag test --no-git-checks",
|
|
439
487
|
"release:alpha": "pnpm version prerelease --preid alpha && git push --follow-tags && pnpm publish --tag alpha --no-git-checks",
|
|
440
488
|
"typecheck": "tsc --noEmit",
|
|
@@ -17,10 +17,10 @@ export const AVALANCHE_PUBLIC_RPC = "https://avalanche-c-chain-rpc.publicnode.co
|
|
|
17
17
|
export const BSC_PUBLIC_RPC = "https://bsc-rpc.publicnode.com";
|
|
18
18
|
|
|
19
19
|
// Chain-specific public endpoints
|
|
20
|
-
export const B3_PUBLIC_RPC =
|
|
21
|
-
"https://late-dimensional-yard.b3-mainnet.quiknode.pro/461dbdbd44158cd7a7a764a58ffb01a67eef77f2/";
|
|
20
|
+
export const B3_PUBLIC_RPC = "https://mainnet-rpc.b3.fun";
|
|
22
21
|
export const ABSTRACT_PUBLIC_RPC = "https://api.mainnet.abs.xyz";
|
|
23
22
|
export const HYPEREVM_PUBLIC_RPC = "https://rpc.hyperliquid.xyz/evm";
|
|
23
|
+
export const PLUME_PUBLIC_RPC = "https://rpc.plume.org";
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Map of chain IDs to their default public RPC URLs.
|
|
@@ -36,4 +36,5 @@ export const PUBLIC_RPC_URLS: Record<number, string> = {
|
|
|
36
36
|
8333: B3_PUBLIC_RPC, // B3
|
|
37
37
|
2741: ABSTRACT_PUBLIC_RPC, // Abstract
|
|
38
38
|
999: HYPEREVM_PUBLIC_RPC, // HyperEVM
|
|
39
|
+
98866: PLUME_PUBLIC_RPC, // Plume Network
|
|
39
40
|
};
|
|
@@ -42,6 +42,7 @@ export function AnySpendBondKit({
|
|
|
42
42
|
slots,
|
|
43
43
|
content,
|
|
44
44
|
theme,
|
|
45
|
+
showFiatOption,
|
|
45
46
|
}: AnySpendBondKitProps & {
|
|
46
47
|
slots?: AnySpendSlots;
|
|
47
48
|
content?: AnySpendContent;
|
|
@@ -382,6 +383,7 @@ export function AnySpendBondKit({
|
|
|
382
383
|
slots={slots}
|
|
383
384
|
content={content}
|
|
384
385
|
theme={theme}
|
|
386
|
+
showFiatOption={showFiatOption}
|
|
385
387
|
/>
|
|
386
388
|
);
|
|
387
389
|
}
|
|
@@ -135,6 +135,7 @@ export function AnySpendBuySpin({
|
|
|
135
135
|
slots,
|
|
136
136
|
content,
|
|
137
137
|
theme,
|
|
138
|
+
showFiatOption,
|
|
138
139
|
}: {
|
|
139
140
|
loadOrder?: string;
|
|
140
141
|
mode?: "modal" | "page";
|
|
@@ -148,6 +149,7 @@ export function AnySpendBuySpin({
|
|
|
148
149
|
slots?: AnySpendSlots;
|
|
149
150
|
content?: AnySpendContent;
|
|
150
151
|
theme?: AnySpendTheme;
|
|
152
|
+
showFiatOption?: boolean;
|
|
151
153
|
}) {
|
|
152
154
|
const hasMounted = useHasMounted();
|
|
153
155
|
const { setB3ModalOpen } = useModalStore();
|
|
@@ -695,6 +697,7 @@ export function AnySpendBuySpin({
|
|
|
695
697
|
slots={slots}
|
|
696
698
|
content={content}
|
|
697
699
|
theme={theme}
|
|
700
|
+
showFiatOption={showFiatOption}
|
|
698
701
|
/>
|
|
699
702
|
);
|
|
700
703
|
}
|
|
@@ -96,6 +96,8 @@ export interface AnySpendCustomExactInProps {
|
|
|
96
96
|
content?: AnySpendContent;
|
|
97
97
|
/** Structured color/theme configuration */
|
|
98
98
|
theme?: AnySpendTheme;
|
|
99
|
+
/** Whether to show fiat payment option. Defaults to true. When false, paymentType is forced to "crypto". */
|
|
100
|
+
showFiatOption?: boolean;
|
|
99
101
|
}
|
|
100
102
|
|
|
101
103
|
export function AnySpendCustomExactIn(props: AnySpendCustomExactInProps) {
|
|
@@ -137,8 +139,10 @@ function AnySpendCustomExactInInner({
|
|
|
137
139
|
allowDirectTransfer = false,
|
|
138
140
|
callbackMetadata,
|
|
139
141
|
senderAddress,
|
|
142
|
+
showFiatOption = true,
|
|
140
143
|
}: AnySpendCustomExactInProps) {
|
|
141
144
|
const { slots, content } = useAnySpendCustomization();
|
|
145
|
+
const effectivePaymentType = showFiatOption ? paymentType : "crypto";
|
|
142
146
|
const actionLabel = customExactInConfig?.action ?? "Custom Execution";
|
|
143
147
|
const setB3ModalOpen = useModalStore(state => state.setB3ModalOpen);
|
|
144
148
|
|
|
@@ -191,7 +195,7 @@ function AnySpendCustomExactInInner({
|
|
|
191
195
|
createOnrampOrder,
|
|
192
196
|
isCreatingOnrampOrder,
|
|
193
197
|
} = useAnyspendFlow({
|
|
194
|
-
paymentType,
|
|
198
|
+
paymentType: effectivePaymentType,
|
|
195
199
|
recipientAddress,
|
|
196
200
|
loadOrder,
|
|
197
201
|
onTransactionSuccess: onSuccess,
|
|
@@ -213,11 +217,17 @@ function AnySpendCustomExactInInner({
|
|
|
213
217
|
// Check if source and destination are the same token on the same chain
|
|
214
218
|
const isSameChainSameToken = useMemo(() => {
|
|
215
219
|
return (
|
|
216
|
-
|
|
220
|
+
effectivePaymentType === "crypto" &&
|
|
217
221
|
selectedSrcChainId === selectedDstChainId &&
|
|
218
222
|
selectedSrcToken?.address?.toLowerCase() === selectedDstToken?.address?.toLowerCase()
|
|
219
223
|
);
|
|
220
|
-
}, [
|
|
224
|
+
}, [
|
|
225
|
+
effectivePaymentType,
|
|
226
|
+
selectedSrcChainId,
|
|
227
|
+
selectedDstChainId,
|
|
228
|
+
selectedSrcToken?.address,
|
|
229
|
+
selectedDstToken?.address,
|
|
230
|
+
]);
|
|
221
231
|
|
|
222
232
|
// Check if this is a direct transfer
|
|
223
233
|
const isDirectTransfer = isSameChainSameToken && allowDirectTransfer;
|
|
@@ -322,7 +332,7 @@ function AnySpendCustomExactInInner({
|
|
|
322
332
|
}
|
|
323
333
|
}
|
|
324
334
|
|
|
325
|
-
if (
|
|
335
|
+
if (effectivePaymentType === "crypto") {
|
|
326
336
|
if (effectiveCryptoPaymentMethod === CryptoPaymentMethodType.NONE) {
|
|
327
337
|
return { text: "Choose payment method", disable: false, error: false, loading: false };
|
|
328
338
|
}
|
|
@@ -342,7 +352,7 @@ function AnySpendCustomExactInInner({
|
|
|
342
352
|
return { text: buttonText, disable: false, error: false, loading: false };
|
|
343
353
|
}
|
|
344
354
|
|
|
345
|
-
if (
|
|
355
|
+
if (effectivePaymentType === "fiat") {
|
|
346
356
|
if (selectedFiatPaymentMethod === FiatPaymentMethod.NONE) {
|
|
347
357
|
return { text: "Select payment method", disable: false, error: false, loading: false };
|
|
348
358
|
}
|
|
@@ -358,7 +368,7 @@ function AnySpendCustomExactInInner({
|
|
|
358
368
|
isSwitchingOrExecuting,
|
|
359
369
|
selectedRecipientOrDefault,
|
|
360
370
|
anyspendQuote,
|
|
361
|
-
|
|
371
|
+
effectivePaymentType,
|
|
362
372
|
effectiveCryptoPaymentMethod,
|
|
363
373
|
selectedFiatPaymentMethod,
|
|
364
374
|
hasEnoughBalance,
|
|
@@ -386,13 +396,13 @@ function AnySpendCustomExactInInner({
|
|
|
386
396
|
return;
|
|
387
397
|
}
|
|
388
398
|
|
|
389
|
-
if (
|
|
399
|
+
if (effectivePaymentType === "crypto") {
|
|
390
400
|
if (effectiveCryptoPaymentMethod === CryptoPaymentMethodType.NONE) {
|
|
391
401
|
setActivePanel(PanelView.CRYPTO_PAYMENT_METHOD);
|
|
392
402
|
return;
|
|
393
403
|
}
|
|
394
404
|
await handleCryptoOrder();
|
|
395
|
-
} else if (
|
|
405
|
+
} else if (effectivePaymentType === "fiat") {
|
|
396
406
|
if (selectedFiatPaymentMethod === FiatPaymentMethod.NONE) {
|
|
397
407
|
setActivePanel(PanelView.FIAT_PAYMENT_METHOD);
|
|
398
408
|
return;
|
|
@@ -423,7 +433,7 @@ function AnySpendCustomExactInInner({
|
|
|
423
433
|
|
|
424
434
|
<div className="relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2">
|
|
425
435
|
<div className="relative flex w-full max-w-[calc(100vw-32px)] flex-col gap-2">
|
|
426
|
-
{
|
|
436
|
+
{effectivePaymentType === "crypto" ? (
|
|
427
437
|
<CryptoPaySection
|
|
428
438
|
selectedSrcChainId={selectedSrcChainId}
|
|
429
439
|
setSelectedSrcChainId={setSelectedSrcChainId}
|
|
@@ -469,7 +479,10 @@ function AnySpendCustomExactInInner({
|
|
|
469
479
|
)}
|
|
470
480
|
|
|
471
481
|
<div
|
|
472
|
-
className={cn(
|
|
482
|
+
className={cn(
|
|
483
|
+
"relative -my-1 flex h-0 items-center justify-center",
|
|
484
|
+
effectivePaymentType === "fiat" && "hidden",
|
|
485
|
+
)}
|
|
473
486
|
>
|
|
474
487
|
<Button
|
|
475
488
|
variant="ghost"
|
|
@@ -484,7 +497,7 @@ function AnySpendCustomExactInInner({
|
|
|
484
497
|
</Button>
|
|
485
498
|
</div>
|
|
486
499
|
|
|
487
|
-
{
|
|
500
|
+
{effectivePaymentType === "crypto" && (
|
|
488
501
|
<CryptoReceiveSection
|
|
489
502
|
isDepositMode={false}
|
|
490
503
|
isBuyMode={false}
|
|
@@ -551,7 +564,7 @@ function AnySpendCustomExactInInner({
|
|
|
551
564
|
</motion.div>
|
|
552
565
|
|
|
553
566
|
{/* Gas indicator - show when source chain has gas data, hide for direct transfers */}
|
|
554
|
-
{gasPriceData && !isLoadingGas &&
|
|
567
|
+
{gasPriceData && !isLoadingGas && effectivePaymentType === "crypto" && !isDirectTransfer && (
|
|
555
568
|
<GasIndicator gasPrice={gasPriceData} className={classes?.gasIndicator || "mt-2 w-full"} />
|
|
556
569
|
)}
|
|
557
570
|
|
|
@@ -735,7 +748,9 @@ function AnySpendCustomExactInInner({
|
|
|
735
748
|
relayTxs={oat.data.relayTxs}
|
|
736
749
|
executeTx={oat.data.executeTx}
|
|
737
750
|
refundTxs={oat.data.refundTxs}
|
|
738
|
-
cryptoPaymentMethod={
|
|
751
|
+
cryptoPaymentMethod={
|
|
752
|
+
effectivePaymentType === "fiat" ? CryptoPaymentMethodType.NONE : effectiveCryptoPaymentMethod
|
|
753
|
+
}
|
|
739
754
|
selectedCryptoPaymentMethod={effectiveCryptoPaymentMethod}
|
|
740
755
|
onPaymentMethodChange={setSelectedCryptoPaymentMethod}
|
|
741
756
|
onBack={() => {
|
|
@@ -806,7 +821,7 @@ function AnySpendCustomExactInInner({
|
|
|
806
821
|
<FeeDetailPanel
|
|
807
822
|
fee={anyspendQuote.data.fee}
|
|
808
823
|
transactionAmountUsd={
|
|
809
|
-
|
|
824
|
+
effectivePaymentType === "fiat"
|
|
810
825
|
? parseFloat(srcAmount)
|
|
811
826
|
: anyspendQuote.data.currencyIn?.amountUsd
|
|
812
827
|
? Number(anyspendQuote.data.currencyIn.amountUsd)
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
NetworkPolygonPos,
|
|
12
12
|
} from "@web3icons/react";
|
|
13
13
|
import { ChevronRight } from "lucide-react";
|
|
14
|
-
import { useMemo, useState } from "react";
|
|
14
|
+
import { useEffect, useMemo, useState } from "react";
|
|
15
15
|
import { AnySpend } from "./AnySpend";
|
|
16
16
|
import { AnySpendCustomExactIn } from "./AnySpendCustomExactIn";
|
|
17
17
|
import { ChainWarningText } from "./common/WarningText";
|
|
@@ -273,12 +273,20 @@ export function AnySpendDeposit({
|
|
|
273
273
|
const { connectedEOAWallet } = useAccountWallet();
|
|
274
274
|
const eoaAddress = connectedEOAWallet?.getAccount()?.address;
|
|
275
275
|
|
|
276
|
+
const effectiveInitialPaymentType = !showFiatOption && initialPaymentType === "fiat" ? "crypto" : initialPaymentType;
|
|
277
|
+
|
|
276
278
|
// Determine if we should show chain selection
|
|
277
|
-
const shouldShowChainSelection = showChainSelection ?? (!initialSourceChainId && !
|
|
279
|
+
const shouldShowChainSelection = showChainSelection ?? (!initialSourceChainId && !effectiveInitialPaymentType);
|
|
278
280
|
|
|
279
281
|
const [step, setStep] = useState<DepositStep>(shouldShowChainSelection ? "select-chain" : "deposit");
|
|
280
282
|
const [selectedChainId, setSelectedChainId] = useState<number | undefined>(initialSourceChainId);
|
|
281
|
-
const [paymentType, setPaymentType] = useState<"crypto" | "fiat">(
|
|
283
|
+
const [paymentType, setPaymentType] = useState<"crypto" | "fiat">(effectiveInitialPaymentType ?? "crypto");
|
|
284
|
+
|
|
285
|
+
useEffect(() => {
|
|
286
|
+
if (!showFiatOption && paymentType === "fiat") {
|
|
287
|
+
setPaymentType("crypto");
|
|
288
|
+
}
|
|
289
|
+
}, [showFiatOption, paymentType]);
|
|
282
290
|
|
|
283
291
|
// Fetch destination token data
|
|
284
292
|
const { data: destinationTokenData } = useTokenData(destinationTokenChainId, destinationTokenAddress);
|
|
@@ -723,6 +731,7 @@ export function AnySpendDeposit({
|
|
|
723
731
|
destinationTokenAmount={destinationTokenAmount}
|
|
724
732
|
callbackMetadata={callbackMetadata}
|
|
725
733
|
senderAddress={senderAddress}
|
|
734
|
+
showFiatOption={showFiatOption}
|
|
726
735
|
slots={slots}
|
|
727
736
|
content={content}
|
|
728
737
|
theme={theme}
|
|
@@ -751,6 +760,7 @@ export function AnySpendDeposit({
|
|
|
751
760
|
destinationTokenAmount={destinationTokenAmount}
|
|
752
761
|
callbackMetadata={callbackMetadata}
|
|
753
762
|
senderAddress={senderAddress}
|
|
763
|
+
showFiatOption={showFiatOption}
|
|
754
764
|
slots={slots}
|
|
755
765
|
content={content}
|
|
756
766
|
theme={theme}
|