@trustware/sdk-staging 1.1.8-staging.3 → 1.1.8-staging.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.
Files changed (46) hide show
  1. package/README.md +27 -0
  2. package/dist/blockchain-BONedEsU.d.cts +110 -0
  3. package/dist/blockchain-BONedEsU.d.ts +110 -0
  4. package/dist/constants.cjs +1 -1
  5. package/dist/constants.mjs +1 -1
  6. package/dist/{core-u95iahDO.d.cts → core-B9PJ0mUX.d.cts} +3 -2
  7. package/dist/{core-CVbN3gJy.d.ts → core-DrWK6PT3.d.ts} +3 -2
  8. package/dist/core.cjs +2290 -2247
  9. package/dist/core.cjs.map +1 -1
  10. package/dist/core.d.cts +4 -3
  11. package/dist/core.d.ts +4 -3
  12. package/dist/core.mjs +2277 -2244
  13. package/dist/core.mjs.map +1 -1
  14. package/dist/{detect-6MRR4B7g.d.ts → detect-BLE9aPwJ.d.ts} +2 -2
  15. package/dist/{detect-DVIWcXpl.d.cts → detect-Dn7A-Svt.d.cts} +2 -2
  16. package/dist/index.cjs +22356 -3553
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.cts +28 -10
  19. package/dist/index.d.ts +28 -10
  20. package/dist/index.mjs +28302 -9499
  21. package/dist/index.mjs.map +1 -1
  22. package/dist/{manager-CXSw1h5e.d.cts → manager-C85ARoxD.d.cts} +65 -121
  23. package/dist/{manager-CXSw1h5e.d.ts → manager-PBjHXKjh.d.ts} +65 -121
  24. package/dist/smart-account.cjs +14707 -0
  25. package/dist/smart-account.cjs.map +1 -0
  26. package/dist/smart-account.d.cts +3962 -0
  27. package/dist/smart-account.d.ts +3962 -0
  28. package/dist/smart-account.mjs +14686 -0
  29. package/dist/smart-account.mjs.map +1 -0
  30. package/dist/types-B3nKHW6H.d.cts +32 -0
  31. package/dist/types-MtdjJgwT.d.ts +32 -0
  32. package/dist/wallet.cjs +29 -9
  33. package/dist/wallet.cjs.map +1 -1
  34. package/dist/wallet.d.cts +4 -3
  35. package/dist/wallet.d.ts +4 -3
  36. package/dist/wallet.mjs +16 -6
  37. package/dist/wallet.mjs.map +1 -1
  38. package/dist/widget.cjs +33042 -14248
  39. package/dist/widget.cjs.map +1 -1
  40. package/dist/widget.d.cts +5 -4
  41. package/dist/widget.d.ts +5 -4
  42. package/dist/widget.mjs +32978 -14180
  43. package/dist/widget.mjs.map +1 -1
  44. package/package.json +17 -4
  45. package/dist/types-BrVfNxND.d.cts +0 -14
  46. package/dist/types-BrVfNxND.d.ts +0 -14
@@ -1,3 +1,5 @@
1
+ import { c as ChainType, C as ChainDef } from './blockchain-BONedEsU.cjs';
2
+
1
3
  declare enum TrustwareErrorCode {
2
4
  INVALID_CONFIG = "INVALID_CONFIG",
3
5
  INVALID_API_KEY = "INVALID_API_KEY",
@@ -129,6 +131,7 @@ type EvmWalletInterface = BaseWalletInterface & {
129
131
  data: `0x${string}`;
130
132
  value?: bigint;
131
133
  chainId?: number;
134
+ paymasterAndData?: `0x${string}`;
132
135
  }): Promise<{
133
136
  hash: `0x${string}`;
134
137
  }>;
@@ -145,115 +148,6 @@ type SimpleWalletInterface = {
145
148
  disconnect?(): Promise<void>;
146
149
  };
147
150
 
148
- type ChainMeta = {
149
- id: string;
150
- networkIdentifier: string;
151
- nativeCurrency: {
152
- symbol: string;
153
- decimals: number;
154
- name: string;
155
- };
156
- };
157
- type TokenMeta = {
158
- chainId: string;
159
- address: `0x${string}`;
160
- symbol: string;
161
- decimals: number;
162
- visible?: boolean;
163
- active?: boolean;
164
- };
165
- type BalanceRow = {
166
- chain_key: string;
167
- category: "native" | "erc20" | "spl" | "btc";
168
- contract?: string;
169
- address?: string;
170
- symbol?: string;
171
- decimals: number;
172
- balance: string;
173
- name?: string;
174
- logoURI?: string;
175
- usdPrice?: number;
176
- };
177
- type WalletAddressBalanceWrapper = {
178
- chain_id: string;
179
- balances: BalanceRow[];
180
- count: number;
181
- error: string | null;
182
- source: string;
183
- };
184
- type TokenPageOptions = {
185
- cursor?: string;
186
- limit?: number;
187
- q?: string;
188
- };
189
- type TokenPageInfo = {
190
- hasNextPage: boolean;
191
- nextCursor?: string;
192
- };
193
- type TokenPageResult = {
194
- data: TokenDef[];
195
- pageInfo: TokenPageInfo;
196
- };
197
- type BalanceStreamOptions = {
198
- stream?: boolean;
199
- signal?: AbortSignal;
200
- strict?: boolean;
201
- };
202
- type ChainType = "evm" | "cosmos" | "solana" | "btc" | string;
203
- interface NativeCurrency {
204
- symbol: string;
205
- name?: string;
206
- decimals?: number;
207
- icon?: string;
208
- }
209
- interface ChainDef {
210
- /** API commonly sends both. We canonicalize on chainId as string. */
211
- chainId: string | number;
212
- id?: string | number;
213
- /** Keys we use to resolve chains from presets / user input */
214
- networkIdentifier?: string;
215
- axelarChainName?: string;
216
- networkName?: string;
217
- /** UI/availability flags */
218
- enabled?: boolean;
219
- visible?: boolean;
220
- isTestnet?: boolean;
221
- /** Display */
222
- chainIconURI?: string;
223
- nativeCurrency?: NativeCurrency;
224
- /** Kinds (some payloads use both) */
225
- type?: ChainType;
226
- chainType?: ChainType;
227
- /** Nice-to-have extras we won't rely on but keep for completeness */
228
- blockExplorerUrls?: string[];
229
- rpc?: string;
230
- rpcList?: string[];
231
- }
232
- type TokenType = "evm" | "solana" | "btc" | string;
233
- interface TokenDef {
234
- /** Core identity */
235
- address: string;
236
- chainId: string | number;
237
- /** Display */
238
- logoURI?: string;
239
- name: string;
240
- symbol: string;
241
- /** Behavior / filtering */
242
- decimals: number;
243
- active?: boolean;
244
- visible?: boolean;
245
- type: TokenType;
246
- /** Optional metadata */
247
- usdPrice?: number;
248
- coingeckoId?: string;
249
- createdBy?: string;
250
- subGraphIds?: string[];
251
- subGraphOnly?: boolean;
252
- }
253
- type TokenWithBalance = TokenDef & {
254
- balance?: bigint;
255
- };
256
-
257
151
  type WalletAddressSource = "provider" | "manual" | "imported";
258
152
  type WalletIdentityAddress = {
259
153
  address: string;
@@ -312,16 +206,7 @@ type TxRequest = {
312
206
  chainId?: number | string;
313
207
  gasPrice?: string;
314
208
  };
315
- declare function buildRoute(body: BuildRouteBody, signal?: AbortSignal): Promise<{
316
- intentId: string;
317
- txReq: TxRequest;
318
- actions: unknown[];
319
- finalExchangeRate: {
320
- fromAmountUSD?: string;
321
- toAmountMinUSD?: string;
322
- };
323
- route: RoutePlan | undefined;
324
- }>;
209
+ declare function buildRoute(body: BuildRouteBody, signal?: AbortSignal): Promise<BuildRouteResult>;
325
210
  declare function buildDepositAddress(body: BuildRouteBody, signal?: AbortSignal): Promise<{
326
211
  intentId: string;
327
212
  depositAddress: string;
@@ -332,7 +217,7 @@ declare function buildDepositAddress(body: BuildRouteBody, signal?: AbortSignal)
332
217
  };
333
218
  route: RoutePlan | undefined;
334
219
  }>;
335
- declare function submitReceipt(intentId: string, txHash: string): Promise<any>;
220
+ declare function submitReceipt(intentId: string, txHash: string, sponsorshipRequestId?: string): Promise<any>;
336
221
  declare function getStatus(intentId: string): Promise<Transaction>;
337
222
  declare function pollStatus(intentId: string, { intervalMs, timeoutMs }?: {
338
223
  intervalMs?: number | undefined;
@@ -393,6 +278,33 @@ type Transaction = {
393
278
  updatedDate: Date | string;
394
279
  timeSpentMs?: number;
395
280
  };
281
+ type SponsorshipApproval = {
282
+ client_id: string;
283
+ program_id: string;
284
+ sdk_key_id: string;
285
+ sender: string;
286
+ call_data_hash: string;
287
+ chain_id: string;
288
+ max_cost: string;
289
+ valid_after?: string | null;
290
+ valid_until?: string | null;
291
+ nonce: string;
292
+ entry_point: string;
293
+ paymaster: string;
294
+ };
295
+ type RouteSponsorship = {
296
+ requestId: string;
297
+ paymaster: string;
298
+ entryPoint: string;
299
+ chainId: string;
300
+ callDataHash: string;
301
+ maxCost: string;
302
+ paymasterAndData: string;
303
+ signature: string;
304
+ signer: string;
305
+ typedDataHash: string;
306
+ approval: SponsorshipApproval;
307
+ };
396
308
  type RouteEstimate = {
397
309
  fromAmount?: string;
398
310
  toAmount?: string;
@@ -415,6 +327,7 @@ type RoutePlan = {
415
327
  diagnostics?: {
416
328
  rawPayload?: unknown;
417
329
  };
330
+ sponsorship?: RouteSponsorship;
418
331
  };
419
332
  type BuildRouteResult = {
420
333
  intentId: string;
@@ -425,6 +338,7 @@ type BuildRouteResult = {
425
338
  toAmountMinUSD?: string;
426
339
  };
427
340
  route: RoutePlan | undefined;
341
+ sponsorship?: RouteSponsorship;
428
342
  };
429
343
 
430
344
  type TrustwareEvent = {
@@ -553,15 +467,45 @@ type ResolvedTrustwareConfig = {
553
467
  onSuccess?: (transaction: Transaction) => void;
554
468
  onEvent?: (event: TrustwareEvent) => void;
555
469
  };
470
+ /** A token identified by contract address + chain ID. Used for swap mode configuration. */
471
+ type SwapTokenRef = {
472
+ /** EVM contract address (or native placeholder, e.g. "0xeeee...") */
473
+ address: string;
474
+ /** Numeric chain ID, e.g. 8453 for Base */
475
+ chainId: number;
476
+ };
556
477
  type FeatureFlags = {
557
478
  tokensPagination?: boolean;
558
479
  balanceStreaming?: boolean;
559
480
  shouldAllowGA4?: boolean;
481
+ swapMode?: boolean;
482
+ /**
483
+ * Pre-selects the destination token in swap mode. When set, the widget opens
484
+ * with this token already chosen as the "buy" side.
485
+ * Example: `{ address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", chainId: 8453 }` (Base USDC)
486
+ */
487
+ swapDefaultDestToken?: SwapTokenRef;
488
+ /**
489
+ * When true (and `swapDefaultDestToken` is set), the destination token is fixed
490
+ * and the user cannot change it. The "select token to buy" button is disabled.
491
+ */
492
+ swapLockDestToken?: boolean;
493
+ /**
494
+ * Restricts the destination ("buy") token selector to only these tokens. The user
495
+ * can still sell any token from their wallet; only the buy side is limited.
496
+ * Each entry is a token address + chain ID pair. When omitted, all tokens are selectable.
497
+ * Example: `[{ address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", chainId: 1 }]`
498
+ */
499
+ swapAllowedDestTokens?: SwapTokenRef[];
560
500
  };
561
501
  type ResolvedFeatureFlags = {
562
502
  tokensPagination: boolean;
563
503
  balanceStreaming: boolean;
564
504
  shouldAllowGA4: boolean;
505
+ swapMode: boolean;
506
+ swapDefaultDestToken: SwapTokenRef | null;
507
+ swapLockDestToken: boolean;
508
+ swapAllowedDestTokens: SwapTokenRef[] | null;
565
509
  };
566
510
  declare const DEFAULT_SLIPPAGE = 1;
567
511
  declare const DEFAULT_AUTO_DETECT_PROVIDER = false;
@@ -735,4 +679,4 @@ declare function useWalletInfo(wagmi?: WagmiBridge): {
735
679
  };
736
680
  declare function useWalletExternalDisconnect(cb: () => void): void;
737
681
 
738
- export { type WalletEcosystem as $, type TokenDef as A, type BalanceRow as B, type ChainDef as C, DEFAULT_AUTO_DETECT_PROVIDER as D, type EIP1193 as E, type FeatureFlags as F, type TokenMeta as G, type TokenPageInfo as H, IdentityStore as I, type TokenPageOptions as J, type TokenPageResult as K, type TokenType as L, type TokenWithBalance as M, type NativeCurrency as N, type TrustwareWidgetMessages as O, type TrustwareWidgetTheme as P, type WagmiBridge as Q, type RateLimitInfo as R, type SimpleWalletInterface as S, type TrustwareConfigOptions as T, type WagmiConnector as U, type WalletAddressBalanceWrapper as V, type WalletInterFaceAPI as W, type WalletAddressResolution as X, type WalletAddressSource as Y, type WalletCategory as Z, type WalletConnectConfig as _, TrustwareError as a, type WalletId as a0, type WalletIdentity as a1, type WalletIdentityAddress as a2, type WalletIdentityChainLike as a3, type WalletMeta as a4, buildWalletIdentityAddress as a5, createWalletIdentity as a6, resolveWalletAddressForChain as a7, upsertWalletIdentityAddress as a8, useWireDetectionIntoManager as a9, type WalletSnapshot as aa, useWalletConnectConnect as ab, useWalletExternalDisconnect as ac, useWalletInfo as ad, walletManager as ae, buildRoute as af, buildDepositAddress as ag, submitReceipt as ah, getStatus as ai, pollStatus as aj, type Transaction as b, type TrustwareEvent as c, type BalanceStreamOptions as d, type BuildRouteResult as e, type ChainMeta as f, type ChainType as g, DEFAULT_FEATURE_FLAGS as h, DEFAULT_MESSAGES as i, DEFAULT_RETRY_CONFIG as j, DEFAULT_SLIPPAGE as k, DEFAULT_THEME as l, type DetectedWallet as m, type EIP6963ProviderDetail as n, type EvmWalletInterface as o, type ResolvedFeatureFlags as p, type ResolvedRetryConfig as q, type ResolvedTrustwareConfig as r, type ResolvedWalletConnectConfig as s, type RetryConfig as t, type RouteEstimate as u, type RouteIntent as v, type RouteParams as w, type RoutePlan as x, type SolanaProviderLike as y, type SolanaWalletInterface as z };
682
+ export { getStatus as $, type TrustwareWidgetTheme as A, type BuildRouteResult as B, type WagmiConnector as C, DEFAULT_AUTO_DETECT_PROVIDER as D, type EIP1193 as E, type FeatureFlags as F, type WalletAddressResolution as G, type WalletAddressSource as H, IdentityStore as I, type WalletCategory as J, type WalletConnectConfig as K, type WalletEcosystem as L, type WalletId as M, type WalletIdentity as N, type WalletIdentityAddress as O, type WalletIdentityChainLike as P, type WalletInterFaceAPI as Q, type RateLimitInfo as R, type SimpleWalletInterface as S, type Transaction as T, type WalletMeta as U, type WalletSnapshot as V, type WagmiBridge as W, buildDepositAddress as X, buildRoute as Y, buildWalletIdentityAddress as Z, createWalletIdentity as _, DEFAULT_FEATURE_FLAGS as a, pollStatus as a0, resolveWalletAddressForChain as a1, submitReceipt as a2, upsertWalletIdentityAddress as a3, useWalletConnectConnect as a4, useWalletExternalDisconnect as a5, useWalletInfo as a6, useWireDetectionIntoManager as a7, walletManager as a8, DEFAULT_MESSAGES as b, DEFAULT_RETRY_CONFIG as c, DEFAULT_SLIPPAGE as d, DEFAULT_THEME as e, type DetectedWallet as f, type EIP6963ProviderDetail as g, type EvmWalletInterface as h, type ResolvedFeatureFlags as i, type ResolvedRetryConfig as j, type ResolvedTrustwareConfig as k, type ResolvedWalletConnectConfig as l, type RetryConfig as m, type RouteEstimate as n, type RouteIntent as o, type RouteParams as p, type RoutePlan as q, type RouteSponsorship as r, type SolanaProviderLike as s, type SolanaWalletInterface as t, type SponsorshipApproval as u, type SwapTokenRef as v, type TrustwareConfigOptions as w, TrustwareError as x, type TrustwareEvent as y, type TrustwareWidgetMessages as z };
@@ -1,3 +1,5 @@
1
+ import { c as ChainType, C as ChainDef } from './blockchain-BONedEsU.js';
2
+
1
3
  declare enum TrustwareErrorCode {
2
4
  INVALID_CONFIG = "INVALID_CONFIG",
3
5
  INVALID_API_KEY = "INVALID_API_KEY",
@@ -129,6 +131,7 @@ type EvmWalletInterface = BaseWalletInterface & {
129
131
  data: `0x${string}`;
130
132
  value?: bigint;
131
133
  chainId?: number;
134
+ paymasterAndData?: `0x${string}`;
132
135
  }): Promise<{
133
136
  hash: `0x${string}`;
134
137
  }>;
@@ -145,115 +148,6 @@ type SimpleWalletInterface = {
145
148
  disconnect?(): Promise<void>;
146
149
  };
147
150
 
148
- type ChainMeta = {
149
- id: string;
150
- networkIdentifier: string;
151
- nativeCurrency: {
152
- symbol: string;
153
- decimals: number;
154
- name: string;
155
- };
156
- };
157
- type TokenMeta = {
158
- chainId: string;
159
- address: `0x${string}`;
160
- symbol: string;
161
- decimals: number;
162
- visible?: boolean;
163
- active?: boolean;
164
- };
165
- type BalanceRow = {
166
- chain_key: string;
167
- category: "native" | "erc20" | "spl" | "btc";
168
- contract?: string;
169
- address?: string;
170
- symbol?: string;
171
- decimals: number;
172
- balance: string;
173
- name?: string;
174
- logoURI?: string;
175
- usdPrice?: number;
176
- };
177
- type WalletAddressBalanceWrapper = {
178
- chain_id: string;
179
- balances: BalanceRow[];
180
- count: number;
181
- error: string | null;
182
- source: string;
183
- };
184
- type TokenPageOptions = {
185
- cursor?: string;
186
- limit?: number;
187
- q?: string;
188
- };
189
- type TokenPageInfo = {
190
- hasNextPage: boolean;
191
- nextCursor?: string;
192
- };
193
- type TokenPageResult = {
194
- data: TokenDef[];
195
- pageInfo: TokenPageInfo;
196
- };
197
- type BalanceStreamOptions = {
198
- stream?: boolean;
199
- signal?: AbortSignal;
200
- strict?: boolean;
201
- };
202
- type ChainType = "evm" | "cosmos" | "solana" | "btc" | string;
203
- interface NativeCurrency {
204
- symbol: string;
205
- name?: string;
206
- decimals?: number;
207
- icon?: string;
208
- }
209
- interface ChainDef {
210
- /** API commonly sends both. We canonicalize on chainId as string. */
211
- chainId: string | number;
212
- id?: string | number;
213
- /** Keys we use to resolve chains from presets / user input */
214
- networkIdentifier?: string;
215
- axelarChainName?: string;
216
- networkName?: string;
217
- /** UI/availability flags */
218
- enabled?: boolean;
219
- visible?: boolean;
220
- isTestnet?: boolean;
221
- /** Display */
222
- chainIconURI?: string;
223
- nativeCurrency?: NativeCurrency;
224
- /** Kinds (some payloads use both) */
225
- type?: ChainType;
226
- chainType?: ChainType;
227
- /** Nice-to-have extras we won't rely on but keep for completeness */
228
- blockExplorerUrls?: string[];
229
- rpc?: string;
230
- rpcList?: string[];
231
- }
232
- type TokenType = "evm" | "solana" | "btc" | string;
233
- interface TokenDef {
234
- /** Core identity */
235
- address: string;
236
- chainId: string | number;
237
- /** Display */
238
- logoURI?: string;
239
- name: string;
240
- symbol: string;
241
- /** Behavior / filtering */
242
- decimals: number;
243
- active?: boolean;
244
- visible?: boolean;
245
- type: TokenType;
246
- /** Optional metadata */
247
- usdPrice?: number;
248
- coingeckoId?: string;
249
- createdBy?: string;
250
- subGraphIds?: string[];
251
- subGraphOnly?: boolean;
252
- }
253
- type TokenWithBalance = TokenDef & {
254
- balance?: bigint;
255
- };
256
-
257
151
  type WalletAddressSource = "provider" | "manual" | "imported";
258
152
  type WalletIdentityAddress = {
259
153
  address: string;
@@ -312,16 +206,7 @@ type TxRequest = {
312
206
  chainId?: number | string;
313
207
  gasPrice?: string;
314
208
  };
315
- declare function buildRoute(body: BuildRouteBody, signal?: AbortSignal): Promise<{
316
- intentId: string;
317
- txReq: TxRequest;
318
- actions: unknown[];
319
- finalExchangeRate: {
320
- fromAmountUSD?: string;
321
- toAmountMinUSD?: string;
322
- };
323
- route: RoutePlan | undefined;
324
- }>;
209
+ declare function buildRoute(body: BuildRouteBody, signal?: AbortSignal): Promise<BuildRouteResult>;
325
210
  declare function buildDepositAddress(body: BuildRouteBody, signal?: AbortSignal): Promise<{
326
211
  intentId: string;
327
212
  depositAddress: string;
@@ -332,7 +217,7 @@ declare function buildDepositAddress(body: BuildRouteBody, signal?: AbortSignal)
332
217
  };
333
218
  route: RoutePlan | undefined;
334
219
  }>;
335
- declare function submitReceipt(intentId: string, txHash: string): Promise<any>;
220
+ declare function submitReceipt(intentId: string, txHash: string, sponsorshipRequestId?: string): Promise<any>;
336
221
  declare function getStatus(intentId: string): Promise<Transaction>;
337
222
  declare function pollStatus(intentId: string, { intervalMs, timeoutMs }?: {
338
223
  intervalMs?: number | undefined;
@@ -393,6 +278,33 @@ type Transaction = {
393
278
  updatedDate: Date | string;
394
279
  timeSpentMs?: number;
395
280
  };
281
+ type SponsorshipApproval = {
282
+ client_id: string;
283
+ program_id: string;
284
+ sdk_key_id: string;
285
+ sender: string;
286
+ call_data_hash: string;
287
+ chain_id: string;
288
+ max_cost: string;
289
+ valid_after?: string | null;
290
+ valid_until?: string | null;
291
+ nonce: string;
292
+ entry_point: string;
293
+ paymaster: string;
294
+ };
295
+ type RouteSponsorship = {
296
+ requestId: string;
297
+ paymaster: string;
298
+ entryPoint: string;
299
+ chainId: string;
300
+ callDataHash: string;
301
+ maxCost: string;
302
+ paymasterAndData: string;
303
+ signature: string;
304
+ signer: string;
305
+ typedDataHash: string;
306
+ approval: SponsorshipApproval;
307
+ };
396
308
  type RouteEstimate = {
397
309
  fromAmount?: string;
398
310
  toAmount?: string;
@@ -415,6 +327,7 @@ type RoutePlan = {
415
327
  diagnostics?: {
416
328
  rawPayload?: unknown;
417
329
  };
330
+ sponsorship?: RouteSponsorship;
418
331
  };
419
332
  type BuildRouteResult = {
420
333
  intentId: string;
@@ -425,6 +338,7 @@ type BuildRouteResult = {
425
338
  toAmountMinUSD?: string;
426
339
  };
427
340
  route: RoutePlan | undefined;
341
+ sponsorship?: RouteSponsorship;
428
342
  };
429
343
 
430
344
  type TrustwareEvent = {
@@ -553,15 +467,45 @@ type ResolvedTrustwareConfig = {
553
467
  onSuccess?: (transaction: Transaction) => void;
554
468
  onEvent?: (event: TrustwareEvent) => void;
555
469
  };
470
+ /** A token identified by contract address + chain ID. Used for swap mode configuration. */
471
+ type SwapTokenRef = {
472
+ /** EVM contract address (or native placeholder, e.g. "0xeeee...") */
473
+ address: string;
474
+ /** Numeric chain ID, e.g. 8453 for Base */
475
+ chainId: number;
476
+ };
556
477
  type FeatureFlags = {
557
478
  tokensPagination?: boolean;
558
479
  balanceStreaming?: boolean;
559
480
  shouldAllowGA4?: boolean;
481
+ swapMode?: boolean;
482
+ /**
483
+ * Pre-selects the destination token in swap mode. When set, the widget opens
484
+ * with this token already chosen as the "buy" side.
485
+ * Example: `{ address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", chainId: 8453 }` (Base USDC)
486
+ */
487
+ swapDefaultDestToken?: SwapTokenRef;
488
+ /**
489
+ * When true (and `swapDefaultDestToken` is set), the destination token is fixed
490
+ * and the user cannot change it. The "select token to buy" button is disabled.
491
+ */
492
+ swapLockDestToken?: boolean;
493
+ /**
494
+ * Restricts the destination ("buy") token selector to only these tokens. The user
495
+ * can still sell any token from their wallet; only the buy side is limited.
496
+ * Each entry is a token address + chain ID pair. When omitted, all tokens are selectable.
497
+ * Example: `[{ address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", chainId: 1 }]`
498
+ */
499
+ swapAllowedDestTokens?: SwapTokenRef[];
560
500
  };
561
501
  type ResolvedFeatureFlags = {
562
502
  tokensPagination: boolean;
563
503
  balanceStreaming: boolean;
564
504
  shouldAllowGA4: boolean;
505
+ swapMode: boolean;
506
+ swapDefaultDestToken: SwapTokenRef | null;
507
+ swapLockDestToken: boolean;
508
+ swapAllowedDestTokens: SwapTokenRef[] | null;
565
509
  };
566
510
  declare const DEFAULT_SLIPPAGE = 1;
567
511
  declare const DEFAULT_AUTO_DETECT_PROVIDER = false;
@@ -735,4 +679,4 @@ declare function useWalletInfo(wagmi?: WagmiBridge): {
735
679
  };
736
680
  declare function useWalletExternalDisconnect(cb: () => void): void;
737
681
 
738
- export { type WalletEcosystem as $, type TokenDef as A, type BalanceRow as B, type ChainDef as C, DEFAULT_AUTO_DETECT_PROVIDER as D, type EIP1193 as E, type FeatureFlags as F, type TokenMeta as G, type TokenPageInfo as H, IdentityStore as I, type TokenPageOptions as J, type TokenPageResult as K, type TokenType as L, type TokenWithBalance as M, type NativeCurrency as N, type TrustwareWidgetMessages as O, type TrustwareWidgetTheme as P, type WagmiBridge as Q, type RateLimitInfo as R, type SimpleWalletInterface as S, type TrustwareConfigOptions as T, type WagmiConnector as U, type WalletAddressBalanceWrapper as V, type WalletInterFaceAPI as W, type WalletAddressResolution as X, type WalletAddressSource as Y, type WalletCategory as Z, type WalletConnectConfig as _, TrustwareError as a, type WalletId as a0, type WalletIdentity as a1, type WalletIdentityAddress as a2, type WalletIdentityChainLike as a3, type WalletMeta as a4, buildWalletIdentityAddress as a5, createWalletIdentity as a6, resolveWalletAddressForChain as a7, upsertWalletIdentityAddress as a8, useWireDetectionIntoManager as a9, type WalletSnapshot as aa, useWalletConnectConnect as ab, useWalletExternalDisconnect as ac, useWalletInfo as ad, walletManager as ae, buildRoute as af, buildDepositAddress as ag, submitReceipt as ah, getStatus as ai, pollStatus as aj, type Transaction as b, type TrustwareEvent as c, type BalanceStreamOptions as d, type BuildRouteResult as e, type ChainMeta as f, type ChainType as g, DEFAULT_FEATURE_FLAGS as h, DEFAULT_MESSAGES as i, DEFAULT_RETRY_CONFIG as j, DEFAULT_SLIPPAGE as k, DEFAULT_THEME as l, type DetectedWallet as m, type EIP6963ProviderDetail as n, type EvmWalletInterface as o, type ResolvedFeatureFlags as p, type ResolvedRetryConfig as q, type ResolvedTrustwareConfig as r, type ResolvedWalletConnectConfig as s, type RetryConfig as t, type RouteEstimate as u, type RouteIntent as v, type RouteParams as w, type RoutePlan as x, type SolanaProviderLike as y, type SolanaWalletInterface as z };
682
+ export { getStatus as $, type TrustwareWidgetTheme as A, type BuildRouteResult as B, type WagmiConnector as C, DEFAULT_AUTO_DETECT_PROVIDER as D, type EIP1193 as E, type FeatureFlags as F, type WalletAddressResolution as G, type WalletAddressSource as H, IdentityStore as I, type WalletCategory as J, type WalletConnectConfig as K, type WalletEcosystem as L, type WalletId as M, type WalletIdentity as N, type WalletIdentityAddress as O, type WalletIdentityChainLike as P, type WalletInterFaceAPI as Q, type RateLimitInfo as R, type SimpleWalletInterface as S, type Transaction as T, type WalletMeta as U, type WalletSnapshot as V, type WagmiBridge as W, buildDepositAddress as X, buildRoute as Y, buildWalletIdentityAddress as Z, createWalletIdentity as _, DEFAULT_FEATURE_FLAGS as a, pollStatus as a0, resolveWalletAddressForChain as a1, submitReceipt as a2, upsertWalletIdentityAddress as a3, useWalletConnectConnect as a4, useWalletExternalDisconnect as a5, useWalletInfo as a6, useWireDetectionIntoManager as a7, walletManager as a8, DEFAULT_MESSAGES as b, DEFAULT_RETRY_CONFIG as c, DEFAULT_SLIPPAGE as d, DEFAULT_THEME as e, type DetectedWallet as f, type EIP6963ProviderDetail as g, type EvmWalletInterface as h, type ResolvedFeatureFlags as i, type ResolvedRetryConfig as j, type ResolvedTrustwareConfig as k, type ResolvedWalletConnectConfig as l, type RetryConfig as m, type RouteEstimate as n, type RouteIntent as o, type RouteParams as p, type RoutePlan as q, type RouteSponsorship as r, type SolanaProviderLike as s, type SolanaWalletInterface as t, type SponsorshipApproval as u, type SwapTokenRef as v, type TrustwareConfigOptions as w, TrustwareError as x, type TrustwareEvent as y, type TrustwareWidgetMessages as z };