@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
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const zDepositTransaction: z.ZodObject<{
|
|
3
|
-
orderId: z.ZodString;
|
|
4
|
-
chain: z.ZodNumber;
|
|
5
|
-
from: z.ZodNullable<z.ZodString>;
|
|
6
|
-
txHash: z.ZodString;
|
|
7
|
-
amount: z.ZodString;
|
|
8
|
-
createdAt: z.ZodNumber;
|
|
9
|
-
}, "strip", z.ZodTypeAny, {
|
|
10
|
-
amount: string;
|
|
11
|
-
createdAt: number;
|
|
12
|
-
orderId: string;
|
|
13
|
-
chain: number;
|
|
14
|
-
from: string | null;
|
|
15
|
-
txHash: string;
|
|
16
|
-
}, {
|
|
17
|
-
amount: string;
|
|
18
|
-
createdAt: number;
|
|
19
|
-
orderId: string;
|
|
20
|
-
chain: number;
|
|
21
|
-
from: string | null;
|
|
22
|
-
txHash: string;
|
|
23
|
-
}>;
|
|
24
|
-
export type DepositTransaction = z.infer<typeof zDepositTransaction>;
|
|
25
|
-
export declare const zRelayTransaction: z.ZodObject<{
|
|
26
|
-
orderId: z.ZodString;
|
|
27
|
-
chain: z.ZodNumber;
|
|
28
|
-
txHash: z.ZodString;
|
|
29
|
-
status: z.ZodEnum<["refund", "delayed", "waiting", "failure", "pending", "success"]>;
|
|
30
|
-
createdAt: z.ZodNumber;
|
|
31
|
-
}, "strip", z.ZodTypeAny, {
|
|
32
|
-
status: "failure" | "success" | "refund" | "delayed" | "waiting" | "pending";
|
|
33
|
-
createdAt: number;
|
|
34
|
-
orderId: string;
|
|
35
|
-
chain: number;
|
|
36
|
-
txHash: string;
|
|
37
|
-
}, {
|
|
38
|
-
status: "failure" | "success" | "refund" | "delayed" | "waiting" | "pending";
|
|
39
|
-
createdAt: number;
|
|
40
|
-
orderId: string;
|
|
41
|
-
chain: number;
|
|
42
|
-
txHash: string;
|
|
43
|
-
}>;
|
|
44
|
-
export type RelayTransaction = z.infer<typeof zRelayTransaction>;
|
|
45
|
-
export declare const zExecuteTransaction: z.ZodObject<{
|
|
46
|
-
orderId: z.ZodString;
|
|
47
|
-
chain: z.ZodNumber;
|
|
48
|
-
txHash: z.ZodString;
|
|
49
|
-
createdAt: z.ZodNumber;
|
|
50
|
-
}, "strip", z.ZodTypeAny, {
|
|
51
|
-
createdAt: number;
|
|
52
|
-
orderId: string;
|
|
53
|
-
chain: number;
|
|
54
|
-
txHash: string;
|
|
55
|
-
}, {
|
|
56
|
-
createdAt: number;
|
|
57
|
-
orderId: string;
|
|
58
|
-
chain: number;
|
|
59
|
-
txHash: string;
|
|
60
|
-
}>;
|
|
61
|
-
export type ExecuteTransaction = z.infer<typeof zExecuteTransaction>;
|
|
62
|
-
export declare const zRefundTransaction: z.ZodObject<{
|
|
63
|
-
orderId: z.ZodString;
|
|
64
|
-
chain: z.ZodNumber;
|
|
65
|
-
txHash: z.ZodString;
|
|
66
|
-
amount: z.ZodString;
|
|
67
|
-
status: z.ZodEnum<["success", "failure"]>;
|
|
68
|
-
createdAt: z.ZodNumber;
|
|
69
|
-
}, "strip", z.ZodTypeAny, {
|
|
70
|
-
status: "failure" | "success";
|
|
71
|
-
amount: string;
|
|
72
|
-
createdAt: number;
|
|
73
|
-
orderId: string;
|
|
74
|
-
chain: number;
|
|
75
|
-
txHash: string;
|
|
76
|
-
}, {
|
|
77
|
-
status: "failure" | "success";
|
|
78
|
-
amount: string;
|
|
79
|
-
createdAt: number;
|
|
80
|
-
orderId: string;
|
|
81
|
-
chain: number;
|
|
82
|
-
txHash: string;
|
|
83
|
-
}>;
|
|
84
|
-
export type RefundTransaction = z.infer<typeof zRefundTransaction>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
import { zToken } from "./token";
|
|
3
|
-
|
|
4
|
-
export const zCustomPayload = z.object({
|
|
5
|
-
data: z.string(),
|
|
6
|
-
to: z.string(),
|
|
7
|
-
spenderAddress: z.string().optional(),
|
|
8
|
-
amount: z.string(),
|
|
9
|
-
});
|
|
10
|
-
export type CustomPayload = z.infer<typeof zCustomPayload>;
|
|
11
|
-
|
|
12
|
-
export const zCustomMetadata = z.object({
|
|
13
|
-
srcToken: zToken,
|
|
14
|
-
dstToken: zToken,
|
|
15
|
-
action: z.string().optional(),
|
|
16
|
-
});
|
|
17
|
-
export type CustomMetadata = z.infer<typeof zCustomMetadata>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export * from "./req-res";
|
|
2
|
-
|
|
3
|
-
export * from "./chain";
|
|
4
|
-
export * from "./custom";
|
|
5
|
-
export * from "./globalWallet";
|
|
6
|
-
export * from "./metadata";
|
|
7
|
-
export * from "./nft";
|
|
8
|
-
export * from "./onramp";
|
|
9
|
-
export * from "./order";
|
|
10
|
-
export * from "./relay";
|
|
11
|
-
export * from "./swap";
|
|
12
|
-
export * from "./token";
|
|
13
|
-
export * from "./tournament";
|
|
14
|
-
export * from "./transaction";
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { NftContract } from "./nft";
|
|
2
|
-
import { OrderType } from "./order";
|
|
3
|
-
|
|
4
|
-
export type BaseMetadata = {
|
|
5
|
-
type: OrderType;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export type NftMetadata = BaseMetadata & {
|
|
9
|
-
type: OrderType.MintNFT;
|
|
10
|
-
nftContract: NftContract;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export type TournamentMetadata = BaseMetadata & {
|
|
14
|
-
type: OrderType.JoinTournament | OrderType.FundTournament;
|
|
15
|
-
tournament: {
|
|
16
|
-
slug: string;
|
|
17
|
-
name: string;
|
|
18
|
-
description: string;
|
|
19
|
-
imageUrl: string;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export type CustomTxMetadata = BaseMetadata & {
|
|
24
|
-
type: OrderType.Custom;
|
|
25
|
-
action: string;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export type AnySpendMetadata = NftMetadata | TournamentMetadata | CustomTxMetadata;
|
|
29
|
-
|
|
30
|
-
// Type guard functions
|
|
31
|
-
export function isNftMetadata(metadata: AnySpendMetadata): metadata is NftMetadata {
|
|
32
|
-
return metadata.type === OrderType.MintNFT;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export function isTournamentMetadata(metadata: AnySpendMetadata): metadata is TournamentMetadata {
|
|
36
|
-
return metadata.type === OrderType.JoinTournament || metadata.type === OrderType.FundTournament;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export function isCustomTxMetadata(metadata: AnySpendMetadata): metadata is CustomTxMetadata {
|
|
40
|
-
return metadata.type === OrderType.Custom;
|
|
41
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { Token, zToken } from "./token";
|
|
3
|
-
|
|
4
|
-
export enum NftType {
|
|
5
|
-
ERC721 = "erc721",
|
|
6
|
-
ERC1155 = "erc1155",
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const zBaseNft = z.object({
|
|
10
|
-
type: z.nativeEnum(NftType),
|
|
11
|
-
contractAddress: z.string(),
|
|
12
|
-
name: z.string(),
|
|
13
|
-
description: z.string(),
|
|
14
|
-
imageUrl: z.string(),
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
export const zNft = z.discriminatedUnion("type", [
|
|
18
|
-
zBaseNft.extend({
|
|
19
|
-
type: z.literal(NftType.ERC721),
|
|
20
|
-
}),
|
|
21
|
-
zBaseNft.extend({
|
|
22
|
-
type: z.literal(NftType.ERC1155),
|
|
23
|
-
tokenId: z.number(),
|
|
24
|
-
imageUrl: z.string(),
|
|
25
|
-
}),
|
|
26
|
-
]);
|
|
27
|
-
export type Nft = z.infer<typeof zNft>;
|
|
28
|
-
|
|
29
|
-
export const zMintNftPayload = z.object({
|
|
30
|
-
contractAddress: z.string(),
|
|
31
|
-
tokenId: z.number().nullable(),
|
|
32
|
-
contractType: z.nativeEnum(NftType),
|
|
33
|
-
nftPrice: z.string(),
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
export const zMintNftMetadata = z.object({
|
|
37
|
-
srcToken: zToken,
|
|
38
|
-
dstToken: zToken,
|
|
39
|
-
nft: zNft,
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
export interface NftContract {
|
|
43
|
-
chainId: number;
|
|
44
|
-
contractAddress: string;
|
|
45
|
-
price: string;
|
|
46
|
-
priceFormatted: string;
|
|
47
|
-
currency: Token;
|
|
48
|
-
imageUrl: string;
|
|
49
|
-
name: string;
|
|
50
|
-
description: string;
|
|
51
|
-
tokenId: number | null;
|
|
52
|
-
type: NftType;
|
|
53
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
export enum OnrampVendor {
|
|
4
|
-
Coinbase = "coinbase",
|
|
5
|
-
Stripe = "stripe",
|
|
6
|
-
StripeWeb2 = "stripe-web2",
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const zOnrampMetadata = z.object({
|
|
10
|
-
country: z.string(),
|
|
11
|
-
vendor: z.nativeEnum(OnrampVendor),
|
|
12
|
-
paymentMethod: z.string(),
|
|
13
|
-
ipAddress: z.string().ip("Invalid IP address").optional(),
|
|
14
|
-
redirectUrl: z.string(),
|
|
15
|
-
stripeAmountInCents: z.number().optional(),
|
|
16
|
-
});
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { zOnrampMetadata } from "./onramp";
|
|
3
|
-
import { zMintNftMetadata, zMintNftPayload } from "./nft";
|
|
4
|
-
import { zSwapMetadata, zSwapPayload } from "./swap";
|
|
5
|
-
import { zFundTournamentPayload, zJoinTournamentPayload, zTournamentMetadata } from "./tournament";
|
|
6
|
-
import { zCustomMetadata, zCustomPayload } from "./custom";
|
|
7
|
-
|
|
8
|
-
export enum OrderStatus {
|
|
9
|
-
// Prepare steps
|
|
10
|
-
ScanningDepositTransaction = "scanning_deposit_transaction",
|
|
11
|
-
WaitingStripePayment = "waiting_stripe_payment",
|
|
12
|
-
|
|
13
|
-
//
|
|
14
|
-
Expired = "expired",
|
|
15
|
-
|
|
16
|
-
//
|
|
17
|
-
SendingTokenFromVault = "sending_token_from_vault",
|
|
18
|
-
|
|
19
|
-
// Execute steps
|
|
20
|
-
Relay = "relay",
|
|
21
|
-
Executed = "executed",
|
|
22
|
-
|
|
23
|
-
// Refund steps
|
|
24
|
-
Refunding = "refunding",
|
|
25
|
-
Refunded = "refunded",
|
|
26
|
-
|
|
27
|
-
// Failed order
|
|
28
|
-
Failure = "failure",
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export enum OrderType {
|
|
32
|
-
Swap = "swap",
|
|
33
|
-
MintNFT = "mint_nft",
|
|
34
|
-
JoinTournament = "join_tournament",
|
|
35
|
-
FundTournament = "fund_tournament",
|
|
36
|
-
Custom = "custom",
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export const zBaseOrder = z.object({
|
|
40
|
-
id: z.string(),
|
|
41
|
-
|
|
42
|
-
recipientAddress: z.string(),
|
|
43
|
-
globalAddress: z.string(),
|
|
44
|
-
srcChain: z.number(),
|
|
45
|
-
dstChain: z.number(),
|
|
46
|
-
srcTokenAddress: z.string(),
|
|
47
|
-
dstTokenAddress: z.string(),
|
|
48
|
-
srcAmount: z.string(),
|
|
49
|
-
status: z.nativeEnum(OrderStatus),
|
|
50
|
-
errorDetails: z.string().nullable(),
|
|
51
|
-
createdAt: z.number(),
|
|
52
|
-
expiredAt: z.number(),
|
|
53
|
-
onrampMetadata: zOnrampMetadata.nullable(),
|
|
54
|
-
creatorAddress: z.string().nullable(),
|
|
55
|
-
partnerId: z.string().nullable(),
|
|
56
|
-
|
|
57
|
-
oneClickBuyUrl: z.string().nullable(),
|
|
58
|
-
stripePaymentIntentId: z.string().nullable(),
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
export const zOrder = z.discriminatedUnion("type", [
|
|
62
|
-
zBaseOrder.extend({
|
|
63
|
-
type: z.literal(OrderType.Swap),
|
|
64
|
-
payload: zSwapPayload,
|
|
65
|
-
metadata: zSwapMetadata,
|
|
66
|
-
}),
|
|
67
|
-
zBaseOrder.extend({
|
|
68
|
-
type: z.literal(OrderType.MintNFT),
|
|
69
|
-
payload: zMintNftPayload,
|
|
70
|
-
metadata: zMintNftMetadata,
|
|
71
|
-
}),
|
|
72
|
-
zBaseOrder.extend({
|
|
73
|
-
type: z.literal(OrderType.JoinTournament),
|
|
74
|
-
payload: zJoinTournamentPayload,
|
|
75
|
-
metadata: zTournamentMetadata,
|
|
76
|
-
}),
|
|
77
|
-
zBaseOrder.extend({
|
|
78
|
-
type: z.literal(OrderType.FundTournament),
|
|
79
|
-
payload: zFundTournamentPayload,
|
|
80
|
-
metadata: zTournamentMetadata,
|
|
81
|
-
}),
|
|
82
|
-
zBaseOrder.extend({
|
|
83
|
-
type: z.literal(OrderType.Custom),
|
|
84
|
-
payload: zCustomPayload,
|
|
85
|
-
metadata: zCustomMetadata,
|
|
86
|
-
}),
|
|
87
|
-
]);
|
|
88
|
-
export type Order = z.infer<typeof zOrder>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
export const zRelayStatus = z.enum(["refund", "delayed", "waiting", "failure", "pending", "success"]);
|
|
4
|
-
export type RelayStatus = z.infer<typeof zRelayStatus>;
|
|
5
|
-
|
|
6
|
-
export const zRelayStepStatus = z.enum(["complete", "incomplete"]);
|
|
7
|
-
export type RelayStepStatus = z.infer<typeof zRelayStepStatus>;
|
|
8
|
-
|
|
9
|
-
export enum TradeType {
|
|
10
|
-
EXACT_INPUT = "EXACT_INPUT",
|
|
11
|
-
EXPECTED_OUTPUT = "EXPECTED_OUTPUT",
|
|
12
|
-
EXACT_OUTPUT = "EXACT_OUTPUT",
|
|
13
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { zCustomMetadata, zCustomPayload } from "../custom";
|
|
3
|
-
import { zMintNftMetadata, zMintNftPayload } from "../nft";
|
|
4
|
-
import { zOnrampMetadata } from "../onramp";
|
|
5
|
-
import { OrderType, zOrder } from "../order";
|
|
6
|
-
import { zSwapMetadata, zSwapPayload } from "../swap";
|
|
7
|
-
import { zFundTournamentPayload, zJoinTournamentPayload, zTournamentMetadata } from "../tournament";
|
|
8
|
-
|
|
9
|
-
const zBaseCreateOrderBody = z.object({
|
|
10
|
-
recipientAddress: z.string(),
|
|
11
|
-
srcChain: z.number(),
|
|
12
|
-
dstChain: z.number(),
|
|
13
|
-
srcTokenAddress: z.string(),
|
|
14
|
-
dstTokenAddress: z.string(),
|
|
15
|
-
srcAmount: z.string(),
|
|
16
|
-
partnerId: z.string().optional(),
|
|
17
|
-
onramp: zOnrampMetadata.optional(),
|
|
18
|
-
creatorAddress: z.string().optional(),
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
const zCreateSwapOrderBody = zBaseCreateOrderBody.extend({
|
|
22
|
-
type: z.literal(OrderType.Swap),
|
|
23
|
-
payload: zSwapPayload,
|
|
24
|
-
metadata: zSwapMetadata,
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
const zCreateMintNftOrderBody = zBaseCreateOrderBody.extend({
|
|
28
|
-
type: z.literal(OrderType.MintNFT),
|
|
29
|
-
payload: zMintNftPayload,
|
|
30
|
-
metadata: zMintNftMetadata,
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
const zCreateJoinTournamentOrderBody = zBaseCreateOrderBody.extend({
|
|
34
|
-
type: z.literal(OrderType.JoinTournament),
|
|
35
|
-
payload: zJoinTournamentPayload,
|
|
36
|
-
metadata: zTournamentMetadata,
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
const zCreateFundTournamentOrderBody = zBaseCreateOrderBody.extend({
|
|
40
|
-
type: z.literal(OrderType.FundTournament),
|
|
41
|
-
payload: zFundTournamentPayload,
|
|
42
|
-
metadata: zTournamentMetadata,
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
const zCreateCustomOrderBody = zBaseCreateOrderBody.extend({
|
|
46
|
-
type: z.literal(OrderType.Custom),
|
|
47
|
-
payload: zCustomPayload,
|
|
48
|
-
metadata: zCustomMetadata,
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
export const zCreateOrderRequest = z.object({
|
|
52
|
-
body: z.discriminatedUnion("type", [
|
|
53
|
-
zCreateSwapOrderBody,
|
|
54
|
-
zCreateMintNftOrderBody,
|
|
55
|
-
zCreateJoinTournamentOrderBody,
|
|
56
|
-
zCreateFundTournamentOrderBody,
|
|
57
|
-
zCreateCustomOrderBody,
|
|
58
|
-
]),
|
|
59
|
-
});
|
|
60
|
-
export type CreateOrderRequest = z.infer<typeof zCreateOrderRequest.shape.body>;
|
|
61
|
-
|
|
62
|
-
export const zCreateOrderResponse = z.object({
|
|
63
|
-
success: z.boolean(),
|
|
64
|
-
message: z.string(),
|
|
65
|
-
data: zOrder,
|
|
66
|
-
statusCode: z.number(),
|
|
67
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
const zNetwork = z.object({
|
|
4
|
-
name: z.string(),
|
|
5
|
-
displayName: z.string(),
|
|
6
|
-
contractAddress: z.string(),
|
|
7
|
-
chainId: z.string(),
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
const zPaymentLimit = z.object({
|
|
11
|
-
id: z.string(),
|
|
12
|
-
min: z.string(),
|
|
13
|
-
max: z.string(),
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
const zPaymentCurrency = z.object({
|
|
17
|
-
id: z.string(),
|
|
18
|
-
limits: z.array(zPaymentLimit),
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
const zPurchaseCurrency = z.object({
|
|
22
|
-
id: z.string(),
|
|
23
|
-
name: z.string(),
|
|
24
|
-
symbol: z.string(),
|
|
25
|
-
networks: z.array(zNetwork),
|
|
26
|
-
iconUrl: z.string(),
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
// Main response schema
|
|
30
|
-
export const zGetCoinbaseOnrampOptionsResponse = z.object({
|
|
31
|
-
paymentCurrencies: z.array(zPaymentCurrency),
|
|
32
|
-
purchaseCurrencies: z.array(zPurchaseCurrency),
|
|
33
|
-
});
|
|
34
|
-
export type GetCoinbaseOnrampOptionsResponse = z.infer<typeof zGetCoinbaseOnrampOptionsResponse>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { zOrder } from "../order";
|
|
3
|
-
import { zDepositTransaction, zExecuteTransaction, zRefundTransaction, zRelayTransaction } from "../transaction";
|
|
4
|
-
|
|
5
|
-
export const zGetOrderAndTransactionsRequest = z.object({
|
|
6
|
-
params: z.object({
|
|
7
|
-
orderId: z.string(),
|
|
8
|
-
}),
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
export const zGetOrderAndTxsResponse = z.object({
|
|
12
|
-
success: z.boolean(),
|
|
13
|
-
message: z.string(),
|
|
14
|
-
data: z.object({
|
|
15
|
-
order: zOrder,
|
|
16
|
-
depositTxs: z.array(zDepositTransaction).nullable(),
|
|
17
|
-
relayTx: zRelayTransaction.nullable(),
|
|
18
|
-
executeTx: zExecuteTransaction.nullable(),
|
|
19
|
-
refundTxs: z.array(zRefundTransaction).nullable(),
|
|
20
|
-
}),
|
|
21
|
-
statusCode: z.number(),
|
|
22
|
-
});
|
|
23
|
-
export type GetOrderAndTxsResponse = z.infer<typeof zGetOrderAndTxsResponse>;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { QuoteDetails } from "@reservoir0x/relay-sdk";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
import { zCustomPayload } from "../custom";
|
|
5
|
-
import { NftType } from "../nft";
|
|
6
|
-
import { OrderType } from "../order";
|
|
7
|
-
import { TradeType } from "../relay";
|
|
8
|
-
import { OnrampVendor } from "../onramp";
|
|
9
|
-
|
|
10
|
-
const zGetQuoteBody = z.object({
|
|
11
|
-
srcChain: z.number(),
|
|
12
|
-
dstChain: z.number(),
|
|
13
|
-
srcTokenAddress: z.string(),
|
|
14
|
-
dstTokenAddress: z.string(),
|
|
15
|
-
onrampVendor: z.nativeEnum(OnrampVendor).optional(),
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
const zGetQuoteForSwapOrderBody = zGetQuoteBody.extend({
|
|
19
|
-
type: z.literal(OrderType.Swap),
|
|
20
|
-
tradeType: z.nativeEnum(TradeType),
|
|
21
|
-
amount: z.string(),
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
const zGetQuoteForMintNftOrderBody = zGetQuoteBody.extend({
|
|
25
|
-
type: z.literal(OrderType.MintNFT),
|
|
26
|
-
contractAddress: z.string(),
|
|
27
|
-
tokenId: z.number().nullable(),
|
|
28
|
-
contractType: z.nativeEnum(NftType),
|
|
29
|
-
price: z.string(),
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
const zGetQuoteForJoinTournamentOrderBody = zGetQuoteBody.extend({
|
|
33
|
-
type: z.literal(OrderType.JoinTournament),
|
|
34
|
-
contractAddress: z.string(),
|
|
35
|
-
price: z.string(),
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
const zGetQuoteForFundTournamentOrderBody = zGetQuoteBody.extend({
|
|
39
|
-
type: z.literal(OrderType.FundTournament),
|
|
40
|
-
contractAddress: z.string(),
|
|
41
|
-
fundAmount: z.string(),
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
const zGetQuoteForCustomOrderBody = zGetQuoteBody.extend({
|
|
45
|
-
type: z.literal(OrderType.Custom),
|
|
46
|
-
payload: zCustomPayload,
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
export const zGetQuoteRequest = z.object({
|
|
50
|
-
body: z.discriminatedUnion("type", [
|
|
51
|
-
zGetQuoteForSwapOrderBody,
|
|
52
|
-
zGetQuoteForMintNftOrderBody,
|
|
53
|
-
zGetQuoteForJoinTournamentOrderBody,
|
|
54
|
-
zGetQuoteForFundTournamentOrderBody,
|
|
55
|
-
zGetQuoteForCustomOrderBody,
|
|
56
|
-
]),
|
|
57
|
-
});
|
|
58
|
-
export type GetQuoteRequest = z.infer<typeof zGetQuoteRequest.shape.body>;
|
|
59
|
-
|
|
60
|
-
export interface GetQuoteResponse {
|
|
61
|
-
success: boolean;
|
|
62
|
-
message: string;
|
|
63
|
-
data: QuoteDetails;
|
|
64
|
-
statusCode: number;
|
|
65
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
export const zGetTokenListResponse = z.object({
|
|
4
|
-
success: z.boolean(),
|
|
5
|
-
message: z.string(),
|
|
6
|
-
data: z.array(
|
|
7
|
-
z.object({
|
|
8
|
-
chainId: z.number(),
|
|
9
|
-
address: z.string(),
|
|
10
|
-
symbol: z.string(),
|
|
11
|
-
name: z.string(),
|
|
12
|
-
decimals: z.number(),
|
|
13
|
-
metadata: z.object({
|
|
14
|
-
logoURI: z.string().optional(),
|
|
15
|
-
}),
|
|
16
|
-
}),
|
|
17
|
-
),
|
|
18
|
-
});
|
|
File without changes
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { zToken } from "./token";
|
|
3
|
-
|
|
4
|
-
export const zSwapPayload = z.object({
|
|
5
|
-
expectedDstAmount: z.string(),
|
|
6
|
-
actualDstAmount: z.string().nullable(),
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
export const zSwapMetadata = z.object({
|
|
10
|
-
srcToken: zToken,
|
|
11
|
-
dstToken: zToken,
|
|
12
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
export const zToken = z.object({
|
|
4
|
-
chainId: z.number(),
|
|
5
|
-
address: z.string(),
|
|
6
|
-
symbol: z.string(),
|
|
7
|
-
name: z.string(),
|
|
8
|
-
decimals: z.number(),
|
|
9
|
-
metadata: z.object({
|
|
10
|
-
logoURI: z.string().optional(),
|
|
11
|
-
}),
|
|
12
|
-
});
|
|
13
|
-
export type Token = z.infer<typeof zToken>;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { zToken } from "./token";
|
|
3
|
-
|
|
4
|
-
export const zTournament = z.object({
|
|
5
|
-
slug: z.string(),
|
|
6
|
-
name: z.string(),
|
|
7
|
-
description: z.string(),
|
|
8
|
-
imageUrl: z.string(),
|
|
9
|
-
});
|
|
10
|
-
export type Tournament = z.infer<typeof zTournament>;
|
|
11
|
-
|
|
12
|
-
export const zJoinTournamentPayload = z.object({
|
|
13
|
-
contractAddress: z.string(),
|
|
14
|
-
entryPrice: z.string(),
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
export const zFundTournamentPayload = z.object({
|
|
18
|
-
contractAddress: z.string(),
|
|
19
|
-
fundAmount: z.string(),
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
export const zTournamentMetadata = z.object({
|
|
23
|
-
srcToken: zToken,
|
|
24
|
-
dstToken: zToken,
|
|
25
|
-
tournament: zTournament,
|
|
26
|
-
});
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { zRelayStatus } from "./relay";
|
|
3
|
-
|
|
4
|
-
export const zDepositTransaction = z.object({
|
|
5
|
-
orderId: z.string(),
|
|
6
|
-
chain: z.number(),
|
|
7
|
-
from: z.string().nullable(),
|
|
8
|
-
txHash: z.string(),
|
|
9
|
-
amount: z.string(),
|
|
10
|
-
createdAt: z.number(),
|
|
11
|
-
});
|
|
12
|
-
export type DepositTransaction = z.infer<typeof zDepositTransaction>;
|
|
13
|
-
|
|
14
|
-
export const zRelayTransaction = z.object({
|
|
15
|
-
orderId: z.string(),
|
|
16
|
-
chain: z.number(),
|
|
17
|
-
txHash: z.string(),
|
|
18
|
-
status: zRelayStatus,
|
|
19
|
-
createdAt: z.number(),
|
|
20
|
-
});
|
|
21
|
-
export type RelayTransaction = z.infer<typeof zRelayTransaction>;
|
|
22
|
-
|
|
23
|
-
export const zExecuteTransaction = z.object({
|
|
24
|
-
orderId: z.string(),
|
|
25
|
-
chain: z.number(),
|
|
26
|
-
txHash: z.string(),
|
|
27
|
-
createdAt: z.number(),
|
|
28
|
-
});
|
|
29
|
-
export type ExecuteTransaction = z.infer<typeof zExecuteTransaction>;
|
|
30
|
-
|
|
31
|
-
export const zRefundTransaction = z.object({
|
|
32
|
-
orderId: z.string(),
|
|
33
|
-
chain: z.number(),
|
|
34
|
-
txHash: z.string(),
|
|
35
|
-
amount: z.string(),
|
|
36
|
-
status: z.enum(["success", "failure"]),
|
|
37
|
-
createdAt: z.number(),
|
|
38
|
-
});
|
|
39
|
-
export type RefundTransaction = z.infer<typeof zRefundTransaction>;
|
|
File without changes
|
|
File without changes
|