@b3dotfun/sdk 0.1.0 → 0.1.1-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/react/components/AnySpend.js +1 -1
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +15 -10
- package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +22 -14
- package/dist/cjs/anyspend/react/components/QRDeposit.js +31 -5
- package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +9 -2
- package/dist/cjs/anyspend/react/components/common/GasIndicator.d.ts +1 -1
- package/dist/cjs/anyspend/react/components/common/GasIndicator.js +6 -16
- package/dist/cjs/anyspend/react/components/common/TokenBalance.js +15 -4
- package/dist/cjs/anyspend/react/components/common/TransferResultScreen.d.ts +22 -0
- package/dist/cjs/anyspend/react/components/common/TransferResultScreen.js +25 -0
- package/dist/cjs/anyspend/react/hooks/index.d.ts +1 -0
- package/dist/cjs/anyspend/react/hooks/index.js +1 -0
- package/dist/cjs/anyspend/react/hooks/useWatchTransfer.d.ts +41 -0
- package/dist/cjs/anyspend/react/hooks/useWatchTransfer.js +75 -0
- package/dist/cjs/anyspend/react/providers/AnyspendProvider.js +1 -2
- package/dist/cjs/anyspend/utils/address.d.ts +5 -0
- package/dist/cjs/anyspend/utils/address.js +8 -0
- package/dist/cjs/global-account/react/components/AccountAssets/AccountAssets.js +7 -3
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +4 -14
- package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +31 -0
- package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.js +37 -0
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +2 -1
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +3 -31
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.js +4 -31
- package/dist/cjs/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +3 -1
- package/dist/cjs/global-account/react/components/B3Provider/LocalSDKProvider.js +3 -1
- package/dist/cjs/global-account/react/components/B3Provider/useB3.d.ts +1 -12
- package/dist/cjs/global-account/react/components/B3Provider/useB3Config.d.ts +1 -17
- package/dist/cjs/global-account/react/components/B3Provider/useB3Config.js +2 -21
- package/dist/cjs/global-account/react/components/ManageAccount/NFTContent.js +2 -2
- package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +12 -1
- package/dist/cjs/global-account/react/components/SingleUserSearchSelector/SingleUserSearchSelector.d.ts +64 -0
- package/dist/cjs/global-account/react/components/SingleUserSearchSelector/SingleUserSearchSelector.js +163 -0
- package/dist/cjs/global-account/react/components/SingleUserSearchSelector/index.d.ts +2 -0
- package/dist/cjs/global-account/react/components/SingleUserSearchSelector/index.js +5 -0
- package/dist/cjs/global-account/react/components/WalletImage/WalletImage.d.ts +1 -1
- package/dist/cjs/global-account/react/components/index.d.ts +2 -0
- package/dist/cjs/global-account/react/components/index.js +6 -3
- package/dist/cjs/global-account/react/hooks/index.d.ts +2 -1
- package/dist/cjs/global-account/react/hooks/index.js +5 -1
- package/dist/cjs/global-account/react/hooks/useAuthentication.js +5 -2
- package/dist/cjs/global-account/react/hooks/useProfile.js +4 -23
- package/dist/cjs/global-account/react/hooks/useSimBalance.d.ts +7 -0
- package/dist/cjs/global-account/react/hooks/useSimBalance.js +43 -11
- package/dist/cjs/global-account/react/hooks/useSimCollectibles.d.ts +45 -0
- package/dist/cjs/global-account/react/hooks/useSimCollectibles.js +190 -0
- package/dist/cjs/global-account/react/stores/index.d.ts +0 -1
- package/dist/cjs/global-account/react/stores/index.js +1 -3
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +63 -1
- package/dist/cjs/global-account/react/stores/useModalStore.js +3 -0
- package/dist/cjs/global-account/react/utils/profileApi.d.ts +13 -0
- package/dist/cjs/global-account/react/utils/profileApi.js +29 -0
- package/dist/cjs/global-account/react/utils/simdune.d.ts +7 -0
- package/dist/cjs/global-account/react/utils/simdune.js +21 -0
- package/dist/esm/anyspend/react/components/AnySpend.js +1 -1
- package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +15 -10
- package/dist/esm/anyspend/react/components/AnySpendDeposit.js +23 -15
- package/dist/esm/anyspend/react/components/QRDeposit.js +32 -6
- package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +10 -3
- package/dist/esm/anyspend/react/components/common/GasIndicator.d.ts +1 -1
- package/dist/esm/anyspend/react/components/common/GasIndicator.js +7 -17
- package/dist/esm/anyspend/react/components/common/TokenBalance.js +16 -5
- package/dist/esm/anyspend/react/components/common/TransferResultScreen.d.ts +22 -0
- package/dist/esm/anyspend/react/components/common/TransferResultScreen.js +22 -0
- package/dist/esm/anyspend/react/hooks/index.d.ts +1 -0
- package/dist/esm/anyspend/react/hooks/index.js +1 -0
- package/dist/esm/anyspend/react/hooks/useWatchTransfer.d.ts +41 -0
- package/dist/esm/anyspend/react/hooks/useWatchTransfer.js +72 -0
- package/dist/esm/anyspend/react/providers/AnyspendProvider.js +1 -2
- package/dist/esm/anyspend/utils/address.d.ts +5 -0
- package/dist/esm/anyspend/utils/address.js +7 -0
- package/dist/esm/global-account/react/components/AccountAssets/AccountAssets.js +7 -3
- package/dist/esm/global-account/react/components/B3DynamicModal.js +5 -15
- package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +31 -0
- package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.js +33 -0
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +2 -1
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +3 -31
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.js +3 -30
- package/dist/esm/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +3 -1
- package/dist/esm/global-account/react/components/B3Provider/LocalSDKProvider.js +3 -1
- package/dist/esm/global-account/react/components/B3Provider/useB3.d.ts +1 -12
- package/dist/esm/global-account/react/components/B3Provider/useB3Config.d.ts +1 -17
- package/dist/esm/global-account/react/components/B3Provider/useB3Config.js +1 -20
- package/dist/esm/global-account/react/components/ManageAccount/NFTContent.js +3 -3
- package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +13 -2
- package/dist/esm/global-account/react/components/SingleUserSearchSelector/SingleUserSearchSelector.d.ts +64 -0
- package/dist/esm/global-account/react/components/SingleUserSearchSelector/SingleUserSearchSelector.js +160 -0
- package/dist/esm/global-account/react/components/SingleUserSearchSelector/index.d.ts +2 -0
- package/dist/esm/global-account/react/components/SingleUserSearchSelector/index.js +1 -0
- package/dist/esm/global-account/react/components/WalletImage/WalletImage.d.ts +1 -1
- package/dist/esm/global-account/react/components/index.d.ts +2 -0
- package/dist/esm/global-account/react/components/index.js +2 -0
- package/dist/esm/global-account/react/hooks/index.d.ts +2 -1
- package/dist/esm/global-account/react/hooks/index.js +2 -1
- package/dist/esm/global-account/react/hooks/useAuthentication.js +5 -2
- package/dist/esm/global-account/react/hooks/useProfile.js +1 -20
- package/dist/esm/global-account/react/hooks/useSimBalance.d.ts +7 -0
- package/dist/esm/global-account/react/hooks/useSimBalance.js +42 -11
- package/dist/esm/global-account/react/hooks/useSimCollectibles.d.ts +45 -0
- package/dist/esm/global-account/react/hooks/useSimCollectibles.js +187 -0
- package/dist/esm/global-account/react/stores/index.d.ts +0 -1
- package/dist/esm/global-account/react/stores/index.js +0 -1
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +63 -1
- package/dist/esm/global-account/react/stores/useModalStore.js +3 -0
- package/dist/esm/global-account/react/utils/profileApi.d.ts +13 -0
- package/dist/esm/global-account/react/utils/profileApi.js +25 -0
- package/dist/esm/global-account/react/utils/simdune.d.ts +7 -0
- package/dist/esm/global-account/react/utils/simdune.js +17 -0
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +15 -10
- package/dist/types/anyspend/react/components/common/GasIndicator.d.ts +1 -1
- package/dist/types/anyspend/react/components/common/TransferResultScreen.d.ts +22 -0
- package/dist/types/anyspend/react/hooks/index.d.ts +1 -0
- package/dist/types/anyspend/react/hooks/useWatchTransfer.d.ts +41 -0
- package/dist/types/anyspend/utils/address.d.ts +5 -0
- package/dist/types/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +31 -0
- package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +2 -1
- package/dist/types/global-account/react/components/B3Provider/LocalSDKProvider.d.ts +3 -1
- package/dist/types/global-account/react/components/B3Provider/useB3.d.ts +1 -12
- package/dist/types/global-account/react/components/B3Provider/useB3Config.d.ts +1 -17
- package/dist/types/global-account/react/components/SingleUserSearchSelector/SingleUserSearchSelector.d.ts +64 -0
- package/dist/types/global-account/react/components/SingleUserSearchSelector/index.d.ts +2 -0
- package/dist/types/global-account/react/components/WalletImage/WalletImage.d.ts +1 -1
- package/dist/types/global-account/react/components/index.d.ts +2 -0
- package/dist/types/global-account/react/hooks/index.d.ts +2 -1
- package/dist/types/global-account/react/hooks/useSimBalance.d.ts +7 -0
- package/dist/types/global-account/react/hooks/useSimCollectibles.d.ts +45 -0
- package/dist/types/global-account/react/stores/index.d.ts +0 -1
- package/dist/types/global-account/react/stores/useModalStore.d.ts +63 -1
- package/dist/types/global-account/react/utils/profileApi.d.ts +13 -0
- package/dist/types/global-account/react/utils/simdune.d.ts +7 -0
- package/package.json +6 -1
- package/src/anyspend/react/components/AnySpend.tsx +1 -0
- package/src/anyspend/react/components/AnySpendDeposit.tsx +60 -42
- package/src/anyspend/react/components/QRDeposit.tsx +57 -5
- package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +13 -3
- package/src/anyspend/react/components/common/GasIndicator.tsx +11 -30
- package/src/anyspend/react/components/common/TokenBalance.tsx +17 -5
- package/src/anyspend/react/components/common/TransferResultScreen.tsx +107 -0
- package/src/anyspend/react/hooks/index.ts +1 -0
- package/src/anyspend/react/hooks/useWatchTransfer.ts +114 -0
- package/src/anyspend/react/providers/AnyspendProvider.tsx +2 -5
- package/src/anyspend/utils/address.ts +13 -0
- package/src/global-account/react/components/AccountAssets/AccountAssets.tsx +25 -13
- package/src/global-account/react/components/B3DynamicModal.tsx +5 -17
- package/src/global-account/react/components/B3Provider/B3ConfigProvider.tsx +84 -0
- package/src/global-account/react/components/B3Provider/B3Provider.native.tsx +28 -36
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +24 -39
- package/src/global-account/react/components/B3Provider/LocalSDKProvider.tsx +5 -0
- package/src/global-account/react/components/B3Provider/useB3Config.ts +1 -21
- package/src/global-account/react/components/ManageAccount/NFTContent.tsx +4 -4
- package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +13 -2
- package/src/global-account/react/components/SingleUserSearchSelector/README.md +266 -0
- package/src/global-account/react/components/SingleUserSearchSelector/SingleUserSearchSelector.tsx +330 -0
- package/src/global-account/react/components/SingleUserSearchSelector/index.ts +2 -0
- package/src/global-account/react/components/index.ts +7 -0
- package/src/global-account/react/hooks/index.ts +2 -1
- package/src/global-account/react/hooks/useAuthentication.ts +6 -2
- package/src/global-account/react/hooks/useProfile.ts +1 -32
- package/src/global-account/react/hooks/useSimBalance.ts +49 -12
- package/src/global-account/react/hooks/useSimCollectibles.ts +238 -0
- package/src/global-account/react/stores/index.ts +0 -1
- package/src/global-account/react/stores/useModalStore.ts +67 -1
- package/src/global-account/react/utils/profileApi.ts +38 -0
- package/src/global-account/react/utils/simdune.ts +20 -0
- package/dist/cjs/global-account/react/stores/configStore.d.ts +0 -24
- package/dist/cjs/global-account/react/stores/configStore.js +0 -30
- package/dist/esm/global-account/react/stores/configStore.d.ts +0 -24
- package/dist/esm/global-account/react/stores/configStore.js +0 -27
- package/dist/types/global-account/react/stores/configStore.d.ts +0 -24
- package/src/global-account/react/stores/configStore.ts +0 -51
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface TransferResult {
|
|
2
|
+
amount: string;
|
|
3
|
+
formattedAmount: string;
|
|
4
|
+
txHash?: string;
|
|
5
|
+
timestamp: number;
|
|
6
|
+
}
|
|
7
|
+
export interface UseWatchTransferProps {
|
|
8
|
+
/** Address to watch for incoming transfers */
|
|
9
|
+
address: string;
|
|
10
|
+
/** Chain ID to watch on */
|
|
11
|
+
chainId: number;
|
|
12
|
+
/** Token address (use zero address for native token) */
|
|
13
|
+
tokenAddress: string;
|
|
14
|
+
/** Token decimals */
|
|
15
|
+
tokenDecimals: number;
|
|
16
|
+
/** Whether watching is enabled */
|
|
17
|
+
enabled?: boolean;
|
|
18
|
+
/** Callback when a transfer is detected */
|
|
19
|
+
onTransferDetected?: (result: TransferResult) => void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Hook to watch for incoming transfers to an address by monitoring balance changes.
|
|
23
|
+
* When a transfer is detected (balance increases), it captures the amount and notifies.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useWatchTransfer({ address, chainId, tokenAddress, tokenDecimals, enabled, onTransferDetected, }: UseWatchTransferProps): {
|
|
26
|
+
/** Whether currently watching for transfers */
|
|
27
|
+
isWatching: boolean;
|
|
28
|
+
/** The detected transfer result, if any */
|
|
29
|
+
transferResult: TransferResult | null;
|
|
30
|
+
/** Whether a transfer has been detected */
|
|
31
|
+
hasTransfer: boolean;
|
|
32
|
+
/** Reset and start watching again */
|
|
33
|
+
reset: () => void;
|
|
34
|
+
/** Manually refetch balance */
|
|
35
|
+
refetchBalance: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<{
|
|
36
|
+
decimals: number;
|
|
37
|
+
formatted: string;
|
|
38
|
+
symbol: string;
|
|
39
|
+
value: bigint;
|
|
40
|
+
}, import("viem").GetBalanceErrorType>>;
|
|
41
|
+
};
|
|
@@ -13,3 +13,8 @@ export declare function isEvmOrSolanaAddress(address: string): boolean;
|
|
|
13
13
|
export declare function isHyperliquidUSDC(chainId: number, address: string): boolean;
|
|
14
14
|
export declare function normalizeAddress(address: string): string;
|
|
15
15
|
export declare function eqci(a: string | null | undefined, b: string | null | undefined): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Check if source and destination represent the same token on the same chain.
|
|
18
|
+
* When true, this is a pure transfer (no swap/bridge needed).
|
|
19
|
+
*/
|
|
20
|
+
export declare function isSameChainAndToken(sourceChainId: number, sourceTokenAddress: string, destinationChainId: number, destinationTokenAddress: string): boolean;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { CreateOnrampOrderParams } from "@b3dotfun/sdk/anyspend/react/hooks/useAnyspendCreateOnrampOrder";
|
|
2
|
+
import { CreateOrderParams } from "@b3dotfun/sdk/anyspend/react/hooks/useAnyspendCreateOrder";
|
|
3
|
+
import { PermissionsConfig } from "@b3dotfun/sdk/global-account/types/permissions";
|
|
4
|
+
import { Account } from "thirdweb/wallets";
|
|
5
|
+
import { ClientType } from "../../../client-manager";
|
|
6
|
+
export interface B3ConfigContextType {
|
|
7
|
+
accountOverride?: Account;
|
|
8
|
+
automaticallySetFirstEoa: boolean;
|
|
9
|
+
environment: "development" | "production";
|
|
10
|
+
defaultPermissions: PermissionsConfig;
|
|
11
|
+
theme: "light" | "dark";
|
|
12
|
+
clientType: ClientType;
|
|
13
|
+
partnerId: string;
|
|
14
|
+
stripePublishableKey?: string;
|
|
15
|
+
createClientReferenceId?: (params: CreateOrderParams | CreateOnrampOrderParams) => Promise<string>;
|
|
16
|
+
enableTurnkey: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function B3ConfigProvider({ children, accountOverride, environment, defaultPermissions, automaticallySetFirstEoa, theme, clientType, partnerId, stripePublishableKey, createClientReferenceId, enableTurnkey, }: {
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
accountOverride?: Account;
|
|
21
|
+
environment?: "development" | "production";
|
|
22
|
+
defaultPermissions?: PermissionsConfig;
|
|
23
|
+
automaticallySetFirstEoa?: boolean;
|
|
24
|
+
theme?: "light" | "dark";
|
|
25
|
+
clientType?: ClientType;
|
|
26
|
+
partnerId: string;
|
|
27
|
+
stripePublishableKey?: string;
|
|
28
|
+
createClientReferenceId?: (params: CreateOrderParams | CreateOnrampOrderParams) => Promise<string>;
|
|
29
|
+
enableTurnkey?: boolean;
|
|
30
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare function useB3Config(): B3ConfigContextType;
|
|
@@ -8,7 +8,7 @@ import { ClientType } from "../../../client-manager";
|
|
|
8
8
|
/**
|
|
9
9
|
* Main B3Provider component
|
|
10
10
|
*/
|
|
11
|
-
export declare function B3Provider({ theme, children, accountOverride, environment, automaticallySetFirstEoa, simDuneApiKey, toaster: _toaster, clientType, rpcUrls, partnerId, stripePublishableKey, onConnect, connectors, overrideDefaultConnectors, createClientReferenceId, enableTurnkey, defaultPermissions, }: {
|
|
11
|
+
export declare function B3Provider({ theme, children, accountOverride, environment, automaticallySetFirstEoa, simDuneApiKey, toaster: _toaster, clientType, rpcUrls, partnerId, stripePublishableKey, onConnect, onLogout, connectors, overrideDefaultConnectors, createClientReferenceId, enableTurnkey, defaultPermissions, }: {
|
|
12
12
|
theme: "light" | "dark";
|
|
13
13
|
children: React.ReactNode;
|
|
14
14
|
accountOverride?: Account;
|
|
@@ -25,6 +25,7 @@ export declare function B3Provider({ theme, children, accountOverride, environme
|
|
|
25
25
|
/** Partner-specific Stripe publishable key. If not provided, uses default B3 Stripe account. */
|
|
26
26
|
stripePublishableKey?: string;
|
|
27
27
|
onConnect?: (wallet: Wallet, b3Jwt: string) => void | Promise<void>;
|
|
28
|
+
onLogout?: () => void | Promise<void>;
|
|
28
29
|
connectors?: CreateConnectorFn[];
|
|
29
30
|
overrideDefaultConnectors?: boolean;
|
|
30
31
|
createClientReferenceId?: (params: CreateOrderParams | CreateOnrampOrderParams) => Promise<string>;
|
|
@@ -5,12 +5,14 @@ import { Wallet } from "thirdweb/wallets";
|
|
|
5
5
|
*/
|
|
6
6
|
export interface LocalSDKContextType {
|
|
7
7
|
onConnectCallback?: (wallet: Wallet, b3Jwt: string) => void | Promise<void>;
|
|
8
|
+
onLogoutCallback?: () => void | Promise<void>;
|
|
8
9
|
}
|
|
9
10
|
export declare const LocalSDKContext: import("react").Context<LocalSDKContextType>;
|
|
10
11
|
/**
|
|
11
12
|
* Local SDK Provider that wraps the app and provides internal SDK state
|
|
12
13
|
*/
|
|
13
|
-
export declare function LocalSDKProvider({ children, onConnectCallback, }: {
|
|
14
|
+
export declare function LocalSDKProvider({ children, onConnectCallback, onLogoutCallback, }: {
|
|
14
15
|
children: React.ReactNode;
|
|
15
16
|
onConnectCallback?: (wallet: Wallet, b3Jwt: string) => void | Promise<void>;
|
|
17
|
+
onLogoutCallback?: () => void | Promise<void>;
|
|
16
18
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,15 +2,4 @@
|
|
|
2
2
|
* Hook to access the B3 configuration
|
|
3
3
|
* @deprecated This is just an alias for useB3Config. Use useB3Config directly instead.
|
|
4
4
|
*/
|
|
5
|
-
export declare function useB3():
|
|
6
|
-
automaticallySetFirstEoa: boolean;
|
|
7
|
-
environment: "development" | "production";
|
|
8
|
-
theme: "light" | "dark";
|
|
9
|
-
clientType: import("../../../client-manager").ClientType;
|
|
10
|
-
partnerId: string;
|
|
11
|
-
createClientReferenceId: ((params: import("../../../../anyspend/react").CreateOrderParams | import("../../../../anyspend/react").CreateOnrampOrderParams) => Promise<string>) | undefined;
|
|
12
|
-
enableTurnkey: boolean;
|
|
13
|
-
stripePublishableKey: string | undefined;
|
|
14
|
-
defaultPermissions: import("../../../types/permissions").PermissionsConfig;
|
|
15
|
-
accountOverride: import("thirdweb/wallets").Account | undefined;
|
|
16
|
-
};
|
|
5
|
+
export declare function useB3(): import("./B3ConfigProvider").B3ConfigContextType;
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Hook to access B3 configuration
|
|
3
|
-
* Returns all config values from the Zustand store
|
|
4
|
-
* Since config is static (set once at initialization), destructuring is fine here
|
|
5
|
-
*/
|
|
6
|
-
export declare const useB3Config: () => {
|
|
7
|
-
automaticallySetFirstEoa: boolean;
|
|
8
|
-
environment: "development" | "production";
|
|
9
|
-
theme: "light" | "dark";
|
|
10
|
-
clientType: import("../../../client-manager").ClientType;
|
|
11
|
-
partnerId: string;
|
|
12
|
-
createClientReferenceId: ((params: import("../../../../anyspend/react").CreateOrderParams | import("../../../../anyspend/react").CreateOnrampOrderParams) => Promise<string>) | undefined;
|
|
13
|
-
enableTurnkey: boolean;
|
|
14
|
-
stripePublishableKey: string | undefined;
|
|
15
|
-
defaultPermissions: import("../../../types/permissions").PermissionsConfig;
|
|
16
|
-
accountOverride: import("thirdweb/wallets").Account | undefined;
|
|
17
|
-
};
|
|
1
|
+
export { useB3Config } from "./B3ConfigProvider";
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { CombinedProfile } from "../../hooks/useProfile";
|
|
2
|
+
/**
|
|
3
|
+
* Profile type filter options for SingleUserSearchSelector
|
|
4
|
+
* - b3-ens: B3 ENS profiles
|
|
5
|
+
* - thirdweb-${string}: Thirdweb profiles (e.g., thirdweb-email, thirdweb-wallet)
|
|
6
|
+
* - ens-data: ENS data profiles
|
|
7
|
+
* - global-account: Global account profiles
|
|
8
|
+
*/
|
|
9
|
+
export type ProfileTypeFilter = "b3-ens" | `thirdweb-${string}` | "ens-data" | "global-account";
|
|
10
|
+
export interface SingleUserSearchSelectorProps {
|
|
11
|
+
/**
|
|
12
|
+
* Callback function when a user is selected
|
|
13
|
+
* Returns the complete profile data including all profile types
|
|
14
|
+
*/
|
|
15
|
+
onSelectUser: (profile: CombinedProfile) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Optional: Filter results to only show profiles that include specific types
|
|
18
|
+
* If provided, only profiles containing at least one of these types will be shown
|
|
19
|
+
*/
|
|
20
|
+
profileTypeFilter?: ProfileTypeFilter[];
|
|
21
|
+
/**
|
|
22
|
+
* Optional: Custom placeholder text for the search input
|
|
23
|
+
*/
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Optional: Custom class name for the container
|
|
27
|
+
*/
|
|
28
|
+
className?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Optional: Show clear button when there's input
|
|
31
|
+
*/
|
|
32
|
+
showClearButton?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Optional: Show profile type badges in the result
|
|
35
|
+
*/
|
|
36
|
+
showBadges?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Optional: Minimum characters before triggering search
|
|
39
|
+
*/
|
|
40
|
+
minSearchLength?: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* SingleUserSearchSelector Component
|
|
44
|
+
*
|
|
45
|
+
* A specialized component for searching and selecting a single user profile.
|
|
46
|
+
* This component is designed specifically for single-user selection scenarios,
|
|
47
|
+
* not for multi-user or general profile browsing.
|
|
48
|
+
*
|
|
49
|
+
* Features:
|
|
50
|
+
* - Search by address or name
|
|
51
|
+
* - Filter results by profile type (b3-ens, thirdweb-*, ens-data, global-account)
|
|
52
|
+
* - Shows a single result in a dropdown
|
|
53
|
+
* - Callback with complete profile data on selection
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```tsx
|
|
57
|
+
* <SingleUserSearchSelector
|
|
58
|
+
* onSelectUser={(profile) => console.log('Selected:', profile)}
|
|
59
|
+
* profileTypeFilter={['b3-ens', 'global-account']}
|
|
60
|
+
* placeholder="Search by address or name..."
|
|
61
|
+
* />
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export declare function SingleUserSearchSelector({ onSelectUser, profileTypeFilter, placeholder, className, showClearButton, showBadges, minSearchLength, }: SingleUserSearchSelectorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
declare const WalletImage: ({ fallback }: {
|
|
2
2
|
fallback?: React.ReactNode;
|
|
3
|
-
}) => string | number | bigint | true |
|
|
3
|
+
}) => string | number | bigint | true | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null;
|
|
4
4
|
export default WalletImage;
|
|
@@ -24,6 +24,8 @@ export { AccountAssets } from "./AccountAssets/AccountAssets";
|
|
|
24
24
|
export { MintButton } from "./MintButton/MintButton";
|
|
25
25
|
export { SendETHButton } from "./SendETHButton/SendETHButton";
|
|
26
26
|
export { SendERC20Button } from "./SendERC20Button/SendERC20Button";
|
|
27
|
+
export { SingleUserSearchSelector } from "./SingleUserSearchSelector/SingleUserSearchSelector";
|
|
28
|
+
export type { ProfileTypeFilter, SingleUserSearchSelectorProps, } from "./SingleUserSearchSelector/SingleUserSearchSelector";
|
|
27
29
|
export { Button as CustomButton, buttonVariants as customButtonVariants } from "./custom/Button";
|
|
28
30
|
export { ClientOnly } from "./custom/ClientOnly";
|
|
29
31
|
export { CopyToClipboard } from "./custom/CopyToClipboard";
|
|
@@ -30,7 +30,8 @@ export { useQueryBSMNT } from "./useQueryBSMNT";
|
|
|
30
30
|
export { useRemoveSessionKey } from "./useRemoveSessionKey";
|
|
31
31
|
export { useRouter } from "./useRouter";
|
|
32
32
|
export { useSearchParamsSSR } from "./useSearchParamsSSR";
|
|
33
|
-
export { useSimBalance, useSimSvmBalance } from "./useSimBalance";
|
|
33
|
+
export { useSimBalance, useSimSvmBalance, useSimTokenBalance } from "./useSimBalance";
|
|
34
|
+
export { useSimCollectibles } from "./useSimCollectibles";
|
|
34
35
|
export { useSiwe } from "./useSiwe";
|
|
35
36
|
export { useTokenBalance } from "./useTokenBalance";
|
|
36
37
|
export { useTokenBalanceDirect } from "./useTokenBalanceDirect";
|
|
@@ -50,3 +50,10 @@ export interface SvmBalanceResponse {
|
|
|
50
50
|
}
|
|
51
51
|
export declare function useSimBalance(address?: string, chainIdsParam?: number[]): import("@tanstack/react-query").UseQueryResult<SimBalanceResponse, Error>;
|
|
52
52
|
export declare function useSimSvmBalance(address?: string, chains?: ("solana" | "eclipse")[], limit?: number): import("@tanstack/react-query").UseQueryResult<SvmBalanceResponse, Error>;
|
|
53
|
+
/**
|
|
54
|
+
* Hook to fetch a single token balance for a wallet.
|
|
55
|
+
* @param walletAddress - The wallet address to fetch balance for
|
|
56
|
+
* @param tokenAddress - The token contract address, or "native" for native token (ETH, etc.)
|
|
57
|
+
* @param chainId - Chain ID to query (defaults to 1 for Ethereum mainnet)
|
|
58
|
+
*/
|
|
59
|
+
export declare function useSimTokenBalance(walletAddress?: string, tokenAddress?: string, chainId?: number): import("@tanstack/react-query").UseQueryResult<SimBalanceResponse, Error>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { SimpleHashNFTResponse } from "@b3dotfun/sdk/global-account/types/simplehash.types";
|
|
2
|
+
export interface SimCollectibleMetadata {
|
|
3
|
+
uri: string;
|
|
4
|
+
attributes?: Array<{
|
|
5
|
+
trait_type: string;
|
|
6
|
+
value: string;
|
|
7
|
+
display_type?: string | null;
|
|
8
|
+
}>;
|
|
9
|
+
}
|
|
10
|
+
export interface SimCollectibleEntry {
|
|
11
|
+
contract_address: string;
|
|
12
|
+
token_standard: "ERC721" | "ERC1155";
|
|
13
|
+
token_id: string;
|
|
14
|
+
chain: string;
|
|
15
|
+
chain_id: number;
|
|
16
|
+
name?: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
symbol?: string;
|
|
19
|
+
image_url?: string;
|
|
20
|
+
last_sale_price?: string;
|
|
21
|
+
metadata?: SimCollectibleMetadata;
|
|
22
|
+
is_spam?: boolean;
|
|
23
|
+
spam_score?: number;
|
|
24
|
+
explanations?: string[];
|
|
25
|
+
balance?: string;
|
|
26
|
+
last_acquired?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface SimCollectiblesResponse {
|
|
29
|
+
address: string;
|
|
30
|
+
entries: SimCollectibleEntry[];
|
|
31
|
+
next_offset?: string;
|
|
32
|
+
request_time: string;
|
|
33
|
+
response_time: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Hook to fetch NFT collectibles from Simdune API.
|
|
37
|
+
* Returns data in SimpleHash format for compatibility with AccountAssets component.
|
|
38
|
+
* @param address - Wallet address to fetch collectibles for
|
|
39
|
+
* @param chainIdsParam - Optional array of chain IDs to filter by
|
|
40
|
+
* @param options - Optional parameters (limit, filterSpam)
|
|
41
|
+
*/
|
|
42
|
+
export declare function useSimCollectibles(address?: string, chainIdsParam?: number[], options?: {
|
|
43
|
+
limit?: number;
|
|
44
|
+
filterSpam?: boolean;
|
|
45
|
+
}): import("@tanstack/react-query").UseQueryResult<SimpleHashNFTResponse, Error>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { useAuthStore } from "./useAuthStore";
|
|
2
|
-
export { useB3ConfigStore } from "./configStore";
|
|
3
2
|
export { useModalStore } from "./useModalStore";
|
|
4
3
|
export { useRecentAddressesStore } from "./useRecentAddressesStore";
|
|
5
4
|
export type { AnySpendBuySpinProps, AnySpendFundTournamentProps, AnySpendJoinTournamentProps, AnySpendModalProps, AnySpendNftProps, AnySpendOrderHistoryProps, AnySpendStakeB3Props, AnyspendOrderDetailsProps, ManageAccountModalProps, ModalContentType, RequestPermissionsModalProps, SignInWithB3ModalProps, } from "./useModalStore";
|
|
@@ -482,10 +482,70 @@ export interface AnySpendCollectorClubPurchaseProps extends BaseModalProps {
|
|
|
482
482
|
/** Force fiat payment */
|
|
483
483
|
forceFiatPayment?: boolean;
|
|
484
484
|
}
|
|
485
|
+
/**
|
|
486
|
+
* Props for the AnySpend Deposit modal
|
|
487
|
+
* Flexible deposit component with optional chain selection
|
|
488
|
+
*/
|
|
489
|
+
export interface AnySpendDepositModalProps extends BaseModalProps {
|
|
490
|
+
/** Modal type identifier */
|
|
491
|
+
type: "anySpendDeposit";
|
|
492
|
+
/** Order ID to load an existing order */
|
|
493
|
+
loadOrder?: string;
|
|
494
|
+
/** The recipient address for the deposit */
|
|
495
|
+
recipientAddress: string;
|
|
496
|
+
/** Payment type - crypto or fiat. If not set, shows chain selection first */
|
|
497
|
+
paymentType?: "crypto" | "fiat";
|
|
498
|
+
/** Source token address to pre-select */
|
|
499
|
+
sourceTokenAddress?: string;
|
|
500
|
+
/** Source chain ID to pre-select. If not provided, shows chain selection */
|
|
501
|
+
sourceTokenChainId?: number;
|
|
502
|
+
/** The destination token address */
|
|
503
|
+
destinationTokenAddress: string;
|
|
504
|
+
/** The destination chain ID */
|
|
505
|
+
destinationTokenChainId: number;
|
|
506
|
+
/** Callback when deposit succeeds */
|
|
507
|
+
onSuccess?: (amount: string) => void;
|
|
508
|
+
/** Callback for opening a custom modal (e.g., for special token handling) */
|
|
509
|
+
onOpenCustomModal?: () => void;
|
|
510
|
+
/** Custom footer content */
|
|
511
|
+
mainFooter?: React.ReactNode;
|
|
512
|
+
/** Called when a token is selected. Call event.preventDefault() to prevent default behavior */
|
|
513
|
+
onTokenSelect?: (token: components["schemas"]["Token"], event: {
|
|
514
|
+
preventDefault: () => void;
|
|
515
|
+
}) => void;
|
|
516
|
+
/** Custom USD input value presets for fiat payment */
|
|
517
|
+
customUsdInputValues?: string[];
|
|
518
|
+
/** Whether to prefer using connected EOA wallet */
|
|
519
|
+
preferEoa?: boolean;
|
|
520
|
+
/** Minimum destination amount required */
|
|
521
|
+
minDestinationAmount?: number;
|
|
522
|
+
/** Order type for the deposit */
|
|
523
|
+
orderType?: "hype_duel" | "custom_exact_in" | "swap";
|
|
524
|
+
/** Custom action label displayed on buttons */
|
|
525
|
+
actionLabel?: string;
|
|
526
|
+
/** Whether to show chain selection step. Defaults to true if sourceTokenChainId is not provided */
|
|
527
|
+
showChainSelection?: boolean;
|
|
528
|
+
/** Minimum pool size for filtering tokens (default: 1,000,000) */
|
|
529
|
+
minPoolSize?: number;
|
|
530
|
+
/** Custom title for chain selection step */
|
|
531
|
+
chainSelectionTitle?: string;
|
|
532
|
+
/** Custom description for chain selection step */
|
|
533
|
+
chainSelectionDescription?: string;
|
|
534
|
+
/** Number of top chains to show (default: 3) */
|
|
535
|
+
topChainsCount?: number;
|
|
536
|
+
/** Custom URL to redirect to when clicking "Return to Home" on complete order screen */
|
|
537
|
+
returnToHomeUrl?: string;
|
|
538
|
+
/** Custom label for recipient display (e.g., "OBSN Telegram Bot") */
|
|
539
|
+
customRecipientLabel?: string;
|
|
540
|
+
/** Custom label for the return home button (overrides "Return to Home" / "Close") */
|
|
541
|
+
returnHomeLabel?: string;
|
|
542
|
+
/** Whether the deposit requires a custom function (uses AnySpendCustomExactIn). Defaults to false. */
|
|
543
|
+
isCustomDeposit?: boolean;
|
|
544
|
+
}
|
|
485
545
|
/**
|
|
486
546
|
* Union type of all possible modal content types
|
|
487
547
|
*/
|
|
488
|
-
export type ModalContentType = SignInWithB3ModalProps | TurnkeyAuthModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendStakeB3ExactInProps | AnySpendStakeUpsideProps | AnySpendStakeUpsideExactInProps | AnySpendDepositUpsideProps | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | LinkNewAccountModalProps | AnySpendDepositHypeProps | AvatarEditorModalProps | DepositModalProps | SendModalProps | NotificationsModalProps | AnySpendCollectorClubPurchaseProps;
|
|
548
|
+
export type ModalContentType = SignInWithB3ModalProps | TurnkeyAuthModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendStakeB3ExactInProps | AnySpendStakeUpsideProps | AnySpendStakeUpsideExactInProps | AnySpendDepositUpsideProps | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | LinkNewAccountModalProps | AnySpendDepositHypeProps | AvatarEditorModalProps | DepositModalProps | SendModalProps | NotificationsModalProps | AnySpendCollectorClubPurchaseProps | AnySpendDepositModalProps;
|
|
489
549
|
/**
|
|
490
550
|
* State interface for the modal store
|
|
491
551
|
*/
|
|
@@ -514,6 +574,8 @@ interface ModalState {
|
|
|
514
574
|
linkingMethod: string | null;
|
|
515
575
|
/** Function to set the linking state */
|
|
516
576
|
setLinkingState: (isLinking: boolean, method?: string | null) => void;
|
|
577
|
+
/** Function to update closable property of current content without adding to history */
|
|
578
|
+
setClosable: (closable: boolean) => void;
|
|
517
579
|
}
|
|
518
580
|
/**
|
|
519
581
|
* Zustand store for managing modal state
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CombinedProfile } from "../hooks/useProfile";
|
|
2
|
+
export declare const PROFILES_API_URL = "https://profiles.b3.fun";
|
|
3
|
+
/**
|
|
4
|
+
* Fetch a user profile from the B3 Profiles API
|
|
5
|
+
* @param params - Search parameters (address, name, or b3GlobalId)
|
|
6
|
+
* @returns Promise resolving to CombinedProfile or null if not found
|
|
7
|
+
*/
|
|
8
|
+
export declare function fetchProfile({ address, name, b3GlobalId, fresh, }: {
|
|
9
|
+
address?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
b3GlobalId?: string;
|
|
12
|
+
fresh?: boolean;
|
|
13
|
+
}): Promise<CombinedProfile>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const SIMDUNE_API_HOST = "https://simdune-api.sean-430.workers.dev";
|
|
2
|
+
/**
|
|
3
|
+
* Builds a Simdune API URL with the proxy wrapper and optional dev mode key.
|
|
4
|
+
* @param endpoint - The Simdune API endpoint (e.g., "/v1/evm/balances/0x...")
|
|
5
|
+
* @param queryParams - Optional URLSearchParams to append
|
|
6
|
+
*/
|
|
7
|
+
export declare function buildSimduneUrl(endpoint: string, queryParams?: URLSearchParams): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@b3dotfun/sdk",
|
|
3
|
-
"version": "0.1.0",
|
|
3
|
+
"version": "0.1.1-alpha.0",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"react-native": "./dist/cjs/index.native.js",
|
|
@@ -131,6 +131,11 @@
|
|
|
131
131
|
"require": "./dist/cjs/global-account/react/components/*.js"
|
|
132
132
|
}
|
|
133
133
|
},
|
|
134
|
+
"./global-account/react/components/SingleUserSearchSelector": {
|
|
135
|
+
"types": "./dist/types/global-account/react/components/SingleUserSearchSelector/index.d.ts",
|
|
136
|
+
"import": "./dist/esm/global-account/react/components/SingleUserSearchSelector/index.js",
|
|
137
|
+
"require": "./dist/cjs/global-account/react/components/SingleUserSearchSelector/index.js"
|
|
138
|
+
},
|
|
134
139
|
"./global-account/types": {
|
|
135
140
|
"types": "./dist/types/global-account/types.d.ts",
|
|
136
141
|
"import": "./dist/esm/global-account/types.js",
|