@vleap/warps 3.0.0-alpha.99 → 3.0.0-beta.154
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/dist/index.d.cts +344 -155
- package/dist/index.d.ts +344 -155
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +5 -5
package/dist/index.d.cts
CHANGED
|
@@ -1,15 +1,36 @@
|
|
|
1
1
|
import QRCodeStyling from 'qr-code-styling';
|
|
2
2
|
|
|
3
|
+
type WarpLocale = 'en' | 'es' | 'fr' | 'de' | 'it' | 'pt' | 'ru' | 'zh' | 'ja' | 'ko' | 'ar' | 'hi' | 'nl' | 'sv' | 'da' | 'no' | 'fi' | 'pl' | 'tr' | 'el' | 'he' | 'th' | 'vi' | 'id' | 'ms' | 'tl' | string;
|
|
4
|
+
type WarpText = string | WarpI18nText;
|
|
5
|
+
type WarpI18nText = {
|
|
6
|
+
[language: string]: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type WarpAlertName = string;
|
|
10
|
+
type WarpAlert = {
|
|
11
|
+
label: WarpText;
|
|
12
|
+
trigger: string;
|
|
13
|
+
subject: WarpText;
|
|
14
|
+
body: WarpText;
|
|
15
|
+
action?: string;
|
|
16
|
+
};
|
|
17
|
+
type WarpAlerts = Record<WarpAlertName, WarpAlert>;
|
|
18
|
+
|
|
3
19
|
type WarpBrand = {
|
|
4
20
|
protocol: string;
|
|
5
|
-
name:
|
|
6
|
-
description:
|
|
7
|
-
logo:
|
|
21
|
+
name: WarpText;
|
|
22
|
+
description: WarpText;
|
|
23
|
+
logo: WarpBrandLogo;
|
|
8
24
|
urls?: WarpBrandUrls;
|
|
9
25
|
colors?: WarpBrandColors;
|
|
10
26
|
cta?: WarpBrandCta;
|
|
11
27
|
meta?: WarpMeta;
|
|
12
28
|
};
|
|
29
|
+
type WarpBrandLogoThemed = {
|
|
30
|
+
light: string;
|
|
31
|
+
dark: string;
|
|
32
|
+
};
|
|
33
|
+
type WarpBrandLogo = string | WarpBrandLogoThemed;
|
|
13
34
|
type WarpBrandUrls = {
|
|
14
35
|
web?: string;
|
|
15
36
|
};
|
|
@@ -18,9 +39,9 @@ type WarpBrandColors = {
|
|
|
18
39
|
secondary?: string;
|
|
19
40
|
};
|
|
20
41
|
type WarpBrandCta = {
|
|
21
|
-
title:
|
|
22
|
-
description:
|
|
23
|
-
label:
|
|
42
|
+
title: WarpText;
|
|
43
|
+
description: WarpText;
|
|
44
|
+
label: WarpText;
|
|
24
45
|
url: string;
|
|
25
46
|
};
|
|
26
47
|
|
|
@@ -49,24 +70,27 @@ type WarpRegistryConfigInfo = {
|
|
|
49
70
|
admins: string[];
|
|
50
71
|
};
|
|
51
72
|
|
|
52
|
-
type
|
|
53
|
-
|
|
73
|
+
type WarpActionExecutionStatus = 'success' | 'error' | 'unhandled';
|
|
74
|
+
type WarpActionExecutionResult = {
|
|
75
|
+
status: WarpActionExecutionStatus;
|
|
54
76
|
warp: Warp;
|
|
55
77
|
action: number;
|
|
56
78
|
user: string | null;
|
|
57
79
|
txHash: string | null;
|
|
58
80
|
tx: WarpAdapterGenericTransaction | null;
|
|
59
81
|
next: WarpExecutionNextInfo | null;
|
|
60
|
-
values:
|
|
61
|
-
|
|
62
|
-
|
|
82
|
+
values: {
|
|
83
|
+
string: string[];
|
|
84
|
+
native: WarpNativeValue[];
|
|
85
|
+
};
|
|
86
|
+
output: WarpExecutionOutput;
|
|
63
87
|
messages: WarpExecutionMessages;
|
|
64
88
|
};
|
|
65
89
|
type WarpExecutionNextInfo = {
|
|
66
90
|
identifier: string | null;
|
|
67
91
|
url: string;
|
|
68
92
|
}[];
|
|
69
|
-
type
|
|
93
|
+
type WarpExecutionOutput = Record<WarpOutputName, any | null>;
|
|
70
94
|
type WarpExecutionMessages = Record<WarpMessageName, string | null>;
|
|
71
95
|
|
|
72
96
|
type ClientIndexConfig = {
|
|
@@ -96,8 +120,17 @@ type ClientTransformConfig = {
|
|
|
96
120
|
runner?: TransformRunner | null;
|
|
97
121
|
};
|
|
98
122
|
|
|
99
|
-
type
|
|
100
|
-
|
|
123
|
+
type WarpWalletDetails = {
|
|
124
|
+
address: string;
|
|
125
|
+
mnemonic?: string | null;
|
|
126
|
+
privateKey?: string | null;
|
|
127
|
+
};
|
|
128
|
+
type WarpUserWallets = Record<WarpChain, WarpWalletDetails | string | null>;
|
|
129
|
+
type WarpProviderPreferences = Partial<Record<WarpChainEnv, string | WarpProviderConfig>>;
|
|
130
|
+
type WarpProviderConfig = {
|
|
131
|
+
url: string;
|
|
132
|
+
headers?: Record<string, string>;
|
|
133
|
+
};
|
|
101
134
|
type WarpClientConfig = {
|
|
102
135
|
env: WarpChainEnv;
|
|
103
136
|
clientUrl?: string;
|
|
@@ -107,9 +140,10 @@ type WarpClientConfig = {
|
|
|
107
140
|
wallets?: WarpUserWallets;
|
|
108
141
|
};
|
|
109
142
|
preferences?: {
|
|
143
|
+
locale?: WarpLocale;
|
|
110
144
|
explorers?: Record<WarpChain, WarpExplorerName>;
|
|
145
|
+
providers?: Record<WarpChain, WarpProviderPreferences>;
|
|
111
146
|
};
|
|
112
|
-
providers?: Record<WarpChain, WarpProviderConfig>;
|
|
113
147
|
schema?: {
|
|
114
148
|
warp?: string;
|
|
115
149
|
brand?: string;
|
|
@@ -117,6 +151,9 @@ type WarpClientConfig = {
|
|
|
117
151
|
cache?: ClientCacheConfig;
|
|
118
152
|
transform?: ClientTransformConfig;
|
|
119
153
|
index?: ClientIndexConfig;
|
|
154
|
+
interceptors?: {
|
|
155
|
+
openLink?: (url: string) => Promise<void>;
|
|
156
|
+
};
|
|
120
157
|
};
|
|
121
158
|
type WarpCacheConfig = {
|
|
122
159
|
ttl?: number;
|
|
@@ -124,17 +161,16 @@ type WarpCacheConfig = {
|
|
|
124
161
|
type AdapterFactory = (config: WarpClientConfig, fallback?: Adapter) => Adapter;
|
|
125
162
|
type Adapter = {
|
|
126
163
|
chainInfo: WarpChainInfo;
|
|
127
|
-
prefix: string;
|
|
128
164
|
builder: () => CombinedWarpBuilder;
|
|
129
165
|
executor: AdapterWarpExecutor;
|
|
130
|
-
|
|
166
|
+
output: AdapterWarpOutput;
|
|
131
167
|
serializer: AdapterWarpSerializer;
|
|
132
168
|
registry: AdapterWarpRegistry;
|
|
133
169
|
explorer: AdapterWarpExplorer;
|
|
134
170
|
abiBuilder: () => AdapterWarpAbiBuilder;
|
|
135
171
|
brandBuilder: () => AdapterWarpBrandBuilder;
|
|
136
172
|
dataLoader: AdapterWarpDataLoader;
|
|
137
|
-
|
|
173
|
+
wallet: AdapterWarpWallet;
|
|
138
174
|
};
|
|
139
175
|
type WarpAdapterGenericTransaction = any;
|
|
140
176
|
type WarpAdapterGenericRemoteTransaction = any;
|
|
@@ -144,10 +180,13 @@ interface WarpTypeHandler {
|
|
|
144
180
|
stringToNative(value: string): any;
|
|
145
181
|
nativeToString(value: any): string;
|
|
146
182
|
}
|
|
147
|
-
interface
|
|
183
|
+
interface AdapterTypeRegistry {
|
|
148
184
|
registerType(typeName: string, handler: WarpTypeHandler): void;
|
|
185
|
+
registerTypeAlias(typeName: string, alias: string): void;
|
|
149
186
|
hasType(typeName: string): boolean;
|
|
150
187
|
getHandler(typeName: string): WarpTypeHandler | undefined;
|
|
188
|
+
getAlias(typeName: string): string | undefined;
|
|
189
|
+
resolveType(typeName: string): string;
|
|
151
190
|
getRegisteredTypes(): string[];
|
|
152
191
|
}
|
|
153
192
|
interface BaseWarpBuilder {
|
|
@@ -180,11 +219,10 @@ interface AdapterWarpBrandBuilder {
|
|
|
180
219
|
}
|
|
181
220
|
interface AdapterWarpExecutor {
|
|
182
221
|
createTransaction(executable: WarpExecutable): Promise<WarpAdapterGenericTransaction>;
|
|
183
|
-
executeQuery(executable: WarpExecutable): Promise<
|
|
184
|
-
signMessage(message: string, privateKey: string): Promise<string>;
|
|
222
|
+
executeQuery(executable: WarpExecutable): Promise<WarpActionExecutionResult>;
|
|
185
223
|
}
|
|
186
|
-
interface
|
|
187
|
-
|
|
224
|
+
interface AdapterWarpOutput {
|
|
225
|
+
getActionExecution(warp: Warp, actionIndex: WarpActionIndex, tx: WarpAdapterGenericRemoteTransaction): Promise<WarpActionExecutionResult>;
|
|
188
226
|
}
|
|
189
227
|
interface AdapterWarpSerializer {
|
|
190
228
|
typedToString(value: WarpAdapterGenericValue): string;
|
|
@@ -233,6 +271,16 @@ interface AdapterWarpDataLoader {
|
|
|
233
271
|
getAction(identifier: string, awaitCompleted?: boolean): Promise<WarpChainAction | null>;
|
|
234
272
|
getAccountActions(address: string, options?: WarpDataLoaderOptions): Promise<WarpChainAction[]>;
|
|
235
273
|
}
|
|
274
|
+
interface AdapterWarpWallet {
|
|
275
|
+
signTransaction(tx: WarpAdapterGenericTransaction): Promise<WarpAdapterGenericTransaction>;
|
|
276
|
+
signTransactions(txs: WarpAdapterGenericTransaction[]): Promise<WarpAdapterGenericTransaction[]>;
|
|
277
|
+
signMessage(message: string): Promise<string>;
|
|
278
|
+
sendTransactions(txs: WarpAdapterGenericTransaction[]): Promise<string[]>;
|
|
279
|
+
sendTransaction(tx: WarpAdapterGenericTransaction): Promise<string>;
|
|
280
|
+
create(mnemonic: string): WarpWalletDetails;
|
|
281
|
+
generate(): WarpWalletDetails;
|
|
282
|
+
getAddress(): string | null;
|
|
283
|
+
}
|
|
236
284
|
|
|
237
285
|
type WarpChainAccount = {
|
|
238
286
|
chain: WarpChain;
|
|
@@ -250,7 +298,9 @@ type WarpChainAsset = {
|
|
|
250
298
|
symbol: string;
|
|
251
299
|
amount?: bigint;
|
|
252
300
|
decimals?: number;
|
|
253
|
-
logoUrl?: string;
|
|
301
|
+
logoUrl?: string | null;
|
|
302
|
+
price?: number;
|
|
303
|
+
supply?: bigint;
|
|
254
304
|
};
|
|
255
305
|
type WarpChainAction = {
|
|
256
306
|
chain: WarpChain;
|
|
@@ -275,29 +325,35 @@ type WarpChainInfo = {
|
|
|
275
325
|
blockTime: number;
|
|
276
326
|
addressHrp: string;
|
|
277
327
|
defaultApiUrl: string;
|
|
328
|
+
logoUrl: string;
|
|
278
329
|
nativeToken: WarpChainAsset;
|
|
279
330
|
};
|
|
280
|
-
type
|
|
331
|
+
type WarpIdentifierType = 'hash' | 'alias';
|
|
281
332
|
type WarpVarPlaceholder = string;
|
|
282
|
-
type
|
|
333
|
+
type WarpOutputName = string;
|
|
283
334
|
type WarpResulutionPath = string;
|
|
284
335
|
type WarpMessageName = string;
|
|
285
336
|
type Warp = {
|
|
286
337
|
protocol: string;
|
|
338
|
+
chain?: WarpChain;
|
|
287
339
|
name: string;
|
|
288
|
-
title:
|
|
289
|
-
description:
|
|
340
|
+
title: WarpText;
|
|
341
|
+
description: WarpText | null;
|
|
290
342
|
bot?: string;
|
|
291
343
|
preview?: string;
|
|
292
344
|
vars?: Record<WarpVarPlaceholder, string>;
|
|
293
345
|
actions: WarpAction[];
|
|
294
346
|
next?: string;
|
|
295
|
-
|
|
296
|
-
messages?: Record<WarpMessageName,
|
|
347
|
+
output?: Record<WarpOutputName, WarpResulutionPath>;
|
|
348
|
+
messages?: Record<WarpMessageName, WarpText>;
|
|
349
|
+
alerts?: WarpAlerts;
|
|
350
|
+
related?: string[];
|
|
297
351
|
meta?: WarpMeta;
|
|
298
352
|
};
|
|
299
353
|
type WarpMeta = {
|
|
300
354
|
chain: WarpChain;
|
|
355
|
+
identifier: string;
|
|
356
|
+
query: string | null;
|
|
301
357
|
hash: string;
|
|
302
358
|
creator: string;
|
|
303
359
|
createdAt: string;
|
|
@@ -307,21 +363,21 @@ type WarpActionIndex = number;
|
|
|
307
363
|
type WarpActionType = 'transfer' | 'contract' | 'query' | 'collect' | 'link';
|
|
308
364
|
type WarpTransferAction = {
|
|
309
365
|
type: WarpActionType;
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
description?: string | null;
|
|
366
|
+
label: WarpText;
|
|
367
|
+
description?: WarpText | null;
|
|
313
368
|
address?: string;
|
|
314
369
|
data?: string;
|
|
315
370
|
value?: string;
|
|
316
371
|
transfers?: string[];
|
|
317
372
|
inputs?: WarpActionInput[];
|
|
373
|
+
primary?: boolean;
|
|
374
|
+
auto?: boolean;
|
|
318
375
|
next?: string;
|
|
319
376
|
};
|
|
320
377
|
type WarpContractAction = {
|
|
321
378
|
type: WarpActionType;
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
description?: string | null;
|
|
379
|
+
label: WarpText;
|
|
380
|
+
description?: WarpText | null;
|
|
325
381
|
address?: string;
|
|
326
382
|
func?: string | null;
|
|
327
383
|
args?: string[];
|
|
@@ -330,51 +386,62 @@ type WarpContractAction = {
|
|
|
330
386
|
transfers?: string[];
|
|
331
387
|
abi?: string;
|
|
332
388
|
inputs?: WarpActionInput[];
|
|
389
|
+
primary?: boolean;
|
|
390
|
+
auto?: boolean;
|
|
333
391
|
next?: string;
|
|
334
392
|
};
|
|
335
393
|
type WarpQueryAction = {
|
|
336
394
|
type: WarpActionType;
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
description?: string | null;
|
|
395
|
+
label: WarpText;
|
|
396
|
+
description?: WarpText | null;
|
|
340
397
|
address?: string;
|
|
341
398
|
func?: string;
|
|
342
399
|
args?: string[];
|
|
343
400
|
abi?: string;
|
|
344
401
|
inputs?: WarpActionInput[];
|
|
402
|
+
primary?: boolean;
|
|
403
|
+
auto?: boolean;
|
|
345
404
|
next?: string;
|
|
346
405
|
};
|
|
347
406
|
type WarpCollectAction = {
|
|
348
407
|
type: WarpActionType;
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
destination: {
|
|
353
|
-
url: string;
|
|
354
|
-
method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
355
|
-
headers?: Record<string, string>;
|
|
356
|
-
};
|
|
408
|
+
label: WarpText;
|
|
409
|
+
description?: WarpText | null;
|
|
410
|
+
destination?: WarpCollectDestination;
|
|
357
411
|
inputs?: WarpActionInput[];
|
|
412
|
+
primary?: boolean;
|
|
413
|
+
auto?: boolean;
|
|
358
414
|
next?: string;
|
|
359
415
|
};
|
|
416
|
+
type WarpCollectDestination = WarpCollectDestinationHttp | string;
|
|
417
|
+
type WarpCollectDestinationHttp = {
|
|
418
|
+
url: string;
|
|
419
|
+
method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
420
|
+
headers?: Record<string, string>;
|
|
421
|
+
};
|
|
360
422
|
type WarpLinkAction = {
|
|
361
423
|
type: WarpActionType;
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
description?: string | null;
|
|
424
|
+
label: WarpText;
|
|
425
|
+
description?: WarpText | null;
|
|
365
426
|
url: string;
|
|
366
427
|
inputs?: WarpActionInput[];
|
|
428
|
+
primary?: boolean;
|
|
429
|
+
auto?: boolean;
|
|
367
430
|
};
|
|
368
431
|
type WarpActionInputSource = 'field' | 'query' | 'user:wallet' | 'hidden';
|
|
369
432
|
type BaseWarpActionInputType = 'string' | 'uint8' | 'uint16' | 'uint32' | 'uint64' | 'uint128' | 'uint256' | 'biguint' | 'bool' | 'address' | 'hex' | string;
|
|
370
433
|
type WarpActionInputType = string;
|
|
371
|
-
|
|
372
|
-
|
|
434
|
+
interface WarpStructValue {
|
|
435
|
+
[key: string]: WarpNativeValue;
|
|
436
|
+
}
|
|
437
|
+
type WarpNativeValue = string | number | bigint | boolean | WarpChainAssetValue | null | WarpNativeValue[] | WarpStructValue;
|
|
438
|
+
type WarpActionInputPosition = 'receiver' | 'value' | 'transfer' | `arg:${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10}` | 'data' | 'chain' | `payload:${string}` | 'destination';
|
|
373
439
|
type WarpActionInputModifier = 'scale';
|
|
374
440
|
type WarpActionInput = {
|
|
375
441
|
name: string;
|
|
376
442
|
as?: string;
|
|
377
|
-
|
|
443
|
+
label?: WarpText;
|
|
444
|
+
description?: WarpText | null;
|
|
378
445
|
bot?: string;
|
|
379
446
|
type: WarpActionInputType;
|
|
380
447
|
position?: WarpActionInputPosition;
|
|
@@ -383,9 +450,9 @@ type WarpActionInput = {
|
|
|
383
450
|
min?: number | WarpVarPlaceholder;
|
|
384
451
|
max?: number | WarpVarPlaceholder;
|
|
385
452
|
pattern?: string;
|
|
386
|
-
patternDescription?:
|
|
453
|
+
patternDescription?: WarpText;
|
|
387
454
|
options?: string[] | {
|
|
388
|
-
[key: string]:
|
|
455
|
+
[key: string]: WarpText;
|
|
389
456
|
};
|
|
390
457
|
modifier?: string;
|
|
391
458
|
default?: string | number | boolean;
|
|
@@ -407,7 +474,7 @@ type WarpExecutable = {
|
|
|
407
474
|
chain: WarpChainInfo;
|
|
408
475
|
warp: Warp;
|
|
409
476
|
action: number;
|
|
410
|
-
destination: string;
|
|
477
|
+
destination: string | null;
|
|
411
478
|
args: string[];
|
|
412
479
|
value: bigint;
|
|
413
480
|
transfers: WarpChainAssetValue[];
|
|
@@ -429,6 +496,31 @@ type WarpAbiContents = {
|
|
|
429
496
|
events?: any[];
|
|
430
497
|
};
|
|
431
498
|
|
|
499
|
+
type WarpSecret = {
|
|
500
|
+
key: string;
|
|
501
|
+
description?: string | null;
|
|
502
|
+
};
|
|
503
|
+
|
|
504
|
+
type InterpolationBag = {
|
|
505
|
+
config: WarpClientConfig;
|
|
506
|
+
chain: WarpChainInfo;
|
|
507
|
+
};
|
|
508
|
+
|
|
509
|
+
declare const WarpProtocolVersions: {
|
|
510
|
+
Warp: string;
|
|
511
|
+
Brand: string;
|
|
512
|
+
Abi: string;
|
|
513
|
+
};
|
|
514
|
+
declare const WarpConfig: {
|
|
515
|
+
LatestWarpSchemaUrl: string;
|
|
516
|
+
LatestBrandSchemaUrl: string;
|
|
517
|
+
DefaultClientUrl: (env: WarpChainEnv) => "https://usewarp.to" | "https://testnet.usewarp.to" | "https://devnet.usewarp.to";
|
|
518
|
+
SuperClientUrls: string[];
|
|
519
|
+
AvailableActionInputSources: WarpActionInputSource[];
|
|
520
|
+
AvailableActionInputTypes: WarpActionInputType[];
|
|
521
|
+
AvailableActionInputPositions: WarpActionInputPosition[];
|
|
522
|
+
};
|
|
523
|
+
|
|
432
524
|
declare enum WarpChainName {
|
|
433
525
|
Multiversx = "multiversx",
|
|
434
526
|
Vibechain = "vibechain",
|
|
@@ -442,17 +534,17 @@ declare enum WarpChainName {
|
|
|
442
534
|
declare const WarpConstants: {
|
|
443
535
|
HttpProtocolPrefix: string;
|
|
444
536
|
IdentifierParamName: string;
|
|
445
|
-
IdentifierParamSeparator: string
|
|
446
|
-
IdentifierParamSeparatorDefault: string;
|
|
537
|
+
IdentifierParamSeparator: string;
|
|
447
538
|
IdentifierChainDefault: string;
|
|
448
539
|
IdentifierType: {
|
|
449
|
-
Alias:
|
|
450
|
-
Hash:
|
|
540
|
+
Alias: WarpIdentifierType;
|
|
541
|
+
Hash: WarpIdentifierType;
|
|
451
542
|
};
|
|
543
|
+
IdentifierAliasMarker: string;
|
|
452
544
|
Globals: {
|
|
453
545
|
UserWallet: {
|
|
454
546
|
Placeholder: string;
|
|
455
|
-
Accessor: (bag: InterpolationBag) => string | null | undefined;
|
|
547
|
+
Accessor: (bag: InterpolationBag) => string | WarpWalletDetails | null | undefined;
|
|
456
548
|
};
|
|
457
549
|
ChainApiUrl: {
|
|
458
550
|
Placeholder: string;
|
|
@@ -469,6 +561,8 @@ declare const WarpConstants: {
|
|
|
469
561
|
};
|
|
470
562
|
ArgParamsSeparator: string;
|
|
471
563
|
ArgCompositeSeparator: string;
|
|
564
|
+
ArgListSeparator: string;
|
|
565
|
+
ArgStructSeparator: string;
|
|
472
566
|
Transform: {
|
|
473
567
|
Prefix: string;
|
|
474
568
|
};
|
|
@@ -478,48 +572,35 @@ declare const WarpConstants: {
|
|
|
478
572
|
Position: {
|
|
479
573
|
Payload: string;
|
|
480
574
|
};
|
|
575
|
+
Alerts: {
|
|
576
|
+
TriggerEventPrefix: string;
|
|
577
|
+
};
|
|
481
578
|
};
|
|
482
579
|
declare const WarpInputTypes: {
|
|
483
580
|
Option: string;
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
Composite: string;
|
|
581
|
+
Vector: string;
|
|
582
|
+
Tuple: string;
|
|
583
|
+
Struct: string;
|
|
488
584
|
String: string;
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
585
|
+
Uint8: string;
|
|
586
|
+
Uint16: string;
|
|
587
|
+
Uint32: string;
|
|
588
|
+
Uint64: string;
|
|
589
|
+
Uint128: string;
|
|
590
|
+
Uint256: string;
|
|
495
591
|
Biguint: string;
|
|
496
|
-
|
|
592
|
+
Bool: string;
|
|
497
593
|
Address: string;
|
|
498
594
|
Asset: string;
|
|
499
595
|
Hex: string;
|
|
500
596
|
};
|
|
597
|
+
declare const safeWindow: Window;
|
|
501
598
|
|
|
502
|
-
|
|
503
|
-
config: WarpClientConfig;
|
|
504
|
-
chain: WarpChainName;
|
|
505
|
-
chainInfo: WarpChainInfo;
|
|
506
|
-
};
|
|
599
|
+
declare const getEventNameFromWarp: (warp: Warp, alertName: string) => string | null;
|
|
507
600
|
|
|
508
|
-
declare const
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
Abi: string;
|
|
512
|
-
};
|
|
513
|
-
declare const WarpConfig: {
|
|
514
|
-
LatestWarpSchemaUrl: string;
|
|
515
|
-
LatestBrandSchemaUrl: string;
|
|
516
|
-
DefaultClientUrl: (env: WarpChainEnv) => "https://usewarp.to" | "https://testnet.usewarp.to" | "https://devnet.usewarp.to";
|
|
517
|
-
DefaultChainPrefix: string;
|
|
518
|
-
SuperClientUrls: string[];
|
|
519
|
-
AvailableActionInputSources: WarpActionInputSource[];
|
|
520
|
-
AvailableActionInputTypes: WarpActionInputType[];
|
|
521
|
-
AvailableActionInputPositions: WarpActionInputPosition[];
|
|
522
|
-
};
|
|
601
|
+
declare const getWarpBrandLogoUrl: (brand: WarpBrand, preferences?: {
|
|
602
|
+
scheme: "light" | "dark";
|
|
603
|
+
}) => string;
|
|
523
604
|
|
|
524
605
|
interface CryptoProvider {
|
|
525
606
|
getRandomBytes(size: number): Promise<Uint8Array>;
|
|
@@ -542,31 +623,69 @@ declare function testCryptoAvailability(): Promise<{
|
|
|
542
623
|
}>;
|
|
543
624
|
declare function createCryptoProvider(): CryptoProvider;
|
|
544
625
|
|
|
626
|
+
declare const extractWarpSecrets: (warp: Warp) => WarpSecret[];
|
|
627
|
+
|
|
545
628
|
declare const findWarpAdapterForChain: (chain: WarpChain, adapters: Adapter[]) => Adapter;
|
|
546
|
-
declare const findWarpAdapterByPrefix: (prefix: string, adapters: Adapter[]) => Adapter;
|
|
547
629
|
declare const getLatestProtocolIdentifier: (name: ProtocolName) => string;
|
|
548
630
|
declare const getWarpActionByIndex: (warp: Warp, index: number) => WarpAction;
|
|
549
|
-
declare const
|
|
631
|
+
declare const getWarpPrimaryAction: (warp: Warp) => {
|
|
550
632
|
action: WarpAction;
|
|
551
|
-
|
|
633
|
+
index: number;
|
|
552
634
|
};
|
|
635
|
+
declare const isWarpActionAutoExecute: (action: WarpAction, warp: Warp) => boolean;
|
|
553
636
|
declare const shiftBigintBy: (value: bigint | string | number, decimals: number) => bigint;
|
|
554
637
|
declare const toPreviewText: (text: string, maxChars?: number) => string;
|
|
555
638
|
declare const replacePlaceholders: (message: string, bag: Record<string, any>) => string;
|
|
556
|
-
declare const applyResultsToMessages: (warp: Warp, results: Record<string, any>) => Record<string, string>;
|
|
557
639
|
|
|
640
|
+
declare const WARP_LANGUAGES: {
|
|
641
|
+
readonly de: "German";
|
|
642
|
+
readonly en: "English";
|
|
643
|
+
readonly es: "Spanish";
|
|
644
|
+
readonly fr: "French";
|
|
645
|
+
readonly it: "Italian";
|
|
646
|
+
readonly pt: "Portuguese";
|
|
647
|
+
readonly ru: "Russian";
|
|
648
|
+
readonly zh: "Chinese";
|
|
649
|
+
readonly ja: "Japanese";
|
|
650
|
+
readonly ko: "Korean";
|
|
651
|
+
readonly ar: "Arabic";
|
|
652
|
+
readonly hi: "Hindi";
|
|
653
|
+
readonly nl: "Dutch";
|
|
654
|
+
readonly sv: "Swedish";
|
|
655
|
+
readonly da: "Danish";
|
|
656
|
+
readonly no: "Norwegian";
|
|
657
|
+
readonly fi: "Finnish";
|
|
658
|
+
readonly pl: "Polish";
|
|
659
|
+
readonly tr: "Turkish";
|
|
660
|
+
readonly el: "Greek";
|
|
661
|
+
readonly he: "Hebrew";
|
|
662
|
+
readonly th: "Thai";
|
|
663
|
+
readonly vi: "Vietnamese";
|
|
664
|
+
readonly id: "Indonesian";
|
|
665
|
+
readonly ms: "Malay";
|
|
666
|
+
readonly tl: "Tagalog";
|
|
667
|
+
};
|
|
668
|
+
declare const resolveWarpText: (text: WarpText, config?: WarpClientConfig) => string;
|
|
669
|
+
declare const isWarpI18nText: (text: WarpText) => text is WarpI18nText;
|
|
670
|
+
declare const createWarpI18nText: (translations: Record<string, string>) => WarpI18nText;
|
|
671
|
+
|
|
672
|
+
declare const cleanWarpIdentifier: (identifier: string) => string;
|
|
673
|
+
declare const isEqualWarpIdentifier: (identifier1: string, identifier2: string) => boolean;
|
|
674
|
+
declare const createWarpIdentifier: (chain: WarpChain, type: WarpIdentifierType, identifier: string) => string;
|
|
558
675
|
declare const getWarpInfoFromIdentifier: (prefixedIdentifier: string) => {
|
|
559
|
-
|
|
560
|
-
type:
|
|
676
|
+
chain: WarpChain;
|
|
677
|
+
type: WarpIdentifierType;
|
|
561
678
|
identifier: string;
|
|
562
679
|
identifierBase: string;
|
|
563
680
|
} | null;
|
|
564
681
|
declare const extractIdentifierInfoFromUrl: (url: string) => {
|
|
565
|
-
|
|
566
|
-
type:
|
|
682
|
+
chain: WarpChain;
|
|
683
|
+
type: WarpIdentifierType;
|
|
567
684
|
identifier: string;
|
|
568
685
|
identifierBase: string;
|
|
569
686
|
} | null;
|
|
687
|
+
declare const extractQueryStringFromUrl: (url: string) => string | null;
|
|
688
|
+
declare const extractQueryStringFromIdentifier: (identifier: string) => string | null;
|
|
570
689
|
|
|
571
690
|
/**
|
|
572
691
|
* Splits an input string into type and value, using only the first colon as separator.
|
|
@@ -575,7 +694,9 @@ declare const extractIdentifierInfoFromUrl: (url: string) => {
|
|
|
575
694
|
declare const splitInput: (input: string) => [WarpActionInputType, string];
|
|
576
695
|
declare const hasInputPrefix: (input: string) => boolean;
|
|
577
696
|
|
|
578
|
-
declare const
|
|
697
|
+
declare const applyOutputToMessages: (warp: Warp, output: Record<string, any>, config: WarpClientConfig) => Record<string, string>;
|
|
698
|
+
|
|
699
|
+
declare const getNextInfo: (config: WarpClientConfig, adapters: Adapter[], warp: Warp, actionIndex: number, output: WarpExecutionOutput) => WarpExecutionNextInfo | null;
|
|
579
700
|
|
|
580
701
|
/**
|
|
581
702
|
* Builds a nested payload object from a position string and field value.
|
|
@@ -598,19 +719,27 @@ declare function buildNestedPayload(position: string, fieldName: string, value:
|
|
|
598
719
|
*/
|
|
599
720
|
declare function mergeNestedPayload(target: any, source: any): any;
|
|
600
721
|
|
|
601
|
-
declare const
|
|
602
|
-
declare const getProviderConfig: (config: WarpClientConfig, chain: WarpChain) => WarpProviderConfig | undefined;
|
|
722
|
+
declare const getProviderConfig: (config: WarpClientConfig, chain: WarpChain, env: WarpChainEnv, defaultProvider: string) => WarpProviderConfig;
|
|
603
723
|
|
|
604
|
-
declare
|
|
605
|
-
|
|
606
|
-
|
|
724
|
+
declare class WarpSerializer {
|
|
725
|
+
private readonly typeRegistry?;
|
|
726
|
+
constructor(options?: {
|
|
727
|
+
typeRegistry?: AdapterTypeRegistry;
|
|
728
|
+
});
|
|
729
|
+
nativeToString(type: WarpActionInputType, value: WarpNativeValue): string;
|
|
730
|
+
stringToNative(value: string): [WarpActionInputType, WarpNativeValue];
|
|
731
|
+
private getTypeAndValue;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
declare const extractCollectOutput: (warp: Warp, response: any, actionIndex: number, inputs: ResolvedInput[], serializer: WarpSerializer, config: WarpClientConfig) => Promise<{
|
|
735
|
+
values: {
|
|
736
|
+
string: string[];
|
|
737
|
+
native: any[];
|
|
738
|
+
};
|
|
739
|
+
output: WarpExecutionOutput;
|
|
607
740
|
}>;
|
|
608
|
-
declare const
|
|
609
|
-
|
|
610
|
-
* Parses out[N] notation and returns the action index (1-based) or null if invalid.
|
|
611
|
-
* Also handles plain "out" which defaults to action index 1.
|
|
612
|
-
*/
|
|
613
|
-
declare const parseResultsOutIndex: (resultPath: string) => number | null;
|
|
741
|
+
declare const evaluateOutputCommon: (warp: Warp, baseOutput: WarpExecutionOutput, actionIndex: number, inputs: ResolvedInput[], serializer: WarpSerializer, config: WarpClientConfig) => Promise<WarpExecutionOutput>;
|
|
742
|
+
declare const parseOutputOutIndex: (outputPath: string) => number | null;
|
|
614
743
|
|
|
615
744
|
/**
|
|
616
745
|
* Signing utilities for creating and validating signed messages
|
|
@@ -664,30 +793,45 @@ declare function validateSignedMessage(expiresAt: string): boolean;
|
|
|
664
793
|
*/
|
|
665
794
|
declare function parseSignedMessage(message: string): SignableMessage;
|
|
666
795
|
|
|
667
|
-
declare const
|
|
668
|
-
declare const
|
|
669
|
-
declare const
|
|
670
|
-
declare const
|
|
671
|
-
declare const
|
|
672
|
-
declare const
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
declare const
|
|
676
|
-
declare const
|
|
796
|
+
declare const getWarpWalletAddress: (wallet: WarpWalletDetails | string | null | undefined) => string | null;
|
|
797
|
+
declare const getWarpWalletAddressFromConfig: (config: WarpClientConfig, chain: WarpChain) => string | null;
|
|
798
|
+
declare const getWarpWalletPrivateKey: (wallet: WarpWalletDetails | string | null | undefined) => string | null | undefined;
|
|
799
|
+
declare const getWarpWalletMnemonic: (wallet: WarpWalletDetails | string | null | undefined) => string | null | undefined;
|
|
800
|
+
declare const getWarpWalletPrivateKeyFromConfig: (config: WarpClientConfig, chain: WarpChain) => string | null;
|
|
801
|
+
declare const getWarpWalletMnemonicFromConfig: (config: WarpClientConfig, chain: WarpChain) => string | null;
|
|
802
|
+
|
|
803
|
+
type CodecFunc<T extends WarpNativeValue = WarpNativeValue> = (value: T) => string;
|
|
804
|
+
declare const string: CodecFunc<string>;
|
|
805
|
+
declare const uint8: CodecFunc<number>;
|
|
806
|
+
declare const uint16: CodecFunc<number>;
|
|
807
|
+
declare const uint32: CodecFunc<number>;
|
|
808
|
+
declare const uint64: CodecFunc<bigint | number>;
|
|
809
|
+
declare const biguint: CodecFunc<bigint | string | number>;
|
|
810
|
+
declare const bool: CodecFunc<boolean>;
|
|
811
|
+
declare const address: CodecFunc<string>;
|
|
812
|
+
declare const asset: CodecFunc<WarpChainAssetValue & {
|
|
813
|
+
decimals?: number;
|
|
814
|
+
}>;
|
|
815
|
+
declare const hex: CodecFunc<string>;
|
|
816
|
+
declare const option: <T extends WarpNativeValue>(codecFunc: CodecFunc<T>, value: T | null) => string;
|
|
817
|
+
declare const tuple: (...values: WarpNativeValue[]) => string;
|
|
818
|
+
declare const struct: CodecFunc<WarpStructValue>;
|
|
819
|
+
declare const vector: CodecFunc<WarpNativeValue[]>;
|
|
677
820
|
|
|
678
821
|
declare class WarpBrandBuilder {
|
|
679
822
|
private config;
|
|
680
823
|
private pendingBrand;
|
|
681
824
|
constructor(config: WarpClientConfig);
|
|
682
825
|
createFromRaw(encoded: string, validateSchema?: boolean): Promise<WarpBrand>;
|
|
683
|
-
setName(name:
|
|
684
|
-
setDescription(description:
|
|
685
|
-
setLogo(logo:
|
|
826
|
+
setName(name: WarpText): WarpBrandBuilder;
|
|
827
|
+
setDescription(description: WarpText): WarpBrandBuilder;
|
|
828
|
+
setLogo(logo: WarpBrandLogo): WarpBrandBuilder;
|
|
686
829
|
setUrls(urls: WarpBrandUrls): WarpBrandBuilder;
|
|
687
830
|
setColors(colors: WarpBrandColors): WarpBrandBuilder;
|
|
688
831
|
setCta(cta: WarpBrandCta): WarpBrandBuilder;
|
|
689
832
|
build(): Promise<WarpBrand>;
|
|
690
833
|
private ensure;
|
|
834
|
+
private ensureWarpText;
|
|
691
835
|
private ensureValidSchema;
|
|
692
836
|
}
|
|
693
837
|
|
|
@@ -697,15 +841,17 @@ declare class WarpBuilder implements BaseWarpBuilder {
|
|
|
697
841
|
constructor(config: WarpClientConfig);
|
|
698
842
|
createFromRaw(encoded: string, validate?: boolean): Promise<Warp>;
|
|
699
843
|
createFromUrl(url: string): Promise<Warp>;
|
|
844
|
+
setChain(chain: WarpChain): WarpBuilder;
|
|
700
845
|
setName(name: string): WarpBuilder;
|
|
701
|
-
setTitle(title:
|
|
702
|
-
setDescription(description:
|
|
846
|
+
setTitle(title: WarpText): WarpBuilder;
|
|
847
|
+
setDescription(description: WarpText): WarpBuilder;
|
|
703
848
|
setPreview(preview: string): WarpBuilder;
|
|
704
849
|
setActions(actions: WarpAction[]): WarpBuilder;
|
|
705
850
|
addAction(action: WarpAction): WarpBuilder;
|
|
706
851
|
build(): Promise<Warp>;
|
|
707
852
|
getDescriptionPreview(description: string, maxChars?: number): string;
|
|
708
853
|
private ensure;
|
|
854
|
+
private ensureWarpText;
|
|
709
855
|
private validate;
|
|
710
856
|
}
|
|
711
857
|
|
|
@@ -736,28 +882,54 @@ declare class WarpCache {
|
|
|
736
882
|
}
|
|
737
883
|
|
|
738
884
|
type ExecutionHandlers = {
|
|
739
|
-
onExecuted?: (result:
|
|
885
|
+
onExecuted?: (result: WarpActionExecutionResult) => void | Promise<void>;
|
|
740
886
|
onError?: (params: {
|
|
741
887
|
message: string;
|
|
742
888
|
}) => void;
|
|
743
889
|
onSignRequest?: (params: {
|
|
744
890
|
message: string;
|
|
745
891
|
chain: WarpChainInfo;
|
|
746
|
-
}) => Promise<string>;
|
|
892
|
+
}) => string | Promise<string>;
|
|
893
|
+
onActionExecuted?: (params: {
|
|
894
|
+
action: WarpActionIndex;
|
|
895
|
+
chain: WarpChainInfo | null;
|
|
896
|
+
execution: WarpActionExecutionResult | null;
|
|
897
|
+
tx: WarpAdapterGenericTransaction | null;
|
|
898
|
+
}) => void;
|
|
899
|
+
onActionUnhandled?: (params: {
|
|
900
|
+
action: WarpActionIndex;
|
|
901
|
+
chain: WarpChainInfo | null;
|
|
902
|
+
execution: WarpActionExecutionResult | null;
|
|
903
|
+
tx: WarpAdapterGenericTransaction | null;
|
|
904
|
+
}) => void;
|
|
747
905
|
};
|
|
748
906
|
declare class WarpExecutor {
|
|
749
907
|
private config;
|
|
750
908
|
private adapters;
|
|
751
909
|
private handlers?;
|
|
752
910
|
private factory;
|
|
753
|
-
private serializer;
|
|
754
911
|
constructor(config: WarpClientConfig, adapters: Adapter[], handlers?: ExecutionHandlers | undefined);
|
|
755
|
-
execute(warp: Warp, inputs: string[],
|
|
912
|
+
execute(warp: Warp, inputs: string[], meta?: {
|
|
913
|
+
envs?: Record<string, any>;
|
|
914
|
+
queries?: Record<string, any>;
|
|
915
|
+
}): Promise<{
|
|
916
|
+
txs: WarpAdapterGenericTransaction[];
|
|
917
|
+
chain: WarpChainInfo | null;
|
|
918
|
+
immediateExecutions: WarpActionExecutionResult[];
|
|
919
|
+
}>;
|
|
920
|
+
executeAction(warp: Warp, actionIndex: WarpActionIndex, inputs: string[], meta?: {
|
|
921
|
+
envs?: Record<string, any>;
|
|
922
|
+
queries?: Record<string, any>;
|
|
923
|
+
}): Promise<{
|
|
756
924
|
tx: WarpAdapterGenericTransaction | null;
|
|
757
925
|
chain: WarpChainInfo | null;
|
|
926
|
+
immediateExecution: WarpActionExecutionResult | null;
|
|
758
927
|
}>;
|
|
759
|
-
|
|
928
|
+
evaluateOutput(warp: Warp, actions: WarpChainAction[]): Promise<void>;
|
|
760
929
|
private executeCollect;
|
|
930
|
+
private doHttpRequest;
|
|
931
|
+
private buildCollectResult;
|
|
932
|
+
private callHandler;
|
|
761
933
|
}
|
|
762
934
|
|
|
763
935
|
declare class WarpFactory {
|
|
@@ -767,8 +939,13 @@ declare class WarpFactory {
|
|
|
767
939
|
private serializer;
|
|
768
940
|
private cache;
|
|
769
941
|
constructor(config: WarpClientConfig, adapters: Adapter[]);
|
|
770
|
-
|
|
771
|
-
|
|
942
|
+
getSerializer(): WarpSerializer;
|
|
943
|
+
createExecutable(warp: Warp, actionIndex: number, inputs: string[], meta?: {
|
|
944
|
+
envs?: Record<string, any>;
|
|
945
|
+
queries?: Record<string, any>;
|
|
946
|
+
}): Promise<WarpExecutable>;
|
|
947
|
+
getChainInfoForWarp(warp: Warp, inputs?: string[]): Promise<WarpChainInfo>;
|
|
948
|
+
getStringTypedInputs(action: WarpAction, inputs: string[]): string[];
|
|
772
949
|
getResolvedInputs(chain: WarpChain, action: WarpAction, inputArgs: string[]): Promise<ResolvedInput[]>;
|
|
773
950
|
getModifiedInputs(inputs: ResolvedInput[]): ResolvedInput[];
|
|
774
951
|
preprocessInput(chain: WarpChain, input: string): Promise<string>;
|
|
@@ -788,9 +965,9 @@ declare class WarpLinkBuilder {
|
|
|
788
965
|
private readonly adapters;
|
|
789
966
|
constructor(config: WarpClientConfig, adapters: Adapter[]);
|
|
790
967
|
isValid(url: string): boolean;
|
|
791
|
-
build(chain: WarpChain, type:
|
|
968
|
+
build(chain: WarpChain, type: WarpIdentifierType, id: string): string;
|
|
792
969
|
buildFromPrefixedIdentifier(identifier: string): string | null;
|
|
793
|
-
generateQrCode(chain: WarpChain, type:
|
|
970
|
+
generateQrCode(chain: WarpChain, type: WarpIdentifierType, id: string, size?: number, background?: string, color?: string, logoColor?: string): QRCodeStyling;
|
|
794
971
|
}
|
|
795
972
|
|
|
796
973
|
type DetectionResult = {
|
|
@@ -803,7 +980,7 @@ type DetectionResult = {
|
|
|
803
980
|
};
|
|
804
981
|
type DetectionResultFromHtml = {
|
|
805
982
|
match: boolean;
|
|
806
|
-
|
|
983
|
+
output: {
|
|
807
984
|
url: string;
|
|
808
985
|
warp: Warp;
|
|
809
986
|
}[];
|
|
@@ -814,7 +991,7 @@ declare class WarpLinkDetecter {
|
|
|
814
991
|
constructor(config: WarpClientConfig, adapters: Adapter[]);
|
|
815
992
|
isValid(url: string): boolean;
|
|
816
993
|
detectFromHtml(content: string): Promise<DetectionResultFromHtml>;
|
|
817
|
-
detect(
|
|
994
|
+
detect(urlOrId: string, cache?: WarpCacheConfig): Promise<DetectionResult>;
|
|
818
995
|
}
|
|
819
996
|
|
|
820
997
|
declare class WarpClient {
|
|
@@ -826,59 +1003,70 @@ declare class WarpClient {
|
|
|
826
1003
|
addAdapter(adapter: Adapter): WarpClient;
|
|
827
1004
|
createExecutor(handlers?: ExecutionHandlers): WarpExecutor;
|
|
828
1005
|
detectWarp(urlOrId: string, cache?: WarpCacheConfig): Promise<DetectionResult>;
|
|
829
|
-
executeWarp(warpOrIdentifierOrUrl: string | Warp, inputs: string[], handlers?: ExecutionHandlers,
|
|
1006
|
+
executeWarp(warpOrIdentifierOrUrl: string | Warp, inputs: string[], handlers?: ExecutionHandlers, params?: {
|
|
830
1007
|
cache?: WarpCacheConfig;
|
|
1008
|
+
queries?: Record<string, any>;
|
|
831
1009
|
}): Promise<{
|
|
832
|
-
|
|
1010
|
+
txs: WarpAdapterGenericTransaction[];
|
|
833
1011
|
chain: WarpChainInfo | null;
|
|
834
|
-
|
|
1012
|
+
immediateExecutions: WarpActionExecutionResult[];
|
|
1013
|
+
evaluateOutput: (remoteTxs: WarpAdapterGenericRemoteTransaction[]) => Promise<void>;
|
|
835
1014
|
}>;
|
|
836
|
-
createInscriptionTransaction(chain: WarpChain, warp: Warp): WarpAdapterGenericTransaction
|
|
1015
|
+
createInscriptionTransaction(chain: WarpChain, warp: Warp): Promise<WarpAdapterGenericTransaction>;
|
|
837
1016
|
createFromTransaction(chain: WarpChain, tx: WarpAdapterGenericRemoteTransaction, validate?: boolean): Promise<Warp>;
|
|
838
1017
|
createFromTransactionHash(hash: string, cache?: WarpCacheConfig): Promise<Warp | null>;
|
|
839
|
-
signMessage(chain: WarpChain, message: string
|
|
1018
|
+
signMessage(chain: WarpChain, message: string): Promise<string>;
|
|
1019
|
+
getActions(chain: WarpChain, ids: string[], awaitCompleted?: boolean): Promise<WarpChainAction[]>;
|
|
840
1020
|
getExplorer(chain: WarpChain): AdapterWarpExplorer;
|
|
841
|
-
|
|
1021
|
+
getOutput(chain: WarpChain): AdapterWarpOutput;
|
|
842
1022
|
getRegistry(chain: WarpChain): Promise<AdapterWarpRegistry>;
|
|
843
1023
|
getDataLoader(chain: WarpChain): AdapterWarpDataLoader;
|
|
1024
|
+
getWallet(chain: WarpChain): AdapterWarpWallet;
|
|
844
1025
|
get factory(): WarpFactory;
|
|
845
1026
|
get index(): WarpIndex;
|
|
846
1027
|
get linkBuilder(): WarpLinkBuilder;
|
|
847
1028
|
createBuilder(chain: WarpChain): CombinedWarpBuilder;
|
|
848
1029
|
createAbiBuilder(chain: WarpChain): AdapterWarpAbiBuilder;
|
|
849
1030
|
createBrandBuilder(chain: WarpChain): AdapterWarpBrandBuilder;
|
|
1031
|
+
createSerializer(chain: WarpChain): AdapterWarpSerializer;
|
|
1032
|
+
resolveText(warpText: WarpText): string;
|
|
850
1033
|
}
|
|
851
1034
|
|
|
852
1035
|
declare class WarpInterpolator {
|
|
853
1036
|
private config;
|
|
854
1037
|
private adapter;
|
|
855
1038
|
constructor(config: WarpClientConfig, adapter: Adapter);
|
|
856
|
-
apply(config: WarpClientConfig, warp: Warp,
|
|
1039
|
+
apply(config: WarpClientConfig, warp: Warp, meta?: {
|
|
1040
|
+
envs?: Record<string, any>;
|
|
1041
|
+
queries?: Record<string, any>;
|
|
1042
|
+
}): Promise<Warp>;
|
|
857
1043
|
applyGlobals(config: WarpClientConfig, warp: Warp): Promise<Warp>;
|
|
858
|
-
applyVars(config: WarpClientConfig, warp: Warp,
|
|
1044
|
+
applyVars(config: WarpClientConfig, warp: Warp, meta?: {
|
|
1045
|
+
envs?: Record<string, any>;
|
|
1046
|
+
queries?: Record<string, any>;
|
|
1047
|
+
}): Warp;
|
|
859
1048
|
private applyRootGlobals;
|
|
860
1049
|
private applyActionGlobals;
|
|
1050
|
+
applyInputs(text: string, resolvedInputs: ResolvedInput[], serializer: WarpSerializer): string;
|
|
861
1051
|
}
|
|
862
1052
|
|
|
863
1053
|
declare class WarpLogger {
|
|
864
1054
|
private static isTestEnv;
|
|
1055
|
+
static debug(...args: any[]): void;
|
|
865
1056
|
static info(...args: any[]): void;
|
|
866
1057
|
static warn(...args: any[]): void;
|
|
867
1058
|
static error(...args: any[]): void;
|
|
868
1059
|
}
|
|
869
1060
|
|
|
870
|
-
declare class
|
|
871
|
-
private typeRegistry;
|
|
872
|
-
setTypeRegistry(typeRegistry: WarpTypeRegistry): void;
|
|
873
|
-
nativeToString(type: WarpActionInputType, value: WarpNativeValue): string;
|
|
874
|
-
stringToNative(value: string): [WarpActionInputType, WarpNativeValue];
|
|
875
|
-
}
|
|
876
|
-
|
|
877
|
-
declare class WarpTypeRegistryImpl implements WarpTypeRegistry {
|
|
1061
|
+
declare class WarpTypeRegistry implements AdapterTypeRegistry {
|
|
878
1062
|
private typeHandlers;
|
|
1063
|
+
private typeAliases;
|
|
879
1064
|
registerType(typeName: string, handler: WarpTypeHandler): void;
|
|
1065
|
+
registerTypeAlias(typeName: string, alias: string): void;
|
|
880
1066
|
hasType(typeName: string): boolean;
|
|
881
1067
|
getHandler(typeName: string): WarpTypeHandler | undefined;
|
|
1068
|
+
getAlias(typeName: string): string | undefined;
|
|
1069
|
+
resolveType(typeName: string): string;
|
|
882
1070
|
getRegisteredTypes(): string[];
|
|
883
1071
|
}
|
|
884
1072
|
|
|
@@ -891,10 +1079,11 @@ declare class WarpValidator {
|
|
|
891
1079
|
private config;
|
|
892
1080
|
constructor(config: WarpClientConfig);
|
|
893
1081
|
validate(warp: Warp): Promise<ValidationResult>;
|
|
1082
|
+
private validatePrimaryAction;
|
|
894
1083
|
private validateMaxOneValuePosition;
|
|
895
1084
|
private validateVariableNamesAndResultNamesUppercase;
|
|
896
1085
|
private validateAbiIsSetIfApplicable;
|
|
897
1086
|
private validateSchema;
|
|
898
1087
|
}
|
|
899
1088
|
|
|
900
|
-
export { type Adapter, type AdapterFactory, type AdapterWarpAbiBuilder, type AdapterWarpBrandBuilder, type AdapterWarpBuilder, type AdapterWarpDataLoader, type AdapterWarpExecutor, type AdapterWarpExplorer, type
|
|
1089
|
+
export { type Adapter, type AdapterFactory, type AdapterTypeRegistry, type AdapterWarpAbiBuilder, type AdapterWarpBrandBuilder, type AdapterWarpBuilder, type AdapterWarpDataLoader, type AdapterWarpExecutor, type AdapterWarpExplorer, type AdapterWarpOutput, type AdapterWarpRegistry, type AdapterWarpSerializer, type AdapterWarpWallet, type BaseWarpActionInputType, type BaseWarpBuilder, BrowserCryptoProvider, CacheTtl, type ClientIndexConfig, type ClientTransformConfig, type CodecFunc, type CombinedWarpBuilder, type CryptoProvider, type DetectionResult, type DetectionResultFromHtml, type ExecutionHandlers, type HttpAuthHeaders, type InterpolationBag, NodeCryptoProvider, type ProtocolName, type ResolvedInput, type SignableMessage, type TransformRunner, WARP_LANGUAGES, type Warp, type WarpAbi, type WarpAbiContents, type WarpAction, type WarpActionExecutionResult, type WarpActionExecutionStatus, type WarpActionIndex, type WarpActionInput, type WarpActionInputModifier, type WarpActionInputPosition, type WarpActionInputSource, type WarpActionInputType, type WarpActionType, type WarpAdapterGenericRemoteTransaction, type WarpAdapterGenericTransaction, type WarpAdapterGenericType, type WarpAdapterGenericValue, type WarpAlert, type WarpAlertName, type WarpAlerts, type WarpBrand, WarpBrandBuilder, type WarpBrandColors, type WarpBrandCta, type WarpBrandLogo, type WarpBrandLogoThemed, type WarpBrandUrls, WarpBuilder, WarpCache, type WarpCacheConfig, WarpCacheKey, type WarpChain, type WarpChainAccount, type WarpChainAction, type WarpChainActionStatus, type WarpChainAsset, type WarpChainAssetValue, type WarpChainEnv, type WarpChainInfo, WarpChainName, WarpClient, type WarpClientConfig, type WarpCollectAction, type WarpCollectDestination, type WarpCollectDestinationHttp, WarpConfig, WarpConstants, type WarpContract, type WarpContractAction, type WarpContractVerification, type WarpDataLoaderOptions, type WarpExecutable, type WarpExecutionMessages, type WarpExecutionNextInfo, type WarpExecutionOutput, WarpExecutor, type WarpExplorerName, WarpFactory, type WarpI18nText, type WarpIdentifierType, WarpIndex, WarpInputTypes, WarpInterpolator, type WarpLinkAction, WarpLinkBuilder, WarpLinkDetecter, type WarpLocale, WarpLogger, type WarpMessageName, type WarpMeta, type WarpNativeValue, type WarpOutputName, WarpProtocolVersions, type WarpProviderConfig, type WarpProviderPreferences, type WarpQueryAction, type WarpRegistryConfigInfo, type WarpRegistryInfo, type WarpResulutionPath, type WarpSearchHit, type WarpSearchResult, type WarpSecret, WarpSerializer, type WarpStructValue, type WarpText, type WarpTransferAction, type WarpTrustStatus, type WarpTypeHandler, WarpTypeRegistry, type WarpUserWallets, WarpValidator, type WarpVarPlaceholder, type WarpWalletDetails, address, applyOutputToMessages, asset, biguint, bool, buildNestedPayload, bytesToBase64, bytesToHex, cleanWarpIdentifier, createAuthHeaders, createAuthMessage, createCryptoProvider, createHttpAuthHeaders, createSignableMessage, createWarpI18nText, createWarpIdentifier, evaluateOutputCommon, extractCollectOutput, extractIdentifierInfoFromUrl, extractQueryStringFromIdentifier, extractQueryStringFromUrl, extractWarpSecrets, findWarpAdapterForChain, getCryptoProvider, getEventNameFromWarp, getLatestProtocolIdentifier, getNextInfo, getProviderConfig, getRandomBytes, getRandomHex, getWarpActionByIndex, getWarpBrandLogoUrl, getWarpInfoFromIdentifier, getWarpPrimaryAction, getWarpWalletAddress, getWarpWalletAddressFromConfig, getWarpWalletMnemonic, getWarpWalletMnemonicFromConfig, getWarpWalletPrivateKey, getWarpWalletPrivateKeyFromConfig, hasInputPrefix, hex, isEqualWarpIdentifier, isWarpActionAutoExecute, isWarpI18nText, mergeNestedPayload, option, parseOutputOutIndex, parseSignedMessage, replacePlaceholders, resolveWarpText, safeWindow, setCryptoProvider, shiftBigintBy, splitInput, string, struct, testCryptoAvailability, toPreviewText, tuple, uint16, uint32, uint64, uint8, validateSignedMessage, vector };
|