@b3dotfun/sdk 0.0.90-test.1 → 0.1.0-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.
- package/dist/cjs/anyspend/constants/rpc.d.ts +22 -0
- package/dist/cjs/anyspend/constants/rpc.js +38 -0
- package/dist/cjs/anyspend/utils/chain.d.ts +23 -0
- package/dist/cjs/anyspend/utils/chain.js +56 -12
- 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.js +2 -19
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.native.js +4 -31
- 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/hooks/useFirstEOA.d.ts +2 -2
- package/dist/cjs/global-account/react/hooks/useTokenBalancesByChain.js +3 -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/esm/anyspend/constants/rpc.d.ts +22 -0
- package/dist/esm/anyspend/constants/rpc.js +35 -0
- package/dist/esm/anyspend/utils/chain.d.ts +23 -0
- package/dist/esm/anyspend/utils/chain.js +53 -12
- 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.js +2 -19
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.native.js +3 -30
- 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/hooks/useFirstEOA.d.ts +2 -2
- package/dist/esm/global-account/react/hooks/useTokenBalancesByChain.js +3 -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/types/anyspend/constants/rpc.d.ts +22 -0
- package/dist/types/anyspend/utils/chain.d.ts +23 -0
- package/dist/types/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +31 -0
- 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/hooks/useFirstEOA.d.ts +2 -2
- package/dist/types/global-account/react/stores/index.d.ts +0 -1
- package/package.json +1 -1
- package/src/anyspend/constants/rpc.ts +38 -0
- package/src/anyspend/utils/chain.ts +70 -36
- 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 +21 -27
- package/src/global-account/react/components/B3Provider/useB3Config.ts +1 -21
- package/src/global-account/react/hooks/useTokenBalancesByChain.tsx +3 -0
- package/src/global-account/react/stores/index.ts +0 -1
- 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
|
@@ -1,51 +0,0 @@
|
|
|
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 { create } from "zustand";
|
|
6
|
-
import { ClientType } from "../../client-manager";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Default permissions configuration for B3 provider
|
|
10
|
-
*/
|
|
11
|
-
const DEFAULT_PERMISSIONS: PermissionsConfig = {
|
|
12
|
-
approvedTargets: ["0xa8e42121e318e3D3BeD7f5969AF6D360045317DD"],
|
|
13
|
-
nativeTokenLimitPerTransaction: 0.1,
|
|
14
|
-
startDate: new Date(),
|
|
15
|
-
endDate: new Date(Date.now() + 1000 * 60 * 60 * 24 * 365), // 1 year from now
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
interface ConfigStore {
|
|
19
|
-
accountOverride?: Account;
|
|
20
|
-
automaticallySetFirstEoa: boolean;
|
|
21
|
-
environment: "development" | "production";
|
|
22
|
-
defaultPermissions: PermissionsConfig;
|
|
23
|
-
theme: "light" | "dark";
|
|
24
|
-
clientType: ClientType;
|
|
25
|
-
partnerId: string;
|
|
26
|
-
stripePublishableKey?: string;
|
|
27
|
-
createClientReferenceId?: (params: CreateOrderParams | CreateOnrampOrderParams) => Promise<string>;
|
|
28
|
-
enableTurnkey: boolean;
|
|
29
|
-
|
|
30
|
-
// Actions
|
|
31
|
-
setConfig: (config: Partial<Omit<ConfigStore, "setConfig">>) => void;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Zustand store for B3 configuration
|
|
36
|
-
* NOT persisted - these are developer-set configuration values
|
|
37
|
-
*/
|
|
38
|
-
export const useB3ConfigStore = create<ConfigStore>(set => ({
|
|
39
|
-
accountOverride: undefined,
|
|
40
|
-
automaticallySetFirstEoa: false,
|
|
41
|
-
environment: "development",
|
|
42
|
-
defaultPermissions: DEFAULT_PERMISSIONS,
|
|
43
|
-
theme: "light",
|
|
44
|
-
clientType: "rest",
|
|
45
|
-
partnerId: "",
|
|
46
|
-
stripePublishableKey: undefined,
|
|
47
|
-
createClientReferenceId: undefined,
|
|
48
|
-
enableTurnkey: false,
|
|
49
|
-
|
|
50
|
-
setConfig: config => set(state => ({ ...state, ...config })),
|
|
51
|
-
}));
|