@vleap/warps 3.0.0-alpha.12 → 3.0.0-alpha.121

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.ts CHANGED
@@ -1,75 +1,306 @@
1
- import { Transaction, TransactionOnNetwork, Address, TokenTransfer as TokenTransfer$1, AbiRegistry, NetworkEntrypoint } from '@multiversx/sdk-core';
2
- import { TypedValue, Type, OptionValue, OptionalValue, List, VariadicValue, CompositeValue, StringValue, U8Value, U16Value, U32Value, U64Value, BigUIntValue, BooleanValue, AddressValue, TokenIdentifierValue, BytesValue, TokenTransfer, Struct, CodeMetadataValue, NothingValue, Transaction as Transaction$1, Address as Address$1 } from '@multiversx/sdk-core/out';
3
1
  import QRCodeStyling from 'qr-code-styling';
4
2
 
5
- declare const CacheTtl: {
6
- OneMinute: number;
7
- OneHour: number;
8
- OneDay: number;
9
- OneWeek: number;
10
- OneMonth: number;
11
- OneYear: number;
3
+ type WarpBrand = {
4
+ protocol: string;
5
+ name: string;
6
+ description: string;
7
+ logo: string;
8
+ urls?: WarpBrandUrls;
9
+ colors?: WarpBrandColors;
10
+ cta?: WarpBrandCta;
11
+ meta?: WarpMeta;
12
12
  };
13
- declare const CacheKey: {
14
- Warp: (env: WarpChainEnv, id: string) => string;
15
- WarpAbi: (env: WarpChainEnv, id: string) => string;
16
- LastWarpExecutionInputs: (env: WarpChainEnv, id: string, action: number) => string;
17
- RegistryInfo: (env: WarpChainEnv, id: string) => string;
18
- Brand: (env: WarpChainEnv, hash: string) => string;
19
- ChainInfo: (env: WarpChainEnv, chain: WarpChain) => string;
20
- ChainInfos: (env: WarpChainEnv) => string;
13
+ type WarpBrandUrls = {
14
+ web?: string;
15
+ };
16
+ type WarpBrandColors = {
17
+ primary?: string;
18
+ secondary?: string;
19
+ };
20
+ type WarpBrandCta = {
21
+ title: string;
22
+ description: string;
23
+ label: string;
24
+ url: string;
21
25
  };
22
- type CacheType = 'memory' | 'localStorage';
23
- declare class WarpCache {
24
- private strategy;
25
- constructor(type?: CacheType);
26
- private selectStrategy;
27
- set<T>(key: string, value: T, ttl: number): void;
28
- get<T>(key: string): T | null;
29
- forget(key: string): void;
30
- clear(): void;
31
- }
26
+
27
+ type ClientCacheConfig = {
28
+ ttl?: number;
29
+ type?: WarpCacheType;
30
+ };
31
+ type WarpCacheType = 'memory' | 'localStorage';
32
32
 
33
33
  type WarpChainEnv = 'mainnet' | 'testnet' | 'devnet';
34
34
  type ProtocolName = 'warp' | 'brand' | 'abi';
35
35
 
36
- type WarpChain = string;
37
- type WarpInitConfig = {
36
+ type WarpTrustStatus = 'unverified' | 'verified' | 'blacklisted';
37
+ type WarpRegistryInfo = {
38
+ hash: string;
39
+ alias: string | null;
40
+ trust: WarpTrustStatus;
41
+ owner: string;
42
+ createdAt: number;
43
+ upgradedAt: number;
44
+ brand: string | null;
45
+ upgrade: string | null;
46
+ };
47
+ type WarpRegistryConfigInfo = {
48
+ unitPrice: bigint;
49
+ admins: string[];
50
+ };
51
+
52
+ type WarpActionExecution = {
53
+ success: boolean;
54
+ warp: Warp;
55
+ action: number;
56
+ user: string | null;
57
+ txHash: string | null;
58
+ tx: WarpAdapterGenericTransaction | null;
59
+ next: WarpExecutionNextInfo | null;
60
+ values: {
61
+ string: string[];
62
+ native: WarpNativeValue[];
63
+ };
64
+ results: WarpExecutionResults;
65
+ messages: WarpExecutionMessages;
66
+ };
67
+ type WarpExecutionNextInfo = {
68
+ identifier: string | null;
69
+ url: string;
70
+ }[];
71
+ type WarpExecutionResults = Record<WarpResultName, any | null>;
72
+ type WarpExecutionMessages = Record<WarpMessageName, string | null>;
73
+
74
+ type ClientIndexConfig = {
75
+ url?: string;
76
+ apiKey?: string;
77
+ searchParamName?: string;
78
+ };
79
+ type WarpSearchResult = {
80
+ hits: WarpSearchHit[];
81
+ };
82
+ type WarpSearchHit = {
83
+ hash: string;
84
+ alias: string;
85
+ name: string;
86
+ title: string;
87
+ description: string;
88
+ preview: string;
89
+ status: string;
90
+ category: string;
91
+ featured: boolean;
92
+ };
93
+
94
+ interface TransformRunner {
95
+ run(code: string, context: any): Promise<any>;
96
+ }
97
+ type ClientTransformConfig = {
98
+ runner?: TransformRunner | null;
99
+ };
100
+
101
+ type WarpWalletDetails = {
102
+ address: string;
103
+ mnemonic?: string | null;
104
+ privateKey?: string | null;
105
+ };
106
+ type WarpUserWallets = Record<WarpChain, WarpWalletDetails | string | null>;
107
+ type WarpProviderConfig = Record<WarpChainEnv, string>;
108
+ type WarpClientConfig = {
38
109
  env: WarpChainEnv;
39
110
  clientUrl?: string;
40
111
  currentUrl?: string;
41
112
  vars?: Record<string, string | number>;
42
113
  user?: {
43
- wallet?: string;
114
+ wallets?: WarpUserWallets;
115
+ };
116
+ preferences?: {
117
+ explorers?: Record<WarpChain, WarpExplorerName>;
44
118
  };
119
+ providers?: Record<WarpChain, WarpProviderConfig>;
45
120
  schema?: {
46
121
  warp?: string;
47
122
  brand?: string;
48
123
  };
49
- cache?: {
50
- ttl?: number;
51
- type?: CacheType;
52
- };
53
- registry?: {
54
- contract?: string;
55
- };
56
- index?: {
57
- url?: string;
58
- apiKey?: string;
59
- searchParamName?: string;
124
+ cache?: ClientCacheConfig;
125
+ transform?: ClientTransformConfig;
126
+ index?: ClientIndexConfig;
127
+ interceptors?: {
128
+ openLink?: (url: string) => Promise<void>;
60
129
  };
61
130
  };
62
131
  type WarpCacheConfig = {
63
132
  ttl?: number;
64
133
  };
134
+ type AdapterFactory = (config: WarpClientConfig, fallback?: Adapter) => Adapter;
135
+ type Adapter = {
136
+ chainInfo: WarpChainInfo;
137
+ prefix: string;
138
+ builder: () => CombinedWarpBuilder;
139
+ executor: AdapterWarpExecutor;
140
+ results: AdapterWarpResults;
141
+ serializer: AdapterWarpSerializer;
142
+ registry: AdapterWarpRegistry;
143
+ explorer: AdapterWarpExplorer;
144
+ abiBuilder: () => AdapterWarpAbiBuilder;
145
+ brandBuilder: () => AdapterWarpBrandBuilder;
146
+ dataLoader: AdapterWarpDataLoader;
147
+ wallet: AdapterWarpWallet;
148
+ };
149
+ type WarpAdapterGenericTransaction = any;
150
+ type WarpAdapterGenericRemoteTransaction = any;
151
+ type WarpAdapterGenericValue = any;
152
+ type WarpAdapterGenericType = any;
153
+ interface WarpTypeHandler {
154
+ stringToNative(value: string): any;
155
+ nativeToString(value: any): string;
156
+ }
157
+ interface AdapterTypeRegistry {
158
+ registerType(typeName: string, handler: WarpTypeHandler): void;
159
+ registerTypeAlias(typeName: string, alias: string): void;
160
+ hasType(typeName: string): boolean;
161
+ getHandler(typeName: string): WarpTypeHandler | undefined;
162
+ getAlias(typeName: string): string | undefined;
163
+ resolveType(typeName: string): string;
164
+ getRegisteredTypes(): string[];
165
+ }
166
+ interface BaseWarpBuilder {
167
+ createFromRaw(encoded: string, validate?: boolean): Promise<Warp>;
168
+ createFromUrl(url: string): Promise<Warp>;
169
+ setName(name: string): BaseWarpBuilder;
170
+ setTitle(title: string): BaseWarpBuilder;
171
+ setDescription(description: string): BaseWarpBuilder;
172
+ setPreview(preview: string): BaseWarpBuilder;
173
+ setActions(actions: WarpAction[]): BaseWarpBuilder;
174
+ addAction(action: WarpAction): BaseWarpBuilder;
175
+ build(): Promise<Warp>;
176
+ }
177
+ interface AdapterWarpBuilder {
178
+ createInscriptionTransaction(warp: Warp): Promise<WarpAdapterGenericTransaction>;
179
+ createFromTransaction(tx: WarpAdapterGenericTransaction, validate?: boolean): Promise<Warp>;
180
+ createFromTransactionHash(hash: string, cache?: WarpCacheConfig): Promise<Warp | null>;
181
+ }
182
+ type CombinedWarpBuilder = AdapterWarpBuilder & BaseWarpBuilder;
183
+ interface AdapterWarpAbiBuilder {
184
+ createInscriptionTransaction(abi: WarpAbiContents): Promise<WarpAdapterGenericTransaction>;
185
+ createFromRaw(encoded: string): Promise<any>;
186
+ createFromTransaction(tx: WarpAdapterGenericTransaction): Promise<any>;
187
+ createFromTransactionHash(hash: string, cache?: WarpCacheConfig): Promise<any | null>;
188
+ }
189
+ interface AdapterWarpBrandBuilder {
190
+ createInscriptionTransaction(brand: WarpBrand): WarpAdapterGenericTransaction;
191
+ createFromTransaction(tx: WarpAdapterGenericTransaction, validate?: boolean): Promise<WarpBrand>;
192
+ createFromTransactionHash(hash: string, cache?: WarpCacheConfig): Promise<WarpBrand | null>;
193
+ }
194
+ interface AdapterWarpExecutor {
195
+ createTransaction(executable: WarpExecutable): Promise<WarpAdapterGenericTransaction>;
196
+ executeQuery(executable: WarpExecutable): Promise<WarpActionExecution>;
197
+ }
198
+ interface AdapterWarpResults {
199
+ getActionExecution(warp: Warp, actionIndex: WarpActionIndex, tx: WarpAdapterGenericRemoteTransaction): Promise<WarpActionExecution>;
200
+ }
201
+ interface AdapterWarpSerializer {
202
+ typedToString(value: WarpAdapterGenericValue): string;
203
+ typedToNative(value: WarpAdapterGenericValue): [WarpActionInputType, WarpNativeValue];
204
+ nativeToTyped(type: WarpActionInputType, value: WarpNativeValue): WarpAdapterGenericValue;
205
+ nativeToType(type: BaseWarpActionInputType): WarpAdapterGenericType;
206
+ stringToTyped(value: string): WarpAdapterGenericValue;
207
+ }
208
+ interface AdapterWarpRegistry {
209
+ init(): Promise<void>;
210
+ getRegistryConfig(): WarpRegistryConfigInfo;
211
+ createWarpRegisterTransaction(txHash: string, alias?: string | null, brand?: string | null): Promise<WarpAdapterGenericTransaction>;
212
+ createWarpUnregisterTransaction(txHash: string): Promise<WarpAdapterGenericTransaction>;
213
+ createWarpUpgradeTransaction(alias: string, txHash: string, brand?: string | null): Promise<WarpAdapterGenericTransaction>;
214
+ createWarpAliasSetTransaction(txHash: string, alias: string): Promise<WarpAdapterGenericTransaction>;
215
+ createWarpVerifyTransaction(txHash: string): Promise<WarpAdapterGenericTransaction>;
216
+ createWarpTransferOwnershipTransaction(txHash: string, newOwner: string): Promise<WarpAdapterGenericTransaction>;
217
+ createBrandRegisterTransaction(txHash: string): Promise<WarpAdapterGenericTransaction>;
218
+ createWarpBrandingTransaction(warpHash: string, brandHash: string): Promise<WarpAdapterGenericTransaction>;
219
+ getInfoByAlias(alias: string, cache?: WarpCacheConfig): Promise<{
220
+ registryInfo: WarpRegistryInfo | null;
221
+ brand: WarpBrand | null;
222
+ }>;
223
+ getInfoByHash(hash: string, cache?: WarpCacheConfig): Promise<{
224
+ registryInfo: WarpRegistryInfo | null;
225
+ brand: WarpBrand | null;
226
+ }>;
227
+ getUserWarpRegistryInfos(user?: string): Promise<WarpRegistryInfo[]>;
228
+ getUserBrands(user?: string): Promise<WarpBrand[]>;
229
+ fetchBrand(hash: string, cache?: WarpCacheConfig): Promise<WarpBrand | null>;
230
+ }
231
+ interface AdapterWarpExplorer {
232
+ getAccountUrl(address: string): string;
233
+ getTransactionUrl(hash: string): string;
234
+ getAssetUrl(identifier: string): string;
235
+ getContractUrl(address: string): string;
236
+ }
237
+ interface WarpDataLoaderOptions {
238
+ page?: number;
239
+ size?: number;
240
+ }
241
+ interface AdapterWarpDataLoader {
242
+ getAccount(address: string): Promise<WarpChainAccount>;
243
+ getAccountAssets(address: string): Promise<WarpChainAsset[]>;
244
+ getAsset(identifier: string): Promise<WarpChainAsset | null>;
245
+ getAction(identifier: string, awaitCompleted?: boolean): Promise<WarpChainAction | null>;
246
+ getAccountActions(address: string, options?: WarpDataLoaderOptions): Promise<WarpChainAction[]>;
247
+ }
248
+ interface AdapterWarpWallet {
249
+ signTransaction(tx: WarpAdapterGenericTransaction): Promise<WarpAdapterGenericTransaction>;
250
+ signTransactions(txs: WarpAdapterGenericTransaction[]): Promise<WarpAdapterGenericTransaction[]>;
251
+ signMessage(message: string): Promise<string>;
252
+ sendTransactions(txs: WarpAdapterGenericTransaction[]): Promise<string[]>;
253
+ sendTransaction(tx: WarpAdapterGenericTransaction): Promise<string>;
254
+ create(mnemonic: string): WarpWalletDetails;
255
+ generate(): WarpWalletDetails;
256
+ getAddress(): string | null;
257
+ }
258
+
259
+ type WarpChainAccount = {
260
+ chain: WarpChain;
261
+ address: string;
262
+ balance: bigint;
263
+ };
264
+ type WarpChainAssetValue = {
265
+ identifier: string;
266
+ amount: bigint;
267
+ };
268
+ type WarpChainAsset = {
269
+ chain: WarpChain;
270
+ identifier: string;
271
+ name: string;
272
+ symbol: string;
273
+ amount?: bigint;
274
+ decimals?: number;
275
+ logoUrl?: string | null;
276
+ price?: number;
277
+ supply?: bigint;
278
+ };
279
+ type WarpChainAction = {
280
+ chain: WarpChain;
281
+ id: string;
282
+ sender: string;
283
+ receiver: string;
284
+ value: bigint;
285
+ function: string;
286
+ status: WarpChainActionStatus;
287
+ createdAt: string;
288
+ error?: string | null;
289
+ tx?: WarpAdapterGenericRemoteTransaction | null;
290
+ };
291
+ type WarpChainActionStatus = 'pending' | 'success' | 'failed';
292
+
293
+ type WarpChain = string;
294
+ type WarpExplorerName = string;
65
295
  type WarpChainInfo = {
66
- name: WarpChain;
296
+ name: string;
67
297
  displayName: string;
68
298
  chainId: string;
69
299
  blockTime: number;
70
300
  addressHrp: string;
71
- apiUrl: string;
72
- explorerUrl: string;
301
+ defaultApiUrl: string;
302
+ logoUrl: string;
303
+ nativeToken: WarpChainAsset;
73
304
  };
74
305
  type WarpIdType = 'hash' | 'alias';
75
306
  type WarpVarPlaceholder = string;
@@ -78,6 +309,7 @@ type WarpResulutionPath = string;
78
309
  type WarpMessageName = string;
79
310
  type Warp = {
80
311
  protocol: string;
312
+ chain?: WarpChain;
81
313
  name: string;
82
314
  title: string;
83
315
  description: string | null;
@@ -91,59 +323,58 @@ type Warp = {
91
323
  meta?: WarpMeta;
92
324
  };
93
325
  type WarpMeta = {
326
+ chain: WarpChain;
94
327
  hash: string;
95
328
  creator: string;
96
329
  createdAt: string;
97
330
  };
98
331
  type WarpAction = WarpTransferAction | WarpContractAction | WarpQueryAction | WarpCollectAction | WarpLinkAction;
332
+ type WarpActionIndex = number;
99
333
  type WarpActionType = 'transfer' | 'contract' | 'query' | 'collect' | 'link';
100
334
  type WarpTransferAction = {
101
335
  type: WarpActionType;
102
- chain?: WarpChain;
103
336
  label: string;
104
337
  description?: string | null;
105
338
  address?: string;
106
339
  data?: string;
107
340
  value?: string;
108
- transfers?: WarpContractActionTransfer[];
341
+ transfers?: string[];
109
342
  inputs?: WarpActionInput[];
343
+ primary?: boolean;
344
+ auto?: boolean;
110
345
  next?: string;
111
346
  };
112
347
  type WarpContractAction = {
113
348
  type: WarpActionType;
114
- chain?: WarpChain;
115
349
  label: string;
116
350
  description?: string | null;
117
- address: string;
118
- func: string | null;
119
- args: string[];
351
+ address?: string;
352
+ func?: string | null;
353
+ args?: string[];
120
354
  value?: string;
121
355
  gasLimit: number;
122
- transfers?: WarpContractActionTransfer[];
356
+ transfers?: string[];
123
357
  abi?: string;
124
358
  inputs?: WarpActionInput[];
359
+ primary?: boolean;
360
+ auto?: boolean;
125
361
  next?: string;
126
362
  };
127
- type WarpContractActionTransfer = {
128
- token: string;
129
- nonce?: number;
130
- amount?: string;
131
- };
132
363
  type WarpQueryAction = {
133
364
  type: WarpActionType;
134
- chain?: WarpChain;
135
365
  label: string;
136
366
  description?: string | null;
137
- address: string;
138
- func: string;
139
- args: string[];
367
+ address?: string;
368
+ func?: string;
369
+ args?: string[];
140
370
  abi?: string;
141
371
  inputs?: WarpActionInput[];
372
+ primary?: boolean;
373
+ auto?: boolean;
142
374
  next?: string;
143
375
  };
144
376
  type WarpCollectAction = {
145
377
  type: WarpActionType;
146
- chain?: WarpChain;
147
378
  label: string;
148
379
  description?: string | null;
149
380
  destination: {
@@ -152,20 +383,27 @@ type WarpCollectAction = {
152
383
  headers?: Record<string, string>;
153
384
  };
154
385
  inputs?: WarpActionInput[];
386
+ primary?: boolean;
387
+ auto?: boolean;
155
388
  next?: string;
156
389
  };
157
390
  type WarpLinkAction = {
158
391
  type: WarpActionType;
159
- chain?: WarpChain;
160
392
  label: string;
161
393
  description?: string | null;
162
394
  url: string;
163
395
  inputs?: WarpActionInput[];
396
+ primary?: boolean;
397
+ auto?: boolean;
164
398
  };
165
- type WarpActionInputSource = 'field' | 'query' | 'user:wallet';
166
- type BaseWarpActionInputType = 'string' | 'uint8' | 'uint16' | 'uint32' | 'uint64' | 'biguint' | 'bool' | 'address' | 'token' | 'codemeta' | 'hex' | 'esdt' | 'nft';
399
+ type WarpActionInputSource = 'field' | 'query' | 'user:wallet' | 'hidden';
400
+ type BaseWarpActionInputType = 'string' | 'uint8' | 'uint16' | 'uint32' | 'uint64' | 'uint128' | 'uint256' | 'biguint' | 'bool' | 'address' | 'hex' | string;
167
401
  type WarpActionInputType = string;
168
- type WarpActionInputPosition = 'receiver' | 'value' | 'transfer' | `arg:${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10}` | 'data';
402
+ interface WarpStructValue {
403
+ [key: string]: WarpNativeValue;
404
+ }
405
+ type WarpNativeValue = string | number | bigint | boolean | WarpChainAssetValue | null | WarpNativeValue[] | WarpStructValue;
406
+ type WarpActionInputPosition = 'receiver' | 'value' | 'transfer' | `arg:${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10}` | 'data' | 'chain' | `payload:${string}`;
169
407
  type WarpActionInputModifier = 'scale';
170
408
  type WarpActionInput = {
171
409
  name: string;
@@ -184,6 +422,7 @@ type WarpActionInput = {
184
422
  [key: string]: string;
185
423
  };
186
424
  modifier?: string;
425
+ default?: string | number | boolean;
187
426
  };
188
427
  type ResolvedInput = {
189
428
  input: WarpActionInput;
@@ -198,8 +437,19 @@ type WarpContractVerification = {
198
437
  codeHash: string;
199
438
  abi: object;
200
439
  };
440
+ type WarpExecutable = {
441
+ chain: WarpChainInfo;
442
+ warp: Warp;
443
+ action: number;
444
+ destination: string;
445
+ args: string[];
446
+ value: bigint;
447
+ transfers: WarpChainAssetValue[];
448
+ data: string | null;
449
+ resolvedInputs: ResolvedInput[];
450
+ };
201
451
 
202
- type WarpWarpAbi = {
452
+ type WarpAbi = {
203
453
  protocol: string;
204
454
  content: WarpAbiContents;
205
455
  meta?: WarpMeta;
@@ -213,103 +463,16 @@ type WarpAbiContents = {
213
463
  events?: any[];
214
464
  };
215
465
 
216
- type Brand = {
217
- protocol: string;
218
- name: string;
219
- description: string;
220
- logo: string;
221
- urls?: BrandUrls;
222
- colors?: BrandColors;
223
- cta?: BrandCta;
224
- meta?: BrandMeta;
225
- };
226
- type BrandUrls = {
227
- web?: string;
228
- };
229
- type BrandColors = {
230
- primary?: string;
231
- secondary?: string;
232
- };
233
- type BrandCta = {
234
- title: string;
235
- description: string;
236
- label: string;
237
- url: string;
238
- };
239
- type BrandMeta = {
240
- hash: string;
241
- creator: string;
242
- createdAt: string;
243
- };
244
-
245
- type WarpTrustStatus = 'unverified' | 'verified' | 'blacklisted';
246
- type WarpRegistryInfo = {
247
- hash: string;
248
- alias: string | null;
249
- trust: WarpTrustStatus;
250
- owner: string;
251
- createdAt: number;
252
- upgradedAt: number;
253
- brand: string | null;
254
- upgrade: string | null;
255
- };
256
- type WarpRegistryConfigInfo = {
257
- unitPrice: bigint;
258
- admins: string[];
259
- };
260
-
261
- type WarpExecution = {
262
- success: boolean;
263
- warp: Warp;
264
- action: number;
265
- user: string | null;
266
- txHash: string | null;
267
- next: WarpExecutionNextInfo | null;
268
- values: any[];
269
- results: WarpExecutionResults;
270
- messages: WarpExecutionMessages;
466
+ type WarpSecret = {
467
+ key: string;
468
+ description?: string | null;
271
469
  };
272
- type WarpExecutionNextInfo = {
273
- identifier: string | null;
274
- url: string;
275
- }[];
276
- type WarpExecutionResults = Record<WarpResultName, any | null>;
277
- type WarpExecutionMessages = Record<WarpMessageName, string | null>;
278
470
 
279
- type WarpSearchResult = {
280
- hits: WarpSearchHit[];
281
- };
282
- type WarpSearchHit = {
283
- hash: string;
284
- alias: string;
285
- name: string;
286
- title: string;
287
- description: string;
288
- preview: string;
289
- status: string;
290
- category: string;
291
- featured: boolean;
471
+ type InterpolationBag = {
472
+ config: WarpClientConfig;
473
+ chain: WarpChainInfo;
292
474
  };
293
475
 
294
- declare class BrandBuilder {
295
- private config;
296
- private pendingBrand;
297
- constructor(config: WarpInitConfig);
298
- createInscriptionTransaction(brand: Brand): Transaction;
299
- createFromRaw(encoded: string, validateSchema?: boolean): Promise<Brand>;
300
- createFromTransaction(tx: TransactionOnNetwork, validateSchema?: boolean): Promise<Brand>;
301
- createFromTransactionHash(hash: string): Promise<Brand | null>;
302
- setName(name: string): BrandBuilder;
303
- setDescription(description: string): BrandBuilder;
304
- setLogo(logo: string): BrandBuilder;
305
- setUrls(urls: BrandUrls): BrandBuilder;
306
- setColors(colors: BrandColors): BrandBuilder;
307
- setCta(cta: BrandCta): BrandBuilder;
308
- build(): Promise<Brand>;
309
- private ensure;
310
- private ensureValidSchema;
311
- }
312
-
313
476
  declare const WarpProtocolVersions: {
314
477
  Warp: string;
315
478
  Brand: string;
@@ -320,56 +483,40 @@ declare const WarpConfig: {
320
483
  LatestBrandSchemaUrl: string;
321
484
  DefaultClientUrl: (env: WarpChainEnv) => "https://usewarp.to" | "https://testnet.usewarp.to" | "https://devnet.usewarp.to";
322
485
  SuperClientUrls: string[];
323
- MainChain: {
324
- Name: string;
325
- DisplayName: string;
326
- ApiUrl: (env: WarpChainEnv) => "https://devnet-api.multiversx.com" | "https://testnet-api.multiversx.com" | "https://api.multiversx.com";
327
- ExplorerUrl: (env: WarpChainEnv) => "https://devnet-explorer.multiversx.com" | "https://testnet-explorer.multiversx.com" | "https://explorer.multiversx.com";
328
- BlockTime: (env: WarpChainEnv) => number;
329
- AddressHrp: string;
330
- ChainId: (env: WarpChainEnv) => "D" | "T" | "1";
331
- };
332
- Registry: {
333
- Contract: (env: WarpChainEnv) => "erd1qqqqqqqqqqqqqpgqje2f99vr6r7sk54thg03c9suzcvwr4nfl3tsfkdl36" | "####" | "erd1qqqqqqqqqqqqqpgq3mrpj3u6q7tejv6d7eqhnyd27n9v5c5tl3ts08mffe";
334
- };
335
486
  AvailableActionInputSources: WarpActionInputSource[];
336
487
  AvailableActionInputTypes: WarpActionInputType[];
337
488
  AvailableActionInputPositions: WarpActionInputPosition[];
338
489
  };
339
490
 
340
- type InterpolationBag = {
341
- config: WarpInitConfig;
342
- chain: WarpChainInfo;
343
- };
344
- declare class WarpInterpolator {
345
- static apply(config: WarpInitConfig, warp: Warp): Promise<Warp>;
346
- static applyGlobals(config: WarpInitConfig, warp: Warp): Promise<Warp>;
347
- static applyVars(config: WarpInitConfig, warp: Warp): Warp;
348
- private static applyRootGlobals;
349
- private static applyActionGlobals;
491
+ declare enum WarpChainName {
492
+ Multiversx = "multiversx",
493
+ Vibechain = "vibechain",
494
+ Sui = "sui",
495
+ Ethereum = "ethereum",
496
+ Base = "base",
497
+ Arbitrum = "arbitrum",
498
+ Somnia = "somnia",
499
+ Fastset = "fastset"
350
500
  }
351
-
352
501
  declare const WarpConstants: {
353
502
  HttpProtocolPrefix: string;
354
503
  IdentifierParamName: string;
355
504
  IdentifierParamSeparator: string;
505
+ IdentifierChainDefault: string;
356
506
  IdentifierType: {
357
- Alias: string;
358
- Hash: string;
359
- };
360
- Source: {
361
- UserWallet: string;
507
+ Alias: WarpIdType;
508
+ Hash: WarpIdType;
362
509
  };
363
510
  Globals: {
364
511
  UserWallet: {
365
512
  Placeholder: string;
366
- Accessor: (bag: InterpolationBag) => string | undefined;
513
+ Accessor: (bag: InterpolationBag) => string | WarpWalletDetails | null | undefined;
367
514
  };
368
515
  ChainApiUrl: {
369
516
  Placeholder: string;
370
517
  Accessor: (bag: InterpolationBag) => string;
371
518
  };
372
- ChainExplorerUrl: {
519
+ ChainAddressHrp: {
373
520
  Placeholder: string;
374
521
  Accessor: (bag: InterpolationBag) => string;
375
522
  };
@@ -380,106 +527,245 @@ declare const WarpConstants: {
380
527
  };
381
528
  ArgParamsSeparator: string;
382
529
  ArgCompositeSeparator: string;
530
+ ArgListSeparator: string;
531
+ ArgStructSeparator: string;
383
532
  Transform: {
384
533
  Prefix: string;
385
534
  };
386
- Egld: {
387
- Identifier: string;
388
- EsdtIdentifier: string;
389
- DisplayName: string;
390
- Decimals: number;
535
+ Source: {
536
+ UserWallet: string;
537
+ };
538
+ Position: {
539
+ Payload: string;
391
540
  };
392
541
  };
542
+ declare const WarpInputTypes: {
543
+ Option: string;
544
+ Vector: string;
545
+ Tuple: string;
546
+ Struct: string;
547
+ String: string;
548
+ Uint8: string;
549
+ Uint16: string;
550
+ Uint32: string;
551
+ Uint64: string;
552
+ Uint128: string;
553
+ Uint256: string;
554
+ Biguint: string;
555
+ Bool: string;
556
+ Address: string;
557
+ Asset: string;
558
+ Hex: string;
559
+ };
560
+ declare const safeWindow: Window;
561
+
562
+ interface CryptoProvider {
563
+ getRandomBytes(size: number): Promise<Uint8Array>;
564
+ }
565
+ declare class BrowserCryptoProvider implements CryptoProvider {
566
+ getRandomBytes(size: number): Promise<Uint8Array>;
567
+ }
568
+ declare class NodeCryptoProvider implements CryptoProvider {
569
+ getRandomBytes(size: number): Promise<Uint8Array>;
570
+ }
571
+ declare function getCryptoProvider(): CryptoProvider;
572
+ declare function setCryptoProvider(provider: CryptoProvider): void;
573
+ declare function getRandomBytes(size: number, cryptoProvider?: CryptoProvider): Promise<Uint8Array>;
574
+ declare function bytesToHex(bytes: Uint8Array): string;
575
+ declare function bytesToBase64(bytes: Uint8Array): string;
576
+ declare function getRandomHex(length: number, cryptoProvider?: CryptoProvider): Promise<string>;
577
+ declare function testCryptoAvailability(): Promise<{
578
+ randomBytes: boolean;
579
+ environment: 'browser' | 'nodejs' | 'unknown';
580
+ }>;
581
+ declare function createCryptoProvider(): CryptoProvider;
582
+
583
+ declare const extractWarpSecrets: (warp: Warp) => WarpSecret[];
393
584
 
394
- declare const getMainChainInfo: (config: WarpInitConfig) => WarpChainInfo;
395
- declare const getChainExplorerUrl: (chain: WarpChainInfo, path?: string) => string;
585
+ declare const findWarpAdapterForChain: (chain: WarpChain, adapters: Adapter[]) => Adapter;
586
+ declare const findWarpAdapterByPrefix: (prefix: string, adapters: Adapter[]) => Adapter;
396
587
  declare const getLatestProtocolIdentifier: (name: ProtocolName) => string;
397
588
  declare const getWarpActionByIndex: (warp: Warp, index: number) => WarpAction;
398
- declare const toTypedChainInfo: (chainInfo: any) => WarpChainInfo;
399
- declare const shiftBigintBy: (value: bigint | string, decimals: number) => bigint;
589
+ declare const getWarpPrimaryAction: (warp: Warp) => {
590
+ action: WarpAction;
591
+ index: number;
592
+ };
593
+ declare const isWarpActionAutoExecute: (action: WarpAction, warp: Warp) => boolean;
594
+ declare const shiftBigintBy: (value: bigint | string | number, decimals: number) => bigint;
400
595
  declare const toPreviewText: (text: string, maxChars?: number) => string;
401
596
  declare const replacePlaceholders: (message: string, bag: Record<string, any>) => string;
597
+ declare const applyResultsToMessages: (warp: Warp, results: Record<string, any>) => Record<string, string>;
402
598
 
403
- declare const option: (value: TypedValue | null, type?: Type) => OptionValue;
404
- declare const optional: (value: TypedValue | null, type?: Type) => OptionalValue;
405
- declare const list: (values: TypedValue[]) => List;
406
- declare const variadic: (values: TypedValue[]) => VariadicValue;
407
- declare const composite: (values: TypedValue[]) => CompositeValue;
408
- declare const string: (value: string) => StringValue;
409
- declare const u8: (value: number) => U8Value;
410
- declare const u16: (value: number) => U16Value;
411
- declare const u32: (value: number) => U32Value;
412
- declare const u64: (value: bigint) => U64Value;
413
- declare const biguint: (value: bigint | string | number) => BigUIntValue;
414
- declare const boolean: (value: boolean) => BooleanValue;
415
- declare const address: (value: string) => AddressValue;
416
- declare const token: (value: string) => TokenIdentifierValue;
417
- declare const hex: (value: string) => BytesValue;
418
- declare const esdt: (value: TokenTransfer) => Struct;
419
- declare const codemeta: (hexString: string) => CodeMetadataValue;
420
- declare const nothing: () => NothingValue;
421
-
422
- declare class WarpAbiBuilder {
423
- private config;
424
- private cache;
425
- constructor(config: WarpInitConfig);
426
- createInscriptionTransaction(abi: WarpAbiContents): Transaction;
427
- createFromRaw(encoded: string): Promise<WarpWarpAbi>;
428
- createFromTransaction(tx: TransactionOnNetwork): Promise<WarpWarpAbi>;
429
- createFromTransactionHash(hash: string, cache?: WarpCacheConfig): Promise<WarpWarpAbi | null>;
430
- }
599
+ declare const getWarpInfoFromIdentifier: (prefixedIdentifier: string) => {
600
+ chainPrefix: string;
601
+ type: WarpIdType;
602
+ identifier: string;
603
+ identifierBase: string;
604
+ } | null;
605
+ declare const extractIdentifierInfoFromUrl: (url: string) => {
606
+ chainPrefix: string;
607
+ type: WarpIdType;
608
+ identifier: string;
609
+ identifierBase: string;
610
+ } | null;
431
611
 
432
- type TxComponents = {
433
- destination: Address;
434
- args: string[];
435
- value: bigint;
436
- transfers: TokenTransfer$1[];
437
- data: Buffer | null;
438
- resolvedInputs: ResolvedInput[];
439
- };
440
- declare class WarpActionExecutor {
441
- private config;
442
- private url;
443
- private serializer;
444
- private contractLoader;
445
- private cache;
446
- constructor(config: WarpInitConfig);
447
- createTransactionForExecute(warp: Warp, actionIndex: number, inputs: string[]): Promise<Transaction>;
448
- getTransactionExecutionResults(warp: Warp, actionIndex: number, tx: TransactionOnNetwork): Promise<WarpExecution>;
449
- executeQuery(warp: Warp, actionIndex: number, inputs: string[]): Promise<WarpExecution>;
450
- executeCollect(warp: Warp, actionIndex: number, inputs: string[], extra?: Record<string, any>): Promise<WarpExecution>;
451
- getTxComponentsFromInputs(chain: WarpChainInfo, action: WarpTransferAction | WarpContractAction | WarpQueryAction, inputs: string[], sender?: Address): Promise<TxComponents>;
452
- getResolvedInputs(chain: WarpChainInfo, action: WarpAction, inputArgs: string[]): Promise<ResolvedInput[]>;
453
- getModifiedInputs(inputs: ResolvedInput[]): ResolvedInput[];
454
- preprocessInput(chain: WarpChainInfo, input: string): Promise<string>;
455
- getAbiForAction(action: WarpContractAction | WarpQueryAction): Promise<AbiRegistry>;
456
- private getPreparedArgs;
457
- private getPreparedMessages;
458
- private fetchAbi;
459
- private toTypedTransfer;
460
- }
612
+ /**
613
+ * Splits an input string into type and value, using only the first colon as separator.
614
+ * This handles cases where the value itself contains colons (like SUI token IDs).
615
+ */
616
+ declare const splitInput: (input: string) => [WarpActionInputType, string];
617
+ declare const hasInputPrefix: (input: string) => boolean;
618
+
619
+ declare const getNextInfo: (config: WarpClientConfig, adapters: Adapter[], warp: Warp, actionIndex: number, results: WarpExecutionResults) => WarpExecutionNextInfo | null;
620
+
621
+ /**
622
+ * Builds a nested payload object from a position string and field value.
623
+ * Position strings should be in format: "payload:path.to.nested.location"
624
+ *
625
+ * @param position - The position string defining where to place the value
626
+ * @param fieldName - The field name to use for the value
627
+ * @param value - The value to place at the position
628
+ * @returns A nested object structure or flat object if position doesn't start with 'payload:'
629
+ */
630
+ declare function buildNestedPayload(position: string, fieldName: string, value: any): any;
631
+ /**
632
+ * Recursively merges a source object into a target object and returns the merged result.
633
+ * Existing nested objects are merged recursively, primitive values are overwritten.
634
+ * Does not mutate the original target or source objects.
635
+ *
636
+ * @param target - The target object to merge into
637
+ * @param source - The source object to merge from
638
+ * @returns A new object with the merged result
639
+ */
640
+ declare function mergeNestedPayload(target: any, source: any): any;
461
641
 
462
- type WarpNativeValue = string | number | bigint | boolean | null | TokenTransfer | WarpNativeValue[];
463
- declare class WarpArgSerializer {
642
+ declare const getProviderUrl: (config: WarpClientConfig, chain: WarpChain, env: WarpChainEnv, defaultProvider: string) => string;
643
+ declare const getProviderConfig: (config: WarpClientConfig, chain: WarpChain) => WarpProviderConfig | undefined;
644
+
645
+ declare class WarpSerializer {
646
+ private readonly typeRegistry?;
647
+ constructor(options?: {
648
+ typeRegistry?: AdapterTypeRegistry;
649
+ });
464
650
  nativeToString(type: WarpActionInputType, value: WarpNativeValue): string;
465
- typedToString(value: TypedValue): string;
466
- typedToNative(value: TypedValue): [WarpActionInputType, WarpNativeValue];
467
- nativeToTyped(type: WarpActionInputType, value: WarpNativeValue): TypedValue;
468
- nativeToType(type: BaseWarpActionInputType): Type;
469
651
  stringToNative(value: string): [WarpActionInputType, WarpNativeValue];
470
- stringToTyped(value: string): TypedValue;
471
- typeToString(type: Type): WarpActionInputType;
652
+ private getTypeAndValue;
472
653
  }
473
654
 
474
- declare class WarpBuilder {
655
+ declare const extractCollectResults: (warp: Warp, response: any, actionIndex: number, inputs: ResolvedInput[], serializer: WarpSerializer, transformRunner?: TransformRunner | null) => Promise<{
656
+ values: {
657
+ string: string[];
658
+ native: any[];
659
+ };
660
+ results: WarpExecutionResults;
661
+ }>;
662
+ declare const evaluateResultsCommon: (warp: Warp, baseResults: WarpExecutionResults, actionIndex: number, inputs: ResolvedInput[], serializer: WarpSerializer, transformRunner?: TransformRunner | null) => Promise<WarpExecutionResults>;
663
+ /**
664
+ * Parses out[N] notation and returns the action index (1-based) or null if invalid.
665
+ * Also handles plain "out" which defaults to action index 1.
666
+ */
667
+ declare const parseResultsOutIndex: (resultPath: string) => number | null;
668
+
669
+ /**
670
+ * Signing utilities for creating and validating signed messages
671
+ * Works with any crypto provider or uses automatic detection
672
+ */
673
+
674
+ interface SignableMessage {
675
+ wallet: string;
676
+ nonce: string;
677
+ expiresAt: string;
678
+ purpose: string;
679
+ }
680
+ type HttpAuthHeaders = Record<string, string> & {
681
+ 'X-Signer-Wallet': string;
682
+ 'X-Signer-Signature': string;
683
+ 'X-Signer-Nonce': string;
684
+ 'X-Signer-ExpiresAt': string;
685
+ };
686
+ /**
687
+ * Creates a signable message with standard security fields
688
+ * This can be used for any type of proof or authentication
689
+ */
690
+ declare function createSignableMessage(walletAddress: string, purpose: string, cryptoProvider?: CryptoProvider, expiresInMinutes?: number): Promise<{
691
+ message: string;
692
+ nonce: string;
693
+ expiresAt: string;
694
+ }>;
695
+ /**
696
+ * Creates a signable message for HTTP authentication
697
+ * This is a convenience function that uses the standard format
698
+ */
699
+ declare function createAuthMessage(walletAddress: string, appName: string, cryptoProvider?: CryptoProvider, purpose?: string): Promise<{
700
+ message: string;
701
+ nonce: string;
702
+ expiresAt: string;
703
+ }>;
704
+ /**
705
+ * Creates HTTP authentication headers from a signature
706
+ */
707
+ declare function createAuthHeaders(walletAddress: string, signature: string, nonce: string, expiresAt: string): HttpAuthHeaders;
708
+ /**
709
+ * Creates HTTP authentication headers for a wallet using the provided signing function
710
+ */
711
+ declare function createHttpAuthHeaders(walletAddress: string, signMessage: (message: string) => Promise<string>, appName: string, cryptoProvider?: CryptoProvider): Promise<HttpAuthHeaders>;
712
+ /**
713
+ * Validates a signed message by checking expiration
714
+ */
715
+ declare function validateSignedMessage(expiresAt: string): boolean;
716
+ /**
717
+ * Parses a signed message to extract its components
718
+ */
719
+ declare function parseSignedMessage(message: string): SignableMessage;
720
+
721
+ declare const getWarpWalletAddress: (wallet: WarpWalletDetails | string | null | undefined) => string | null;
722
+ declare const getWarpWalletAddressFromConfig: (config: WarpClientConfig, chain: WarpChain) => string | null;
723
+ declare const getWarpWalletPrivateKey: (wallet: WarpWalletDetails | string | null | undefined) => string | null | undefined;
724
+ declare const getWarpWalletMnemonic: (wallet: WarpWalletDetails | string | null | undefined) => string | null | undefined;
725
+ declare const getWarpWalletPrivateKeyFromConfig: (config: WarpClientConfig, chain: WarpChain) => string | null;
726
+ declare const getWarpWalletMnemonicFromConfig: (config: WarpClientConfig, chain: WarpChain) => string | null;
727
+
728
+ type CodecFunc<T extends WarpNativeValue = WarpNativeValue> = (value: T) => string;
729
+ declare const string: CodecFunc<string>;
730
+ declare const uint8: CodecFunc<number>;
731
+ declare const uint16: CodecFunc<number>;
732
+ declare const uint32: CodecFunc<number>;
733
+ declare const uint64: CodecFunc<bigint | number>;
734
+ declare const biguint: CodecFunc<bigint | string | number>;
735
+ declare const bool: CodecFunc<boolean>;
736
+ declare const address: CodecFunc<string>;
737
+ declare const asset: CodecFunc<WarpChainAssetValue & {
738
+ decimals?: number;
739
+ }>;
740
+ declare const hex: CodecFunc<string>;
741
+ declare const option: <T extends WarpNativeValue>(codecFunc: CodecFunc<T>, value: T | null) => string;
742
+ declare const tuple: (...values: WarpNativeValue[]) => string;
743
+ declare const struct: CodecFunc<WarpStructValue>;
744
+ declare const vector: CodecFunc<WarpNativeValue[]>;
745
+
746
+ declare class WarpBrandBuilder {
475
747
  private config;
476
- private cache;
748
+ private pendingBrand;
749
+ constructor(config: WarpClientConfig);
750
+ createFromRaw(encoded: string, validateSchema?: boolean): Promise<WarpBrand>;
751
+ setName(name: string): WarpBrandBuilder;
752
+ setDescription(description: string): WarpBrandBuilder;
753
+ setLogo(logo: string): WarpBrandBuilder;
754
+ setUrls(urls: WarpBrandUrls): WarpBrandBuilder;
755
+ setColors(colors: WarpBrandColors): WarpBrandBuilder;
756
+ setCta(cta: WarpBrandCta): WarpBrandBuilder;
757
+ build(): Promise<WarpBrand>;
758
+ private ensure;
759
+ private ensureValidSchema;
760
+ }
761
+
762
+ declare class WarpBuilder implements BaseWarpBuilder {
763
+ protected readonly config: WarpClientConfig;
477
764
  private pendingWarp;
478
- constructor(config: WarpInitConfig);
479
- createInscriptionTransaction(warp: Warp): Transaction;
765
+ constructor(config: WarpClientConfig);
480
766
  createFromRaw(encoded: string, validate?: boolean): Promise<Warp>;
481
- createFromTransaction(tx: TransactionOnNetwork, validate?: boolean): Promise<Warp>;
482
- createFromTransactionHash(hash: string, cache?: WarpCacheConfig): Promise<Warp | null>;
767
+ createFromUrl(url: string): Promise<Warp>;
768
+ setChain(chain: WarpChain): WarpBuilder;
483
769
  setName(name: string): WarpBuilder;
484
770
  setTitle(title: string): WarpBuilder;
485
771
  setDescription(description: string): WarpBuilder;
@@ -492,25 +778,119 @@ declare class WarpBuilder {
492
778
  private validate;
493
779
  }
494
780
 
495
- declare class WarpContractLoader {
496
- private readonly config;
497
- constructor(config: WarpInitConfig);
498
- getContract(address: string, chain: WarpChainInfo): Promise<WarpContract | null>;
499
- getVerificationInfo(address: string, chain: WarpChainInfo): Promise<WarpContractVerification | null>;
781
+ declare const CacheTtl: {
782
+ OneMinute: number;
783
+ OneHour: number;
784
+ OneDay: number;
785
+ OneWeek: number;
786
+ OneMonth: number;
787
+ OneYear: number;
788
+ };
789
+ declare const WarpCacheKey: {
790
+ Warp: (env: WarpChainEnv, id: string) => string;
791
+ WarpAbi: (env: WarpChainEnv, id: string) => string;
792
+ WarpExecutable: (env: WarpChainEnv, id: string, action: number) => string;
793
+ RegistryInfo: (env: WarpChainEnv, id: string) => string;
794
+ Brand: (env: WarpChainEnv, hash: string) => string;
795
+ Asset: (env: WarpChainEnv, chain: string, identifier: string) => string;
796
+ };
797
+ declare class WarpCache {
798
+ private strategy;
799
+ constructor(type?: WarpCacheType);
800
+ private selectStrategy;
801
+ set<T>(key: string, value: T, ttl: number): void;
802
+ get<T>(key: string): T | null;
803
+ forget(key: string): void;
804
+ clear(): void;
805
+ }
806
+
807
+ type ExecutionHandlers = {
808
+ onExecuted?: (result: WarpActionExecution) => void | Promise<void>;
809
+ onError?: (params: {
810
+ message: string;
811
+ }) => void;
812
+ onSignRequest?: (params: {
813
+ message: string;
814
+ chain: WarpChainInfo;
815
+ }) => string | Promise<string>;
816
+ onActionExecuted?: (params: {
817
+ action: WarpActionIndex;
818
+ chain: WarpChainInfo | null;
819
+ execution: WarpActionExecution | null;
820
+ tx: WarpAdapterGenericTransaction | null;
821
+ }) => void;
822
+ };
823
+ declare class WarpExecutor {
824
+ private config;
825
+ private adapters;
826
+ private handlers?;
827
+ private factory;
828
+ constructor(config: WarpClientConfig, adapters: Adapter[], handlers?: ExecutionHandlers | undefined);
829
+ execute(warp: Warp, inputs: string[], meta?: {
830
+ envs?: Record<string, any>;
831
+ queries?: Record<string, any>;
832
+ }): Promise<{
833
+ txs: WarpAdapterGenericTransaction[];
834
+ chain: WarpChainInfo | null;
835
+ immediateExecutions: WarpActionExecution[];
836
+ }>;
837
+ executeAction(warp: Warp, actionIndex: WarpActionIndex, inputs: string[], meta?: {
838
+ envs?: Record<string, any>;
839
+ queries?: Record<string, any>;
840
+ }): Promise<{
841
+ tx: WarpAdapterGenericTransaction | null;
842
+ chain: WarpChainInfo | null;
843
+ immediateExecution: WarpActionExecution | null;
844
+ }>;
845
+ evaluateResults(warp: Warp, actions: WarpChainAction[]): Promise<void>;
846
+ private executeCollect;
847
+ private callHandler;
848
+ }
849
+
850
+ declare class WarpFactory {
851
+ private config;
852
+ private adapters;
853
+ private url;
854
+ private serializer;
855
+ private cache;
856
+ constructor(config: WarpClientConfig, adapters: Adapter[]);
857
+ getSerializer(): WarpSerializer;
858
+ createExecutable(warp: Warp, actionIndex: number, inputs: string[], meta?: {
859
+ envs?: Record<string, any>;
860
+ queries?: Record<string, any>;
861
+ }): Promise<WarpExecutable>;
862
+ getChainInfoForWarp(warp: Warp, inputs?: string[]): Promise<WarpChainInfo>;
863
+ getResolvedInputs(chain: WarpChain, action: WarpAction, inputArgs: string[]): Promise<ResolvedInput[]>;
864
+ getModifiedInputs(inputs: ResolvedInput[]): ResolvedInput[];
865
+ preprocessInput(chain: WarpChain, input: string): Promise<string>;
866
+ private getDestinationFromAction;
867
+ private getPreparedArgs;
868
+ private tryGetChainFromInputs;
500
869
  }
501
870
 
502
871
  declare class WarpIndex {
503
872
  private config;
504
- constructor(config: WarpInitConfig);
873
+ constructor(config: WarpClientConfig);
505
874
  search(query: string, params?: Record<string, any>, headers?: Record<string, string>): Promise<WarpSearchHit[]>;
506
875
  }
507
876
 
877
+ declare class WarpLinkBuilder {
878
+ private readonly config;
879
+ private readonly adapters;
880
+ constructor(config: WarpClientConfig, adapters: Adapter[]);
881
+ isValid(url: string): boolean;
882
+ build(chain: WarpChain, type: WarpIdType, id: string): string;
883
+ buildFromPrefixedIdentifier(identifier: string): string | null;
884
+ generateQrCode(chain: WarpChain, type: WarpIdType, id: string, size?: number, background?: string, color?: string, logoColor?: string): QRCodeStyling;
885
+ }
886
+
508
887
  type DetectionResult = {
509
888
  match: boolean;
510
889
  url: string;
511
890
  warp: Warp | null;
891
+ chain: WarpChain | null;
512
892
  registryInfo: WarpRegistryInfo | null;
513
- brand: Brand | null;
893
+ brand: WarpBrand | null;
514
894
  };
515
895
  type DetectionResultFromHtml = {
516
896
  match: boolean;
@@ -519,63 +899,87 @@ type DetectionResultFromHtml = {
519
899
  warp: Warp;
520
900
  }[];
521
901
  };
522
- declare class WarpLink {
902
+ declare class WarpLinkDetecter {
523
903
  private config;
524
- constructor(config: WarpInitConfig);
904
+ private adapters;
905
+ constructor(config: WarpClientConfig, adapters: Adapter[]);
525
906
  isValid(url: string): boolean;
526
907
  detectFromHtml(content: string): Promise<DetectionResultFromHtml>;
527
908
  detect(url: string, cache?: WarpCacheConfig): Promise<DetectionResult>;
528
- build(type: WarpIdType, id: string): string;
529
- buildFromPrefixedIdentifier(prefixedIdentifier: string): string;
530
- generateQrCode(type: WarpIdType, id: string, size?: number, background?: string, color?: string, logoColor?: string): QRCodeStyling;
531
- private extractIdentifierInfoFromUrl;
532
909
  }
533
910
 
534
- declare class WarpRegistry {
535
- private config;
536
- private cache;
537
- registryConfig: WarpRegistryConfigInfo;
538
- constructor(config: WarpInitConfig);
539
- init(): Promise<void>;
540
- createWarpRegisterTransaction(txHash: string, alias?: string | null, brand?: string | null): Transaction$1;
541
- createWarpUnregisterTransaction(txHash: string): Transaction$1;
542
- createWarpUpgradeTransaction(alias: string, txHash: string): Transaction$1;
543
- createWarpAliasSetTransaction(txHash: string, alias: string): Transaction$1;
544
- createWarpVerifyTransaction(txHash: string): Transaction$1;
545
- createWarpTransferOwnershipTransaction(txHash: string, newOwner: string): Transaction$1;
546
- createBrandRegisterTransaction(txHash: string): Transaction$1;
547
- createWarpBrandingTransaction(warpHash: string, brandHash: string): Transaction$1;
548
- getInfoByAlias(alias: string, cache?: WarpCacheConfig): Promise<{
549
- registryInfo: WarpRegistryInfo | null;
550
- brand: Brand | null;
551
- }>;
552
- getInfoByHash(hash: string, cache?: WarpCacheConfig): Promise<{
553
- registryInfo: WarpRegistryInfo | null;
554
- brand: Brand | null;
911
+ declare class WarpClient {
912
+ private readonly config;
913
+ private adapters;
914
+ constructor(config: WarpClientConfig, adapters: Adapter[]);
915
+ getConfig(): WarpClientConfig;
916
+ getAdapters(): Adapter[];
917
+ addAdapter(adapter: Adapter): WarpClient;
918
+ createExecutor(handlers?: ExecutionHandlers): WarpExecutor;
919
+ detectWarp(urlOrId: string, cache?: WarpCacheConfig): Promise<DetectionResult>;
920
+ executeWarp(warpOrIdentifierOrUrl: string | Warp, inputs: string[], handlers?: ExecutionHandlers, params?: {
921
+ cache?: WarpCacheConfig;
922
+ queries?: Record<string, any>;
923
+ }): Promise<{
924
+ txs: WarpAdapterGenericTransaction[];
925
+ chain: WarpChainInfo | null;
926
+ immediateExecutions: WarpActionExecution[];
927
+ evaluateResults: (remoteTxs: WarpAdapterGenericRemoteTransaction[]) => Promise<void>;
555
928
  }>;
556
- getUserWarpRegistryInfos(user?: string): Promise<WarpRegistryInfo[]>;
557
- getUserBrands(user?: string): Promise<Brand[]>;
558
- getChainInfos(cache?: WarpCacheConfig): Promise<WarpChainInfo[]>;
559
- getChainInfo(chain: WarpChain, cache?: WarpCacheConfig): Promise<WarpChainInfo | null>;
560
- fetchBrand(hash: string, cache?: WarpCacheConfig): Promise<Brand | null>;
561
- getRegistryContractAddress(): Address$1;
562
- private loadRegistryConfigs;
563
- private getFactory;
564
- private getController;
565
- private isCurrentUserAdmin;
566
- }
567
-
568
- declare class WarpUtils {
569
- static getInfoFromPrefixedIdentifier(prefixedIdentifier: string): {
570
- type: WarpIdType;
571
- identifier: string;
572
- identifierBase: string;
573
- } | null;
574
- static getNextInfo(config: WarpInitConfig, warp: Warp, actionIndex: number, results: WarpExecutionResults): WarpExecutionNextInfo | null;
575
- private static buildNextUrl;
576
- private static getNestedValue;
577
- static getChainInfoForAction(config: WarpInitConfig, action: WarpAction): Promise<WarpChainInfo>;
578
- static getChainEntrypoint(chainInfo: WarpChainInfo, env: WarpChainEnv): NetworkEntrypoint;
929
+ createInscriptionTransaction(chain: WarpChain, warp: Warp): WarpAdapterGenericTransaction;
930
+ createFromTransaction(chain: WarpChain, tx: WarpAdapterGenericRemoteTransaction, validate?: boolean): Promise<Warp>;
931
+ createFromTransactionHash(hash: string, cache?: WarpCacheConfig): Promise<Warp | null>;
932
+ signMessage(chain: WarpChain, message: string): Promise<string>;
933
+ getActions(chain: WarpChain, ids: string[], awaitCompleted?: boolean): Promise<WarpChainAction[]>;
934
+ getExplorer(chain: WarpChain): AdapterWarpExplorer;
935
+ getResults(chain: WarpChain): AdapterWarpResults;
936
+ getRegistry(chain: WarpChain): Promise<AdapterWarpRegistry>;
937
+ getDataLoader(chain: WarpChain): AdapterWarpDataLoader;
938
+ getWallet(chain: WarpChain): AdapterWarpWallet;
939
+ get factory(): WarpFactory;
940
+ get index(): WarpIndex;
941
+ get linkBuilder(): WarpLinkBuilder;
942
+ createBuilder(chain: WarpChain): CombinedWarpBuilder;
943
+ createAbiBuilder(chain: WarpChain): AdapterWarpAbiBuilder;
944
+ createBrandBuilder(chain: WarpChain): AdapterWarpBrandBuilder;
945
+ createSerializer(chain: WarpChain): AdapterWarpSerializer;
946
+ }
947
+
948
+ declare class WarpInterpolator {
949
+ private config;
950
+ private adapter;
951
+ constructor(config: WarpClientConfig, adapter: Adapter);
952
+ apply(config: WarpClientConfig, warp: Warp, meta?: {
953
+ envs?: Record<string, any>;
954
+ queries?: Record<string, any>;
955
+ }): Promise<Warp>;
956
+ applyGlobals(config: WarpClientConfig, warp: Warp): Promise<Warp>;
957
+ applyVars(config: WarpClientConfig, warp: Warp, meta?: {
958
+ envs?: Record<string, any>;
959
+ queries?: Record<string, any>;
960
+ }): Warp;
961
+ private applyRootGlobals;
962
+ private applyActionGlobals;
963
+ }
964
+
965
+ declare class WarpLogger {
966
+ private static isTestEnv;
967
+ static debug(...args: any[]): void;
968
+ static info(...args: any[]): void;
969
+ static warn(...args: any[]): void;
970
+ static error(...args: any[]): void;
971
+ }
972
+
973
+ declare class WarpTypeRegistry implements AdapterTypeRegistry {
974
+ private typeHandlers;
975
+ private typeAliases;
976
+ registerType(typeName: string, handler: WarpTypeHandler): void;
977
+ registerTypeAlias(typeName: string, alias: string): void;
978
+ hasType(typeName: string): boolean;
979
+ getHandler(typeName: string): WarpTypeHandler | undefined;
980
+ getAlias(typeName: string): string | undefined;
981
+ resolveType(typeName: string): string;
982
+ getRegisteredTypes(): string[];
579
983
  }
580
984
 
581
985
  type ValidationResult = {
@@ -585,12 +989,13 @@ type ValidationResult = {
585
989
  type ValidationError = string;
586
990
  declare class WarpValidator {
587
991
  private config;
588
- constructor(config: WarpInitConfig);
992
+ constructor(config: WarpClientConfig);
589
993
  validate(warp: Warp): Promise<ValidationResult>;
994
+ private validatePrimaryAction;
590
995
  private validateMaxOneValuePosition;
591
996
  private validateVariableNamesAndResultNamesUppercase;
592
997
  private validateAbiIsSetIfApplicable;
593
998
  private validateSchema;
594
999
  }
595
1000
 
596
- export { type BaseWarpActionInputType, type Brand, BrandBuilder, type BrandColors, type BrandCta, type BrandMeta, type BrandUrls, CacheKey, CacheTtl, type CacheType, type InterpolationBag, type ProtocolName, type ResolvedInput, type Warp, WarpAbiBuilder, type WarpAbiContents, type WarpAction, WarpActionExecutor, type WarpActionInput, type WarpActionInputModifier, type WarpActionInputPosition, type WarpActionInputSource, type WarpActionInputType, type WarpActionType, WarpArgSerializer, WarpBuilder, WarpCache, type WarpCacheConfig, type WarpChain, type WarpChainEnv, type WarpChainInfo, type WarpCollectAction, WarpConfig, WarpConstants, type WarpContract, type WarpContractAction, type WarpContractActionTransfer, WarpContractLoader, type WarpContractVerification, type WarpExecution, type WarpExecutionMessages, type WarpExecutionNextInfo, type WarpExecutionResults, type WarpIdType, WarpIndex, type WarpInitConfig, WarpInterpolator, WarpLink, type WarpLinkAction, type WarpMessageName, type WarpMeta, type WarpNativeValue, WarpProtocolVersions, type WarpQueryAction, WarpRegistry, type WarpRegistryConfigInfo, type WarpRegistryInfo, type WarpResultName, type WarpResulutionPath, type WarpSearchHit, type WarpSearchResult, type WarpTransferAction, type WarpTrustStatus, WarpUtils, WarpValidator, type WarpVarPlaceholder, type WarpWarpAbi, address, biguint, boolean, codemeta, composite, esdt, getChainExplorerUrl, getLatestProtocolIdentifier, getMainChainInfo, getWarpActionByIndex, hex, list, nothing, option, optional, replacePlaceholders, shiftBigintBy, string, toPreviewText, toTypedChainInfo, token, u16, u32, u64, u8, variadic };
1001
+ export { type Adapter, type AdapterFactory, type AdapterTypeRegistry, type AdapterWarpAbiBuilder, type AdapterWarpBrandBuilder, type AdapterWarpBuilder, type AdapterWarpDataLoader, type AdapterWarpExecutor, type AdapterWarpExplorer, type AdapterWarpRegistry, type AdapterWarpResults, 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, type Warp, type WarpAbi, type WarpAbiContents, type WarpAction, type WarpActionExecution, type WarpActionIndex, type WarpActionInput, type WarpActionInputModifier, type WarpActionInputPosition, type WarpActionInputSource, type WarpActionInputType, type WarpActionType, type WarpAdapterGenericRemoteTransaction, type WarpAdapterGenericTransaction, type WarpAdapterGenericType, type WarpAdapterGenericValue, type WarpBrand, WarpBrandBuilder, type WarpBrandColors, type WarpBrandCta, 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, WarpConfig, WarpConstants, type WarpContract, type WarpContractAction, type WarpContractVerification, type WarpDataLoaderOptions, type WarpExecutable, type WarpExecutionMessages, type WarpExecutionNextInfo, type WarpExecutionResults, WarpExecutor, type WarpExplorerName, WarpFactory, type WarpIdType, WarpIndex, WarpInputTypes, WarpInterpolator, type WarpLinkAction, WarpLinkBuilder, WarpLinkDetecter, WarpLogger, type WarpMessageName, type WarpMeta, type WarpNativeValue, WarpProtocolVersions, type WarpProviderConfig, type WarpQueryAction, type WarpRegistryConfigInfo, type WarpRegistryInfo, type WarpResultName, type WarpResulutionPath, type WarpSearchHit, type WarpSearchResult, type WarpSecret, WarpSerializer, type WarpStructValue, type WarpTransferAction, type WarpTrustStatus, type WarpTypeHandler, WarpTypeRegistry, type WarpUserWallets, WarpValidator, type WarpVarPlaceholder, type WarpWalletDetails, address, applyResultsToMessages, asset, biguint, bool, buildNestedPayload, bytesToBase64, bytesToHex, createAuthHeaders, createAuthMessage, createCryptoProvider, createHttpAuthHeaders, createSignableMessage, evaluateResultsCommon, extractCollectResults, extractIdentifierInfoFromUrl, extractWarpSecrets, findWarpAdapterByPrefix, findWarpAdapterForChain, getCryptoProvider, getLatestProtocolIdentifier, getNextInfo, getProviderConfig, getProviderUrl, getRandomBytes, getRandomHex, getWarpActionByIndex, getWarpInfoFromIdentifier, getWarpPrimaryAction, getWarpWalletAddress, getWarpWalletAddressFromConfig, getWarpWalletMnemonic, getWarpWalletMnemonicFromConfig, getWarpWalletPrivateKey, getWarpWalletPrivateKeyFromConfig, hasInputPrefix, hex, isWarpActionAutoExecute, mergeNestedPayload, option, parseResultsOutIndex, parseSignedMessage, replacePlaceholders, safeWindow, setCryptoProvider, shiftBigintBy, splitInput, string, struct, testCryptoAvailability, toPreviewText, tuple, uint16, uint32, uint64, uint8, validateSignedMessage, vector };