@b3dotfun/sdk 0.0.4-alpha.2 → 0.0.5-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/dist/cjs/anyspend/index.js +0 -1
- package/dist/cjs/shared/constants/chains/supported.d.ts +2 -6
- package/dist/cjs/shared/constants/chains/supported.js +6 -3
- package/dist/esm/anyspend/index.js +13 -14
- package/dist/esm/anyspend/index.native.js +13 -13
- package/dist/esm/anyspend/react/components/AnySpend.js +13 -13
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +8 -8
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +14 -14
- package/dist/esm/anyspend/react/components/AnySpendNFT.js +7 -7
- package/dist/esm/anyspend/react/components/AnySpendNFTButton.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +7 -7
- package/dist/esm/anyspend/react/components/AnySpendTournament.js +4 -4
- package/dist/esm/anyspend/react/components/common/OrderDetails.js +6 -6
- package/dist/esm/anyspend/react/components/common/OrderHistory.js +3 -3
- package/dist/esm/anyspend/react/components/common/OrderHistoryItem.js +4 -4
- package/dist/esm/anyspend/react/components/common/OrderStatus.js +2 -2
- package/dist/esm/anyspend/react/components/common/OrderToken.js +6 -6
- package/dist/esm/anyspend/react/components/common/OrderTokenAmount.js +4 -4
- package/dist/esm/anyspend/react/components/common/PanelOnramp.js +3 -3
- package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.js +3 -3
- package/dist/esm/anyspend/react/components/common/PaymentMethodIcons.js +1 -1
- package/dist/esm/anyspend/react/components/common/PaymentOneClick.js +3 -3
- package/dist/esm/anyspend/react/components/common/PaymentStripeWeb2.js +6 -6
- package/dist/esm/anyspend/react/components/common/PaymentVendorUI.js +3 -3
- package/dist/esm/anyspend/react/components/common/TokenBalance.js +1 -1
- package/dist/esm/anyspend/react/components/index.js +15 -15
- package/dist/esm/anyspend/react/components/modals/EnterRecipientModal.js +1 -1
- package/dist/esm/anyspend/react/components/webview/WebviewOnrampPayment.js +3 -3
- package/dist/esm/anyspend/react/hooks/index.js +13 -13
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOnrampOrder.js +3 -3
- package/dist/esm/anyspend/react/hooks/useAnyspendCreateOrder.js +2 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendOrderAndTransactions.js +1 -1
- package/dist/esm/anyspend/react/hooks/useAnyspendOrderHistory.js +1 -1
- package/dist/esm/anyspend/react/hooks/useAnyspendQuote.js +2 -2
- package/dist/esm/anyspend/react/hooks/useAnyspendSendPermitData.js +1 -1
- package/dist/esm/anyspend/react/hooks/useAnyspendTokens.js +1 -1
- package/dist/esm/anyspend/react/hooks/useCoinbaseOnrampOptions.js +1 -1
- package/dist/esm/anyspend/react/hooks/useGeoOnrampOptions.js +3 -3
- package/dist/esm/anyspend/react/hooks/usePermitData.js +2 -2
- package/dist/esm/anyspend/react/hooks/useStripeClientSecret.js +1 -1
- package/dist/esm/anyspend/react/hooks/useStripeSupport.js +1 -1
- package/dist/esm/anyspend/react/index.js +3 -3
- package/dist/esm/anyspend/services/anyspend.js +3 -3
- package/dist/esm/anyspend/types/custom.js +1 -1
- package/dist/esm/anyspend/types/index.js +13 -13
- package/dist/esm/anyspend/types/nft.js +1 -1
- package/dist/esm/anyspend/types/order.js +6 -6
- package/dist/esm/anyspend/types/req-res/createOrder.js +6 -6
- package/dist/esm/anyspend/types/req-res/getOrderAndTransactions.js +2 -2
- package/dist/esm/anyspend/types/req-res/getOrderHistory.js +1 -1
- package/dist/esm/anyspend/types/req-res/getQuote.js +3 -3
- package/dist/esm/anyspend/types/req-res/index.js +8 -8
- package/dist/esm/anyspend/types/req-res/sendPermitData.js +1 -1
- package/dist/esm/anyspend/types/swap.js +1 -1
- package/dist/esm/anyspend/types/tournament.js +1 -1
- package/dist/esm/anyspend/types/transaction.js +1 -1
- package/dist/esm/anyspend/utils/chain.js +3 -3
- package/dist/esm/anyspend/utils/format.js +1 -1
- package/dist/esm/anyspend/utils/index.js +8 -8
- package/dist/esm/anyspend/utils/orderPayload.js +2 -2
- package/dist/esm/anyspend/utils/token.js +1 -1
- package/dist/esm/global-account/app.js +1 -1
- package/dist/esm/global-account/index.js +1 -1
- package/dist/esm/global-account/index.native.js +1 -1
- package/dist/esm/global-account/react/components/B3DynamicModal.js +10 -10
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +4 -4
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.js +1 -1
- package/dist/esm/global-account/react/components/B3Provider/useB3.js +1 -1
- package/dist/esm/global-account/react/components/ManageAccount/ManageAccount.js +4 -4
- package/dist/esm/global-account/react/components/MintButton/MintButton.js +2 -2
- package/dist/esm/global-account/react/components/ProfileAvatar.js +1 -1
- package/dist/esm/global-account/react/components/RequestPermissions/RequestPermissions.js +4 -4
- package/dist/esm/global-account/react/components/RequestPermissions/RequestPermissionsButton.js +1 -1
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3.js +2 -2
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +5 -5
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +2 -2
- package/dist/esm/global-account/react/components/SignInWithB3/components/AuthButton.js +2 -2
- package/dist/esm/global-account/react/components/SignInWithB3/components/PermissionItem.js +1 -1
- package/dist/esm/global-account/react/components/SignInWithB3/components/WalletRow.js +1 -1
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStep.js +3 -3
- package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +2 -2
- package/dist/esm/global-account/react/components/StyleRoot.js +1 -1
- package/dist/esm/global-account/react/components/Transak/TransakModal.js +2 -2
- package/dist/esm/global-account/react/components/custom/Button.js +1 -1
- package/dist/esm/global-account/react/components/custom/ClientOnly.js +1 -1
- package/dist/esm/global-account/react/components/index.js +45 -45
- package/dist/esm/global-account/react/components/ui/Loading.js +1 -1
- package/dist/esm/global-account/react/components/ui/ShinyButton.js +3 -3
- package/dist/esm/global-account/react/components/ui/TabSystem.js +2 -2
- package/dist/esm/global-account/react/components/ui/Tabs.js +1 -1
- package/dist/esm/global-account/react/components/ui/badge.js +1 -1
- package/dist/esm/global-account/react/components/ui/button.js +1 -1
- package/dist/esm/global-account/react/components/ui/command.js +2 -2
- package/dist/esm/global-account/react/components/ui/dialog.js +1 -1
- package/dist/esm/global-account/react/components/ui/drawer.js +1 -1
- package/dist/esm/global-account/react/components/ui/glare-card-rounded.js +1 -1
- package/dist/esm/global-account/react/components/ui/glare-card.js +1 -1
- package/dist/esm/global-account/react/components/ui/input.js +1 -1
- package/dist/esm/global-account/react/components/ui/popover.js +2 -2
- package/dist/esm/global-account/react/components/ui/scroll-area.js +1 -1
- package/dist/esm/global-account/react/components/ui/skeleton.js +1 -1
- package/dist/esm/global-account/react/components/ui/text-loop.js +1 -1
- package/dist/esm/global-account/react/components/ui/text-shimmer.js +1 -1
- package/dist/esm/global-account/react/components/ui/tooltip.js +1 -1
- package/dist/esm/global-account/react/components/ui/transition-panel.js +1 -1
- package/dist/esm/global-account/react/hooks/index.js +35 -35
- package/dist/esm/global-account/react/hooks/useAccountAssets.js +1 -1
- package/dist/esm/global-account/react/hooks/useAccountWallet.js +3 -3
- package/dist/esm/global-account/react/hooks/useAddTWSessionKey.js +1 -1
- package/dist/esm/global-account/react/hooks/useAuthentication.js +8 -8
- package/dist/esm/global-account/react/hooks/useB3BalanceFromAddresses.js +2 -2
- package/dist/esm/global-account/react/hooks/useBestTransactionPath.js +2 -2
- package/dist/esm/global-account/react/hooks/useBsmntProfile.js +1 -1
- package/dist/esm/global-account/react/hooks/useChainSwitchWithAction.js +2 -2
- package/dist/esm/global-account/react/hooks/useClaim.js +1 -1
- package/dist/esm/global-account/react/hooks/useConnect.js +3 -3
- package/dist/esm/global-account/react/hooks/useGetAllTWSigners.js +1 -1
- package/dist/esm/global-account/react/hooks/useGetGeo.js +1 -1
- package/dist/esm/global-account/react/hooks/useHandleConnectWithPrivy.js +2 -2
- package/dist/esm/global-account/react/hooks/useIsMobile.js +1 -1
- package/dist/esm/global-account/react/hooks/useMediaQuery.js +1 -1
- package/dist/esm/global-account/react/hooks/useNativeBalance.js +2 -2
- package/dist/esm/global-account/react/hooks/useOnchainName.js +2 -2
- package/dist/esm/global-account/react/hooks/useOneBalance.js +2 -2
- package/dist/esm/global-account/react/hooks/useQueryB3.js +1 -1
- package/dist/esm/global-account/react/hooks/useQueryBSMNT.js +1 -1
- package/dist/esm/global-account/react/hooks/useRemoveSessionKey.js +1 -1
- package/dist/esm/global-account/react/hooks/useSiwe.js +2 -2
- package/dist/esm/global-account/react/hooks/useTokenBalance.js +4 -4
- package/dist/esm/global-account/react/hooks/useTokenBalancesByChain.js +4 -4
- package/dist/esm/global-account/react/hooks/useTokenFromUrl.js +1 -1
- package/dist/esm/global-account/react/hooks/useTokenPrice.js +1 -1
- package/dist/esm/global-account/react/hooks/useTokenPriceWithFallback.js +2 -2
- package/dist/esm/global-account/react/hooks/useTokensFromAddress.js +1 -1
- package/dist/esm/global-account/react/hooks/useURLParams.js +1 -1
- package/dist/esm/global-account/react/index.js +3 -3
- package/dist/esm/global-account/react/index.native.js +10 -10
- package/dist/esm/global-account/react/stores/index.js +2 -2
- package/dist/esm/shared/constants/chains/supported.d.ts +2 -6
- package/dist/esm/shared/constants/chains/supported.js +6 -3
- package/dist/esm/shared/thirdweb/generated/@tanstack/react-query.gen.js +2 -2
- package/dist/esm/shared/thirdweb/generated/index.js +2 -2
- package/dist/esm/shared/thirdweb/generated/sdk.gen.js +1 -1
- package/dist/esm/shared/thirdweb/initiateClient.js +2 -2
- package/dist/esm/shared/utils/chains.js +1 -1
- package/dist/esm/shared/utils/fetchBalances.js +2 -2
- package/dist/esm/shared/utils/index.js +1 -1
- package/dist/esm/shared/utils/insights.js +1 -1
- package/dist/esm/shared/utils/payment.utils.js +2 -2
- package/dist/esm/shared/utils/simplehash.js +4 -4
- package/dist/esm/shared/utils/thirdweb-insights.js +2 -2
- package/dist/esm/shared/utils/thirdweb.js +1 -1
- package/dist/types/shared/constants/chains/supported.d.ts +2 -6
- package/package.json +2 -2
- package/src/anyspend/index.ts +0 -2
- package/src/shared/constants/chains/supported.ts +8 -4
|
@@ -53,12 +53,8 @@ export declare function getCoingeckoChainInfo(chainId: number): {
|
|
|
53
53
|
name: string;
|
|
54
54
|
native_coin_id: string;
|
|
55
55
|
};
|
|
56
|
+
export declare const b3MainnetThirdWeb: ThirdwebChain;
|
|
57
|
+
export declare const b3TestnetThirdWeb: ThirdwebChain;
|
|
56
58
|
export declare const b3Mainnet: import("viem").Chain | undefined;
|
|
57
59
|
export declare const b3Testnet: import("viem").Chain | undefined;
|
|
58
60
|
export declare const baseMainnet: import("viem").Chain | undefined;
|
|
59
|
-
export declare const b3MainnetThirdWeb: Readonly<import("thirdweb/dist/types/chains/types").ChainOptions & {
|
|
60
|
-
rpc: string;
|
|
61
|
-
}> | undefined;
|
|
62
|
-
export declare const b3TestnetThirdWeb: Readonly<import("thirdweb/dist/types/chains/types").ChainOptions & {
|
|
63
|
-
rpc: string;
|
|
64
|
-
}> | undefined;
|
|
@@ -3,9 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.baseMainnet = exports.b3Testnet = exports.b3Mainnet = exports.b3TestnetThirdWeb = exports.b3MainnetThirdWeb = exports.coingeckoChains = exports.supportedChainNetworks = exports.supportedChainsTW = exports.supportedChains = void 0;
|
|
7
7
|
exports.getCoingeckoChainInfo = getCoingeckoChainInfo;
|
|
8
8
|
const chain_transformers_1 = require("../../../shared/utils/chain-transformers");
|
|
9
|
+
const invariant_1 = __importDefault(require("invariant"));
|
|
9
10
|
// Import the JSON directly
|
|
10
11
|
// @ts-ignore
|
|
11
12
|
const chain_networks_json_1 = __importDefault(require("../../generated/chain-networks.json"));
|
|
@@ -34,8 +35,10 @@ exports.coingeckoChains = coingecko_chains_json_1.default;
|
|
|
34
35
|
function getCoingeckoChainInfo(chainId) {
|
|
35
36
|
return exports.coingeckoChains[chainId];
|
|
36
37
|
}
|
|
38
|
+
exports.b3MainnetThirdWeb = exports.supportedChainsTW.find(chain => chain.id === 8333);
|
|
39
|
+
(0, invariant_1.default)(exports.b3MainnetThirdWeb, "B3 mainnet chain not found in supported chains TW");
|
|
40
|
+
exports.b3TestnetThirdWeb = exports.supportedChainsTW.find(chain => chain.id === 1993);
|
|
41
|
+
(0, invariant_1.default)(exports.b3TestnetThirdWeb, "B3 testnet chain not found in supported chains TW");
|
|
37
42
|
exports.b3Mainnet = exports.supportedChains.find(chain => chain.id === 8333);
|
|
38
43
|
exports.b3Testnet = exports.supportedChains.find(chain => chain.id === 1993);
|
|
39
44
|
exports.baseMainnet = exports.supportedChains.find(chain => chain.id === 8453);
|
|
40
|
-
exports.b3MainnetThirdWeb = exports.supportedChainsTW.find(chain => chain.id === 8333);
|
|
41
|
-
exports.b3TestnetThirdWeb = exports.supportedChainsTW.find(chain => chain.id === 1993);
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
// Export all hooks
|
|
2
|
-
export * from "./react/hooks";
|
|
2
|
+
export * from "./react/hooks/index.js";
|
|
3
3
|
// Providers
|
|
4
|
-
export * from "./react/providers/AnyspendProvider";
|
|
4
|
+
export * from "./react/providers/AnyspendProvider.js";
|
|
5
5
|
// Types
|
|
6
|
-
export * from "./types";
|
|
6
|
+
export * from "./types/index.js";
|
|
7
7
|
// Utils
|
|
8
|
-
export * from "./utils/address";
|
|
9
|
-
export * from "./utils/chain";
|
|
10
|
-
export * from "./utils/format";
|
|
11
|
-
export * from "./utils/json";
|
|
12
|
-
export * from "./utils/number";
|
|
13
|
-
export * from "./utils/string";
|
|
14
|
-
export * from "./utils/token";
|
|
8
|
+
export * from "./utils/address.js";
|
|
9
|
+
export * from "./utils/chain.js";
|
|
10
|
+
export * from "./utils/format.js";
|
|
11
|
+
export * from "./utils/json.js";
|
|
12
|
+
export * from "./utils/number.js";
|
|
13
|
+
export * from "./utils/string.js";
|
|
14
|
+
export * from "./utils/token.js";
|
|
15
15
|
// Constants
|
|
16
|
-
export * from "./constants";
|
|
16
|
+
export * from "./constants/index.js";
|
|
17
17
|
// Abis
|
|
18
|
-
export * from "./abis/abi-usdc-base";
|
|
19
|
-
export * from "./abis/erc20-staking";
|
|
20
|
-
console.log(`Test CICD`);
|
|
18
|
+
export * from "./abis/abi-usdc-base.js";
|
|
19
|
+
export * from "./abis/erc20-staking.js";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
// Export all hooks
|
|
2
|
-
export * from "./react/hooks";
|
|
2
|
+
export * from "./react/hooks/index.js";
|
|
3
3
|
// Providers
|
|
4
|
-
export * from "./react/providers/AnyspendProvider";
|
|
4
|
+
export * from "./react/providers/AnyspendProvider.js";
|
|
5
5
|
// Types
|
|
6
|
-
export * from "./types";
|
|
6
|
+
export * from "./types/index.js";
|
|
7
7
|
// Utils
|
|
8
|
-
export * from "./utils/address";
|
|
9
|
-
export * from "./utils/chain";
|
|
10
|
-
export * from "./utils/format";
|
|
11
|
-
export * from "./utils/json";
|
|
12
|
-
export * from "./utils/number";
|
|
13
|
-
export * from "./utils/string";
|
|
14
|
-
export * from "./utils/token";
|
|
8
|
+
export * from "./utils/address.js";
|
|
9
|
+
export * from "./utils/chain.js";
|
|
10
|
+
export * from "./utils/format.js";
|
|
11
|
+
export * from "./utils/json.js";
|
|
12
|
+
export * from "./utils/number.js";
|
|
13
|
+
export * from "./utils/string.js";
|
|
14
|
+
export * from "./utils/token.js";
|
|
15
15
|
// Constants
|
|
16
|
-
export * from "./constants";
|
|
16
|
+
export * from "./constants/index.js";
|
|
17
17
|
// Abis
|
|
18
|
-
export * from "./abis/abi-usdc-base";
|
|
19
|
-
export * from "./abis/erc20-staking";
|
|
18
|
+
export * from "./abis/abi-usdc-base.js";
|
|
19
|
+
export * from "./abis/erc20-staking.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { getDefaultToken, OrderType, TradeType, USDC_BASE, useAnyspendCreateOrder, useAnyspendOrderAndTransactions, useAnyspendQuote } from "../../../anyspend";
|
|
4
|
-
import { Button, ShinyButton, StyleRoot, TransitionPanel, useAccountWallet, useOnchainName, useRouter, useSearchParamsSSR, useTokenData, useTokenFromUrl } from "../../../global-account/react";
|
|
5
|
-
import { cn } from "../../../shared/utils/cn";
|
|
6
|
-
import { shortenAddress } from "../../../shared/utils/formatAddress";
|
|
7
|
-
import { formatDisplayNumber, formatTokenAmount } from "../../../shared/utils/number";
|
|
3
|
+
import { getDefaultToken, OrderType, TradeType, USDC_BASE, useAnyspendCreateOrder, useAnyspendOrderAndTransactions, useAnyspendQuote } from "../../../anyspend/index.js";
|
|
4
|
+
import { Button, ShinyButton, StyleRoot, TransitionPanel, useAccountWallet, useOnchainName, useRouter, useSearchParamsSSR, useTokenData, useTokenFromUrl } from "../../../global-account/react/index.js";
|
|
5
|
+
import { cn } from "../../../shared/utils/cn.js";
|
|
6
|
+
import { shortenAddress } from "../../../shared/utils/formatAddress.js";
|
|
7
|
+
import { formatDisplayNumber, formatTokenAmount } from "../../../shared/utils/number.js";
|
|
8
8
|
import { motion } from "framer-motion";
|
|
9
9
|
import invariant from "invariant";
|
|
10
10
|
import { ArrowDown, ChevronRightCircle, ChevronsUpDown, CircleAlert, ClipboardIcon, HistoryIcon } from "lucide-react";
|
|
@@ -12,14 +12,14 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
|
12
12
|
import { toast } from "sonner";
|
|
13
13
|
import { parseUnits } from "viem";
|
|
14
14
|
import { b3Sepolia, base, mainnet, sepolia } from "viem/chains";
|
|
15
|
-
import { OrderDetails, OrderDetailsLoadingView } from "./common/OrderDetails";
|
|
16
|
-
import { OrderHistory } from "./common/OrderHistory";
|
|
17
|
-
import { OrderStatus } from "./common/OrderStatus";
|
|
18
|
-
import { OrderTokenAmount } from "./common/OrderTokenAmount";
|
|
19
|
-
import { PanelOnramp } from "./common/PanelOnramp";
|
|
20
|
-
import { PanelOnrampPayment } from "./common/PanelOnrampPayment";
|
|
21
|
-
import { TokenBalance } from "./common/TokenBalance";
|
|
22
|
-
import { EnterRecipientModal } from "./modals/EnterRecipientModal";
|
|
15
|
+
import { OrderDetails, OrderDetailsLoadingView } from "./common/OrderDetails.js";
|
|
16
|
+
import { OrderHistory } from "./common/OrderHistory.js";
|
|
17
|
+
import { OrderStatus } from "./common/OrderStatus.js";
|
|
18
|
+
import { OrderTokenAmount } from "./common/OrderTokenAmount.js";
|
|
19
|
+
import { PanelOnramp } from "./common/PanelOnramp.js";
|
|
20
|
+
import { PanelOnrampPayment } from "./common/PanelOnrampPayment.js";
|
|
21
|
+
import { TokenBalance } from "./common/TokenBalance.js";
|
|
22
|
+
import { EnterRecipientModal } from "./modals/EnterRecipientModal.js";
|
|
23
23
|
export var PanelView;
|
|
24
24
|
(function (PanelView) {
|
|
25
25
|
PanelView[PanelView["MAIN"] = 0] = "MAIN";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { B3_TOKEN, OrderType } from "../../../anyspend";
|
|
3
|
-
import { baseMainnet } from "../../../shared/constants/chains/supported";
|
|
4
|
-
import { EthIcon } from "./icons/EthIcon";
|
|
5
|
-
import { SolIcon } from "./icons/SolIcon";
|
|
6
|
-
import { UsdcIcon } from "./icons/USDCIcon";
|
|
7
|
-
import { StyleRoot } from "../../../global-account/react";
|
|
8
|
-
import { Button, GlareCardRounded, Input, TextLoop, useChainSwitchWithAction, useHasMounted, useTokenBalance, useModalStore } from "../../../global-account/react";
|
|
2
|
+
import { B3_TOKEN, OrderType } from "../../../anyspend/index.js";
|
|
3
|
+
import { baseMainnet } from "../../../shared/constants/chains/supported.js";
|
|
4
|
+
import { EthIcon } from "./icons/EthIcon.js";
|
|
5
|
+
import { SolIcon } from "./icons/SolIcon.js";
|
|
6
|
+
import { UsdcIcon } from "./icons/USDCIcon.js";
|
|
7
|
+
import { StyleRoot } from "../../../global-account/react/index.js";
|
|
8
|
+
import { Button, GlareCardRounded, Input, TextLoop, useChainSwitchWithAction, useHasMounted, useTokenBalance, useModalStore } from "../../../global-account/react/index.js";
|
|
9
9
|
import { motion } from "framer-motion";
|
|
10
10
|
import invariant from "invariant";
|
|
11
11
|
import { ArrowRight, Loader2 } from "lucide-react";
|
|
@@ -13,7 +13,7 @@ import { useCallback, useEffect, useState } from "react";
|
|
|
13
13
|
import { toast } from "sonner";
|
|
14
14
|
import { createPublicClient, encodeFunctionData, erc20Abi, formatUnits, http } from "viem";
|
|
15
15
|
import { useAccount, useWaitForTransactionReceipt, useWriteContract } from "wagmi";
|
|
16
|
-
import { AnySpendCustom } from "./AnySpendCustom";
|
|
16
|
+
import { AnySpendCustom } from "./AnySpendCustom.js";
|
|
17
17
|
const SPIN_WHEEL_ABI = [
|
|
18
18
|
{
|
|
19
19
|
inputs: [],
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { eqci, getDefaultToken, NftType, OrderStatus, OrderType, RELAY_ETH_ADDRESS, USDC_BASE, useAnyspendCreateOnrampOrder, useAnyspendCreateOrder, useAnyspendOrderAndTransactions, useAnyspendQuote, useAnyspendTokenList, useGeoOnrampOptions } from "../../../anyspend";
|
|
3
|
-
import { useB3, StyleRoot } from "../../../global-account/react";
|
|
4
|
-
import { Badge, Button, ShinyButton, Skeleton, Tabs, TabsContent, TabsList, TabTrigger, useAccountWallet, useBsmntProfile, useHasMounted, useRouter, useTokenBalancesByChain, useModalStore, useSearchParamsSSR } from "../../../global-account/react";
|
|
5
|
-
import { TextShimmer } from "../../../global-account/react";
|
|
6
|
-
import { TransitionPanel } from "../../../global-account/react";
|
|
7
|
-
import { cn } from "../../../shared/utils";
|
|
8
|
-
import centerTruncate from "../../../shared/utils/centerTruncate";
|
|
9
|
-
import { formatTokenAmount } from "../../../shared/utils/number";
|
|
10
|
-
import { simpleHashChainToChainName } from "../../../shared/utils/simplehash";
|
|
2
|
+
import { eqci, getDefaultToken, NftType, OrderStatus, OrderType, RELAY_ETH_ADDRESS, USDC_BASE, useAnyspendCreateOnrampOrder, useAnyspendCreateOrder, useAnyspendOrderAndTransactions, useAnyspendQuote, useAnyspendTokenList, useGeoOnrampOptions } from "../../../anyspend/index.js";
|
|
3
|
+
import { useB3, StyleRoot } from "../../../global-account/react/index.js";
|
|
4
|
+
import { Badge, Button, ShinyButton, Skeleton, Tabs, TabsContent, TabsList, TabTrigger, useAccountWallet, useBsmntProfile, useHasMounted, useRouter, useTokenBalancesByChain, useModalStore, useSearchParamsSSR } from "../../../global-account/react/index.js";
|
|
5
|
+
import { TextShimmer } from "../../../global-account/react/index.js";
|
|
6
|
+
import { TransitionPanel } from "../../../global-account/react/index.js";
|
|
7
|
+
import { cn } from "../../../shared/utils/index.js";
|
|
8
|
+
import centerTruncate from "../../../shared/utils/centerTruncate.js";
|
|
9
|
+
import { formatTokenAmount } from "../../../shared/utils/number.js";
|
|
10
|
+
import { simpleHashChainToChainName } from "../../../shared/utils/simplehash.js";
|
|
11
11
|
import { motion } from "framer-motion";
|
|
12
12
|
import invariant from "invariant";
|
|
13
13
|
import { ChevronRightCircle, Loader2 } from "lucide-react";
|
|
14
14
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
15
15
|
import { toast } from "sonner";
|
|
16
16
|
import { b3, base, baseSepolia } from "viem/chains";
|
|
17
|
-
import { OrderDetails } from "./common/OrderDetails";
|
|
18
|
-
import { OrderHistory } from "./common/OrderHistory";
|
|
19
|
-
import { OrderStatus as OrderStatusDisplay } from "./common/OrderStatus";
|
|
20
|
-
import { OrderToken } from "./common/OrderToken";
|
|
21
|
-
import { PanelOnrampPayment } from "./common/PanelOnrampPayment";
|
|
17
|
+
import { OrderDetails } from "./common/OrderDetails.js";
|
|
18
|
+
import { OrderHistory } from "./common/OrderHistory.js";
|
|
19
|
+
import { OrderStatus as OrderStatusDisplay } from "./common/OrderStatus.js";
|
|
20
|
+
import { OrderToken } from "./common/OrderToken.js";
|
|
21
|
+
import { PanelOnrampPayment } from "./common/PanelOnrampPayment.js";
|
|
22
22
|
var PanelView;
|
|
23
23
|
(function (PanelView) {
|
|
24
24
|
PanelView[PanelView["CONFIRM_ORDER"] = 0] = "CONFIRM_ORDER";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { ALL_CHAINS, getChainName, getExplorerAddressUrl, OrderType } from "../../../anyspend";
|
|
3
|
-
import { DEFAULT_NFT_CONTRACT } from "../../../anyspend/constants";
|
|
4
|
-
import { GlareCard, Popover, PopoverContent, PopoverTrigger } from "../../../global-account/react";
|
|
5
|
-
import { cn } from "../../../shared/utils";
|
|
6
|
-
import { getIpfsUrl } from "../../../shared/utils/ipfs";
|
|
7
|
-
import { formatDisplayNumber, formatTokenAmount } from "../../../shared/utils/number";
|
|
2
|
+
import { ALL_CHAINS, getChainName, getExplorerAddressUrl, OrderType } from "../../../anyspend/index.js";
|
|
3
|
+
import { DEFAULT_NFT_CONTRACT } from "../../../anyspend/constants/index.js";
|
|
4
|
+
import { GlareCard, Popover, PopoverContent, PopoverTrigger } from "../../../global-account/react/index.js";
|
|
5
|
+
import { cn } from "../../../shared/utils/index.js";
|
|
6
|
+
import { getIpfsUrl } from "../../../shared/utils/ipfs.js";
|
|
7
|
+
import { formatDisplayNumber, formatTokenAmount } from "../../../shared/utils/number.js";
|
|
8
8
|
import { AnimatePresence } from "framer-motion";
|
|
9
9
|
import { MoreVertical } from "lucide-react";
|
|
10
10
|
import { useState } from "react";
|
|
11
11
|
import { b3 } from "viem/chains";
|
|
12
|
-
import { AnySpendCustom } from "./AnySpendCustom";
|
|
12
|
+
import { AnySpendCustom } from "./AnySpendCustom.js";
|
|
13
13
|
export function AnySpendNFT({ isMainnet = true, loadOrder, mode = "modal", recipientAddress, nftContract = DEFAULT_NFT_CONTRACT }) {
|
|
14
14
|
const header = ({ anyspendPrice, isLoadingAnyspendPrice }) => (_jsxs(_Fragment, { children: [_jsxs("div", { className: "relative size-[200px]", children: [_jsx("div", { className: "absolute inset-0 scale-95 bg-black/30 blur-md" }), _jsxs(GlareCard, { className: "overflow-hidden", children: [_jsx("img", { src: getIpfsUrl(nftContract.imageUrl), alt: nftContract.name, className: "size-full object-cover" }), _jsx("div", { className: "absolute inset-0 rounded-xl border border-white/10" })] }), _jsx(DropdownMenu, { nftContract: nftContract })] }), _jsxs("div", { className: "from-b3-react-background to-as-on-surface-1 mt-[-100px] w-full rounded-t-lg bg-gradient-to-t", children: [_jsx("div", { className: "h-[100px] w-full" }), _jsxs("div", { className: "mb-1 flex w-full flex-col items-center gap-2 p-5", children: [_jsx("span", { className: "font-sf-rounded text-2xl font-semibold", children: nftContract.name }), _jsx("div", { className: "flex w-fit items-center gap-1", children: anyspendPrice ? (_jsx(AnimatePresence, { mode: "wait", children: _jsx("div", { className: cn("text-as-primary group flex items-center text-3xl font-semibold transition-all", {
|
|
15
15
|
"opacity-0": isLoadingAnyspendPrice
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { DEFAULT_NFT_CONTRACT } from "../../../anyspend/constants";
|
|
3
|
-
import { Button, useModalStore } from "../../../global-account/react";
|
|
2
|
+
import { DEFAULT_NFT_CONTRACT } from "../../../anyspend/constants/index.js";
|
|
3
|
+
import { Button, useModalStore } from "../../../global-account/react/index.js";
|
|
4
4
|
export function AnySpendNFTButton({ nftContract = DEFAULT_NFT_CONTRACT, recipientAddress }) {
|
|
5
5
|
const { setB3ModalOpen, setB3ModalContentType } = useModalStore();
|
|
6
6
|
const handleClick = () => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { ABI_ERC20_STAKING, B3_TOKEN, OrderType } from "../../../anyspend";
|
|
3
|
-
import { EthIcon } from "./icons/EthIcon";
|
|
4
|
-
import { SolIcon } from "./icons/SolIcon";
|
|
5
|
-
import { UsdcIcon } from "./icons/USDCIcon";
|
|
6
|
-
import { Button, GlareCardRounded, Input, TextLoop, useHasMounted, useModalStore, useChainSwitchWithAction, useTokenBalance, StyleRoot } from "../../../global-account/react";
|
|
7
|
-
import { formatTokenAmount } from "../../../shared/utils/number";
|
|
2
|
+
import { ABI_ERC20_STAKING, B3_TOKEN, OrderType } from "../../../anyspend/index.js";
|
|
3
|
+
import { EthIcon } from "./icons/EthIcon.js";
|
|
4
|
+
import { SolIcon } from "./icons/SolIcon.js";
|
|
5
|
+
import { UsdcIcon } from "./icons/USDCIcon.js";
|
|
6
|
+
import { Button, GlareCardRounded, Input, TextLoop, useHasMounted, useModalStore, useChainSwitchWithAction, useTokenBalance, StyleRoot } from "../../../global-account/react/index.js";
|
|
7
|
+
import { formatTokenAmount } from "../../../shared/utils/number.js";
|
|
8
8
|
import { motion } from "framer-motion";
|
|
9
9
|
import invariant from "invariant";
|
|
10
10
|
import { ArrowRight, Loader2 } from "lucide-react";
|
|
@@ -13,7 +13,7 @@ import { toast } from "sonner";
|
|
|
13
13
|
import { createPublicClient, encodeFunctionData, erc20Abi, http } from "viem";
|
|
14
14
|
import { base } from "viem/chains";
|
|
15
15
|
import { useAccount, useWaitForTransactionReceipt, useWriteContract } from "wagmi";
|
|
16
|
-
import { AnySpendCustom } from "./AnySpendCustom";
|
|
16
|
+
import { AnySpendCustom } from "./AnySpendCustom.js";
|
|
17
17
|
const basePublicClient = createPublicClient({
|
|
18
18
|
chain: base,
|
|
19
19
|
transport: http()
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { OrderType } from "../../../anyspend";
|
|
3
|
-
import { cn } from "../../../shared/utils";
|
|
4
|
-
import { formatDisplayNumber, formatTokenAmount } from "../../../shared/utils/number";
|
|
2
|
+
import { OrderType } from "../../../anyspend/index.js";
|
|
3
|
+
import { cn } from "../../../shared/utils/index.js";
|
|
4
|
+
import { formatDisplayNumber, formatTokenAmount } from "../../../shared/utils/number.js";
|
|
5
5
|
import { AnimatePresence } from "framer-motion";
|
|
6
|
-
import { AnySpendCustom } from "./AnySpendCustom";
|
|
6
|
+
import { AnySpendCustom } from "./AnySpendCustom.js";
|
|
7
7
|
export function AnySpendTournament(props) {
|
|
8
8
|
const { isMainnet = true, mode = "modal", action, loadOrder, tournamentChainId, tournamentContractAddress, tournamentMetadata, onSuccess } = props;
|
|
9
9
|
const dstToken = action === "join" ? props.tournamentEntryToken : props.tournamentFundToken;
|
|
@@ -1,10 +1,10 @@
|
|
|
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, OrderStatus, OrderType, RELAY_ETH_ADDRESS, zNft, zToken, zTournament } from "../../../../anyspend";
|
|
4
|
-
import { CopyToClipboard, Badge, ShinyButton, Skeleton, TextLoop, TextShimmer, Button, useAccountWallet, useChainSwitchWithAction, useOnchainName, useModalStore } from "../../../../global-account/react";
|
|
5
|
-
import { cn } from "../../../../shared/utils";
|
|
6
|
-
import centerTruncate from "../../../../shared/utils/centerTruncate";
|
|
7
|
-
import { formatTokenAmount } from "../../../../shared/utils/number";
|
|
3
|
+
import { ALL_CHAINS, capitalizeFirstLetter, EVM_CHAINS, getChainName, getErrorDisplay, getExplorerTxUrl, getPaymentUrl, getStatusDisplay, isNativeToken, OrderStatus, OrderType, RELAY_ETH_ADDRESS, zNft, zToken, zTournament } from "../../../../anyspend/index.js";
|
|
4
|
+
import { CopyToClipboard, Badge, ShinyButton, Skeleton, TextLoop, TextShimmer, Button, useAccountWallet, useChainSwitchWithAction, useOnchainName, useModalStore } from "../../../../global-account/react/index.js";
|
|
5
|
+
import { cn } from "../../../../shared/utils/index.js";
|
|
6
|
+
import centerTruncate from "../../../../shared/utils/centerTruncate.js";
|
|
7
|
+
import { formatTokenAmount } from "../../../../shared/utils/number.js";
|
|
8
8
|
import { useColorMode } from "@chakra-ui/react";
|
|
9
9
|
import { WalletCoinbase, WalletMetamask, WalletPhantom, WalletTrust, WalletWalletConnect } from "@web3icons/react";
|
|
10
10
|
import { motion } from "framer-motion";
|
|
@@ -17,7 +17,7 @@ import { toast } from "sonner";
|
|
|
17
17
|
import { erc20Abi } from "viem";
|
|
18
18
|
import { b3 } from "viem/chains";
|
|
19
19
|
import { useWaitForTransactionReceipt, useWalletClient } from "wagmi";
|
|
20
|
-
import PaymentVendorUI from "./PaymentVendorUI";
|
|
20
|
+
import PaymentVendorUI from "./PaymentVendorUI.js";
|
|
21
21
|
// Add this helper function near the top or just above the component
|
|
22
22
|
function getOrderSuccessText({ order, tournament, formattedActualDstAmount, dstToken, recipientName, centerTruncate }) {
|
|
23
23
|
const recipient = recipientName || centerTruncate(order.recipientAddress, 8);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { useAnyspendOrderHistory } from "../../../../anyspend";
|
|
4
|
-
import { Button, Skeleton, useAccountWallet } from "../../../../global-account/react";
|
|
3
|
+
import { useAnyspendOrderHistory } from "../../../../anyspend/index.js";
|
|
4
|
+
import { Button, Skeleton, useAccountWallet } from "../../../../global-account/react/index.js";
|
|
5
5
|
import { ArrowLeft, RefreshCcw } from "lucide-react";
|
|
6
|
-
import { OrderHistoryItem } from "./OrderHistoryItem";
|
|
6
|
+
import { OrderHistoryItem } from "./OrderHistoryItem.js";
|
|
7
7
|
const isMainnet = true;
|
|
8
8
|
export function OrderHistory({ mode, onBack, onSelectOrder }) {
|
|
9
9
|
const { address } = useAccountWallet();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { ALL_CHAINS, getChainName, getStatusDisplay, OrderType } from "../../../../anyspend";
|
|
3
|
-
import { Badge, Button, useIsMobile } from "../../../../global-account/react";
|
|
4
|
-
import { cn } from "../../../../shared/utils";
|
|
5
|
-
import { formatTokenAmount } from "../../../../shared/utils/number";
|
|
2
|
+
import { ALL_CHAINS, getChainName, getStatusDisplay, OrderType } from "../../../../anyspend/index.js";
|
|
3
|
+
import { Badge, Button, useIsMobile } from "../../../../global-account/react/index.js";
|
|
4
|
+
import { cn } from "../../../../shared/utils/index.js";
|
|
5
|
+
import { formatTokenAmount } from "../../../../shared/utils/number.js";
|
|
6
6
|
import { ArrowRight, ChevronDown } from "lucide-react";
|
|
7
7
|
import TimeAgo from "react-timeago";
|
|
8
8
|
import { b3 } from "viem/chains";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { OrderStatus as OrderStatusEnum, getStatusDisplay } from "../../../../anyspend";
|
|
3
|
-
import { Badge, TextShimmer } from "../../../../global-account/react";
|
|
2
|
+
import { OrderStatus as OrderStatusEnum, getStatusDisplay } from "../../../../anyspend/index.js";
|
|
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 }) {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { ALL_CHAINS, RELAY_ETH_ADDRESS, RELAY_SOLANA_MAINNET_CHAIN_ID } from "../../../../anyspend";
|
|
4
|
-
import { Button, useAccountWallet, useTokenBalancesByChain } from "../../../../global-account/react";
|
|
5
|
-
import { cn } from "../../../../shared/utils";
|
|
6
|
-
import { formatTokenAmount } from "../../../../shared/utils/number";
|
|
7
|
-
import { simpleHashChainToChainName } from "../../../../shared/utils/simplehash";
|
|
3
|
+
import { ALL_CHAINS, RELAY_ETH_ADDRESS, RELAY_SOLANA_MAINNET_CHAIN_ID } from "../../../../anyspend/index.js";
|
|
4
|
+
import { Button, useAccountWallet, useTokenBalancesByChain } from "../../../../global-account/react/index.js";
|
|
5
|
+
import { cn } from "../../../../shared/utils/index.js";
|
|
6
|
+
import { formatTokenAmount } from "../../../../shared/utils/number.js";
|
|
7
|
+
import { simpleHashChainToChainName } from "../../../../shared/utils/simplehash.js";
|
|
8
8
|
import { TokenSelector } from "@reservoir0x/relay-kit-ui";
|
|
9
9
|
import { CheckCircle2, ChevronsUpDown } from "lucide-react";
|
|
10
10
|
import { useMemo } from "react";
|
|
11
|
-
import { ChainTokenIcon } from "./ChainTokenIcon";
|
|
11
|
+
import { ChainTokenIcon } from "./ChainTokenIcon.js";
|
|
12
12
|
export function OrderToken({ context, address, chainId, setChainId, token, setToken, requiredAmount, tokenSelectClassName }) {
|
|
13
13
|
const { wallet } = useAccountWallet();
|
|
14
14
|
const chainName = useMemo(() => simpleHashChainToChainName(chainId), [chainId]);
|
|
@@ -3,11 +3,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { ChevronsUpDown } from "lucide-react";
|
|
4
4
|
import { useEffect, useRef } from "react";
|
|
5
5
|
import { NumericFormat } from "react-number-format";
|
|
6
|
-
import { ALL_CHAINS, RELAY_SOLANA_MAINNET_CHAIN_ID } from "../../../../anyspend";
|
|
7
|
-
import { Button } from "../../../../global-account/react";
|
|
8
|
-
import { cn } from "../../../../shared/utils";
|
|
6
|
+
import { ALL_CHAINS, RELAY_SOLANA_MAINNET_CHAIN_ID } from "../../../../anyspend/index.js";
|
|
7
|
+
import { Button } from "../../../../global-account/react/index.js";
|
|
8
|
+
import { cn } from "../../../../shared/utils/index.js";
|
|
9
9
|
import { TokenSelector } from "@reservoir0x/relay-kit-ui";
|
|
10
|
-
import { ChainTokenIcon } from "./ChainTokenIcon";
|
|
10
|
+
import { ChainTokenIcon } from "./ChainTokenIcon.js";
|
|
11
11
|
export function OrderTokenAmount({ disabled, inputValue, onChangeInput, context, address, chainId, setChainId, token, setToken, hideTokenSelect = false, canEditAmount = true, className, innerClassName, amountClassName, tokenSelectClassName }) {
|
|
12
12
|
// Track previous token to detect changes
|
|
13
13
|
const prevTokenRef = useRef(token.address);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCoinbaseOnrampOptions } from "../../../../anyspend";
|
|
3
|
-
import { Input, useGetGeo } from "../../../../global-account/react";
|
|
2
|
+
import { useCoinbaseOnrampOptions } from "../../../../anyspend/index.js";
|
|
3
|
+
import { Input, useGetGeo } from "../../../../global-account/react/index.js";
|
|
4
4
|
import { AnimatePresence, motion } from "framer-motion";
|
|
5
5
|
import { useRef } from "react";
|
|
6
6
|
import { toast } from "sonner";
|
|
7
|
-
import { PaymentOptions } from "./PaymentOptions";
|
|
7
|
+
import { PaymentOptions } from "./PaymentOptions.js";
|
|
8
8
|
export function PanelOnramp({ srcAmountOnRamp, setSrcAmountOnRamp }) {
|
|
9
9
|
// Get geo data for onramp availability
|
|
10
10
|
const { geoData } = useGetGeo();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { OnrampVendor, OrderType, useAnyspendCreateOnrampOrder, useGeoOnrampOptions } from "../../../../anyspend";
|
|
3
|
-
import { Button } from "../../../../global-account/react";
|
|
4
|
-
import centerTruncate from "../../../../shared/utils/centerTruncate";
|
|
2
|
+
import { OnrampVendor, OrderType, useAnyspendCreateOnrampOrder, useGeoOnrampOptions } from "../../../../anyspend/index.js";
|
|
3
|
+
import { Button } from "../../../../global-account/react/index.js";
|
|
4
|
+
import centerTruncate from "../../../../shared/utils/centerTruncate.js";
|
|
5
5
|
import { motion } from "framer-motion";
|
|
6
6
|
import invariant from "invariant";
|
|
7
7
|
import { ChevronLeft, ChevronRight, Landmark, Loader2 } from "lucide-react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { PAYMENT_METHOD_ICONS } from "../../../../anyspend/constants";
|
|
2
|
+
import { PAYMENT_METHOD_ICONS } from "../../../../anyspend/constants/index.js";
|
|
3
3
|
export default function PaymentMethodIcons() {
|
|
4
4
|
const paymentMethods = [
|
|
5
5
|
{ name: "Visa", src: PAYMENT_METHOD_ICONS.visa },
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ShinyButton } from "../../../../global-account/react";
|
|
3
|
-
import { getPaymentMethodDescription, getVendorDisplayName } from "../../../../shared/utils/payment.utils";
|
|
2
|
+
import { ShinyButton } from "../../../../global-account/react/index.js";
|
|
3
|
+
import { getPaymentMethodDescription, getVendorDisplayName } from "../../../../shared/utils/payment.utils.js";
|
|
4
4
|
import { ChevronRight } from "lucide-react";
|
|
5
|
-
import HowItWorks from "./HowItWorks";
|
|
5
|
+
import HowItWorks from "./HowItWorks.js";
|
|
6
6
|
export default function PaymentOneClick({ order }) {
|
|
7
7
|
const vendor = order.onrampMetadata?.vendor;
|
|
8
8
|
const vendorName = getVendorDisplayName(vendor);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { USDC_BASE, useStripeClientSecret } from "../../../../anyspend";
|
|
3
|
-
import { STRIPE_CONFIG } from "../../../../anyspend/constants";
|
|
4
|
-
import { ShinyButton, useB3 } from "../../../../global-account/react";
|
|
5
|
-
import { formatStripeAmount } from "../../../../shared/utils/payment.utils";
|
|
2
|
+
import { USDC_BASE, useStripeClientSecret } from "../../../../anyspend/index.js";
|
|
3
|
+
import { STRIPE_CONFIG } from "../../../../anyspend/constants/index.js";
|
|
4
|
+
import { ShinyButton, useB3 } from "../../../../global-account/react/index.js";
|
|
5
|
+
import { formatStripeAmount } from "../../../../shared/utils/payment.utils.js";
|
|
6
6
|
import { Elements, PaymentElement, useElements, useStripe } from "@stripe/react-stripe-js";
|
|
7
7
|
import { loadStripe } from "@stripe/stripe-js";
|
|
8
8
|
import { HelpCircle, Info, X } from "lucide-react";
|
|
9
9
|
import { useEffect, useState } from "react";
|
|
10
|
-
import HowItWorks from "./HowItWorks";
|
|
11
|
-
import PaymentMethodIcons from "./PaymentMethodIcons";
|
|
10
|
+
import HowItWorks from "./HowItWorks.js";
|
|
11
|
+
import PaymentMethodIcons from "./PaymentMethodIcons.js";
|
|
12
12
|
const stripePromise = loadStripe(STRIPE_CONFIG.publishableKey);
|
|
13
13
|
export default function PaymentStripeWeb2({ isMainnet, order, onPaymentSuccess }) {
|
|
14
14
|
const { theme } = useB3();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { OnrampVendor } from "../../../../anyspend";
|
|
3
|
-
import PaymentOneClick from "./PaymentOneClick";
|
|
4
|
-
import PaymentStripeWeb2 from "./PaymentStripeWeb2";
|
|
2
|
+
import { OnrampVendor } from "../../../../anyspend/index.js";
|
|
3
|
+
import PaymentOneClick from "./PaymentOneClick.js";
|
|
4
|
+
import PaymentStripeWeb2 from "./PaymentStripeWeb2.js";
|
|
5
5
|
export default function PaymentVendorUI({ isMainnet, order, dstTokenSymbol }) {
|
|
6
6
|
const vendor = order.onrampMetadata?.vendor;
|
|
7
7
|
// Handle one-click payment flows (Coinbase, Stripe redirect)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useTokenBalance } from "../../../../global-account/react";
|
|
2
|
+
import { useTokenBalance } from "../../../../global-account/react/index.js";
|
|
3
3
|
import { formatUnits } from "viem";
|
|
4
4
|
export function TokenBalance({ token, walletAddress, onChangeInput }) {
|
|
5
5
|
const { rawBalance, formattedBalance, isLoading } = useTokenBalance({
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// Components
|
|
2
|
-
export { AnySpend } from "./AnySpend";
|
|
3
|
-
export { AnySpendBuySpin } from "./AnySpendBuySpin";
|
|
4
|
-
export { AnySpendCustom } from "./AnySpendCustom";
|
|
5
|
-
export { AnySpendNFT } from "./AnySpendNFT";
|
|
6
|
-
export { AnySpendNFTButton } from "./AnySpendNFTButton";
|
|
7
|
-
export { AnySpendStakeB3 } from "./AnySpendStakeB3";
|
|
8
|
-
export { AnySpendTournament } from "./AnySpendTournament";
|
|
2
|
+
export { AnySpend } from "./AnySpend.js";
|
|
3
|
+
export { AnySpendBuySpin } from "./AnySpendBuySpin.js";
|
|
4
|
+
export { AnySpendCustom } from "./AnySpendCustom.js";
|
|
5
|
+
export { AnySpendNFT } from "./AnySpendNFT.js";
|
|
6
|
+
export { AnySpendNFTButton } from "./AnySpendNFTButton.js";
|
|
7
|
+
export { AnySpendStakeB3 } from "./AnySpendStakeB3.js";
|
|
8
|
+
export { AnySpendTournament } from "./AnySpendTournament.js";
|
|
9
9
|
// Common Components
|
|
10
|
-
export { OrderDetails } from "./common/OrderDetails";
|
|
11
|
-
export { OrderHistory } from "./common/OrderHistory";
|
|
12
|
-
export { OrderHistoryItem } from "./common/OrderHistoryItem";
|
|
13
|
-
export { OrderStatus } from "./common/OrderStatus";
|
|
14
|
-
export { OrderToken } from "./common/OrderToken";
|
|
15
|
-
export { OrderTokenAmount } from "./common/OrderTokenAmount";
|
|
16
|
-
export { TokenBalance } from "./common/TokenBalance";
|
|
17
|
-
export { WebviewOnrampPayment } from "./webview/WebviewOnrampPayment";
|
|
10
|
+
export { OrderDetails } from "./common/OrderDetails.js";
|
|
11
|
+
export { OrderHistory } from "./common/OrderHistory.js";
|
|
12
|
+
export { OrderHistoryItem } from "./common/OrderHistoryItem.js";
|
|
13
|
+
export { OrderStatus } from "./common/OrderStatus.js";
|
|
14
|
+
export { OrderToken } from "./common/OrderToken.js";
|
|
15
|
+
export { OrderTokenAmount } from "./common/OrderTokenAmount.js";
|
|
16
|
+
export { TokenBalance } from "./common/TokenBalance.js";
|
|
17
|
+
export { WebviewOnrampPayment } from "./webview/WebviewOnrampPayment.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
|
-
import { Dialog, DialogContent, Input, ShinyButton } from "../../../../global-account/react";
|
|
3
|
+
import { Dialog, DialogContent, Input, ShinyButton } from "../../../../global-account/react/index.js";
|
|
4
4
|
export function EnterRecipientModal({ isOpenPasteRecipientAddress, setIsOpenPasteRecipientAddress, recipientAddress, setRecipientAddress }) {
|
|
5
5
|
const [modalRecipientAddress, setModalRecipientAddress] = useState(recipientAddress || "");
|
|
6
6
|
useEffect(() => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { getChainName, OnrampVendor, OrderType, useAnyspendCreateOnrampOrder, useGeoOnrampOptions } from "../../../../anyspend";
|
|
3
|
-
import { Button } from "../../../../global-account/react";
|
|
4
|
-
import centerTruncate from "../../../../shared/utils/centerTruncate";
|
|
2
|
+
import { getChainName, OnrampVendor, OrderType, useAnyspendCreateOnrampOrder, useGeoOnrampOptions } from "../../../../anyspend/index.js";
|
|
3
|
+
import { Button } from "../../../../global-account/react/index.js";
|
|
4
|
+
import centerTruncate from "../../../../shared/utils/centerTruncate.js";
|
|
5
5
|
import { motion } from "framer-motion";
|
|
6
6
|
import { Loader2 } from "lucide-react";
|
|
7
7
|
import { useEffect, useRef, useState } from "react";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export * from "./useAnyspendCreateOnrampOrder";
|
|
2
|
-
export * from "./useAnyspendCreateOrder";
|
|
3
|
-
export * from "./useAnyspendOrderAndTransactions";
|
|
4
|
-
export * from "./useAnyspendOrderHistory";
|
|
5
|
-
export * from "./useAnyspendQuote";
|
|
6
|
-
export * from "./useAnyspendSendPermitData";
|
|
7
|
-
export * from "./useAnyspendTokens";
|
|
8
|
-
export * from "./useCoinbaseOnrampOptions";
|
|
9
|
-
export * from "./useGeoOnrampOptions";
|
|
10
|
-
export * from "./useGetGeo";
|
|
11
|
-
export * from "./usePermitData";
|
|
12
|
-
export * from "./useStripeClientSecret";
|
|
13
|
-
export * from "./useStripeSupport";
|
|
1
|
+
export * from "./useAnyspendCreateOnrampOrder.js";
|
|
2
|
+
export * from "./useAnyspendCreateOrder.js";
|
|
3
|
+
export * from "./useAnyspendOrderAndTransactions.js";
|
|
4
|
+
export * from "./useAnyspendOrderHistory.js";
|
|
5
|
+
export * from "./useAnyspendQuote.js";
|
|
6
|
+
export * from "./useAnyspendSendPermitData.js";
|
|
7
|
+
export * from "./useAnyspendTokens.js";
|
|
8
|
+
export * from "./useCoinbaseOnrampOptions.js";
|
|
9
|
+
export * from "./useGeoOnrampOptions.js";
|
|
10
|
+
export * from "./useGetGeo.js";
|
|
11
|
+
export * from "./usePermitData.js";
|
|
12
|
+
export * from "./useStripeClientSecret.js";
|
|
13
|
+
export * from "./useStripeSupport.js";
|