@b3dotfun/sdk 0.0.1-alpha.22 → 0.0.1-alpha.3

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 (94) hide show
  1. package/README.md +230 -328
  2. package/dist/cjs/anyspend/react/components/AnySpend.d.ts +1 -2
  3. package/dist/cjs/anyspend/react/components/AnySpend.js +4 -4
  4. package/dist/cjs/anyspend/react/components/AnySpendBuySpin.d.ts +1 -2
  5. package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +51 -124
  6. package/dist/cjs/anyspend/utils/chain.js +0 -3
  7. package/dist/cjs/global-account/react/components/B3DynamicModal.js +2 -2
  8. package/dist/{esm/global-account/react/components/B3Provider → cjs/global-account/react/components}/B3Provider.d.ts +29 -3
  9. package/dist/cjs/global-account/react/components/{B3Provider/B3Provider.js → B3Provider.js} +34 -6
  10. package/dist/cjs/global-account/react/components/{B3Provider/B3Provider.native.d.ts → B3Provider.native.d.ts} +25 -2
  11. package/dist/cjs/global-account/react/components/{B3Provider/B3Provider.native.js → B3Provider.native.js} +28 -5
  12. package/dist/cjs/global-account/react/components/StyleRoot.js +2 -2
  13. package/dist/cjs/global-account/react/components/index.d.ts +6 -8
  14. package/dist/cjs/global-account/react/components/index.js +16 -18
  15. package/dist/cjs/global-account/react/hooks/index.d.ts +1 -1
  16. package/dist/cjs/global-account/react/hooks/index.js +1 -2
  17. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +0 -2
  18. package/dist/cjs/global-account/types/chain-networks.d.ts +34 -34
  19. package/dist/cjs/global-account/types/feature-flags.d.ts +5 -5
  20. package/dist/cjs/shared/constants/chains/b3Chain.d.ts +1 -1
  21. package/dist/cjs/shared/constants/chains/supported.d.ts +3 -4
  22. package/dist/cjs/shared/constants/chains/supported.js +1 -3
  23. package/dist/cjs/shared/utils/chains.js +0 -4
  24. package/dist/esm/anyspend/react/components/AnySpend.d.ts +1 -2
  25. package/dist/esm/anyspend/react/components/AnySpend.js +4 -4
  26. package/dist/esm/anyspend/react/components/AnySpendBuySpin.d.ts +1 -2
  27. package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +51 -124
  28. package/dist/esm/anyspend/utils/chain.js +0 -3
  29. package/dist/esm/global-account/react/components/B3DynamicModal.js +1 -1
  30. package/dist/{cjs/global-account/react/components/B3Provider → esm/global-account/react/components}/B3Provider.d.ts +29 -3
  31. package/dist/esm/global-account/react/components/{B3Provider/B3Provider.js → B3Provider.js} +32 -5
  32. package/dist/esm/global-account/react/components/{B3Provider/B3Provider.native.d.ts → B3Provider.native.d.ts} +25 -2
  33. package/dist/esm/global-account/react/components/{B3Provider/B3Provider.native.js → B3Provider.native.js} +26 -5
  34. package/dist/esm/global-account/react/components/StyleRoot.js +1 -1
  35. package/dist/esm/global-account/react/components/index.d.ts +6 -8
  36. package/dist/esm/global-account/react/components/index.js +5 -7
  37. package/dist/esm/global-account/react/hooks/index.d.ts +1 -1
  38. package/dist/esm/global-account/react/hooks/index.js +1 -1
  39. package/dist/esm/global-account/react/stores/useModalStore.d.ts +0 -2
  40. package/dist/esm/global-account/types/chain-networks.d.ts +34 -34
  41. package/dist/esm/global-account/types/feature-flags.d.ts +5 -5
  42. package/dist/esm/shared/constants/chains/b3Chain.d.ts +1 -1
  43. package/dist/esm/shared/constants/chains/supported.d.ts +3 -4
  44. package/dist/esm/shared/constants/chains/supported.js +0 -2
  45. package/dist/esm/shared/utils/chains.js +0 -4
  46. package/dist/styles/index.css +1 -1
  47. package/dist/types/anyspend/react/components/AnySpend.d.ts +1 -2
  48. package/dist/types/anyspend/react/components/AnySpendBuySpin.d.ts +1 -2
  49. package/dist/types/global-account/react/components/{B3Provider/B3Provider.d.ts → B3Provider.d.ts} +28 -2
  50. package/dist/types/global-account/react/components/{B3Provider/B3Provider.native.d.ts → B3Provider.native.d.ts} +24 -1
  51. package/dist/types/global-account/react/components/index.d.ts +6 -8
  52. package/dist/types/global-account/react/hooks/index.d.ts +1 -1
  53. package/dist/types/global-account/react/stores/useModalStore.d.ts +0 -2
  54. package/dist/types/global-account/types/chain-networks.d.ts +34 -34
  55. package/dist/types/global-account/types/feature-flags.d.ts +5 -5
  56. package/dist/types/shared/constants/chains/b3Chain.d.ts +1 -1
  57. package/dist/types/shared/constants/chains/supported.d.ts +3 -4
  58. package/package.json +11 -25
  59. package/src/anyspend/react/components/AnySpend.tsx +5 -6
  60. package/src/anyspend/react/components/AnySpendBuySpin.tsx +180 -233
  61. package/src/anyspend/utils/chain.ts +0 -3
  62. package/src/global-account/react/components/B3DynamicModal.tsx +1 -1
  63. package/src/global-account/react/components/{B3Provider/B3Provider.native.tsx → B3Provider.native.tsx} +45 -4
  64. package/src/global-account/react/components/{B3Provider/B3Provider.tsx → B3Provider.tsx} +53 -4
  65. package/src/global-account/react/components/StyleRoot.tsx +1 -1
  66. package/src/global-account/react/components/index.ts +6 -8
  67. package/src/global-account/react/hooks/index.ts +1 -1
  68. package/src/global-account/react/stores/useModalStore.ts +0 -2
  69. package/src/shared/constants/chains/supported.ts +0 -2
  70. package/src/shared/utils/chains.ts +1 -4
  71. package/dist/cjs/anyspend/index.native.d.ts +0 -13
  72. package/dist/cjs/anyspend/index.native.js +0 -35
  73. package/dist/cjs/global-account/react/components/B3Provider/types.d.ts +0 -25
  74. package/dist/cjs/global-account/react/components/B3Provider/types.js +0 -20
  75. package/dist/cjs/global-account/react/components/B3Provider/useB3.d.ts +0 -5
  76. package/dist/cjs/global-account/react/components/B3Provider/useB3.js +0 -17
  77. package/dist/cjs/global-account/react/index.native.d.ts +0 -7
  78. package/dist/cjs/global-account/react/index.native.js +0 -21
  79. package/dist/esm/anyspend/index.native.d.ts +0 -13
  80. package/dist/esm/anyspend/index.native.js +0 -19
  81. package/dist/esm/global-account/react/components/B3Provider/types.d.ts +0 -25
  82. package/dist/esm/global-account/react/components/B3Provider/types.js +0 -17
  83. package/dist/esm/global-account/react/components/B3Provider/useB3.d.ts +0 -5
  84. package/dist/esm/global-account/react/components/B3Provider/useB3.js +0 -14
  85. package/dist/esm/global-account/react/index.native.d.ts +0 -7
  86. package/dist/esm/global-account/react/index.native.js +0 -11
  87. package/dist/types/anyspend/index.native.d.ts +0 -13
  88. package/dist/types/global-account/react/components/B3Provider/types.d.ts +0 -25
  89. package/dist/types/global-account/react/components/B3Provider/useB3.d.ts +0 -5
  90. package/dist/types/global-account/react/index.native.d.ts +0 -7
  91. package/src/anyspend/index.native.ts +0 -24
  92. package/src/global-account/react/components/B3Provider/types.ts +0 -40
  93. package/src/global-account/react/components/B3Provider/useB3.ts +0 -17
  94. package/src/global-account/react/index.native.ts +0 -14
@@ -1,44 +1,44 @@
1
1
  import { Static } from "@feathersjs/typebox";
2
- export declare const chainNetworksSchema: import("@feathersjs/typebox").TObject<{
3
- _id: import("@feathersjs/typebox").TUnion<[import("@feathersjs/typebox").TString<string>, import("@feathersjs/typebox").TObject<{}>]>;
4
- id: import("@feathersjs/typebox").TInteger;
5
- name: import("@feathersjs/typebox").TString<string>;
6
- rpcUrls: import("@feathersjs/typebox").TObject<{
7
- default: import("@feathersjs/typebox").TObject<{
8
- http: import("@feathersjs/typebox").TString<"uri">;
9
- ws: import("@feathersjs/typebox").TString<"uri">;
2
+ export declare const chainNetworksSchema: import("@sinclair/typebox").TObject<{
3
+ _id: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TObject<{}>]>;
4
+ id: import("@sinclair/typebox").TInteger;
5
+ name: import("@sinclair/typebox").TString<string>;
6
+ rpcUrls: import("@sinclair/typebox").TObject<{
7
+ default: import("@sinclair/typebox").TObject<{
8
+ http: import("@sinclair/typebox").TString<"uri">;
9
+ ws: import("@sinclair/typebox").TString<"uri">;
10
10
  }>;
11
- backups: import("@feathersjs/typebox").TArray<import("@feathersjs/typebox").TObject<{
12
- type: import("@feathersjs/typebox").TUnion<[import("@feathersjs/typebox").TLiteral<"http">, import("@feathersjs/typebox").TLiteral<"ws">]>;
13
- uri: import("@feathersjs/typebox").TString<string>;
11
+ backups: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
12
+ type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"http">, import("@sinclair/typebox").TLiteral<"ws">]>;
13
+ uri: import("@sinclair/typebox").TString<string>;
14
14
  }>>;
15
15
  }>;
16
- icon: import("@feathersjs/typebox").TObject<{
17
- url: import("@feathersjs/typebox").TString<"uri">;
18
- width: import("@feathersjs/typebox").TInteger;
19
- height: import("@feathersjs/typebox").TInteger;
20
- format: import("@feathersjs/typebox").TString<string>;
16
+ icon: import("@sinclair/typebox").TObject<{
17
+ url: import("@sinclair/typebox").TString<"uri">;
18
+ width: import("@sinclair/typebox").TInteger;
19
+ height: import("@sinclair/typebox").TInteger;
20
+ format: import("@sinclair/typebox").TString<string>;
21
21
  }>;
22
- blockExplorers: import("@feathersjs/typebox").TObject<{
23
- explorerTitle: import("@feathersjs/typebox").TString<string>;
24
- default: import("@feathersjs/typebox").TString<"uri">;
22
+ blockExplorers: import("@sinclair/typebox").TObject<{
23
+ explorerTitle: import("@sinclair/typebox").TString<string>;
24
+ default: import("@sinclair/typebox").TString<"uri">;
25
25
  }>;
26
- nativeCurrency: import("@feathersjs/typebox").TObject<{
27
- name: import("@feathersjs/typebox").TString<string>;
28
- symbol: import("@feathersjs/typebox").TString<string>;
29
- decimals: import("@feathersjs/typebox").TInteger;
26
+ nativeCurrency: import("@sinclair/typebox").TObject<{
27
+ name: import("@sinclair/typebox").TString<string>;
28
+ symbol: import("@sinclair/typebox").TString<string>;
29
+ decimals: import("@sinclair/typebox").TInteger;
30
30
  }>;
31
- testnet: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TBoolean>;
32
- testnetConfigID: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TInteger>;
33
- sourceId: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TInteger>;
34
- contracts: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TRecord<import("@feathersjs/typebox").TString<string>, import("@feathersjs/typebox").TObject<{
35
- address: import("@feathersjs/typebox").TString<string>;
36
- blockCreated: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TInteger>;
31
+ testnet: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
32
+ testnetConfigID: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
33
+ sourceId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
34
+ contracts: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TObject<{
35
+ address: import("@sinclair/typebox").TString<string>;
36
+ blockCreated: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
37
37
  }>>>;
38
- formatters: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TRecord<import("@feathersjs/typebox").TString<string>, import("@feathersjs/typebox").TAny>>;
39
- fees: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TRecord<import("@feathersjs/typebox").TString<string>, import("@feathersjs/typebox").TAny>>;
40
- badge: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TString<"uri">>;
41
- color: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TString<string>>;
42
- enabledFeatures: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TArray<import("@feathersjs/typebox").TString<string>>>;
38
+ formatters: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TAny>>;
39
+ fees: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TAny>>;
40
+ badge: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<"uri">>;
41
+ color: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString<string>>;
42
+ enabledFeatures: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString<string>>>;
43
43
  }>;
44
44
  export type ChainNetworks = Static<typeof chainNetworksSchema>;
@@ -1,8 +1,8 @@
1
1
  import { Static } from "@feathersjs/typebox";
2
- export declare const featureFlagsSchema: import("@feathersjs/typebox").TObject<{
3
- _id: import("@feathersjs/typebox").TUnion<[import("@feathersjs/typebox").TString<string>, import("@feathersjs/typebox").TObject<{}>]>;
4
- id: import("@feathersjs/typebox").TString<string>;
5
- enabled: import("@feathersjs/typebox").TBoolean;
6
- description: import("@feathersjs/typebox").TString<string>;
2
+ export declare const featureFlagsSchema: import("@sinclair/typebox").TObject<{
3
+ _id: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString<string>, import("@sinclair/typebox").TObject<{}>]>;
4
+ id: import("@sinclair/typebox").TString<string>;
5
+ enabled: import("@sinclair/typebox").TBoolean;
6
+ description: import("@sinclair/typebox").TString<string>;
7
7
  }>;
8
8
  export type FeatureFlags = Static<typeof featureFlagsSchema>;
@@ -89,8 +89,8 @@ export declare const getViemChainConfig: (config: ChainNetworks) => {
89
89
  readonly icon: {
90
90
  format: string;
91
91
  url: string;
92
- height: number;
93
92
  width: number;
93
+ height: number;
94
94
  };
95
95
  };
96
96
  export declare const thirdwebB3Testnet: ThirdwebChain;
@@ -10,9 +10,9 @@ export declare const supportedChainNetworks: {
10
10
  testnet?: boolean | undefined;
11
11
  fees?: Record<string, any> | undefined;
12
12
  formatters?: Record<string, any> | undefined;
13
- color?: string | undefined;
14
13
  testnetConfigID?: number | undefined;
15
14
  badge?: string | undefined;
15
+ color?: string | undefined;
16
16
  enabledFeatures?: string[] | undefined;
17
17
  name: string;
18
18
  id: number;
@@ -35,17 +35,16 @@ export declare const supportedChainNetworks: {
35
35
  uri: string;
36
36
  }[];
37
37
  };
38
+ _id: string | {};
38
39
  icon: {
39
40
  format: string;
40
41
  url: string;
41
- height: number;
42
42
  width: number;
43
+ height: number;
43
44
  };
44
- _id: string | {};
45
45
  }[];
46
46
  export declare const b3Mainnet: import("viem").Chain;
47
47
  export declare const b3Testnet: import("viem").Chain;
48
- export declare const baseMainnet: import("viem").Chain | undefined;
49
48
  export declare const b3MainnetThirdWeb: Readonly<import("thirdweb/dist/types/chains/types").ChainOptions & {
50
49
  rpc: string;
51
50
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@b3dotfun/sdk",
3
- "version": "0.0.1-alpha.22",
3
+ "version": "0.0.1-alpha.3",
4
4
  "source": "src/index.ts",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "react-native": "./dist/cjs/index.native.js",
@@ -14,16 +14,9 @@
14
14
  "require": "./dist/cjs/anyspend/index.js"
15
15
  },
16
16
  "./anyspend/react": {
17
- "react-native": {
18
- "types": "./dist/types/anyspend/react/index.native.d.ts",
19
- "import": "./dist/esm/anyspend/react/index.native.js",
20
- "require": "./dist/cjs/anyspend/react/index.native.js"
21
- },
22
- "default": {
23
- "types": "./dist/types/anyspend/react/index.d.ts",
24
- "import": "./dist/esm/anyspend/react/index.js",
25
- "require": "./dist/cjs/anyspend/react/index.js"
26
- }
17
+ "types": "./dist/types/anyspend/react/index.d.ts",
18
+ "import": "./dist/esm/anyspend/react/index.js",
19
+ "require": "./dist/cjs/anyspend/react/index.js"
27
20
  },
28
21
  "./anyspend/types": {
29
22
  "types": "./dist/types/anyspend/types/index.d.ts",
@@ -68,16 +61,9 @@
68
61
  }
69
62
  },
70
63
  "./global-account/react": {
71
- "react-native": {
72
- "types": "./dist/types/global-account/react/index.native.d.ts",
73
- "import": "./dist/esm/global-account/react/index.native.js",
74
- "require": "./dist/cjs/global-account/react/index.native.js"
75
- },
76
- "default": {
77
- "types": "./dist/types/global-account/react/index.d.ts",
78
- "import": "./dist/esm/global-account/react/index.js",
79
- "require": "./dist/cjs/global-account/react/index.js"
80
- }
64
+ "types": "./dist/types/global-account/react/index.d.ts",
65
+ "import": "./dist/esm/global-account/react/index.js",
66
+ "require": "./dist/cjs/global-account/react/index.js"
81
67
  },
82
68
  "./global-account/types": {
83
69
  "types": "./dist/types/global-account/types.d.ts",
@@ -170,7 +156,7 @@
170
156
  "dependencies": {
171
157
  "@amplitude/analytics-browser": "2.14.0",
172
158
  "@b3dotfun/b3-api": "0.0.21",
173
- "@b3dotfun/basement-api": "0.0.11",
159
+ "@b3dotfun/basement-api": "0.0.10",
174
160
  "@chakra-ui/react": "2.10.7",
175
161
  "@feathersjs/authentication-client": "5.0.33",
176
162
  "@feathersjs/feathers": "5.0.33",
@@ -215,14 +201,14 @@
215
201
  "vaul": "^1.1.2",
216
202
  "viem": "2.27.2",
217
203
  "wagmi": "2.14.15",
218
- "zustand": "4.5.6",
219
- "zod": "3.25.51"
204
+ "zustand": "4.5.6"
220
205
  },
221
206
  "devDependencies": {
222
207
  "@feathersjs/authentication-client": "5.0.33",
223
208
  "@feathersjs/feathers": "5.0.33",
224
209
  "@feathersjs/socketio-client": "5.0.33",
225
210
  "@feathersjs/typebox": "5.0.33",
211
+ "@privy-io/react-auth": "2.8.0",
226
212
  "@types/big.js": "^6.2.2",
227
213
  "@types/invariant": "2.2.37",
228
214
  "@types/js-cookie": "3.0.6",
@@ -255,7 +241,7 @@
255
241
  }
256
242
  },
257
243
  "peerDependencies": {
258
- "@privy-io/react-auth": "^2.8.0",
244
+ "@privy-io/react-auth": "*",
259
245
  "@react-three/postprocessing": "2.16.6",
260
246
  "@readyplayerme/visage": "6.10.0",
261
247
  "@tanstack/react-query": "5.55.0",
@@ -15,6 +15,7 @@ import {
15
15
  ShinyButton,
16
16
  StyleRoot,
17
17
  TransitionPanel,
18
+ useAccountAssets,
18
19
  useAccountWallet,
19
20
  useOnchainName,
20
21
  useRouter,
@@ -22,8 +23,8 @@ import {
22
23
  useTokenData,
23
24
  useTokenFromUrl
24
25
  } from "@b3dotfun/sdk/global-account/react";
25
- import { cn } from "@b3dotfun/sdk/shared/utils/cn";
26
26
  import { shortenAddress } from "@b3dotfun/sdk/shared/utils/formatAddress";
27
+ import { cn } from "@b3dotfun/sdk/shared/utils/cn";
27
28
  import { formatDisplayNumber, formatTokenAmount } from "@b3dotfun/sdk/shared/utils/number";
28
29
  import { motion } from "framer-motion";
29
30
  import invariant from "invariant";
@@ -65,8 +66,7 @@ export function AnySpend({
65
66
  mode = "modal",
66
67
  defaultActiveTab = "crypto",
67
68
  loadOrder,
68
- hideTransactionHistoryButton,
69
- recipientAddress: recipientAddressFromProps
69
+ hideTransactionHistoryButton
70
70
  }: {
71
71
  destinationTokenAddress?: string;
72
72
  destinationTokenChainId?: number;
@@ -75,7 +75,6 @@ export function AnySpend({
75
75
  defaultActiveTab?: "crypto" | "fiat";
76
76
  loadOrder?: string;
77
77
  hideTransactionHistoryButton?: boolean;
78
- recipientAddress?: string;
79
78
  }) {
80
79
  const searchParams = useSearchParamsSSR();
81
80
  const router = useRouter();
@@ -375,8 +374,8 @@ export function AnySpend({
375
374
 
376
375
  // Set default recipient address when wallet changes
377
376
  useEffect(() => {
378
- setRecipientAddress(recipientAddressFromProps || globalAddress);
379
- }, [recipientAddressFromProps, globalAddress]);
377
+ setRecipientAddress(globalAddress);
378
+ }, [globalAddress]);
380
379
 
381
380
  // Get anyspend price
382
381
  const activeInputAmountInWei = isSrcInputDirty