@b3dotfun/sdk 0.0.8-alpha.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/constants/index.d.ts +16 -5
- package/dist/cjs/anyspend/constants/index.js +3 -4
- package/dist/cjs/anyspend/index.d.ts +0 -5
- package/dist/cjs/anyspend/index.js +0 -6
- package/dist/cjs/anyspend/index.native.d.ts +0 -1
- package/dist/cjs/anyspend/index.native.js +0 -2
- package/dist/cjs/anyspend/react/components/AnySpend.js +12 -12
- package/dist/cjs/anyspend/react/components/AnySpendBondKit.js +2 -3
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +3 -6
- package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +5 -4
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +30 -30
- 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.js +2 -4
- package/dist/cjs/anyspend/react/components/common/AnySpendNFTButton.d.ts +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/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/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 +6 -6
- 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 +978 -797
- 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/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/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 +6 -7
- 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/constants/index.d.ts +16 -5
- package/dist/esm/anyspend/constants/index.js +3 -4
- package/dist/esm/anyspend/index.d.ts +0 -5
- package/dist/esm/anyspend/index.js +0 -6
- package/dist/esm/anyspend/index.native.d.ts +0 -1
- package/dist/esm/anyspend/index.native.js +0 -2
- package/dist/esm/anyspend/react/components/AnySpend.js +13 -13
- package/dist/esm/anyspend/react/components/AnySpendBondKit.js +2 -3
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +4 -7
- package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +5 -4
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +29 -29
- 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.js +3 -5
- package/dist/esm/anyspend/react/components/common/AnySpendNFTButton.d.ts +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/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/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 +6 -6
- 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 +978 -797
- 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/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/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 +6 -7
- 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/types/anyspend/constants/index.d.ts +16 -5
- package/dist/types/anyspend/index.d.ts +0 -5
- package/dist/types/anyspend/index.native.d.ts +0 -1
- 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/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/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 +6 -6
- package/dist/types/anyspend/services/anyspend.d.ts +10 -321
- package/dist/types/anyspend/types/api.d.ts +978 -797
- 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/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 +6 -7
- 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 +1 -1
- package/src/anyspend/README.md +32 -32
- package/src/anyspend/constants/index.ts +7 -7
- package/src/anyspend/index.native.ts +0 -3
- package/src/anyspend/index.ts +0 -7
- package/src/anyspend/react/components/AnySpend.tsx +18 -15
- package/src/anyspend/react/components/AnySpendBondKit.tsx +2 -3
- package/src/anyspend/react/components/AnySpendBuySpin.tsx +4 -7
- package/src/anyspend/react/components/AnySpendCustom.tsx +77 -88
- 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 +3 -6
- package/src/anyspend/react/components/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/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 +1 -1
- 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/services/anyspend.ts +38 -30
- package/src/anyspend/types/api.ts +1000 -810
- 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/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 +6 -7
- package/src/shared/utils/payment.utils.ts +9 -9
- package/dist/cjs/anyspend/types/bondKit.d.ts +0 -12
- 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 -5167
- package/dist/cjs/anyspend/types/req-res/getOrderAndTransactions.js +0 -24
- 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/bondKit.d.ts +0 -12
- 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 -5167
- package/dist/esm/anyspend/types/req-res/getOrderAndTransactions.js +0 -21
- 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/bondKit.d.ts +0 -12
- 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 -5167
- 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/bondKit.ts +0 -12
- 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 -26
- 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/types/{bondKit.js → api_req_res.js} +0 -0
- /package/dist/esm/anyspend/types/{bondKit.js → api_req_res.js} +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { StyleRoot, useHasMounted, useTokenData } from "../../../global-account/react/index.js";
|
|
2
|
+
import { StyleRoot, useTokenData } from "../../../global-account/react/index.js";
|
|
4
3
|
import invariant from "../../../shared/utils/debug.js";
|
|
5
4
|
import { useMemo } from "react";
|
|
6
5
|
import { encodeFunctionData, parseEther } from "viem";
|
|
@@ -37,7 +36,6 @@ function generateEncodedDataForSignatureMint(signatureData) {
|
|
|
37
36
|
return encodedData;
|
|
38
37
|
}
|
|
39
38
|
export function AnyspendSignatureMint({ loadOrder, mode = "modal", signatureData, imageUrl, onSuccess, }) {
|
|
40
|
-
const hasMounted = useHasMounted();
|
|
41
39
|
// Get token data
|
|
42
40
|
const { data: tokenData, isError: isTokenError, isLoading, } = useTokenData(signatureData.collection.chainId, signatureData.collection.signatureRequestBody?.currency);
|
|
43
41
|
// Convert token data to AnySpend Token type
|
|
@@ -68,8 +66,8 @@ export function AnyspendSignatureMint({ loadOrder, mode = "modal", signatureData
|
|
|
68
66
|
}
|
|
69
67
|
const encodedData = generateEncodedDataForSignatureMint(signatureData);
|
|
70
68
|
const price = parseEther(signatureData.payload.price?.toString() || "0");
|
|
71
|
-
return (_jsx(AnySpendCustom, { isMainnet: true, loadOrder: loadOrder, mode: mode, recipientAddress: signatureData.payload.to, orderType:
|
|
72
|
-
type:
|
|
69
|
+
return (_jsx(AnySpendCustom, { isMainnet: true, loadOrder: loadOrder, mode: mode, recipientAddress: signatureData.payload.to, orderType: "custom", dstChainId: signatureData.collection.chainId, dstToken: dstToken, dstAmount: price.toString(), contractAddress: signatureData.collection.address, encodedData: encodedData, metadata: {
|
|
70
|
+
type: "custom",
|
|
73
71
|
action: "Signature Mint",
|
|
74
72
|
}, header: header, onSuccess: onSuccess, showRecipient: true }));
|
|
75
73
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { components } from "../../../../anyspend/types/api";
|
|
2
2
|
type AnySpendNFTButtonProps = {
|
|
3
|
-
nftContract?: NftContract;
|
|
3
|
+
nftContract?: components["schemas"]["NftContract"];
|
|
4
4
|
recipientAddress?: string;
|
|
5
5
|
};
|
|
6
6
|
export declare function AnySpendNFTButton({ nftContract, recipientAddress }: AnySpendNFTButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { components } from "../../../../anyspend/types/api";
|
|
2
2
|
interface OrderDetailsProps {
|
|
3
3
|
isMainnet: boolean;
|
|
4
4
|
mode?: "modal" | "page";
|
|
5
|
-
order: Order;
|
|
6
|
-
depositTxs:
|
|
7
|
-
relayTx:
|
|
8
|
-
executeTx:
|
|
9
|
-
refundTxs:
|
|
5
|
+
order: components["schemas"]["Order"];
|
|
6
|
+
depositTxs: components["schemas"]["DepositTx"][] | null;
|
|
7
|
+
relayTx: components["schemas"]["RelayTx"] | null;
|
|
8
|
+
executeTx: components["schemas"]["ExecuteTx"] | null;
|
|
9
|
+
refundTxs: components["schemas"]["RefundTx"][] | null;
|
|
10
10
|
onBack?: () => void;
|
|
11
11
|
}
|
|
12
12
|
export declare const OrderDetails: import("react").NamedExoticComponent<OrderDetailsProps>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { ALL_CHAINS, capitalizeFirstLetter, EVM_CHAINS, getChainName, getErrorDisplay, getExplorerTxUrl, getPaymentUrl, getStatusDisplay, isNativeToken,
|
|
3
|
+
import { ALL_CHAINS, capitalizeFirstLetter, EVM_CHAINS, getChainName, getErrorDisplay, getExplorerTxUrl, getPaymentUrl, getStatusDisplay, isNativeToken, RELAY_ETH_ADDRESS, } from "../../../../anyspend/index.js";
|
|
4
4
|
import { Badge, Button, CopyToClipboard, ShinyButton, Skeleton, TextLoop, TextShimmer, useAccountWallet, useChainSwitchWithAction, useModalStore, useOnchainName, } from "../../../../global-account/react/index.js";
|
|
5
5
|
import { useRouter, useSearchParams } from "../../../../shared/react/hooks/index.js";
|
|
6
6
|
import { cn } from "../../../../shared/utils/index.js";
|
|
@@ -23,19 +23,19 @@ function getOrderSuccessText({ order, tournament, formattedActualDstAmount, dstT
|
|
|
23
23
|
const recipient = recipientName || centerTruncate(order.recipientAddress, 8);
|
|
24
24
|
let actionText = "";
|
|
25
25
|
switch (order.type) {
|
|
26
|
-
case
|
|
26
|
+
case "swap":
|
|
27
27
|
actionText = `sent ${formattedActualDstAmount || "--"} ${dstToken.symbol}`;
|
|
28
28
|
return `Successfully ${actionText} to ${recipient}`;
|
|
29
|
-
case
|
|
29
|
+
case "mint_nft":
|
|
30
30
|
actionText = `minted ${order.metadata.nft.name}`;
|
|
31
31
|
return `Successfully ${actionText} to ${recipient}`;
|
|
32
|
-
case
|
|
32
|
+
case "join_tournament":
|
|
33
33
|
actionText = `joined ${tournament?.name}`;
|
|
34
34
|
return `Successfully ${actionText} for ${recipient}`;
|
|
35
|
-
case
|
|
35
|
+
case "fund_tournament":
|
|
36
36
|
actionText = `funded ${tournament?.name}`;
|
|
37
37
|
return `Successfully ${actionText}`;
|
|
38
|
-
case
|
|
38
|
+
case "custom":
|
|
39
39
|
actionText = order.metadata.action || `executed contract`;
|
|
40
40
|
return `Successfully ${actionText}`;
|
|
41
41
|
default:
|
|
@@ -118,12 +118,10 @@ export const OrderDetails = memo(function OrderDetails({ isMainnet, mode = "moda
|
|
|
118
118
|
const router = useRouter();
|
|
119
119
|
const searchParams = useSearchParams();
|
|
120
120
|
const setB3ModalOpen = useModalStore(state => state.setB3ModalOpen);
|
|
121
|
-
const srcToken =
|
|
122
|
-
const dstToken =
|
|
123
|
-
const nft = order.type ===
|
|
124
|
-
const tournament = order.type ===
|
|
125
|
-
? zTournament.parse(order.metadata.tournament)
|
|
126
|
-
: undefined;
|
|
121
|
+
const srcToken = order.metadata.srcToken;
|
|
122
|
+
const dstToken = order.metadata.dstToken;
|
|
123
|
+
const nft = order.type === "mint_nft" ? order.metadata.nft : undefined;
|
|
124
|
+
const tournament = order.type === "join_tournament" || order.type === "fund_tournament" ? order.metadata.tournament : undefined;
|
|
127
125
|
const { name: recipientName } = useOnchainName(order.recipientAddress);
|
|
128
126
|
const account = useAccountWallet();
|
|
129
127
|
const { data: walletClient } = useWalletClient();
|
|
@@ -211,17 +209,17 @@ export const OrderDetails = memo(function OrderDetails({ isMainnet, mode = "moda
|
|
|
211
209
|
if (!srcToken || !dstToken) {
|
|
212
210
|
return _jsx("div", { children: "Loading..." });
|
|
213
211
|
}
|
|
214
|
-
const expectedDstAmount = order.type ===
|
|
215
|
-
order.type ===
|
|
216
|
-
order.type ===
|
|
217
|
-
order.type ===
|
|
212
|
+
const expectedDstAmount = order.type === "mint_nft" ||
|
|
213
|
+
order.type === "join_tournament" ||
|
|
214
|
+
order.type === "fund_tournament" ||
|
|
215
|
+
order.type === "custom"
|
|
218
216
|
? "0"
|
|
219
217
|
: order.payload.expectedDstAmount.toString();
|
|
220
218
|
const formattedExpectedDstAmount = formatTokenAmount(BigInt(expectedDstAmount), dstToken.decimals);
|
|
221
|
-
const actualDstAmount = order.type ===
|
|
222
|
-
order.type ===
|
|
223
|
-
order.type ===
|
|
224
|
-
order.type ===
|
|
219
|
+
const actualDstAmount = order.type === "mint_nft" ||
|
|
220
|
+
order.type === "join_tournament" ||
|
|
221
|
+
order.type === "fund_tournament" ||
|
|
222
|
+
order.type === "custom"
|
|
225
223
|
? undefined
|
|
226
224
|
: order.payload.actualDstAmount;
|
|
227
225
|
const formattedActualDstAmount = actualDstAmount
|
|
@@ -247,7 +245,7 @@ export const OrderDetails = memo(function OrderDetails({ isMainnet, mode = "moda
|
|
|
247
245
|
};
|
|
248
246
|
if (refundTxs) {
|
|
249
247
|
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "relative mt-4 flex w-full flex-col gap-4", children: [_jsx("div", { className: "bg-b3-react-background absolute bottom-2 left-4 top-2 z-[5] w-2", children: _jsx(motion.div, { className: "from-as-brand/50 absolute left-[2px] top-0 z-10 w-[3px] bg-gradient-to-b from-20% via-purple-500/50 via-80% to-transparent", initial: { height: "0%" }, animate: { height: "100%" }, transition: { duration: 1.5, ease: "easeInOut" } }) }), depositTxs
|
|
250
|
-
? depositTxs.map(dTx => (_jsx(TransactionDetails, { title: order.onrampMetadata?.vendor ===
|
|
248
|
+
? depositTxs.map(dTx => (_jsx(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
|
|
251
249
|
? `Received payment`
|
|
252
250
|
: `Received ${formatTokenAmount(BigInt(dTx.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTx, isProcessing: false }, dTx.txHash)))
|
|
253
251
|
: null, refundTxs
|
|
@@ -256,16 +254,16 @@ export const OrderDetails = memo(function OrderDetails({ isMainnet, mode = "moda
|
|
|
256
254
|
}
|
|
257
255
|
if (executeTx) {
|
|
258
256
|
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "relative mt-4 flex w-full flex-col gap-4", children: [_jsx("div", { className: "bg-b3-react-background absolute bottom-2 left-4 top-2 z-[5] w-2", children: _jsx(motion.div, { className: "from-as-brand/50 absolute left-[2px] top-0 z-10 w-[3px] bg-gradient-to-b from-20% via-purple-500/50 via-80% to-transparent", initial: { height: "0%" }, animate: { height: "100%" }, transition: { duration: 1.5, ease: "easeInOut" } }) }), depositTxs
|
|
259
|
-
? depositTxs.map(dTxs => (_jsx(TransactionDetails, { title: order.onrampMetadata?.vendor ===
|
|
257
|
+
? depositTxs.map(dTxs => (_jsx(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
|
|
260
258
|
? `Received payment`
|
|
261
259
|
: `Received ${formatTokenAmount(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: false }, dTxs.txHash)))
|
|
262
|
-
: null, _jsx(TransactionDetails, { title: "Processed Transaction", chainId: order.srcChain, tx: relayTx, delay: 0.5, isProcessing: false }), _jsx(TransactionDetails, { title: order.type ===
|
|
260
|
+
: null, _jsx(TransactionDetails, { title: "Processed Transaction", chainId: order.srcChain, tx: relayTx, delay: 0.5, isProcessing: false }), _jsx(TransactionDetails, { title: order.type === "swap"
|
|
263
261
|
? "Processed Swap"
|
|
264
|
-
: order.type ===
|
|
262
|
+
: order.type === "mint_nft"
|
|
265
263
|
? "Minted NFT"
|
|
266
|
-
: order.type ===
|
|
264
|
+
: order.type === "join_tournament"
|
|
267
265
|
? "Joined Tournament"
|
|
268
|
-
: order.type ===
|
|
266
|
+
: order.type === "fund_tournament"
|
|
269
267
|
? "Funded Tournament"
|
|
270
268
|
: "Processed Order", chainId: order.dstChain, tx: executeTx, isProcessing: false, delay: 1 })] }), _jsx("div", { className: "flex w-full flex-col gap-8", children: _jsx(Button, { variant: "link", asChild: true, children: _jsxs("a", { href: getExplorerTxUrl(order.dstChain, executeTx.txHash), target: "_blank", className: "text-as-primary/70 hover:text-as-primary", style: { whiteSpace: "normal" }, children: [getOrderSuccessText({
|
|
271
269
|
order,
|
|
@@ -274,28 +272,28 @@ export const OrderDetails = memo(function OrderDetails({ isMainnet, mode = "moda
|
|
|
274
272
|
dstToken,
|
|
275
273
|
recipientName,
|
|
276
274
|
centerTruncate,
|
|
277
|
-
}), _jsx(ExternalLink, { className: "ml-2 h-4 w-4" })] }) }) }), order.type ===
|
|
275
|
+
}), _jsx(ExternalLink, { className: "ml-2 h-4 w-4" })] }) }) }), order.type === "join_tournament" && order.status === "executed" && (_jsxs(ShinyButton, { accentColor: "hsl(var(--as-brand))", textColor: "text-white", className: "flex w-full items-center gap-2", disabled: txLoading || isSwitchingOrExecuting, onClick: handleCloseModal, children: [_jsx("span", { className: "pl-4", children: "Continue to Tournament" }), _jsx(ChevronRight, { className: "h-4 w-4" })] })), order.status === "executed" && (_jsx("button", { className: "bg-as-on-surface-2 text-as-secondary flex w-full items-center justify-center gap-2 rounded-lg p-2", onClick: mode === "page" ? handleBack : handleCloseModal, children: mode === "page" ? (_jsxs(_Fragment, { children: ["Return to Home ", _jsx(Home, { className: "ml-2 h-4 w-4" })] })) : ("Close") }))] }));
|
|
278
276
|
}
|
|
279
277
|
if (relayTx && relayTx.status === "success") {
|
|
280
278
|
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "relative mt-4 flex w-full flex-col gap-4", children: [_jsx("div", { className: "bg-b3-react-background absolute bottom-2 left-4 top-2 z-[5] w-2", children: _jsx(motion.div, { className: "from-as-brand/50 absolute left-[2px] top-0 z-10 w-[3px] bg-gradient-to-b from-20% via-purple-500/50 via-80% to-transparent", initial: { height: "0%" }, animate: { height: "100%" }, transition: { duration: 1.5, ease: "easeInOut" } }) }), depositTxs
|
|
281
|
-
? depositTxs.map(dTxs => (_jsx(TransactionDetails, { title: order.onrampMetadata?.vendor ===
|
|
279
|
+
? depositTxs.map(dTxs => (_jsx(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
|
|
282
280
|
? `Received payment`
|
|
283
281
|
: `Received ${formatTokenAmount(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: false }, dTxs.txHash)))
|
|
284
|
-
: null, order.srcChain === order.dstChain ? (_jsx(TransactionDetails, { title: order.type ===
|
|
282
|
+
: null, order.srcChain === order.dstChain ? (_jsx(TransactionDetails, { title: order.type === "swap"
|
|
285
283
|
? "Processed Swap"
|
|
286
|
-
: order.type ===
|
|
284
|
+
: order.type === "mint_nft"
|
|
287
285
|
? "Minted NFT"
|
|
288
|
-
: order.type ===
|
|
286
|
+
: order.type === "join_tournament"
|
|
289
287
|
? "Joined Tournament"
|
|
290
|
-
: order.type ===
|
|
288
|
+
: order.type === "fund_tournament"
|
|
291
289
|
? "Funded Tournament"
|
|
292
|
-
: "Processed Transaction", chainId: order.srcChain, isProcessing: false, tx: relayTx, delay: 0.5 })) : (_jsxs(_Fragment, { children: [_jsx(TransactionDetails, { title: "Processed Transaction", chainId: order.srcChain, isProcessing: false, tx: relayTx, delay: 0.5 }), _jsx(TransactionDetails, { title: order.type ===
|
|
290
|
+
: "Processed Transaction", chainId: order.srcChain, isProcessing: false, tx: relayTx, delay: 0.5 })) : (_jsxs(_Fragment, { children: [_jsx(TransactionDetails, { title: "Processed Transaction", chainId: order.srcChain, isProcessing: false, tx: relayTx, delay: 0.5 }), _jsx(TransactionDetails, { title: order.type === "swap"
|
|
293
291
|
? "Processing Swap"
|
|
294
|
-
: order.type ===
|
|
292
|
+
: order.type === "mint_nft"
|
|
295
293
|
? "Minting NFT"
|
|
296
|
-
: order.type ===
|
|
294
|
+
: order.type === "join_tournament"
|
|
297
295
|
? "Joining Tournament"
|
|
298
|
-
: order.type ===
|
|
296
|
+
: order.type === "fund_tournament"
|
|
299
297
|
? "Funding Tournament"
|
|
300
298
|
: "Processing Bridge", chainId: order.dstChain, isProcessing: true, tx: executeTx, delay: 1 })] }))] }), _jsx("div", { className: "flex w-full flex-col gap-8", children: _jsx(Button, { variant: "link", asChild: true, children: _jsxs("a", { href: getExplorerTxUrl(order.dstChain, relayTx.txHash), target: "_blank", className: "text-as-primary/70 hover:text-as-primary", style: { whiteSpace: "normal" }, children: [getOrderSuccessText({
|
|
301
299
|
order,
|
|
@@ -304,22 +302,22 @@ export const OrderDetails = memo(function OrderDetails({ isMainnet, mode = "moda
|
|
|
304
302
|
dstToken,
|
|
305
303
|
recipientName,
|
|
306
304
|
centerTruncate,
|
|
307
|
-
}), _jsx(ExternalLink, { className: "ml-2 h-4 w-4" })] }) }) }), order.type ===
|
|
305
|
+
}), _jsx(ExternalLink, { className: "ml-2 h-4 w-4" })] }) }) }), order.type === "join_tournament" && order.status === "executed" && (_jsxs(ShinyButton, { accentColor: "hsl(var(--as-brand))", textColor: "text-white", className: "flex w-full items-center gap-2", disabled: txLoading || isSwitchingOrExecuting, onClick: handleCloseModal, children: [_jsx("span", { className: "pl-4", children: "Continue to Tournament" }), _jsx(ChevronRight, { className: "h-4 w-4" })] })), order.status === "executed" && (_jsx("button", { className: "bg-as-on-surface-2 text-as-secondary flex w-full items-center justify-center gap-2 rounded-lg p-2", onClick: mode === "page" ? handleBack : handleCloseModal, children: mode === "page" ? (_jsxs(_Fragment, { children: ["Return to Home ", _jsx(Home, { className: "ml-2 h-4 w-4" })] })) : ("Close") }))] }));
|
|
308
306
|
}
|
|
309
307
|
// This boolean indicates that user finish payment, and waiting for the deposit to be confirmed. We get this from query params (waitingForDeposit=true)
|
|
310
308
|
const waitingForDeposit = new URLSearchParams(window.location.search).get("waitingForDeposit") === "true";
|
|
311
309
|
if (depositTxs?.length || waitingForDeposit) {
|
|
312
|
-
return (_jsx(_Fragment, { children: _jsxs("div", { className: "relative mt-4 flex w-full flex-col gap-6", children: [_jsx("div", { className: "bg-b3-react-background absolute bottom-2 left-4 top-2 z-[5] w-2", children: _jsx(motion.div, { className: "from-as-brand/50 absolute left-[2px] top-0 z-10 w-[3px] bg-gradient-to-b from-20% via-purple-500/50 via-80% to-transparent", initial: { height: "0%" }, animate: { height: "100%" }, transition: { duration: 1, ease: "easeInOut" } }) }), (depositTxs || []).map((dTxs, index) => (_jsx(TransactionDetails, { title: order.onrampMetadata?.vendor ===
|
|
310
|
+
return (_jsx(_Fragment, { children: _jsxs("div", { className: "relative mt-4 flex w-full flex-col gap-6", children: [_jsx("div", { className: "bg-b3-react-background absolute bottom-2 left-4 top-2 z-[5] w-2", children: _jsx(motion.div, { className: "from-as-brand/50 absolute left-[2px] top-0 z-10 w-[3px] bg-gradient-to-b from-20% via-purple-500/50 via-80% to-transparent", initial: { height: "0%" }, animate: { height: "100%" }, transition: { duration: 1, ease: "easeInOut" } }) }), (depositTxs || []).map((dTxs, index) => (_jsx(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
|
|
313
311
|
? `Received payment`
|
|
314
|
-
: `Received ${formatTokenAmount(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: index < (depositTxs || []).length - 1 ? false : !depositEnoughAmount }, dTxs.txHash))), statusDisplay === "failure" ? (_jsx(TransactionDetails, { title: statusText, chainId: order.srcChain, tx: null, isProcessing: false, delay: 0.5 })) : depositEnoughAmount ? (_jsx(TransactionDetails, { title: order.type ===
|
|
312
|
+
: `Received ${formatTokenAmount(BigInt(dTxs.amount), srcToken.decimals)} ${srcToken.symbol}`, chainId: order.srcChain, tx: dTxs, isProcessing: index < (depositTxs || []).length - 1 ? false : !depositEnoughAmount }, dTxs.txHash))), statusDisplay === "failure" ? (_jsx(TransactionDetails, { title: statusText, chainId: order.srcChain, tx: null, isProcessing: false, delay: 0.5 })) : depositEnoughAmount ? (_jsx(TransactionDetails, { title: order.type === "swap"
|
|
315
313
|
? "Processing Swap"
|
|
316
|
-
: order.type ===
|
|
314
|
+
: order.type === "mint_nft"
|
|
317
315
|
? "Minting NFT"
|
|
318
|
-
: order.type ===
|
|
316
|
+
: order.type === "join_tournament"
|
|
319
317
|
? "Joining Tournament"
|
|
320
|
-
: order.type ===
|
|
318
|
+
: order.type === "fund_tournament"
|
|
321
319
|
? "Funding Tournament"
|
|
322
|
-
: "Processing Transaction", chainId: order.srcChain, tx: null, isProcessing: true, delay: 0.5 })) : (_jsx(TransactionDetails, { title: order.onrampMetadata?.vendor ===
|
|
320
|
+
: "Processing Transaction", chainId: order.srcChain, tx: null, isProcessing: true, delay: 0.5 })) : (_jsx(TransactionDetails, { title: order.onrampMetadata?.vendor === "stripe-web2"
|
|
323
321
|
? `Waiting for payment`
|
|
324
322
|
: `Waiting for deposit ${formattedDepositDeficit} ${srcToken.symbol}`, chainId: order.srcChain, tx: null, isProcessing: true, delay: 0.5 }))] }) }));
|
|
325
323
|
}
|
|
@@ -342,17 +340,17 @@ export const OrderDetails = memo(function OrderDetails({ isMainnet, mode = "moda
|
|
|
342
340
|
else {
|
|
343
341
|
toast.error("Web Share API is not supported on this browser");
|
|
344
342
|
}
|
|
345
|
-
}, children: ["Send Link ", _jsx(SquareArrowOutUpRight, { className: "ml-2 h-3 w-3" })] })] })] })] })), _jsxs("div", { className: "flex w-full items-center justify-center gap-1 text-sm", children: [_jsx("div", { className: "text-as-primary/30", children: "Time remaining:" }), _jsx("div", { className: "text-as-primary", children: depositEnoughAmount ? ("Received") : order.status ===
|
|
343
|
+
}, children: ["Send Link ", _jsx(SquareArrowOutUpRight, { className: "ml-2 h-3 w-3" })] })] })] })] })), _jsxs("div", { className: "flex w-full items-center justify-center gap-1 text-sm", children: [_jsx("div", { className: "text-as-primary/30", children: "Time remaining:" }), _jsx("div", { className: "text-as-primary", children: depositEnoughAmount ? ("Received") : order.status === "expired" ? ("Expired") : (_jsx(TimeAgo, { date: new Date(order.expiredAt), live: true })) })] }), showOrderDetails ? (_jsx(motion.div, { className: "w-full", initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0, ease: "easeInOut" }, children: _jsxs("div", { className: "flex w-full flex-col items-center gap-3 whitespace-nowrap py-2 text-sm", children: [_jsxs("div", { className: "flex w-full items-center justify-between gap-2", children: [_jsx("div", { className: "text-as-primary/30", children: order.type === "swap" || order.type === "mint_nft"
|
|
346
344
|
? "Expected to receive"
|
|
347
|
-
: order.type ===
|
|
345
|
+
: order.type === "join_tournament"
|
|
348
346
|
? "Join tournament"
|
|
349
|
-
: order.type ===
|
|
347
|
+
: order.type === "fund_tournament"
|
|
350
348
|
? "Fund tournament"
|
|
351
|
-
: order.type ===
|
|
349
|
+
: order.type === "custom"
|
|
352
350
|
? order.metadata.action
|
|
353
351
|
? capitalizeFirstLetter(order.metadata.action)
|
|
354
352
|
: "Contract execution"
|
|
355
|
-
: "" }), _jsxs("div", { className: "flex items-end gap-2", children: [order.type ===
|
|
353
|
+
: "" }), _jsxs("div", { className: "flex items-end gap-2", children: [order.type === "swap" ? (`~${formattedExpectedDstAmount} ${dstToken.symbol}`) : order.type === "mint_nft" ? (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("img", { src: nft?.imageUrl, alt: nft?.name || "NFT", className: "h-5 w-5" }), _jsx("div", { children: nft?.name || "NFT" })] })) : order.type === "join_tournament" || order.type === "fund_tournament" ? (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("img", { src: tournament?.imageUrl, alt: tournament?.name || "Tournament", className: "h-5 w-5" }), _jsx("div", { children: tournament?.name || "Tournament" })] })) : null, _jsxs("div", { className: "text-as-primary/50 flex items-center gap-2", children: [_jsxs("span", { children: ["on ", order.dstChain !== b3.id && getChainName(order.dstChain)] }), _jsx("img", { src: ALL_CHAINS[order.dstChain].logoUrl, alt: getChainName(order.dstChain), className: cn("h-3", order.dstChain !== b3.id && "w-3 rounded-full", order.dstChain === b3.id && "h-4") })] })] })] }), _jsx("div", { className: "divider w-full" }), _jsxs("div", { className: "flex w-full justify-between gap-4", children: [_jsx("div", { className: "text-as-primary/30", children: "Order ID" }), _jsx("div", { className: "text-as-primary overflow-hidden text-ellipsis whitespace-nowrap", children: order.id })] }), _jsx("div", { className: "divider w-full" }), _jsxs("div", { className: "flex w-full justify-between gap-4", children: [_jsx("div", { className: "text-as-primary/30", children: "Recipient" }), _jsxs("div", { className: "flex flex-col items-end gap-1", children: [recipientName && _jsx("div", { className: "text-as-primary font-semibold", children: recipientName }), _jsx(CopyToClipboard, { text: order.recipientAddress, onCopy: () => {
|
|
356
354
|
toast.success("Copied recipient address to clipboard");
|
|
357
355
|
}, children: _jsxs("div", { className: "text-as-primary flex items-center gap-2", children: [centerTruncate(order.recipientAddress, 10), _jsx(Copy, { className: "text-as-primary/50 hover:text-as-primary h-4 w-4 cursor-pointer transition-all duration-200" })] }) })] })] })] }) })) : (_jsxs("div", { className: "flex w-full items-center", children: [_jsx("div", { className: "divider w-full" }), _jsx("button", { className: "whitespace-nowrap text-sm", onClick: () => setShowOrderDetails(true), children: "Order Details" }), _jsx(ChevronDown, { className: "text-as-primary mx-1 h-4 min-h-4 w-4 min-w-4" }), _jsx("div", { className: "divider w-full" })] })), _jsxs("button", { className: "bg-as-on-surface-2 text-as-secondary flex w-full items-center justify-center gap-2 rounded-lg p-2", onClick: handleBack, children: ["Cancel and start over ", _jsx(RefreshCcw, { className: "ml-2 h-4 w-4" })] })] }));
|
|
358
356
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { components } from "../../../../anyspend/types/api";
|
|
2
2
|
interface OrderHistoryItemProps {
|
|
3
|
-
order: Order;
|
|
3
|
+
order: components["schemas"]["Order"];
|
|
4
4
|
onSelectOrder?: (orderId: string) => void;
|
|
5
5
|
mode: "modal" | "page";
|
|
6
6
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { ALL_CHAINS, getChainName, getStatusDisplay
|
|
2
|
+
import { ALL_CHAINS, getChainName, getStatusDisplay } from "../../../../anyspend/index.js";
|
|
3
3
|
import { Badge, Button, useIsMobile } from "../../../../global-account/react/index.js";
|
|
4
4
|
import { cn } from "../../../../shared/utils/index.js";
|
|
5
5
|
import { formatTokenAmount } from "../../../../shared/utils/number.js";
|
|
@@ -7,21 +7,19 @@ import { ArrowRight, ChevronDown } from "lucide-react";
|
|
|
7
7
|
import TimeAgo from "react-timeago";
|
|
8
8
|
import { b3 } from "viem/chains";
|
|
9
9
|
export function OrderHistoryItem({ order, onSelectOrder, mode }) {
|
|
10
|
-
const nft = order.type ===
|
|
11
|
-
const tournament = order.type ===
|
|
12
|
-
? order.metadata.tournament
|
|
13
|
-
: undefined;
|
|
10
|
+
const nft = order.type === "mint_nft" ? order.metadata.nft : undefined;
|
|
11
|
+
const tournament = order.type === "join_tournament" || order.type === "fund_tournament" ? order.metadata.tournament : undefined;
|
|
14
12
|
const dstToken = order.metadata.dstToken;
|
|
15
|
-
const actualDstAmount = order.type ===
|
|
16
|
-
order.type ===
|
|
17
|
-
order.type ===
|
|
18
|
-
order.type ===
|
|
13
|
+
const actualDstAmount = order.type === "mint_nft" ||
|
|
14
|
+
order.type === "join_tournament" ||
|
|
15
|
+
order.type === "fund_tournament" ||
|
|
16
|
+
order.type === "custom"
|
|
19
17
|
? undefined
|
|
20
18
|
: order.payload.actualDstAmount;
|
|
21
|
-
const expectedDstAmount = order.type ===
|
|
22
|
-
order.type ===
|
|
23
|
-
order.type ===
|
|
24
|
-
order.type ===
|
|
19
|
+
const expectedDstAmount = order.type === "mint_nft" ||
|
|
20
|
+
order.type === "join_tournament" ||
|
|
21
|
+
order.type === "fund_tournament" ||
|
|
22
|
+
order.type === "custom"
|
|
25
23
|
? undefined
|
|
26
24
|
: order.payload.expectedDstAmount;
|
|
27
25
|
const { text: orderStatusText, status: orderDisplayStatus } = getStatusDisplay(order);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { getStatusDisplay } from "../../../../anyspend/index.js";
|
|
3
3
|
import { Badge, TextShimmer } from "../../../../global-account/react/index.js";
|
|
4
4
|
import { Check, Loader2 } from "lucide-react";
|
|
5
5
|
import { memo } from "react";
|
|
6
6
|
export const OrderStatus = memo(function OrderStatus({ order }) {
|
|
7
|
-
const isComplete = order.status ===
|
|
7
|
+
const isComplete = order.status === "executed";
|
|
8
8
|
const { text, status: displayStatus } = getStatusDisplay(order);
|
|
9
9
|
return (_jsx("div", { className: "flex items-center justify-center gap-2", children: isComplete ? (_jsxs(Badge, { variant: "outline", className: "flex items-center gap-3 border-green-500/50 bg-green-500/20 px-4 py-1 text-base transition-colors", children: [_jsx(Check, { className: "h-6 w-6 text-green-500" }), _jsx("span", { className: "font-medium", children: text })] })) : displayStatus === "failure" ? (_jsx(Badge, { variant: "destructive", className: "border-red-400/50 bg-red-400/20 px-4 py-1 text-base", children: _jsx("div", { className: "font-sf-rounded text-base font-semibold text-red-400/50", children: text }) })) : (_jsxs(Badge, { variant: "default", className: "border-as-stroke/20 bg-as-primary/10 flex items-center gap-3 px-4 py-1 text-base transition-colors", children: [displayStatus === "processing" && _jsx(Loader2, { className: "text-as-primary h-4 w-4 animate-spin" }), _jsx(TextShimmer, { duration: 1, className: "font-sf-rounded text-base font-semibold", children: text })] })) }));
|
|
10
10
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { components } from "../../../../anyspend/types/api";
|
|
2
2
|
export declare function OrderToken({ context, address, chainId, setChainId, token, setToken, requiredAmount, tokenSelectClassName, }: {
|
|
3
3
|
context: "from" | "to";
|
|
4
4
|
address: string | undefined;
|
|
5
|
-
token: Token;
|
|
6
|
-
setToken: (token: Token) => void;
|
|
5
|
+
token: components["schemas"]["Token"];
|
|
6
|
+
setToken: (token: components["schemas"]["Token"]) => void;
|
|
7
7
|
chainId: number;
|
|
8
8
|
setChainId: (chainId: number) => void;
|
|
9
9
|
requiredAmount: bigint | undefined;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { components } from "../../../../anyspend/types/api";
|
|
2
2
|
export declare function OrderTokenAmount({ disabled, inputValue, onChangeInput, context, address, chainId, setChainId, token, setToken, hideTokenSelect, canEditAmount, className, innerClassName, amountClassName, tokenSelectClassName, }: {
|
|
3
3
|
disabled?: boolean;
|
|
4
4
|
inputValue: string;
|
|
5
5
|
onChangeInput: (value: string) => void;
|
|
6
6
|
context: "from" | "to";
|
|
7
7
|
address: string | undefined;
|
|
8
|
-
token: Token;
|
|
9
|
-
setToken: (token: Token) => void;
|
|
8
|
+
token: components["schemas"]["Token"];
|
|
9
|
+
setToken: (token: components["schemas"]["Token"]) => void;
|
|
10
10
|
chainId: number;
|
|
11
11
|
setChainId: (chainId: number) => void;
|
|
12
12
|
hideTokenSelect?: boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { components } from "../../../../anyspend/types/api";
|
|
2
|
+
import { GetQuoteResponse } from "../../../../anyspend/types/api_req_res";
|
|
2
3
|
interface PanelOnrampPaymentProps {
|
|
3
4
|
srcAmountOnRamp: string;
|
|
4
5
|
recipientName?: string;
|
|
@@ -8,16 +9,16 @@ interface PanelOnrampPaymentProps {
|
|
|
8
9
|
destinationTokenChainId?: number;
|
|
9
10
|
destinationTokenAddress?: string;
|
|
10
11
|
selectedDstChainId: number;
|
|
11
|
-
selectedDstToken: Token;
|
|
12
|
+
selectedDstToken: components["schemas"]["Token"];
|
|
12
13
|
anyspendQuote: GetQuoteResponse | undefined;
|
|
13
14
|
globalAddress?: string;
|
|
14
15
|
onOrderCreated: (orderId: string) => void;
|
|
15
16
|
onBack: () => void;
|
|
16
|
-
orderType:
|
|
17
|
-
nft?:
|
|
17
|
+
orderType: components["schemas"]["Order"]["type"];
|
|
18
|
+
nft?: components["schemas"]["NFT"] & {
|
|
18
19
|
price: string;
|
|
19
20
|
};
|
|
20
|
-
tournament?: Tournament & {
|
|
21
|
+
tournament?: components["schemas"]["Tournament"] & {
|
|
21
22
|
contractAddress: string;
|
|
22
23
|
entryPriceOrFundAmount: string;
|
|
23
24
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { OnrampVendor, OrderType } from "../../../../anyspend/index.js";
|
|
3
2
|
import { useAnyspendCreateOnrampOrder, useGeoOnrampOptions } from "../../../../anyspend/react/index.js";
|
|
4
3
|
import { Button } from "../../../../global-account/react/index.js";
|
|
5
4
|
import centerTruncate from "../../../../shared/utils/centerTruncate.js";
|
|
@@ -42,15 +41,15 @@ recipientAddress, isMainnet, isBuyMode, destinationTokenChainId, destinationToke
|
|
|
42
41
|
toast.error("Please enter a valid amount");
|
|
43
42
|
return;
|
|
44
43
|
}
|
|
45
|
-
if (vendor ===
|
|
44
|
+
if (vendor === "coinbase" && !coinbaseOnrampOptions) {
|
|
46
45
|
toast.error("Onramp options not available");
|
|
47
46
|
return;
|
|
48
47
|
}
|
|
49
|
-
if (vendor ===
|
|
48
|
+
if (vendor === "stripe" && !isStripeOnrampSupported) {
|
|
50
49
|
toast.error("Stripe onramp not available");
|
|
51
50
|
return;
|
|
52
51
|
}
|
|
53
|
-
if (vendor ===
|
|
52
|
+
if (vendor === "stripe-web2" && !isStripeWeb2Supported) {
|
|
54
53
|
toast.error("Stripe credit card not available");
|
|
55
54
|
return;
|
|
56
55
|
}
|
|
@@ -99,11 +98,11 @@ recipientAddress, isMainnet, isBuyMode, destinationTokenChainId, destinationToke
|
|
|
99
98
|
opacity: 1,
|
|
100
99
|
y: 0,
|
|
101
100
|
filter: "blur(0px)",
|
|
102
|
-
}, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: "flex items-center justify-between", children: [_jsx("p", { className: "text-b3-react-foreground/60", children: orderType ===
|
|
101
|
+
}, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: "flex items-center justify-between", children: [_jsx("p", { className: "text-b3-react-foreground/60", children: orderType === "swap"
|
|
103
102
|
? "Recipient"
|
|
104
|
-
: orderType ===
|
|
103
|
+
: orderType === "mint_nft"
|
|
105
104
|
? "Receive NFT at"
|
|
106
|
-
: orderType ===
|
|
105
|
+
: orderType === "join_tournament"
|
|
107
106
|
? "Join for"
|
|
108
107
|
: "Recipient" }), _jsxs("div", { className: "flex items-center gap-2", children: [recipientImageUrl && (_jsx("img", { src: recipientImageUrl, alt: recipientImageUrl, className: "bg-b3-react-foreground size-7 rounded-full object-cover opacity-100" })), _jsxs("div", { className: "flex flex-col items-end gap-1", children: [recipientEnsName && _jsxs("span", { className: "text-b3-react-foreground/80", children: ["@", recipientEnsName] }), _jsx("span", { className: "text-b3-react-foreground/80", children: centerTruncate(recipientAddress) })] })] })] })), _jsx("div", { className: "border-b3-react-border border-t pt-3", children: _jsxs("div", { className: "flex items-center justify-between", children: [_jsx("p", { className: "text-b3-react-foreground font-semibold", children: "Amount" }), _jsxs("p", { className: "text-b3-react-foreground hover:text-b3-react-foreground/80 cursor-pointer text-xl font-semibold transition-colors", onClick: onBack, children: ["$", parseFloat(srcAmountOnRamp).toFixed(2)] })] }) })] })] }), isCreatingOrder ? (_jsxs("div", { className: "bg-b3-react-background border-b3-react-border flex items-center justify-center gap-3 rounded-lg border p-6", children: [_jsx(Loader2, { className: "h-4 w-4 animate-spin" }), _jsx("span", { className: "text-as-primary/70", children: "Creating onramp order..." })] })) : isLoadingGeoOnramp ? (_jsxs("div", { className: "bg-b3-react-background border-b3-react-border flex items-center justify-center gap-3 rounded-lg border p-6", children: [_jsx(Loader2, { className: "h-4 w-4 animate-spin" }), _jsx("span", { className: "text-as-primary/70", children: "Loading payment options..." })] })) : (_jsxs(_Fragment, { children: [_jsxs("div", { className: "mb-3 flex items-center justify-between", children: [_jsx("h2", { className: "text-lg font-semibold", children: "Payment method" }), _jsx("div", { className: "flex items-center gap-1", children: coinbaseAvailablePaymentMethods.length > 0 &&
|
|
109
108
|
(() => {
|
|
@@ -114,6 +113,6 @@ recipientAddress, isMainnet, isBuyMode, destinationTokenChainId, destinationToke
|
|
|
114
113
|
})() })] }), _jsxs("div", { className: "flex flex-col gap-3", children: [coinbaseAvailablePaymentMethods.length > 0 &&
|
|
115
114
|
(() => {
|
|
116
115
|
const method = coinbaseAvailablePaymentMethods[0];
|
|
117
|
-
return (_jsxs("button", { onClick: () => handlePaymentMethodClick(
|
|
118
|
-
})(), isStripeWeb2Supported && (_jsxs("button", { onClick: () => handlePaymentMethodClick(
|
|
116
|
+
return (_jsxs("button", { onClick: () => handlePaymentMethodClick("coinbase", method.id), disabled: isCreatingOrder, className: "bg-b3-react-background border-b3-react-border hover:border-as-brand disabled:hover:border-b3-react-border group flex w-full items-center justify-between gap-4 rounded-xl border p-5 transition-all duration-200 hover:shadow-md disabled:cursor-not-allowed disabled:opacity-50", children: [_jsxs("div", { className: "flex items-center gap-4", children: [_jsx("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-blue-50", children: _jsx("img", { src: "https://cdn.b3.fun/coinbase-wordmark-blue.svg", alt: "Coinbase", className: "h-6" }) }), _jsxs("div", { className: "flex flex-col items-start text-left", children: [_jsx("h4", { className: "text-b3-react-foreground text-lg font-semibold", children: "Coinbase Pay" }), _jsxs("p", { className: "text-b3-react-foreground/60 text-sm", children: [method.id === "CARD" && "Debit card, bank account, or Coinbase Account", method.id === "FIAT_WALLET" && "Pay with your Coinbase account balance", method.id === "APPLE_PAY" && "Quick payment with Apple Pay", method.id === "ACH_BANK_ACCOUNT" && "Direct bank account transfer"] }), _jsx("div", { className: "mt-1 flex items-center gap-1", children: _jsx("span", { className: "text-xs font-medium text-green-600", children: "Free" }) })] })] }), _jsx(ChevronRight, { className: "text-b3-react-foreground/40 group-hover:text-b3-react-foreground/60 h-5 w-5 transition-colors" })] }));
|
|
117
|
+
})(), isStripeWeb2Supported && (_jsxs("button", { onClick: () => handlePaymentMethodClick("stripe-web2"), className: "bg-b3-react-background border-b3-react-border hover:border-as-brand group flex w-full items-center justify-between gap-4 rounded-xl border p-5 transition-all duration-200 hover:shadow-md", children: [_jsxs("div", { className: "flex items-center gap-4", children: [_jsx("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-purple-50", children: _jsx("img", { src: "https://raw.githubusercontent.com/stripe/stripe.github.io/455f506a628dc3f6c505e3001db45a64e29e9fc3/images/stripe-logo.svg", alt: "Stripe", className: "h-5" }) }), _jsxs("div", { className: "flex flex-col items-start text-left", children: [_jsx("h4", { className: "text-b3-react-foreground text-lg font-semibold", children: "Stripe" }), _jsx("p", { className: "text-b3-react-foreground/60 text-sm", children: "Credit or debit card payment" }), _jsx("div", { className: "mt-1 flex items-center gap-1", children: _jsx("span", { className: "text-xs font-medium text-orange-600", children: "Fee Applied" }) })] })] }), _jsx(ChevronRight, { className: "text-b3-react-foreground/40 group-hover:text-b3-react-foreground/60 h-5 w-5 transition-colors" })] })), _jsxs(Button, { variant: "link", onClick: onBack, className: "text-b3-react-foreground/70 hover:text-b3-react-foreground/90 mt-2 w-full", children: [_jsx(ChevronLeft, { className: "mr-2 h-4 w-4" }), "Back"] })] })] }))] }));
|
|
119
118
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { components } from "../../../../anyspend/types/api";
|
|
2
2
|
interface PaymentOneClickProps {
|
|
3
|
-
order: Order;
|
|
3
|
+
order: components["schemas"]["Order"];
|
|
4
4
|
dstTokenSymbol: string;
|
|
5
5
|
}
|
|
6
6
|
export default function PaymentOneClick({ order }: PaymentOneClickProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { components } from "../../../../anyspend/types/api";
|
|
2
2
|
interface PaymentStripeWeb2Props {
|
|
3
3
|
isMainnet: boolean;
|
|
4
|
-
order: Order;
|
|
4
|
+
order: components["schemas"]["Order"];
|
|
5
5
|
onPaymentSuccess?: (paymentIntent: any) => void;
|
|
6
6
|
}
|
|
7
7
|
export default function PaymentStripeWeb2({ isMainnet, order, onPaymentSuccess }: PaymentStripeWeb2Props): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { components } from "../../../../anyspend/types/api";
|
|
2
2
|
interface PaymentVendorUIProps {
|
|
3
3
|
isMainnet: boolean;
|
|
4
|
-
order: Order;
|
|
4
|
+
order: components["schemas"]["Order"];
|
|
5
5
|
dstTokenSymbol: string;
|
|
6
6
|
}
|
|
7
7
|
export default function PaymentVendorUI({ isMainnet, order, dstTokenSymbol }: PaymentVendorUIProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { OnrampVendor } from "../../../../anyspend/index.js";
|
|
3
2
|
import PaymentOneClick from "./PaymentOneClick.js";
|
|
4
3
|
import PaymentStripeWeb2 from "./PaymentStripeWeb2.js";
|
|
5
4
|
export default function PaymentVendorUI({ isMainnet, order, dstTokenSymbol }) {
|
|
@@ -9,7 +8,7 @@ export default function PaymentVendorUI({ isMainnet, order, dstTokenSymbol }) {
|
|
|
9
8
|
return _jsx(PaymentOneClick, { order: order, dstTokenSymbol: dstTokenSymbol });
|
|
10
9
|
}
|
|
11
10
|
// Handle Stripe Web2 payment flow
|
|
12
|
-
if (vendor ===
|
|
11
|
+
if (vendor === "stripe-web2") {
|
|
13
12
|
return _jsx(PaymentStripeWeb2, { isMainnet: isMainnet, order: order });
|
|
14
13
|
}
|
|
15
14
|
// Return null for unsupported vendors
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { components } from "../../../../anyspend/types/api";
|
|
2
2
|
export declare function TokenBalance({ token, walletAddress, onChangeInput, }: {
|
|
3
|
-
token: Token;
|
|
3
|
+
token: components["schemas"]["Token"];
|
|
4
4
|
walletAddress: string | undefined;
|
|
5
5
|
onChangeInput: (value: string) => void;
|
|
6
6
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { components } from "../../../../anyspend/types/api";
|
|
2
2
|
interface WebviewOnrampOrderStatusProps {
|
|
3
|
-
order: Order;
|
|
3
|
+
order: components["schemas"]["Order"];
|
|
4
4
|
}
|
|
5
5
|
export declare function WebviewOnrampOrderStatus({ order }: WebviewOnrampOrderStatusProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export {};
|