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