@trustware/sdk-staging 1.1.8-staging.3 → 1.1.8-staging.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -0
- package/dist/blockchain-BONedEsU.d.cts +110 -0
- package/dist/blockchain-BONedEsU.d.ts +110 -0
- package/dist/constants.cjs +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/{core-u95iahDO.d.cts → core-BcoaMbJ6.d.cts} +3 -2
- package/dist/{core-CVbN3gJy.d.ts → core-BqqBQ5nF.d.ts} +3 -2
- package/dist/core.cjs +2290 -2247
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +4 -3
- package/dist/core.d.ts +4 -3
- package/dist/core.mjs +2277 -2244
- package/dist/core.mjs.map +1 -1
- package/dist/{detect-6MRR4B7g.d.ts → detect-F6garpnf.d.ts} +2 -2
- package/dist/{detect-DVIWcXpl.d.cts → detect-srLQtIzU.d.cts} +2 -2
- package/dist/index.cjs +22382 -3552
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -10
- package/dist/index.d.ts +28 -10
- package/dist/index.mjs +28327 -9497
- package/dist/index.mjs.map +1 -1
- package/dist/{manager-CXSw1h5e.d.cts → manager-BWmNEeZb.d.cts} +72 -121
- package/dist/{manager-CXSw1h5e.d.ts → manager-BojJyYIt.d.ts} +72 -121
- package/dist/smart-account.cjs +14707 -0
- package/dist/smart-account.cjs.map +1 -0
- package/dist/smart-account.d.cts +3962 -0
- package/dist/smart-account.d.ts +3962 -0
- package/dist/smart-account.mjs +14686 -0
- package/dist/smart-account.mjs.map +1 -0
- package/dist/types-B3nKHW6H.d.cts +32 -0
- package/dist/types-MtdjJgwT.d.ts +32 -0
- package/dist/wallet.cjs +29 -9
- package/dist/wallet.cjs.map +1 -1
- package/dist/wallet.d.cts +4 -3
- package/dist/wallet.d.ts +4 -3
- package/dist/wallet.mjs +16 -6
- package/dist/wallet.mjs.map +1 -1
- package/dist/widget.cjs +33067 -14246
- package/dist/widget.cjs.map +1 -1
- package/dist/widget.d.cts +5 -4
- package/dist/widget.d.ts +5 -4
- package/dist/widget.mjs +33007 -14182
- package/dist/widget.mjs.map +1 -1
- package/package.json +17 -4
- package/dist/types-BrVfNxND.d.cts +0 -14
- 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 = {
|
|
@@ -460,6 +374,13 @@ type TrustwareEvent = {
|
|
|
460
374
|
type: "balance_stream_fallback";
|
|
461
375
|
address: string;
|
|
462
376
|
message: string;
|
|
377
|
+
} | {
|
|
378
|
+
type: "swap_route_changed";
|
|
379
|
+
fromChain: string;
|
|
380
|
+
fromToken: string;
|
|
381
|
+
toChain: string;
|
|
382
|
+
toToken: string;
|
|
383
|
+
amount?: string;
|
|
463
384
|
};
|
|
464
385
|
|
|
465
386
|
/** WalletConnect configuration options (all optional - SDK has built-in defaults) */
|
|
@@ -553,15 +474,45 @@ type ResolvedTrustwareConfig = {
|
|
|
553
474
|
onSuccess?: (transaction: Transaction) => void;
|
|
554
475
|
onEvent?: (event: TrustwareEvent) => void;
|
|
555
476
|
};
|
|
477
|
+
/** A token identified by contract address + chain ID. Used for swap mode configuration. */
|
|
478
|
+
type SwapTokenRef = {
|
|
479
|
+
/** EVM contract address (or native placeholder, e.g. "0xeeee...") */
|
|
480
|
+
address: string;
|
|
481
|
+
/** Numeric chain ID, e.g. 8453 for Base */
|
|
482
|
+
chainId: number;
|
|
483
|
+
};
|
|
556
484
|
type FeatureFlags = {
|
|
557
485
|
tokensPagination?: boolean;
|
|
558
486
|
balanceStreaming?: boolean;
|
|
559
487
|
shouldAllowGA4?: boolean;
|
|
488
|
+
swapMode?: boolean;
|
|
489
|
+
/**
|
|
490
|
+
* Pre-selects the destination token in swap mode. When set, the widget opens
|
|
491
|
+
* with this token already chosen as the "buy" side.
|
|
492
|
+
* Example: `{ address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", chainId: 8453 }` (Base USDC)
|
|
493
|
+
*/
|
|
494
|
+
swapDefaultDestToken?: SwapTokenRef;
|
|
495
|
+
/**
|
|
496
|
+
* When true (and `swapDefaultDestToken` is set), the destination token is fixed
|
|
497
|
+
* and the user cannot change it. The "select token to buy" button is disabled.
|
|
498
|
+
*/
|
|
499
|
+
swapLockDestToken?: boolean;
|
|
500
|
+
/**
|
|
501
|
+
* Restricts the destination ("buy") token selector to only these tokens. The user
|
|
502
|
+
* can still sell any token from their wallet; only the buy side is limited.
|
|
503
|
+
* Each entry is a token address + chain ID pair. When omitted, all tokens are selectable.
|
|
504
|
+
* Example: `[{ address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", chainId: 1 }]`
|
|
505
|
+
*/
|
|
506
|
+
swapAllowedDestTokens?: SwapTokenRef[];
|
|
560
507
|
};
|
|
561
508
|
type ResolvedFeatureFlags = {
|
|
562
509
|
tokensPagination: boolean;
|
|
563
510
|
balanceStreaming: boolean;
|
|
564
511
|
shouldAllowGA4: boolean;
|
|
512
|
+
swapMode: boolean;
|
|
513
|
+
swapDefaultDestToken: SwapTokenRef | null;
|
|
514
|
+
swapLockDestToken: boolean;
|
|
515
|
+
swapAllowedDestTokens: SwapTokenRef[] | null;
|
|
565
516
|
};
|
|
566
517
|
declare const DEFAULT_SLIPPAGE = 1;
|
|
567
518
|
declare const DEFAULT_AUTO_DETECT_PROVIDER = false;
|
|
@@ -735,4 +686,4 @@ declare function useWalletInfo(wagmi?: WagmiBridge): {
|
|
|
735
686
|
};
|
|
736
687
|
declare function useWalletExternalDisconnect(cb: () => void): void;
|
|
737
688
|
|
|
738
|
-
export {
|
|
689
|
+
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 = {
|
|
@@ -460,6 +374,13 @@ type TrustwareEvent = {
|
|
|
460
374
|
type: "balance_stream_fallback";
|
|
461
375
|
address: string;
|
|
462
376
|
message: string;
|
|
377
|
+
} | {
|
|
378
|
+
type: "swap_route_changed";
|
|
379
|
+
fromChain: string;
|
|
380
|
+
fromToken: string;
|
|
381
|
+
toChain: string;
|
|
382
|
+
toToken: string;
|
|
383
|
+
amount?: string;
|
|
463
384
|
};
|
|
464
385
|
|
|
465
386
|
/** WalletConnect configuration options (all optional - SDK has built-in defaults) */
|
|
@@ -553,15 +474,45 @@ type ResolvedTrustwareConfig = {
|
|
|
553
474
|
onSuccess?: (transaction: Transaction) => void;
|
|
554
475
|
onEvent?: (event: TrustwareEvent) => void;
|
|
555
476
|
};
|
|
477
|
+
/** A token identified by contract address + chain ID. Used for swap mode configuration. */
|
|
478
|
+
type SwapTokenRef = {
|
|
479
|
+
/** EVM contract address (or native placeholder, e.g. "0xeeee...") */
|
|
480
|
+
address: string;
|
|
481
|
+
/** Numeric chain ID, e.g. 8453 for Base */
|
|
482
|
+
chainId: number;
|
|
483
|
+
};
|
|
556
484
|
type FeatureFlags = {
|
|
557
485
|
tokensPagination?: boolean;
|
|
558
486
|
balanceStreaming?: boolean;
|
|
559
487
|
shouldAllowGA4?: boolean;
|
|
488
|
+
swapMode?: boolean;
|
|
489
|
+
/**
|
|
490
|
+
* Pre-selects the destination token in swap mode. When set, the widget opens
|
|
491
|
+
* with this token already chosen as the "buy" side.
|
|
492
|
+
* Example: `{ address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", chainId: 8453 }` (Base USDC)
|
|
493
|
+
*/
|
|
494
|
+
swapDefaultDestToken?: SwapTokenRef;
|
|
495
|
+
/**
|
|
496
|
+
* When true (and `swapDefaultDestToken` is set), the destination token is fixed
|
|
497
|
+
* and the user cannot change it. The "select token to buy" button is disabled.
|
|
498
|
+
*/
|
|
499
|
+
swapLockDestToken?: boolean;
|
|
500
|
+
/**
|
|
501
|
+
* Restricts the destination ("buy") token selector to only these tokens. The user
|
|
502
|
+
* can still sell any token from their wallet; only the buy side is limited.
|
|
503
|
+
* Each entry is a token address + chain ID pair. When omitted, all tokens are selectable.
|
|
504
|
+
* Example: `[{ address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", chainId: 1 }]`
|
|
505
|
+
*/
|
|
506
|
+
swapAllowedDestTokens?: SwapTokenRef[];
|
|
560
507
|
};
|
|
561
508
|
type ResolvedFeatureFlags = {
|
|
562
509
|
tokensPagination: boolean;
|
|
563
510
|
balanceStreaming: boolean;
|
|
564
511
|
shouldAllowGA4: boolean;
|
|
512
|
+
swapMode: boolean;
|
|
513
|
+
swapDefaultDestToken: SwapTokenRef | null;
|
|
514
|
+
swapLockDestToken: boolean;
|
|
515
|
+
swapAllowedDestTokens: SwapTokenRef[] | null;
|
|
565
516
|
};
|
|
566
517
|
declare const DEFAULT_SLIPPAGE = 1;
|
|
567
518
|
declare const DEFAULT_AUTO_DETECT_PROVIDER = false;
|
|
@@ -735,4 +686,4 @@ declare function useWalletInfo(wagmi?: WagmiBridge): {
|
|
|
735
686
|
};
|
|
736
687
|
declare function useWalletExternalDisconnect(cb: () => void): void;
|
|
737
688
|
|
|
738
|
-
export {
|
|
689
|
+
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 };
|