@b3dotfun/sdk 0.0.18-alpha.4 → 0.0.18-alpha.6

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 (23) hide show
  1. package/README.md +29 -51
  2. package/dist/cjs/shared/thirdweb/generated/@tanstack/react-query.gen.d.ts +4 -4
  3. package/dist/cjs/shared/thirdweb/generated/@tanstack/react-query.gen.js +360 -313
  4. package/dist/cjs/shared/thirdweb/generated/client.gen.d.ts +2 -2
  5. package/dist/cjs/shared/thirdweb/generated/sdk.gen.d.ts +2 -2
  6. package/dist/cjs/shared/thirdweb/generated/sdk.gen.js +398 -398
  7. package/dist/cjs/shared/thirdweb/generated/types.gen.d.ts +135 -135
  8. package/dist/esm/shared/thirdweb/generated/@tanstack/react-query.gen.d.ts +4 -4
  9. package/dist/esm/shared/thirdweb/generated/@tanstack/react-query.gen.js +363 -316
  10. package/dist/esm/shared/thirdweb/generated/client.gen.d.ts +2 -2
  11. package/dist/esm/shared/thirdweb/generated/client.gen.js +1 -1
  12. package/dist/esm/shared/thirdweb/generated/sdk.gen.d.ts +2 -2
  13. package/dist/esm/shared/thirdweb/generated/sdk.gen.js +399 -399
  14. package/dist/esm/shared/thirdweb/generated/types.gen.d.ts +135 -135
  15. package/dist/types/shared/thirdweb/generated/@tanstack/react-query.gen.d.ts +4 -4
  16. package/dist/types/shared/thirdweb/generated/client.gen.d.ts +2 -2
  17. package/dist/types/shared/thirdweb/generated/sdk.gen.d.ts +2 -2
  18. package/dist/types/shared/thirdweb/generated/types.gen.d.ts +135 -135
  19. package/package.json +1 -1
  20. package/src/shared/thirdweb/generated/@tanstack/react-query.gen.ts +1886 -1220
  21. package/src/shared/thirdweb/generated/client.gen.ts +11 -4
  22. package/src/shared/thirdweb/generated/sdk.gen.ts +1083 -809
  23. package/src/shared/thirdweb/generated/types.gen.ts +3953 -3862
package/README.md CHANGED
@@ -12,6 +12,7 @@ The SDK is organized into focused modules:
12
12
  - **`others/`** - Additional features and utilities
13
13
 
14
14
  Each module contains:
15
+
15
16
  - `react/` - React components and hooks
16
17
  - `services/` - Headless TypeScript services
17
18
  - `types/` - TypeScript definitions
@@ -20,11 +21,11 @@ Each module contains:
20
21
 
21
22
  ## Platform Support
22
23
 
23
- | Feature | React Web | React Native |
24
- | ---------------------- | --------- | ------------ |
25
- | AnySpend | ✅ | ❌ |
26
- | Global Accounts | ✅ | ✅ |
27
- | Headless Services | ✅ | ✅ |
24
+ | Feature | React Web | React Native |
25
+ | ----------------- | --------- | ------------ |
26
+ | AnySpend | ✅ | ❌ |
27
+ | Global Accounts | ✅ | ✅ |
28
+ | Headless Services | ✅ | ✅ |
28
29
 
29
30
  ## Installation
30
31
 
@@ -54,12 +55,7 @@ AnySpend enables cross-chain swaps, NFT minting, and other blockchain operations
54
55
  import { AnySpend } from "@b3dotfun/sdk/anyspend/react";
55
56
 
56
57
  function CrossChainSwapPage() {
57
- return (
58
- <AnySpend
59
- isMainnet={true}
60
- mode="page"
61
- />
62
- );
58
+ return <AnySpend isMainnet={true} mode="page" />;
63
59
  }
64
60
  ```
65
61
 
@@ -78,16 +74,11 @@ function NFTMinting() {
78
74
  price: "1000000000000000000", // 1 ETH in wei
79
75
  currency: {
80
76
  symbol: "ETH",
81
- decimals: 18
82
- }
77
+ decimals: 18,
78
+ },
83
79
  };
84
80
 
85
- return (
86
- <AnySpendNFTButton
87
- nftContract={nftContract}
88
- recipientAddress="0x..."
89
- />
90
- );
81
+ return <AnySpendNFTButton nftContract={nftContract} recipientAddress="0x..." />;
91
82
  }
92
83
  ```
93
84
 
@@ -115,15 +106,15 @@ import { anyspendService } from "@b3dotfun/sdk/anyspend/services/anyspend";
115
106
  // Get available tokens for a chain
116
107
  const tokens = await anyspendService.getTokenList(
117
108
  true, // isMainnet
118
- 1, // chainId (Ethereum)
119
- "usdc" // search query
109
+ 1, // chainId (Ethereum)
110
+ "usdc", // search query
120
111
  );
121
112
 
122
113
  // Get specific token details
123
114
  const token = await anyspendService.getToken(
124
115
  true, // isMainnet
125
- 1, // chainId
126
- "0xA0b86a33E6c51c7C36c654d6C9e7b8F5d4a8b5c5" // token address
116
+ 1, // chainId
117
+ "0xA0b86a33E6c51c7C36c654d6C9e7b8F5d4a8b5c5", // token address
127
118
  );
128
119
  ```
129
120
 
@@ -141,7 +132,7 @@ const quoteRequest: GetQuoteRequest = {
141
132
  dstTokenAddress: "0x...",
142
133
  srcAmount: "1000000", // 1 USDC
143
134
  recipientAddress: "0x...",
144
- type: "swap"
135
+ type: "swap",
145
136
  };
146
137
 
147
138
  const quote = await anyspendService.getQuote(true, quoteRequest);
@@ -157,7 +148,7 @@ const order = await anyspendService.createOrder({
157
148
  dstTokenAddress: "0x...",
158
149
  srcAmount: "1000000",
159
150
  payload: {},
160
- metadata: {}
151
+ metadata: {},
161
152
  });
162
153
  ```
163
154
 
@@ -169,7 +160,7 @@ import { anyspendService } from "@b3dotfun/sdk/anyspend/services/anyspend";
169
160
  // Get order details and transactions
170
161
  const orderDetails = await anyspendService.getOrderAndTransactions(
171
162
  true, // isMainnet
172
- "order-id"
163
+ "order-id",
173
164
  );
174
165
 
175
166
  // Get order history for an address
@@ -177,7 +168,7 @@ const history = await anyspendService.getOrderHistory(
177
168
  true, // isMainnet
178
169
  "0x...", // creator address
179
170
  50, // limit
180
- 0 // offset
171
+ 0, // offset
181
172
  );
182
173
  ```
183
174
 
@@ -214,7 +205,7 @@ function App() {
214
205
  <SignInWithB3
215
206
  provider={{ strategy: "google" }}
216
207
  partnerId="your-partner-id"
217
- onLoginSuccess={(globalAccount) => {
208
+ onLoginSuccess={globalAccount => {
218
209
  console.log("Authenticated:", globalAccount);
219
210
  }}
220
211
  />
@@ -232,7 +223,7 @@ const b3Chain = {
232
223
  id: 8333,
233
224
  name: "B3",
234
225
  nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
235
- rpc: "https://mainnet-rpc.b3.fun"
226
+ rpc: "https://mainnet-rpc.b3.fun",
236
227
  };
237
228
 
238
229
  function SessionKeyAuth() {
@@ -243,7 +234,7 @@ function SessionKeyAuth() {
243
234
  chain={b3Chain}
244
235
  partnerId="your-partner-id"
245
236
  sessionKeyAddress="0x..." // MetaMask address
246
- onLoginSuccess={(globalAccount) => {
237
+ onLoginSuccess={globalAccount => {
247
238
  console.log("Session key authenticated:", globalAccount);
248
239
  }}
249
240
  />
@@ -266,10 +257,10 @@ function PermissionsExample() {
266
257
  approvedTargets: ["0x..."], // Contract addresses
267
258
  startDate: new Date(),
268
259
  endDate: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000), // 30 days
269
- nativeTokenLimitPerTransaction: 0.0001
260
+ nativeTokenLimitPerTransaction: 0.0001,
270
261
  }}
271
262
  onSuccess={() => console.log("Permissions granted")}
272
- onError={(error) => console.error("Permission error:", error)}
263
+ onError={error => console.error("Permission error:", error)}
273
264
  />
274
265
  );
275
266
  }
@@ -283,15 +274,7 @@ import { useB3 } from "@b3dotfun/sdk/global-account/react";
283
274
  function AccountStatus() {
284
275
  const { account, isAuthenticated } = useB3();
285
276
 
286
- return (
287
- <div>
288
- {isAuthenticated ? (
289
- <p>Welcome, {account?.displayName}!</p>
290
- ) : (
291
- <p>Please sign in</p>
292
- )}
293
- </div>
294
- );
277
+ return <div>{isAuthenticated ? <p>Welcome, {account?.displayName}!</p> : <p>Please sign in</p>}</div>;
295
278
  }
296
279
  ```
297
280
 
@@ -303,11 +286,9 @@ function AccountStatus() {
303
286
  import { authenticate, resetSocket } from "@b3dotfun/sdk/global-account/app";
304
287
 
305
288
  // Authenticate with B3 Global Account
306
- const authResult = await authenticate(
307
- "access-token",
308
- "identity-token",
309
- { /* additional params */ }
310
- );
289
+ const authResult = await authenticate("access-token", "identity-token", {
290
+ /* additional params */
291
+ });
311
292
 
312
293
  if (authResult) {
313
294
  console.log("Authentication successful:", authResult);
@@ -325,10 +306,7 @@ resetSocket();
325
306
  import { authenticate as bsmntAuthenticate } from "@b3dotfun/sdk/global-account/bsmnt";
326
307
 
327
308
  // Authenticate with Basement services
328
- const bsmntAuth = await bsmntAuthenticate(
329
- "access-token",
330
- "identity-token"
331
- );
309
+ const bsmntAuth = await bsmntAuthenticate("access-token", "identity-token");
332
310
  ```
333
311
 
334
312
  ### React Native Support
@@ -372,7 +350,7 @@ import { cn } from "@b3dotfun/sdk/shared/utils/cn";
372
350
 
373
351
  // Tailwind class name utility
374
352
  const classes = cn("base-class", "conditional-class", {
375
- "active": isActive
353
+ active: isActive,
376
354
  });
377
355
  ```
378
356
 
@@ -1,8 +1,8 @@
1
- import { type Options } from '../sdk.gen';
2
- import { type UseMutationOptions, type InfiniteData } from '@tanstack/react-query';
3
- import type { GetV1WebhooksData, PostV1WebhooksData, PostV1WebhooksError, PostV1WebhooksResponse, DeleteV1WebhooksByWebhookIdData, DeleteV1WebhooksByWebhookIdError, DeleteV1WebhooksByWebhookIdResponse, PatchV1WebhooksByWebhookIdData, PatchV1WebhooksByWebhookIdError, PatchV1WebhooksByWebhookIdResponse, PostV1WebhooksTestData, PostV1WebhooksTestError, PostV1WebhooksTestResponse, GetV1EventsData, GetV1EventsError, GetV1EventsByContractAddressData, GetV1EventsByContractAddressError, GetV1EventsByContractAddressBySignatureData, GetV1EventsByContractAddressBySignatureError, GetV1TransactionsData, GetV1TransactionsError, GetV1TransactionsByContractAddressData, GetV1TransactionsByContractAddressError, GetV1TransactionsByContractAddressBySignatureData, GetV1TransactionsByContractAddressBySignatureError, GetV1TokensTransfersTransactionByTransactionHashData, GetV1TokensTransfersByContractAddressData, GetV1TokensTransfersData, GetV1TokensErc20ByOwnerAddressData, GetV1TokensErc721ByOwnerAddressData, GetV1TokensErc1155ByOwnerAddressData, GetV1TokensPriceSupportedData, GetV1TokensPriceData, GetV1TokensLookupData, GetV1ResolveByInputData, GetV1BlocksData, GetV1BlocksError, GetV1ContractsAbiByContractAddressData, GetV1ContractsMetadataByContractAddressData, PostV1DecodeByContractAddressData, PostV1DecodeByContractAddressError, PostV1DecodeByContractAddressResponse, GetV1NftsBalanceByOwnerAddressData, GetV1NftsCollectionsByContractAddressData, GetV1NftsData, GetV1NftsOwnersByContractAddressData, GetV1NftsOwnersByContractAddressByTokenIdData, GetV1NftsTransfersData, GetV1NftsTransfersTransactionByTransactionHashData, GetV1NftsTransfersByContractAddressData, GetV1NftsByContractAddressData, GetV1NftsTransfersByContractAddressByTokenIdData, GetV1NftsByContractAddressByTokenIdData, GetV1NftsMetadataRefreshByContractAddressData, GetV1NftsMetadataRefreshByContractAddressByTokenIdData, GetV1WalletsByWalletAddressTransactionsData, GetV1WalletsByWalletAddressTransactionsError } from '../types.gen';
1
+ import { type Options } from "../sdk.gen";
2
+ import { type UseMutationOptions, type InfiniteData } from "@tanstack/react-query";
3
+ import type { GetV1WebhooksData, PostV1WebhooksData, PostV1WebhooksError, PostV1WebhooksResponse, DeleteV1WebhooksByWebhookIdData, DeleteV1WebhooksByWebhookIdError, DeleteV1WebhooksByWebhookIdResponse, PatchV1WebhooksByWebhookIdData, PatchV1WebhooksByWebhookIdError, PatchV1WebhooksByWebhookIdResponse, PostV1WebhooksTestData, PostV1WebhooksTestError, PostV1WebhooksTestResponse, GetV1EventsData, GetV1EventsError, GetV1EventsByContractAddressData, GetV1EventsByContractAddressError, GetV1EventsByContractAddressBySignatureData, GetV1EventsByContractAddressBySignatureError, GetV1TransactionsData, GetV1TransactionsError, GetV1TransactionsByContractAddressData, GetV1TransactionsByContractAddressError, GetV1TransactionsByContractAddressBySignatureData, GetV1TransactionsByContractAddressBySignatureError, GetV1TokensTransfersTransactionByTransactionHashData, GetV1TokensTransfersByContractAddressData, GetV1TokensTransfersData, GetV1TokensErc20ByOwnerAddressData, GetV1TokensErc721ByOwnerAddressData, GetV1TokensErc1155ByOwnerAddressData, GetV1TokensPriceSupportedData, GetV1TokensPriceData, GetV1TokensLookupData, GetV1ResolveByInputData, GetV1BlocksData, GetV1BlocksError, GetV1ContractsAbiByContractAddressData, GetV1ContractsMetadataByContractAddressData, PostV1DecodeByContractAddressData, PostV1DecodeByContractAddressError, PostV1DecodeByContractAddressResponse, GetV1NftsBalanceByOwnerAddressData, GetV1NftsCollectionsByContractAddressData, GetV1NftsData, GetV1NftsOwnersByContractAddressData, GetV1NftsOwnersByContractAddressByTokenIdData, GetV1NftsTransfersData, GetV1NftsTransfersTransactionByTransactionHashData, GetV1NftsTransfersByContractAddressData, GetV1NftsByContractAddressData, GetV1NftsTransfersByContractAddressByTokenIdData, GetV1NftsByContractAddressByTokenIdData, GetV1NftsMetadataRefreshByContractAddressData, GetV1NftsMetadataRefreshByContractAddressByTokenIdData, GetV1WalletsByWalletAddressTransactionsData, GetV1WalletsByWalletAddressTransactionsError } from "../types.gen";
4
4
  export type QueryKey<TOptions extends Options> = [
5
- Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & {
5
+ Pick<TOptions, "baseUrl" | "body" | "headers" | "path" | "query"> & {
6
6
  _id: string;
7
7
  _infinite?: boolean;
8
8
  }