@vleap/warps 3.0.0-alpha.32 → 3.0.0-alpha.34
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/chunk-3SAEGOMQ.mjs +1 -0
- package/dist/index.d.mts +603 -41
- package/dist/index.d.ts +603 -41
- package/dist/index.js +12 -65
- package/dist/index.mjs +2 -65
- package/dist/runInVm-5YQ766M3.mjs +11 -0
- package/dist/runInVm-BFUZVHHD.mjs +1 -0
- package/package.json +4 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var d=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});export{d as a};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,62 +1,624 @@
|
|
|
1
|
-
import
|
|
2
|
-
export * from '@vleap/warps-core';
|
|
3
|
-
import { Transaction, TransactionOnNetwork } from '@multiversx/sdk-core';
|
|
4
|
-
import { WarpBrandUrls, WarpBrandColors, WarpBrandCta } from '@vleap/warps-core/src/types';
|
|
1
|
+
import QRCodeStyling from 'qr-code-styling';
|
|
5
2
|
|
|
6
|
-
declare
|
|
3
|
+
declare const CacheTtl: {
|
|
4
|
+
OneMinute: number;
|
|
5
|
+
OneHour: number;
|
|
6
|
+
OneDay: number;
|
|
7
|
+
OneWeek: number;
|
|
8
|
+
OneMonth: number;
|
|
9
|
+
OneYear: number;
|
|
10
|
+
};
|
|
11
|
+
declare const WarpCacheKey: {
|
|
12
|
+
Warp: (env: WarpChainEnv, id: string) => string;
|
|
13
|
+
WarpAbi: (env: WarpChainEnv, id: string) => string;
|
|
14
|
+
WarpExecutable: (env: WarpChainEnv, id: string, action: number) => string;
|
|
15
|
+
RegistryInfo: (env: WarpChainEnv, id: string) => string;
|
|
16
|
+
Brand: (env: WarpChainEnv, hash: string) => string;
|
|
17
|
+
ChainInfo: (env: WarpChainEnv, chain: WarpChain) => string;
|
|
18
|
+
ChainInfos: (env: WarpChainEnv) => string;
|
|
19
|
+
};
|
|
20
|
+
type CacheType = 'memory' | 'localStorage';
|
|
21
|
+
declare class WarpCache {
|
|
22
|
+
private strategy;
|
|
23
|
+
constructor(type?: CacheType);
|
|
24
|
+
private selectStrategy;
|
|
25
|
+
set<T>(key: string, value: T, ttl: number): void;
|
|
26
|
+
get<T>(key: string): T | null;
|
|
27
|
+
forget(key: string): void;
|
|
28
|
+
clear(): void;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
type WarpChainEnv = 'mainnet' | 'testnet' | 'devnet';
|
|
32
|
+
type ProtocolName = 'warp' | 'brand' | 'abi';
|
|
33
|
+
|
|
34
|
+
type WarpChain = string;
|
|
35
|
+
type WarpInitConfig = {
|
|
36
|
+
env: WarpChainEnv;
|
|
37
|
+
repository: Adapter;
|
|
38
|
+
adapters: Adapter[];
|
|
39
|
+
preferredChain?: WarpChain;
|
|
40
|
+
clientUrl?: string;
|
|
41
|
+
currentUrl?: string;
|
|
42
|
+
vars?: Record<string, string | number>;
|
|
43
|
+
user?: {
|
|
44
|
+
wallet?: string;
|
|
45
|
+
};
|
|
46
|
+
schema?: {
|
|
47
|
+
warp?: string;
|
|
48
|
+
brand?: string;
|
|
49
|
+
};
|
|
50
|
+
cache?: {
|
|
51
|
+
ttl?: number;
|
|
52
|
+
type?: CacheType;
|
|
53
|
+
};
|
|
54
|
+
registry?: {
|
|
55
|
+
contract?: string;
|
|
56
|
+
};
|
|
57
|
+
index?: {
|
|
58
|
+
url?: string;
|
|
59
|
+
apiKey?: string;
|
|
60
|
+
searchParamName?: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
type WarpCacheConfig = {
|
|
64
|
+
ttl?: number;
|
|
65
|
+
};
|
|
66
|
+
type WarpChainInfo = {
|
|
67
|
+
name: WarpChain;
|
|
68
|
+
displayName: string;
|
|
69
|
+
chainId: string;
|
|
70
|
+
blockTime: number;
|
|
71
|
+
addressHrp: string;
|
|
72
|
+
apiUrl: string;
|
|
73
|
+
explorerUrl: string;
|
|
74
|
+
nativeToken: string;
|
|
75
|
+
};
|
|
76
|
+
type WarpIdType = 'hash' | 'alias';
|
|
77
|
+
type WarpVarPlaceholder = string;
|
|
78
|
+
type WarpResultName = string;
|
|
79
|
+
type WarpResulutionPath = string;
|
|
80
|
+
type WarpMessageName = string;
|
|
81
|
+
type Warp = {
|
|
82
|
+
protocol: string;
|
|
83
|
+
name: string;
|
|
84
|
+
title: string;
|
|
85
|
+
description: string | null;
|
|
86
|
+
bot?: string;
|
|
87
|
+
preview?: string;
|
|
88
|
+
vars?: Record<WarpVarPlaceholder, string>;
|
|
89
|
+
actions: WarpAction[];
|
|
90
|
+
next?: string;
|
|
91
|
+
results?: Record<WarpResultName, WarpResulutionPath>;
|
|
92
|
+
messages?: Record<WarpMessageName, string>;
|
|
93
|
+
meta?: WarpMeta;
|
|
94
|
+
};
|
|
95
|
+
type WarpMeta = {
|
|
96
|
+
hash: string;
|
|
97
|
+
creator: string;
|
|
98
|
+
createdAt: string;
|
|
99
|
+
};
|
|
100
|
+
type WarpAction = WarpTransferAction | WarpContractAction | WarpQueryAction | WarpCollectAction | WarpLinkAction;
|
|
101
|
+
type WarpActionIndex = number;
|
|
102
|
+
type WarpActionType = 'transfer' | 'contract' | 'query' | 'collect' | 'link';
|
|
103
|
+
type WarpTransferAction = {
|
|
104
|
+
type: WarpActionType;
|
|
105
|
+
chain?: WarpChain;
|
|
106
|
+
label: string;
|
|
107
|
+
description?: string | null;
|
|
108
|
+
address?: string;
|
|
109
|
+
data?: string;
|
|
110
|
+
value?: string;
|
|
111
|
+
transfers?: string[];
|
|
112
|
+
inputs?: WarpActionInput[];
|
|
113
|
+
next?: string;
|
|
114
|
+
};
|
|
115
|
+
type WarpContractAction = {
|
|
116
|
+
type: WarpActionType;
|
|
117
|
+
chain?: WarpChain;
|
|
118
|
+
label: string;
|
|
119
|
+
description?: string | null;
|
|
120
|
+
address?: string;
|
|
121
|
+
func?: string | null;
|
|
122
|
+
args?: string[];
|
|
123
|
+
value?: string;
|
|
124
|
+
gasLimit: number;
|
|
125
|
+
transfers?: string[];
|
|
126
|
+
abi?: string;
|
|
127
|
+
inputs?: WarpActionInput[];
|
|
128
|
+
next?: string;
|
|
129
|
+
};
|
|
130
|
+
type WarpQueryAction = {
|
|
131
|
+
type: WarpActionType;
|
|
132
|
+
chain?: WarpChain;
|
|
133
|
+
label: string;
|
|
134
|
+
description?: string | null;
|
|
135
|
+
address?: string;
|
|
136
|
+
func?: string;
|
|
137
|
+
args?: string[];
|
|
138
|
+
abi?: string;
|
|
139
|
+
inputs?: WarpActionInput[];
|
|
140
|
+
next?: string;
|
|
141
|
+
};
|
|
142
|
+
type WarpCollectAction = {
|
|
143
|
+
type: WarpActionType;
|
|
144
|
+
chain?: WarpChain;
|
|
145
|
+
label: string;
|
|
146
|
+
description?: string | null;
|
|
147
|
+
destination: {
|
|
148
|
+
url: string;
|
|
149
|
+
method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
150
|
+
headers?: Record<string, string>;
|
|
151
|
+
};
|
|
152
|
+
inputs?: WarpActionInput[];
|
|
153
|
+
next?: string;
|
|
154
|
+
};
|
|
155
|
+
type WarpLinkAction = {
|
|
156
|
+
type: WarpActionType;
|
|
157
|
+
chain?: WarpChain;
|
|
158
|
+
label: string;
|
|
159
|
+
description?: string | null;
|
|
160
|
+
url: string;
|
|
161
|
+
inputs?: WarpActionInput[];
|
|
162
|
+
};
|
|
163
|
+
type WarpActionInputSource = 'field' | 'query' | 'user:wallet';
|
|
164
|
+
type BaseWarpActionInputType = 'string' | 'uint8' | 'uint16' | 'uint32' | 'uint64' | 'biguint' | 'bool' | 'address' | 'hex' | string;
|
|
165
|
+
type WarpActionInputType = string;
|
|
166
|
+
type WarpNativeValue = string | number | bigint | boolean | null | WarpNativeValue[];
|
|
167
|
+
type WarpActionInputPosition = 'receiver' | 'value' | 'transfer' | `arg:${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10}` | 'data' | 'chain';
|
|
168
|
+
type WarpActionInputModifier = 'scale';
|
|
169
|
+
type WarpActionInput = {
|
|
170
|
+
name: string;
|
|
171
|
+
as?: string;
|
|
172
|
+
description?: string | null;
|
|
173
|
+
bot?: string;
|
|
174
|
+
type: WarpActionInputType;
|
|
175
|
+
position?: WarpActionInputPosition;
|
|
176
|
+
source: WarpActionInputSource;
|
|
177
|
+
required?: boolean;
|
|
178
|
+
min?: number | WarpVarPlaceholder;
|
|
179
|
+
max?: number | WarpVarPlaceholder;
|
|
180
|
+
pattern?: string;
|
|
181
|
+
patternDescription?: string;
|
|
182
|
+
options?: string[] | {
|
|
183
|
+
[key: string]: string;
|
|
184
|
+
};
|
|
185
|
+
modifier?: string;
|
|
186
|
+
default?: string | number | boolean;
|
|
187
|
+
};
|
|
188
|
+
type ResolvedInput = {
|
|
189
|
+
input: WarpActionInput;
|
|
190
|
+
value: string | null;
|
|
191
|
+
};
|
|
192
|
+
type WarpContract = {
|
|
193
|
+
address: string;
|
|
194
|
+
owner: string;
|
|
195
|
+
verified: boolean;
|
|
196
|
+
};
|
|
197
|
+
type WarpContractVerification = {
|
|
198
|
+
codeHash: string;
|
|
199
|
+
abi: object;
|
|
200
|
+
};
|
|
201
|
+
type WarpExecutable = {
|
|
202
|
+
chain: WarpChainInfo;
|
|
203
|
+
warp: Warp;
|
|
204
|
+
action: number;
|
|
205
|
+
destination: string;
|
|
206
|
+
args: string[];
|
|
207
|
+
value: bigint;
|
|
208
|
+
transfers: string[];
|
|
209
|
+
data: string | null;
|
|
210
|
+
resolvedInputs: ResolvedInput[];
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
type WarpAbi = {
|
|
214
|
+
protocol: string;
|
|
215
|
+
content: WarpAbiContents;
|
|
216
|
+
meta?: WarpMeta;
|
|
217
|
+
};
|
|
218
|
+
type WarpAbiContents = {
|
|
219
|
+
name?: string;
|
|
220
|
+
constructor?: any;
|
|
221
|
+
upgradeConstructor?: any;
|
|
222
|
+
endpoints?: any[];
|
|
223
|
+
types?: Record<string, any>;
|
|
224
|
+
events?: any[];
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
type WarpBrand = {
|
|
228
|
+
protocol: string;
|
|
229
|
+
name: string;
|
|
230
|
+
description: string;
|
|
231
|
+
logo: string;
|
|
232
|
+
urls?: WarpBrandUrls;
|
|
233
|
+
colors?: WarpBrandColors;
|
|
234
|
+
cta?: WarpBrandCta;
|
|
235
|
+
meta?: WarpBrandMeta;
|
|
236
|
+
};
|
|
237
|
+
type WarpBrandUrls = {
|
|
238
|
+
web?: string;
|
|
239
|
+
};
|
|
240
|
+
type WarpBrandColors = {
|
|
241
|
+
primary?: string;
|
|
242
|
+
secondary?: string;
|
|
243
|
+
};
|
|
244
|
+
type WarpBrandCta = {
|
|
245
|
+
title: string;
|
|
246
|
+
description: string;
|
|
247
|
+
label: string;
|
|
248
|
+
url: string;
|
|
249
|
+
};
|
|
250
|
+
type WarpBrandMeta = {
|
|
251
|
+
hash: string;
|
|
252
|
+
creator: string;
|
|
253
|
+
createdAt: string;
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
type InterpolationBag = {
|
|
257
|
+
config: WarpInitConfig;
|
|
258
|
+
chain: WarpChainInfo;
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
type WarpTrustStatus = 'unverified' | 'verified' | 'blacklisted';
|
|
262
|
+
type WarpRegistryInfo = {
|
|
263
|
+
hash: string;
|
|
264
|
+
alias: string | null;
|
|
265
|
+
trust: WarpTrustStatus;
|
|
266
|
+
owner: string;
|
|
267
|
+
createdAt: number;
|
|
268
|
+
upgradedAt: number;
|
|
269
|
+
brand: string | null;
|
|
270
|
+
upgrade: string | null;
|
|
271
|
+
};
|
|
272
|
+
type WarpRegistryConfigInfo = {
|
|
273
|
+
unitPrice: bigint;
|
|
274
|
+
admins: string[];
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
type WarpExecution = {
|
|
278
|
+
success: boolean;
|
|
279
|
+
warp: Warp;
|
|
280
|
+
action: number;
|
|
281
|
+
user: string | null;
|
|
282
|
+
txHash: string | null;
|
|
283
|
+
next: WarpExecutionNextInfo | null;
|
|
284
|
+
values: any[];
|
|
285
|
+
results: WarpExecutionResults;
|
|
286
|
+
messages: WarpExecutionMessages;
|
|
287
|
+
};
|
|
288
|
+
type WarpExecutionNextInfo = {
|
|
289
|
+
identifier: string | null;
|
|
290
|
+
url: string;
|
|
291
|
+
}[];
|
|
292
|
+
type WarpExecutionResults = Record<WarpResultName, any | null>;
|
|
293
|
+
type WarpExecutionMessages = Record<WarpMessageName, string | null>;
|
|
294
|
+
|
|
295
|
+
type WarpSearchResult = {
|
|
296
|
+
hits: WarpSearchHit[];
|
|
297
|
+
};
|
|
298
|
+
type WarpSearchHit = {
|
|
299
|
+
hash: string;
|
|
300
|
+
alias: string;
|
|
301
|
+
name: string;
|
|
302
|
+
title: string;
|
|
303
|
+
description: string;
|
|
304
|
+
preview: string;
|
|
305
|
+
status: string;
|
|
306
|
+
category: string;
|
|
307
|
+
featured: boolean;
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
type Adapter = {
|
|
311
|
+
chain: WarpChain;
|
|
312
|
+
builder: AdapterWarpBuilderConstructor;
|
|
313
|
+
executor: AdapterWarpExecutorConstructor;
|
|
314
|
+
results: AdapterWarpResultsConstructor;
|
|
315
|
+
serializer: AdapterWarpSerializerConstructor;
|
|
316
|
+
registry: AdapterWarpRegistryConstructor;
|
|
317
|
+
};
|
|
318
|
+
type WarpAdapterGenericTransaction = any;
|
|
319
|
+
type WarpAdapterGenericRemoteTransaction = any;
|
|
320
|
+
type WarpAdapterGenericValue = any;
|
|
321
|
+
type WarpAdapterGenericType = any;
|
|
322
|
+
interface AdapterWarpBuilderConstructor {
|
|
323
|
+
new (config: WarpInitConfig): AdapterWarpBuilder;
|
|
324
|
+
}
|
|
325
|
+
interface AdapterWarpBuilder {
|
|
326
|
+
createInscriptionTransaction(warp: Warp): WarpAdapterGenericTransaction;
|
|
327
|
+
createFromTransaction(tx: WarpAdapterGenericTransaction, validate?: boolean): Promise<Warp>;
|
|
328
|
+
createFromTransactionHash(hash: string, cache?: WarpCacheConfig): Promise<Warp | null>;
|
|
329
|
+
}
|
|
330
|
+
interface AdapterWarpExecutorConstructor {
|
|
331
|
+
new (config: WarpInitConfig): AdapterWarpExecutor;
|
|
332
|
+
}
|
|
333
|
+
interface AdapterWarpExecutor {
|
|
334
|
+
createTransaction(executable: WarpExecutable): Promise<WarpAdapterGenericTransaction>;
|
|
335
|
+
preprocessInput(chain: WarpChainInfo, input: string, type: WarpActionInputType, value: string): Promise<string>;
|
|
336
|
+
}
|
|
337
|
+
interface AdapterWarpResultsConstructor {
|
|
338
|
+
new (config: WarpInitConfig): AdapterWarpResults;
|
|
339
|
+
}
|
|
340
|
+
interface AdapterWarpResults {
|
|
341
|
+
getTransactionExecutionResults(warp: Warp, actionIndex: WarpActionIndex, tx: WarpAdapterGenericRemoteTransaction): Promise<WarpExecution>;
|
|
342
|
+
}
|
|
343
|
+
interface AdapterWarpSerializerConstructor {
|
|
344
|
+
new (): AdapterWarpSerializer;
|
|
345
|
+
}
|
|
346
|
+
interface AdapterWarpSerializer {
|
|
347
|
+
typedToString(value: WarpAdapterGenericValue): string;
|
|
348
|
+
typedToNative(value: WarpAdapterGenericValue): [WarpActionInputType, WarpNativeValue];
|
|
349
|
+
nativeToTyped(type: WarpActionInputType, value: WarpNativeValue): WarpAdapterGenericValue;
|
|
350
|
+
nativeToType(type: BaseWarpActionInputType): WarpAdapterGenericType;
|
|
351
|
+
stringToTyped(value: string): WarpAdapterGenericValue;
|
|
352
|
+
}
|
|
353
|
+
interface AdapterWarpRegistryConstructor {
|
|
354
|
+
new (config: WarpInitConfig): AdapterWarpRegistry;
|
|
355
|
+
}
|
|
356
|
+
interface AdapterWarpRegistry {
|
|
357
|
+
createWarpRegisterTransaction(txHash: string, alias?: string | null, brand?: string | null): WarpAdapterGenericTransaction;
|
|
358
|
+
createWarpUnregisterTransaction(txHash: string): WarpAdapterGenericTransaction;
|
|
359
|
+
createWarpUpgradeTransaction(alias: string, txHash: string): WarpAdapterGenericTransaction;
|
|
360
|
+
createWarpAliasSetTransaction(txHash: string, alias: string): WarpAdapterGenericTransaction;
|
|
361
|
+
createWarpVerifyTransaction(txHash: string): WarpAdapterGenericTransaction;
|
|
362
|
+
createWarpTransferOwnershipTransaction(txHash: string, newOwner: string): WarpAdapterGenericTransaction;
|
|
363
|
+
createBrandRegisterTransaction(txHash: string): WarpAdapterGenericTransaction;
|
|
364
|
+
createWarpBrandingTransaction(warpHash: string, brandHash: string): WarpAdapterGenericTransaction;
|
|
365
|
+
getInfoByAlias(alias: string, cache?: WarpCacheConfig): Promise<{
|
|
366
|
+
registryInfo: WarpRegistryInfo | null;
|
|
367
|
+
brand: WarpBrand | null;
|
|
368
|
+
}>;
|
|
369
|
+
getInfoByHash(hash: string, cache?: WarpCacheConfig): Promise<{
|
|
370
|
+
registryInfo: WarpRegistryInfo | null;
|
|
371
|
+
brand: WarpBrand | null;
|
|
372
|
+
}>;
|
|
373
|
+
getUserWarpRegistryInfos(user?: string): Promise<WarpRegistryInfo[]>;
|
|
374
|
+
getUserBrands(user?: string): Promise<WarpBrand[]>;
|
|
375
|
+
getChainInfos(cache?: WarpCacheConfig): Promise<WarpChainInfo[]>;
|
|
376
|
+
getChainInfo(chain: WarpChain, cache?: WarpCacheConfig): Promise<WarpChainInfo | null>;
|
|
377
|
+
setChain(info: WarpChainInfo): Promise<WarpAdapterGenericTransaction>;
|
|
378
|
+
removeChain(chain: WarpChain): Promise<WarpAdapterGenericTransaction>;
|
|
379
|
+
fetchBrand(hash: string, cache?: WarpCacheConfig): Promise<WarpBrand | null>;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
declare const WarpProtocolVersions: {
|
|
383
|
+
Warp: string;
|
|
384
|
+
Brand: string;
|
|
385
|
+
Abi: string;
|
|
386
|
+
};
|
|
387
|
+
declare const WarpConfig: {
|
|
388
|
+
LatestWarpSchemaUrl: string;
|
|
389
|
+
LatestBrandSchemaUrl: string;
|
|
390
|
+
DefaultClientUrl: (env: WarpChainEnv) => "https://usewarp.to" | "https://testnet.usewarp.to" | "https://devnet.usewarp.to";
|
|
391
|
+
SuperClientUrls: string[];
|
|
392
|
+
MainChain: {
|
|
393
|
+
Name: string;
|
|
394
|
+
DisplayName: string;
|
|
395
|
+
ApiUrl: (env: WarpChainEnv) => "https://devnet-api.multiversx.com" | "https://testnet-api.multiversx.com" | "https://api.multiversx.com";
|
|
396
|
+
ExplorerUrl: (env: WarpChainEnv) => "https://devnet-explorer.multiversx.com" | "https://testnet-explorer.multiversx.com" | "https://explorer.multiversx.com";
|
|
397
|
+
BlockTime: (env: WarpChainEnv) => number;
|
|
398
|
+
AddressHrp: string;
|
|
399
|
+
ChainId: (env: WarpChainEnv) => "D" | "T" | "1";
|
|
400
|
+
NativeToken: string;
|
|
401
|
+
};
|
|
402
|
+
Registry: {
|
|
403
|
+
Contract: (env: WarpChainEnv) => "erd1qqqqqqqqqqqqqpgqje2f99vr6r7sk54thg03c9suzcvwr4nfl3tsfkdl36" | "####" | "erd1qqqqqqqqqqqqqpgq3mrpj3u6q7tejv6d7eqhnyd27n9v5c5tl3ts08mffe";
|
|
404
|
+
};
|
|
405
|
+
AvailableActionInputSources: WarpActionInputSource[];
|
|
406
|
+
AvailableActionInputTypes: WarpActionInputType[];
|
|
407
|
+
AvailableActionInputPositions: WarpActionInputPosition[];
|
|
408
|
+
};
|
|
409
|
+
|
|
410
|
+
declare const WarpConstants: {
|
|
411
|
+
HttpProtocolPrefix: string;
|
|
412
|
+
IdentifierParamName: string;
|
|
413
|
+
IdentifierParamSeparator: string;
|
|
414
|
+
IdentifierType: {
|
|
415
|
+
Alias: WarpIdType;
|
|
416
|
+
Hash: WarpIdType;
|
|
417
|
+
};
|
|
418
|
+
Source: {
|
|
419
|
+
UserWallet: string;
|
|
420
|
+
};
|
|
421
|
+
Globals: {
|
|
422
|
+
UserWallet: {
|
|
423
|
+
Placeholder: string;
|
|
424
|
+
Accessor: (bag: InterpolationBag) => string | undefined;
|
|
425
|
+
};
|
|
426
|
+
ChainApiUrl: {
|
|
427
|
+
Placeholder: string;
|
|
428
|
+
Accessor: (bag: InterpolationBag) => string;
|
|
429
|
+
};
|
|
430
|
+
ChainExplorerUrl: {
|
|
431
|
+
Placeholder: string;
|
|
432
|
+
Accessor: (bag: InterpolationBag) => string;
|
|
433
|
+
};
|
|
434
|
+
};
|
|
435
|
+
Vars: {
|
|
436
|
+
Query: string;
|
|
437
|
+
Env: string;
|
|
438
|
+
};
|
|
439
|
+
ArgParamsSeparator: string;
|
|
440
|
+
ArgCompositeSeparator: string;
|
|
441
|
+
Transform: {
|
|
442
|
+
Prefix: string;
|
|
443
|
+
};
|
|
444
|
+
};
|
|
445
|
+
declare const WarpInputTypes: {
|
|
446
|
+
Option: string;
|
|
447
|
+
Optional: string;
|
|
448
|
+
List: string;
|
|
449
|
+
Variadic: string;
|
|
450
|
+
Composite: string;
|
|
451
|
+
String: string;
|
|
452
|
+
U8: string;
|
|
453
|
+
U16: string;
|
|
454
|
+
U32: string;
|
|
455
|
+
U64: string;
|
|
456
|
+
Biguint: string;
|
|
457
|
+
Boolean: string;
|
|
458
|
+
Address: string;
|
|
459
|
+
Hex: string;
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
declare const getMainChainInfo: (config: WarpInitConfig) => WarpChainInfo;
|
|
463
|
+
declare const getChainExplorerUrl: (chain: WarpChainInfo, path?: string) => string;
|
|
464
|
+
declare const getLatestProtocolIdentifier: (name: ProtocolName) => string;
|
|
465
|
+
declare const getWarpActionByIndex: (warp: Warp, index: number) => WarpAction;
|
|
466
|
+
declare const toTypedChainInfo: (chainInfo: any) => WarpChainInfo;
|
|
467
|
+
declare const shiftBigintBy: (value: bigint | string, decimals: number) => bigint;
|
|
468
|
+
declare const toPreviewText: (text: string, maxChars?: number) => string;
|
|
469
|
+
declare const replacePlaceholders: (message: string, bag: Record<string, any>) => string;
|
|
470
|
+
declare const applyResultsToMessages: (warp: Warp, results: Record<string, any>) => Record<string, string>;
|
|
471
|
+
|
|
472
|
+
declare const getWarpInfoFromIdentifier: (prefixedIdentifier: string) => {
|
|
473
|
+
type: WarpIdType;
|
|
474
|
+
identifier: string;
|
|
475
|
+
identifierBase: string;
|
|
476
|
+
} | null;
|
|
477
|
+
declare const extractIdentifierInfoFromUrl: (url: string) => {
|
|
478
|
+
type: WarpIdType;
|
|
479
|
+
identifier: string;
|
|
480
|
+
identifierBase: string;
|
|
481
|
+
} | null;
|
|
482
|
+
|
|
483
|
+
declare const getNextInfo: (config: WarpInitConfig, warp: Warp, actionIndex: number, results: WarpExecutionResults) => WarpExecutionNextInfo | null;
|
|
484
|
+
|
|
485
|
+
declare const extractCollectResults: (warp: Warp, response: any, actionIndex: number, inputs: ResolvedInput[]) => Promise<{
|
|
486
|
+
values: any[];
|
|
487
|
+
results: WarpExecutionResults;
|
|
488
|
+
}>;
|
|
489
|
+
declare const evaluateResultsCommon: (warp: Warp, baseResults: WarpExecutionResults, actionIndex: number, inputs: ResolvedInput[]) => Promise<WarpExecutionResults>;
|
|
490
|
+
/**
|
|
491
|
+
* Parses out[N] notation and returns the action index (1-based) or null if invalid.
|
|
492
|
+
* Also handles plain "out" which defaults to action index 1.
|
|
493
|
+
*/
|
|
494
|
+
declare const parseResultsOutIndex: (resultPath: string) => number | null;
|
|
495
|
+
|
|
496
|
+
type KnownToken = {
|
|
497
|
+
id: string;
|
|
498
|
+
name: string;
|
|
499
|
+
decimals: number;
|
|
500
|
+
};
|
|
501
|
+
declare const KnownTokens: KnownToken[];
|
|
502
|
+
declare const findKnownTokenById: (id: string) => KnownToken | null;
|
|
503
|
+
|
|
504
|
+
declare const string: (value: string) => string;
|
|
505
|
+
declare const u8: (value: number) => string;
|
|
506
|
+
declare const u16: (value: number) => string;
|
|
507
|
+
declare const u32: (value: number) => string;
|
|
508
|
+
declare const u64: (value: bigint) => string;
|
|
509
|
+
declare const biguint: (value: bigint | string | number) => string;
|
|
510
|
+
declare const boolean: (value: boolean) => string;
|
|
511
|
+
declare const address: (value: string) => string;
|
|
512
|
+
declare const hex: (value: string) => string;
|
|
513
|
+
|
|
514
|
+
declare class WarpBrandBuilder {
|
|
7
515
|
private config;
|
|
8
516
|
private pendingBrand;
|
|
9
517
|
constructor(config: WarpInitConfig);
|
|
10
|
-
createInscriptionTransaction(brand: WarpBrand): Transaction;
|
|
11
518
|
createFromRaw(encoded: string, validateSchema?: boolean): Promise<WarpBrand>;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
setColors(colors: WarpBrandColors): BrandBuilder;
|
|
19
|
-
setCta(cta: WarpBrandCta): BrandBuilder;
|
|
519
|
+
setName(name: string): WarpBrandBuilder;
|
|
520
|
+
setDescription(description: string): WarpBrandBuilder;
|
|
521
|
+
setLogo(logo: string): WarpBrandBuilder;
|
|
522
|
+
setUrls(urls: WarpBrandUrls): WarpBrandBuilder;
|
|
523
|
+
setColors(colors: WarpBrandColors): WarpBrandBuilder;
|
|
524
|
+
setCta(cta: WarpBrandCta): WarpBrandBuilder;
|
|
20
525
|
build(): Promise<WarpBrand>;
|
|
21
526
|
private ensure;
|
|
22
527
|
private ensureValidSchema;
|
|
23
528
|
}
|
|
24
529
|
|
|
25
|
-
declare class
|
|
26
|
-
|
|
530
|
+
declare class WarpBuilder {
|
|
531
|
+
private config;
|
|
532
|
+
private pendingWarp;
|
|
533
|
+
constructor(config: WarpInitConfig);
|
|
534
|
+
createFromRaw(encoded: string, validate?: boolean): Promise<Warp>;
|
|
535
|
+
setName(name: string): WarpBuilder;
|
|
536
|
+
setTitle(title: string): WarpBuilder;
|
|
537
|
+
setDescription(description: string): WarpBuilder;
|
|
538
|
+
setPreview(preview: string): WarpBuilder;
|
|
539
|
+
setActions(actions: WarpAction[]): WarpBuilder;
|
|
540
|
+
addAction(action: WarpAction): WarpBuilder;
|
|
541
|
+
build(): Promise<Warp>;
|
|
542
|
+
getDescriptionPreview(description: string, maxChars?: number): string;
|
|
543
|
+
private ensure;
|
|
544
|
+
private validate;
|
|
27
545
|
}
|
|
28
546
|
|
|
29
|
-
|
|
30
|
-
onExecuted?: (result: WarpExecution) => void;
|
|
31
|
-
};
|
|
32
|
-
declare class WarpExecutor {
|
|
547
|
+
declare class WarpIndex {
|
|
33
548
|
private config;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
constructor(config: WarpInitConfig, handlers: ExecutionHandlers);
|
|
37
|
-
execute(warp: Warp, inputs: string[]): Promise<[WarpAdapterGenericTransaction | null, WarpChainInfo | null]>;
|
|
38
|
-
evaluateResults(warp: Warp, chain: WarpChainInfo, tx: WarpAdapterGenericRemoteTransaction): Promise<void>;
|
|
39
|
-
private determineActionIndex;
|
|
40
|
-
private executeCollect;
|
|
549
|
+
constructor(config: WarpInitConfig);
|
|
550
|
+
search(query: string, params?: Record<string, any>, headers?: Record<string, string>): Promise<WarpSearchHit[]>;
|
|
41
551
|
}
|
|
42
552
|
|
|
43
|
-
declare class
|
|
553
|
+
declare class WarpInterpolator {
|
|
44
554
|
private config;
|
|
45
|
-
private
|
|
46
|
-
private serializer;
|
|
47
|
-
private cache;
|
|
555
|
+
private registry;
|
|
48
556
|
constructor(config: WarpInitConfig);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
private
|
|
557
|
+
apply(config: WarpInitConfig, warp: Warp): Promise<Warp>;
|
|
558
|
+
applyGlobals(config: WarpInitConfig, warp: Warp): Promise<Warp>;
|
|
559
|
+
applyVars(config: WarpInitConfig, warp: Warp): Warp;
|
|
560
|
+
private applyRootGlobals;
|
|
561
|
+
private applyActionGlobals;
|
|
54
562
|
}
|
|
55
563
|
|
|
56
|
-
declare class
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
564
|
+
declare class WarpLinkBuilder {
|
|
565
|
+
private config;
|
|
566
|
+
constructor(config: WarpInitConfig);
|
|
567
|
+
isValid(url: string): boolean;
|
|
568
|
+
build(type: WarpIdType, id: string): string;
|
|
569
|
+
buildFromPrefixedIdentifier(identifier: string): string;
|
|
570
|
+
generateQrCode(type: WarpIdType, id: string, size?: number, background?: string, color?: string, logoColor?: string): QRCodeStyling;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
type DetectionResult = {
|
|
574
|
+
match: boolean;
|
|
575
|
+
url: string;
|
|
576
|
+
warp: Warp | null;
|
|
577
|
+
registryInfo: WarpRegistryInfo | null;
|
|
578
|
+
brand: WarpBrand | null;
|
|
579
|
+
};
|
|
580
|
+
type DetectionResultFromHtml = {
|
|
581
|
+
match: boolean;
|
|
582
|
+
results: {
|
|
583
|
+
url: string;
|
|
584
|
+
warp: Warp;
|
|
585
|
+
}[];
|
|
586
|
+
};
|
|
587
|
+
declare class WarpLinkDetecter {
|
|
588
|
+
private config;
|
|
589
|
+
private registry;
|
|
590
|
+
private builder;
|
|
591
|
+
constructor(config: WarpInitConfig);
|
|
592
|
+
isValid(url: string): boolean;
|
|
593
|
+
detectFromHtml(content: string): Promise<DetectionResultFromHtml>;
|
|
594
|
+
detect(url: string, cache?: WarpCacheConfig): Promise<DetectionResult>;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
declare class WarpLogger {
|
|
598
|
+
private static isTestEnv;
|
|
599
|
+
static info(...args: any[]): void;
|
|
600
|
+
static warn(...args: any[]): void;
|
|
601
|
+
static error(...args: any[]): void;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
declare class WarpSerializer {
|
|
605
|
+
nativeToString(type: WarpActionInputType, value: WarpNativeValue): string;
|
|
606
|
+
stringToNative(value: string): [WarpActionInputType, WarpNativeValue];
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
type ValidationResult = {
|
|
610
|
+
valid: boolean;
|
|
611
|
+
errors: ValidationError[];
|
|
612
|
+
};
|
|
613
|
+
type ValidationError = string;
|
|
614
|
+
declare class WarpValidator {
|
|
615
|
+
private config;
|
|
616
|
+
constructor(config: WarpInitConfig);
|
|
617
|
+
validate(warp: Warp): Promise<ValidationResult>;
|
|
618
|
+
private validateMaxOneValuePosition;
|
|
619
|
+
private validateVariableNamesAndResultNamesUppercase;
|
|
620
|
+
private validateAbiIsSetIfApplicable;
|
|
621
|
+
private validateSchema;
|
|
60
622
|
}
|
|
61
623
|
|
|
62
|
-
export {
|
|
624
|
+
export { type Adapter, type AdapterWarpBuilder, type AdapterWarpBuilderConstructor, type AdapterWarpExecutor, type AdapterWarpExecutorConstructor, type AdapterWarpRegistry, type AdapterWarpRegistryConstructor, type AdapterWarpResults, type AdapterWarpResultsConstructor, type AdapterWarpSerializer, type AdapterWarpSerializerConstructor, type BaseWarpActionInputType, CacheTtl, type CacheType, type InterpolationBag, type KnownToken, KnownTokens, type ProtocolName, type ResolvedInput, 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 WarpChainEnv, type WarpChainInfo, type WarpCollectAction, WarpConfig, WarpConstants, type WarpContract, type WarpContractAction, type WarpContractVerification, type WarpExecutable, type WarpExecution, type WarpExecutionMessages, type WarpExecutionNextInfo, type WarpExecutionResults, type WarpIdType, WarpIndex, type WarpInitConfig, WarpInputTypes, WarpInterpolator, type WarpLinkAction, WarpLinkBuilder, WarpLinkDetecter, WarpLogger, type WarpMessageName, type WarpMeta, type WarpNativeValue, WarpProtocolVersions, type WarpQueryAction, type WarpRegistryConfigInfo, type WarpRegistryInfo, type WarpResultName, type WarpResulutionPath, type WarpSearchHit, type WarpSearchResult, WarpSerializer, type WarpTransferAction, type WarpTrustStatus, WarpValidator, type WarpVarPlaceholder, address, applyResultsToMessages, biguint, boolean, evaluateResultsCommon, extractCollectResults, extractIdentifierInfoFromUrl, findKnownTokenById, getChainExplorerUrl, getLatestProtocolIdentifier, getMainChainInfo, getNextInfo, getWarpActionByIndex, getWarpInfoFromIdentifier, hex, parseResultsOutIndex, replacePlaceholders, shiftBigintBy, string, toPreviewText, toTypedChainInfo, u16, u32, u64, u8 };
|