@b3dotfun/sdk 0.0.8 → 0.0.9-alpha.0
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 +2 -7
- package/dist/cjs/anyspend/index.js +2 -8
- package/dist/cjs/anyspend/index.native.d.ts +2 -3
- package/dist/cjs/anyspend/index.native.js +2 -4
- 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 +2 -7
- package/dist/esm/anyspend/index.js +2 -8
- package/dist/esm/anyspend/index.native.d.ts +2 -3
- package/dist/esm/anyspend/index.native.js +2 -4
- 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 +2 -7
- package/dist/types/anyspend/index.native.d.ts +2 -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 +2 -5
- package/src/anyspend/index.ts +2 -9
- 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
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { paths } from "./api";
|
|
2
|
+
export type GetOrderAndTxsResponse = paths["/orders/{orderId}"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
3
|
+
export type GetQuoteRequest = paths["/orders/quote"]["post"]["requestBody"]["content"]["application/json"];
|
|
4
|
+
export type GetQuoteResponse = paths["/orders/quote"]["post"]["responses"]["200"]["content"]["application/json"];
|
|
5
|
+
export type GetCoinbaseOnrampOptionsResponse = paths["/onramp/coinbase/options"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
6
|
+
export type GetOrderHistoryResponse = paths["/orders"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
7
|
+
export type GetTokenListResponse = paths["/chains/{chainId}/tokens"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
8
|
+
export type CreateOrderResponse = paths["/orders"]["post"]["responses"]["200"]["content"]["application/json"];
|
|
9
|
+
export type GetStripeSupportedResponse = paths["/onramp/stripe/supported"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
10
|
+
export type GetStripeClientSecret = paths["/stripe/clientSecret"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Chain } from "viem";
|
|
2
|
-
import {
|
|
2
|
+
import { components } from "../../anyspend/types/api";
|
|
3
3
|
export declare enum ChainType {
|
|
4
4
|
EVM = "evm",
|
|
5
5
|
SOLANA = "solana"
|
|
@@ -11,8 +11,8 @@ export interface IBaseChain {
|
|
|
11
11
|
logoUrl: string;
|
|
12
12
|
nativeRequired: bigint;
|
|
13
13
|
canDepositNative: boolean;
|
|
14
|
-
defaultToken: Token;
|
|
15
|
-
nativeToken: Token;
|
|
14
|
+
defaultToken: components["schemas"]["Token"];
|
|
15
|
+
nativeToken: components["schemas"]["Token"];
|
|
16
16
|
}
|
|
17
17
|
export interface IEVMChain extends IBaseChain {
|
|
18
18
|
type: ChainType.EVM;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ChainType, IBaseChain, IEVMChain, ISolanaChain, Token } from "../../anyspend/types";
|
|
2
1
|
import { Account, Chain, PublicClient, Transport, WalletClient } from "viem";
|
|
2
|
+
import { ChainType, IBaseChain, IEVMChain, ISolanaChain } from "../types/chain";
|
|
3
|
+
import { components } from "../../anyspend/types/api";
|
|
3
4
|
export declare const EVM_MAINNET: Record<number, IEVMChain>;
|
|
4
5
|
export declare const EVM_TESTNET: Record<number, IEVMChain>;
|
|
5
6
|
export declare const SOLANA_MAINNET: ISolanaChain;
|
|
@@ -15,11 +16,11 @@ export declare function getNativeRequired(chainId: number): bigint;
|
|
|
15
16
|
export declare function canDepositNative(chainId: number): boolean;
|
|
16
17
|
export declare function isMainnet(chainId: number): boolean;
|
|
17
18
|
export declare function isTestnet(chainId: number): boolean;
|
|
18
|
-
export declare function getDefaultToken(chainId: number): Token;
|
|
19
|
+
export declare function getDefaultToken(chainId: number): components["schemas"]["Token"];
|
|
19
20
|
export declare function getChainName(chainId: number): string;
|
|
20
21
|
export declare function getPaymentUrl(address: string, amount: bigint, currency: string): string;
|
|
21
22
|
export declare function getExplorerTxUrl(chainId: number, txHash: string): string;
|
|
22
23
|
export declare function getExplorerAddressUrl(chainId: number, address: string): string;
|
|
23
24
|
export declare function getMulticall3Address(chainId: number): string;
|
|
24
|
-
export declare function getNativeToken(chainId: number): Token;
|
|
25
|
+
export declare function getNativeToken(chainId: number): components["schemas"]["Token"];
|
|
25
26
|
export declare function isEvmChain(chainId: number): boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ChainType } from "../../anyspend/types/index.js";
|
|
2
1
|
import invariant from "invariant";
|
|
3
2
|
import { createPublicClient, createWalletClient, defineChain, http, parseEther, } from "viem";
|
|
4
3
|
import { arbitrum, avalanche, b3, b3Sepolia, base, baseSepolia, bsc, mainnet, optimism, polygon, sepolia, } from "viem/chains";
|
|
5
4
|
import { RELAY_SOLANA_MAINNET_CHAIN_ID } from "../../anyspend/constants/index.js";
|
|
6
5
|
import { getAvaxToken, getBnbToken, getEthToken, getPolToken, getSolanaToken } from "./token.js";
|
|
6
|
+
import { ChainType } from "../types/chain.js";
|
|
7
7
|
function getCustomEvmChain(chain, rpcUrl) {
|
|
8
8
|
return defineChain({ ...chain, rpcUrls: { default: { http: [rpcUrl] } } });
|
|
9
9
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const getStatusDisplay: (order: Order) => {
|
|
1
|
+
import { components } from "../../anyspend/types/api";
|
|
2
|
+
export declare const getStatusDisplay: (order: components["schemas"]["Order"]) => {
|
|
3
3
|
text: string;
|
|
4
4
|
status: "processing" | "success" | "failure";
|
|
5
5
|
};
|
|
@@ -1,39 +1,38 @@
|
|
|
1
|
-
import { OrderStatus, OrderType } from "../../anyspend/types/index.js";
|
|
2
1
|
export const getStatusDisplay = (order) => {
|
|
3
2
|
switch (order.status) {
|
|
4
|
-
case
|
|
3
|
+
case "scanning_deposit_transaction":
|
|
5
4
|
return {
|
|
6
5
|
text: order.onrampMetadata ? "Awaiting Payment" : "Awaiting Deposit",
|
|
7
6
|
status: "processing",
|
|
8
7
|
};
|
|
9
|
-
case
|
|
8
|
+
case "waiting_stripe_payment":
|
|
10
9
|
return {
|
|
11
10
|
text: "Awaiting Payment",
|
|
12
11
|
status: "processing",
|
|
13
12
|
};
|
|
14
|
-
case
|
|
13
|
+
case "expired":
|
|
15
14
|
return { text: "Order Expired", status: "failure" };
|
|
16
|
-
case
|
|
15
|
+
case "sending_token_from_vault":
|
|
17
16
|
return { text: "Sending Token", status: "processing" };
|
|
18
|
-
case
|
|
17
|
+
case "relay":
|
|
19
18
|
return { text: "Executing Order", status: "processing" };
|
|
20
|
-
case
|
|
21
|
-
const text = order.type ===
|
|
19
|
+
case "executed": {
|
|
20
|
+
const text = order.type === "swap"
|
|
22
21
|
? "Swap Complete"
|
|
23
|
-
: order.type ===
|
|
22
|
+
: order.type === "mint_nft"
|
|
24
23
|
? "NFT Minted"
|
|
25
|
-
: order.type ===
|
|
24
|
+
: order.type === "join_tournament"
|
|
26
25
|
? "Tournament Joined"
|
|
27
|
-
: order.type ===
|
|
26
|
+
: order.type === "fund_tournament"
|
|
28
27
|
? "Tournament Funded"
|
|
29
28
|
: "Order Complete";
|
|
30
29
|
return { text, status: "success" };
|
|
31
30
|
}
|
|
32
|
-
case
|
|
31
|
+
case "refunding":
|
|
33
32
|
return { text: "Order Refunding", status: "processing" };
|
|
34
|
-
case
|
|
33
|
+
case "refunded":
|
|
35
34
|
return { text: "Order Refunded", status: "failure" };
|
|
36
|
-
case
|
|
35
|
+
case "failure":
|
|
37
36
|
return { text: "Order Failure", status: "failure" };
|
|
38
37
|
default:
|
|
39
38
|
throw new Error("Invalid order status");
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { components } from "../../anyspend/types/api";
|
|
2
2
|
export type OrderParams = {
|
|
3
|
-
orderType:
|
|
4
|
-
srcToken: Token;
|
|
5
|
-
dstToken: Token;
|
|
3
|
+
orderType: components["schemas"]["Order"]["type"];
|
|
4
|
+
srcToken: components["schemas"]["Token"];
|
|
5
|
+
dstToken: components["schemas"]["Token"];
|
|
6
6
|
expectedDstAmount?: string;
|
|
7
|
-
nft?:
|
|
7
|
+
nft?: components["schemas"]["NFT"] & {
|
|
8
8
|
price: string;
|
|
9
9
|
};
|
|
10
|
-
tournament?: Tournament & {
|
|
10
|
+
tournament?: components["schemas"]["Tournament"] & {
|
|
11
11
|
contractAddress: string;
|
|
12
12
|
entryPriceOrFundAmount: string;
|
|
13
13
|
};
|
|
14
14
|
payload?: any;
|
|
15
15
|
};
|
|
16
|
-
export declare const buildPayload: (orderType:
|
|
17
|
-
export declare const buildMetadata: (orderType:
|
|
16
|
+
export declare const buildPayload: (orderType: components["schemas"]["Order"]["type"], params: OrderParams) => any;
|
|
17
|
+
export declare const buildMetadata: (orderType: components["schemas"]["Order"]["type"], params: OrderParams) => {
|
|
18
18
|
srcToken: {
|
|
19
|
-
symbol: string;
|
|
20
19
|
chainId: number;
|
|
21
20
|
address: string;
|
|
21
|
+
symbol: string;
|
|
22
22
|
name: string;
|
|
23
23
|
decimals: number;
|
|
24
24
|
metadata: {
|
|
25
|
-
logoURI?: string
|
|
25
|
+
logoURI?: string;
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
28
|
dstToken: {
|
|
29
|
-
symbol: string;
|
|
30
29
|
chainId: number;
|
|
31
30
|
address: string;
|
|
31
|
+
symbol: string;
|
|
32
32
|
name: string;
|
|
33
33
|
decimals: number;
|
|
34
34
|
metadata: {
|
|
35
|
-
logoURI?: string
|
|
35
|
+
logoURI?: string;
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
38
|
} | {
|
|
39
39
|
nft: (({
|
|
40
|
-
|
|
41
|
-
type: NftType.ERC721;
|
|
40
|
+
type: "erc721";
|
|
42
41
|
contractAddress: string;
|
|
42
|
+
name: string;
|
|
43
43
|
description: string;
|
|
44
44
|
imageUrl: string;
|
|
45
45
|
} | {
|
|
46
|
-
|
|
47
|
-
type: NftType.ERC1155;
|
|
46
|
+
type: "erc1155";
|
|
48
47
|
contractAddress: string;
|
|
48
|
+
name: string;
|
|
49
49
|
description: string;
|
|
50
50
|
imageUrl: string;
|
|
51
51
|
tokenId: number;
|
|
@@ -53,75 +53,75 @@ export declare const buildMetadata: (orderType: OrderType, params: OrderParams)
|
|
|
53
53
|
price: string;
|
|
54
54
|
}) | undefined;
|
|
55
55
|
srcToken: {
|
|
56
|
-
symbol: string;
|
|
57
56
|
chainId: number;
|
|
58
57
|
address: string;
|
|
58
|
+
symbol: string;
|
|
59
59
|
name: string;
|
|
60
60
|
decimals: number;
|
|
61
61
|
metadata: {
|
|
62
|
-
logoURI?: string
|
|
62
|
+
logoURI?: string;
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
65
|
dstToken: {
|
|
66
|
-
symbol: string;
|
|
67
66
|
chainId: number;
|
|
68
67
|
address: string;
|
|
68
|
+
symbol: string;
|
|
69
69
|
name: string;
|
|
70
70
|
decimals: number;
|
|
71
71
|
metadata: {
|
|
72
|
-
logoURI?: string
|
|
72
|
+
logoURI?: string;
|
|
73
73
|
};
|
|
74
74
|
};
|
|
75
75
|
} | {
|
|
76
76
|
tournament: ({
|
|
77
|
+
slug: string;
|
|
77
78
|
name: string;
|
|
78
79
|
description: string;
|
|
79
80
|
imageUrl: string;
|
|
80
|
-
slug: string;
|
|
81
81
|
} & {
|
|
82
82
|
contractAddress: string;
|
|
83
83
|
entryPriceOrFundAmount: string;
|
|
84
84
|
}) | undefined;
|
|
85
85
|
srcToken: {
|
|
86
|
-
symbol: string;
|
|
87
86
|
chainId: number;
|
|
88
87
|
address: string;
|
|
88
|
+
symbol: string;
|
|
89
89
|
name: string;
|
|
90
90
|
decimals: number;
|
|
91
91
|
metadata: {
|
|
92
|
-
logoURI?: string
|
|
92
|
+
logoURI?: string;
|
|
93
93
|
};
|
|
94
94
|
};
|
|
95
95
|
dstToken: {
|
|
96
|
-
symbol: string;
|
|
97
96
|
chainId: number;
|
|
98
97
|
address: string;
|
|
98
|
+
symbol: string;
|
|
99
99
|
name: string;
|
|
100
100
|
decimals: number;
|
|
101
101
|
metadata: {
|
|
102
|
-
logoURI?: string
|
|
102
|
+
logoURI?: string;
|
|
103
103
|
};
|
|
104
104
|
};
|
|
105
105
|
} | {
|
|
106
106
|
action: any;
|
|
107
107
|
srcToken: {
|
|
108
|
-
symbol: string;
|
|
109
108
|
chainId: number;
|
|
110
109
|
address: string;
|
|
110
|
+
symbol: string;
|
|
111
111
|
name: string;
|
|
112
112
|
decimals: number;
|
|
113
113
|
metadata: {
|
|
114
|
-
logoURI?: string
|
|
114
|
+
logoURI?: string;
|
|
115
115
|
};
|
|
116
116
|
};
|
|
117
117
|
dstToken: {
|
|
118
|
-
symbol: string;
|
|
119
118
|
chainId: number;
|
|
120
119
|
address: string;
|
|
120
|
+
symbol: string;
|
|
121
121
|
name: string;
|
|
122
122
|
decimals: number;
|
|
123
123
|
metadata: {
|
|
124
|
-
logoURI?: string
|
|
124
|
+
logoURI?: string;
|
|
125
125
|
};
|
|
126
126
|
};
|
|
127
127
|
};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { NftType, OrderType } from "../../anyspend/types/index.js";
|
|
2
1
|
import { normalizeAddress } from "../../anyspend/utils/index.js";
|
|
3
2
|
export const buildPayload = (orderType, params) => {
|
|
4
3
|
const { nft, tournament, payload, expectedDstAmount } = params;
|
|
5
4
|
switch (orderType) {
|
|
6
|
-
case
|
|
5
|
+
case "swap":
|
|
7
6
|
return {
|
|
8
7
|
expectedDstAmount,
|
|
9
8
|
actualDstAmount: null,
|
|
10
9
|
};
|
|
11
|
-
case
|
|
12
|
-
if (nft?.type ===
|
|
10
|
+
case "mint_nft":
|
|
11
|
+
if (nft?.type === "erc1155") {
|
|
13
12
|
return {
|
|
14
13
|
contractAddress: normalizeAddress(nft.contractAddress),
|
|
15
14
|
nftPrice: nft?.price || "",
|
|
@@ -17,7 +16,7 @@ export const buildPayload = (orderType, params) => {
|
|
|
17
16
|
contractType: nft?.type,
|
|
18
17
|
};
|
|
19
18
|
}
|
|
20
|
-
else if (nft?.type ===
|
|
19
|
+
else if (nft?.type === "erc721") {
|
|
21
20
|
return {
|
|
22
21
|
contractAddress: normalizeAddress(nft.contractAddress),
|
|
23
22
|
nftPrice: nft?.price || "",
|
|
@@ -27,17 +26,17 @@ export const buildPayload = (orderType, params) => {
|
|
|
27
26
|
else {
|
|
28
27
|
throw new Error(`Invalid nft payload: ${JSON.stringify(nft)}`);
|
|
29
28
|
}
|
|
30
|
-
case
|
|
29
|
+
case "join_tournament":
|
|
31
30
|
return {
|
|
32
31
|
contractAddress: tournament?.contractAddress,
|
|
33
32
|
entryPrice: tournament?.entryPriceOrFundAmount,
|
|
34
33
|
};
|
|
35
|
-
case
|
|
34
|
+
case "fund_tournament":
|
|
36
35
|
return {
|
|
37
36
|
contractAddress: tournament?.contractAddress,
|
|
38
37
|
fundAmount: tournament?.entryPriceOrFundAmount,
|
|
39
38
|
};
|
|
40
|
-
case
|
|
39
|
+
case "custom":
|
|
41
40
|
return { ...payload };
|
|
42
41
|
default:
|
|
43
42
|
throw new Error(`Invalid order type: ${orderType}`);
|
|
@@ -50,14 +49,14 @@ export const buildMetadata = (orderType, params) => {
|
|
|
50
49
|
dstToken,
|
|
51
50
|
};
|
|
52
51
|
switch (orderType) {
|
|
53
|
-
case
|
|
52
|
+
case "swap":
|
|
54
53
|
return { ...baseMetadata };
|
|
55
|
-
case
|
|
54
|
+
case "mint_nft":
|
|
56
55
|
return { ...baseMetadata, nft };
|
|
57
|
-
case
|
|
58
|
-
case
|
|
56
|
+
case "join_tournament":
|
|
57
|
+
case "fund_tournament":
|
|
59
58
|
return { ...baseMetadata, tournament };
|
|
60
|
-
case
|
|
59
|
+
case "custom":
|
|
61
60
|
return { ...baseMetadata, action: payload.action };
|
|
62
61
|
default:
|
|
63
62
|
throw new Error(`Invalid order type: ${orderType}`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { components } from "../../anyspend/types/api";
|
|
2
2
|
export declare function isNativeToken(address: string): boolean;
|
|
3
|
-
export declare function getSolanaToken(): Token;
|
|
4
|
-
export declare function getEthToken(chainId: number): Token;
|
|
5
|
-
export declare function getPolToken(): Token;
|
|
6
|
-
export declare function getBnbToken(): Token;
|
|
7
|
-
export declare function getAvaxToken(): Token;
|
|
3
|
+
export declare function getSolanaToken(): components["schemas"]["Token"];
|
|
4
|
+
export declare function getEthToken(chainId: number): components["schemas"]["Token"];
|
|
5
|
+
export declare function getPolToken(): components["schemas"]["Token"];
|
|
6
|
+
export declare function getBnbToken(): components["schemas"]["Token"];
|
|
7
|
+
export declare function getAvaxToken(): components["schemas"]["Token"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { AnySpend, AnySpendBuySpin, AnySpendNFT, AnySpendStakeB3, AnySpendTournament,
|
|
2
|
+
import { AnySpend, AnySpendBondKit, AnySpendBuySpin, AnySpendNFT, AnyspendSignatureMint, AnySpendStakeB3, AnySpendTournament, OrderHistory, } from "../../../anyspend/react/index.js";
|
|
3
3
|
import { useIsMobile, useModalStore } from "../../../global-account/react/index.js";
|
|
4
4
|
import { debugB3React } from "../../../shared/utils/debug.js";
|
|
5
5
|
import { useB3 } from "./B3Provider/useB3.js";
|
|
@@ -26,6 +26,7 @@ export function B3DynamicModal() {
|
|
|
26
26
|
"anySpendOrderHistory",
|
|
27
27
|
"signInWithB3",
|
|
28
28
|
"anySpendSignatureMint",
|
|
29
|
+
"anySpendBondKit",
|
|
29
30
|
].find(type => contentType?.type === type)) {
|
|
30
31
|
contentClass += " max-h-[90dvh] overflow-y-auto no-scrollbar w-full";
|
|
31
32
|
}
|
|
@@ -36,6 +37,7 @@ export function B3DynamicModal() {
|
|
|
36
37
|
"anySpendStakeB3",
|
|
37
38
|
"anySpendBuySpin",
|
|
38
39
|
"anySpendSignatureMint",
|
|
40
|
+
"anySpendBondKit",
|
|
39
41
|
].find(type => contentType?.type === type)) {
|
|
40
42
|
// Due to the dynamic of (Pay with crypto),(Pay with fiat), we want the height fixed to 90dvh but still scrollable.
|
|
41
43
|
// NOTE: Just leave it here in case we want the fixed height
|
|
@@ -77,6 +79,8 @@ export function B3DynamicModal() {
|
|
|
77
79
|
return _jsx(AnySpendBuySpin, { ...contentType, mode: "modal" });
|
|
78
80
|
case "anySpendSignatureMint":
|
|
79
81
|
return _jsx(AnyspendSignatureMint, { ...contentType, mode: "modal" });
|
|
82
|
+
case "anySpendBondKit":
|
|
83
|
+
return _jsx(AnySpendBondKit, { ...contentType });
|
|
80
84
|
// Add other modal types here
|
|
81
85
|
default:
|
|
82
86
|
return null;
|
|
@@ -12,7 +12,7 @@ export function SignIn(props) {
|
|
|
12
12
|
const { automaticallySetFirstEoa } = useB3();
|
|
13
13
|
const { wallet, address: globalAddress, ensName, connectedSmartWallet, connectedEOAWallet, isActiveSmartWallet, isActiveEOAWallet, smartWalletIcon, eoaWalletIcon, } = useAccountWallet();
|
|
14
14
|
const isMobile = useIsMobile();
|
|
15
|
-
const { logout } = useAuthentication(String(process.env.
|
|
15
|
+
const { logout } = useAuthentication(String(process.env.NEXT_PUBLIC_THIRDWEB_PARTNER_ID));
|
|
16
16
|
const onDisconnect = async () => {
|
|
17
17
|
await logout();
|
|
18
18
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
2
|
interface TabsRootProps {
|
|
3
3
|
value: string;
|
|
4
4
|
onValueChange: (value: string) => void;
|
|
@@ -18,7 +18,7 @@ interface TabTriggerProps {
|
|
|
18
18
|
icon?: ReactNode;
|
|
19
19
|
disabled?: boolean;
|
|
20
20
|
}
|
|
21
|
-
export declare
|
|
21
|
+
export declare const TabTrigger: React.ForwardRefExoticComponent<TabTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
22
22
|
interface TabsContentProps {
|
|
23
23
|
value: string;
|
|
24
24
|
children: ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { cn } from "../../../../shared/utils/cn.js";
|
|
4
3
|
import { TransitionPanel } from "../../../../global-account/react/index.js";
|
|
4
|
+
import { cn } from "../../../../shared/utils/cn.js";
|
|
5
5
|
import { AnimatePresence, motion } from "framer-motion";
|
|
6
6
|
import React, { createContext, useContext } from "react";
|
|
7
7
|
const TabsContext = createContext(undefined);
|
|
@@ -11,14 +11,14 @@ export function Tabs({ value, onValueChange, children, className = "" }) {
|
|
|
11
11
|
export function TabsList({ children, className = "", hideGradient = false }) {
|
|
12
12
|
return (_jsxs("div", { className: "relative w-full", children: [_jsx("div", { role: "tablist", className: cn("no-scrollbar relative mb-4 flex items-center gap-2 whitespace-nowrap", className), children: children }), _jsx(AnimatePresence, { mode: "wait", children: !hideGradient && (_jsxs(motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: 0.2, delay: 0.2 }, children: [_jsx("div", { className: "pointer-events-none absolute bottom-0 left-0 top-0 z-10 w-8 bg-gradient-to-r from-[#15121c] to-transparent md:hidden" }), _jsx("div", { className: "pointer-events-none absolute bottom-0 right-0 top-0 z-10 w-8 bg-gradient-to-l from-[#15121c] to-transparent md:hidden" })] }, "gradients-container")) })] }));
|
|
13
13
|
}
|
|
14
|
-
export
|
|
14
|
+
export const TabTrigger = React.forwardRef(({ value, children, icon, disabled = false }, ref) => {
|
|
15
15
|
const context = useContext(TabsContext);
|
|
16
16
|
if (!context)
|
|
17
17
|
throw new Error("TabTrigger must be used within Tabs");
|
|
18
18
|
const { selectedTab, onTabChange } = context;
|
|
19
19
|
const isSelected = selectedTab === value;
|
|
20
|
-
return (_jsxs("button", { role: "tab", "aria-selected": isSelected, "aria-controls": `panel-${value}`, id: `tab-${value}`, onClick: () => onTabChange(value), className: `relative rounded-full px-4 py-2 text-sm text-white transition-all duration-200 hover:text-white focus:outline-none`, disabled: disabled, children: [_jsxs("span", { className: `${isSelected ? "opacity-100" : "opacity-50"} relative z-10 flex items-center gap-2 font-semibold uppercase`, children: [children, icon] }), isSelected && (_jsx(motion.span, { layoutId: "activeTab", transition: { type: "spring", duration: 0.4 }, className: "from-as-light-brand to-as-brand/10 border-as-brand/30 absolute inset-0 z-0 rounded-full border border-t-white/15 bg-gradient-to-b shadow-lg" }))] }));
|
|
21
|
-
}
|
|
20
|
+
return (_jsxs("button", { ref: ref, role: "tab", "aria-selected": isSelected, "aria-controls": `panel-${value}`, id: `tab-${value}`, onClick: () => onTabChange(value), className: `relative rounded-full px-4 py-2 text-sm text-white transition-all duration-200 hover:text-white focus:outline-none`, disabled: disabled, children: [_jsxs("span", { className: `${isSelected ? "opacity-100" : "opacity-50"} relative z-10 flex items-center gap-2 font-semibold uppercase`, children: [children, icon] }), isSelected && (_jsx(motion.span, { layoutId: "activeTab", transition: { type: "spring", duration: 0.4 }, className: "from-as-light-brand to-as-brand/10 border-as-brand/30 absolute inset-0 z-0 rounded-full border border-t-white/15 bg-gradient-to-b shadow-lg" }))] }));
|
|
21
|
+
});
|
|
22
22
|
export function TabsContent({ value, children }) {
|
|
23
23
|
const context = useContext(TabsContext);
|
|
24
24
|
if (!context)
|
|
@@ -24,7 +24,7 @@ declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<
|
|
|
24
24
|
ref?: React.Ref<HTMLInputElement>;
|
|
25
25
|
} & {
|
|
26
26
|
asChild?: boolean;
|
|
27
|
-
}, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "
|
|
27
|
+
}, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "type" | "value" | "onChange"> & {
|
|
28
28
|
value?: string;
|
|
29
29
|
onValueChange?: (search: string) => void;
|
|
30
30
|
} & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -30,7 +30,7 @@ export function useAccountWallet() {
|
|
|
30
30
|
? socialIcons[lastAuthProvider]
|
|
31
31
|
: "https://gradvatar.com/0x0000000000000000000000000000000000000000"; // show smart wallet of eoa wallet is gradvatar
|
|
32
32
|
const { data: profileData } = useBsmntProfile({ address: account?.address });
|
|
33
|
-
const ensName = profileData?.username?.
|
|
33
|
+
const ensName = profileData?.username?.replace(/\.b3\.fun/g, "");
|
|
34
34
|
const avatarUrl = profileData?.avatar;
|
|
35
35
|
const res = useMemo(() => ({
|
|
36
36
|
wallet: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { components } from "../../../anyspend/types/api";
|
|
2
2
|
export type TransactionType = "send" | "swap" | "bridge";
|
|
3
3
|
export interface SprinterOption {
|
|
4
4
|
chainId: number;
|
|
@@ -18,7 +18,7 @@ export interface TransactionPathResult extends TransactionPath {
|
|
|
18
18
|
}
|
|
19
19
|
interface UseBestTransactionPathProps {
|
|
20
20
|
amount: bigint;
|
|
21
|
-
token: Token;
|
|
21
|
+
token: components["schemas"]["Token"];
|
|
22
22
|
address?: string;
|
|
23
23
|
transactionType?: TransactionType;
|
|
24
24
|
}
|
|
@@ -10,7 +10,7 @@ export function useOnchainName(address) {
|
|
|
10
10
|
return null;
|
|
11
11
|
try {
|
|
12
12
|
const response = await fetchBsmntProfile(undefined, address);
|
|
13
|
-
return response?.username?.
|
|
13
|
+
return response?.username?.replace(/\.b3\.fun/g, "") || null;
|
|
14
14
|
}
|
|
15
15
|
catch (error) {
|
|
16
16
|
return null;
|
|
@@ -25,7 +25,7 @@ export function useOnchainName(address) {
|
|
|
25
25
|
return null;
|
|
26
26
|
try {
|
|
27
27
|
const response = await getB3NameByAddress(address);
|
|
28
|
-
return response?.name?.
|
|
28
|
+
return response?.name?.replace(/\.b3\.fun/g, "") || null;
|
|
29
29
|
}
|
|
30
30
|
catch (error) {
|
|
31
31
|
return null;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { components } from "../../../anyspend/types/api";
|
|
2
2
|
interface UseTokenFromUrlOptions {
|
|
3
3
|
/**
|
|
4
4
|
* Default token to use when URL params are not available
|
|
5
5
|
*/
|
|
6
|
-
defaultToken: Token;
|
|
6
|
+
defaultToken: components["schemas"]["Token"];
|
|
7
7
|
/**
|
|
8
8
|
* The URL parameter prefix to look for (e.g., "from" or "to")
|
|
9
9
|
*/
|
|
@@ -13,9 +13,9 @@ interface UseTokenFromUrlOptions {
|
|
|
13
13
|
* Hook to parse token data from URL parameters and fetch additional token info.
|
|
14
14
|
* Looks for parameters: [prefix]Currency
|
|
15
15
|
*/
|
|
16
|
-
export declare function useTokenFromUrl({ defaultToken, prefix }: UseTokenFromUrlOptions): Token;
|
|
17
|
-
export declare function useTokenFromAddress({ address, chainId }: {
|
|
16
|
+
export declare function useTokenFromUrl({ defaultToken, prefix }: UseTokenFromUrlOptions): components["schemas"]["Token"];
|
|
17
|
+
export declare function useTokenFromAddress({ address, chainId, }: {
|
|
18
18
|
address: string;
|
|
19
19
|
chainId: number;
|
|
20
|
-
}): Token | undefined;
|
|
20
|
+
}): components["schemas"]["Token"] | undefined;
|
|
21
21
|
export {};
|
|
@@ -63,7 +63,7 @@ export function useTokenFromUrl({ defaultToken, prefix }) {
|
|
|
63
63
|
},
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
export function useTokenFromAddress({ address, chainId }) {
|
|
66
|
+
export function useTokenFromAddress({ address, chainId, }) {
|
|
67
67
|
const { data: tokenInfo, isError } = useQuery({
|
|
68
68
|
queryKey: ["tokenInfo", address, chainId],
|
|
69
69
|
queryFn: () => fetchTokenInfo(getCoingeckoChainInfo(chainId).coingecko_id, address),
|