@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
|
@@ -35,6 +35,7 @@ export function AnySpendDepositUpside({
|
|
|
35
35
|
token,
|
|
36
36
|
onSuccess,
|
|
37
37
|
senderAddress,
|
|
38
|
+
showFiatOption,
|
|
38
39
|
slots,
|
|
39
40
|
content,
|
|
40
41
|
theme,
|
|
@@ -49,6 +50,7 @@ export function AnySpendDepositUpside({
|
|
|
49
50
|
onSuccess?: (amount: string) => void;
|
|
50
51
|
/** Optional sender (payer) address — pre-fills token balances when the user address is known ahead of time */
|
|
51
52
|
senderAddress?: string;
|
|
53
|
+
showFiatOption?: boolean;
|
|
52
54
|
slots?: AnySpendSlots;
|
|
53
55
|
content?: AnySpendContent;
|
|
54
56
|
theme?: AnySpendTheme;
|
|
@@ -87,6 +89,7 @@ export function AnySpendDepositUpside({
|
|
|
87
89
|
header={header}
|
|
88
90
|
onSuccess={onSuccess}
|
|
89
91
|
senderAddress={senderAddress}
|
|
92
|
+
showFiatOption={showFiatOption}
|
|
90
93
|
slots={slots}
|
|
91
94
|
content={content}
|
|
92
95
|
theme={theme}
|
|
@@ -54,6 +54,7 @@ export function AnySpendStakeB3({
|
|
|
54
54
|
slots,
|
|
55
55
|
content,
|
|
56
56
|
theme,
|
|
57
|
+
showFiatOption,
|
|
57
58
|
}: {
|
|
58
59
|
loadOrder?: string;
|
|
59
60
|
mode?: "modal" | "page";
|
|
@@ -65,6 +66,7 @@ export function AnySpendStakeB3({
|
|
|
65
66
|
slots?: AnySpendSlots;
|
|
66
67
|
content?: AnySpendContent;
|
|
67
68
|
theme?: AnySpendTheme;
|
|
69
|
+
showFiatOption?: boolean;
|
|
68
70
|
}) {
|
|
69
71
|
const hasMounted = useHasMounted();
|
|
70
72
|
const { setB3ModalOpen } = useModalStore();
|
|
@@ -521,6 +523,7 @@ export function AnySpendStakeB3({
|
|
|
521
523
|
slots={slots}
|
|
522
524
|
content={content}
|
|
523
525
|
theme={theme}
|
|
526
|
+
showFiatOption={showFiatOption}
|
|
524
527
|
/>
|
|
525
528
|
);
|
|
526
529
|
}
|
|
@@ -56,6 +56,7 @@ export function AnySpendStakeB3ExactIn({
|
|
|
56
56
|
stakeAmount,
|
|
57
57
|
onSuccess,
|
|
58
58
|
senderAddress,
|
|
59
|
+
showFiatOption,
|
|
59
60
|
slots,
|
|
60
61
|
content,
|
|
61
62
|
theme,
|
|
@@ -69,6 +70,7 @@ export function AnySpendStakeB3ExactIn({
|
|
|
69
70
|
onSuccess?: (amount: string) => void;
|
|
70
71
|
/** Optional sender (payer) address — pre-fills token balances when the user address is known ahead of time */
|
|
71
72
|
senderAddress?: string;
|
|
73
|
+
showFiatOption?: boolean;
|
|
72
74
|
slots?: AnySpendSlots;
|
|
73
75
|
content?: AnySpendContent;
|
|
74
76
|
theme?: AnySpendTheme;
|
|
@@ -529,6 +531,7 @@ export function AnySpendStakeB3ExactIn({
|
|
|
529
531
|
header={header}
|
|
530
532
|
onSuccess={onSuccess}
|
|
531
533
|
senderAddress={senderAddress}
|
|
534
|
+
showFiatOption={showFiatOption}
|
|
532
535
|
slots={slots}
|
|
533
536
|
content={content}
|
|
534
537
|
theme={theme}
|
|
@@ -28,6 +28,7 @@ export function AnySpendStakeUpsideExactIn({
|
|
|
28
28
|
token,
|
|
29
29
|
onSuccess,
|
|
30
30
|
senderAddress,
|
|
31
|
+
showFiatOption,
|
|
31
32
|
slots,
|
|
32
33
|
content,
|
|
33
34
|
theme,
|
|
@@ -43,6 +44,7 @@ export function AnySpendStakeUpsideExactIn({
|
|
|
43
44
|
onSuccess?: (amount: string) => void;
|
|
44
45
|
/** Optional sender (payer) address — pre-fills token balances when the user address is known ahead of time */
|
|
45
46
|
senderAddress?: string;
|
|
47
|
+
showFiatOption?: boolean;
|
|
46
48
|
slots?: AnySpendSlots;
|
|
47
49
|
content?: AnySpendContent;
|
|
48
50
|
theme?: AnySpendTheme;
|
|
@@ -82,6 +84,7 @@ export function AnySpendStakeUpsideExactIn({
|
|
|
82
84
|
header={header}
|
|
83
85
|
onSuccess={onSuccess}
|
|
84
86
|
senderAddress={senderAddress}
|
|
87
|
+
showFiatOption={showFiatOption}
|
|
85
88
|
slots={slots}
|
|
86
89
|
content={content}
|
|
87
90
|
theme={theme}
|
|
@@ -30,6 +30,8 @@ export interface AnySpendWorkflowTriggerProps {
|
|
|
30
30
|
actionLabel?: string;
|
|
31
31
|
/** Custom class names */
|
|
32
32
|
classes?: AnySpendAllClasses;
|
|
33
|
+
/** Whether to show fiat payment option. Defaults to true. */
|
|
34
|
+
showFiatOption?: boolean;
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
export function AnySpendWorkflowTrigger({
|
|
@@ -45,6 +47,7 @@ export function AnySpendWorkflowTrigger({
|
|
|
45
47
|
mode,
|
|
46
48
|
actionLabel,
|
|
47
49
|
classes,
|
|
50
|
+
showFiatOption,
|
|
48
51
|
}: AnySpendWorkflowTriggerProps) {
|
|
49
52
|
const metadata = useMemo(
|
|
50
53
|
() => ({
|
|
@@ -68,6 +71,7 @@ export function AnySpendWorkflowTrigger({
|
|
|
68
71
|
actionLabel={actionLabel}
|
|
69
72
|
classes={classes}
|
|
70
73
|
allowDirectTransfer
|
|
74
|
+
showFiatOption={showFiatOption}
|
|
71
75
|
/>
|
|
72
76
|
);
|
|
73
77
|
}
|
|
@@ -32,6 +32,7 @@ export interface AnySpendDepositHypeProps {
|
|
|
32
32
|
customRecipientLabel?: string;
|
|
33
33
|
/** Optional sender (payer) address — pre-fills token balances when the user address is known ahead of time */
|
|
34
34
|
senderAddress?: string;
|
|
35
|
+
showFiatOption?: boolean;
|
|
35
36
|
slots?: AnySpendSlots;
|
|
36
37
|
content?: AnySpendContent;
|
|
37
38
|
theme?: AnySpendTheme;
|
|
@@ -51,6 +52,7 @@ export function AnySpendDepositHype({
|
|
|
51
52
|
customUsdInputValues,
|
|
52
53
|
preferEoa,
|
|
53
54
|
senderAddress,
|
|
55
|
+
showFiatOption,
|
|
54
56
|
slots,
|
|
55
57
|
content,
|
|
56
58
|
theme,
|
|
@@ -97,6 +99,7 @@ export function AnySpendDepositHype({
|
|
|
97
99
|
customUsdInputValues={customUsdInputValues}
|
|
98
100
|
preferEoa={preferEoa}
|
|
99
101
|
senderAddress={senderAddress}
|
|
102
|
+
showFiatOption={showFiatOption}
|
|
100
103
|
slots={slots}
|
|
101
104
|
content={content}
|
|
102
105
|
theme={theme}
|
|
@@ -48,6 +48,7 @@ export function AnyspendSignatureMint({
|
|
|
48
48
|
signatureData,
|
|
49
49
|
imageUrl,
|
|
50
50
|
onSuccess,
|
|
51
|
+
showFiatOption,
|
|
51
52
|
slots,
|
|
52
53
|
content,
|
|
53
54
|
theme,
|
|
@@ -57,6 +58,7 @@ export function AnyspendSignatureMint({
|
|
|
57
58
|
signatureData: GenerateSigMintResponse;
|
|
58
59
|
imageUrl?: string;
|
|
59
60
|
onSuccess?: (txHash?: string) => void;
|
|
61
|
+
showFiatOption?: boolean;
|
|
60
62
|
slots?: AnySpendSlots;
|
|
61
63
|
content?: AnySpendContent;
|
|
62
64
|
theme?: AnySpendTheme;
|
|
@@ -156,6 +158,7 @@ export function AnyspendSignatureMint({
|
|
|
156
158
|
header={header}
|
|
157
159
|
onSuccess={onSuccess}
|
|
158
160
|
showRecipient={true}
|
|
161
|
+
showFiatOption={showFiatOption}
|
|
159
162
|
slots={slots}
|
|
160
163
|
content={content}
|
|
161
164
|
theme={theme}
|
|
@@ -140,6 +140,8 @@ export interface AnySpendCheckoutProps {
|
|
|
140
140
|
kycEnabled?: boolean;
|
|
141
141
|
/** Extra metadata included under the 'callbackMetadata' key in the order's callbackMetadata (e.g. workflowId, orgId from checkout session) */
|
|
142
142
|
callbackMetadata?: Record<string, unknown>;
|
|
143
|
+
/** Whether to show fiat payment options (card + coinbase). Defaults to true. */
|
|
144
|
+
showFiatOption?: boolean;
|
|
143
145
|
}
|
|
144
146
|
|
|
145
147
|
const emptyAddress: AddressData = { street: "", city: "", state: "", zip: "", country: "" };
|
|
@@ -190,6 +192,7 @@ export function AnySpendCheckout({
|
|
|
190
192
|
feeOnTop,
|
|
191
193
|
kycEnabled = false,
|
|
192
194
|
callbackMetadata: callbackMetadataProp,
|
|
195
|
+
showFiatOption,
|
|
193
196
|
}: AnySpendCheckoutProps) {
|
|
194
197
|
// ===== Variable pricing state =====
|
|
195
198
|
const [variablePricingAmount, setVariablePricingAmount] = useState<string>("0");
|
|
@@ -452,6 +455,7 @@ export function AnySpendCheckout({
|
|
|
452
455
|
isFormValid={isFormValid}
|
|
453
456
|
feeOnTop={feeOnTop}
|
|
454
457
|
kycEnabled={kycEnabled}
|
|
458
|
+
showFiatOption={showFiatOption}
|
|
455
459
|
/>
|
|
456
460
|
</>
|
|
457
461
|
}
|
|
@@ -75,6 +75,8 @@ export interface AnySpendCheckoutTriggerProps {
|
|
|
75
75
|
summaryLines?: CheckoutSummaryLine[];
|
|
76
76
|
/** When true, identity verification (KYC) is required before card payment. Defaults to false. */
|
|
77
77
|
kycEnabled?: boolean;
|
|
78
|
+
/** Whether to show fiat payment options (card + coinbase). Defaults to true. */
|
|
79
|
+
showFiatOption?: boolean;
|
|
78
80
|
}
|
|
79
81
|
|
|
80
82
|
export function AnySpendCheckoutTrigger({
|
|
@@ -106,6 +108,7 @@ export function AnySpendCheckoutTrigger({
|
|
|
106
108
|
discount,
|
|
107
109
|
summaryLines,
|
|
108
110
|
kycEnabled = false,
|
|
111
|
+
showFiatOption,
|
|
109
112
|
}: AnySpendCheckoutTriggerProps) {
|
|
110
113
|
// Merge workflowId + orgId into callbackMetadata
|
|
111
114
|
const mergedMetadata = useMemo(() => {
|
|
@@ -216,6 +219,7 @@ export function AnySpendCheckoutTrigger({
|
|
|
216
219
|
defaultPaymentMethod={defaultPaymentMethod}
|
|
217
220
|
senderAddress={senderAddress}
|
|
218
221
|
kycEnabled={kycEnabled}
|
|
222
|
+
showFiatOption={showFiatOption}
|
|
219
223
|
/>
|
|
220
224
|
</div>
|
|
221
225
|
</div>
|
|
@@ -41,6 +41,8 @@ interface CheckoutPaymentPanelProps {
|
|
|
41
41
|
feeOnTop?: boolean;
|
|
42
42
|
/** When true, identity verification (KYC) is required before card payment. Defaults to false. */
|
|
43
43
|
kycEnabled?: boolean;
|
|
44
|
+
/** Whether to show fiat payment options (card + coinbase). Defaults to true. */
|
|
45
|
+
showFiatOption?: boolean;
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
function RadioCircle({ selected, themeColor }: { selected: boolean; themeColor?: string }) {
|
|
@@ -138,8 +140,20 @@ export function CheckoutPaymentPanel({
|
|
|
138
140
|
isFormValid = true,
|
|
139
141
|
feeOnTop,
|
|
140
142
|
kycEnabled = false,
|
|
143
|
+
showFiatOption = true,
|
|
141
144
|
}: CheckoutPaymentPanelProps) {
|
|
142
|
-
const [paymentMethod, setPaymentMethod] = useState<PaymentMethod | null>(
|
|
145
|
+
const [paymentMethod, setPaymentMethod] = useState<PaymentMethod | null>(() => {
|
|
146
|
+
if (!showFiatOption && (defaultPaymentMethod === "card" || defaultPaymentMethod === "coinbase")) {
|
|
147
|
+
return "crypto";
|
|
148
|
+
}
|
|
149
|
+
return defaultPaymentMethod ?? null;
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
useEffect(() => {
|
|
153
|
+
if (!showFiatOption && (paymentMethod === "card" || paymentMethod === "coinbase")) {
|
|
154
|
+
setPaymentMethod("crypto");
|
|
155
|
+
}
|
|
156
|
+
}, [showFiatOption, paymentMethod]);
|
|
143
157
|
|
|
144
158
|
// Restore activeOrderId from sessionStorage (handles page refresh / Coinbase return)
|
|
145
159
|
const [activeOrderId, setActiveOrderId] = useState<string | null>(() => {
|
|
@@ -259,88 +273,92 @@ export function CheckoutPaymentPanel({
|
|
|
259
273
|
</AnimatePresence>
|
|
260
274
|
</div>
|
|
261
275
|
|
|
262
|
-
{
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
<CreditCard className="h-5 w-5 text-gray-700 dark:text-gray-300" />
|
|
270
|
-
<span className="text-sm font-medium text-gray-900 dark:text-gray-100">Credit or debit card</span>
|
|
271
|
-
<div className="ml-auto flex items-center gap-1">
|
|
272
|
-
<VisaLogo />
|
|
273
|
-
<MastercardLogo />
|
|
274
|
-
<AmexLogo />
|
|
275
|
-
</div>
|
|
276
|
-
</button>
|
|
277
|
-
<AnimatePresence initial={false}>
|
|
278
|
-
{paymentMethod === "card" && (
|
|
279
|
-
<motion.div
|
|
280
|
-
key="card-panel"
|
|
281
|
-
initial={{ height: 0, opacity: 0 }}
|
|
282
|
-
animate={{ height: "auto", opacity: 1 }}
|
|
283
|
-
exit={{ height: 0, opacity: 0 }}
|
|
284
|
-
transition={{ duration: 0.2, ease: "easeOut" }}
|
|
285
|
-
style={{ overflow: "hidden" }}
|
|
276
|
+
{showFiatOption && (
|
|
277
|
+
<>
|
|
278
|
+
{/* Credit or Debit Card */}
|
|
279
|
+
<div className="anyspend-method-card">
|
|
280
|
+
<button
|
|
281
|
+
onClick={() => setPaymentMethod(paymentMethod === "card" ? null : "card")}
|
|
282
|
+
className={accordionButtonClass(paymentMethod === "card")}
|
|
286
283
|
>
|
|
287
|
-
<
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
onOrderCreated={handleOrderCreated}
|
|
295
|
-
onError={onError}
|
|
296
|
-
callbackMetadata={callbackMetadata}
|
|
297
|
-
classes={classes}
|
|
298
|
-
feeOnTop={feeOnTop}
|
|
299
|
-
kycEnabled={kycEnabled}
|
|
300
|
-
/>
|
|
284
|
+
<RadioCircle selected={paymentMethod === "card"} themeColor={themeColor} />
|
|
285
|
+
<CreditCard className="h-5 w-5 text-gray-700 dark:text-gray-300" />
|
|
286
|
+
<span className="text-sm font-medium text-gray-900 dark:text-gray-100">Credit or debit card</span>
|
|
287
|
+
<div className="ml-auto flex items-center gap-1">
|
|
288
|
+
<VisaLogo />
|
|
289
|
+
<MastercardLogo />
|
|
290
|
+
<AmexLogo />
|
|
301
291
|
</div>
|
|
302
|
-
</
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
292
|
+
</button>
|
|
293
|
+
<AnimatePresence initial={false}>
|
|
294
|
+
{paymentMethod === "card" && (
|
|
295
|
+
<motion.div
|
|
296
|
+
key="card-panel"
|
|
297
|
+
initial={{ height: 0, opacity: 0 }}
|
|
298
|
+
animate={{ height: "auto", opacity: 1 }}
|
|
299
|
+
exit={{ height: 0, opacity: 0 }}
|
|
300
|
+
transition={{ duration: 0.2, ease: "easeOut" }}
|
|
301
|
+
style={{ overflow: "hidden" }}
|
|
302
|
+
>
|
|
303
|
+
<div className={expandedPanelClass}>
|
|
304
|
+
<FiatCheckoutPanel
|
|
305
|
+
recipientAddress={recipientAddress}
|
|
306
|
+
destinationTokenAddress={destinationTokenAddress}
|
|
307
|
+
destinationTokenChainId={destinationTokenChainId}
|
|
308
|
+
totalAmount={totalAmount}
|
|
309
|
+
themeColor={themeColor}
|
|
310
|
+
onOrderCreated={handleOrderCreated}
|
|
311
|
+
onError={onError}
|
|
312
|
+
callbackMetadata={callbackMetadata}
|
|
313
|
+
classes={classes}
|
|
314
|
+
feeOnTop={feeOnTop}
|
|
315
|
+
kycEnabled={kycEnabled}
|
|
316
|
+
/>
|
|
317
|
+
</div>
|
|
318
|
+
</motion.div>
|
|
319
|
+
)}
|
|
320
|
+
</AnimatePresence>
|
|
321
|
+
</div>
|
|
306
322
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
>
|
|
313
|
-
<RadioCircle selected={paymentMethod === "coinbase"} themeColor={themeColor} />
|
|
314
|
-
<CoinbaseLogo />
|
|
315
|
-
<span className="text-sm font-medium text-gray-900 dark:text-gray-100">Coinbase Pay</span>
|
|
316
|
-
</button>
|
|
317
|
-
<AnimatePresence initial={false}>
|
|
318
|
-
{paymentMethod === "coinbase" && (
|
|
319
|
-
<motion.div
|
|
320
|
-
key="coinbase-panel"
|
|
321
|
-
initial={{ height: 0, opacity: 0 }}
|
|
322
|
-
animate={{ height: "auto", opacity: 1 }}
|
|
323
|
-
exit={{ height: 0, opacity: 0 }}
|
|
324
|
-
transition={{ duration: 0.2, ease: "easeOut" }}
|
|
325
|
-
style={{ overflow: "hidden" }}
|
|
323
|
+
{/* Coinbase Pay */}
|
|
324
|
+
<div className="anyspend-method-coinbase">
|
|
325
|
+
<button
|
|
326
|
+
onClick={() => setPaymentMethod(paymentMethod === "coinbase" ? null : "coinbase")}
|
|
327
|
+
className={accordionButtonClass(paymentMethod === "coinbase")}
|
|
326
328
|
>
|
|
327
|
-
<
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
329
|
+
<RadioCircle selected={paymentMethod === "coinbase"} themeColor={themeColor} />
|
|
330
|
+
<CoinbaseLogo />
|
|
331
|
+
<span className="text-sm font-medium text-gray-900 dark:text-gray-100">Coinbase Pay</span>
|
|
332
|
+
</button>
|
|
333
|
+
<AnimatePresence initial={false}>
|
|
334
|
+
{paymentMethod === "coinbase" && (
|
|
335
|
+
<motion.div
|
|
336
|
+
key="coinbase-panel"
|
|
337
|
+
initial={{ height: 0, opacity: 0 }}
|
|
338
|
+
animate={{ height: "auto", opacity: 1 }}
|
|
339
|
+
exit={{ height: 0, opacity: 0 }}
|
|
340
|
+
transition={{ duration: 0.2, ease: "easeOut" }}
|
|
341
|
+
style={{ overflow: "hidden" }}
|
|
342
|
+
>
|
|
343
|
+
<div className={expandedPanelClass}>
|
|
344
|
+
<CoinbaseCheckoutPanel
|
|
345
|
+
recipientAddress={recipientAddress}
|
|
346
|
+
destinationTokenAddress={destinationTokenAddress}
|
|
347
|
+
destinationTokenChainId={destinationTokenChainId}
|
|
348
|
+
totalAmount={totalAmount}
|
|
349
|
+
themeColor={themeColor}
|
|
350
|
+
onOrderCreated={handleOrderCreated}
|
|
351
|
+
onError={onError}
|
|
352
|
+
callbackMetadata={callbackMetadata}
|
|
353
|
+
classes={classes}
|
|
354
|
+
/>
|
|
355
|
+
</div>
|
|
356
|
+
</motion.div>
|
|
357
|
+
)}
|
|
358
|
+
</AnimatePresence>
|
|
359
|
+
</div>
|
|
360
|
+
</>
|
|
361
|
+
)}
|
|
344
362
|
</div>
|
|
345
363
|
</div>
|
|
346
364
|
);
|
|
@@ -26,20 +26,20 @@ export function useAnyspendQuote(req: GetQuoteRequest): UseAnyspendQuoteResult {
|
|
|
26
26
|
},
|
|
27
27
|
enabled: Boolean(
|
|
28
28
|
req.srcChain &&
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
req.dstChain &&
|
|
30
|
+
req.srcTokenAddress &&
|
|
31
|
+
req.dstTokenAddress &&
|
|
32
|
+
BigInt(
|
|
33
|
+
req.type === "swap" || req.type === "hype_duel" || req.type === "x402_swap" || req.type === "custom_exact_in"
|
|
34
|
+
? req.amount
|
|
35
|
+
: req.type === "mint_nft"
|
|
36
|
+
? req.price
|
|
37
|
+
: req.type === "join_tournament"
|
|
36
38
|
? req.price
|
|
37
|
-
: req.type === "
|
|
38
|
-
? req.
|
|
39
|
-
: req.
|
|
40
|
-
|
|
41
|
-
: req.payload.amount,
|
|
42
|
-
) !== BigInt(0),
|
|
39
|
+
: req.type === "fund_tournament"
|
|
40
|
+
? req.fundAmount
|
|
41
|
+
: req.payload.amount,
|
|
42
|
+
) !== BigInt(0),
|
|
43
43
|
),
|
|
44
44
|
refetchInterval: 10000,
|
|
45
45
|
retry: false,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { anyspendService } from "@b3dotfun/sdk/anyspend/services/anyspend";
|
|
2
|
-
import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
3
|
-
import { CreateOrderResponse } from "@b3dotfun/sdk/anyspend/types/api_req_res";
|
|
4
|
-
import { VisitorData } from "@b3dotfun/sdk/anyspend/types/fingerprint";
|
|
2
|
+
import type { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
3
|
+
import type { CreateOrderResponse } from "@b3dotfun/sdk/anyspend/types/api_req_res";
|
|
4
|
+
import type { VisitorData } from "@b3dotfun/sdk/anyspend/types/fingerprint";
|
|
5
5
|
import { normalizeAddress } from "@b3dotfun/sdk/anyspend/utils";
|
|
6
6
|
import { useB3Config } from "@b3dotfun/sdk/global-account/react";
|
|
7
7
|
import { useVisitorData } from "@fingerprintjs/fingerprintjs-pro-react";
|
|
8
8
|
import { useMutation } from "@tanstack/react-query";
|
|
9
9
|
import { useMemo } from "react";
|
|
10
|
-
import { DepositContractConfig } from "../components/AnySpendDeposit";
|
|
10
|
+
import type { DepositContractConfig } from "../components/AnySpendDeposit";
|
|
11
11
|
|
|
12
12
|
export type CreateDepositFirstOrderParams = {
|
|
13
13
|
recipientAddress: string;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { paths } from "./api";
|
|
2
2
|
|
|
3
|
-
export type GetOrderAndTxsResponse =
|
|
3
|
+
export type GetOrderAndTxsResponse =
|
|
4
|
+
paths["/orders/{orderId}"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
4
5
|
export type GetQuoteRequest = paths["/orders/quote"]["post"]["requestBody"]["content"]["application/json"];
|
|
5
6
|
export type GetQuoteResponse = paths["/orders/quote"]["post"]["responses"]["200"]["content"]["application/json"];
|
|
6
7
|
|
|
7
|
-
export type GetCoinbaseOnrampOptionsResponse =
|
|
8
|
+
export type GetCoinbaseOnrampOptionsResponse =
|
|
9
|
+
paths["/onramp/coinbase/options"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
8
10
|
export type GetOrderHistoryResponse = paths["/orders"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
9
|
-
export type GetTokenListResponse =
|
|
11
|
+
export type GetTokenListResponse =
|
|
12
|
+
paths["/chains/{chainId}/tokens"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
10
13
|
export type CreateOrderResponse = paths["/orders"]["post"]["responses"]["200"]["content"]["application/json"];
|
|
11
|
-
export type GetStripeSupportedResponse =
|
|
12
|
-
|
|
14
|
+
export type GetStripeSupportedResponse =
|
|
15
|
+
paths["/onramp/stripe/supported"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
16
|
+
export type GetStripeClientSecret =
|
|
17
|
+
paths["/stripe/clientSecret"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
ETHEREUM_PUBLIC_RPC,
|
|
9
9
|
HYPEREVM_PUBLIC_RPC,
|
|
10
10
|
OPTIMISM_PUBLIC_RPC,
|
|
11
|
+
PLUME_PUBLIC_RPC,
|
|
11
12
|
POLYGON_PUBLIC_RPC,
|
|
12
13
|
} from "@b3dotfun/sdk/anyspend/constants/rpc";
|
|
13
14
|
import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
@@ -33,10 +34,12 @@ import {
|
|
|
33
34
|
getEthToken,
|
|
34
35
|
getHyperEVMNativeToken,
|
|
35
36
|
getHyperliquidUSDCToken,
|
|
37
|
+
getPlumeNativeToken,
|
|
36
38
|
getPolToken,
|
|
37
39
|
getSolanaToken,
|
|
38
40
|
HYPEREVM_CHAIN_ID,
|
|
39
41
|
HYPERLIQUID_CHAIN_ID,
|
|
42
|
+
PLUME_CHAIN_ID,
|
|
40
43
|
} from "./token";
|
|
41
44
|
|
|
42
45
|
function getCustomEvmChain(chain: Chain, rpcUrl: string): Chain {
|
|
@@ -84,11 +87,19 @@ export function clearChainRpcOverrides(): void {
|
|
|
84
87
|
export const hyperEVM = defineChain({
|
|
85
88
|
id: HYPEREVM_CHAIN_ID,
|
|
86
89
|
name: "HyperEVM",
|
|
87
|
-
nativeCurrency: { name: "
|
|
90
|
+
nativeCurrency: { name: "Hyperliquid", symbol: "HYPE", decimals: 18 },
|
|
88
91
|
rpcUrls: { default: { http: [HYPEREVM_PUBLIC_RPC] } },
|
|
89
92
|
blockExplorers: { default: { name: "HyperEVM Explorer", url: "https://hyperevmscan.io/" } },
|
|
90
93
|
});
|
|
91
94
|
|
|
95
|
+
export const plume = defineChain({
|
|
96
|
+
id: PLUME_CHAIN_ID,
|
|
97
|
+
name: "Plume",
|
|
98
|
+
nativeCurrency: { name: "Plume", symbol: "PLUME", decimals: 18 },
|
|
99
|
+
rpcUrls: { default: { http: [PLUME_PUBLIC_RPC] } },
|
|
100
|
+
blockExplorers: { default: { name: "Plume Explorer", url: "https://explorer.plume.org" } },
|
|
101
|
+
});
|
|
102
|
+
|
|
92
103
|
// export const b4testnet = defineChain({
|
|
93
104
|
// id: 19934,
|
|
94
105
|
// name: "B4 Testnet",
|
|
@@ -247,6 +258,20 @@ export const EVM_MAINNET: Record<number, IEVMChain> = {
|
|
|
247
258
|
coingeckoName: "hyperevm",
|
|
248
259
|
wethAddress: "0x5555555555555555555555555555555555555555",
|
|
249
260
|
},
|
|
261
|
+
[plume.id]: {
|
|
262
|
+
id: plume.id,
|
|
263
|
+
name: plume.name,
|
|
264
|
+
logoUrl: "https://cdn.b3.fun/b3os-icons/plume.svg",
|
|
265
|
+
type: ChainType.EVM,
|
|
266
|
+
nativeRequired: parseEther("5"), // 5 PLUME ≈ $0.06 — gas reserve; Plume gasPrice ~1000 gwei × 2.2M gas (approve+deposit) needs ~2.2 PLUME, +headroom for spikes
|
|
267
|
+
canDepositNative: true,
|
|
268
|
+
defaultToken: getPlumeNativeToken(),
|
|
269
|
+
nativeToken: getPlumeNativeToken(),
|
|
270
|
+
viem: plume,
|
|
271
|
+
pollingInterval: 1000, // 1 second for Plume (L2 fast blocks)
|
|
272
|
+
coingeckoName: "plume-network",
|
|
273
|
+
wethAddress: "0xea237441c92cae6fc17caaf9a7acb3f953be4bd1", // WPLUME (wrapped native)
|
|
274
|
+
},
|
|
250
275
|
};
|
|
251
276
|
|
|
252
277
|
export const EVM_TESTNET: Record<number, IEVMChain> = {
|
|
@@ -4,6 +4,7 @@ import { avalanche, bsc, polygon } from "viem/chains";
|
|
|
4
4
|
|
|
5
5
|
export const HYPERLIQUID_CHAIN_ID = 1337;
|
|
6
6
|
export const HYPEREVM_CHAIN_ID = 999;
|
|
7
|
+
export const PLUME_CHAIN_ID = 98866;
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Hyperliquid uses a special 34-character USDC address format (0x + 32 hex digits)
|
|
@@ -106,3 +107,16 @@ export function getHyperliquidUSDCToken(): components["schemas"]["Token"] {
|
|
|
106
107
|
},
|
|
107
108
|
};
|
|
108
109
|
}
|
|
110
|
+
|
|
111
|
+
export function getPlumeNativeToken(): components["schemas"]["Token"] {
|
|
112
|
+
return {
|
|
113
|
+
chainId: PLUME_CHAIN_ID,
|
|
114
|
+
address: ZERO_ADDRESS,
|
|
115
|
+
symbol: "PLUME",
|
|
116
|
+
name: "Plume",
|
|
117
|
+
decimals: 18,
|
|
118
|
+
metadata: {
|
|
119
|
+
logoURI: "https://cdn.b3.fun/b3os-icons/plume.svg",
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
}
|
package/src/app.shared.ts
CHANGED
|
@@ -4,15 +4,35 @@ import Cookies from "js-cookie";
|
|
|
4
4
|
import { B3_AUTH_COOKIE_NAME } from "./shared/constants";
|
|
5
5
|
import { getSessionDurationDays } from "./shared/utils/session-duration";
|
|
6
6
|
|
|
7
|
+
/** Default API URL derived from environment variables. */
|
|
7
8
|
export const B3_API_URL =
|
|
8
9
|
process.env.EXPO_PUBLIC_B3_API || process.env.NEXT_PUBLIC_B3_API || process.env.PUBLIC_B3_API || "https://api.b3.fun";
|
|
9
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Runtime-overridable API URL. Set by `B3Provider` when an `apiUrl` prop
|
|
13
|
+
* is provided. Falls back to the env-var-derived `B3_API_URL`.
|
|
14
|
+
*/
|
|
15
|
+
let _apiUrlOverride: string | null = null;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Override the B3 API URL at runtime. Called by `B3Provider` when an
|
|
19
|
+
* `apiUrl` prop is provided. Pass `null` to revert to the default.
|
|
20
|
+
*/
|
|
21
|
+
export function setB3ApiUrl(url: string | null): void {
|
|
22
|
+
_apiUrlOverride = url;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Get the current B3 API URL (prefers runtime override, then env var). */
|
|
26
|
+
export function getB3ApiUrl(): string {
|
|
27
|
+
return _apiUrlOverride || B3_API_URL;
|
|
28
|
+
}
|
|
29
|
+
|
|
10
30
|
export const authenticate = async (
|
|
11
31
|
app: ClientApplication,
|
|
12
32
|
accessToken: string,
|
|
13
33
|
identityToken: string,
|
|
14
34
|
params?: Record<string, any>,
|
|
15
|
-
) => {
|
|
35
|
+
): Promise<Record<string, any> | null> => {
|
|
16
36
|
const fullToken = `${accessToken}+${identityToken}`;
|
|
17
37
|
|
|
18
38
|
// Do not authenticate if there is no token
|
|
@@ -77,7 +77,11 @@ const app = createClient(socketio(socket), {
|
|
|
77
77
|
storageKey: B3_AUTH_COOKIE_NAME,
|
|
78
78
|
});
|
|
79
79
|
|
|
80
|
-
export const authenticate = async (
|
|
80
|
+
export const authenticate = async (
|
|
81
|
+
accessToken: string,
|
|
82
|
+
identityToken: string,
|
|
83
|
+
params?: Record<string, any>,
|
|
84
|
+
): Promise<Record<string, any> | null> => {
|
|
81
85
|
const fullToken = `${accessToken}+${identityToken}`;
|
|
82
86
|
|
|
83
87
|
// Do not authenticate if there is no token
|