@b3dotfun/sdk 0.0.8 → 0.0.9-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/dist/cjs/anyspend/abis/bondKit.d.ts +35 -0
- package/dist/cjs/anyspend/abis/bondKit.js +29 -0
- package/dist/cjs/anyspend/constants/index.d.ts +16 -5
- package/dist/cjs/anyspend/constants/index.js +3 -4
- package/dist/cjs/anyspend/index.d.ts +3 -7
- package/dist/cjs/anyspend/index.js +3 -7
- package/dist/cjs/anyspend/index.native.d.ts +3 -3
- package/dist/cjs/anyspend/index.native.js +3 -3
- package/dist/cjs/anyspend/react/components/AnySpend.js +12 -12
- package/dist/cjs/anyspend/react/components/AnySpendBondKit.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/AnySpendBondKit.js +209 -0
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +3 -10
- package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +5 -4
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +49 -49
- package/dist/cjs/anyspend/react/components/AnySpendNFT.d.ts +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendNFT.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +2 -2
- package/dist/cjs/anyspend/react/components/AnySpendTournament.d.ts +5 -5
- package/dist/cjs/anyspend/react/components/AnySpendTournament.js +2 -3
- package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/AnyspendSignatureMint.js +10 -8
- package/dist/cjs/anyspend/react/components/{AnySpendNFTButton.d.ts → common/AnySpendNFTButton.d.ts} +2 -2
- package/dist/cjs/anyspend/react/components/{AnySpendNFTButton.js → common/AnySpendNFTButton.js} +2 -2
- package/dist/cjs/anyspend/react/components/common/OrderDetails.d.ts +6 -6
- package/dist/cjs/anyspend/react/components/common/OrderDetails.js +45 -47
- package/dist/cjs/anyspend/react/components/common/OrderHistoryItem.d.ts +2 -2
- package/dist/cjs/anyspend/react/components/common/OrderHistoryItem.js +10 -12
- package/dist/cjs/anyspend/react/components/common/OrderStatus.d.ts +2 -2
- package/dist/cjs/anyspend/react/components/common/OrderStatus.js +1 -1
- package/dist/cjs/anyspend/react/components/common/OrderToken.d.ts +3 -3
- package/dist/cjs/anyspend/react/components/common/OrderTokenAmount.d.ts +3 -3
- package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.d.ts +6 -5
- package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.js +8 -9
- package/dist/cjs/anyspend/react/components/common/PaymentOneClick.d.ts +2 -2
- package/dist/cjs/anyspend/react/components/common/PaymentStripeWeb2.d.ts +2 -2
- package/dist/cjs/anyspend/react/components/common/PaymentVendorUI.d.ts +2 -2
- package/dist/cjs/anyspend/react/components/common/PaymentVendorUI.js +1 -2
- package/dist/cjs/anyspend/react/components/common/TokenBalance.d.ts +2 -2
- package/dist/cjs/anyspend/react/components/index.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/index.js +5 -3
- package/dist/cjs/anyspend/react/components/webview/WebviewOnrampOrderStatus.d.ts +2 -2
- package/dist/cjs/anyspend/react/components/webview/WebviewOnrampOrderStatus.js +9 -9
- package/dist/cjs/anyspend/react/components/webview/WebviewOnrampPayment.d.ts +3 -2
- package/dist/cjs/anyspend/react/components/webview/WebviewOnrampPayment.js +3 -4
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOnrampOrder.d.ts +2 -2
- package/dist/cjs/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +6 -6
- package/dist/cjs/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +12 -644
- package/dist/cjs/anyspend/react/hooks/useAnyspendOrderAndTransactions.js +21 -6
- package/dist/cjs/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +72 -434
- package/dist/cjs/anyspend/react/hooks/useAnyspendOrderHistory.js +3 -2
- package/dist/cjs/anyspend/react/hooks/useAnyspendQuote.d.ts +7 -15
- package/dist/cjs/anyspend/react/hooks/useAnyspendQuote.js +4 -21
- package/dist/cjs/anyspend/react/hooks/useAnyspendTokens.d.ts +4 -4
- package/dist/cjs/anyspend/react/hooks/useCoinbaseOnrampOptions.d.ts +38 -27
- package/dist/cjs/anyspend/react/hooks/useCoinbaseOnrampOptions.js +1 -1
- package/dist/cjs/anyspend/react/hooks/useGeoOnrampOptions.d.ts +16 -13
- package/dist/cjs/anyspend/react/hooks/useSigMint.d.ts +7 -7
- package/dist/cjs/anyspend/services/anyspend.d.ts +10 -321
- package/dist/cjs/anyspend/services/anyspend.js +7 -11
- package/dist/cjs/anyspend/types/api.d.ts +1731 -0
- package/dist/cjs/anyspend/types/api.js +6 -0
- package/dist/cjs/anyspend/types/api_req_res.d.ts +10 -0
- package/dist/cjs/anyspend/types/chain.d.ts +3 -3
- package/dist/cjs/anyspend/types/signatureMint.js +2 -0
- package/dist/cjs/anyspend/utils/chain.d.ts +4 -3
- package/dist/cjs/anyspend/utils/chain.js +14 -14
- package/dist/cjs/anyspend/utils/format.d.ts +2 -2
- package/dist/cjs/anyspend/utils/format.js +13 -14
- package/dist/cjs/anyspend/utils/orderPayload.d.ts +29 -29
- package/dist/cjs/anyspend/utils/orderPayload.js +12 -13
- package/dist/cjs/anyspend/utils/token.d.ts +6 -6
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +4 -0
- package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.js +1 -1
- package/dist/cjs/global-account/react/components/ui/TabSystem.d.ts +2 -2
- package/dist/cjs/global-account/react/components/ui/TabSystem.js +5 -5
- package/dist/cjs/global-account/react/components/ui/command.d.ts +1 -1
- package/dist/cjs/global-account/react/hooks/useAccountWallet.js +1 -1
- package/dist/cjs/global-account/react/hooks/useBestTransactionPath.d.ts +2 -2
- package/dist/cjs/global-account/react/hooks/useOnchainName.js +2 -2
- package/dist/cjs/global-account/react/hooks/useTokenBalance.d.ts +2 -2
- package/dist/cjs/global-account/react/hooks/useTokenFromUrl.d.ts +5 -5
- package/dist/cjs/global-account/react/hooks/useTokenFromUrl.js +1 -1
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +32 -9
- package/dist/cjs/shared/constants/chains/supported.d.ts +2 -2
- package/dist/cjs/shared/thirdweb/generated/@tanstack/react-query.gen.d.ts +249 -249
- package/dist/cjs/shared/utils/payment.utils.d.ts +3 -3
- package/dist/cjs/shared/utils/payment.utils.js +6 -7
- package/dist/esm/anyspend/abis/bondKit.d.ts +35 -0
- package/dist/esm/anyspend/abis/bondKit.js +26 -0
- package/dist/esm/anyspend/constants/index.d.ts +16 -5
- package/dist/esm/anyspend/constants/index.js +3 -4
- package/dist/esm/anyspend/index.d.ts +3 -7
- package/dist/esm/anyspend/index.js +3 -7
- package/dist/esm/anyspend/index.native.d.ts +3 -3
- package/dist/esm/anyspend/index.native.js +3 -3
- package/dist/esm/anyspend/react/components/AnySpend.js +13 -13
- package/dist/esm/anyspend/react/components/AnySpendBondKit.d.ts +2 -0
- package/dist/esm/anyspend/react/components/AnySpendBondKit.js +206 -0
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +4 -11
- package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +5 -4
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +49 -49
- package/dist/esm/anyspend/react/components/AnySpendNFT.d.ts +2 -2
- package/dist/esm/anyspend/react/components/AnySpendNFT.js +3 -3
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +3 -3
- package/dist/esm/anyspend/react/components/AnySpendTournament.d.ts +5 -5
- package/dist/esm/anyspend/react/components/AnySpendTournament.js +2 -3
- package/dist/esm/anyspend/react/components/AnyspendSignatureMint.d.ts +1 -1
- package/dist/esm/anyspend/react/components/AnyspendSignatureMint.js +10 -8
- package/dist/esm/anyspend/react/components/{AnySpendNFTButton.d.ts → common/AnySpendNFTButton.d.ts} +2 -2
- package/dist/esm/anyspend/react/components/{AnySpendNFTButton.js → common/AnySpendNFTButton.js} +2 -2
- package/dist/esm/anyspend/react/components/common/OrderDetails.d.ts +6 -6
- package/dist/esm/anyspend/react/components/common/OrderDetails.js +46 -48
- package/dist/esm/anyspend/react/components/common/OrderHistoryItem.d.ts +2 -2
- package/dist/esm/anyspend/react/components/common/OrderHistoryItem.js +11 -13
- package/dist/esm/anyspend/react/components/common/OrderStatus.d.ts +2 -2
- package/dist/esm/anyspend/react/components/common/OrderStatus.js +2 -2
- package/dist/esm/anyspend/react/components/common/OrderToken.d.ts +3 -3
- package/dist/esm/anyspend/react/components/common/OrderTokenAmount.d.ts +3 -3
- package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.d.ts +6 -5
- package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.js +8 -9
- package/dist/esm/anyspend/react/components/common/PaymentOneClick.d.ts +2 -2
- package/dist/esm/anyspend/react/components/common/PaymentStripeWeb2.d.ts +2 -2
- package/dist/esm/anyspend/react/components/common/PaymentVendorUI.d.ts +2 -2
- package/dist/esm/anyspend/react/components/common/PaymentVendorUI.js +1 -2
- package/dist/esm/anyspend/react/components/common/TokenBalance.d.ts +2 -2
- package/dist/esm/anyspend/react/components/index.d.ts +2 -1
- package/dist/esm/anyspend/react/components/index.js +2 -1
- package/dist/esm/anyspend/react/components/webview/WebviewOnrampOrderStatus.d.ts +2 -2
- package/dist/esm/anyspend/react/components/webview/WebviewOnrampOrderStatus.js +10 -10
- package/dist/esm/anyspend/react/components/webview/WebviewOnrampPayment.d.ts +3 -2
- package/dist/esm/anyspend/react/components/webview/WebviewOnrampPayment.js +4 -5
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOnrampOrder.d.ts +2 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +6 -6
- package/dist/esm/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +12 -644
- package/dist/esm/anyspend/react/hooks/useAnyspendOrderAndTransactions.js +21 -3
- package/dist/esm/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +72 -434
- package/dist/esm/anyspend/react/hooks/useAnyspendOrderHistory.js +3 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendQuote.d.ts +7 -15
- package/dist/esm/anyspend/react/hooks/useAnyspendQuote.js +4 -21
- package/dist/esm/anyspend/react/hooks/useAnyspendTokens.d.ts +4 -4
- package/dist/esm/anyspend/react/hooks/useCoinbaseOnrampOptions.d.ts +38 -27
- package/dist/esm/anyspend/react/hooks/useCoinbaseOnrampOptions.js +1 -1
- package/dist/esm/anyspend/react/hooks/useGeoOnrampOptions.d.ts +16 -13
- package/dist/esm/anyspend/react/hooks/useSigMint.d.ts +7 -7
- package/dist/esm/anyspend/services/anyspend.d.ts +10 -321
- package/dist/esm/anyspend/services/anyspend.js +7 -11
- package/dist/esm/anyspend/types/api.d.ts +1731 -0
- package/dist/esm/anyspend/types/api.js +5 -0
- package/dist/esm/anyspend/types/api_req_res.d.ts +10 -0
- package/dist/esm/anyspend/types/chain.d.ts +3 -3
- package/dist/esm/anyspend/types/signatureMint.js +1 -0
- package/dist/esm/anyspend/utils/chain.d.ts +4 -3
- package/dist/esm/anyspend/utils/chain.js +1 -1
- package/dist/esm/anyspend/utils/format.d.ts +2 -2
- package/dist/esm/anyspend/utils/format.js +13 -14
- package/dist/esm/anyspend/utils/orderPayload.d.ts +29 -29
- package/dist/esm/anyspend/utils/orderPayload.js +12 -13
- package/dist/esm/anyspend/utils/token.d.ts +6 -6
- package/dist/esm/global-account/react/components/B3DynamicModal.js +5 -1
- package/dist/esm/global-account/react/components/SignInWithB3/SignIn.js +1 -1
- package/dist/esm/global-account/react/components/ui/TabSystem.d.ts +2 -2
- package/dist/esm/global-account/react/components/ui/TabSystem.js +4 -4
- package/dist/esm/global-account/react/components/ui/command.d.ts +1 -1
- package/dist/esm/global-account/react/hooks/useAccountWallet.js +1 -1
- package/dist/esm/global-account/react/hooks/useBestTransactionPath.d.ts +2 -2
- package/dist/esm/global-account/react/hooks/useOnchainName.js +2 -2
- package/dist/esm/global-account/react/hooks/useTokenBalance.d.ts +2 -2
- package/dist/esm/global-account/react/hooks/useTokenFromUrl.d.ts +5 -5
- package/dist/esm/global-account/react/hooks/useTokenFromUrl.js +1 -1
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +32 -9
- package/dist/esm/shared/constants/chains/supported.d.ts +2 -2
- package/dist/esm/shared/thirdweb/generated/@tanstack/react-query.gen.d.ts +249 -249
- package/dist/esm/shared/utils/payment.utils.d.ts +3 -3
- package/dist/esm/shared/utils/payment.utils.js +6 -7
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/abis/bondKit.d.ts +35 -0
- package/dist/types/anyspend/constants/index.d.ts +16 -5
- package/dist/types/anyspend/index.d.ts +3 -7
- package/dist/types/anyspend/index.native.d.ts +3 -3
- package/dist/types/anyspend/react/components/AnySpendBondKit.d.ts +2 -0
- package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +5 -4
- package/dist/types/anyspend/react/components/AnySpendNFT.d.ts +2 -2
- package/dist/types/anyspend/react/components/AnySpendTournament.d.ts +5 -5
- package/dist/types/anyspend/react/components/AnyspendSignatureMint.d.ts +1 -1
- package/dist/types/anyspend/react/components/{AnySpendNFTButton.d.ts → common/AnySpendNFTButton.d.ts} +2 -2
- package/dist/types/anyspend/react/components/common/OrderDetails.d.ts +6 -6
- package/dist/types/anyspend/react/components/common/OrderHistoryItem.d.ts +2 -2
- package/dist/types/anyspend/react/components/common/OrderStatus.d.ts +2 -2
- package/dist/types/anyspend/react/components/common/OrderToken.d.ts +3 -3
- package/dist/types/anyspend/react/components/common/OrderTokenAmount.d.ts +3 -3
- package/dist/types/anyspend/react/components/common/PanelOnrampPayment.d.ts +6 -5
- package/dist/types/anyspend/react/components/common/PaymentOneClick.d.ts +2 -2
- package/dist/types/anyspend/react/components/common/PaymentStripeWeb2.d.ts +2 -2
- package/dist/types/anyspend/react/components/common/PaymentVendorUI.d.ts +2 -2
- package/dist/types/anyspend/react/components/common/TokenBalance.d.ts +2 -2
- package/dist/types/anyspend/react/components/index.d.ts +2 -1
- package/dist/types/anyspend/react/components/webview/WebviewOnrampOrderStatus.d.ts +2 -2
- package/dist/types/anyspend/react/components/webview/WebviewOnrampPayment.d.ts +3 -2
- package/dist/types/anyspend/react/hooks/useAnyspendCreateOnrampOrder.d.ts +2 -2
- package/dist/types/anyspend/react/hooks/useAnyspendCreateOrder.d.ts +6 -6
- package/dist/types/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +12 -644
- package/dist/types/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +72 -434
- package/dist/types/anyspend/react/hooks/useAnyspendQuote.d.ts +7 -15
- package/dist/types/anyspend/react/hooks/useAnyspendTokens.d.ts +4 -4
- package/dist/types/anyspend/react/hooks/useCoinbaseOnrampOptions.d.ts +38 -27
- package/dist/types/anyspend/react/hooks/useGeoOnrampOptions.d.ts +16 -13
- package/dist/types/anyspend/react/hooks/useSigMint.d.ts +7 -7
- package/dist/types/anyspend/services/anyspend.d.ts +10 -321
- package/dist/types/anyspend/types/api.d.ts +1731 -0
- package/dist/types/anyspend/types/api_req_res.d.ts +10 -0
- package/dist/types/anyspend/types/chain.d.ts +3 -3
- package/dist/types/anyspend/utils/chain.d.ts +4 -3
- package/dist/types/anyspend/utils/format.d.ts +2 -2
- package/dist/types/anyspend/utils/orderPayload.d.ts +29 -29
- package/dist/types/anyspend/utils/token.d.ts +6 -6
- package/dist/types/global-account/react/components/ui/TabSystem.d.ts +2 -2
- package/dist/types/global-account/react/components/ui/command.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useBestTransactionPath.d.ts +2 -2
- package/dist/types/global-account/react/hooks/useTokenBalance.d.ts +2 -2
- package/dist/types/global-account/react/hooks/useTokenFromUrl.d.ts +5 -5
- package/dist/types/global-account/react/stores/useModalStore.d.ts +32 -9
- package/dist/types/shared/constants/chains/supported.d.ts +2 -2
- package/dist/types/shared/thirdweb/generated/@tanstack/react-query.gen.d.ts +249 -249
- package/dist/types/shared/utils/payment.utils.d.ts +3 -3
- package/package.json +3 -1
- package/src/anyspend/README.md +33 -32
- package/src/anyspend/abis/bondKit.ts +26 -0
- package/src/anyspend/constants/index.ts +7 -7
- package/src/anyspend/index.native.ts +3 -3
- package/src/anyspend/index.ts +3 -7
- package/src/anyspend/react/components/AnySpend.tsx +19 -17
- package/src/anyspend/react/components/AnySpendBondKit.tsx +378 -0
- package/src/anyspend/react/components/AnySpendBuySpin.tsx +4 -12
- package/src/anyspend/react/components/AnySpendCustom.tsx +100 -112
- package/src/anyspend/react/components/AnySpendNFT.tsx +7 -6
- package/src/anyspend/react/components/AnySpendStakeB3.tsx +3 -3
- package/src/anyspend/react/components/AnySpendTournament.tsx +8 -7
- package/src/anyspend/react/components/AnyspendSignatureMint.tsx +22 -13
- package/src/anyspend/react/components/{AnySpendNFTButton.tsx → common/AnySpendNFTButton.tsx} +2 -2
- package/src/anyspend/react/components/common/OrderDetails.tsx +58 -70
- package/src/anyspend/react/components/common/OrderHistoryItem.tsx +13 -14
- package/src/anyspend/react/components/common/OrderStatus.tsx +4 -3
- package/src/anyspend/react/components/common/OrderToken.tsx +4 -3
- package/src/anyspend/react/components/common/OrderTokenAmount.tsx +4 -3
- package/src/anyspend/react/components/common/PanelOnrampPayment.tsx +19 -15
- package/src/anyspend/react/components/common/PaymentOneClick.tsx +2 -2
- package/src/anyspend/react/components/common/PaymentStripeWeb2.tsx +4 -3
- package/src/anyspend/react/components/common/PaymentVendorUI.tsx +3 -3
- package/src/anyspend/react/components/common/TokenBalance.tsx +2 -2
- package/src/anyspend/react/components/index.ts +2 -1
- package/src/anyspend/react/components/webview/WebviewOnrampOrderStatus.tsx +12 -11
- package/src/anyspend/react/components/webview/WebviewOnrampPayment.tsx +15 -16
- package/src/anyspend/react/hooks/useAnyspendCreateOnrampOrder.ts +2 -2
- package/src/anyspend/react/hooks/useAnyspendCreateOrder.ts +6 -6
- package/src/anyspend/react/hooks/useAnyspendOrderAndTransactions.ts +27 -5
- package/src/anyspend/react/hooks/useAnyspendOrderHistory.ts +10 -6
- package/src/anyspend/react/hooks/useAnyspendQuote.ts +15 -18
- package/src/anyspend/react/hooks/useCoinbaseOnrampOptions.ts +1 -1
- package/src/anyspend/react/hooks/useSigMint.tsx +1 -1
- package/src/anyspend/services/anyspend.ts +38 -30
- package/src/anyspend/types/api.ts +1756 -0
- package/src/anyspend/types/api_req_res.ts +16 -0
- package/src/anyspend/types/chain.ts +3 -3
- package/src/anyspend/utils/chain.ts +4 -3
- package/src/anyspend/utils/format.ts +17 -15
- package/src/anyspend/utils/orderPayload.ts +20 -20
- package/src/anyspend/utils/token.ts +6 -6
- package/src/global-account/react/components/B3DynamicModal.tsx +6 -1
- package/src/global-account/react/components/SignInWithB3/SignIn.tsx +1 -1
- package/src/global-account/react/components/StyleRoot.tsx +1 -0
- package/src/global-account/react/components/ui/TabSystem.tsx +36 -33
- package/src/global-account/react/hooks/useAccountWallet.tsx +1 -1
- package/src/global-account/react/hooks/useBestTransactionPath.tsx +3 -2
- package/src/global-account/react/hooks/useOnchainName.tsx +2 -2
- package/src/global-account/react/hooks/useTokenBalance.tsx +3 -2
- package/src/global-account/react/hooks/useTokenFromUrl.tsx +10 -4
- package/src/global-account/react/stores/useModalStore.ts +34 -9
- package/src/shared/utils/payment.utils.ts +9 -9
- package/dist/cjs/anyspend/types/custom.d.ts +0 -130
- package/dist/cjs/anyspend/types/custom.js +0 -19
- package/dist/cjs/anyspend/types/globalWallet.d.ts +0 -18
- package/dist/cjs/anyspend/types/globalWallet.js +0 -10
- package/dist/cjs/anyspend/types/index.d.ts +0 -13
- package/dist/cjs/anyspend/types/index.js +0 -29
- package/dist/cjs/anyspend/types/metadata.d.ts +0 -26
- package/dist/cjs/anyspend/types/metadata.js +0 -16
- package/dist/cjs/anyspend/types/nft.d.ts +0 -274
- package/dist/cjs/anyspend/types/nft.js +0 -38
- package/dist/cjs/anyspend/types/onramp.d.ts +0 -28
- package/dist/cjs/anyspend/types/onramp.js +0 -18
- package/dist/cjs/anyspend/types/order.d.ts +0 -1629
- package/dist/cjs/anyspend/types/order.js +0 -81
- package/dist/cjs/anyspend/types/relay.d.ts +0 -10
- package/dist/cjs/anyspend/types/relay.js +0 -12
- package/dist/cjs/anyspend/types/req-res/createOrder.d.ts +0 -4026
- package/dist/cjs/anyspend/types/req-res/createOrder.js +0 -61
- package/dist/cjs/anyspend/types/req-res/getCoinbaseOnrampOptions.d.ts +0 -120
- package/dist/cjs/anyspend/types/req-res/getCoinbaseOnrampOptions.js +0 -31
- package/dist/cjs/anyspend/types/req-res/getOrderAndTransactions.d.ts +0 -2922
- package/dist/cjs/anyspend/types/req-res/getOrderAndTransactions.js +0 -23
- package/dist/cjs/anyspend/types/req-res/getOrderByCreator.d.ts +0 -28
- package/dist/cjs/anyspend/types/req-res/getOrderByCreator.js +0 -11
- package/dist/cjs/anyspend/types/req-res/getOrderHistory.d.ts +0 -2117
- package/dist/cjs/anyspend/types/req-res/getOrderHistory.js +0 -11
- package/dist/cjs/anyspend/types/req-res/getQuote.d.ts +0 -290
- package/dist/cjs/anyspend/types/req-res/getQuote.js +0 -51
- package/dist/cjs/anyspend/types/req-res/getTokenList.d.ts +0 -63
- package/dist/cjs/anyspend/types/req-res/getTokenList.js +0 -18
- package/dist/cjs/anyspend/types/req-res/index.d.ts +0 -7
- package/dist/cjs/anyspend/types/req-res/index.js +0 -23
- package/dist/cjs/anyspend/types/req-res/stripe.d.ts +0 -0
- package/dist/cjs/anyspend/types/req-res/stripe.js +0 -1
- package/dist/cjs/anyspend/types/swap.d.ts +0 -119
- package/dist/cjs/anyspend/types/swap.js +0 -13
- package/dist/cjs/anyspend/types/token.d.ts +0 -34
- package/dist/cjs/anyspend/types/token.js +0 -14
- package/dist/cjs/anyspend/types/tournament.d.ts +0 -174
- package/dist/cjs/anyspend/types/tournament.js +0 -24
- package/dist/cjs/anyspend/types/transaction.d.ts +0 -84
- package/dist/cjs/anyspend/types/transaction.js +0 -34
- package/dist/esm/anyspend/types/custom.d.ts +0 -130
- package/dist/esm/anyspend/types/custom.js +0 -13
- package/dist/esm/anyspend/types/globalWallet.d.ts +0 -18
- package/dist/esm/anyspend/types/globalWallet.js +0 -7
- package/dist/esm/anyspend/types/index.d.ts +0 -13
- package/dist/esm/anyspend/types/index.js +0 -13
- package/dist/esm/anyspend/types/metadata.d.ts +0 -26
- package/dist/esm/anyspend/types/metadata.js +0 -11
- package/dist/esm/anyspend/types/nft.d.ts +0 -274
- package/dist/esm/anyspend/types/nft.js +0 -35
- package/dist/esm/anyspend/types/onramp.d.ts +0 -28
- package/dist/esm/anyspend/types/onramp.js +0 -15
- package/dist/esm/anyspend/types/order.d.ts +0 -1629
- package/dist/esm/anyspend/types/order.js +0 -78
- package/dist/esm/anyspend/types/relay.d.ts +0 -10
- package/dist/esm/anyspend/types/relay.js +0 -9
- package/dist/esm/anyspend/types/req-res/createOrder.d.ts +0 -4026
- package/dist/esm/anyspend/types/req-res/createOrder.js +0 -58
- package/dist/esm/anyspend/types/req-res/getCoinbaseOnrampOptions.d.ts +0 -120
- package/dist/esm/anyspend/types/req-res/getCoinbaseOnrampOptions.js +0 -28
- package/dist/esm/anyspend/types/req-res/getOrderAndTransactions.d.ts +0 -2922
- package/dist/esm/anyspend/types/req-res/getOrderAndTransactions.js +0 -20
- package/dist/esm/anyspend/types/req-res/getOrderByCreator.d.ts +0 -28
- package/dist/esm/anyspend/types/req-res/getOrderByCreator.js +0 -8
- package/dist/esm/anyspend/types/req-res/getOrderHistory.d.ts +0 -2117
- package/dist/esm/anyspend/types/req-res/getOrderHistory.js +0 -8
- package/dist/esm/anyspend/types/req-res/getQuote.d.ts +0 -290
- package/dist/esm/anyspend/types/req-res/getQuote.js +0 -48
- package/dist/esm/anyspend/types/req-res/getTokenList.d.ts +0 -63
- package/dist/esm/anyspend/types/req-res/getTokenList.js +0 -15
- package/dist/esm/anyspend/types/req-res/index.d.ts +0 -7
- package/dist/esm/anyspend/types/req-res/index.js +0 -7
- package/dist/esm/anyspend/types/req-res/stripe.d.ts +0 -0
- package/dist/esm/anyspend/types/req-res/stripe.js +0 -1
- package/dist/esm/anyspend/types/swap.d.ts +0 -119
- package/dist/esm/anyspend/types/swap.js +0 -10
- package/dist/esm/anyspend/types/token.d.ts +0 -34
- package/dist/esm/anyspend/types/token.js +0 -11
- package/dist/esm/anyspend/types/tournament.d.ts +0 -174
- package/dist/esm/anyspend/types/tournament.js +0 -21
- package/dist/esm/anyspend/types/transaction.d.ts +0 -84
- package/dist/esm/anyspend/types/transaction.js +0 -31
- package/dist/types/anyspend/types/custom.d.ts +0 -130
- package/dist/types/anyspend/types/globalWallet.d.ts +0 -18
- package/dist/types/anyspend/types/index.d.ts +0 -13
- package/dist/types/anyspend/types/metadata.d.ts +0 -26
- package/dist/types/anyspend/types/nft.d.ts +0 -274
- package/dist/types/anyspend/types/onramp.d.ts +0 -28
- package/dist/types/anyspend/types/order.d.ts +0 -1629
- package/dist/types/anyspend/types/relay.d.ts +0 -10
- package/dist/types/anyspend/types/req-res/createOrder.d.ts +0 -4026
- package/dist/types/anyspend/types/req-res/getCoinbaseOnrampOptions.d.ts +0 -120
- package/dist/types/anyspend/types/req-res/getOrderAndTransactions.d.ts +0 -2922
- package/dist/types/anyspend/types/req-res/getOrderByCreator.d.ts +0 -28
- package/dist/types/anyspend/types/req-res/getOrderHistory.d.ts +0 -2117
- package/dist/types/anyspend/types/req-res/getQuote.d.ts +0 -290
- package/dist/types/anyspend/types/req-res/getTokenList.d.ts +0 -63
- package/dist/types/anyspend/types/req-res/index.d.ts +0 -7
- package/dist/types/anyspend/types/req-res/stripe.d.ts +0 -0
- package/dist/types/anyspend/types/swap.d.ts +0 -119
- package/dist/types/anyspend/types/token.d.ts +0 -34
- package/dist/types/anyspend/types/tournament.d.ts +0 -174
- package/dist/types/anyspend/types/transaction.d.ts +0 -84
- package/src/anyspend/types/custom.ts +0 -17
- package/src/anyspend/types/globalWallet.ts +0 -9
- package/src/anyspend/types/index.ts +0 -14
- package/src/anyspend/types/metadata.ts +0 -41
- package/src/anyspend/types/nft.ts +0 -53
- package/src/anyspend/types/onramp.ts +0 -16
- package/src/anyspend/types/order.ts +0 -88
- package/src/anyspend/types/relay.ts +0 -13
- package/src/anyspend/types/req-res/createOrder.ts +0 -67
- package/src/anyspend/types/req-res/getCoinbaseOnrampOptions.ts +0 -34
- package/src/anyspend/types/req-res/getOrderAndTransactions.ts +0 -23
- package/src/anyspend/types/req-res/getOrderByCreator.ts +0 -9
- package/src/anyspend/types/req-res/getOrderHistory.ts +0 -9
- package/src/anyspend/types/req-res/getQuote.ts +0 -65
- package/src/anyspend/types/req-res/getTokenList.ts +0 -18
- package/src/anyspend/types/req-res/index.ts +0 -7
- package/src/anyspend/types/req-res/stripe.ts +0 -0
- package/src/anyspend/types/swap.ts +0 -12
- package/src/anyspend/types/token.ts +0 -13
- package/src/anyspend/types/tournament.ts +0 -26
- package/src/anyspend/types/transaction.ts +0 -39
- /package/dist/cjs/anyspend/abis/{abi-usdc-base.d.ts → abiUsdcBase.d.ts} +0 -0
- /package/dist/cjs/anyspend/abis/{abi-usdc-base.js → abiUsdcBase.js} +0 -0
- /package/dist/cjs/anyspend/abis/{erc20-staking.d.ts → erc20Staking.d.ts} +0 -0
- /package/dist/cjs/anyspend/abis/{erc20-staking.js → erc20Staking.js} +0 -0
- /package/dist/cjs/anyspend/abis/{signature-minting.d.ts → signatureMinting.d.ts} +0 -0
- /package/dist/cjs/anyspend/abis/{signature-minting.js → signatureMinting.js} +0 -0
- /package/dist/cjs/anyspend/types/{signature-mint.js → api_req_res.js} +0 -0
- /package/dist/cjs/anyspend/types/{signature-mint.d.ts → signatureMint.d.ts} +0 -0
- /package/dist/esm/anyspend/abis/{abi-usdc-base.d.ts → abiUsdcBase.d.ts} +0 -0
- /package/dist/esm/anyspend/abis/{abi-usdc-base.js → abiUsdcBase.js} +0 -0
- /package/dist/esm/anyspend/abis/{erc20-staking.d.ts → erc20Staking.d.ts} +0 -0
- /package/dist/esm/anyspend/abis/{erc20-staking.js → erc20Staking.js} +0 -0
- /package/dist/esm/anyspend/abis/{signature-minting.d.ts → signatureMinting.d.ts} +0 -0
- /package/dist/esm/anyspend/abis/{signature-minting.js → signatureMinting.js} +0 -0
- /package/dist/esm/anyspend/types/{signature-mint.js → api_req_res.js} +0 -0
- /package/dist/esm/anyspend/types/{signature-mint.d.ts → signatureMint.d.ts} +0 -0
- /package/dist/types/anyspend/abis/{abi-usdc-base.d.ts → abiUsdcBase.d.ts} +0 -0
- /package/dist/types/anyspend/abis/{erc20-staking.d.ts → erc20Staking.d.ts} +0 -0
- /package/dist/types/anyspend/abis/{signature-minting.d.ts → signatureMinting.d.ts} +0 -0
- /package/dist/types/anyspend/types/{signature-mint.d.ts → signatureMint.d.ts} +0 -0
- /package/src/anyspend/abis/{abi-usdc-base.ts → abiUsdcBase.ts} +0 -0
- /package/src/anyspend/abis/{erc20-staking.ts → erc20Staking.ts} +0 -0
- /package/src/anyspend/abis/{signature-minting.ts → signatureMinting.ts} +0 -0
- /package/src/anyspend/types/{signature-mint.ts → signatureMint.ts} +0 -0
|
@@ -1,21 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
eqci,
|
|
4
|
-
getDefaultToken,
|
|
5
|
-
GetQuoteRequest,
|
|
6
|
-
GetQuoteResponse,
|
|
7
|
-
isCustomTxMetadata,
|
|
8
|
-
isNftMetadata,
|
|
9
|
-
isTournamentMetadata,
|
|
10
|
-
Nft,
|
|
11
|
-
NftType,
|
|
12
|
-
OnrampVendor,
|
|
13
|
-
OrderStatus,
|
|
14
|
-
OrderType,
|
|
15
|
-
RELAY_ETH_ADDRESS,
|
|
16
|
-
Token,
|
|
17
|
-
USDC_BASE,
|
|
18
|
-
} from "@b3dotfun/sdk/anyspend";
|
|
1
|
+
import { eqci, getDefaultToken } from "@b3dotfun/sdk/anyspend";
|
|
2
|
+
import { RELAY_ETH_ADDRESS, USDC_BASE } from "@b3dotfun/sdk/anyspend/constants";
|
|
19
3
|
import {
|
|
20
4
|
CreateOrderParams,
|
|
21
5
|
useAnyspendCreateOnrampOrder,
|
|
@@ -25,6 +9,8 @@ import {
|
|
|
25
9
|
useAnyspendTokenList,
|
|
26
10
|
useGeoOnrampOptions,
|
|
27
11
|
} from "@b3dotfun/sdk/anyspend/react";
|
|
12
|
+
import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
13
|
+
import { GetQuoteRequest, GetQuoteResponse } from "@b3dotfun/sdk/anyspend/types/api_req_res";
|
|
28
14
|
import {
|
|
29
15
|
Badge,
|
|
30
16
|
Button,
|
|
@@ -44,10 +30,8 @@ import {
|
|
|
44
30
|
TooltipTrigger,
|
|
45
31
|
TransitionPanel,
|
|
46
32
|
useAccountWallet,
|
|
47
|
-
useB3,
|
|
48
33
|
useBsmntProfile,
|
|
49
34
|
useHasMounted,
|
|
50
|
-
useModalStore,
|
|
51
35
|
useRouter,
|
|
52
36
|
useSearchParamsSSR,
|
|
53
37
|
useTokenBalancesByChain,
|
|
@@ -61,7 +45,7 @@ import invariant from "invariant";
|
|
|
61
45
|
import { ChevronRightCircle, Loader2 } from "lucide-react";
|
|
62
46
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
63
47
|
import { toast } from "sonner";
|
|
64
|
-
import {
|
|
48
|
+
import { base, baseSepolia } from "viem/chains";
|
|
65
49
|
import { OrderDetails } from "./common/OrderDetails";
|
|
66
50
|
import { OrderHistory } from "./common/OrderHistory";
|
|
67
51
|
import { OrderStatus as OrderStatusDisplay } from "./common/OrderStatus";
|
|
@@ -88,22 +72,22 @@ function generateGetRelayQuoteRequest({
|
|
|
88
72
|
encodedData,
|
|
89
73
|
spenderAddress,
|
|
90
74
|
}: {
|
|
91
|
-
orderType:
|
|
75
|
+
orderType: components["schemas"]["Order"]["type"];
|
|
92
76
|
srcChainId: number;
|
|
93
|
-
srcToken: Token;
|
|
77
|
+
srcToken: components["schemas"]["Token"];
|
|
94
78
|
dstChainId: number;
|
|
95
|
-
dstToken: Token;
|
|
79
|
+
dstToken: components["schemas"]["Token"];
|
|
96
80
|
dstAmount: string;
|
|
97
81
|
contractAddress: string;
|
|
98
82
|
tokenId?: number | null;
|
|
99
|
-
contractType?:
|
|
83
|
+
contractType?: components["schemas"]["NftContract"]["type"];
|
|
100
84
|
encodedData: string;
|
|
101
85
|
spenderAddress?: string;
|
|
102
86
|
}): GetQuoteRequest {
|
|
103
87
|
switch (orderType) {
|
|
104
|
-
case
|
|
88
|
+
case "mint_nft": {
|
|
105
89
|
return {
|
|
106
|
-
type:
|
|
90
|
+
type: "mint_nft",
|
|
107
91
|
srcChain: srcChainId,
|
|
108
92
|
srcTokenAddress: srcToken.address,
|
|
109
93
|
dstChain: dstChainId,
|
|
@@ -114,9 +98,9 @@ function generateGetRelayQuoteRequest({
|
|
|
114
98
|
contractType: contractType!,
|
|
115
99
|
};
|
|
116
100
|
}
|
|
117
|
-
case
|
|
101
|
+
case "join_tournament": {
|
|
118
102
|
return {
|
|
119
|
-
type:
|
|
103
|
+
type: "join_tournament",
|
|
120
104
|
srcChain: srcChainId,
|
|
121
105
|
srcTokenAddress: srcToken.address,
|
|
122
106
|
dstChain: dstChainId,
|
|
@@ -125,9 +109,9 @@ function generateGetRelayQuoteRequest({
|
|
|
125
109
|
contractAddress: contractAddress,
|
|
126
110
|
};
|
|
127
111
|
}
|
|
128
|
-
case
|
|
112
|
+
case "fund_tournament": {
|
|
129
113
|
return {
|
|
130
|
-
type:
|
|
114
|
+
type: "fund_tournament",
|
|
131
115
|
srcChain: srcChainId,
|
|
132
116
|
srcTokenAddress: srcToken.address,
|
|
133
117
|
dstChain: dstChainId,
|
|
@@ -136,9 +120,9 @@ function generateGetRelayQuoteRequest({
|
|
|
136
120
|
contractAddress: contractAddress,
|
|
137
121
|
};
|
|
138
122
|
}
|
|
139
|
-
case
|
|
123
|
+
case "custom": {
|
|
140
124
|
return {
|
|
141
|
-
type:
|
|
125
|
+
type: "custom",
|
|
142
126
|
srcChain: srcChainId,
|
|
143
127
|
srcTokenAddress: srcToken.address,
|
|
144
128
|
dstChain: dstChainId,
|
|
@@ -179,13 +163,13 @@ export function AnySpendCustom({
|
|
|
179
163
|
mode?: "modal" | "page";
|
|
180
164
|
recipientAddress?: string;
|
|
181
165
|
spenderAddress?: string;
|
|
182
|
-
orderType:
|
|
166
|
+
orderType: components["schemas"]["Order"]["type"];
|
|
183
167
|
dstChainId: number;
|
|
184
|
-
dstToken: Token;
|
|
168
|
+
dstToken: components["schemas"]["Token"];
|
|
185
169
|
dstAmount: string;
|
|
186
170
|
contractAddress: string;
|
|
187
171
|
encodedData: string;
|
|
188
|
-
metadata:
|
|
172
|
+
metadata: any;
|
|
189
173
|
header: ({
|
|
190
174
|
anyspendPrice,
|
|
191
175
|
isLoadingAnyspendPrice,
|
|
@@ -196,8 +180,6 @@ export function AnySpendCustom({
|
|
|
196
180
|
onSuccess?: (txHash?: string) => void;
|
|
197
181
|
showRecipient?: boolean;
|
|
198
182
|
}) {
|
|
199
|
-
const { setB3ModalOpen, setB3ModalContentType } = useModalStore();
|
|
200
|
-
|
|
201
183
|
const hasMounted = useHasMounted();
|
|
202
184
|
|
|
203
185
|
const searchParams = useSearchParamsSSR();
|
|
@@ -220,7 +202,7 @@ export function AnySpendCustom({
|
|
|
220
202
|
// Update recipient logic to use custom recipient
|
|
221
203
|
const recipientAddress = customRecipientAddress || currentWallet.address;
|
|
222
204
|
const recipientPropsProfile = useBsmntProfile({ address: recipientAddress });
|
|
223
|
-
const recipientEnsName = recipientPropsProfile.data?.username?.
|
|
205
|
+
const recipientEnsName = recipientPropsProfile.data?.username?.replace(/\.b3\.fun/g, "");
|
|
224
206
|
const recipientImageUrl = recipientPropsProfile.data?.avatar || currentWallet.wallet.meta?.icon;
|
|
225
207
|
|
|
226
208
|
const [orderId, setOrderId] = useState<string | undefined>(loadOrder);
|
|
@@ -274,7 +256,7 @@ export function AnySpendCustom({
|
|
|
274
256
|
}, [currentWallet?.wallet?.address, nativeTokens, fungibleTokens, tokenList, srcChainId]);
|
|
275
257
|
|
|
276
258
|
// Set the selected token with preference for tokens user owns
|
|
277
|
-
const [srcToken, setSrcToken] = useState<Token>(getDefaultToken(srcChainId));
|
|
259
|
+
const [srcToken, setSrcToken] = useState<components["schemas"]["Token"]>(getDefaultToken(srcChainId));
|
|
278
260
|
const [dirtySelectSrcToken, setDirtySelectSrcToken] = useState(false);
|
|
279
261
|
|
|
280
262
|
// Update token when chain changes or token balances are loaded
|
|
@@ -287,7 +269,7 @@ export function AnySpendCustom({
|
|
|
287
269
|
}
|
|
288
270
|
}, [srcChainId, tokenList, getTokenWithBalance, nativeTokens, fungibleTokens, dirtySelectSrcToken, dstToken.address]);
|
|
289
271
|
|
|
290
|
-
const { account: isAuthenticated } = useB3();
|
|
272
|
+
// const { account: isAuthenticated } = useB3();
|
|
291
273
|
|
|
292
274
|
const getRelayQuoteRequest = useMemo(() => {
|
|
293
275
|
return generateGetRelayQuoteRequest({
|
|
@@ -298,8 +280,8 @@ export function AnySpendCustom({
|
|
|
298
280
|
dstToken: dstToken,
|
|
299
281
|
dstAmount: dstAmount,
|
|
300
282
|
contractAddress: contractAddress,
|
|
301
|
-
tokenId:
|
|
302
|
-
contractType:
|
|
283
|
+
tokenId: metadata.type === "mint_nft" ? metadata.nftContract.tokenId : undefined,
|
|
284
|
+
contractType: metadata.type === "mint_nft" ? metadata.nftContract.type : undefined,
|
|
303
285
|
encodedData: encodedData,
|
|
304
286
|
spenderAddress: spenderAddress,
|
|
305
287
|
});
|
|
@@ -363,7 +345,7 @@ export function AnySpendCustom({
|
|
|
363
345
|
}, [anyspendQuote?.data]);
|
|
364
346
|
|
|
365
347
|
useEffect(() => {
|
|
366
|
-
if (oat?.data?.order.status ===
|
|
348
|
+
if (oat?.data?.order.status === "executed") {
|
|
367
349
|
console.log("Calling onSuccess");
|
|
368
350
|
const txHash = oat?.data?.executeTx?.txHash;
|
|
369
351
|
onSuccess?.(txHash);
|
|
@@ -394,7 +376,7 @@ export function AnySpendCustom({
|
|
|
394
376
|
|
|
395
377
|
const handleCreateOrder = async (
|
|
396
378
|
recipientAddress: string,
|
|
397
|
-
onramp?: { paymentMethod: string; vendor:
|
|
379
|
+
onramp?: { paymentMethod: string; vendor: components["schemas"]["OnrampMetadata"]["vendor"] },
|
|
398
380
|
) => {
|
|
399
381
|
try {
|
|
400
382
|
invariant(anyspendQuote, "Relay price is not found");
|
|
@@ -410,44 +392,47 @@ export function AnySpendCustom({
|
|
|
410
392
|
srcAmount: srcAmount.toString(),
|
|
411
393
|
recipientAddress,
|
|
412
394
|
creatorAddress: currentWallet?.wallet?.address,
|
|
413
|
-
nft:
|
|
414
|
-
|
|
415
|
-
?
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
395
|
+
nft:
|
|
396
|
+
metadata.type === "mint_nft"
|
|
397
|
+
? metadata.nftContract.type === "erc1155"
|
|
398
|
+
? {
|
|
399
|
+
type: "erc1155",
|
|
400
|
+
contractAddress: metadata.nftContract.contractAddress,
|
|
401
|
+
tokenId: metadata.nftContract.tokenId!,
|
|
402
|
+
name: metadata.nftContract.name,
|
|
403
|
+
description: metadata.nftContract.description,
|
|
404
|
+
imageUrl: metadata.nftContract.imageUrl,
|
|
405
|
+
price: dstAmount,
|
|
406
|
+
}
|
|
407
|
+
: {
|
|
408
|
+
type: "erc721",
|
|
409
|
+
contractAddress: metadata.nftContract.contractAddress,
|
|
410
|
+
contractType: metadata.nftContract.type,
|
|
411
|
+
price: dstAmount,
|
|
412
|
+
name: metadata.nftContract.name,
|
|
413
|
+
description: metadata.nftContract.description,
|
|
414
|
+
imageUrl: metadata.nftContract.imageUrl,
|
|
415
|
+
}
|
|
416
|
+
: undefined,
|
|
417
|
+
tournament:
|
|
418
|
+
metadata.type === "join_tournament" || metadata.type === "fund_tournament"
|
|
419
|
+
? {
|
|
420
|
+
...metadata.tournament,
|
|
421
|
+
contractAddress: contractAddress,
|
|
422
|
+
entryPriceOrFundAmount: dstAmount,
|
|
423
|
+
}
|
|
424
|
+
: undefined,
|
|
441
425
|
// only populate payload for custom tx
|
|
442
|
-
payload:
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
426
|
+
payload:
|
|
427
|
+
metadata.type === "custom"
|
|
428
|
+
? {
|
|
429
|
+
amount: dstAmount,
|
|
430
|
+
data: encodedData,
|
|
431
|
+
spenderAddress: spenderAddress,
|
|
432
|
+
to: contractAddress,
|
|
433
|
+
action: metadata.action,
|
|
434
|
+
}
|
|
435
|
+
: undefined,
|
|
451
436
|
} as CreateOrderParams;
|
|
452
437
|
|
|
453
438
|
if (onramp) {
|
|
@@ -478,23 +463,26 @@ export function AnySpendCustom({
|
|
|
478
463
|
}
|
|
479
464
|
};
|
|
480
465
|
|
|
481
|
-
const handleConfirmOrder = async (onramp?: {
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
}
|
|
466
|
+
const handleConfirmOrder = async (onramp?: {
|
|
467
|
+
paymentMethod: string;
|
|
468
|
+
vendor: components["schemas"]["OnrampMetadata"]["vendor"];
|
|
469
|
+
}) => {
|
|
470
|
+
// if (!isAuthenticated) {
|
|
471
|
+
// // Copied from https://github.com/b3-fun/b3-mono/blob/main/apps/anyspend-web/components/User/index.tsx#L85
|
|
472
|
+
// setB3ModalContentType({
|
|
473
|
+
// chain: {
|
|
474
|
+
// ...b3,
|
|
475
|
+
// rpc: "https://mainnet-rpc.b3.fun",
|
|
476
|
+
// blockExplorers: [{ name: "B3 Explorer", url: "https://explorer.b3.fun/" }],
|
|
477
|
+
// testnet: undefined,
|
|
478
|
+
// },
|
|
479
|
+
// partnerId: String(process.env.NEXT_PUBLIC_THIRDWEB_PARTNER_ID),
|
|
480
|
+
// type: "signInWithB3",
|
|
481
|
+
// showBackButton: false,
|
|
482
|
+
// });
|
|
483
|
+
// setB3ModalOpen(true);
|
|
484
|
+
// return;
|
|
485
|
+
// }
|
|
498
486
|
|
|
499
487
|
if (recipientAddress) {
|
|
500
488
|
try {
|
|
@@ -507,7 +495,7 @@ export function AnySpendCustom({
|
|
|
507
495
|
};
|
|
508
496
|
|
|
509
497
|
const recipientSection =
|
|
510
|
-
showRecipient &&
|
|
498
|
+
showRecipient && recipientAddress ? (
|
|
511
499
|
<motion.div
|
|
512
500
|
initial={false}
|
|
513
501
|
animate={{
|
|
@@ -519,11 +507,11 @@ export function AnySpendCustom({
|
|
|
519
507
|
className="flex w-full items-center justify-between gap-4"
|
|
520
508
|
>
|
|
521
509
|
<div className="text-b3-react-foreground">
|
|
522
|
-
{orderType ===
|
|
510
|
+
{orderType === "swap"
|
|
523
511
|
? "Recipient"
|
|
524
|
-
: orderType ===
|
|
512
|
+
: orderType === "mint_nft"
|
|
525
513
|
? "Receive NFT at"
|
|
526
|
-
: orderType ===
|
|
514
|
+
: orderType === "join_tournament"
|
|
527
515
|
? "Join for"
|
|
528
516
|
: "Recipient"}
|
|
529
517
|
</div>
|
|
@@ -762,7 +750,9 @@ export function AnySpendCustom({
|
|
|
762
750
|
transition={{ duration: 0.3, delay: 0.1, ease: "easeInOut" }}
|
|
763
751
|
className="relative flex w-full items-center justify-between"
|
|
764
752
|
>
|
|
765
|
-
<span className="font-medium">
|
|
753
|
+
<span className="font-medium">
|
|
754
|
+
Total <span className="text-sm text-gray-500">(with fee)</span>
|
|
755
|
+
</span>
|
|
766
756
|
<h2 className={cn("text-as-primary text-2xl font-semibold")}>
|
|
767
757
|
{formattedSrcAmount || "--"} {srcToken.symbol}
|
|
768
758
|
</h2>
|
|
@@ -790,9 +780,7 @@ export function AnySpendCustom({
|
|
|
790
780
|
onClick={() => handleConfirmOrder()}
|
|
791
781
|
className="relative w-full"
|
|
792
782
|
>
|
|
793
|
-
{
|
|
794
|
-
"Sign in with B3"
|
|
795
|
-
) : isCreatingOrder ? (
|
|
783
|
+
{isCreatingOrder ? (
|
|
796
784
|
<div className="flex items-center gap-2">
|
|
797
785
|
<Loader2 className="size-4 animate-spin" />
|
|
798
786
|
<span>Creating order...</span>
|
|
@@ -833,10 +821,10 @@ export function AnySpendCustom({
|
|
|
833
821
|
onBack={() => setActiveTab("crypto")}
|
|
834
822
|
orderType={orderType}
|
|
835
823
|
nft={
|
|
836
|
-
|
|
837
|
-
? metadata.nftContract.type ===
|
|
824
|
+
metadata.type === "mint_nft"
|
|
825
|
+
? metadata.nftContract.type === "erc1155"
|
|
838
826
|
? {
|
|
839
|
-
type:
|
|
827
|
+
type: "erc1155",
|
|
840
828
|
contractAddress: metadata.nftContract.contractAddress,
|
|
841
829
|
tokenId: metadata.nftContract.tokenId!,
|
|
842
830
|
imageUrl: metadata.nftContract.imageUrl,
|
|
@@ -845,7 +833,7 @@ export function AnySpendCustom({
|
|
|
845
833
|
price: dstAmount,
|
|
846
834
|
}
|
|
847
835
|
: {
|
|
848
|
-
type:
|
|
836
|
+
type: "erc721",
|
|
849
837
|
contractAddress: metadata.nftContract.contractAddress,
|
|
850
838
|
name: metadata.nftContract.name,
|
|
851
839
|
description: metadata.nftContract.description,
|
|
@@ -855,7 +843,7 @@ export function AnySpendCustom({
|
|
|
855
843
|
: undefined
|
|
856
844
|
}
|
|
857
845
|
payload={
|
|
858
|
-
|
|
846
|
+
metadata.type === "custom"
|
|
859
847
|
? {
|
|
860
848
|
...metadata,
|
|
861
849
|
amount: dstAmount,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { ALL_CHAINS, getChainName, getExplorerAddressUrl
|
|
2
|
-
import { NftContract } from "@b3dotfun/sdk/anyspend/types";
|
|
1
|
+
import { ALL_CHAINS, getChainName, getExplorerAddressUrl } from "@b3dotfun/sdk/anyspend";
|
|
3
2
|
import { GlareCard, Popover, PopoverContent, PopoverTrigger } from "@b3dotfun/sdk/global-account/react";
|
|
4
3
|
import { cn } from "@b3dotfun/sdk/shared/utils";
|
|
5
4
|
import { getIpfsUrl } from "@b3dotfun/sdk/shared/utils/ipfs";
|
|
@@ -9,6 +8,8 @@ import { MoreVertical } from "lucide-react";
|
|
|
9
8
|
import { useState } from "react";
|
|
10
9
|
import { b3 } from "viem/chains";
|
|
11
10
|
import { AnySpendCustom } from "./AnySpendCustom";
|
|
11
|
+
import { GetQuoteResponse } from "../../types/api_req_res";
|
|
12
|
+
import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
12
13
|
|
|
13
14
|
export function AnySpendNFT({
|
|
14
15
|
isMainnet = true,
|
|
@@ -22,7 +23,7 @@ export function AnySpendNFT({
|
|
|
22
23
|
loadOrder?: string;
|
|
23
24
|
mode?: "modal" | "page";
|
|
24
25
|
recipientAddress?: string;
|
|
25
|
-
nftContract: NftContract;
|
|
26
|
+
nftContract: components["schemas"]["NftContract"];
|
|
26
27
|
onSuccess?: (txHash?: string) => void;
|
|
27
28
|
}) {
|
|
28
29
|
const header = ({
|
|
@@ -73,14 +74,14 @@ export function AnySpendNFT({
|
|
|
73
74
|
loadOrder={loadOrder}
|
|
74
75
|
mode={mode}
|
|
75
76
|
recipientAddress={recipientAddress}
|
|
76
|
-
orderType={
|
|
77
|
+
orderType={"mint_nft"}
|
|
77
78
|
dstChainId={nftContract.chainId}
|
|
78
79
|
dstToken={nftContract.currency}
|
|
79
80
|
dstAmount={nftContract.price}
|
|
80
81
|
contractAddress={nftContract.contractAddress}
|
|
81
82
|
encodedData="0x"
|
|
82
83
|
metadata={{
|
|
83
|
-
type:
|
|
84
|
+
type: "mint_nft",
|
|
84
85
|
nftContract: nftContract,
|
|
85
86
|
}}
|
|
86
87
|
header={header}
|
|
@@ -89,7 +90,7 @@ export function AnySpendNFT({
|
|
|
89
90
|
);
|
|
90
91
|
}
|
|
91
92
|
|
|
92
|
-
function DropdownMenu({ nftContract }: { nftContract: NftContract }) {
|
|
93
|
+
function DropdownMenu({ nftContract }: { nftContract: components["schemas"]["NftContract"] }) {
|
|
93
94
|
const [open, setOpen] = useState(false);
|
|
94
95
|
const chain = ALL_CHAINS[nftContract.chainId];
|
|
95
96
|
const nftUrl = getExplorerAddressUrl(nftContract.chainId, nftContract.contractAddress);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ABI_ERC20_STAKING, B3_TOKEN
|
|
1
|
+
import { ABI_ERC20_STAKING, B3_TOKEN } from "@b3dotfun/sdk/anyspend";
|
|
2
2
|
import {
|
|
3
3
|
Button,
|
|
4
4
|
GlareCardRounded,
|
|
@@ -476,14 +476,14 @@ export function AnySpendStakeB3({
|
|
|
476
476
|
loadOrder={loadOrder}
|
|
477
477
|
mode={mode}
|
|
478
478
|
recipientAddress={recipientAddress}
|
|
479
|
-
orderType={
|
|
479
|
+
orderType={"custom"}
|
|
480
480
|
dstChainId={base.id}
|
|
481
481
|
dstToken={B3_TOKEN}
|
|
482
482
|
dstAmount={userStakeAmount}
|
|
483
483
|
contractAddress={ERC20Staking}
|
|
484
484
|
encodedData={encodedData}
|
|
485
485
|
metadata={{
|
|
486
|
-
type:
|
|
486
|
+
type: "custom",
|
|
487
487
|
action: "stake B3",
|
|
488
488
|
}}
|
|
489
489
|
header={header}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { GetQuoteResponse, OrderType, Token, Tournament } from "@b3dotfun/sdk/anyspend";
|
|
2
1
|
import { cn } from "@b3dotfun/sdk/shared/utils";
|
|
3
2
|
import { formatDisplayNumber, formatTokenAmount } from "@b3dotfun/sdk/shared/utils/number";
|
|
4
3
|
import { AnimatePresence } from "framer-motion";
|
|
5
4
|
import { AnySpendCustom } from "./AnySpendCustom";
|
|
5
|
+
import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
6
|
+
import { GetQuoteResponse } from "@b3dotfun/sdk/anyspend/types/api_req_res";
|
|
6
7
|
|
|
7
8
|
type AnySpendTournamentProps =
|
|
8
9
|
| {
|
|
@@ -13,8 +14,8 @@ type AnySpendTournamentProps =
|
|
|
13
14
|
loadOrder?: string;
|
|
14
15
|
tournamentChainId: number;
|
|
15
16
|
tournamentContractAddress: string;
|
|
16
|
-
tournamentMetadata: Tournament;
|
|
17
|
-
tournamentEntryToken: Token;
|
|
17
|
+
tournamentMetadata: components["schemas"]["Tournament"];
|
|
18
|
+
tournamentEntryToken: components["schemas"]["Token"];
|
|
18
19
|
tournamentEntryFee: string;
|
|
19
20
|
onSuccess?: () => void;
|
|
20
21
|
}
|
|
@@ -25,8 +26,8 @@ type AnySpendTournamentProps =
|
|
|
25
26
|
loadOrder?: string;
|
|
26
27
|
tournamentChainId: number;
|
|
27
28
|
tournamentContractAddress: string;
|
|
28
|
-
tournamentMetadata: Tournament;
|
|
29
|
-
tournamentFundToken: Token;
|
|
29
|
+
tournamentMetadata: components["schemas"]["Tournament"];
|
|
30
|
+
tournamentFundToken: components["schemas"]["Token"];
|
|
30
31
|
tournamentFundAmount: string;
|
|
31
32
|
onSuccess?: () => void;
|
|
32
33
|
};
|
|
@@ -94,14 +95,14 @@ export function AnySpendTournament(props: AnySpendTournamentProps) {
|
|
|
94
95
|
loadOrder={loadOrder}
|
|
95
96
|
mode={mode}
|
|
96
97
|
recipientAddress={action === "join" ? props.joinFor : undefined}
|
|
97
|
-
orderType={action === "join" ?
|
|
98
|
+
orderType={action === "join" ? "join_tournament" : "fund_tournament"}
|
|
98
99
|
dstChainId={tournamentChainId}
|
|
99
100
|
dstToken={dstToken}
|
|
100
101
|
dstAmount={dstAmount}
|
|
101
102
|
contractAddress={tournamentContractAddress}
|
|
102
103
|
encodedData="0x"
|
|
103
104
|
metadata={{
|
|
104
|
-
type: action === "join" ?
|
|
105
|
+
type: action === "join" ? "join_tournament" : "fund_tournament",
|
|
105
106
|
tournament: tournamentMetadata,
|
|
106
107
|
}}
|
|
107
108
|
header={header}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { StyleRoot, useHasMounted, useTokenData } from "@b3dotfun/sdk/global-account/react";
|
|
1
|
+
import { StyleRoot, useTokenData } from "@b3dotfun/sdk/global-account/react";
|
|
3
2
|
import invariant from "@b3dotfun/sdk/shared/utils/debug";
|
|
4
3
|
import { useMemo } from "react";
|
|
5
4
|
import { encodeFunctionData, parseEther } from "viem";
|
|
6
|
-
import { ABI_SIGNATURE_MINTING } from "../../abis/
|
|
7
|
-
import { GenerateSigMintResponse } from "../../types/
|
|
5
|
+
import { ABI_SIGNATURE_MINTING } from "../../abis/signatureMinting";
|
|
6
|
+
import { GenerateSigMintResponse } from "../../types/signatureMint";
|
|
8
7
|
import { AnySpendCustom } from "./AnySpendCustom";
|
|
9
8
|
|
|
10
9
|
// Helper function to determine if URL is a video
|
|
@@ -55,13 +54,12 @@ export function AnyspendSignatureMint({
|
|
|
55
54
|
imageUrl?: string;
|
|
56
55
|
onSuccess?: (txHash?: string) => void;
|
|
57
56
|
}) {
|
|
58
|
-
const hasMounted = useHasMounted();
|
|
59
|
-
|
|
60
57
|
// Get token data
|
|
61
|
-
const {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
const {
|
|
59
|
+
data: tokenData,
|
|
60
|
+
isError: isTokenError,
|
|
61
|
+
isLoading,
|
|
62
|
+
} = useTokenData(signatureData.collection.chainId, signatureData.collection.signatureRequestBody?.currency);
|
|
65
63
|
|
|
66
64
|
// Convert token data to AnySpend Token type
|
|
67
65
|
const dstToken = useMemo(() => {
|
|
@@ -106,7 +104,18 @@ export function AnyspendSignatureMint({
|
|
|
106
104
|
</>
|
|
107
105
|
);
|
|
108
106
|
|
|
109
|
-
//
|
|
107
|
+
// Show loading state while fetching token data
|
|
108
|
+
if (isLoading) {
|
|
109
|
+
return (
|
|
110
|
+
<StyleRoot>
|
|
111
|
+
<div className="b3-root b3-modal bg-b3-react-background flex w-full flex-col items-center p-8">
|
|
112
|
+
<p className="text-as-primary/70 text-center text-sm">Loading payment token information...</p>
|
|
113
|
+
</div>
|
|
114
|
+
</StyleRoot>
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// If we don't have token data after loading, show error state
|
|
110
119
|
if (!dstToken || isTokenError) {
|
|
111
120
|
return (
|
|
112
121
|
<StyleRoot>
|
|
@@ -129,14 +138,14 @@ export function AnyspendSignatureMint({
|
|
|
129
138
|
loadOrder={loadOrder}
|
|
130
139
|
mode={mode}
|
|
131
140
|
recipientAddress={signatureData.payload.to}
|
|
132
|
-
orderType={
|
|
141
|
+
orderType={"custom"}
|
|
133
142
|
dstChainId={signatureData.collection.chainId}
|
|
134
143
|
dstToken={dstToken}
|
|
135
144
|
dstAmount={price.toString()}
|
|
136
145
|
contractAddress={signatureData.collection.address!}
|
|
137
146
|
encodedData={encodedData}
|
|
138
147
|
metadata={{
|
|
139
|
-
type:
|
|
148
|
+
type: "custom",
|
|
140
149
|
action: "Signature Mint",
|
|
141
150
|
}}
|
|
142
151
|
header={header}
|
package/src/anyspend/react/components/{AnySpendNFTButton.tsx → common/AnySpendNFTButton.tsx}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DEFAULT_NFT_CONTRACT } from "@b3dotfun/sdk/anyspend/constants";
|
|
2
|
+
import { components } from "@b3dotfun/sdk/anyspend/types/api";
|
|
2
3
|
import { Button, useModalStore } from "@b3dotfun/sdk/global-account/react";
|
|
3
|
-
import { NftContract } from "@b3dotfun/sdk/anyspend/types";
|
|
4
4
|
|
|
5
5
|
type AnySpendNFTButtonProps = {
|
|
6
|
-
nftContract?: NftContract;
|
|
6
|
+
nftContract?: components["schemas"]["NftContract"];
|
|
7
7
|
recipientAddress?: string;
|
|
8
8
|
};
|
|
9
9
|
|