@b3dotfun/sdk 0.0.7-alpha.8 → 0.0.7

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 (149) hide show
  1. package/dist/cjs/anyspend/constants/index.js +2 -5
  2. package/dist/cjs/anyspend/index.d.ts +0 -1
  3. package/dist/cjs/anyspend/index.js +0 -1
  4. package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +33 -33
  5. package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +2 -2
  6. package/dist/cjs/anyspend/react/components/AnySpendCustom.js +43 -75
  7. package/dist/cjs/anyspend/react/components/AnySpendNFT.d.ts +2 -3
  8. package/dist/cjs/anyspend/react/components/AnySpendNFT.js +3 -5
  9. package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +3 -4
  10. package/dist/cjs/anyspend/react/components/AnySpendTournament.js +1 -4
  11. package/dist/cjs/anyspend/react/components/common/OrderDetails.js +2 -2
  12. package/dist/cjs/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +0 -4
  13. package/dist/cjs/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +0 -4
  14. package/dist/cjs/anyspend/services/anyspend.d.ts +1 -3
  15. package/dist/cjs/anyspend/services/anyspend.js +1 -1
  16. package/dist/cjs/anyspend/types/index.d.ts +0 -1
  17. package/dist/cjs/anyspend/types/index.js +0 -1
  18. package/dist/cjs/anyspend/types/nft.d.ts +0 -7
  19. package/dist/cjs/anyspend/types/nft.js +0 -2
  20. package/dist/cjs/anyspend/types/order.d.ts +0 -10
  21. package/dist/cjs/anyspend/types/req-res/createOrder.d.ts +0 -28
  22. package/dist/cjs/anyspend/types/req-res/getOrderAndTransactions.d.ts +0 -18
  23. package/dist/cjs/anyspend/types/req-res/getOrderHistory.d.ts +0 -14
  24. package/dist/cjs/anyspend/types/req-res/getQuote.d.ts +0 -11
  25. package/dist/cjs/anyspend/types/req-res/getQuote.js +1 -4
  26. package/dist/cjs/anyspend/utils/orderPayload.d.ts +3 -3
  27. package/dist/cjs/anyspend/utils/orderPayload.js +4 -18
  28. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +1 -1
  29. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +1 -1
  30. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3.d.ts +2 -1
  31. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3.js +16 -11
  32. package/dist/cjs/global-account/react/components/StyleRoot.js +1 -0
  33. package/dist/cjs/global-account/react/hooks/useB3EnsName.d.ts +4 -1
  34. package/dist/cjs/global-account/react/hooks/useB3EnsName.js +22 -22
  35. package/dist/cjs/shared/constants/chains/supported.js +0 -3
  36. package/dist/cjs/shared/constants/index.d.ts +0 -1
  37. package/dist/cjs/shared/constants/index.js +1 -2
  38. package/dist/cjs/shared/utils/index.d.ts +0 -9
  39. package/dist/cjs/shared/utils/index.js +0 -17
  40. package/dist/esm/anyspend/constants/index.js +2 -5
  41. package/dist/esm/anyspend/index.d.ts +0 -1
  42. package/dist/esm/anyspend/index.js +0 -1
  43. package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +5 -5
  44. package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +2 -2
  45. package/dist/esm/anyspend/react/components/AnySpendCustom.js +20 -52
  46. package/dist/esm/anyspend/react/components/AnySpendNFT.d.ts +2 -3
  47. package/dist/esm/anyspend/react/components/AnySpendNFT.js +3 -5
  48. package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +4 -5
  49. package/dist/esm/anyspend/react/components/AnySpendTournament.js +1 -4
  50. package/dist/esm/anyspend/react/components/common/OrderDetails.js +3 -3
  51. package/dist/esm/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +0 -4
  52. package/dist/esm/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +0 -4
  53. package/dist/esm/anyspend/services/anyspend.d.ts +1 -3
  54. package/dist/esm/anyspend/services/anyspend.js +1 -1
  55. package/dist/esm/anyspend/types/index.d.ts +0 -1
  56. package/dist/esm/anyspend/types/index.js +0 -1
  57. package/dist/esm/anyspend/types/nft.d.ts +0 -7
  58. package/dist/esm/anyspend/types/nft.js +0 -2
  59. package/dist/esm/anyspend/types/order.d.ts +0 -10
  60. package/dist/esm/anyspend/types/req-res/createOrder.d.ts +0 -28
  61. package/dist/esm/anyspend/types/req-res/getOrderAndTransactions.d.ts +0 -18
  62. package/dist/esm/anyspend/types/req-res/getOrderHistory.d.ts +0 -14
  63. package/dist/esm/anyspend/types/req-res/getQuote.d.ts +0 -11
  64. package/dist/esm/anyspend/types/req-res/getQuote.js +1 -4
  65. package/dist/esm/anyspend/utils/orderPayload.d.ts +3 -3
  66. package/dist/esm/anyspend/utils/orderPayload.js +5 -19
  67. package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +1 -1
  68. package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +1 -1
  69. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3.d.ts +2 -1
  70. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3.js +12 -7
  71. package/dist/esm/global-account/react/components/StyleRoot.js +1 -0
  72. package/dist/esm/global-account/react/hooks/useB3EnsName.d.ts +4 -1
  73. package/dist/esm/global-account/react/hooks/useB3EnsName.js +21 -24
  74. package/dist/esm/shared/constants/chains/supported.js +0 -3
  75. package/dist/esm/shared/constants/index.d.ts +0 -1
  76. package/dist/esm/shared/constants/index.js +0 -1
  77. package/dist/esm/shared/utils/index.d.ts +0 -9
  78. package/dist/esm/shared/utils/index.js +0 -15
  79. package/dist/styles/index.css +1 -1
  80. package/dist/types/anyspend/index.d.ts +0 -1
  81. package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +2 -2
  82. package/dist/types/anyspend/react/components/AnySpendNFT.d.ts +2 -3
  83. package/dist/types/anyspend/react/hooks/useAnyspendOrderAndTransactions.d.ts +0 -4
  84. package/dist/types/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +0 -4
  85. package/dist/types/anyspend/services/anyspend.d.ts +1 -3
  86. package/dist/types/anyspend/types/index.d.ts +0 -1
  87. package/dist/types/anyspend/types/nft.d.ts +0 -7
  88. package/dist/types/anyspend/types/order.d.ts +0 -10
  89. package/dist/types/anyspend/types/req-res/createOrder.d.ts +0 -28
  90. package/dist/types/anyspend/types/req-res/getOrderAndTransactions.d.ts +0 -18
  91. package/dist/types/anyspend/types/req-res/getOrderHistory.d.ts +0 -14
  92. package/dist/types/anyspend/types/req-res/getQuote.d.ts +0 -11
  93. package/dist/types/anyspend/utils/orderPayload.d.ts +3 -3
  94. package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +1 -1
  95. package/dist/types/global-account/react/components/SignInWithB3/SignInWithB3.d.ts +2 -1
  96. package/dist/types/global-account/react/hooks/useB3EnsName.d.ts +4 -1
  97. package/dist/types/shared/constants/index.d.ts +0 -1
  98. package/dist/types/shared/utils/index.d.ts +0 -9
  99. package/package.json +3 -22
  100. package/src/anyspend/constants/index.ts +3 -5
  101. package/src/anyspend/index.ts +0 -1
  102. package/src/anyspend/react/components/AnySpendBuySpin.tsx +7 -8
  103. package/src/anyspend/react/components/AnySpendCustom.tsx +24 -68
  104. package/src/anyspend/react/components/AnySpendNFT.tsx +4 -9
  105. package/src/anyspend/react/components/AnySpendStakeB3.tsx +6 -7
  106. package/src/anyspend/react/components/AnySpendTournament.tsx +1 -4
  107. package/src/anyspend/react/components/common/OrderDetails.tsx +6 -6
  108. package/src/anyspend/services/anyspend.ts +2 -2
  109. package/src/anyspend/types/index.ts +0 -1
  110. package/src/anyspend/types/nft.ts +0 -3
  111. package/src/anyspend/types/req-res/getQuote.ts +1 -4
  112. package/src/anyspend/utils/orderPayload.ts +5 -17
  113. package/src/global-account/react/components/B3Provider/B3Provider.tsx +3 -2
  114. package/src/global-account/react/components/SignInWithB3/SignInWithB3.tsx +27 -15
  115. package/src/global-account/react/components/StyleRoot.tsx +1 -0
  116. package/src/global-account/react/hooks/useB3EnsName.ts +32 -26
  117. package/src/shared/constants/chains/supported.ts +0 -5
  118. package/src/shared/constants/index.ts +0 -2
  119. package/src/shared/utils/index.ts +0 -16
  120. package/dist/cjs/anyspend/types/metadata.d.ts +0 -26
  121. package/dist/cjs/anyspend/types/metadata.js +0 -16
  122. package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.d.ts +0 -14
  123. package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.js +0 -50
  124. package/dist/cjs/global-account/react/components/custom/Icon.d.ts +0 -7
  125. package/dist/cjs/global-account/react/components/custom/Icon.js +0 -52
  126. package/dist/cjs/global-account/react/components/custom/ManageAccountButton.d.ts +0 -4
  127. package/dist/cjs/global-account/react/components/custom/ManageAccountButton.js +0 -20
  128. package/dist/cjs/index.d.ts +0 -0
  129. package/dist/cjs/index.js +0 -2
  130. package/dist/esm/anyspend/types/metadata.d.ts +0 -26
  131. package/dist/esm/anyspend/types/metadata.js +0 -11
  132. package/dist/esm/global-account/react/components/SignInWithB3/SignIn.d.ts +0 -14
  133. package/dist/esm/global-account/react/components/SignInWithB3/SignIn.js +0 -44
  134. package/dist/esm/global-account/react/components/custom/Icon.d.ts +0 -7
  135. package/dist/esm/global-account/react/components/custom/Icon.js +0 -50
  136. package/dist/esm/global-account/react/components/custom/ManageAccountButton.d.ts +0 -4
  137. package/dist/esm/global-account/react/components/custom/ManageAccountButton.js +0 -17
  138. package/dist/esm/index.d.ts +0 -0
  139. package/dist/esm/index.js +0 -2
  140. package/dist/types/anyspend/types/metadata.d.ts +0 -26
  141. package/dist/types/global-account/react/components/SignInWithB3/SignIn.d.ts +0 -14
  142. package/dist/types/global-account/react/components/custom/Icon.d.ts +0 -7
  143. package/dist/types/global-account/react/components/custom/ManageAccountButton.d.ts +0 -4
  144. package/dist/types/index.d.ts +0 -0
  145. package/src/anyspend/types/metadata.ts +0 -41
  146. package/src/global-account/react/components/SignInWithB3/SignIn.tsx +0 -190
  147. package/src/global-account/react/components/custom/Icon.tsx +0 -102
  148. package/src/global-account/react/components/custom/ManageAccountButton.tsx +0 -33
  149. package/src/index.ts +0 -1
@@ -352,18 +352,12 @@ export declare const zGetOrderHistoryResponse: z.ZodObject<{
352
352
  type: z.ZodLiteral<import("../order").OrderType.MintNFT>;
353
353
  payload: z.ZodObject<{
354
354
  contractAddress: z.ZodString;
355
- tokenId: z.ZodNullable<z.ZodNumber>;
356
- contractType: z.ZodNativeEnum<typeof import("..").NftType>;
357
355
  nftPrice: z.ZodString;
358
356
  }, "strip", z.ZodTypeAny, {
359
357
  contractAddress: string;
360
- tokenId: number | null;
361
- contractType: import("..").NftType;
362
358
  nftPrice: string;
363
359
  }, {
364
360
  contractAddress: string;
365
- tokenId: number | null;
366
- contractType: import("..").NftType;
367
361
  nftPrice: string;
368
362
  }>;
369
363
  metadata: z.ZodObject<{
@@ -614,8 +608,6 @@ export declare const zGetOrderHistoryResponse: z.ZodObject<{
614
608
  } | null;
615
609
  payload: {
616
610
  contractAddress: string;
617
- tokenId: number | null;
618
- contractType: import("..").NftType;
619
611
  nftPrice: string;
620
612
  };
621
613
  }, {
@@ -688,8 +680,6 @@ export declare const zGetOrderHistoryResponse: z.ZodObject<{
688
680
  } | null;
689
681
  payload: {
690
682
  contractAddress: string;
691
- tokenId: number | null;
692
- contractType: import("..").NftType;
693
683
  nftPrice: string;
694
684
  };
695
685
  }>, z.ZodObject<{
@@ -1792,8 +1782,6 @@ export declare const zGetOrderHistoryResponse: z.ZodObject<{
1792
1782
  } | null;
1793
1783
  payload: {
1794
1784
  contractAddress: string;
1795
- tokenId: number | null;
1796
- contractType: import("..").NftType;
1797
1785
  nftPrice: string;
1798
1786
  };
1799
1787
  } | {
@@ -2118,8 +2106,6 @@ export declare const zGetOrderHistoryResponse: z.ZodObject<{
2118
2106
  } | null;
2119
2107
  payload: {
2120
2108
  contractAddress: string;
2121
- tokenId: number | null;
2122
- contractType: import("..").NftType;
2123
2109
  nftPrice: string;
2124
2110
  };
2125
2111
  } | {
@@ -1,6 +1,5 @@
1
1
  import { QuoteDetails } from "@reservoir0x/relay-sdk";
2
2
  import { z } from "zod";
3
- import { NftType } from "../nft";
4
3
  import { OrderType } from "../order";
5
4
  import { TradeType } from "../relay";
6
5
  export declare const zGetQuoteRequest: z.ZodObject<{
@@ -37,14 +36,10 @@ export declare const zGetQuoteRequest: z.ZodObject<{
37
36
  } & {
38
37
  type: z.ZodLiteral<OrderType.MintNFT>;
39
38
  contractAddress: z.ZodString;
40
- tokenId: z.ZodNullable<z.ZodNumber>;
41
- contractType: z.ZodNativeEnum<typeof NftType>;
42
39
  price: z.ZodString;
43
40
  }, "strip", z.ZodTypeAny, {
44
41
  type: OrderType.MintNFT;
45
42
  contractAddress: string;
46
- tokenId: number | null;
47
- contractType: NftType;
48
43
  srcChain: number;
49
44
  dstChain: number;
50
45
  srcTokenAddress: string;
@@ -53,8 +48,6 @@ export declare const zGetQuoteRequest: z.ZodObject<{
53
48
  }, {
54
49
  type: OrderType.MintNFT;
55
50
  contractAddress: string;
56
- tokenId: number | null;
57
- contractType: NftType;
58
51
  srcChain: number;
59
52
  dstChain: number;
60
53
  srcTokenAddress: string;
@@ -170,8 +163,6 @@ export declare const zGetQuoteRequest: z.ZodObject<{
170
163
  } | {
171
164
  type: OrderType.MintNFT;
172
165
  contractAddress: string;
173
- tokenId: number | null;
174
- contractType: NftType;
175
166
  srcChain: number;
176
167
  dstChain: number;
177
168
  srcTokenAddress: string;
@@ -218,8 +209,6 @@ export declare const zGetQuoteRequest: z.ZodObject<{
218
209
  } | {
219
210
  type: OrderType.MintNFT;
220
211
  contractAddress: string;
221
- tokenId: number | null;
222
- contractType: NftType;
223
212
  srcChain: number;
224
213
  dstChain: number;
225
214
  srcTokenAddress: string;
@@ -1,4 +1,4 @@
1
- import { Nft, NftType, OrderType, Token, Tournament } from "@b3dotfun/sdk/anyspend/types";
1
+ import { Nft, OrderType, Token, Tournament } from "@b3dotfun/sdk/anyspend/types";
2
2
  export type OrderParams = {
3
3
  orderType: OrderType;
4
4
  srcToken: Token;
@@ -38,13 +38,13 @@ export declare const buildMetadata: (orderType: OrderType, params: OrderParams)
38
38
  } | {
39
39
  nft: (({
40
40
  name: string;
41
- type: NftType.ERC721;
41
+ type: import("@b3dotfun/sdk/anyspend/types").NftType.ERC721;
42
42
  contractAddress: string;
43
43
  description: string;
44
44
  imageUrl: string;
45
45
  } | {
46
46
  name: string;
47
- type: NftType.ERC1155;
47
+ type: import("@b3dotfun/sdk/anyspend/types").NftType.ERC1155;
48
48
  contractAddress: string;
49
49
  description: string;
50
50
  imageUrl: string;
@@ -1,7 +1,7 @@
1
1
  import { PermissionsConfig } from "@b3dotfun/sdk/global-account/types/permissions";
2
2
  import { Account } from "thirdweb/wallets";
3
- import { B3ContextType } from "./types";
4
3
  import "@reservoir0x/relay-kit-ui/styles.css";
4
+ import { B3ContextType } from "./types";
5
5
  export declare const wagmiConfig: import("wagmi").Config<readonly [import("viem").Chain, ...import("viem").Chain[]], any, readonly import("wagmi").CreateConnectorFn[]>;
6
6
  /**
7
7
  * Main B3Provider component
@@ -1,9 +1,10 @@
1
1
  import { SignInWithB3ModalProps } from "@b3dotfun/sdk/global-account/react";
2
2
  import { ReactNode } from "react";
3
- export type SignInWithB3Props = Omit<SignInWithB3ModalProps, "type" | "showBackButton"> & {
3
+ type SignInWithB3Props = Omit<SignInWithB3ModalProps, "type" | "showBackButton"> & {
4
4
  buttonText?: string | ReactNode;
5
5
  loggedInButtonText?: string | ReactNode;
6
6
  loadingButtonText?: string | ReactNode;
7
7
  withLogo?: boolean;
8
8
  };
9
9
  export declare function SignInWithB3(props: SignInWithB3Props): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -1,5 +1,8 @@
1
1
  export declare const useB3EnsName: () => {
2
- registerEns: (name: `${string}.b3.fun`, address: string, hash: string) => Promise<Response>;
2
+ registerEns: (username: string, message: string, hash: string) => Promise<{
3
+ success: boolean;
4
+ error?: string;
5
+ }>;
3
6
  getEns: (address: string) => Promise<{
4
7
  name: string;
5
8
  }>;
@@ -13,4 +13,3 @@ export declare const THIRDWEB_SECRET_KEY: string;
13
13
  export declare const THIRDWEB_CLIENT_ID: string;
14
14
  export declare const CLIENT_APP_BUNDLE_ID: string;
15
15
  export declare const B3_AUTH_COOKIE_NAME = "b3-auth";
16
- export declare const ENS_GATEWAY_URL = "https://ens-gateway.b3.fun/";
@@ -1,11 +1,2 @@
1
1
  export declare function formatUsername(username: string): string;
2
- /**
3
- * Helper functions for formatting data
4
- */
5
- /**
6
- * Truncates a wallet address to show first 4 and last 4 characters
7
- * @param address Wallet address to truncate
8
- * @returns Truncated address in format "0x1234...5678"
9
- */
10
- export declare const truncateAddress: (address: string) => string;
11
2
  export * from "./cn";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@b3dotfun/sdk",
3
- "version": "0.0.7-alpha.8",
3
+ "version": "0.0.7",
4
4
  "source": "src/index.ts",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "react-native": "./dist/cjs/index.native.js",
@@ -11,13 +11,6 @@
11
11
  ],
12
12
  "exports": {
13
13
  "./index.css": "./dist/styles/index.css",
14
- ".": {
15
- "default": {
16
- "types": "./dist/types/index.d.ts",
17
- "import": "./dist/esm/index.js",
18
- "require": "./dist/cjs/index.js"
19
- }
20
- },
21
14
  "./anyspend": {
22
15
  "types": "./dist/types/anyspend/index.d.ts",
23
16
  "import": "./dist/esm/anyspend/index.js",
@@ -89,18 +82,6 @@
89
82
  "require": "./dist/cjs/global-account/react/index.js"
90
83
  }
91
84
  },
92
- "./global-account/react/components/*": {
93
- "react-native": {
94
- "types": "./dist/types/global-account/react/components/*.native.d.ts",
95
- "import": "./dist/esm/global-account/react/components/*.native.js",
96
- "require": "./dist/cjs/global-account/react/components/*.native.js"
97
- },
98
- "default": {
99
- "types": "./dist/types/global-account/react/components/*.d.ts",
100
- "import": "./dist/esm/global-account/react/components/*.js",
101
- "require": "./dist/cjs/global-account/react/components/*.js"
102
- }
103
- },
104
85
  "./global-account/types": {
105
86
  "types": "./dist/types/global-account/types.d.ts",
106
87
  "import": "./dist/esm/global-account/types.js",
@@ -237,8 +218,8 @@
237
218
  "vaul": "^1.1.2",
238
219
  "viem": "2.27.2",
239
220
  "wagmi": "2.14.15",
240
- "zod": "3.25.51",
241
- "zustand": "4.5.6"
221
+ "zustand": "4.5.6",
222
+ "zod": "3.25.51"
242
223
  },
243
224
  "devDependencies": {
244
225
  "@feathersjs/authentication-client": "5.0.33",
@@ -1,4 +1,4 @@
1
- import { NftContract, NftType, Token } from "@b3dotfun/sdk/anyspend/types";
1
+ import { NftContract, Token } from "@b3dotfun/sdk/anyspend/types";
2
2
  import { base } from "viem/chains";
3
3
 
4
4
  export const ANYSPEND_MAINNET_BASE_URL = process.env.NEXT_PUBLIC_ANYSPEND_BASE_URL || "https://mainnet.anyspend.com";
@@ -45,8 +45,7 @@ export const NFT_CONTRACTS: NftContract[] = [
45
45
  "https://storage.googleapis.com/nftimagebucket/base/tokens/0x80f0e6644723abb03aa8867d21e32bd854b2a2d9/preview/TVRjME1EUTRORFl4T0E9PV8zNjcy.jpg",
46
46
  name: "Downhill Ski",
47
47
  description: "Downhill Ski",
48
- tokenId: null,
49
- type: NftType.ERC721
48
+ tokenId: null
50
49
  },
51
50
  {
52
51
  chainId: base.id,
@@ -58,8 +57,7 @@ export const NFT_CONTRACTS: NftContract[] = [
58
57
  name: "Eclipse Venom",
59
58
  description:
60
59
  "The Eclipse Venom's crystalline blade channels imprisoned astral toxins through swirling currents of violet and teal light, synchronizing with its wielder's heartbeat for strikes that bypass conventional armor. Wounds from this otherworldly weapon resist healing as victims describe being consumed from within by liquid darkness, their final moments filled with visions of infinite cosmic depths.",
61
- tokenId: null,
62
- type: NftType.ERC721
60
+ tokenId: null
63
61
  }
64
62
  ];
65
63
 
@@ -6,7 +6,6 @@ export * from "./react/providers/AnyspendProvider";
6
6
 
7
7
  // Types
8
8
  export * from "./types";
9
- export * from "./types/metadata";
10
9
 
11
10
  // Utils
12
11
  export * from "./utils/address";
@@ -1,16 +1,19 @@
1
1
  import { B3_TOKEN, OrderType } from "@b3dotfun/sdk/anyspend";
2
+ import { baseMainnet } from "@b3dotfun/sdk/shared/constants/chains/supported";
3
+ import { EthIcon } from "./icons/EthIcon";
4
+ import { SolIcon } from "./icons/SolIcon";
5
+ import { UsdcIcon } from "./icons/USDCIcon";
6
+ import { StyleRoot } from "@b3dotfun/sdk/global-account/react";
2
7
  import {
3
8
  Button,
4
9
  GlareCardRounded,
5
10
  Input,
6
- StyleRoot,
7
11
  TextLoop,
8
12
  useChainSwitchWithAction,
9
13
  useHasMounted,
10
- useModalStore,
11
- useTokenBalance
14
+ useTokenBalance,
15
+ useModalStore
12
16
  } from "@b3dotfun/sdk/global-account/react";
13
- import { baseMainnet } from "@b3dotfun/sdk/shared/constants/chains/supported";
14
17
  import { motion } from "framer-motion";
15
18
  import invariant from "invariant";
16
19
  import { ArrowRight, Loader2 } from "lucide-react";
@@ -19,9 +22,6 @@ import { toast } from "sonner";
19
22
  import { createPublicClient, encodeFunctionData, erc20Abi, formatUnits, http } from "viem";
20
23
  import { useAccount, useWaitForTransactionReceipt, useWriteContract } from "wagmi";
21
24
  import { AnySpendCustom } from "./AnySpendCustom";
22
- import { EthIcon } from "./icons/EthIcon";
23
- import { SolIcon } from "./icons/SolIcon";
24
- import { UsdcIcon } from "./icons/USDCIcon";
25
25
 
26
26
  const SPIN_WHEEL_ABI = [
27
27
  {
@@ -668,7 +668,6 @@ export function AnySpendBuySpin({
668
668
  spenderAddress={paymentConfig.entryModule}
669
669
  encodedData={encodedData}
670
670
  metadata={{
671
- type: OrderType.Custom,
672
671
  action: `buy ${userSpinQuantity} spin${userSpinQuantity !== "1" ? "s" : ""}`
673
672
  }}
674
673
  header={header}
@@ -1,13 +1,8 @@
1
1
  import {
2
- AnySpendMetadata,
3
- CreateOrderParams,
4
2
  eqci,
5
3
  getDefaultToken,
6
4
  GetQuoteRequest,
7
5
  GetQuoteResponse,
8
- isCustomTxMetadata,
9
- isNftMetadata,
10
- isTournamentMetadata,
11
6
  NftType,
12
7
  OnrampVendor,
13
8
  OrderStatus,
@@ -22,27 +17,26 @@ import {
22
17
  useAnyspendTokenList,
23
18
  useGeoOnrampOptions
24
19
  } from "@b3dotfun/sdk/anyspend";
20
+ import { useB3, StyleRoot } from "@b3dotfun/sdk/global-account/react";
25
21
  import {
26
22
  Badge,
27
23
  Button,
28
24
  ShinyButton,
29
25
  Skeleton,
30
- StyleRoot,
31
26
  Tabs,
32
27
  TabsContent,
33
28
  TabsList,
34
29
  TabTrigger,
35
- TextShimmer,
36
- TransitionPanel,
37
30
  useAccountWallet,
38
- useB3,
39
31
  useBsmntProfile,
40
32
  useHasMounted,
41
- useModalStore,
42
33
  useRouter,
43
- useSearchParamsSSR,
44
- useTokenBalancesByChain
34
+ useTokenBalancesByChain,
35
+ useModalStore,
36
+ useSearchParamsSSR
45
37
  } from "@b3dotfun/sdk/global-account/react";
38
+ import { TextShimmer } from "@b3dotfun/sdk/global-account/react";
39
+ import { TransitionPanel } from "@b3dotfun/sdk/global-account/react";
46
40
  import { cn } from "@b3dotfun/sdk/shared/utils";
47
41
  import centerTruncate from "@b3dotfun/sdk/shared/utils/centerTruncate";
48
42
  import { formatTokenAmount } from "@b3dotfun/sdk/shared/utils/number";
@@ -74,8 +68,6 @@ function generateGetRelayQuoteRequest({
74
68
  dstToken,
75
69
  dstAmount,
76
70
  contractAddress,
77
- tokenId,
78
- contractType,
79
71
  encodedData,
80
72
  spenderAddress
81
73
  }: {
@@ -86,8 +78,6 @@ function generateGetRelayQuoteRequest({
86
78
  dstToken: Token;
87
79
  dstAmount: string;
88
80
  contractAddress: string;
89
- tokenId?: number | null;
90
- contractType?: NftType;
91
81
  encodedData: string;
92
82
  spenderAddress?: string;
93
83
  }): GetQuoteRequest {
@@ -100,9 +90,7 @@ function generateGetRelayQuoteRequest({
100
90
  dstChain: dstChainId,
101
91
  dstTokenAddress: dstToken.address,
102
92
  price: dstAmount,
103
- contractAddress: contractAddress,
104
- tokenId: tokenId!,
105
- contractType: contractType!
93
+ contractAddress: contractAddress
106
94
  };
107
95
  }
108
96
  case OrderType.JoinTournament: {
@@ -176,7 +164,7 @@ export function AnySpendCustom({
176
164
  dstAmount: string;
177
165
  contractAddress: string;
178
166
  encodedData: string;
179
- metadata: AnySpendMetadata;
167
+ metadata: any;
180
168
  header: ({
181
169
  anyspendPrice,
182
170
  isLoadingAnyspendPrice
@@ -286,8 +274,6 @@ export function AnySpendCustom({
286
274
  dstToken: dstToken,
287
275
  dstAmount: dstAmount,
288
276
  contractAddress: contractAddress,
289
- tokenId: isNftMetadata(metadata) ? metadata.nftContract.tokenId : undefined,
290
- contractType: isNftMetadata(metadata) ? metadata.nftContract.type : undefined,
291
277
  encodedData: encodedData,
292
278
  spenderAddress: spenderAddress
293
279
  });
@@ -386,37 +372,23 @@ export function AnySpendCustom({
386
372
  srcAmount: srcAmount.toString(),
387
373
  recipientAddress,
388
374
  creatorAddress: currentWallet?.wallet?.address,
389
- nft: isNftMetadata(metadata)
390
- ? metadata.nftContract.type === NftType.ERC1155
391
- ? {
392
- type: NftType.ERC1155,
393
- contractAddress: metadata.nftContract.contractAddress,
394
- tokenId: metadata.nftContract.tokenId!,
395
- imageUrl: metadata.nftContract.imageUrl,
396
- nftPrice: dstAmount
397
- }
398
- : {
399
- type: NftType.ERC721,
400
- contractAddress: metadata.nftContract.contractAddress,
401
- contractType: metadata.nftContract.type,
402
- nftPrice: dstAmount
403
- }
404
- : undefined,
405
- tournament: isTournamentMetadata(metadata)
406
- ? {
407
- ...metadata.tournament,
408
- contractAddress: contractAddress,
409
- entryPriceOrFundAmount: dstAmount
410
- }
411
- : undefined,
375
+ nft: {
376
+ ...metadata.nftContract,
377
+ type: NftType.ERC721
378
+ },
379
+ tournament: {
380
+ ...metadata.tournament,
381
+ contractAddress: contractAddress,
382
+ entryPriceOrFundAmount: dstAmount
383
+ },
412
384
  payload: {
413
385
  amount: dstAmount,
414
386
  data: encodedData,
415
387
  spenderAddress: spenderAddress,
416
388
  to: contractAddress,
417
- action: isCustomTxMetadata(metadata) ? metadata.action : undefined
389
+ action: metadata.action
418
390
  }
419
- } as CreateOrderParams;
391
+ };
420
392
 
421
393
  if (onramp) {
422
394
  invariant(srcToken.address === USDC_BASE.address, "Selected src token is not USDC");
@@ -777,30 +749,14 @@ export function AnySpendCustom({
777
749
  onOrderCreated={(orderId: string) => setOrderId(orderId)}
778
750
  onBack={() => setActiveTab("crypto")}
779
751
  orderType={orderType}
780
- nft={
781
- isNftMetadata(metadata)
782
- ? metadata.nftContract.type === NftType.ERC1155
783
- ? {
784
- type: NftType.ERC1155,
785
- contractAddress: metadata.nftContract.contractAddress,
786
- tokenId: metadata.nftContract.tokenId!,
787
- imageUrl: metadata.nftContract.imageUrl,
788
- name: metadata.nftContract.name,
789
- description: metadata.nftContract.description,
790
- price: dstAmount
791
- }
792
- : {
793
- type: NftType.ERC721,
794
- contractAddress: metadata.nftContract.contractAddress,
795
- name: metadata.nftContract.name,
796
- description: metadata.nftContract.description,
797
- imageUrl: metadata.nftContract.imageUrl,
798
- price: dstAmount
799
- }
752
+ nft={metadata.nftContract ? { ...metadata.nftContract, price: dstAmount } : undefined}
753
+ tournament={
754
+ metadata.tournament
755
+ ? { ...metadata.tournament, contractAddress: contractAddress, entryPriceOrFundAmount: dstAmount }
800
756
  : undefined
801
757
  }
802
758
  payload={
803
- isCustomTxMetadata(metadata)
759
+ metadata.action
804
760
  ? {
805
761
  ...metadata,
806
762
  amount: dstAmount,
@@ -1,4 +1,5 @@
1
1
  import { ALL_CHAINS, getChainName, getExplorerAddressUrl, GetQuoteResponse, OrderType } from "@b3dotfun/sdk/anyspend";
2
+ import { DEFAULT_NFT_CONTRACT } from "@b3dotfun/sdk/anyspend/constants";
2
3
  import { NftContract } from "@b3dotfun/sdk/anyspend/types";
3
4
  import { GlareCard, Popover, PopoverContent, PopoverTrigger } from "@b3dotfun/sdk/global-account/react";
4
5
  import { cn } from "@b3dotfun/sdk/shared/utils";
@@ -15,15 +16,13 @@ export function AnySpendNFT({
15
16
  loadOrder,
16
17
  mode = "modal",
17
18
  recipientAddress,
18
- nftContract,
19
- onSuccess
19
+ nftContract = DEFAULT_NFT_CONTRACT
20
20
  }: {
21
21
  isMainnet?: boolean;
22
22
  loadOrder?: string;
23
23
  mode?: "modal" | "page";
24
24
  recipientAddress?: string;
25
- nftContract: NftContract;
26
- onSuccess?: (txHash?: string) => void;
25
+ nftContract?: NftContract;
27
26
  }) {
28
27
  const header = ({
29
28
  anyspendPrice,
@@ -79,12 +78,8 @@ export function AnySpendNFT({
79
78
  dstAmount={nftContract.price}
80
79
  contractAddress={nftContract.contractAddress}
81
80
  encodedData="0x"
82
- metadata={{
83
- type: OrderType.MintNFT,
84
- nftContract: nftContract
85
- }}
81
+ metadata={{ nftContract }}
86
82
  header={header}
87
- onSuccess={onSuccess}
88
83
  />
89
84
  );
90
85
  }
@@ -1,14 +1,17 @@
1
1
  import { ABI_ERC20_STAKING, B3_TOKEN, OrderType } from "@b3dotfun/sdk/anyspend";
2
+ import { EthIcon } from "./icons/EthIcon";
3
+ import { SolIcon } from "./icons/SolIcon";
4
+ import { UsdcIcon } from "./icons/USDCIcon";
2
5
  import {
3
6
  Button,
4
7
  GlareCardRounded,
5
8
  Input,
6
- StyleRoot,
7
9
  TextLoop,
8
- useChainSwitchWithAction,
9
10
  useHasMounted,
10
11
  useModalStore,
11
- useTokenBalance
12
+ useChainSwitchWithAction,
13
+ useTokenBalance,
14
+ StyleRoot
12
15
  } from "@b3dotfun/sdk/global-account/react";
13
16
  import { formatTokenAmount } from "@b3dotfun/sdk/shared/utils/number";
14
17
  import { motion } from "framer-motion";
@@ -20,9 +23,6 @@ import { createPublicClient, encodeFunctionData, erc20Abi, http } from "viem";
20
23
  import { base } from "viem/chains";
21
24
  import { useAccount, useWaitForTransactionReceipt, useWriteContract } from "wagmi";
22
25
  import { AnySpendCustom } from "./AnySpendCustom";
23
- import { EthIcon } from "./icons/EthIcon";
24
- import { SolIcon } from "./icons/SolIcon";
25
- import { UsdcIcon } from "./icons/USDCIcon";
26
26
 
27
27
  const basePublicClient = createPublicClient({
28
28
  chain: base,
@@ -483,7 +483,6 @@ export function AnySpendStakeB3({
483
483
  contractAddress={ERC20Staking}
484
484
  encodedData={encodedData}
485
485
  metadata={{
486
- type: OrderType.Custom,
487
486
  action: "stake B3"
488
487
  }}
489
488
  header={header}
@@ -100,10 +100,7 @@ export function AnySpendTournament(props: AnySpendTournamentProps) {
100
100
  dstAmount={dstAmount}
101
101
  contractAddress={tournamentContractAddress}
102
102
  encodedData="0x"
103
- metadata={{
104
- type: action === "join" ? OrderType.JoinTournament : OrderType.FundTournament,
105
- tournament: tournamentMetadata
106
- }}
103
+ metadata={{ tournament: tournamentMetadata }}
107
104
  header={header}
108
105
  onSuccess={onSuccess}
109
106
  showRecipient={action === "join"}
@@ -23,17 +23,17 @@ import {
23
23
  zTournament
24
24
  } from "@b3dotfun/sdk/anyspend";
25
25
  import {
26
- Badge,
27
- Button,
28
26
  CopyToClipboard,
27
+ Badge,
29
28
  ShinyButton,
30
29
  Skeleton,
31
30
  TextLoop,
32
31
  TextShimmer,
32
+ Button,
33
33
  useAccountWallet,
34
34
  useChainSwitchWithAction,
35
- useModalStore,
36
- useOnchainName
35
+ useOnchainName,
36
+ useModalStore
37
37
  } from "@b3dotfun/sdk/global-account/react";
38
38
  import { cn } from "@b3dotfun/sdk/shared/utils";
39
39
  import centerTruncate from "@b3dotfun/sdk/shared/utils/centerTruncate";
@@ -334,7 +334,7 @@ export const OrderDetails = memo(function OrderDetails({
334
334
 
335
335
  // When waitingForDeposit is true, we show a message to the user to wait for the deposit to be processed.
336
336
  const setWaitingForDeposit = useCallback(() => {
337
- const params = new URLSearchParams(searchParams.toString());
337
+ const params = new URLSearchParams(searchParams);
338
338
  params.set("waitingForDeposit", "true");
339
339
  router.push(`?${params}`);
340
340
  }, [router, searchParams]);
@@ -865,7 +865,7 @@ export const OrderDetails = memo(function OrderDetails({
865
865
  BigInt(order.srcAmount),
866
866
  order.srcTokenAddress === RELAY_ETH_ADDRESS ? "ETH" : order.srcTokenAddress
867
867
  )}
868
- className="max-w-[200px]"
868
+ size={200}
869
869
  />
870
870
  <div className="mt-3 flex items-center justify-center gap-2 text-sm">
871
871
  <span className="label-style text-as-brand/70 text-sm">Scan with</span>
@@ -1,5 +1,3 @@
1
- import { ANYSPEND_MAINNET_BASE_URL, ANYSPEND_TESTNET_BASE_URL } from "@b3dotfun/sdk/anyspend/constants";
2
- import { OnrampOptions } from "@b3dotfun/sdk/anyspend/react";
3
1
  import {
4
2
  GetOrderAndTxsResponse,
5
3
  GetQuoteRequest,
@@ -13,6 +11,8 @@ import {
13
11
  } from "@b3dotfun/sdk/anyspend/types";
14
12
  import { getNativeToken, isNativeToken } from "@b3dotfun/sdk/anyspend/utils";
15
13
  import invariant from "invariant";
14
+ import { ANYSPEND_MAINNET_BASE_URL, ANYSPEND_TESTNET_BASE_URL } from "@b3dotfun/sdk/anyspend/constants";
15
+ import { OnrampOptions } from "@b3dotfun/sdk/anyspend/react";
16
16
 
17
17
  // Service functions
18
18
  export const anyspendService = {
@@ -3,7 +3,6 @@ export * from "./req-res";
3
3
  export * from "./chain";
4
4
  export * from "./custom";
5
5
  export * from "./globalWallet";
6
- export * from "./metadata";
7
6
  export * from "./nft";
8
7
  export * from "./onramp";
9
8
  export * from "./order";
@@ -28,8 +28,6 @@ export type Nft = z.infer<typeof zNft>;
28
28
 
29
29
  export const zMintNftPayload = z.object({
30
30
  contractAddress: z.string(),
31
- tokenId: z.number().nullable(),
32
- contractType: z.nativeEnum(NftType),
33
31
  nftPrice: z.string()
34
32
  });
35
33
 
@@ -49,5 +47,4 @@ export interface NftContract {
49
47
  name: string;
50
48
  description: string;
51
49
  tokenId: number | null;
52
- type: NftType;
53
50
  }