@b3dotfun/sdk 0.0.1-alpha.23 → 0.0.1-alpha.4
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.d.ts +1 -2
- package/dist/cjs/anyspend/react/components/AnySpend.js +4 -4
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.d.ts +1 -2
- package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +51 -124
- package/dist/cjs/anyspend/utils/chain.js +0 -3
- package/dist/cjs/global-account/react/components/B3DynamicModal.js +2 -2
- package/dist/{esm/global-account/react/components/B3Provider → cjs/global-account/react/components}/B3Provider.d.ts +29 -3
- package/dist/cjs/global-account/react/components/{B3Provider/B3Provider.js → B3Provider.js} +34 -6
- package/dist/cjs/global-account/react/components/{B3Provider/B3Provider.native.d.ts → B3Provider.native.d.ts} +25 -2
- package/dist/cjs/global-account/react/components/{B3Provider/B3Provider.native.js → B3Provider.native.js} +28 -5
- package/dist/cjs/global-account/react/components/StyleRoot.js +2 -2
- package/dist/cjs/global-account/react/components/index.d.ts +6 -8
- package/dist/cjs/global-account/react/components/index.js +16 -18
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +0 -2
- package/dist/cjs/global-account/types/chain-networks.d.ts +34 -34
- package/dist/cjs/global-account/types/feature-flags.d.ts +5 -5
- package/dist/cjs/shared/constants/chains/b3Chain.d.ts +1 -1
- package/dist/cjs/shared/constants/chains/supported.d.ts +3 -4
- package/dist/cjs/shared/constants/chains/supported.js +1 -3
- package/dist/cjs/shared/utils/chains.js +0 -4
- package/dist/esm/anyspend/react/components/AnySpend.d.ts +1 -2
- package/dist/esm/anyspend/react/components/AnySpend.js +4 -4
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.d.ts +1 -2
- package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +51 -124
- package/dist/esm/anyspend/utils/chain.js +0 -3
- package/dist/esm/global-account/react/components/B3DynamicModal.js +1 -1
- package/dist/{cjs/global-account/react/components/B3Provider → esm/global-account/react/components}/B3Provider.d.ts +29 -3
- package/dist/esm/global-account/react/components/{B3Provider/B3Provider.js → B3Provider.js} +32 -5
- package/dist/esm/global-account/react/components/{B3Provider/B3Provider.native.d.ts → B3Provider.native.d.ts} +25 -2
- package/dist/esm/global-account/react/components/{B3Provider/B3Provider.native.js → B3Provider.native.js} +26 -5
- package/dist/esm/global-account/react/components/StyleRoot.js +1 -1
- package/dist/esm/global-account/react/components/index.d.ts +6 -8
- package/dist/esm/global-account/react/components/index.js +5 -7
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +0 -2
- package/dist/esm/global-account/types/chain-networks.d.ts +34 -34
- package/dist/esm/global-account/types/feature-flags.d.ts +5 -5
- package/dist/esm/shared/constants/chains/b3Chain.d.ts +1 -1
- package/dist/esm/shared/constants/chains/supported.d.ts +3 -4
- package/dist/esm/shared/constants/chains/supported.js +0 -2
- package/dist/esm/shared/utils/chains.js +0 -4
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/react/components/AnySpend.d.ts +1 -2
- package/dist/types/anyspend/react/components/AnySpendBuySpin.d.ts +1 -2
- package/dist/types/global-account/react/components/{B3Provider/B3Provider.d.ts → B3Provider.d.ts} +28 -2
- package/dist/types/global-account/react/components/{B3Provider/B3Provider.native.d.ts → B3Provider.native.d.ts} +24 -1
- package/dist/types/global-account/react/components/index.d.ts +6 -8
- package/dist/types/global-account/react/stores/useModalStore.d.ts +0 -2
- package/dist/types/global-account/types/chain-networks.d.ts +34 -34
- package/dist/types/global-account/types/feature-flags.d.ts +5 -5
- package/dist/types/shared/constants/chains/b3Chain.d.ts +1 -1
- package/dist/types/shared/constants/chains/supported.d.ts +3 -4
- package/package.json +11 -25
- package/src/anyspend/react/components/AnySpend.tsx +5 -6
- package/src/anyspend/react/components/AnySpendBuySpin.tsx +180 -233
- package/src/anyspend/utils/chain.ts +0 -3
- package/src/global-account/react/components/B3DynamicModal.tsx +1 -1
- package/src/global-account/react/components/{B3Provider/B3Provider.native.tsx → B3Provider.native.tsx} +45 -4
- package/src/global-account/react/components/{B3Provider/B3Provider.tsx → B3Provider.tsx} +53 -4
- package/src/global-account/react/components/StyleRoot.tsx +1 -1
- package/src/global-account/react/components/index.ts +6 -8
- package/src/global-account/react/stores/useModalStore.ts +0 -2
- package/src/shared/constants/chains/supported.ts +0 -2
- package/src/shared/utils/chains.ts +1 -4
- package/dist/cjs/anyspend/index.native.d.ts +0 -13
- package/dist/cjs/anyspend/index.native.js +0 -35
- package/dist/cjs/global-account/react/components/B3Provider/types.d.ts +0 -25
- package/dist/cjs/global-account/react/components/B3Provider/types.js +0 -20
- package/dist/cjs/global-account/react/components/B3Provider/useB3.d.ts +0 -5
- package/dist/cjs/global-account/react/components/B3Provider/useB3.js +0 -17
- package/dist/cjs/global-account/react/index.native.d.ts +0 -7
- package/dist/cjs/global-account/react/index.native.js +0 -21
- package/dist/esm/anyspend/index.native.d.ts +0 -13
- package/dist/esm/anyspend/index.native.js +0 -19
- package/dist/esm/global-account/react/components/B3Provider/types.d.ts +0 -25
- package/dist/esm/global-account/react/components/B3Provider/types.js +0 -17
- package/dist/esm/global-account/react/components/B3Provider/useB3.d.ts +0 -5
- package/dist/esm/global-account/react/components/B3Provider/useB3.js +0 -14
- package/dist/esm/global-account/react/index.native.d.ts +0 -7
- package/dist/esm/global-account/react/index.native.js +0 -11
- package/dist/types/anyspend/index.native.d.ts +0 -13
- package/dist/types/global-account/react/components/B3Provider/types.d.ts +0 -25
- package/dist/types/global-account/react/components/B3Provider/useB3.d.ts +0 -5
- package/dist/types/global-account/react/index.native.d.ts +0 -7
- package/src/anyspend/index.native.ts +0 -24
- package/src/global-account/react/components/B3Provider/types.ts +0 -40
- package/src/global-account/react/components/B3Provider/useB3.ts +0 -17
- package/src/global-account/react/index.native.ts +0 -14
|
@@ -2,16 +2,15 @@ import { User } from "@b3dotfun/sdk/global-account/types/b3-api.types";
|
|
|
2
2
|
import { PermissionsConfig } from "@b3dotfun/sdk/global-account/types/permissions";
|
|
3
3
|
import { supportedChains } from "@b3dotfun/sdk/shared/constants/chains/supported";
|
|
4
4
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
5
|
-
import { useEffect, useState } from "react";
|
|
5
|
+
import { createContext, useContext, useEffect, useMemo, useState } from "react";
|
|
6
6
|
import { Toaster } from "sonner";
|
|
7
7
|
import { ThirdwebProvider, useActiveAccount, useConnectedWallets, useSetActiveWallet } from "thirdweb/react";
|
|
8
8
|
import { Account, Wallet } from "thirdweb/wallets";
|
|
9
9
|
import { createConfig, http, WagmiProvider } from "wagmi";
|
|
10
|
-
import { RelayKitProviderWrapper } from "
|
|
11
|
-
import { StyleRoot } from "
|
|
10
|
+
import { RelayKitProviderWrapper } from "./RelayKitProviderWrapper";
|
|
11
|
+
import { StyleRoot } from "./StyleRoot";
|
|
12
12
|
|
|
13
13
|
import "@reservoir0x/relay-kit-ui/styles.css";
|
|
14
|
-
import { B3Context, B3ContextType } from "./types";
|
|
15
14
|
|
|
16
15
|
/**
|
|
17
16
|
* Default permissions configuration for B3 provider
|
|
@@ -28,6 +27,56 @@ export const wagmiConfig = createConfig({
|
|
|
28
27
|
transports: Object.fromEntries(supportedChains.map(chain => [chain.id, http()])) as any
|
|
29
28
|
});
|
|
30
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Context type for B3Provider
|
|
32
|
+
*/
|
|
33
|
+
export interface B3ContextType {
|
|
34
|
+
account?: Account;
|
|
35
|
+
automaticallySetFirstEoa: boolean;
|
|
36
|
+
user?: User;
|
|
37
|
+
setAccount: (account: Account) => void;
|
|
38
|
+
setWallet: (wallet: Wallet) => void;
|
|
39
|
+
wallet?: Wallet;
|
|
40
|
+
setUser: (user?: User) => void;
|
|
41
|
+
initialized: boolean;
|
|
42
|
+
ready: boolean;
|
|
43
|
+
environment?: "development" | "production";
|
|
44
|
+
defaultPermissions?: PermissionsConfig;
|
|
45
|
+
theme: "light" | "dark";
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Context for B3 provider
|
|
50
|
+
*/
|
|
51
|
+
export const B3Context = createContext<B3ContextType>({
|
|
52
|
+
account: undefined,
|
|
53
|
+
automaticallySetFirstEoa: false,
|
|
54
|
+
user: undefined,
|
|
55
|
+
setAccount: () => {},
|
|
56
|
+
setWallet: () => {},
|
|
57
|
+
wallet: undefined,
|
|
58
|
+
setUser: () => {},
|
|
59
|
+
initialized: false,
|
|
60
|
+
ready: false,
|
|
61
|
+
environment: "development",
|
|
62
|
+
theme: "light"
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Hook to access the B3 context
|
|
67
|
+
* @throws Error if used outside a B3Provider
|
|
68
|
+
*/
|
|
69
|
+
export function useB3() {
|
|
70
|
+
const context = useContext(B3Context);
|
|
71
|
+
|
|
72
|
+
if (!context.initialized) {
|
|
73
|
+
throw new Error("useB3 must be used within a B3Provider");
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Return a stable reference
|
|
77
|
+
return useMemo(() => context, [context]);
|
|
78
|
+
}
|
|
79
|
+
|
|
31
80
|
// Create queryClient instance
|
|
32
81
|
const queryClient = new QueryClient();
|
|
33
82
|
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
// Core Components
|
|
2
2
|
export { B3DynamicModal } from "./B3DynamicModal";
|
|
3
|
-
export { B3Provider, InnerProvider } from "./B3Provider
|
|
4
|
-
export { useB3 } from "./B3Provider/useB3";
|
|
5
|
-
export { B3Context, type B3ContextType } from "./B3Provider/types";
|
|
3
|
+
export { B3Context, B3Provider, InnerProvider, useB3, type B3ContextType } from "./B3Provider";
|
|
6
4
|
export { RelayKitProviderWrapper } from "./RelayKitProviderWrapper";
|
|
7
5
|
export { StyleRoot } from "./StyleRoot";
|
|
8
6
|
|
|
9
7
|
// SignInWithB3 Components
|
|
10
|
-
export { AuthButton } from "./SignInWithB3/components/AuthButton";
|
|
11
|
-
export { PermissionItem } from "./SignInWithB3/components/PermissionItem";
|
|
12
|
-
export { WalletRow } from "./SignInWithB3/components/WalletRow";
|
|
13
8
|
export { SignInWithB3 } from "./SignInWithB3/SignInWithB3";
|
|
14
9
|
export { SignInWithB3Flow } from "./SignInWithB3/SignInWithB3Flow";
|
|
15
10
|
export { SignInWithB3Privy } from "./SignInWithB3/SignInWithB3Privy";
|
|
11
|
+
export { PermissionItem } from "./SignInWithB3/components/PermissionItem";
|
|
12
|
+
export { WalletRow } from "./SignInWithB3/components/WalletRow";
|
|
13
|
+
export { AuthButton } from "./SignInWithB3/components/AuthButton";
|
|
16
14
|
export { LoginStepContainer } from "./SignInWithB3/steps/LoginStep";
|
|
17
|
-
export { getConnectOptionsFromStrategy, isWalletType
|
|
15
|
+
export { type AllowedStrategy, getConnectOptionsFromStrategy, isWalletType } from "./SignInWithB3/utils/signInUtils";
|
|
18
16
|
|
|
19
17
|
// ManageAccount Components
|
|
20
18
|
export { ManageAccount } from "./ManageAccount/ManageAccount";
|
|
@@ -85,13 +83,13 @@ export { Popover, PopoverContent, PopoverTrigger } from "./ui/popover";
|
|
|
85
83
|
export { ScrollArea, ScrollBar } from "./ui/scroll-area";
|
|
86
84
|
export { ShinyButton } from "./ui/ShinyButton";
|
|
87
85
|
export { Skeleton } from "./ui/skeleton";
|
|
86
|
+
export { Tabs, TabsContent, TabsList, TabsTransitionWrapper, TabTrigger } from "./ui/TabSystem";
|
|
88
87
|
export {
|
|
89
88
|
TabsContent as TabsContentPrimitive,
|
|
90
89
|
TabsList as TabsListPrimitive,
|
|
91
90
|
Tabs as TabsPrimitive,
|
|
92
91
|
TabTrigger as TabTriggerPrimitive
|
|
93
92
|
} from "./ui/Tabs";
|
|
94
|
-
export { Tabs, TabsContent, TabsList, TabsTransitionWrapper, TabTrigger } from "./ui/TabSystem";
|
|
95
93
|
export { TextLoop } from "./ui/text-loop";
|
|
96
94
|
export { TextShimmer } from "./ui/text-shimmer";
|
|
97
95
|
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./ui/tooltip";
|
|
@@ -245,8 +245,6 @@ export interface AnySpendBuySpinProps extends BaseModalProps {
|
|
|
245
245
|
recipientAddress: string;
|
|
246
246
|
/** Callback function called when the spin purchase is successful */
|
|
247
247
|
onSuccess?: (txHash?: string) => void;
|
|
248
|
-
/** Prefill quantity of spins to purchase */
|
|
249
|
-
prefillQuantity?: string;
|
|
250
248
|
}
|
|
251
249
|
|
|
252
250
|
/**
|
|
@@ -31,8 +31,6 @@ export const b3Mainnet = supportedChains.find(chain => chain.id === 8333)!;
|
|
|
31
31
|
invariant(b3Mainnet, "B3 mainnet chain not found in supported chains");
|
|
32
32
|
export const b3Testnet = supportedChains.find(chain => chain.id === 1993)!;
|
|
33
33
|
invariant(b3Testnet, "B3 testnet chain not found in supported chains");
|
|
34
|
-
export const baseMainnet = supportedChains.find(chain => chain.id === 8453);
|
|
35
|
-
invariant(baseMainnet, "Base mainnet chain not found in supported chains");
|
|
36
34
|
|
|
37
35
|
export const b3MainnetThirdWeb = supportedChainsTW.find(chain => chain.id === 8333)!;
|
|
38
36
|
invariant(b3MainnetThirdWeb, "B3 mainnet chain not found in supported chains TW");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { supportedChains } from "@b3dotfun/sdk/shared/constants/chains/supported";
|
|
2
|
-
import {
|
|
2
|
+
import { Chain } from "viem/chains";
|
|
3
3
|
|
|
4
4
|
const baseChainBaseUrl = "https://basescan.org";
|
|
5
5
|
|
|
@@ -13,9 +13,6 @@ export function chainIdToName(id: number) {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export function getExplorerUrl(chain: Chain, txHash: string): string {
|
|
16
|
-
if (chain.id === b3.id) {
|
|
17
|
-
return "https://explorer.b3.fun/b3/tx/" + txHash;
|
|
18
|
-
}
|
|
19
16
|
let baseUrl = chain.blockExplorers?.default.url;
|
|
20
17
|
if (chain.id === 8453) {
|
|
21
18
|
baseUrl = baseChainBaseUrl;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export * from "./react/hooks";
|
|
2
|
-
export * from "./react/providers/AnyspendProvider";
|
|
3
|
-
export * from "./types";
|
|
4
|
-
export * from "./utils/address";
|
|
5
|
-
export * from "./utils/chain";
|
|
6
|
-
export * from "./utils/format";
|
|
7
|
-
export * from "./utils/json";
|
|
8
|
-
export * from "./utils/number";
|
|
9
|
-
export * from "./utils/string";
|
|
10
|
-
export * from "./utils/token";
|
|
11
|
-
export * from "./constants";
|
|
12
|
-
export * from "./abis/abi-usdc-base";
|
|
13
|
-
export * from "./abis/erc20-staking";
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
// Export all hooks
|
|
18
|
-
__exportStar(require("./react/hooks"), exports);
|
|
19
|
-
// Providers
|
|
20
|
-
__exportStar(require("./react/providers/AnyspendProvider"), exports);
|
|
21
|
-
// Types
|
|
22
|
-
__exportStar(require("./types"), exports);
|
|
23
|
-
// Utils
|
|
24
|
-
__exportStar(require("./utils/address"), exports);
|
|
25
|
-
__exportStar(require("./utils/chain"), exports);
|
|
26
|
-
__exportStar(require("./utils/format"), exports);
|
|
27
|
-
__exportStar(require("./utils/json"), exports);
|
|
28
|
-
__exportStar(require("./utils/number"), exports);
|
|
29
|
-
__exportStar(require("./utils/string"), exports);
|
|
30
|
-
__exportStar(require("./utils/token"), exports);
|
|
31
|
-
// Constants
|
|
32
|
-
__exportStar(require("./constants"), exports);
|
|
33
|
-
// Abis
|
|
34
|
-
__exportStar(require("./abis/abi-usdc-base"), exports);
|
|
35
|
-
__exportStar(require("./abis/erc20-staking"), exports);
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Account } from "thirdweb/wallets";
|
|
2
|
-
import { User } from "../../../../global-account/types/b3-api.types";
|
|
3
|
-
import { Wallet } from "thirdweb/wallets";
|
|
4
|
-
import { PermissionsConfig } from "../../../../global-account/types/permissions";
|
|
5
|
-
/**
|
|
6
|
-
* Context type for B3Provider
|
|
7
|
-
*/
|
|
8
|
-
export interface B3ContextType {
|
|
9
|
-
account?: Account;
|
|
10
|
-
automaticallySetFirstEoa: boolean;
|
|
11
|
-
user?: User;
|
|
12
|
-
setAccount: (account: Account) => void;
|
|
13
|
-
setWallet: (wallet: Wallet) => void;
|
|
14
|
-
wallet?: Wallet;
|
|
15
|
-
setUser: (user?: User) => void;
|
|
16
|
-
initialized: boolean;
|
|
17
|
-
ready: boolean;
|
|
18
|
-
environment?: "development" | "production";
|
|
19
|
-
defaultPermissions?: PermissionsConfig;
|
|
20
|
-
theme: "light" | "dark";
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Context for B3 provider
|
|
24
|
-
*/
|
|
25
|
-
export declare const B3Context: import("react").Context<B3ContextType>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.B3Context = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
/**
|
|
6
|
-
* Context for B3 provider
|
|
7
|
-
*/
|
|
8
|
-
exports.B3Context = (0, react_1.createContext)({
|
|
9
|
-
account: undefined,
|
|
10
|
-
automaticallySetFirstEoa: false,
|
|
11
|
-
user: undefined,
|
|
12
|
-
setAccount: () => { },
|
|
13
|
-
setWallet: () => { },
|
|
14
|
-
wallet: undefined,
|
|
15
|
-
setUser: () => { },
|
|
16
|
-
initialized: false,
|
|
17
|
-
ready: false,
|
|
18
|
-
environment: "development",
|
|
19
|
-
theme: "light"
|
|
20
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useB3 = useB3;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const types_1 = require("./types");
|
|
6
|
-
/**
|
|
7
|
-
* Hook to access the B3 context
|
|
8
|
-
* @throws Error if used outside a B3Provider
|
|
9
|
-
*/
|
|
10
|
-
function useB3() {
|
|
11
|
-
const context = (0, react_1.useContext)(types_1.B3Context);
|
|
12
|
-
if (!context.initialized) {
|
|
13
|
-
throw new Error("useB3 must be used within a B3Provider");
|
|
14
|
-
}
|
|
15
|
-
// Return a stable reference
|
|
16
|
-
return (0, react_1.useMemo)(() => context, [context]);
|
|
17
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { B3Provider } from "./components/B3Provider/B3Provider.native";
|
|
2
|
-
export { useB3 } from "./components/B3Provider/useB3";
|
|
3
|
-
export { B3Context, type B3ContextType } from "./components/B3Provider/types";
|
|
4
|
-
export { useAccountWallet } from "./hooks/useAccountWallet";
|
|
5
|
-
export { useAuthentication } from "./hooks/useAuthentication";
|
|
6
|
-
export { useSiwe } from "./hooks/useSiwe";
|
|
7
|
-
export { useAuthStore } from "./stores/useAuthStore";
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// export * from "./components";
|
|
3
|
-
// export * from "./hooks";
|
|
4
|
-
// export * from "./stores";
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useAuthStore = exports.useSiwe = exports.useAuthentication = exports.useAccountWallet = exports.B3Context = exports.useB3 = exports.B3Provider = void 0;
|
|
7
|
-
// We only export the components and hooks that are needed for the native app
|
|
8
|
-
var B3Provider_native_1 = require("./components/B3Provider/B3Provider.native");
|
|
9
|
-
Object.defineProperty(exports, "B3Provider", { enumerable: true, get: function () { return B3Provider_native_1.B3Provider; } });
|
|
10
|
-
var useB3_1 = require("./components/B3Provider/useB3");
|
|
11
|
-
Object.defineProperty(exports, "useB3", { enumerable: true, get: function () { return useB3_1.useB3; } });
|
|
12
|
-
var types_1 = require("./components/B3Provider/types");
|
|
13
|
-
Object.defineProperty(exports, "B3Context", { enumerable: true, get: function () { return types_1.B3Context; } });
|
|
14
|
-
var useAccountWallet_1 = require("./hooks/useAccountWallet");
|
|
15
|
-
Object.defineProperty(exports, "useAccountWallet", { enumerable: true, get: function () { return useAccountWallet_1.useAccountWallet; } });
|
|
16
|
-
var useAuthentication_1 = require("./hooks/useAuthentication");
|
|
17
|
-
Object.defineProperty(exports, "useAuthentication", { enumerable: true, get: function () { return useAuthentication_1.useAuthentication; } });
|
|
18
|
-
var useSiwe_1 = require("./hooks/useSiwe");
|
|
19
|
-
Object.defineProperty(exports, "useSiwe", { enumerable: true, get: function () { return useSiwe_1.useSiwe; } });
|
|
20
|
-
var useAuthStore_1 = require("./stores/useAuthStore");
|
|
21
|
-
Object.defineProperty(exports, "useAuthStore", { enumerable: true, get: function () { return useAuthStore_1.useAuthStore; } });
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export * from "./react/hooks";
|
|
2
|
-
export * from "./react/providers/AnyspendProvider";
|
|
3
|
-
export * from "./types";
|
|
4
|
-
export * from "./utils/address";
|
|
5
|
-
export * from "./utils/chain";
|
|
6
|
-
export * from "./utils/format";
|
|
7
|
-
export * from "./utils/json";
|
|
8
|
-
export * from "./utils/number";
|
|
9
|
-
export * from "./utils/string";
|
|
10
|
-
export * from "./utils/token";
|
|
11
|
-
export * from "./constants";
|
|
12
|
-
export * from "./abis/abi-usdc-base";
|
|
13
|
-
export * from "./abis/erc20-staking";
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// Export all hooks
|
|
2
|
-
export * from "./react/hooks";
|
|
3
|
-
// Providers
|
|
4
|
-
export * from "./react/providers/AnyspendProvider";
|
|
5
|
-
// Types
|
|
6
|
-
export * from "./types";
|
|
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";
|
|
15
|
-
// Constants
|
|
16
|
-
export * from "./constants";
|
|
17
|
-
// Abis
|
|
18
|
-
export * from "./abis/abi-usdc-base";
|
|
19
|
-
export * from "./abis/erc20-staking";
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Account } from "thirdweb/wallets";
|
|
2
|
-
import { User } from "../../../../global-account/types/b3-api.types";
|
|
3
|
-
import { Wallet } from "thirdweb/wallets";
|
|
4
|
-
import { PermissionsConfig } from "../../../../global-account/types/permissions";
|
|
5
|
-
/**
|
|
6
|
-
* Context type for B3Provider
|
|
7
|
-
*/
|
|
8
|
-
export interface B3ContextType {
|
|
9
|
-
account?: Account;
|
|
10
|
-
automaticallySetFirstEoa: boolean;
|
|
11
|
-
user?: User;
|
|
12
|
-
setAccount: (account: Account) => void;
|
|
13
|
-
setWallet: (wallet: Wallet) => void;
|
|
14
|
-
wallet?: Wallet;
|
|
15
|
-
setUser: (user?: User) => void;
|
|
16
|
-
initialized: boolean;
|
|
17
|
-
ready: boolean;
|
|
18
|
-
environment?: "development" | "production";
|
|
19
|
-
defaultPermissions?: PermissionsConfig;
|
|
20
|
-
theme: "light" | "dark";
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Context for B3 provider
|
|
24
|
-
*/
|
|
25
|
-
export declare const B3Context: import("react").Context<B3ContextType>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { createContext } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* Context for B3 provider
|
|
4
|
-
*/
|
|
5
|
-
export const B3Context = createContext({
|
|
6
|
-
account: undefined,
|
|
7
|
-
automaticallySetFirstEoa: false,
|
|
8
|
-
user: undefined,
|
|
9
|
-
setAccount: () => { },
|
|
10
|
-
setWallet: () => { },
|
|
11
|
-
wallet: undefined,
|
|
12
|
-
setUser: () => { },
|
|
13
|
-
initialized: false,
|
|
14
|
-
ready: false,
|
|
15
|
-
environment: "development",
|
|
16
|
-
theme: "light"
|
|
17
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { useContext, useMemo } from "react";
|
|
2
|
-
import { B3Context } from "./types";
|
|
3
|
-
/**
|
|
4
|
-
* Hook to access the B3 context
|
|
5
|
-
* @throws Error if used outside a B3Provider
|
|
6
|
-
*/
|
|
7
|
-
export function useB3() {
|
|
8
|
-
const context = useContext(B3Context);
|
|
9
|
-
if (!context.initialized) {
|
|
10
|
-
throw new Error("useB3 must be used within a B3Provider");
|
|
11
|
-
}
|
|
12
|
-
// Return a stable reference
|
|
13
|
-
return useMemo(() => context, [context]);
|
|
14
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { B3Provider } from "./components/B3Provider/B3Provider.native";
|
|
2
|
-
export { useB3 } from "./components/B3Provider/useB3";
|
|
3
|
-
export { B3Context, type B3ContextType } from "./components/B3Provider/types";
|
|
4
|
-
export { useAccountWallet } from "./hooks/useAccountWallet";
|
|
5
|
-
export { useAuthentication } from "./hooks/useAuthentication";
|
|
6
|
-
export { useSiwe } from "./hooks/useSiwe";
|
|
7
|
-
export { useAuthStore } from "./stores/useAuthStore";
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// export * from "./components";
|
|
2
|
-
// export * from "./hooks";
|
|
3
|
-
// export * from "./stores";
|
|
4
|
-
// We only export the components and hooks that are needed for the native app
|
|
5
|
-
export { B3Provider } from "./components/B3Provider/B3Provider.native";
|
|
6
|
-
export { useB3 } from "./components/B3Provider/useB3";
|
|
7
|
-
export { B3Context } from "./components/B3Provider/types";
|
|
8
|
-
export { useAccountWallet } from "./hooks/useAccountWallet";
|
|
9
|
-
export { useAuthentication } from "./hooks/useAuthentication";
|
|
10
|
-
export { useSiwe } from "./hooks/useSiwe";
|
|
11
|
-
export { useAuthStore } from "./stores/useAuthStore";
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export * from "./react/hooks";
|
|
2
|
-
export * from "./react/providers/AnyspendProvider";
|
|
3
|
-
export * from "./types";
|
|
4
|
-
export * from "./utils/address";
|
|
5
|
-
export * from "./utils/chain";
|
|
6
|
-
export * from "./utils/format";
|
|
7
|
-
export * from "./utils/json";
|
|
8
|
-
export * from "./utils/number";
|
|
9
|
-
export * from "./utils/string";
|
|
10
|
-
export * from "./utils/token";
|
|
11
|
-
export * from "./constants";
|
|
12
|
-
export * from "./abis/abi-usdc-base";
|
|
13
|
-
export * from "./abis/erc20-staking";
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Account } from "thirdweb/wallets";
|
|
2
|
-
import { User } from "@b3dotfun/sdk/global-account/types/b3-api.types";
|
|
3
|
-
import { Wallet } from "thirdweb/wallets";
|
|
4
|
-
import { PermissionsConfig } from "@b3dotfun/sdk/global-account/types/permissions";
|
|
5
|
-
/**
|
|
6
|
-
* Context type for B3Provider
|
|
7
|
-
*/
|
|
8
|
-
export interface B3ContextType {
|
|
9
|
-
account?: Account;
|
|
10
|
-
automaticallySetFirstEoa: boolean;
|
|
11
|
-
user?: User;
|
|
12
|
-
setAccount: (account: Account) => void;
|
|
13
|
-
setWallet: (wallet: Wallet) => void;
|
|
14
|
-
wallet?: Wallet;
|
|
15
|
-
setUser: (user?: User) => void;
|
|
16
|
-
initialized: boolean;
|
|
17
|
-
ready: boolean;
|
|
18
|
-
environment?: "development" | "production";
|
|
19
|
-
defaultPermissions?: PermissionsConfig;
|
|
20
|
-
theme: "light" | "dark";
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Context for B3 provider
|
|
24
|
-
*/
|
|
25
|
-
export declare const B3Context: import("react").Context<B3ContextType>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { B3Provider } from "./components/B3Provider/B3Provider.native";
|
|
2
|
-
export { useB3 } from "./components/B3Provider/useB3";
|
|
3
|
-
export { B3Context, type B3ContextType } from "./components/B3Provider/types";
|
|
4
|
-
export { useAccountWallet } from "./hooks/useAccountWallet";
|
|
5
|
-
export { useAuthentication } from "./hooks/useAuthentication";
|
|
6
|
-
export { useSiwe } from "./hooks/useSiwe";
|
|
7
|
-
export { useAuthStore } from "./stores/useAuthStore";
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// Export all hooks
|
|
2
|
-
export * from "./react/hooks";
|
|
3
|
-
|
|
4
|
-
// Providers
|
|
5
|
-
export * from "./react/providers/AnyspendProvider";
|
|
6
|
-
|
|
7
|
-
// Types
|
|
8
|
-
export * from "./types";
|
|
9
|
-
|
|
10
|
-
// Utils
|
|
11
|
-
export * from "./utils/address";
|
|
12
|
-
export * from "./utils/chain";
|
|
13
|
-
export * from "./utils/format";
|
|
14
|
-
export * from "./utils/json";
|
|
15
|
-
export * from "./utils/number";
|
|
16
|
-
export * from "./utils/string";
|
|
17
|
-
export * from "./utils/token";
|
|
18
|
-
|
|
19
|
-
// Constants
|
|
20
|
-
export * from "./constants";
|
|
21
|
-
|
|
22
|
-
// Abis
|
|
23
|
-
export * from "./abis/abi-usdc-base";
|
|
24
|
-
export * from "./abis/erc20-staking";
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Account } from "thirdweb/wallets";
|
|
2
|
-
import { User } from "@b3dotfun/sdk/global-account/types/b3-api.types";
|
|
3
|
-
import { Wallet } from "thirdweb/wallets";
|
|
4
|
-
import { PermissionsConfig } from "@b3dotfun/sdk/global-account/types/permissions";
|
|
5
|
-
import { createContext } from "react";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Context type for B3Provider
|
|
9
|
-
*/
|
|
10
|
-
export interface B3ContextType {
|
|
11
|
-
account?: Account;
|
|
12
|
-
automaticallySetFirstEoa: boolean;
|
|
13
|
-
user?: User;
|
|
14
|
-
setAccount: (account: Account) => void;
|
|
15
|
-
setWallet: (wallet: Wallet) => void;
|
|
16
|
-
wallet?: Wallet;
|
|
17
|
-
setUser: (user?: User) => void;
|
|
18
|
-
initialized: boolean;
|
|
19
|
-
ready: boolean;
|
|
20
|
-
environment?: "development" | "production";
|
|
21
|
-
defaultPermissions?: PermissionsConfig;
|
|
22
|
-
theme: "light" | "dark";
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Context for B3 provider
|
|
27
|
-
*/
|
|
28
|
-
export const B3Context = createContext<B3ContextType>({
|
|
29
|
-
account: undefined,
|
|
30
|
-
automaticallySetFirstEoa: false,
|
|
31
|
-
user: undefined,
|
|
32
|
-
setAccount: () => {},
|
|
33
|
-
setWallet: () => {},
|
|
34
|
-
wallet: undefined,
|
|
35
|
-
setUser: () => {},
|
|
36
|
-
initialized: false,
|
|
37
|
-
ready: false,
|
|
38
|
-
environment: "development",
|
|
39
|
-
theme: "light"
|
|
40
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useContext, useMemo } from "react";
|
|
2
|
-
import { B3Context } from "./types";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Hook to access the B3 context
|
|
6
|
-
* @throws Error if used outside a B3Provider
|
|
7
|
-
*/
|
|
8
|
-
export function useB3() {
|
|
9
|
-
const context = useContext(B3Context);
|
|
10
|
-
|
|
11
|
-
if (!context.initialized) {
|
|
12
|
-
throw new Error("useB3 must be used within a B3Provider");
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// Return a stable reference
|
|
16
|
-
return useMemo(() => context, [context]);
|
|
17
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// export * from "./components";
|
|
2
|
-
// export * from "./hooks";
|
|
3
|
-
// export * from "./stores";
|
|
4
|
-
|
|
5
|
-
// We only export the components and hooks that are needed for the native app
|
|
6
|
-
|
|
7
|
-
export { B3Provider } from "./components/B3Provider/B3Provider.native";
|
|
8
|
-
|
|
9
|
-
export { useB3 } from "./components/B3Provider/useB3";
|
|
10
|
-
export { B3Context, type B3ContextType } from "./components/B3Provider/types";
|
|
11
|
-
export { useAccountWallet } from "./hooks/useAccountWallet";
|
|
12
|
-
export { useAuthentication } from "./hooks/useAuthentication";
|
|
13
|
-
export { useSiwe } from "./hooks/useSiwe";
|
|
14
|
-
export { useAuthStore } from "./stores/useAuthStore";
|