@b3dotfun/sdk 0.0.39-alpha.0 → 0.0.40-alpha.1

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.
Files changed (63) hide show
  1. package/dist/cjs/anyspend/constants/index.d.ts +0 -1
  2. package/dist/cjs/anyspend/constants/index.js +1 -2
  3. package/dist/cjs/anyspend/react/components/AnySpend.js +5 -6
  4. package/dist/cjs/anyspend/react/components/AnySpendCustom.js +8 -9
  5. package/dist/cjs/anyspend/react/components/AnyspendDepositHype.js +4 -5
  6. package/dist/cjs/anyspend/react/components/common/ConnectWalletPayment.d.ts +2 -1
  7. package/dist/cjs/anyspend/react/components/common/ConnectWalletPayment.js +3 -2
  8. package/dist/cjs/anyspend/react/components/common/OrderDetails.d.ts +2 -0
  9. package/dist/cjs/anyspend/react/components/common/OrderDetails.js +23 -19
  10. package/dist/cjs/anyspend/react/components/common/OrderDetailsCollapsible.js +9 -8
  11. package/dist/cjs/anyspend/react/components/common/PaymentMethodSwitch.d.ts +7 -0
  12. package/dist/cjs/anyspend/react/components/common/PaymentMethodSwitch.js +24 -0
  13. package/dist/cjs/anyspend/react/components/common/TransferCryptoDetails.d.ts +2 -0
  14. package/dist/cjs/anyspend/react/components/common/TransferCryptoDetails.js +6 -4
  15. package/dist/cjs/anyspend/utils/chain.js +1 -1
  16. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +2 -9
  17. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +1 -10
  18. package/dist/cjs/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +5 -2
  19. package/dist/esm/anyspend/constants/index.d.ts +0 -1
  20. package/dist/esm/anyspend/constants/index.js +0 -1
  21. package/dist/esm/anyspend/react/components/AnySpend.js +6 -7
  22. package/dist/esm/anyspend/react/components/AnySpendCustom.js +8 -9
  23. package/dist/esm/anyspend/react/components/AnyspendDepositHype.js +5 -6
  24. package/dist/esm/anyspend/react/components/common/ConnectWalletPayment.d.ts +2 -1
  25. package/dist/esm/anyspend/react/components/common/ConnectWalletPayment.js +3 -2
  26. package/dist/esm/anyspend/react/components/common/OrderDetails.d.ts +2 -0
  27. package/dist/esm/anyspend/react/components/common/OrderDetails.js +24 -20
  28. package/dist/esm/anyspend/react/components/common/OrderDetailsCollapsible.js +10 -9
  29. package/dist/esm/anyspend/react/components/common/PaymentMethodSwitch.d.ts +7 -0
  30. package/dist/esm/anyspend/react/components/common/PaymentMethodSwitch.js +21 -0
  31. package/dist/esm/anyspend/react/components/common/TransferCryptoDetails.d.ts +2 -0
  32. package/dist/esm/anyspend/react/components/common/TransferCryptoDetails.js +6 -4
  33. package/dist/esm/anyspend/utils/chain.js +1 -1
  34. package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +2 -9
  35. package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +1 -10
  36. package/dist/esm/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +5 -2
  37. package/dist/types/anyspend/constants/index.d.ts +0 -1
  38. package/dist/types/anyspend/react/components/common/ConnectWalletPayment.d.ts +2 -1
  39. package/dist/types/anyspend/react/components/common/OrderDetails.d.ts +2 -0
  40. package/dist/types/anyspend/react/components/common/PaymentMethodSwitch.d.ts +7 -0
  41. package/dist/types/anyspend/react/components/common/TransferCryptoDetails.d.ts +2 -0
  42. package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +2 -9
  43. package/package.json +4 -5
  44. package/src/anyspend/constants/index.ts +0 -2
  45. package/src/anyspend/react/components/AnySpend.tsx +15 -17
  46. package/src/anyspend/react/components/AnySpendCustom.tsx +19 -21
  47. package/src/anyspend/react/components/AnyspendDepositHype.tsx +16 -18
  48. package/src/anyspend/react/components/common/ConnectWalletPayment.tsx +5 -0
  49. package/src/anyspend/react/components/common/OrderDetails.tsx +60 -43
  50. package/src/anyspend/react/components/common/OrderDetailsCollapsible.tsx +62 -41
  51. package/src/anyspend/react/components/common/PaymentMethodSwitch.tsx +38 -0
  52. package/src/anyspend/react/components/common/TransferCryptoDetails.tsx +65 -43
  53. package/src/anyspend/utils/chain.ts +1 -1
  54. package/src/global-account/react/components/B3Provider/B3Provider.tsx +3 -11
  55. package/src/global-account/react/hooks/useUnifiedChainSwitchAndExecute.ts +5 -2
  56. package/dist/cjs/global-account/examples/client-selection-example.d.ts +0 -5
  57. package/dist/cjs/global-account/examples/client-selection-example.js +0 -96
  58. package/dist/esm/global-account/examples/client-selection-example.d.ts +0 -5
  59. package/dist/esm/global-account/examples/client-selection-example.js +0 -93
  60. package/dist/types/global-account/examples/client-selection-example.d.ts +0 -5
  61. package/src/global-account/app.d.ts +0 -14
  62. package/src/global-account/docs/client-selection.md +0 -292
  63. package/src/global-account/examples/client-selection-example.tsx +0 -197
@@ -104,7 +104,7 @@ export const EVM_MAINNET = {
104
104
  name: bsc.name,
105
105
  logoUrl: "https://avatars.githubusercontent.com/u/45615063?s=280&v=4",
106
106
  type: ChainType.EVM,
107
- nativeRequired: parseEther("0.000025"),
107
+ nativeRequired: parseEther("0.0001"),
108
108
  canDepositNative: true,
109
109
  defaultToken: getBnbToken(),
110
110
  nativeToken: getBnbToken(),
@@ -1,16 +1,9 @@
1
1
  import { PermissionsConfig } from "../../../../global-account/types/permissions";
2
- import "@reservoir0x/relay-kit-ui/styles.css";
3
2
  import { Account } from "thirdweb/wallets";
4
3
  import { ClientType } from "../../../client-manager";
5
4
  import { B3ContextType } from "./types";
6
- export declare const wagmiConfig: import("wagmi").Config<readonly [import("viem").Chain, ...import("viem").Chain[]], any, readonly [import("wagmi").CreateConnectorFn<import("thirdweb/dist/types/adapters/eip1193").EIP1193Provider | undefined, {
7
- connect(parameters?: import("@thirdweb-dev/wagmi-adapter/dist/types/connector").ConnectionOptions): Promise<{
8
- accounts: readonly `0x${string}`[];
9
- chainId: number;
10
- }>;
11
- }, {
12
- "thirdweb:lastChainId": number;
13
- }>]>;
5
+ import "@reservoir0x/relay-kit-ui/styles.css";
6
+ export declare const wagmiConfig: import("wagmi").Config<readonly [import("viem").Chain, ...import("viem").Chain[]], any, readonly import("wagmi").CreateConnectorFn[]>;
14
7
  /**
15
8
  * Main B3Provider component
16
9
  */
@@ -2,10 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { RelayKitProviderWrapper, TooltipProvider, useAuthStore } from "../../../../global-account/react/index.js";
3
3
  import { loadGA4Script } from "../../../../global-account/utils/analytics.js";
4
4
  import { supportedChains } from "../../../../shared/constants/chains/supported.js";
5
- import { client } from "../../../../shared/utils/thirdweb.js";
6
- import "@reservoir0x/relay-kit-ui/styles.css";
7
5
  import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
8
- import { inAppWalletConnector } from "@thirdweb-dev/wagmi-adapter";
9
6
  import { useCallback, useEffect, useState } from "react";
10
7
  import { Toaster } from "sonner";
11
8
  import { getLastAuthProvider, ThirdwebProvider, useActiveAccount, useConnectedWallets, useSetActiveWallet, } from "thirdweb/react";
@@ -13,6 +10,7 @@ import { createConfig, http, WagmiProvider } from "wagmi";
13
10
  import { setClientType } from "../../../client-manager.js";
14
11
  import { StyleRoot } from "../StyleRoot.js";
15
12
  import { B3Context } from "./types.js";
13
+ import "@reservoir0x/relay-kit-ui/styles.css";
16
14
  /**
17
15
  * Default permissions configuration for B3 provider
18
16
  */
@@ -25,13 +23,6 @@ const DEFAULT_PERMISSIONS = {
25
23
  export const wagmiConfig = createConfig({
26
24
  chains: [supportedChains[0], ...supportedChains.slice(1)],
27
25
  transports: Object.fromEntries(supportedChains.map(chain => [chain.id, http()])),
28
- connectors: [
29
- inAppWalletConnector({
30
- client,
31
- }),
32
- // injected(),
33
- // coinbaseWallet({ appName: "HypeDuel" }),
34
- ],
35
26
  });
36
27
  // Create queryClient instance
37
28
  const queryClient = new QueryClient();
@@ -124,18 +124,21 @@ export function useUnifiedChainSwitchAndExecute() {
124
124
  });
125
125
  }
126
126
  catch (err) {
127
- console.error(err);
127
+ console.error("Create global-accounts-intents error", err);
128
128
  }
129
129
  toast.info("Sending transaction…");
130
+ const start = performance.now();
130
131
  const sendTxResponse = await twSendTransaction({
131
132
  account: aaAccount,
132
133
  transaction,
133
134
  });
135
+ const end = performance.now();
136
+ console.log("Time taken to send transaction", end - start);
134
137
  toast.success("Transaction sent successfully");
135
138
  return sendTxResponse.transactionHash;
136
139
  }
137
140
  catch (err) {
138
- console.error(err);
141
+ console.error("Send transaction error", err);
139
142
  toast.error(err?.message ?? "Transaction failed");
140
143
  return undefined;
141
144
  }
@@ -37,4 +37,3 @@ export declare const VENDOR_DISPLAY_NAMES: {
37
37
  readonly stripe: "Stripe";
38
38
  readonly unknown: "Unknown Vendor";
39
39
  };
40
- export declare const DEPOSIT_HYPE_ACTION = "deposit_hype";
@@ -12,6 +12,7 @@ interface ConnectWalletPaymentProps {
12
12
  tournament?: Tournament;
13
13
  nft?: NFT;
14
14
  cryptoPaymentMethod: CryptoPaymentMethodType;
15
+ onPaymentMethodChange?: (method: CryptoPaymentMethodType) => void;
15
16
  }
16
- export default function ConnectWalletPayment({ order, onPayment, txLoading, isSwitchingOrExecuting, phantomWalletAddress, tournament, nft, cryptoPaymentMethod, }: ConnectWalletPaymentProps): import("react/jsx-runtime").JSX.Element;
17
+ export default function ConnectWalletPayment({ order, onPayment, txLoading, isSwitchingOrExecuting, phantomWalletAddress, tournament, nft, cryptoPaymentMethod, onPaymentMethodChange, }: ConnectWalletPaymentProps): import("react/jsx-runtime").JSX.Element;
17
18
  export {};
@@ -8,6 +8,8 @@ interface OrderDetailsProps {
8
8
  executeTx: components["schemas"]["ExecuteTx"] | null;
9
9
  refundTxs: components["schemas"]["RefundTx"][];
10
10
  cryptoPaymentMethod?: CryptoPaymentMethodType;
11
+ selectedCryptoPaymentMethod?: CryptoPaymentMethodType;
12
+ onPaymentMethodChange?: (method: CryptoPaymentMethodType) => void;
11
13
  onBack?: () => void;
12
14
  disableUrlParamManagement?: boolean;
13
15
  }
@@ -0,0 +1,7 @@
1
+ import { CryptoPaymentMethodType } from "./CryptoPaymentMethod";
2
+ interface PaymentMethodSwitchProps {
3
+ currentMethod: CryptoPaymentMethodType;
4
+ onMethodChange?: (method: CryptoPaymentMethodType) => void;
5
+ }
6
+ export declare function PaymentMethodSwitch({ currentMethod, onMethodChange }: PaymentMethodSwitchProps): import("react/jsx-runtime").JSX.Element | null;
7
+ export {};
@@ -1,4 +1,5 @@
1
1
  import { components } from "@b3dotfun/sdk/anyspend/types/api";
2
+ import { CryptoPaymentMethodType } from "./CryptoPaymentMethod";
2
3
  type Order = components["schemas"]["Order"];
3
4
  type Token = components["schemas"]["Token"];
4
5
  type Tournament = components["schemas"]["Tournament"];
@@ -11,6 +12,7 @@ interface TransferCryptoDetailsProps {
11
12
  nft?: NFT;
12
13
  onBack: () => void;
13
14
  recipientName?: string;
15
+ onPaymentMethodChange?: (method: CryptoPaymentMethodType) => void;
14
16
  }
15
17
  export declare const TransferCryptoDetails: import("react").NamedExoticComponent<TransferCryptoDetailsProps>;
16
18
  export {};
@@ -1,16 +1,9 @@
1
1
  import { PermissionsConfig } from "@b3dotfun/sdk/global-account/types/permissions";
2
- import "@reservoir0x/relay-kit-ui/styles.css";
3
2
  import { Account } from "thirdweb/wallets";
4
3
  import { ClientType } from "../../../client-manager";
5
4
  import { B3ContextType } from "./types";
6
- export declare const wagmiConfig: import("wagmi").Config<readonly [import("viem").Chain, ...import("viem").Chain[]], any, readonly [import("wagmi").CreateConnectorFn<import("thirdweb/dist/types/adapters/eip1193").EIP1193Provider | undefined, {
7
- connect(parameters?: import("@thirdweb-dev/wagmi-adapter/dist/types/connector").ConnectionOptions): Promise<{
8
- accounts: readonly `0x${string}`[];
9
- chainId: number;
10
- }>;
11
- }, {
12
- "thirdweb:lastChainId": number;
13
- }>]>;
5
+ import "@reservoir0x/relay-kit-ui/styles.css";
6
+ export declare const wagmiConfig: import("wagmi").Config<readonly [import("viem").Chain, ...import("viem").Chain[]], any, readonly import("wagmi").CreateConnectorFn[]>;
14
7
  /**
15
8
  * Main B3Provider component
16
9
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@b3dotfun/sdk",
3
- "version": "0.0.39-alpha.0",
3
+ "version": "0.0.40-alpha.1",
4
4
  "source": "src/index.ts",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "react-native": "./dist/cjs/index.native.js",
@@ -241,8 +241,8 @@
241
241
  "@b3dotfun/basement-api": "0.0.11",
242
242
  "@feathersjs/authentication-client": "5.0.33",
243
243
  "@feathersjs/feathers": "5.0.33",
244
- "@feathersjs/rest-client": "5.0.33",
245
244
  "@feathersjs/socketio-client": "5.0.33",
245
+ "@feathersjs/rest-client": "5.0.33",
246
246
  "@feathersjs/typebox": "5.0.33",
247
247
  "@fingerprintjs/fingerprintjs-pro-react": "^2.7.0",
248
248
  "@hey-api/client-fetch": "0.8.3",
@@ -261,7 +261,6 @@
261
261
  "@solana/web3.js": "^1.98.2",
262
262
  "@stripe/react-stripe-js": "^3.7.0",
263
263
  "@stripe/stripe-js": "^7.3.1",
264
- "@thirdweb-dev/wagmi-adapter": "^0.2.141",
265
264
  "@web3icons/react": "3.16.0",
266
265
  "big.js": "^7.0.1",
267
266
  "class-variance-authority": "0.7.0",
@@ -332,8 +331,8 @@
332
331
  "react-native-mmkv": "^3.2.0",
333
332
  "thirdweb": "^5.105.20",
334
333
  "three": "^0.175.0",
335
- "viem": "^2.28.1",
336
- "wagmi": "^2.14.15"
334
+ "wagmi": "^2.14.15",
335
+ "viem": "^2.28.1"
337
336
  },
338
337
  "peerDependenciesMeta": {
339
338
  "@react-three/postprocessing": {
@@ -96,5 +96,3 @@ export const VENDOR_DISPLAY_NAMES = {
96
96
  stripe: "Stripe",
97
97
  unknown: "Unknown Vendor",
98
98
  } as const;
99
-
100
- export const DEPOSIT_HYPE_ACTION = "deposit_hype";
@@ -38,7 +38,6 @@ import { ErrorSection } from "./common/ErrorSection";
38
38
  import { FiatPaymentMethod, FiatPaymentMethodComponent } from "./common/FiatPaymentMethod";
39
39
  import { OrderDetails, OrderDetailsLoadingView } from "./common/OrderDetails";
40
40
  import { OrderHistory } from "./common/OrderHistory";
41
- import { OrderStatus } from "./common/OrderStatus";
42
41
  import { PanelOnramp } from "./common/PanelOnramp";
43
42
  import { PanelOnrampPayment } from "./common/PanelOnrampPayment";
44
43
  import { RecipientSelection } from "./common/RecipientSelection";
@@ -807,22 +806,21 @@ function AnySpendInner({
807
806
  <div className={"mx-auto w-[460px] max-w-full"}>
808
807
  <div className="relative flex flex-col gap-4">
809
808
  {oat && (
810
- <>
811
- <OrderStatus order={oat.data.order} selectedCryptoPaymentMethod={selectedCryptoPaymentMethod} />
812
- <OrderDetails
813
- mode={mode}
814
- order={oat.data.order}
815
- depositTxs={oat.data.depositTxs}
816
- relayTxs={oat.data.relayTxs}
817
- executeTx={oat.data.executeTx}
818
- refundTxs={oat.data.refundTxs}
819
- onBack={() => {
820
- setOrderId(undefined);
821
- setActivePanel(PanelView.MAIN);
822
- setSelectedCryptoPaymentMethod(CryptoPaymentMethodType.NONE); // Reset payment method when going back
823
- }}
824
- />
825
- </>
809
+ <OrderDetails
810
+ mode={mode}
811
+ order={oat.data.order}
812
+ depositTxs={oat.data.depositTxs}
813
+ relayTxs={oat.data.relayTxs}
814
+ executeTx={oat.data.executeTx}
815
+ refundTxs={oat.data.refundTxs}
816
+ selectedCryptoPaymentMethod={selectedCryptoPaymentMethod}
817
+ onPaymentMethodChange={setSelectedCryptoPaymentMethod}
818
+ onBack={() => {
819
+ setOrderId(undefined);
820
+ setActivePanel(PanelView.MAIN);
821
+ setSelectedCryptoPaymentMethod(CryptoPaymentMethodType.NONE); // Reset payment method when going back
822
+ }}
823
+ />
826
824
  )}
827
825
  {/* {mode === "page" && <div className="h-12" />} */}
828
826
  </div>
@@ -47,7 +47,6 @@ import { CryptoPaymentMethod, CryptoPaymentMethodType } from "./common/CryptoPay
47
47
  import { FiatPaymentMethod, FiatPaymentMethodComponent } from "./common/FiatPaymentMethod";
48
48
  import { OrderDetails } from "./common/OrderDetails";
49
49
  import { OrderHistory } from "./common/OrderHistory";
50
- import { OrderStatus as OrderStatusDisplay } from "./common/OrderStatus";
51
50
  import { OrderToken } from "./common/OrderToken";
52
51
  import { RecipientSelection } from "./common/RecipientSelection";
53
52
 
@@ -648,26 +647,25 @@ function AnySpendCustomInner({
648
647
  )}
649
648
  >
650
649
  {oat && (
651
- <>
652
- <OrderStatusDisplay order={oat.data.order} selectedCryptoPaymentMethod={selectedCryptoPaymentMethod} />
653
- <OrderDetails
654
- mode={mode}
655
- order={oat.data.order}
656
- depositTxs={oat.data.depositTxs}
657
- relayTxs={oat.data.relayTxs}
658
- executeTx={oat.data.executeTx}
659
- refundTxs={oat.data.refundTxs}
660
- cryptoPaymentMethod={activeTab === "fiat" ? CryptoPaymentMethodType.NONE : selectedCryptoPaymentMethod}
661
- onBack={() => {
662
- setOrderId(undefined);
663
- setActivePanel(PanelView.CONFIRM_ORDER);
664
- // Remove orderId from URL when canceling
665
- const params = new URLSearchParams(searchParams.toString());
666
- params.delete("orderId");
667
- router.push(`${window.location.pathname}?${params.toString()}`);
668
- }}
669
- />
670
- </>
650
+ <OrderDetails
651
+ mode={mode}
652
+ order={oat.data.order}
653
+ depositTxs={oat.data.depositTxs}
654
+ relayTxs={oat.data.relayTxs}
655
+ executeTx={oat.data.executeTx}
656
+ refundTxs={oat.data.refundTxs}
657
+ cryptoPaymentMethod={activeTab === "fiat" ? CryptoPaymentMethodType.NONE : selectedCryptoPaymentMethod}
658
+ selectedCryptoPaymentMethod={selectedCryptoPaymentMethod}
659
+ onPaymentMethodChange={setSelectedCryptoPaymentMethod}
660
+ onBack={() => {
661
+ setOrderId(undefined);
662
+ setActivePanel(PanelView.CONFIRM_ORDER);
663
+ // Remove orderId from URL when canceling
664
+ const params = new URLSearchParams(searchParams.toString());
665
+ params.delete("orderId");
666
+ router.push(`${window.location.pathname}?${params.toString()}`);
667
+ }}
668
+ />
671
669
  )}
672
670
  {mode === "page" && <div className="h-12" />}
673
671
  </div>
@@ -14,7 +14,6 @@ import { CryptoReceiveSection } from "./common/CryptoReceiveSection";
14
14
  import { ErrorSection } from "./common/ErrorSection";
15
15
  import { FiatPaymentMethod, FiatPaymentMethodComponent } from "./common/FiatPaymentMethod";
16
16
  import { OrderDetails } from "./common/OrderDetails";
17
- import { OrderStatus } from "./common/OrderStatus";
18
17
  import { RecipientSelection } from "./common/RecipientSelection";
19
18
 
20
19
  import { ArrowDown } from "lucide-react";
@@ -381,23 +380,22 @@ function AnySpendDepositHypeInner({
381
380
  <div className={"mx-auto w-[460px] max-w-full"}>
382
381
  <div className="relative flex flex-col gap-4">
383
382
  {oat && (
384
- <>
385
- <OrderStatus order={oat.data.order} selectedCryptoPaymentMethod={selectedCryptoPaymentMethod} />
386
- <OrderDetails
387
- mode={mode}
388
- order={oat.data.order}
389
- depositTxs={oat.data.depositTxs}
390
- relayTxs={oat.data.relayTxs}
391
- executeTx={oat.data.executeTx}
392
- refundTxs={oat.data.refundTxs}
393
- cryptoPaymentMethod={paymentType === "fiat" ? CryptoPaymentMethodType.NONE : selectedCryptoPaymentMethod}
394
- onBack={() => {
395
- setOrderId(undefined);
396
- setActivePanel(PanelView.MAIN);
397
- }}
398
- disableUrlParamManagement
399
- />
400
- </>
383
+ <OrderDetails
384
+ mode={mode}
385
+ order={oat.data.order}
386
+ depositTxs={oat.data.depositTxs}
387
+ relayTxs={oat.data.relayTxs}
388
+ executeTx={oat.data.executeTx}
389
+ refundTxs={oat.data.refundTxs}
390
+ cryptoPaymentMethod={paymentType === "fiat" ? CryptoPaymentMethodType.NONE : selectedCryptoPaymentMethod}
391
+ selectedCryptoPaymentMethod={selectedCryptoPaymentMethod}
392
+ onPaymentMethodChange={setSelectedCryptoPaymentMethod}
393
+ onBack={() => {
394
+ setOrderId(undefined);
395
+ setActivePanel(PanelView.MAIN);
396
+ }}
397
+ disableUrlParamManagement
398
+ />
401
399
  )}
402
400
  </div>
403
401
  </div>
@@ -10,6 +10,7 @@ import { ChevronRight, Loader2 } from "lucide-react";
10
10
  import { useAccount } from "wagmi";
11
11
  import { CryptoPaymentMethodType } from "./CryptoPaymentMethod";
12
12
  import { OrderDetailsCollapsible } from "./OrderDetailsCollapsible";
13
+ import { PaymentMethodSwitch } from "./PaymentMethodSwitch";
13
14
 
14
15
  type Tournament = components["schemas"]["Tournament"];
15
16
  type NFT = components["schemas"]["NFT"];
@@ -24,6 +25,7 @@ interface ConnectWalletPaymentProps {
24
25
  tournament?: Tournament;
25
26
  nft?: NFT;
26
27
  cryptoPaymentMethod: CryptoPaymentMethodType;
28
+ onPaymentMethodChange?: (method: CryptoPaymentMethodType) => void;
27
29
  }
28
30
 
29
31
  export default function ConnectWalletPayment({
@@ -35,6 +37,7 @@ export default function ConnectWalletPayment({
35
37
  tournament,
36
38
  nft,
37
39
  cryptoPaymentMethod,
40
+ onPaymentMethodChange,
38
41
  }: ConnectWalletPaymentProps) {
39
42
  const profile = useProfile({ address: order.recipientAddress });
40
43
  const recipientName = profile.data?.name?.replace(/\.b3\.fun/g, "");
@@ -97,6 +100,8 @@ export default function ConnectWalletPayment({
97
100
  : centerTruncate(connectedAddress || "")}
98
101
  </span>
99
102
 
103
+ <PaymentMethodSwitch currentMethod={cryptoPaymentMethod} onMethodChange={onPaymentMethodChange} />
104
+
100
105
  <div className="mt-4">
101
106
  <OrderDetailsCollapsible
102
107
  order={order}