@vleap/warps 3.0.0-alpha.9 → 3.0.0-alpha.90
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 +867 -0
- package/dist/index.d.ts +553 -282
- package/dist/index.js +2 -12
- package/dist/index.mjs +2 -2
- package/package.json +19 -16
- package/dist/chunk-3SAEGOMQ.mjs +0 -1
- package/dist/index.d.mts +0 -596
- package/dist/vm-JCVDACTR.mjs +0 -11
package/dist/index.d.ts
CHANGED
|
@@ -1,75 +1,44 @@
|
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
OneWeek: number;
|
|
10
|
-
OneMonth: number;
|
|
11
|
-
OneYear: number;
|
|
3
|
+
type WarpChainAccount = {
|
|
4
|
+
chain: WarpChain;
|
|
5
|
+
address: string;
|
|
6
|
+
balance: bigint;
|
|
12
7
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
LastWarpExecutionInputs: (id: string, action: number) => string;
|
|
17
|
-
RegistryInfo: (id: string) => string;
|
|
18
|
-
Brand: (hash: string) => string;
|
|
19
|
-
ChainInfo: (chain: WarpChain) => string;
|
|
20
|
-
ChainInfos: () => string;
|
|
8
|
+
type WarpChainAssetValue = {
|
|
9
|
+
identifier: string;
|
|
10
|
+
amount: bigint;
|
|
21
11
|
};
|
|
22
|
-
type
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
12
|
+
type WarpChainAsset = {
|
|
13
|
+
chain: WarpChain;
|
|
14
|
+
identifier: string;
|
|
15
|
+
name: string;
|
|
16
|
+
amount?: bigint;
|
|
17
|
+
decimals?: number;
|
|
18
|
+
logoUrl?: string;
|
|
19
|
+
};
|
|
20
|
+
type WarpChainAction = {
|
|
21
|
+
chain: WarpChain;
|
|
22
|
+
id: string;
|
|
23
|
+
sender: string;
|
|
24
|
+
receiver: string;
|
|
25
|
+
value: bigint;
|
|
26
|
+
function: string;
|
|
27
|
+
status: WarpChainActionStatus;
|
|
28
|
+
createdAt: string;
|
|
29
|
+
};
|
|
30
|
+
type WarpChainActionStatus = 'pending' | 'success' | 'failed';
|
|
35
31
|
|
|
36
32
|
type WarpChain = string;
|
|
37
|
-
type
|
|
38
|
-
env: WarpChainEnv;
|
|
39
|
-
clientUrl?: string;
|
|
40
|
-
currentUrl?: string;
|
|
41
|
-
vars?: Record<string, string | number>;
|
|
42
|
-
user?: {
|
|
43
|
-
wallet?: string;
|
|
44
|
-
};
|
|
45
|
-
schema?: {
|
|
46
|
-
warp?: string;
|
|
47
|
-
brand?: string;
|
|
48
|
-
};
|
|
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;
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
type WarpCacheConfig = {
|
|
63
|
-
ttl?: number;
|
|
64
|
-
};
|
|
33
|
+
type WarpExplorerName = string;
|
|
65
34
|
type WarpChainInfo = {
|
|
66
|
-
name:
|
|
35
|
+
name: string;
|
|
67
36
|
displayName: string;
|
|
68
37
|
chainId: string;
|
|
69
38
|
blockTime: number;
|
|
70
39
|
addressHrp: string;
|
|
71
|
-
|
|
72
|
-
|
|
40
|
+
defaultApiUrl: string;
|
|
41
|
+
nativeToken: WarpChainAsset;
|
|
73
42
|
};
|
|
74
43
|
type WarpIdType = 'hash' | 'alias';
|
|
75
44
|
type WarpVarPlaceholder = string;
|
|
@@ -91,11 +60,13 @@ type Warp = {
|
|
|
91
60
|
meta?: WarpMeta;
|
|
92
61
|
};
|
|
93
62
|
type WarpMeta = {
|
|
63
|
+
chain: WarpChain;
|
|
94
64
|
hash: string;
|
|
95
65
|
creator: string;
|
|
96
66
|
createdAt: string;
|
|
97
67
|
};
|
|
98
68
|
type WarpAction = WarpTransferAction | WarpContractAction | WarpQueryAction | WarpCollectAction | WarpLinkAction;
|
|
69
|
+
type WarpActionIndex = number;
|
|
99
70
|
type WarpActionType = 'transfer' | 'contract' | 'query' | 'collect' | 'link';
|
|
100
71
|
type WarpTransferAction = {
|
|
101
72
|
type: WarpActionType;
|
|
@@ -105,7 +76,7 @@ type WarpTransferAction = {
|
|
|
105
76
|
address?: string;
|
|
106
77
|
data?: string;
|
|
107
78
|
value?: string;
|
|
108
|
-
transfers?:
|
|
79
|
+
transfers?: string[];
|
|
109
80
|
inputs?: WarpActionInput[];
|
|
110
81
|
next?: string;
|
|
111
82
|
};
|
|
@@ -114,29 +85,24 @@ type WarpContractAction = {
|
|
|
114
85
|
chain?: WarpChain;
|
|
115
86
|
label: string;
|
|
116
87
|
description?: string | null;
|
|
117
|
-
address
|
|
118
|
-
func
|
|
119
|
-
args
|
|
88
|
+
address?: string;
|
|
89
|
+
func?: string | null;
|
|
90
|
+
args?: string[];
|
|
120
91
|
value?: string;
|
|
121
92
|
gasLimit: number;
|
|
122
|
-
transfers?:
|
|
93
|
+
transfers?: string[];
|
|
123
94
|
abi?: string;
|
|
124
95
|
inputs?: WarpActionInput[];
|
|
125
96
|
next?: string;
|
|
126
97
|
};
|
|
127
|
-
type WarpContractActionTransfer = {
|
|
128
|
-
token: string;
|
|
129
|
-
nonce?: number;
|
|
130
|
-
amount?: string;
|
|
131
|
-
};
|
|
132
98
|
type WarpQueryAction = {
|
|
133
99
|
type: WarpActionType;
|
|
134
100
|
chain?: WarpChain;
|
|
135
101
|
label: string;
|
|
136
102
|
description?: string | null;
|
|
137
|
-
address
|
|
138
|
-
func
|
|
139
|
-
args
|
|
103
|
+
address?: string;
|
|
104
|
+
func?: string;
|
|
105
|
+
args?: string[];
|
|
140
106
|
abi?: string;
|
|
141
107
|
inputs?: WarpActionInput[];
|
|
142
108
|
next?: string;
|
|
@@ -163,9 +129,10 @@ type WarpLinkAction = {
|
|
|
163
129
|
inputs?: WarpActionInput[];
|
|
164
130
|
};
|
|
165
131
|
type WarpActionInputSource = 'field' | 'query' | 'user:wallet';
|
|
166
|
-
type BaseWarpActionInputType = 'string' | 'uint8' | 'uint16' | 'uint32' | 'uint64' | '
|
|
132
|
+
type BaseWarpActionInputType = 'string' | 'uint8' | 'uint16' | 'uint32' | 'uint64' | 'uint128' | 'uint256' | 'biguint' | 'bool' | 'address' | 'hex' | string;
|
|
167
133
|
type WarpActionInputType = string;
|
|
168
|
-
type
|
|
134
|
+
type WarpNativeValue = string | number | bigint | boolean | WarpChainAssetValue | null | WarpNativeValue[];
|
|
135
|
+
type WarpActionInputPosition = 'receiver' | 'value' | 'transfer' | `arg:${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10}` | 'data' | 'chain';
|
|
169
136
|
type WarpActionInputModifier = 'scale';
|
|
170
137
|
type WarpActionInput = {
|
|
171
138
|
name: string;
|
|
@@ -184,6 +151,7 @@ type WarpActionInput = {
|
|
|
184
151
|
[key: string]: string;
|
|
185
152
|
};
|
|
186
153
|
modifier?: string;
|
|
154
|
+
default?: string | number | boolean;
|
|
187
155
|
};
|
|
188
156
|
type ResolvedInput = {
|
|
189
157
|
input: WarpActionInput;
|
|
@@ -198,8 +166,19 @@ type WarpContractVerification = {
|
|
|
198
166
|
codeHash: string;
|
|
199
167
|
abi: object;
|
|
200
168
|
};
|
|
169
|
+
type WarpExecutable = {
|
|
170
|
+
chain: WarpChainInfo;
|
|
171
|
+
warp: Warp;
|
|
172
|
+
action: number;
|
|
173
|
+
destination: string;
|
|
174
|
+
args: string[];
|
|
175
|
+
value: bigint;
|
|
176
|
+
transfers: WarpChainAssetValue[];
|
|
177
|
+
data: string | null;
|
|
178
|
+
resolvedInputs: ResolvedInput[];
|
|
179
|
+
};
|
|
201
180
|
|
|
202
|
-
type
|
|
181
|
+
type WarpAbi = {
|
|
203
182
|
protocol: string;
|
|
204
183
|
content: WarpAbiContents;
|
|
205
184
|
meta?: WarpMeta;
|
|
@@ -213,35 +192,44 @@ type WarpAbiContents = {
|
|
|
213
192
|
events?: any[];
|
|
214
193
|
};
|
|
215
194
|
|
|
216
|
-
type
|
|
195
|
+
type WarpBrand = {
|
|
217
196
|
protocol: string;
|
|
218
197
|
name: string;
|
|
219
198
|
description: string;
|
|
220
199
|
logo: string;
|
|
221
|
-
urls?:
|
|
222
|
-
colors?:
|
|
223
|
-
cta?:
|
|
224
|
-
meta?:
|
|
200
|
+
urls?: WarpBrandUrls;
|
|
201
|
+
colors?: WarpBrandColors;
|
|
202
|
+
cta?: WarpBrandCta;
|
|
203
|
+
meta?: WarpBrandMeta;
|
|
225
204
|
};
|
|
226
|
-
type
|
|
205
|
+
type WarpBrandUrls = {
|
|
227
206
|
web?: string;
|
|
228
207
|
};
|
|
229
|
-
type
|
|
208
|
+
type WarpBrandColors = {
|
|
230
209
|
primary?: string;
|
|
231
210
|
secondary?: string;
|
|
232
211
|
};
|
|
233
|
-
type
|
|
212
|
+
type WarpBrandCta = {
|
|
234
213
|
title: string;
|
|
235
214
|
description: string;
|
|
236
215
|
label: string;
|
|
237
216
|
url: string;
|
|
238
217
|
};
|
|
239
|
-
type
|
|
218
|
+
type WarpBrandMeta = {
|
|
240
219
|
hash: string;
|
|
241
220
|
creator: string;
|
|
242
221
|
createdAt: string;
|
|
243
222
|
};
|
|
244
223
|
|
|
224
|
+
type ClientCacheConfig = {
|
|
225
|
+
ttl?: number;
|
|
226
|
+
type?: WarpCacheType;
|
|
227
|
+
};
|
|
228
|
+
type WarpCacheType = 'memory' | 'localStorage';
|
|
229
|
+
|
|
230
|
+
type WarpChainEnv = 'mainnet' | 'testnet' | 'devnet';
|
|
231
|
+
type ProtocolName = 'warp' | 'brand' | 'abi';
|
|
232
|
+
|
|
245
233
|
type WarpTrustStatus = 'unverified' | 'verified' | 'blacklisted';
|
|
246
234
|
type WarpRegistryInfo = {
|
|
247
235
|
hash: string;
|
|
@@ -264,8 +252,10 @@ type WarpExecution = {
|
|
|
264
252
|
action: number;
|
|
265
253
|
user: string | null;
|
|
266
254
|
txHash: string | null;
|
|
255
|
+
tx: WarpAdapterGenericTransaction | null;
|
|
267
256
|
next: WarpExecutionNextInfo | null;
|
|
268
257
|
values: any[];
|
|
258
|
+
valuesRaw: any[];
|
|
269
259
|
results: WarpExecutionResults;
|
|
270
260
|
messages: WarpExecutionMessages;
|
|
271
261
|
};
|
|
@@ -276,6 +266,11 @@ type WarpExecutionNextInfo = {
|
|
|
276
266
|
type WarpExecutionResults = Record<WarpResultName, any | null>;
|
|
277
267
|
type WarpExecutionMessages = Record<WarpMessageName, string | null>;
|
|
278
268
|
|
|
269
|
+
type ClientIndexConfig = {
|
|
270
|
+
url?: string;
|
|
271
|
+
apiKey?: string;
|
|
272
|
+
searchParamName?: string;
|
|
273
|
+
};
|
|
279
274
|
type WarpSearchResult = {
|
|
280
275
|
hits: WarpSearchHit[];
|
|
281
276
|
};
|
|
@@ -291,71 +286,167 @@ type WarpSearchHit = {
|
|
|
291
286
|
featured: boolean;
|
|
292
287
|
};
|
|
293
288
|
|
|
294
|
-
|
|
295
|
-
|
|
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;
|
|
289
|
+
interface TransformRunner {
|
|
290
|
+
run(code: string, context: any): Promise<any>;
|
|
311
291
|
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
Warp: string;
|
|
315
|
-
Brand: string;
|
|
316
|
-
Abi: string;
|
|
292
|
+
type ClientTransformConfig = {
|
|
293
|
+
runner?: TransformRunner | null;
|
|
317
294
|
};
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
BlockTime: (env: WarpChainEnv) => number;
|
|
329
|
-
AddressHrp: string;
|
|
330
|
-
ChainId: (env: WarpChainEnv) => "D" | "T" | "1";
|
|
295
|
+
|
|
296
|
+
type WarpUserWallets = Record<WarpChain, string | null>;
|
|
297
|
+
type WarpProviderConfig = Record<WarpChainEnv, string>;
|
|
298
|
+
type WarpClientConfig = {
|
|
299
|
+
env: WarpChainEnv;
|
|
300
|
+
clientUrl?: string;
|
|
301
|
+
currentUrl?: string;
|
|
302
|
+
vars?: Record<string, string | number>;
|
|
303
|
+
user?: {
|
|
304
|
+
wallets?: WarpUserWallets;
|
|
331
305
|
};
|
|
332
|
-
|
|
333
|
-
|
|
306
|
+
preferences?: {
|
|
307
|
+
explorers?: Record<WarpChain, WarpExplorerName>;
|
|
334
308
|
};
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
309
|
+
providers?: Record<WarpChain, WarpProviderConfig>;
|
|
310
|
+
schema?: {
|
|
311
|
+
warp?: string;
|
|
312
|
+
brand?: string;
|
|
313
|
+
};
|
|
314
|
+
cache?: ClientCacheConfig;
|
|
315
|
+
transform?: ClientTransformConfig;
|
|
316
|
+
index?: ClientIndexConfig;
|
|
338
317
|
};
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
config: WarpInitConfig;
|
|
342
|
-
chain: WarpChainInfo;
|
|
318
|
+
type WarpCacheConfig = {
|
|
319
|
+
ttl?: number;
|
|
343
320
|
};
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
321
|
+
type AdapterFactory = (config: WarpClientConfig, fallback?: Adapter) => Adapter;
|
|
322
|
+
type Adapter = {
|
|
323
|
+
chainInfo: WarpChainInfo;
|
|
324
|
+
prefix: string;
|
|
325
|
+
builder: () => CombinedWarpBuilder;
|
|
326
|
+
executor: AdapterWarpExecutor;
|
|
327
|
+
results: AdapterWarpResults;
|
|
328
|
+
serializer: AdapterWarpSerializer;
|
|
329
|
+
registry: AdapterWarpRegistry;
|
|
330
|
+
explorer: AdapterWarpExplorer;
|
|
331
|
+
abiBuilder: () => AdapterWarpAbiBuilder;
|
|
332
|
+
brandBuilder: () => AdapterWarpBrandBuilder;
|
|
333
|
+
dataLoader: AdapterWarpDataLoader;
|
|
334
|
+
registerTypes?: (typeRegistry: WarpTypeRegistry) => void;
|
|
335
|
+
};
|
|
336
|
+
type WarpAdapterGenericTransaction = any;
|
|
337
|
+
type WarpAdapterGenericRemoteTransaction = any;
|
|
338
|
+
type WarpAdapterGenericValue = any;
|
|
339
|
+
type WarpAdapterGenericType = any;
|
|
340
|
+
interface WarpTypeHandler {
|
|
341
|
+
stringToNative(value: string): any;
|
|
342
|
+
nativeToString(value: any): string;
|
|
343
|
+
}
|
|
344
|
+
interface WarpTypeRegistry {
|
|
345
|
+
registerType(typeName: string, handler: WarpTypeHandler): void;
|
|
346
|
+
hasType(typeName: string): boolean;
|
|
347
|
+
getHandler(typeName: string): WarpTypeHandler | undefined;
|
|
348
|
+
getRegisteredTypes(): string[];
|
|
349
|
+
}
|
|
350
|
+
interface BaseWarpBuilder {
|
|
351
|
+
createFromRaw(encoded: string): Promise<Warp>;
|
|
352
|
+
createFromUrl(url: string): Promise<Warp>;
|
|
353
|
+
setName(name: string): BaseWarpBuilder;
|
|
354
|
+
setTitle(title: string): BaseWarpBuilder;
|
|
355
|
+
setDescription(description: string): BaseWarpBuilder;
|
|
356
|
+
setPreview(preview: string): BaseWarpBuilder;
|
|
357
|
+
setActions(actions: WarpAction[]): BaseWarpBuilder;
|
|
358
|
+
addAction(action: WarpAction): BaseWarpBuilder;
|
|
359
|
+
build(): Promise<Warp>;
|
|
360
|
+
}
|
|
361
|
+
interface AdapterWarpBuilder {
|
|
362
|
+
createInscriptionTransaction(warp: Warp): WarpAdapterGenericTransaction;
|
|
363
|
+
createFromTransaction(tx: WarpAdapterGenericTransaction, validate?: boolean): Promise<Warp>;
|
|
364
|
+
createFromTransactionHash(hash: string, cache?: WarpCacheConfig): Promise<Warp | null>;
|
|
365
|
+
}
|
|
366
|
+
type CombinedWarpBuilder = AdapterWarpBuilder & BaseWarpBuilder;
|
|
367
|
+
interface AdapterWarpAbiBuilder {
|
|
368
|
+
createFromRaw(encoded: string): Promise<any>;
|
|
369
|
+
createFromTransaction(tx: WarpAdapterGenericTransaction): Promise<any>;
|
|
370
|
+
createFromTransactionHash(hash: string, cache?: WarpCacheConfig): Promise<any | null>;
|
|
371
|
+
}
|
|
372
|
+
interface AdapterWarpBrandBuilder {
|
|
373
|
+
createInscriptionTransaction(brand: WarpBrand): WarpAdapterGenericTransaction;
|
|
374
|
+
createFromTransaction(tx: WarpAdapterGenericTransaction, validate?: boolean): Promise<WarpBrand>;
|
|
375
|
+
createFromTransactionHash(hash: string, cache?: WarpCacheConfig): Promise<WarpBrand | null>;
|
|
376
|
+
}
|
|
377
|
+
interface AdapterWarpExecutor {
|
|
378
|
+
createTransaction(executable: WarpExecutable): Promise<WarpAdapterGenericTransaction>;
|
|
379
|
+
executeQuery(executable: WarpExecutable): Promise<WarpExecution>;
|
|
380
|
+
preprocessInput(chain: WarpChainInfo, input: string, type: WarpActionInputType, value: string): Promise<string>;
|
|
381
|
+
signMessage(message: string, privateKey: string): Promise<string>;
|
|
382
|
+
}
|
|
383
|
+
interface AdapterWarpResults {
|
|
384
|
+
getTransactionExecutionResults(warp: Warp, tx: WarpAdapterGenericRemoteTransaction): Promise<WarpExecution>;
|
|
385
|
+
}
|
|
386
|
+
interface AdapterWarpSerializer {
|
|
387
|
+
typedToString(value: WarpAdapterGenericValue): string;
|
|
388
|
+
typedToNative(value: WarpAdapterGenericValue): [WarpActionInputType, WarpNativeValue];
|
|
389
|
+
nativeToTyped(type: WarpActionInputType, value: WarpNativeValue): WarpAdapterGenericValue;
|
|
390
|
+
nativeToType(type: BaseWarpActionInputType): WarpAdapterGenericType;
|
|
391
|
+
stringToTyped(value: string): WarpAdapterGenericValue;
|
|
392
|
+
}
|
|
393
|
+
interface AdapterWarpRegistry {
|
|
394
|
+
init(): Promise<void>;
|
|
395
|
+
getRegistryConfig(): WarpRegistryConfigInfo;
|
|
396
|
+
createWarpRegisterTransaction(txHash: string, alias?: string | null, brand?: string | null): Promise<WarpAdapterGenericTransaction>;
|
|
397
|
+
createWarpUnregisterTransaction(txHash: string): Promise<WarpAdapterGenericTransaction>;
|
|
398
|
+
createWarpUpgradeTransaction(alias: string, txHash: string): Promise<WarpAdapterGenericTransaction>;
|
|
399
|
+
createWarpAliasSetTransaction(txHash: string, alias: string): Promise<WarpAdapterGenericTransaction>;
|
|
400
|
+
createWarpVerifyTransaction(txHash: string): Promise<WarpAdapterGenericTransaction>;
|
|
401
|
+
createWarpTransferOwnershipTransaction(txHash: string, newOwner: string): Promise<WarpAdapterGenericTransaction>;
|
|
402
|
+
createBrandRegisterTransaction(txHash: string): Promise<WarpAdapterGenericTransaction>;
|
|
403
|
+
createWarpBrandingTransaction(warpHash: string, brandHash: string): Promise<WarpAdapterGenericTransaction>;
|
|
404
|
+
getInfoByAlias(alias: string, cache?: WarpCacheConfig): Promise<{
|
|
405
|
+
registryInfo: WarpRegistryInfo | null;
|
|
406
|
+
brand: WarpBrand | null;
|
|
407
|
+
}>;
|
|
408
|
+
getInfoByHash(hash: string, cache?: WarpCacheConfig): Promise<{
|
|
409
|
+
registryInfo: WarpRegistryInfo | null;
|
|
410
|
+
brand: WarpBrand | null;
|
|
411
|
+
}>;
|
|
412
|
+
getUserWarpRegistryInfos(user?: string): Promise<WarpRegistryInfo[]>;
|
|
413
|
+
getUserBrands(user?: string): Promise<WarpBrand[]>;
|
|
414
|
+
fetchBrand(hash: string, cache?: WarpCacheConfig): Promise<WarpBrand | null>;
|
|
415
|
+
}
|
|
416
|
+
interface AdapterWarpExplorer {
|
|
417
|
+
getAccountUrl(address: string): string;
|
|
418
|
+
getTransactionUrl(hash: string): string;
|
|
419
|
+
getAssetUrl(identifier: string): string;
|
|
420
|
+
getContractUrl(address: string): string;
|
|
421
|
+
}
|
|
422
|
+
interface WarpDataLoaderOptions {
|
|
423
|
+
page?: number;
|
|
424
|
+
size?: number;
|
|
425
|
+
}
|
|
426
|
+
interface AdapterWarpDataLoader {
|
|
427
|
+
getAccount(address: string): Promise<WarpChainAccount>;
|
|
428
|
+
getAccountAssets(address: string): Promise<WarpChainAsset[]>;
|
|
429
|
+
getAccountActions(address: string, options?: WarpDataLoaderOptions): Promise<WarpChainAction[]>;
|
|
350
430
|
}
|
|
351
431
|
|
|
432
|
+
declare enum WarpChainName {
|
|
433
|
+
Multiversx = "multiversx",
|
|
434
|
+
Vibechain = "vibechain",
|
|
435
|
+
Sui = "sui",
|
|
436
|
+
Ethereum = "ethereum",
|
|
437
|
+
Base = "base",
|
|
438
|
+
Arbitrum = "arbitrum",
|
|
439
|
+
Fastset = "fastset"
|
|
440
|
+
}
|
|
352
441
|
declare const WarpConstants: {
|
|
353
442
|
HttpProtocolPrefix: string;
|
|
354
443
|
IdentifierParamName: string;
|
|
355
|
-
IdentifierParamSeparator: string;
|
|
444
|
+
IdentifierParamSeparator: string[];
|
|
445
|
+
IdentifierParamSeparatorDefault: string;
|
|
446
|
+
IdentifierChainDefault: string;
|
|
356
447
|
IdentifierType: {
|
|
357
|
-
Alias:
|
|
358
|
-
Hash:
|
|
448
|
+
Alias: WarpIdType;
|
|
449
|
+
Hash: WarpIdType;
|
|
359
450
|
};
|
|
360
451
|
Source: {
|
|
361
452
|
UserWallet: string;
|
|
@@ -363,13 +454,13 @@ declare const WarpConstants: {
|
|
|
363
454
|
Globals: {
|
|
364
455
|
UserWallet: {
|
|
365
456
|
Placeholder: string;
|
|
366
|
-
Accessor: (bag: InterpolationBag) => string | undefined;
|
|
457
|
+
Accessor: (bag: InterpolationBag) => string | null | undefined;
|
|
367
458
|
};
|
|
368
459
|
ChainApiUrl: {
|
|
369
460
|
Placeholder: string;
|
|
370
461
|
Accessor: (bag: InterpolationBag) => string;
|
|
371
462
|
};
|
|
372
|
-
|
|
463
|
+
ChainAddressHrp: {
|
|
373
464
|
Placeholder: string;
|
|
374
465
|
Accessor: (bag: InterpolationBag) => string;
|
|
375
466
|
};
|
|
@@ -383,103 +474,197 @@ declare const WarpConstants: {
|
|
|
383
474
|
Transform: {
|
|
384
475
|
Prefix: string;
|
|
385
476
|
};
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
477
|
+
};
|
|
478
|
+
declare const WarpInputTypes: {
|
|
479
|
+
Option: string;
|
|
480
|
+
Optional: string;
|
|
481
|
+
List: string;
|
|
482
|
+
Variadic: string;
|
|
483
|
+
Composite: string;
|
|
484
|
+
String: string;
|
|
485
|
+
U8: string;
|
|
486
|
+
U16: string;
|
|
487
|
+
U32: string;
|
|
488
|
+
U64: string;
|
|
489
|
+
U128: string;
|
|
490
|
+
U256: string;
|
|
491
|
+
Biguint: string;
|
|
492
|
+
Boolean: string;
|
|
493
|
+
Address: string;
|
|
494
|
+
Asset: string;
|
|
495
|
+
Hex: string;
|
|
392
496
|
};
|
|
393
497
|
|
|
394
|
-
|
|
395
|
-
|
|
498
|
+
type InterpolationBag = {
|
|
499
|
+
config: WarpClientConfig;
|
|
500
|
+
chain: WarpChainName;
|
|
501
|
+
chainInfo: WarpChainInfo;
|
|
502
|
+
};
|
|
503
|
+
|
|
504
|
+
declare const WarpProtocolVersions: {
|
|
505
|
+
Warp: string;
|
|
506
|
+
Brand: string;
|
|
507
|
+
Abi: string;
|
|
508
|
+
};
|
|
509
|
+
declare const WarpConfig: {
|
|
510
|
+
LatestWarpSchemaUrl: string;
|
|
511
|
+
LatestBrandSchemaUrl: string;
|
|
512
|
+
DefaultClientUrl: (env: WarpChainEnv) => "https://usewarp.to" | "https://testnet.usewarp.to" | "https://devnet.usewarp.to";
|
|
513
|
+
DefaultChainPrefix: string;
|
|
514
|
+
SuperClientUrls: string[];
|
|
515
|
+
AvailableActionInputSources: WarpActionInputSource[];
|
|
516
|
+
AvailableActionInputTypes: WarpActionInputType[];
|
|
517
|
+
AvailableActionInputPositions: WarpActionInputPosition[];
|
|
518
|
+
};
|
|
519
|
+
|
|
520
|
+
interface CryptoProvider {
|
|
521
|
+
getRandomBytes(size: number): Promise<Uint8Array>;
|
|
522
|
+
}
|
|
523
|
+
declare class BrowserCryptoProvider implements CryptoProvider {
|
|
524
|
+
getRandomBytes(size: number): Promise<Uint8Array>;
|
|
525
|
+
}
|
|
526
|
+
declare class NodeCryptoProvider implements CryptoProvider {
|
|
527
|
+
getRandomBytes(size: number): Promise<Uint8Array>;
|
|
528
|
+
}
|
|
529
|
+
declare function getCryptoProvider(): CryptoProvider;
|
|
530
|
+
declare function setCryptoProvider(provider: CryptoProvider): void;
|
|
531
|
+
declare function getRandomBytes(size: number, cryptoProvider?: CryptoProvider): Promise<Uint8Array>;
|
|
532
|
+
declare function bytesToHex(bytes: Uint8Array): string;
|
|
533
|
+
declare function bytesToBase64(bytes: Uint8Array): string;
|
|
534
|
+
declare function getRandomHex(length: number, cryptoProvider?: CryptoProvider): Promise<string>;
|
|
535
|
+
declare function testCryptoAvailability(): Promise<{
|
|
536
|
+
randomBytes: boolean;
|
|
537
|
+
environment: 'browser' | 'nodejs' | 'unknown';
|
|
538
|
+
}>;
|
|
539
|
+
declare function createCryptoProvider(): CryptoProvider;
|
|
540
|
+
|
|
541
|
+
declare const findWarpAdapterForChain: (chain: WarpChain, adapters: Adapter[]) => Adapter;
|
|
542
|
+
declare const findWarpAdapterByPrefix: (prefix: string, adapters: Adapter[]) => Adapter;
|
|
396
543
|
declare const getLatestProtocolIdentifier: (name: ProtocolName) => string;
|
|
397
544
|
declare const getWarpActionByIndex: (warp: Warp, index: number) => WarpAction;
|
|
398
|
-
declare const
|
|
399
|
-
|
|
545
|
+
declare const findWarpExecutableAction: (warp: Warp) => {
|
|
546
|
+
action: WarpAction;
|
|
547
|
+
actionIndex: WarpActionIndex;
|
|
548
|
+
};
|
|
549
|
+
declare const shiftBigintBy: (value: bigint | string | number, decimals: number) => bigint;
|
|
400
550
|
declare const toPreviewText: (text: string, maxChars?: number) => string;
|
|
401
551
|
declare const replacePlaceholders: (message: string, bag: Record<string, any>) => string;
|
|
552
|
+
declare const applyResultsToMessages: (warp: Warp, results: Record<string, any>) => Record<string, string>;
|
|
402
553
|
|
|
403
|
-
declare const
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
declare const
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
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
|
-
}
|
|
554
|
+
declare const getWarpInfoFromIdentifier: (prefixedIdentifier: string) => {
|
|
555
|
+
chainPrefix: string;
|
|
556
|
+
type: WarpIdType;
|
|
557
|
+
identifier: string;
|
|
558
|
+
identifierBase: string;
|
|
559
|
+
} | null;
|
|
560
|
+
declare const extractIdentifierInfoFromUrl: (url: string) => {
|
|
561
|
+
chainPrefix: string;
|
|
562
|
+
type: WarpIdType;
|
|
563
|
+
identifier: string;
|
|
564
|
+
identifierBase: string;
|
|
565
|
+
} | null;
|
|
431
566
|
|
|
432
|
-
|
|
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[], meta?: 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
|
-
}
|
|
567
|
+
declare const getNextInfo: (config: WarpClientConfig, adapters: Adapter[], warp: Warp, actionIndex: number, results: WarpExecutionResults) => WarpExecutionNextInfo | null;
|
|
461
568
|
|
|
462
|
-
|
|
463
|
-
declare
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
569
|
+
declare const getProviderUrl: (config: WarpClientConfig, chain: WarpChain, env: WarpChainEnv, defaultProvider: string) => string;
|
|
570
|
+
declare const getProviderConfig: (config: WarpClientConfig, chain: WarpChain) => WarpProviderConfig | undefined;
|
|
571
|
+
|
|
572
|
+
declare const extractCollectResults: (warp: Warp, response: any, actionIndex: number, inputs: ResolvedInput[], transformRunner?: TransformRunner | null) => Promise<{
|
|
573
|
+
values: any[];
|
|
574
|
+
results: WarpExecutionResults;
|
|
575
|
+
}>;
|
|
576
|
+
declare const evaluateResultsCommon: (warp: Warp, baseResults: WarpExecutionResults, actionIndex: number, inputs: ResolvedInput[], transformRunner?: TransformRunner | null) => Promise<WarpExecutionResults>;
|
|
577
|
+
/**
|
|
578
|
+
* Parses out[N] notation and returns the action index (1-based) or null if invalid.
|
|
579
|
+
* Also handles plain "out" which defaults to action index 1.
|
|
580
|
+
*/
|
|
581
|
+
declare const parseResultsOutIndex: (resultPath: string) => number | null;
|
|
582
|
+
|
|
583
|
+
/**
|
|
584
|
+
* Signing utilities for creating and validating signed messages
|
|
585
|
+
* Works with any crypto provider or uses automatic detection
|
|
586
|
+
*/
|
|
587
|
+
|
|
588
|
+
interface SignableMessage {
|
|
589
|
+
wallet: string;
|
|
590
|
+
nonce: string;
|
|
591
|
+
expiresAt: string;
|
|
592
|
+
purpose: string;
|
|
472
593
|
}
|
|
594
|
+
type HttpAuthHeaders = Record<string, string> & {
|
|
595
|
+
'X-Signer-Wallet': string;
|
|
596
|
+
'X-Signer-Signature': string;
|
|
597
|
+
'X-Signer-Nonce': string;
|
|
598
|
+
'X-Signer-ExpiresAt': string;
|
|
599
|
+
};
|
|
600
|
+
/**
|
|
601
|
+
* Creates a signable message with standard security fields
|
|
602
|
+
* This can be used for any type of proof or authentication
|
|
603
|
+
*/
|
|
604
|
+
declare function createSignableMessage(walletAddress: string, purpose: string, cryptoProvider?: CryptoProvider, expiresInMinutes?: number): Promise<{
|
|
605
|
+
message: string;
|
|
606
|
+
nonce: string;
|
|
607
|
+
expiresAt: string;
|
|
608
|
+
}>;
|
|
609
|
+
/**
|
|
610
|
+
* Creates a signable message for HTTP authentication
|
|
611
|
+
* This is a convenience function that uses the standard format
|
|
612
|
+
*/
|
|
613
|
+
declare function createAuthMessage(walletAddress: string, appName: string, cryptoProvider?: CryptoProvider, purpose?: string): Promise<{
|
|
614
|
+
message: string;
|
|
615
|
+
nonce: string;
|
|
616
|
+
expiresAt: string;
|
|
617
|
+
}>;
|
|
618
|
+
/**
|
|
619
|
+
* Creates HTTP authentication headers from a signature
|
|
620
|
+
*/
|
|
621
|
+
declare function createAuthHeaders(walletAddress: string, signature: string, nonce: string, expiresAt: string): HttpAuthHeaders;
|
|
622
|
+
/**
|
|
623
|
+
* Creates HTTP authentication headers for a wallet using the provided signing function
|
|
624
|
+
*/
|
|
625
|
+
declare function createHttpAuthHeaders(walletAddress: string, signMessage: (message: string) => Promise<string>, appName: string, cryptoProvider?: CryptoProvider): Promise<HttpAuthHeaders>;
|
|
626
|
+
/**
|
|
627
|
+
* Validates a signed message by checking expiration
|
|
628
|
+
*/
|
|
629
|
+
declare function validateSignedMessage(expiresAt: string): boolean;
|
|
630
|
+
/**
|
|
631
|
+
* Parses a signed message to extract its components
|
|
632
|
+
*/
|
|
633
|
+
declare function parseSignedMessage(message: string): SignableMessage;
|
|
473
634
|
|
|
474
|
-
declare
|
|
635
|
+
declare const string: (value: string) => string;
|
|
636
|
+
declare const u8: (value: number) => string;
|
|
637
|
+
declare const u16: (value: number) => string;
|
|
638
|
+
declare const u32: (value: number) => string;
|
|
639
|
+
declare const u64: (value: bigint | number) => string;
|
|
640
|
+
declare const biguint: (value: bigint | string | number) => string;
|
|
641
|
+
declare const boolean: (value: boolean) => string;
|
|
642
|
+
declare const address: (value: string) => string;
|
|
643
|
+
declare const asset: (value: WarpChainAsset) => string;
|
|
644
|
+
declare const hex: (value: string) => string;
|
|
645
|
+
|
|
646
|
+
declare class WarpBrandBuilder {
|
|
475
647
|
private config;
|
|
476
|
-
private
|
|
648
|
+
private pendingBrand;
|
|
649
|
+
constructor(config: WarpClientConfig);
|
|
650
|
+
createFromRaw(encoded: string, validateSchema?: boolean): Promise<WarpBrand>;
|
|
651
|
+
setName(name: string): WarpBrandBuilder;
|
|
652
|
+
setDescription(description: string): WarpBrandBuilder;
|
|
653
|
+
setLogo(logo: string): WarpBrandBuilder;
|
|
654
|
+
setUrls(urls: WarpBrandUrls): WarpBrandBuilder;
|
|
655
|
+
setColors(colors: WarpBrandColors): WarpBrandBuilder;
|
|
656
|
+
setCta(cta: WarpBrandCta): WarpBrandBuilder;
|
|
657
|
+
build(): Promise<WarpBrand>;
|
|
658
|
+
private ensure;
|
|
659
|
+
private ensureValidSchema;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
declare class WarpBuilder implements BaseWarpBuilder {
|
|
663
|
+
protected readonly config: WarpClientConfig;
|
|
477
664
|
private pendingWarp;
|
|
478
|
-
constructor(config:
|
|
479
|
-
createInscriptionTransaction(warp: Warp): Transaction;
|
|
665
|
+
constructor(config: WarpClientConfig);
|
|
480
666
|
createFromRaw(encoded: string, validate?: boolean): Promise<Warp>;
|
|
481
|
-
|
|
482
|
-
createFromTransactionHash(hash: string, cache?: WarpCacheConfig): Promise<Warp | null>;
|
|
667
|
+
createFromUrl(url: string): Promise<Warp>;
|
|
483
668
|
setName(name: string): WarpBuilder;
|
|
484
669
|
setTitle(title: string): WarpBuilder;
|
|
485
670
|
setDescription(description: string): WarpBuilder;
|
|
@@ -492,25 +677,95 @@ declare class WarpBuilder {
|
|
|
492
677
|
private validate;
|
|
493
678
|
}
|
|
494
679
|
|
|
495
|
-
declare
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
680
|
+
declare const CacheTtl: {
|
|
681
|
+
OneMinute: number;
|
|
682
|
+
OneHour: number;
|
|
683
|
+
OneDay: number;
|
|
684
|
+
OneWeek: number;
|
|
685
|
+
OneMonth: number;
|
|
686
|
+
OneYear: number;
|
|
687
|
+
};
|
|
688
|
+
declare const WarpCacheKey: {
|
|
689
|
+
Warp: (env: WarpChainEnv, id: string) => string;
|
|
690
|
+
WarpAbi: (env: WarpChainEnv, id: string) => string;
|
|
691
|
+
WarpExecutable: (env: WarpChainEnv, id: string, action: number) => string;
|
|
692
|
+
RegistryInfo: (env: WarpChainEnv, id: string) => string;
|
|
693
|
+
Brand: (env: WarpChainEnv, hash: string) => string;
|
|
694
|
+
};
|
|
695
|
+
declare class WarpCache {
|
|
696
|
+
private strategy;
|
|
697
|
+
constructor(type?: WarpCacheType);
|
|
698
|
+
private selectStrategy;
|
|
699
|
+
set<T>(key: string, value: T, ttl: number): void;
|
|
700
|
+
get<T>(key: string): T | null;
|
|
701
|
+
forget(key: string): void;
|
|
702
|
+
clear(): void;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
type ExecutionHandlers = {
|
|
706
|
+
onExecuted?: (result: WarpExecution) => void;
|
|
707
|
+
onError?: (params: {
|
|
708
|
+
message: string;
|
|
709
|
+
}) => void;
|
|
710
|
+
onSignRequest?: (params: {
|
|
711
|
+
message: string;
|
|
712
|
+
chain: WarpChainInfo;
|
|
713
|
+
}) => Promise<string>;
|
|
714
|
+
};
|
|
715
|
+
declare class WarpExecutor {
|
|
716
|
+
private config;
|
|
717
|
+
private adapters;
|
|
718
|
+
private handlers?;
|
|
719
|
+
private factory;
|
|
720
|
+
private serializer;
|
|
721
|
+
constructor(config: WarpClientConfig, adapters: Adapter[], handlers?: ExecutionHandlers | undefined);
|
|
722
|
+
execute(warp: Warp, inputs: string[]): Promise<{
|
|
723
|
+
tx: WarpAdapterGenericTransaction | null;
|
|
724
|
+
chain: WarpChainInfo | null;
|
|
725
|
+
}>;
|
|
726
|
+
evaluateResults(warp: Warp, chain: WarpChain, tx: WarpAdapterGenericRemoteTransaction): Promise<void>;
|
|
727
|
+
private executeCollect;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
declare class WarpFactory {
|
|
731
|
+
private config;
|
|
732
|
+
private adapters;
|
|
733
|
+
private url;
|
|
734
|
+
private serializer;
|
|
735
|
+
private cache;
|
|
736
|
+
constructor(config: WarpClientConfig, adapters: Adapter[]);
|
|
737
|
+
createExecutable(warp: Warp, actionIndex: number, inputs: string[]): Promise<WarpExecutable>;
|
|
738
|
+
getChainInfoForAction(action: WarpAction, inputs?: string[]): Promise<WarpChainInfo>;
|
|
739
|
+
getResolvedInputs(chain: WarpChain, action: WarpAction, inputArgs: string[]): Promise<ResolvedInput[]>;
|
|
740
|
+
getModifiedInputs(inputs: ResolvedInput[]): ResolvedInput[];
|
|
741
|
+
preprocessInput(chain: WarpChain, input: string): Promise<string>;
|
|
742
|
+
private getPreparedArgs;
|
|
743
|
+
private tryGetChainFromInputs;
|
|
500
744
|
}
|
|
501
745
|
|
|
502
746
|
declare class WarpIndex {
|
|
503
747
|
private config;
|
|
504
|
-
constructor(config:
|
|
748
|
+
constructor(config: WarpClientConfig);
|
|
505
749
|
search(query: string, params?: Record<string, any>, headers?: Record<string, string>): Promise<WarpSearchHit[]>;
|
|
506
750
|
}
|
|
507
751
|
|
|
752
|
+
declare class WarpLinkBuilder {
|
|
753
|
+
private readonly config;
|
|
754
|
+
private readonly adapters;
|
|
755
|
+
constructor(config: WarpClientConfig, adapters: Adapter[]);
|
|
756
|
+
isValid(url: string): boolean;
|
|
757
|
+
build(chain: WarpChain, type: WarpIdType, id: string): string;
|
|
758
|
+
buildFromPrefixedIdentifier(identifier: string): string | null;
|
|
759
|
+
generateQrCode(chain: WarpChain, type: WarpIdType, id: string, size?: number, background?: string, color?: string, logoColor?: string): QRCodeStyling;
|
|
760
|
+
}
|
|
761
|
+
|
|
508
762
|
type DetectionResult = {
|
|
509
763
|
match: boolean;
|
|
510
764
|
url: string;
|
|
511
765
|
warp: Warp | null;
|
|
766
|
+
chain: WarpChain | null;
|
|
512
767
|
registryInfo: WarpRegistryInfo | null;
|
|
513
|
-
brand:
|
|
768
|
+
brand: WarpBrand | null;
|
|
514
769
|
};
|
|
515
770
|
type DetectionResultFromHtml = {
|
|
516
771
|
match: boolean;
|
|
@@ -519,63 +774,79 @@ type DetectionResultFromHtml = {
|
|
|
519
774
|
warp: Warp;
|
|
520
775
|
}[];
|
|
521
776
|
};
|
|
522
|
-
declare class
|
|
777
|
+
declare class WarpLinkDetecter {
|
|
523
778
|
private config;
|
|
524
|
-
|
|
779
|
+
private adapters;
|
|
780
|
+
constructor(config: WarpClientConfig, adapters: Adapter[]);
|
|
525
781
|
isValid(url: string): boolean;
|
|
526
782
|
detectFromHtml(content: string): Promise<DetectionResultFromHtml>;
|
|
527
783
|
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
784
|
}
|
|
533
785
|
|
|
534
|
-
declare class
|
|
786
|
+
declare class WarpClient {
|
|
535
787
|
private config;
|
|
536
|
-
private
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
brand: Brand | null;
|
|
551
|
-
}>;
|
|
552
|
-
getInfoByHash(hash: string, cache?: WarpCacheConfig): Promise<{
|
|
553
|
-
registryInfo: WarpRegistryInfo | null;
|
|
554
|
-
brand: Brand | null;
|
|
788
|
+
private adapters;
|
|
789
|
+
constructor(config: WarpClientConfig, adapters: Adapter[]);
|
|
790
|
+
getConfig(): WarpClientConfig;
|
|
791
|
+
setConfig(config: WarpClientConfig): WarpClient;
|
|
792
|
+
getAdapters(): Adapter[];
|
|
793
|
+
addAdapter(adapter: Adapter): WarpClient;
|
|
794
|
+
createExecutor(handlers?: ExecutionHandlers): WarpExecutor;
|
|
795
|
+
detectWarp(urlOrId: string, cache?: WarpCacheConfig): Promise<DetectionResult>;
|
|
796
|
+
executeWarp(identifier: string, inputs: string[], handlers?: ExecutionHandlers, options?: {
|
|
797
|
+
cache?: WarpCacheConfig;
|
|
798
|
+
}): Promise<{
|
|
799
|
+
tx: WarpAdapterGenericTransaction | null;
|
|
800
|
+
chain: WarpChainInfo | null;
|
|
801
|
+
evaluateResults: (remoteTx: WarpAdapterGenericRemoteTransaction) => Promise<void>;
|
|
555
802
|
}>;
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
803
|
+
createInscriptionTransaction(chain: WarpChain, warp: Warp): WarpAdapterGenericTransaction;
|
|
804
|
+
createFromTransaction(chain: WarpChain, tx: WarpAdapterGenericRemoteTransaction, validate?: boolean): Promise<Warp>;
|
|
805
|
+
createFromTransactionHash(hash: string, cache?: WarpCacheConfig): Promise<Warp | null>;
|
|
806
|
+
signMessage(chain: WarpChain, message: string, privateKey: string): Promise<string>;
|
|
807
|
+
getExplorer(chain: WarpChain): AdapterWarpExplorer;
|
|
808
|
+
getResults(chain: WarpChain): AdapterWarpResults;
|
|
809
|
+
getRegistry(chain: WarpChain): Promise<AdapterWarpRegistry>;
|
|
810
|
+
getDataLoader(chain: WarpChain): AdapterWarpDataLoader;
|
|
811
|
+
get factory(): WarpFactory;
|
|
812
|
+
get index(): WarpIndex;
|
|
813
|
+
get linkBuilder(): WarpLinkBuilder;
|
|
814
|
+
createBuilder(chain: WarpChain): CombinedWarpBuilder;
|
|
815
|
+
createAbiBuilder(chain: WarpChain): AdapterWarpAbiBuilder;
|
|
816
|
+
createBrandBuilder(chain: WarpChain): AdapterWarpBrandBuilder;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
declare class WarpInterpolator {
|
|
820
|
+
private config;
|
|
821
|
+
private adapter;
|
|
822
|
+
constructor(config: WarpClientConfig, adapter: Adapter);
|
|
823
|
+
apply(config: WarpClientConfig, warp: Warp): Promise<Warp>;
|
|
824
|
+
applyGlobals(config: WarpClientConfig, warp: Warp): Promise<Warp>;
|
|
825
|
+
applyVars(config: WarpClientConfig, warp: Warp): Warp;
|
|
826
|
+
private applyRootGlobals;
|
|
827
|
+
private applyActionGlobals;
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
declare class WarpLogger {
|
|
831
|
+
private static isTestEnv;
|
|
832
|
+
static info(...args: any[]): void;
|
|
833
|
+
static warn(...args: any[]): void;
|
|
834
|
+
static error(...args: any[]): void;
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
declare class WarpSerializer {
|
|
838
|
+
private typeRegistry;
|
|
839
|
+
setTypeRegistry(typeRegistry: WarpTypeRegistry): void;
|
|
840
|
+
nativeToString(type: WarpActionInputType, value: WarpNativeValue): string;
|
|
841
|
+
stringToNative(value: string): [WarpActionInputType, WarpNativeValue];
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
declare class WarpTypeRegistryImpl implements WarpTypeRegistry {
|
|
845
|
+
private typeHandlers;
|
|
846
|
+
registerType(typeName: string, handler: WarpTypeHandler): void;
|
|
847
|
+
hasType(typeName: string): boolean;
|
|
848
|
+
getHandler(typeName: string): WarpTypeHandler | undefined;
|
|
849
|
+
getRegisteredTypes(): string[];
|
|
579
850
|
}
|
|
580
851
|
|
|
581
852
|
type ValidationResult = {
|
|
@@ -585,7 +856,7 @@ type ValidationResult = {
|
|
|
585
856
|
type ValidationError = string;
|
|
586
857
|
declare class WarpValidator {
|
|
587
858
|
private config;
|
|
588
|
-
constructor(config:
|
|
859
|
+
constructor(config: WarpClientConfig);
|
|
589
860
|
validate(warp: Warp): Promise<ValidationResult>;
|
|
590
861
|
private validateMaxOneValuePosition;
|
|
591
862
|
private validateVariableNamesAndResultNamesUppercase;
|
|
@@ -593,4 +864,4 @@ declare class WarpValidator {
|
|
|
593
864
|
private validateSchema;
|
|
594
865
|
}
|
|
595
866
|
|
|
596
|
-
export { type
|
|
867
|
+
export { type Adapter, type AdapterFactory, type AdapterWarpAbiBuilder, type AdapterWarpBrandBuilder, type AdapterWarpBuilder, type AdapterWarpDataLoader, type AdapterWarpExecutor, type AdapterWarpExplorer, type AdapterWarpRegistry, type AdapterWarpResults, type AdapterWarpSerializer, type BaseWarpActionInputType, type BaseWarpBuilder, BrowserCryptoProvider, CacheTtl, type ClientIndexConfig, type ClientTransformConfig, 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 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 WarpBrandMeta, 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 WarpExecution, 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, WarpSerializer, type WarpTransferAction, type WarpTrustStatus, type WarpTypeHandler, type WarpTypeRegistry, WarpTypeRegistryImpl, type WarpUserWallets, WarpValidator, type WarpVarPlaceholder, address, applyResultsToMessages, asset, biguint, boolean, bytesToBase64, bytesToHex, createAuthHeaders, createAuthMessage, createCryptoProvider, createHttpAuthHeaders, createSignableMessage, evaluateResultsCommon, extractCollectResults, extractIdentifierInfoFromUrl, findWarpAdapterByPrefix, findWarpAdapterForChain, findWarpExecutableAction, getCryptoProvider, getLatestProtocolIdentifier, getNextInfo, getProviderConfig, getProviderUrl, getRandomBytes, getRandomHex, getWarpActionByIndex, getWarpInfoFromIdentifier, hex, parseResultsOutIndex, parseSignedMessage, replacePlaceholders, setCryptoProvider, shiftBigintBy, string, testCryptoAvailability, toPreviewText, u16, u32, u64, u8, validateSignedMessage };
|