@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
package/README.md
CHANGED
|
@@ -412,7 +412,6 @@ The SDK components support custom styling through CSS classes and CSS-in-JS solu
|
|
|
412
412
|
All modules provide full TypeScript support with comprehensive type definitions:
|
|
413
413
|
|
|
414
414
|
```typescript
|
|
415
|
-
import type { Token } from "@b3dotfun/sdk/anyspend/types";
|
|
416
415
|
import type { GlobalAccount } from "@b3dotfun/sdk/global-account/types";
|
|
417
416
|
```
|
|
418
417
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { components } from "../types/api";
|
|
2
2
|
export declare const ANYSPEND_MAINNET_BASE_URL: string;
|
|
3
3
|
export declare const ANYSPEND_TESTNET_BASE_URL: string;
|
|
4
4
|
export declare const RELAY_ETH_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
@@ -6,10 +6,21 @@ export declare const RELAY_SOL_ADDRESS = "11111111111111111111111111111111";
|
|
|
6
6
|
export declare const RELAY_SOLANA_MAINNET_CHAIN_ID = 792703809;
|
|
7
7
|
export declare const SOLANA_ASSOCIATED_TOKEN_ACCOUNT_PROGRAM_ID = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
|
|
8
8
|
export declare const SOLANA_TOKEN_2022_PROGRAM_ID = "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
|
|
9
|
-
export declare const B3_TOKEN: Token;
|
|
10
|
-
export declare const USDC_BASE: Token;
|
|
11
|
-
export declare const NFT_CONTRACTS: NftContract[];
|
|
12
|
-
export declare const DEFAULT_NFT_CONTRACT:
|
|
9
|
+
export declare const B3_TOKEN: components["schemas"]["Token"];
|
|
10
|
+
export declare const USDC_BASE: components["schemas"]["Token"];
|
|
11
|
+
export declare const NFT_CONTRACTS: components["schemas"]["NftContract"][];
|
|
12
|
+
export declare const DEFAULT_NFT_CONTRACT: {
|
|
13
|
+
chainId: number;
|
|
14
|
+
contractAddress: string;
|
|
15
|
+
price: string;
|
|
16
|
+
priceFormatted: string;
|
|
17
|
+
currency: components["schemas"]["Token"];
|
|
18
|
+
imageUrl: string;
|
|
19
|
+
name: string;
|
|
20
|
+
description: string;
|
|
21
|
+
tokenId: number | null;
|
|
22
|
+
type: "erc721" | "erc1155";
|
|
23
|
+
};
|
|
13
24
|
export declare const STRIPE_CONFIG: {
|
|
14
25
|
readonly publishableKey: "pk_live_51QkrBwJnoDg53PsPq7QYOxSLfnXvtCVeD9UuyZ6c136i42XtYC2Z2bl1W5xbDg6AaoGyq63ErCc0yv3C2KBX29CG002AE862CP";
|
|
15
26
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VENDOR_DISPLAY_NAMES = exports.PAYMENT_METHOD_ICONS = exports.STRIPE_CONFIG = exports.DEFAULT_NFT_CONTRACT = exports.NFT_CONTRACTS = exports.USDC_BASE = exports.B3_TOKEN = exports.SOLANA_TOKEN_2022_PROGRAM_ID = exports.SOLANA_ASSOCIATED_TOKEN_ACCOUNT_PROGRAM_ID = exports.RELAY_SOLANA_MAINNET_CHAIN_ID = exports.RELAY_SOL_ADDRESS = exports.RELAY_ETH_ADDRESS = exports.ANYSPEND_TESTNET_BASE_URL = exports.ANYSPEND_MAINNET_BASE_URL = void 0;
|
|
4
|
-
const types_1 = require("../../anyspend/types");
|
|
5
4
|
const chains_1 = require("viem/chains");
|
|
6
5
|
exports.ANYSPEND_MAINNET_BASE_URL = process.env.NEXT_PUBLIC_ANYSPEND_BASE_URL || "https://mainnet.anyspend.com";
|
|
7
6
|
exports.ANYSPEND_TESTNET_BASE_URL = process.env.NEXT_PUBLIC_ANYSPEND_BASE_URL || "https://testnet.anyspend.com";
|
|
@@ -40,8 +39,8 @@ exports.NFT_CONTRACTS = [
|
|
|
40
39
|
imageUrl: "https://storage.googleapis.com/nftimagebucket/base/tokens/0x80f0e6644723abb03aa8867d21e32bd854b2a2d9/preview/TVRjME1EUTRORFl4T0E9PV8zNjcy.jpg",
|
|
41
40
|
name: "Downhill Ski",
|
|
42
41
|
description: "Downhill Ski",
|
|
43
|
-
tokenId:
|
|
44
|
-
type:
|
|
42
|
+
tokenId: 0,
|
|
43
|
+
type: "erc721",
|
|
45
44
|
},
|
|
46
45
|
{
|
|
47
46
|
chainId: chains_1.base.id,
|
|
@@ -53,7 +52,7 @@ exports.NFT_CONTRACTS = [
|
|
|
53
52
|
name: "Eclipse Venom",
|
|
54
53
|
description: "The Eclipse Venom's crystalline blade channels imprisoned astral toxins through swirling currents of violet and teal light, synchronizing with its wielder's heartbeat for strikes that bypass conventional armor. Wounds from this otherworldly weapon resist healing as victims describe being consumed from within by liquid darkness, their final moments filled with visions of infinite cosmic depths.",
|
|
55
54
|
tokenId: null,
|
|
56
|
-
type:
|
|
55
|
+
type: "erc721",
|
|
57
56
|
},
|
|
58
57
|
];
|
|
59
58
|
exports.DEFAULT_NFT_CONTRACT = exports.NFT_CONTRACTS[1];
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
export * from "./types";
|
|
2
|
-
export * from "./types/metadata";
|
|
3
|
-
export * from "./types/relay";
|
|
4
|
-
export * from "./types/signatureMint";
|
|
5
|
-
export * from "./types/token";
|
|
6
1
|
export * from "./utils/address";
|
|
7
2
|
export * from "./utils/chain";
|
|
8
3
|
export * from "./utils/format";
|
|
@@ -14,12 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
// Types
|
|
18
|
-
__exportStar(require("./types"), exports);
|
|
19
|
-
__exportStar(require("./types/metadata"), exports);
|
|
20
|
-
__exportStar(require("./types/relay"), exports);
|
|
21
|
-
__exportStar(require("./types/signatureMint"), exports);
|
|
22
|
-
__exportStar(require("./types/token"), exports);
|
|
23
17
|
// Utils
|
|
24
18
|
__exportStar(require("./utils/address"), exports);
|
|
25
19
|
__exportStar(require("./utils/chain"), exports);
|
|
@@ -18,8 +18,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
__exportStar(require("./react/hooks"), exports);
|
|
19
19
|
// Providers
|
|
20
20
|
__exportStar(require("./react/providers/AnyspendProvider"), exports);
|
|
21
|
-
// Types
|
|
22
|
-
__exportStar(require("./types"), exports);
|
|
23
21
|
// Utils
|
|
24
22
|
__exportStar(require("./utils/address"), exports);
|
|
25
23
|
__exportStar(require("./utils/chain"), exports);
|
|
@@ -284,17 +284,17 @@ function AnySpend({ destinationTokenAddress, destinationTokenChainId, isMainnet
|
|
|
284
284
|
}, [recipientAddressFromProps, globalAddress]);
|
|
285
285
|
// Get anyspend price
|
|
286
286
|
const activeInputAmountInWei = isSrcInputDirty
|
|
287
|
-
? (0, viem_1.parseUnits)(srcAmount.
|
|
288
|
-
: (0, viem_1.parseUnits)(dstAmount.
|
|
289
|
-
const srcAmountOnrampInWei = (0, viem_1.parseUnits)(srcAmountOnRamp.
|
|
287
|
+
? (0, viem_1.parseUnits)(srcAmount.replace(/,/g, ""), selectedSrcToken.decimals).toString()
|
|
288
|
+
: (0, viem_1.parseUnits)(dstAmount.replace(/,/g, ""), selectedDstToken.decimals).toString();
|
|
289
|
+
const srcAmountOnrampInWei = (0, viem_1.parseUnits)(srcAmountOnRamp.replace(/,/g, ""), anyspend_1.USDC_BASE.decimals).toString();
|
|
290
290
|
const { anyspendQuote, isLoadingAnyspendQuote, getAnyspendQuoteError } = (0, react_1.useAnyspendQuote)(isMainnet, activeTab === "crypto"
|
|
291
291
|
? {
|
|
292
292
|
srcChain: selectedSrcChainId,
|
|
293
293
|
dstChain: isBuyMode ? destinationTokenChainId : selectedDstChainId,
|
|
294
294
|
srcTokenAddress: selectedSrcToken.address,
|
|
295
295
|
dstTokenAddress: isBuyMode ? destinationTokenAddress : selectedDstToken.address,
|
|
296
|
-
type:
|
|
297
|
-
tradeType: isSrcInputDirty ?
|
|
296
|
+
type: "swap",
|
|
297
|
+
tradeType: isSrcInputDirty ? "EXACT_INPUT" : "EXPECTED_OUTPUT",
|
|
298
298
|
amount: activeInputAmountInWei,
|
|
299
299
|
}
|
|
300
300
|
: {
|
|
@@ -302,8 +302,8 @@ function AnySpend({ destinationTokenAddress, destinationTokenChainId, isMainnet
|
|
|
302
302
|
dstChain: isBuyMode ? destinationTokenChainId : selectedDstChainId,
|
|
303
303
|
srcTokenAddress: anyspend_1.USDC_BASE.address,
|
|
304
304
|
dstTokenAddress: isBuyMode ? destinationTokenAddress : selectedDstToken.address,
|
|
305
|
-
type:
|
|
306
|
-
tradeType:
|
|
305
|
+
type: "swap",
|
|
306
|
+
tradeType: "EXACT_INPUT",
|
|
307
307
|
amount: srcAmountOnrampInWei,
|
|
308
308
|
});
|
|
309
309
|
// Replace the old ENS lookup with our new hooks
|
|
@@ -369,11 +369,11 @@ function AnySpend({ destinationTokenAddress, destinationTokenChainId, isMainnet
|
|
|
369
369
|
// const handleCreateOrder = async (recipientAddress: string) => {
|
|
370
370
|
// try {
|
|
371
371
|
// invariant(anyspendPrice, "Relay price is not found");
|
|
372
|
-
// const srcAmountBigInt = parseUnits(srcAmount.
|
|
372
|
+
// const srcAmountBigInt = parseUnits(srcAmount.replace(/,/g, ""), selectedSrcToken.decimals);
|
|
373
373
|
// createOrder({
|
|
374
374
|
// isMainnet,
|
|
375
375
|
// recipientAddress,
|
|
376
|
-
// orderType:
|
|
376
|
+
// orderType: "swap",
|
|
377
377
|
// srcChain: selectedSrcChainId,
|
|
378
378
|
// dstChain: selectedDstChainId,
|
|
379
379
|
// srcToken: selectedSrcToken,
|
|
@@ -525,11 +525,11 @@ function AnySpend({ destinationTokenAddress, destinationTokenChainId, isMainnet
|
|
|
525
525
|
setActivePanel(PanelView.FIAT_PAYMENT);
|
|
526
526
|
return;
|
|
527
527
|
}
|
|
528
|
-
const srcAmountBigInt = (0, viem_1.parseUnits)(srcAmount.
|
|
528
|
+
const srcAmountBigInt = (0, viem_1.parseUnits)(srcAmount.replace(/,/g, ""), selectedSrcToken.decimals);
|
|
529
529
|
createOrder({
|
|
530
530
|
isMainnet,
|
|
531
531
|
recipientAddress,
|
|
532
|
-
orderType:
|
|
532
|
+
orderType: "swap",
|
|
533
533
|
srcChain: selectedSrcChainId,
|
|
534
534
|
dstChain: isBuyMode ? destinationTokenChainId : selectedDstChainId,
|
|
535
535
|
srcToken: selectedSrcToken,
|
|
@@ -661,7 +661,7 @@ function AnySpend({ destinationTokenAddress, destinationTokenChainId, isMainnet
|
|
|
661
661
|
// Using inline style to ensure color displays
|
|
662
662
|
return ((0, jsx_runtime_1.jsxs)("span", { className: "ml-2", style: { color: percentageNum >= 10 ? "red" : "#FFD700" }, children: ["(", isNegative ? "-" : "", percentage, "%)"] }));
|
|
663
663
|
})()] })] })] }), getAnyspendQuoteError && ((0, jsx_runtime_1.jsxs)("div", { className: "bg-as-on-surface-1 flex w-full max-w-[460px] items-center gap-2 rounded-2xl p-4", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.CircleAlert, { className: "bg-as-red h-4 min-h-4 w-4 min-w-4 rounded-full p-0 text-sm font-medium text-white" }), (0, jsx_runtime_1.jsx)("div", { className: "text-as-red text-sm", children: getAnyspendQuoteError.message })] })), (0, jsx_runtime_1.jsxs)(framer_motion_1.motion.div, { initial: { opacity: 0, y: 20, filter: "blur(10px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)" }, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: "flex w-full max-w-[460px] flex-col gap-2", children: [(0, jsx_runtime_1.jsxs)(react_2.ShinyButton, { accentColor: "hsl(var(--as-brand))", disabled: btnInfo.disable, onClick: onMainButtonClick, className: (0, cn_1.cn)("relative w-full", btnInfo.error ? "!bg-as-red" : btnInfo.disable ? "!bg-as-on-surface-2" : "!bg-as-brand"), textClassName: (0, cn_1.cn)(btnInfo.error ? "text-white" : btnInfo.disable ? "text-as-secondary" : "text-white"), children: [btnInfo.text, !btnInfo.disable && !btnInfo.error && ((0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRightCircle, { className: "absolute right-0 top-1/2 h-6 w-6 -translate-y-1/2 opacity-70" }))] }), !hideTransactionHistoryButton && (globalAddress || recipientAddress) ? ((0, jsx_runtime_1.jsxs)(react_2.Button, { variant: "link", onClick: onClickHistory, className: "text-as-primary/50 hover:text-as-primary flex items-center gap-1 transition-colors", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.HistoryIcon, { className: "h-4 w-4" }), " ", (0, jsx_runtime_1.jsx)("span", { className: "pr-4", children: "Transaction History" })] })) : ((0, jsx_runtime_1.jsx)("div", { className: "h-2 w-full" }))] })] }));
|
|
664
|
-
const onrampPaymentView = ((0, jsx_runtime_1.jsx)(PanelOnrampPayment_1.PanelOnrampPayment, { srcAmountOnRamp: srcAmountOnRamp, recipientName: recipientName, recipientAddress: recipientAddress, isMainnet: isMainnet, isBuyMode: isBuyMode, destinationTokenChainId: destinationTokenChainId, destinationTokenAddress: destinationTokenAddress, selectedDstChainId: selectedDstChainId, selectedDstToken: selectedDstToken, orderType:
|
|
664
|
+
const onrampPaymentView = ((0, jsx_runtime_1.jsx)(PanelOnrampPayment_1.PanelOnrampPayment, { srcAmountOnRamp: srcAmountOnRamp, recipientName: recipientName, recipientAddress: recipientAddress, isMainnet: isMainnet, isBuyMode: isBuyMode, destinationTokenChainId: destinationTokenChainId, destinationTokenAddress: destinationTokenAddress, selectedDstChainId: selectedDstChainId, selectedDstToken: selectedDstToken, orderType: "swap", anyspendQuote: anyspendQuote, globalAddress: globalAddress, onOrderCreated: orderId => {
|
|
665
665
|
setOrderId(orderId);
|
|
666
666
|
setActivePanel(PanelView.ORDER_DETAILS);
|
|
667
667
|
// Add orderId to URL for persistence
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AnySpendBondKit = AnySpendBondKit;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const bondkit_1 = require("@b3dotfun/bondkit");
|
|
6
|
-
const anyspend_1 = require("../../../anyspend");
|
|
7
6
|
const react_1 = require("../../../global-account/react");
|
|
8
7
|
const supported_1 = require("../../../shared/constants/chains/supported");
|
|
9
8
|
const framer_motion_1 = require("framer-motion");
|
|
@@ -203,8 +202,8 @@ function AnySpendBondKit({ mode = "modal", recipientAddress, contractAddress, mi
|
|
|
203
202
|
functionName: "buyFor",
|
|
204
203
|
args: [recipientAddress, BigInt(minTokensOut)],
|
|
205
204
|
});
|
|
206
|
-
return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { isMainnet: true, mode: mode, recipientAddress: recipientAddress, orderType:
|
|
207
|
-
type:
|
|
205
|
+
return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { isMainnet: true, mode: mode, recipientAddress: recipientAddress, orderType: "custom", dstChainId: supported_1.baseMainnet.id, dstToken: dstToken, dstAmount: (0, viem_1.parseEther)(ethAmount).toString(), contractAddress: contractAddress, encodedData: encodedData, metadata: {
|
|
206
|
+
type: "custom",
|
|
208
207
|
action: "BondKit Buy",
|
|
209
208
|
}, header: header, onSuccess: onSuccess, showRecipient: true }));
|
|
210
209
|
}
|
|
@@ -139,7 +139,6 @@ function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", spinwhee
|
|
|
139
139
|
const [validationError, setValidationError] = (0, react_2.useState)("");
|
|
140
140
|
const [displayQuantity, setDisplayQuantity] = (0, react_2.useState)("");
|
|
141
141
|
const [debouncedQuantity, setDebouncedQuantity] = (0, react_2.useState)("");
|
|
142
|
-
const [debouncedUserSpinQuantity, setDebouncedUserSpinQuantity] = (0, react_2.useState)("");
|
|
143
142
|
(0, react_2.useEffect)(() => {
|
|
144
143
|
if (prefillQuantity && wheelInfo) {
|
|
145
144
|
const remainingSpins = wheelInfo.totalPrizesAvailable_ - wheelInfo.prizesRequestedCount_;
|
|
@@ -198,7 +197,7 @@ function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", spinwhee
|
|
|
198
197
|
finally {
|
|
199
198
|
setIsLoadingConfig(false);
|
|
200
199
|
}
|
|
201
|
-
}, [spinwheelContractAddress
|
|
200
|
+
}, [spinwheelContractAddress]);
|
|
202
201
|
// Fetch config on mount and when dependencies change
|
|
203
202
|
(0, react_2.useEffect)(() => {
|
|
204
203
|
fetchPaymentConfig();
|
|
@@ -207,7 +206,6 @@ function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", spinwhee
|
|
|
207
206
|
(0, react_2.useEffect)(() => {
|
|
208
207
|
const timer = setTimeout(() => {
|
|
209
208
|
setDebouncedQuantity(displayQuantity);
|
|
210
|
-
setDebouncedUserSpinQuantity(userSpinQuantity);
|
|
211
209
|
}, 500);
|
|
212
210
|
return () => clearTimeout(timer);
|
|
213
211
|
}, [displayQuantity, userSpinQuantity]);
|
|
@@ -337,7 +335,6 @@ function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", spinwhee
|
|
|
337
335
|
const pricePerEntry = (0, viem_1.formatUnits)(paymentConfig.pricePerEntry, 18);
|
|
338
336
|
const remainingEntries = wheelInfo ? wheelInfo.totalPrizesAvailable_ - wheelInfo.prizesRequestedCount_ : BigInt(0);
|
|
339
337
|
const wheelStatus = wheelInfo ? getWheelStatus(wheelInfo) : null;
|
|
340
|
-
const isSoldOut = wheelStatus === "sold_out";
|
|
341
338
|
const isActive = wheelStatus === "active";
|
|
342
339
|
const getStatusMessage = () => {
|
|
343
340
|
if (!wheelInfo)
|
|
@@ -390,8 +387,8 @@ function AnySpendBuySpin({ isMainnet = true, loadOrder, mode = "modal", spinwhee
|
|
|
390
387
|
}
|
|
391
388
|
// AnySpend flow for when user needs to swap to B3
|
|
392
389
|
const encodedData = generateEncodedDataForBuyEntriesAndSpin(address || "", userSpinQuantity);
|
|
393
|
-
return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { isMainnet: isMainnet, loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, orderType:
|
|
394
|
-
type:
|
|
390
|
+
return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { isMainnet: isMainnet, loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, orderType: "custom", dstChainId: chainId, dstToken: anyspend_1.B3_TOKEN, dstAmount: totalCost.toString(), contractAddress: spinwheelContractAddress, spenderAddress: paymentConfig.entryModule, encodedData: encodedData, metadata: {
|
|
391
|
+
type: "custom",
|
|
395
392
|
action: `buy ${userSpinQuantity} spin${userSpinQuantity !== "1" ? "s" : ""}`,
|
|
396
393
|
}, header: header, onSuccess: txHash => onSuccess?.(txHash), showRecipient: false }));
|
|
397
394
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { components } from "../../../anyspend/types/api";
|
|
2
|
+
import { GetQuoteResponse } from "../../../anyspend/types/api_req_res";
|
|
2
3
|
import React from "react";
|
|
3
4
|
export declare function AnySpendCustom({ isMainnet, loadOrder, mode, recipientAddress: recipientAddressProps, spenderAddress, orderType, dstChainId, dstToken, dstAmount, contractAddress, encodedData, metadata, header, onSuccess, showRecipient, }: {
|
|
4
5
|
isMainnet?: boolean;
|
|
@@ -6,13 +7,13 @@ export declare function AnySpendCustom({ isMainnet, loadOrder, mode, recipientAd
|
|
|
6
7
|
mode?: "modal" | "page";
|
|
7
8
|
recipientAddress?: string;
|
|
8
9
|
spenderAddress?: string;
|
|
9
|
-
orderType:
|
|
10
|
+
orderType: components["schemas"]["Order"]["type"];
|
|
10
11
|
dstChainId: number;
|
|
11
|
-
dstToken: Token;
|
|
12
|
+
dstToken: components["schemas"]["Token"];
|
|
12
13
|
dstAmount: string;
|
|
13
14
|
contractAddress: string;
|
|
14
15
|
encodedData: string;
|
|
15
|
-
metadata:
|
|
16
|
+
metadata: any;
|
|
16
17
|
header: ({ anyspendPrice, isLoadingAnyspendPrice, }: {
|
|
17
18
|
anyspendPrice: GetQuoteResponse | undefined;
|
|
18
19
|
isLoadingAnyspendPrice: boolean;
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.AnySpendCustom = AnySpendCustom;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const anyspend_1 = require("../../../anyspend");
|
|
9
|
+
const constants_1 = require("../../../anyspend/constants");
|
|
9
10
|
const react_1 = require("../../../anyspend/react");
|
|
10
11
|
const react_2 = require("../../../global-account/react");
|
|
11
12
|
const utils_1 = require("../../../shared/utils");
|
|
@@ -32,9 +33,9 @@ var PanelView;
|
|
|
32
33
|
})(PanelView || (PanelView = {}));
|
|
33
34
|
function generateGetRelayQuoteRequest({ orderType, srcChainId, srcToken, dstChainId, dstToken, dstAmount, contractAddress, tokenId, contractType, encodedData, spenderAddress, }) {
|
|
34
35
|
switch (orderType) {
|
|
35
|
-
case
|
|
36
|
+
case "mint_nft": {
|
|
36
37
|
return {
|
|
37
|
-
type:
|
|
38
|
+
type: "mint_nft",
|
|
38
39
|
srcChain: srcChainId,
|
|
39
40
|
srcTokenAddress: srcToken.address,
|
|
40
41
|
dstChain: dstChainId,
|
|
@@ -45,9 +46,9 @@ function generateGetRelayQuoteRequest({ orderType, srcChainId, srcToken, dstChai
|
|
|
45
46
|
contractType: contractType,
|
|
46
47
|
};
|
|
47
48
|
}
|
|
48
|
-
case
|
|
49
|
+
case "join_tournament": {
|
|
49
50
|
return {
|
|
50
|
-
type:
|
|
51
|
+
type: "join_tournament",
|
|
51
52
|
srcChain: srcChainId,
|
|
52
53
|
srcTokenAddress: srcToken.address,
|
|
53
54
|
dstChain: dstChainId,
|
|
@@ -56,9 +57,9 @@ function generateGetRelayQuoteRequest({ orderType, srcChainId, srcToken, dstChai
|
|
|
56
57
|
contractAddress: contractAddress,
|
|
57
58
|
};
|
|
58
59
|
}
|
|
59
|
-
case
|
|
60
|
+
case "fund_tournament": {
|
|
60
61
|
return {
|
|
61
|
-
type:
|
|
62
|
+
type: "fund_tournament",
|
|
62
63
|
srcChain: srcChainId,
|
|
63
64
|
srcTokenAddress: srcToken.address,
|
|
64
65
|
dstChain: dstChainId,
|
|
@@ -67,9 +68,9 @@ function generateGetRelayQuoteRequest({ orderType, srcChainId, srcToken, dstChai
|
|
|
67
68
|
contractAddress: contractAddress,
|
|
68
69
|
};
|
|
69
70
|
}
|
|
70
|
-
case
|
|
71
|
+
case "custom": {
|
|
71
72
|
return {
|
|
72
|
-
type:
|
|
73
|
+
type: "custom",
|
|
73
74
|
srcChain: srcChainId,
|
|
74
75
|
srcTokenAddress: srcToken.address,
|
|
75
76
|
dstChain: dstChainId,
|
|
@@ -88,7 +89,6 @@ function generateGetRelayQuoteRequest({ orderType, srcChainId, srcToken, dstChai
|
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
91
|
function AnySpendCustom({ isMainnet = true, loadOrder, mode = "modal", recipientAddress: recipientAddressProps, spenderAddress, orderType, dstChainId, dstToken, dstAmount, contractAddress, encodedData, metadata, header, onSuccess, showRecipient = true, }) {
|
|
91
|
-
const { setB3ModalOpen, setB3ModalContentType } = (0, react_2.useModalStore)();
|
|
92
92
|
const hasMounted = (0, react_2.useHasMounted)();
|
|
93
93
|
const searchParams = (0, react_2.useSearchParamsSSR)();
|
|
94
94
|
const router = (0, react_2.useRouter)();
|
|
@@ -103,7 +103,7 @@ function AnySpendCustom({ isMainnet = true, loadOrder, mode = "modal", recipient
|
|
|
103
103
|
// Update recipient logic to use custom recipient
|
|
104
104
|
const recipientAddress = customRecipientAddress || currentWallet.address;
|
|
105
105
|
const recipientPropsProfile = (0, react_2.useBsmntProfile)({ address: recipientAddress });
|
|
106
|
-
const recipientEnsName = recipientPropsProfile.data?.username?.
|
|
106
|
+
const recipientEnsName = recipientPropsProfile.data?.username?.replace(/\.b3\.fun/g, "");
|
|
107
107
|
const recipientImageUrl = recipientPropsProfile.data?.avatar || currentWallet.wallet.meta?.icon;
|
|
108
108
|
const [orderId, setOrderId] = (0, react_3.useState)(loadOrder);
|
|
109
109
|
const [srcChainId, setSrcChainId] = (0, react_3.useState)(isMainnet ? chains_1.base.id : chains_1.baseSepolia.id);
|
|
@@ -124,7 +124,7 @@ function AnySpendCustom({ isMainnet = true, loadOrder, mode = "modal", recipient
|
|
|
124
124
|
// First check native tokens (ETH, etc.)
|
|
125
125
|
const nativeToken = nativeTokens?.find(t => t.chainId === srcChainId && Number(t.displayValue) > 0);
|
|
126
126
|
if (nativeToken) {
|
|
127
|
-
const matchingToken = tokenList.find(t => t.address ===
|
|
127
|
+
const matchingToken = tokenList.find(t => t.address === constants_1.RELAY_ETH_ADDRESS);
|
|
128
128
|
if (matchingToken)
|
|
129
129
|
return matchingToken;
|
|
130
130
|
}
|
|
@@ -168,8 +168,8 @@ function AnySpendCustom({ isMainnet = true, loadOrder, mode = "modal", recipient
|
|
|
168
168
|
dstToken: dstToken,
|
|
169
169
|
dstAmount: dstAmount,
|
|
170
170
|
contractAddress: contractAddress,
|
|
171
|
-
tokenId:
|
|
172
|
-
contractType:
|
|
171
|
+
tokenId: metadata.type === "mint_nft" ? metadata.nftContract.tokenId : undefined,
|
|
172
|
+
contractType: metadata.type === "mint_nft" ? metadata.nftContract.type : undefined,
|
|
173
173
|
encodedData: encodedData,
|
|
174
174
|
spenderAddress: spenderAddress,
|
|
175
175
|
});
|
|
@@ -204,7 +204,7 @@ function AnySpendCustom({ isMainnet = true, loadOrder, mode = "modal", recipient
|
|
|
204
204
|
(0, react_3.useEffect)(() => {
|
|
205
205
|
if (activeTab === "fiat") {
|
|
206
206
|
setSrcChainId(chains_1.base.id);
|
|
207
|
-
setSrcToken(
|
|
207
|
+
setSrcToken(constants_1.USDC_BASE);
|
|
208
208
|
setDirtySelectSrcToken(true);
|
|
209
209
|
}
|
|
210
210
|
}, [activeTab]);
|
|
@@ -222,7 +222,7 @@ function AnySpendCustom({ isMainnet = true, loadOrder, mode = "modal", recipient
|
|
|
222
222
|
}
|
|
223
223
|
}, [anyspendQuote?.data]);
|
|
224
224
|
(0, react_3.useEffect)(() => {
|
|
225
|
-
if (oat?.data?.order.status ===
|
|
225
|
+
if (oat?.data?.order.status === "executed") {
|
|
226
226
|
console.log("Calling onSuccess");
|
|
227
227
|
const txHash = oat?.data?.executeTx?.txHash;
|
|
228
228
|
onSuccess?.(txHash);
|
|
@@ -261,10 +261,10 @@ function AnySpendCustom({ isMainnet = true, loadOrder, mode = "modal", recipient
|
|
|
261
261
|
srcAmount: srcAmount.toString(),
|
|
262
262
|
recipientAddress,
|
|
263
263
|
creatorAddress: currentWallet?.wallet?.address,
|
|
264
|
-
nft:
|
|
265
|
-
? metadata.nftContract.type ===
|
|
264
|
+
nft: metadata.type === "mint_nft"
|
|
265
|
+
? metadata.nftContract.type === "erc1155"
|
|
266
266
|
? {
|
|
267
|
-
type:
|
|
267
|
+
type: "erc1155",
|
|
268
268
|
contractAddress: metadata.nftContract.contractAddress,
|
|
269
269
|
tokenId: metadata.nftContract.tokenId,
|
|
270
270
|
name: metadata.nftContract.name,
|
|
@@ -273,7 +273,7 @@ function AnySpendCustom({ isMainnet = true, loadOrder, mode = "modal", recipient
|
|
|
273
273
|
price: dstAmount,
|
|
274
274
|
}
|
|
275
275
|
: {
|
|
276
|
-
type:
|
|
276
|
+
type: "erc721",
|
|
277
277
|
contractAddress: metadata.nftContract.contractAddress,
|
|
278
278
|
contractType: metadata.nftContract.type,
|
|
279
279
|
price: dstAmount,
|
|
@@ -282,7 +282,7 @@ function AnySpendCustom({ isMainnet = true, loadOrder, mode = "modal", recipient
|
|
|
282
282
|
imageUrl: metadata.nftContract.imageUrl,
|
|
283
283
|
}
|
|
284
284
|
: undefined,
|
|
285
|
-
tournament:
|
|
285
|
+
tournament: metadata.type === "join_tournament" || metadata.type === "fund_tournament"
|
|
286
286
|
? {
|
|
287
287
|
...metadata.tournament,
|
|
288
288
|
contractAddress: contractAddress,
|
|
@@ -290,7 +290,7 @@ function AnySpendCustom({ isMainnet = true, loadOrder, mode = "modal", recipient
|
|
|
290
290
|
}
|
|
291
291
|
: undefined,
|
|
292
292
|
// only populate payload for custom tx
|
|
293
|
-
payload:
|
|
293
|
+
payload: metadata.type === "custom"
|
|
294
294
|
? {
|
|
295
295
|
amount: dstAmount,
|
|
296
296
|
data: encodedData,
|
|
@@ -301,7 +301,7 @@ function AnySpendCustom({ isMainnet = true, loadOrder, mode = "modal", recipient
|
|
|
301
301
|
: undefined,
|
|
302
302
|
};
|
|
303
303
|
if (onramp) {
|
|
304
|
-
(0, invariant_1.default)(srcToken.address ===
|
|
304
|
+
(0, invariant_1.default)(srcToken.address === constants_1.USDC_BASE.address, "Selected src token is not USDC");
|
|
305
305
|
(0, invariant_1.default)(srcChainId === chains_1.base.id, "Selected src chain is not base");
|
|
306
306
|
void createOnrampOrder({
|
|
307
307
|
...createOrderParams,
|
|
@@ -359,11 +359,11 @@ function AnySpendCustom({ isMainnet = true, loadOrder, mode = "modal", recipient
|
|
|
359
359
|
opacity: hasMounted ? 1 : 0,
|
|
360
360
|
y: hasMounted ? 0 : 20,
|
|
361
361
|
filter: hasMounted ? "blur(0px)" : "blur(10px)",
|
|
362
|
-
}, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: "flex w-full items-center justify-between gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-b3-react-foreground", children: orderType ===
|
|
362
|
+
}, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: "flex w-full items-center justify-between gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-b3-react-foreground", children: orderType === "swap"
|
|
363
363
|
? "Recipient"
|
|
364
|
-
: orderType ===
|
|
364
|
+
: orderType === "mint_nft"
|
|
365
365
|
? "Receive NFT at"
|
|
366
|
-
: orderType ===
|
|
366
|
+
: orderType === "join_tournament"
|
|
367
367
|
? "Join for"
|
|
368
368
|
: "Recipient" }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)(react_2.Button, { variant: "outline", className: "w-full justify-between border-none p-0", onClick: () => setIsRecipientModalOpen(true), children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [recipientImageUrl && ((0, jsx_runtime_1.jsx)("img", { src: recipientImageUrl, alt: recipientImageUrl, className: "bg-b3-react-foreground size-7 rounded-full object-cover opacity-100" })), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-start gap-1", children: [recipientEnsName && (0, jsx_runtime_1.jsxs)("span", { children: ["@", recipientEnsName] }), (0, jsx_runtime_1.jsx)("span", { children: (0, centerTruncate_1.default)(recipientAddress) })] })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRightCircle, { className: "ml-2 size-4 shrink-0 opacity-50" })] }) })] })) : null;
|
|
369
369
|
const historyView = ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("mx-auto flex w-full max-w-2xl flex-col items-center p-5", mode === "modal" && "bg-b3-react-background"), children: (0, jsx_runtime_1.jsx)(OrderHistory_1.OrderHistory, { mode: mode, onBack: () => {
|
|
@@ -394,10 +394,10 @@ function AnySpendCustom({ isMainnet = true, loadOrder, mode = "modal", recipient
|
|
|
394
394
|
opacity: hasMounted ? 1 : 0,
|
|
395
395
|
y: hasMounted ? 0 : 20,
|
|
396
396
|
filter: hasMounted ? "blur(0px)" : "blur(10px)",
|
|
397
|
-
}, transition: { duration: 0.3, delay: 0.3, ease: "easeInOut" }, className: "flex w-full flex-col gap-2", children: (0, jsx_runtime_1.jsx)(react_2.ShinyButton, { accentColor: "hsl(var(--as-brand))", textColor: "text-white", disabled: isCreatingOrder || isLoadingAnyspendQuote || !anyspendQuote, onClick: () => handleConfirmOrder(), className: "relative w-full", children: isCreatingOrder ? ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "size-4 animate-spin" }), (0, jsx_runtime_1.jsx)("span", { children: "Creating order..." })] })) : isLoadingAnyspendQuote ? ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "size-4 animate-spin" }), (0, jsx_runtime_1.jsx)("span", { children: "Loading quote..." })] })) : anyspendQuote ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { children: "Checkout" }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRightCircle, { className: "absolute right-0 top-1/2 size-6 -translate-y-1/2 opacity-70" })] })) : ("No quote found") }) }) })] }) }), (0, jsx_runtime_1.jsx)(react_2.TabsContent, { value: "fiat", children: (0, jsx_runtime_1.jsx)("div", { className: "mt-6 flex w-full flex-col gap-6", children: (0, jsx_runtime_1.jsx)(PanelOnrampPayment_1.PanelOnrampPayment, { srcAmountOnRamp: anyspendQuote?.data?.currencyIn?.amountUsd || "0", recipientName: recipientEnsName, recipientAddress: recipientAddress, isMainnet: isMainnet, isBuyMode: false, selectedDstChainId: dstChainId, selectedDstToken: dstToken, anyspendQuote: anyspendQuote, globalAddress: currentWallet?.wallet?.address, onOrderCreated: (orderId) => setOrderId(orderId), onBack: () => setActiveTab("crypto"), orderType: orderType, nft:
|
|
398
|
-
? metadata.nftContract.type ===
|
|
397
|
+
}, transition: { duration: 0.3, delay: 0.3, ease: "easeInOut" }, className: "flex w-full flex-col gap-2", children: (0, jsx_runtime_1.jsx)(react_2.ShinyButton, { accentColor: "hsl(var(--as-brand))", textColor: "text-white", disabled: isCreatingOrder || isLoadingAnyspendQuote || !anyspendQuote, onClick: () => handleConfirmOrder(), className: "relative w-full", children: isCreatingOrder ? ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "size-4 animate-spin" }), (0, jsx_runtime_1.jsx)("span", { children: "Creating order..." })] })) : isLoadingAnyspendQuote ? ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "size-4 animate-spin" }), (0, jsx_runtime_1.jsx)("span", { children: "Loading quote..." })] })) : anyspendQuote ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { children: "Checkout" }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRightCircle, { className: "absolute right-0 top-1/2 size-6 -translate-y-1/2 opacity-70" })] })) : ("No quote found") }) }) })] }) }), (0, jsx_runtime_1.jsx)(react_2.TabsContent, { value: "fiat", children: (0, jsx_runtime_1.jsx)("div", { className: "mt-6 flex w-full flex-col gap-6", children: (0, jsx_runtime_1.jsx)(PanelOnrampPayment_1.PanelOnrampPayment, { srcAmountOnRamp: anyspendQuote?.data?.currencyIn?.amountUsd || "0", recipientName: recipientEnsName, recipientAddress: recipientAddress, isMainnet: isMainnet, isBuyMode: false, selectedDstChainId: dstChainId, selectedDstToken: dstToken, anyspendQuote: anyspendQuote, globalAddress: currentWallet?.wallet?.address, onOrderCreated: (orderId) => setOrderId(orderId), onBack: () => setActiveTab("crypto"), orderType: orderType, nft: metadata.type === "mint_nft"
|
|
398
|
+
? metadata.nftContract.type === "erc1155"
|
|
399
399
|
? {
|
|
400
|
-
type:
|
|
400
|
+
type: "erc1155",
|
|
401
401
|
contractAddress: metadata.nftContract.contractAddress,
|
|
402
402
|
tokenId: metadata.nftContract.tokenId,
|
|
403
403
|
imageUrl: metadata.nftContract.imageUrl,
|
|
@@ -406,14 +406,14 @@ function AnySpendCustom({ isMainnet = true, loadOrder, mode = "modal", recipient
|
|
|
406
406
|
price: dstAmount,
|
|
407
407
|
}
|
|
408
408
|
: {
|
|
409
|
-
type:
|
|
409
|
+
type: "erc721",
|
|
410
410
|
contractAddress: metadata.nftContract.contractAddress,
|
|
411
411
|
name: metadata.nftContract.name,
|
|
412
412
|
description: metadata.nftContract.description,
|
|
413
413
|
imageUrl: metadata.nftContract.imageUrl,
|
|
414
414
|
price: dstAmount,
|
|
415
415
|
}
|
|
416
|
-
: undefined, payload:
|
|
416
|
+
: undefined, payload: metadata.type === "custom"
|
|
417
417
|
? {
|
|
418
418
|
...metadata,
|
|
419
419
|
amount: dstAmount,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { components } from "../../../anyspend/types/api";
|
|
2
2
|
export declare function AnySpendNFT({ isMainnet, loadOrder, mode, recipientAddress, nftContract, onSuccess, }: {
|
|
3
3
|
isMainnet?: boolean;
|
|
4
4
|
loadOrder?: string;
|
|
5
5
|
mode?: "modal" | "page";
|
|
6
6
|
recipientAddress?: string;
|
|
7
|
-
nftContract: NftContract;
|
|
7
|
+
nftContract: components["schemas"]["NftContract"];
|
|
8
8
|
onSuccess?: (txHash?: string) => void;
|
|
9
9
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -16,8 +16,8 @@ function AnySpendNFT({ isMainnet = true, loadOrder, mode = "modal", recipientAdd
|
|
|
16
16
|
const header = ({ anyspendPrice, isLoadingAnyspendPrice, }) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "relative size-[200px]", children: [(0, jsx_runtime_1.jsx)("div", { className: "absolute inset-0 scale-95 bg-black/30 blur-md" }), (0, jsx_runtime_1.jsxs)(react_1.GlareCard, { className: "overflow-hidden", children: [(0, jsx_runtime_1.jsx)("img", { src: (0, ipfs_1.getIpfsUrl)(nftContract.imageUrl), alt: nftContract.name, className: "size-full object-cover" }), (0, jsx_runtime_1.jsx)("div", { className: "absolute inset-0 rounded-xl border border-white/10" })] }), (0, jsx_runtime_1.jsx)(DropdownMenu, { nftContract: nftContract })] }), (0, jsx_runtime_1.jsxs)("div", { className: "from-b3-react-background to-as-on-surface-1 mt-[-100px] w-full rounded-t-lg bg-gradient-to-t", children: [(0, jsx_runtime_1.jsx)("div", { className: "h-[100px] w-full" }), (0, jsx_runtime_1.jsxs)("div", { className: "mb-1 flex w-full flex-col items-center gap-2 p-5", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-sf-rounded text-2xl font-semibold", children: nftContract.name }), (0, jsx_runtime_1.jsx)("div", { className: "flex w-fit items-center gap-1", children: anyspendPrice ? ((0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, { mode: "wait", children: (0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("text-as-primary group flex items-center text-3xl font-semibold transition-all", {
|
|
17
17
|
"opacity-0": isLoadingAnyspendPrice,
|
|
18
18
|
}), children: (0, number_1.formatDisplayNumber)(anyspendPrice?.data?.currencyIn?.amountUsd, { style: "currency" }) }) })) : ((0, jsx_runtime_1.jsx)("div", { className: "h-[36px] w-full" })) })] })] })] }));
|
|
19
|
-
return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { isMainnet: isMainnet, loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, orderType:
|
|
20
|
-
type:
|
|
19
|
+
return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { isMainnet: isMainnet, loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, orderType: "mint_nft", dstChainId: nftContract.chainId, dstToken: nftContract.currency, dstAmount: nftContract.price, contractAddress: nftContract.contractAddress, encodedData: "0x", metadata: {
|
|
20
|
+
type: "mint_nft",
|
|
21
21
|
nftContract: nftContract,
|
|
22
22
|
}, header: header, onSuccess: onSuccess }));
|
|
23
23
|
}
|
|
@@ -255,8 +255,8 @@ function AnySpendStakeB3({ isMainnet = true, loadOrder, mode = "modal", recipien
|
|
|
255
255
|
}, className: "bg-as-brand hover:bg-as-brand/90 text-as-primary h-14 w-full rounded-xl text-lg font-medium", children: "Done" })] })] }) }));
|
|
256
256
|
}
|
|
257
257
|
const encodedData = generateEncodedDataForStakingB3(userStakeAmount, recipientAddress);
|
|
258
|
-
return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { isMainnet: isMainnet, loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, orderType:
|
|
259
|
-
type:
|
|
258
|
+
return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { isMainnet: isMainnet, loadOrder: loadOrder, mode: mode, recipientAddress: recipientAddress, orderType: "custom", dstChainId: chains_1.base.id, dstToken: anyspend_1.B3_TOKEN, dstAmount: userStakeAmount, contractAddress: ERC20Staking, encodedData: encodedData, metadata: {
|
|
259
|
+
type: "custom",
|
|
260
260
|
action: "stake B3",
|
|
261
261
|
}, header: header, onSuccess: onSuccess, showRecipient: true }));
|
|
262
262
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { components } from "../../../anyspend/types/api";
|
|
2
2
|
type AnySpendTournamentProps = {
|
|
3
3
|
isMainnet?: boolean;
|
|
4
4
|
mode?: "modal" | "page";
|
|
@@ -7,8 +7,8 @@ type AnySpendTournamentProps = {
|
|
|
7
7
|
loadOrder?: string;
|
|
8
8
|
tournamentChainId: number;
|
|
9
9
|
tournamentContractAddress: string;
|
|
10
|
-
tournamentMetadata: Tournament;
|
|
11
|
-
tournamentEntryToken: Token;
|
|
10
|
+
tournamentMetadata: components["schemas"]["Tournament"];
|
|
11
|
+
tournamentEntryToken: components["schemas"]["Token"];
|
|
12
12
|
tournamentEntryFee: string;
|
|
13
13
|
onSuccess?: () => void;
|
|
14
14
|
} | {
|
|
@@ -18,8 +18,8 @@ type AnySpendTournamentProps = {
|
|
|
18
18
|
loadOrder?: string;
|
|
19
19
|
tournamentChainId: number;
|
|
20
20
|
tournamentContractAddress: string;
|
|
21
|
-
tournamentMetadata: Tournament;
|
|
22
|
-
tournamentFundToken: Token;
|
|
21
|
+
tournamentMetadata: components["schemas"]["Tournament"];
|
|
22
|
+
tournamentFundToken: components["schemas"]["Token"];
|
|
23
23
|
tournamentFundAmount: string;
|
|
24
24
|
onSuccess?: () => void;
|
|
25
25
|
};
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AnySpendTournament = AnySpendTournament;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const anyspend_1 = require("../../../anyspend");
|
|
6
5
|
const utils_1 = require("../../../shared/utils");
|
|
7
6
|
const number_1 = require("../../../shared/utils/number");
|
|
8
7
|
const framer_motion_1 = require("framer-motion");
|
|
@@ -14,8 +13,8 @@ function AnySpendTournament(props) {
|
|
|
14
13
|
const header = ({ anyspendPrice, isLoadingAnyspendPrice, }) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "z-10 mt-[-100px] flex h-[270px] w-full items-end justify-center", children: (0, jsx_runtime_1.jsx)("img", { src: "https://cdn.b3.fun/tournament-play.svg", alt: "Tournament Play", className: "h-[200px] w-[360px] object-cover object-center" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "from-b3-react-background to-as-on-surface-1 mt-[-100px] w-full rounded-t-lg bg-gradient-to-t", children: [(0, jsx_runtime_1.jsx)("div", { className: "h-[100px] w-full" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex w-full flex-col items-center gap-1 p-6 pt-0", children: [(0, jsx_runtime_1.jsxs)("span", { className: "font-sf-rounded text-center text-lg font-semibold", children: [action === "join" ? "Pay entry fee to join " : "Pay to fund ", " ", tournamentMetadata.name] }), (0, jsx_runtime_1.jsx)("div", { className: "mt-2 flex w-fit items-center gap-1", children: anyspendPrice ? ((0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, { mode: "wait", children: (0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)("text-as-primary group flex items-center text-2xl font-semibold transition-all", {
|
|
15
14
|
"opacity-0": isLoadingAnyspendPrice,
|
|
16
15
|
}), children: [(0, number_1.formatDisplayNumber)(anyspendPrice?.data?.currencyIn?.amountUsd, { style: "currency" }), " (", (0, number_1.formatTokenAmount)(BigInt(dstAmount), dstToken.decimals, 6, true), " ", dstToken.symbol, ")"] }) })) : ((0, jsx_runtime_1.jsx)("div", { className: "h-[32px] w-full" })) })] })] })] }));
|
|
17
|
-
return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { isMainnet: isMainnet, loadOrder: loadOrder, mode: mode, recipientAddress: action === "join" ? props.joinFor : undefined, orderType: action === "join" ?
|
|
18
|
-
type: action === "join" ?
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { isMainnet: isMainnet, loadOrder: loadOrder, mode: mode, recipientAddress: action === "join" ? props.joinFor : undefined, orderType: action === "join" ? "join_tournament" : "fund_tournament", dstChainId: tournamentChainId, dstToken: dstToken, dstAmount: dstAmount, contractAddress: tournamentContractAddress, encodedData: "0x", metadata: {
|
|
17
|
+
type: action === "join" ? "join_tournament" : "fund_tournament",
|
|
19
18
|
tournament: tournamentMetadata,
|
|
20
19
|
}, header: header, onSuccess: onSuccess, showRecipient: action === "join" }));
|
|
21
20
|
}
|
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.AnyspendSignatureMint = AnyspendSignatureMint;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const anyspend_1 = require("../../../anyspend");
|
|
9
8
|
const react_1 = require("../../../global-account/react");
|
|
10
9
|
const debug_1 = __importDefault(require("../../../shared/utils/debug"));
|
|
11
10
|
const react_2 = require("react");
|
|
@@ -43,7 +42,6 @@ function generateEncodedDataForSignatureMint(signatureData) {
|
|
|
43
42
|
return encodedData;
|
|
44
43
|
}
|
|
45
44
|
function AnyspendSignatureMint({ loadOrder, mode = "modal", signatureData, imageUrl, onSuccess, }) {
|
|
46
|
-
const hasMounted = (0, react_1.useHasMounted)();
|
|
47
45
|
// Get token data
|
|
48
46
|
const { data: tokenData, isError: isTokenError, isLoading, } = (0, react_1.useTokenData)(signatureData.collection.chainId, signatureData.collection.signatureRequestBody?.currency);
|
|
49
47
|
// Convert token data to AnySpend Token type
|
|
@@ -74,8 +72,8 @@ function AnyspendSignatureMint({ loadOrder, mode = "modal", signatureData, image
|
|
|
74
72
|
}
|
|
75
73
|
const encodedData = generateEncodedDataForSignatureMint(signatureData);
|
|
76
74
|
const price = (0, viem_1.parseEther)(signatureData.payload.price?.toString() || "0");
|
|
77
|
-
return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { isMainnet: true, loadOrder: loadOrder, mode: mode, recipientAddress: signatureData.payload.to, orderType:
|
|
78
|
-
type:
|
|
75
|
+
return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.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: {
|
|
76
|
+
type: "custom",
|
|
79
77
|
action: "Signature Mint",
|
|
80
78
|
}, header: header, onSuccess: onSuccess, showRecipient: true }));
|
|
81
79
|
}
|