@meshsdk/common 1.6.0-alpha.20 → 1.6.0-alpha.21
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/.turbo/turbo-build$colon$docs.log +17 -0
- package/.turbo/turbo-build$colon$mesh.log +19 -0
- package/.turbo/turbo-build.log +19 -0
- package/dist/index.d.mts +1176 -0
- package/dist/index.d.ts +1176 -0
- package/dist/index.js +1316 -0
- package/dist/index.mjs +1189 -0
- package/package.json +3 -3
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,1176 @@
|
|
|
1
|
+
import CIP14 from '@emurgo/cip14-js';
|
|
2
|
+
export { generateMnemonic, mnemonicToEntropy } from 'bip39';
|
|
3
|
+
|
|
4
|
+
type AccountInfo = {
|
|
5
|
+
active: boolean;
|
|
6
|
+
poolId?: string;
|
|
7
|
+
balance: string;
|
|
8
|
+
rewards: string;
|
|
9
|
+
withdrawals: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
type Data = string | number | bigint | Array<Data> | Map<Data, Data> | {
|
|
13
|
+
alternative: number;
|
|
14
|
+
fields: Array<Data>;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
type RedeemerTagType = "CERT" | "MINT" | "REWARD" | "SPEND";
|
|
18
|
+
type Action = {
|
|
19
|
+
data: Data;
|
|
20
|
+
index: number;
|
|
21
|
+
budget: Budget;
|
|
22
|
+
tag: RedeemerTagType;
|
|
23
|
+
};
|
|
24
|
+
type Budget = {
|
|
25
|
+
mem: number;
|
|
26
|
+
steps: number;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
type Asset = {
|
|
30
|
+
unit: Unit;
|
|
31
|
+
quantity: Quantity;
|
|
32
|
+
};
|
|
33
|
+
type Unit = string;
|
|
34
|
+
type Quantity = string;
|
|
35
|
+
declare const mergeAssets: (assets: Asset[]) => Asset[];
|
|
36
|
+
|
|
37
|
+
type AssetExtended = {
|
|
38
|
+
unit: Unit;
|
|
39
|
+
policyId: string;
|
|
40
|
+
assetName: string;
|
|
41
|
+
fingerprint: string;
|
|
42
|
+
quantity: Quantity;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
type RoyaltiesStandard = {
|
|
46
|
+
rate: string;
|
|
47
|
+
address: string;
|
|
48
|
+
};
|
|
49
|
+
declare const royaltiesStandardKeys: string[];
|
|
50
|
+
type MetadataStandard = any;
|
|
51
|
+
declare const metadataStandardKeys: string[];
|
|
52
|
+
type Files = {
|
|
53
|
+
files?: [
|
|
54
|
+
{
|
|
55
|
+
name: string;
|
|
56
|
+
src: `${string}://${string}`;
|
|
57
|
+
mediaType: `${string}/${string}`;
|
|
58
|
+
}
|
|
59
|
+
];
|
|
60
|
+
};
|
|
61
|
+
type AssetMetadata = FungibleAssetMetadata | NonFungibleAssetMetadata | RoyaltiesStandard;
|
|
62
|
+
type FungibleAssetMetadata = MetadataStandard & {
|
|
63
|
+
ticker: string;
|
|
64
|
+
decimals: number;
|
|
65
|
+
version: `${number}.${number}`;
|
|
66
|
+
};
|
|
67
|
+
declare const fungibleAssetKeys: string[];
|
|
68
|
+
type NonFungibleAssetMetadata = AudioAssetMetadata | ImageAssetMetadata | SmartAssetMetadata | VideoAssetMetadata;
|
|
69
|
+
type AudioAssetMetadata = MetadataStandard & Files;
|
|
70
|
+
type ImageAssetMetadata = MetadataStandard & Files & {
|
|
71
|
+
artists?: [
|
|
72
|
+
{
|
|
73
|
+
name: string;
|
|
74
|
+
twitter?: `https://twitter.com/${string}`;
|
|
75
|
+
}
|
|
76
|
+
];
|
|
77
|
+
attributes?: {
|
|
78
|
+
[key: string]: string;
|
|
79
|
+
};
|
|
80
|
+
traits?: string[];
|
|
81
|
+
};
|
|
82
|
+
type SmartAssetMetadata = MetadataStandard & Files;
|
|
83
|
+
type VideoAssetMetadata = MetadataStandard & Files;
|
|
84
|
+
declare const metadataToCip68: (metadata: any) => Data;
|
|
85
|
+
|
|
86
|
+
type BlockInfo = {
|
|
87
|
+
time: number;
|
|
88
|
+
hash: string;
|
|
89
|
+
slot: string;
|
|
90
|
+
epoch: number;
|
|
91
|
+
epochSlot: string;
|
|
92
|
+
slotLeader: string;
|
|
93
|
+
size: number;
|
|
94
|
+
txCount: number;
|
|
95
|
+
output: string;
|
|
96
|
+
fees: string;
|
|
97
|
+
previousBlock: string;
|
|
98
|
+
nextBlock: string;
|
|
99
|
+
confirmations: number;
|
|
100
|
+
operationalCertificate: string;
|
|
101
|
+
VRFKey: string;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
type DataSignature = {
|
|
105
|
+
signature: string;
|
|
106
|
+
key: string;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
type Era = "ALONZO" | "BABBAGE";
|
|
110
|
+
|
|
111
|
+
type Message = {
|
|
112
|
+
payload: string;
|
|
113
|
+
externalAAD?: string;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
type Recipient = string | {
|
|
117
|
+
address: string;
|
|
118
|
+
datum?: {
|
|
119
|
+
value: Data;
|
|
120
|
+
inline?: boolean;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
type Mint = {
|
|
125
|
+
assetName: string;
|
|
126
|
+
assetQuantity: Quantity;
|
|
127
|
+
recipient?: Recipient;
|
|
128
|
+
metadata?: AssetMetadata;
|
|
129
|
+
label?: "20" | "721" | "777" | `${number}`;
|
|
130
|
+
cip68ScriptAddress?: string;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
type NativeScript = {
|
|
134
|
+
type: "after" | "before";
|
|
135
|
+
slot: string;
|
|
136
|
+
} | {
|
|
137
|
+
type: "all" | "any";
|
|
138
|
+
scripts: NativeScript[];
|
|
139
|
+
} | {
|
|
140
|
+
type: "atLeast";
|
|
141
|
+
required: number;
|
|
142
|
+
scripts: NativeScript[];
|
|
143
|
+
} | {
|
|
144
|
+
type: "sig";
|
|
145
|
+
keyHash: string;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
declare const ALL_NETWORKS: readonly ["testnet", "preview", "preprod", "mainnet"];
|
|
149
|
+
type Network = (typeof ALL_NETWORKS)[number];
|
|
150
|
+
declare const isNetwork: (value: unknown) => value is Network;
|
|
151
|
+
|
|
152
|
+
type PlutusScript = {
|
|
153
|
+
version: LanguageVersion;
|
|
154
|
+
code: string;
|
|
155
|
+
};
|
|
156
|
+
type LanguageVersion = keyof typeof LANGUAGE_VERSIONS;
|
|
157
|
+
|
|
158
|
+
type Relay = {
|
|
159
|
+
type: "SingleHostAddr";
|
|
160
|
+
IPV4?: string;
|
|
161
|
+
IPV6?: string;
|
|
162
|
+
port?: number;
|
|
163
|
+
} | {
|
|
164
|
+
type: "SingleHostName";
|
|
165
|
+
domainName: string;
|
|
166
|
+
port?: number;
|
|
167
|
+
} | {
|
|
168
|
+
type: "MultiHostName";
|
|
169
|
+
domainName: string;
|
|
170
|
+
};
|
|
171
|
+
declare const relayToObj: (relay: Relay) => object;
|
|
172
|
+
|
|
173
|
+
type PoolParams = {
|
|
174
|
+
vrfKeyHash: string;
|
|
175
|
+
operator: string;
|
|
176
|
+
pledge: string;
|
|
177
|
+
cost: string;
|
|
178
|
+
margin: [number, number];
|
|
179
|
+
relays: Relay[];
|
|
180
|
+
owners: string[];
|
|
181
|
+
rewardAddress: string;
|
|
182
|
+
metadata?: PoolMetadata;
|
|
183
|
+
};
|
|
184
|
+
declare const poolParamsToObj: (poolParams: PoolParams) => object;
|
|
185
|
+
type PoolMetadata = {
|
|
186
|
+
URL: string;
|
|
187
|
+
hash: string;
|
|
188
|
+
};
|
|
189
|
+
declare const poolMetadataToObj: (poolMetadata: PoolMetadata) => object;
|
|
190
|
+
|
|
191
|
+
type Protocol = {
|
|
192
|
+
epoch: number;
|
|
193
|
+
minFeeA: number;
|
|
194
|
+
minFeeB: number;
|
|
195
|
+
maxBlockSize: number;
|
|
196
|
+
maxTxSize: number;
|
|
197
|
+
maxBlockHeaderSize: number;
|
|
198
|
+
keyDeposit: number;
|
|
199
|
+
poolDeposit: number;
|
|
200
|
+
decentralisation: number;
|
|
201
|
+
minPoolCost: string;
|
|
202
|
+
priceMem: number;
|
|
203
|
+
priceStep: number;
|
|
204
|
+
maxTxExMem: string;
|
|
205
|
+
maxTxExSteps: string;
|
|
206
|
+
maxBlockExMem: string;
|
|
207
|
+
maxBlockExSteps: string;
|
|
208
|
+
maxValSize: number;
|
|
209
|
+
collateralPercent: number;
|
|
210
|
+
maxCollateralInputs: number;
|
|
211
|
+
coinsPerUtxoSize: number;
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
type Token = keyof typeof SUPPORTED_TOKENS;
|
|
215
|
+
|
|
216
|
+
type TransactionInfo = {
|
|
217
|
+
index: number;
|
|
218
|
+
block: string;
|
|
219
|
+
hash: string;
|
|
220
|
+
slot: string;
|
|
221
|
+
fees: string;
|
|
222
|
+
size: number;
|
|
223
|
+
deposit: string;
|
|
224
|
+
invalidBefore: string;
|
|
225
|
+
invalidAfter: string;
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
type UTxO = {
|
|
229
|
+
input: {
|
|
230
|
+
outputIndex: number;
|
|
231
|
+
txHash: string;
|
|
232
|
+
};
|
|
233
|
+
output: {
|
|
234
|
+
address: string;
|
|
235
|
+
amount: Asset[];
|
|
236
|
+
dataHash?: string;
|
|
237
|
+
plutusData?: string;
|
|
238
|
+
scriptRef?: string;
|
|
239
|
+
scriptHash?: string;
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
type Wallet = {
|
|
244
|
+
id: string;
|
|
245
|
+
name: string;
|
|
246
|
+
icon: string;
|
|
247
|
+
version: string;
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
type BuilderData = {
|
|
251
|
+
type: "Mesh";
|
|
252
|
+
content: Data;
|
|
253
|
+
} | {
|
|
254
|
+
type: "JSON";
|
|
255
|
+
content: object | string;
|
|
256
|
+
} | {
|
|
257
|
+
type: "CBOR";
|
|
258
|
+
content: string;
|
|
259
|
+
};
|
|
260
|
+
type Redeemer = {
|
|
261
|
+
data: BuilderData;
|
|
262
|
+
exUnits: Budget;
|
|
263
|
+
};
|
|
264
|
+
type DatumSource = {
|
|
265
|
+
type: "Provided";
|
|
266
|
+
data: BuilderData;
|
|
267
|
+
} | {
|
|
268
|
+
type: "Inline";
|
|
269
|
+
txHash: string;
|
|
270
|
+
txIndex: number;
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
type ScriptSource = {
|
|
274
|
+
type: "Provided";
|
|
275
|
+
script: PlutusScript;
|
|
276
|
+
} | {
|
|
277
|
+
type: "Inline";
|
|
278
|
+
txHash: string;
|
|
279
|
+
txIndex: number;
|
|
280
|
+
scriptHash?: string;
|
|
281
|
+
scriptSize?: string;
|
|
282
|
+
version?: LanguageVersion;
|
|
283
|
+
};
|
|
284
|
+
type SimpleScriptSourceInfo = {
|
|
285
|
+
type: "Provided";
|
|
286
|
+
scriptCode: string;
|
|
287
|
+
} | {
|
|
288
|
+
type: "Inline";
|
|
289
|
+
txHash: string;
|
|
290
|
+
txIndex: number;
|
|
291
|
+
simpleScriptHash: string;
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
type MintItem = {
|
|
295
|
+
type: "Plutus" | "Native";
|
|
296
|
+
policyId: string;
|
|
297
|
+
assetName: string;
|
|
298
|
+
amount: string;
|
|
299
|
+
redeemer?: Redeemer;
|
|
300
|
+
scriptSource?: ScriptSource | SimpleScriptSourceInfo;
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
type Output = {
|
|
304
|
+
address: string;
|
|
305
|
+
amount: Asset[];
|
|
306
|
+
datum?: {
|
|
307
|
+
type: "Hash" | "Inline";
|
|
308
|
+
data: BuilderData;
|
|
309
|
+
};
|
|
310
|
+
referenceScript?: PlutusScript;
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
type RefTxIn = {
|
|
314
|
+
txHash: string;
|
|
315
|
+
txIndex: number;
|
|
316
|
+
};
|
|
317
|
+
type TxInParameter = {
|
|
318
|
+
txHash: string;
|
|
319
|
+
txIndex: number;
|
|
320
|
+
amount?: Asset[];
|
|
321
|
+
address?: string;
|
|
322
|
+
};
|
|
323
|
+
type TxIn = PubKeyTxIn | SimpleScriptTxIn | ScriptTxIn;
|
|
324
|
+
type PubKeyTxIn = {
|
|
325
|
+
type: "PubKey";
|
|
326
|
+
txIn: TxInParameter;
|
|
327
|
+
};
|
|
328
|
+
type SimpleScriptTxIn = {
|
|
329
|
+
type: "SimpleScript";
|
|
330
|
+
txIn: TxInParameter;
|
|
331
|
+
simpleScriptTxIn: SimpleScriptTxInParameter;
|
|
332
|
+
};
|
|
333
|
+
type SimpleScriptTxInParameter = {
|
|
334
|
+
scriptSource?: {
|
|
335
|
+
type: "Provided";
|
|
336
|
+
script: string;
|
|
337
|
+
} | {
|
|
338
|
+
type: "Inline";
|
|
339
|
+
txInInfo: SimpleScriptSourceInfo;
|
|
340
|
+
};
|
|
341
|
+
};
|
|
342
|
+
type ScriptTxInParameter = {
|
|
343
|
+
scriptSource?: ScriptSource;
|
|
344
|
+
datumSource?: DatumSource;
|
|
345
|
+
redeemer?: Redeemer;
|
|
346
|
+
};
|
|
347
|
+
type ScriptTxIn = {
|
|
348
|
+
type: "Script";
|
|
349
|
+
txIn: TxInParameter;
|
|
350
|
+
scriptTxIn: ScriptTxInParameter;
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
type Certificate = {
|
|
354
|
+
type: "RegisterPool";
|
|
355
|
+
poolParams: PoolParams;
|
|
356
|
+
} | {
|
|
357
|
+
type: "RegisterStake";
|
|
358
|
+
stakeKeyHash: string;
|
|
359
|
+
} | {
|
|
360
|
+
type: "DelegateStake";
|
|
361
|
+
stakeKeyHash: string;
|
|
362
|
+
poolId: string;
|
|
363
|
+
} | {
|
|
364
|
+
type: "DeregisterStake";
|
|
365
|
+
stakeKeyHash: string;
|
|
366
|
+
} | {
|
|
367
|
+
type: "RetirePool";
|
|
368
|
+
poolId: string;
|
|
369
|
+
epoch: number;
|
|
370
|
+
} | {
|
|
371
|
+
type: "VoteDelegation";
|
|
372
|
+
stakeKeyHash: string;
|
|
373
|
+
drep: DRep;
|
|
374
|
+
} | {
|
|
375
|
+
type: "StakeAndVoteDelegation";
|
|
376
|
+
stakeKeyHash: string;
|
|
377
|
+
poolKeyHash: string;
|
|
378
|
+
drep: DRep;
|
|
379
|
+
} | {
|
|
380
|
+
type: "StakeRegistrationAndDelegation";
|
|
381
|
+
stakeKeyHash: string;
|
|
382
|
+
poolKeyHash: string;
|
|
383
|
+
coin: number;
|
|
384
|
+
} | {
|
|
385
|
+
type: "VoteRegistrationAndDelegation";
|
|
386
|
+
stakeKeyHash: string;
|
|
387
|
+
drep: DRep;
|
|
388
|
+
coin: number;
|
|
389
|
+
} | {
|
|
390
|
+
type: "StakeVoteRegistrationAndDelegation";
|
|
391
|
+
stakeKeyHash: string;
|
|
392
|
+
poolKeyHash: string;
|
|
393
|
+
drep: DRep;
|
|
394
|
+
coin: number;
|
|
395
|
+
} | {
|
|
396
|
+
type: "CommitteeHotAuth";
|
|
397
|
+
committeeColdKeyHash: string;
|
|
398
|
+
committeeHotKeyHash: string;
|
|
399
|
+
} | {
|
|
400
|
+
type: "CommitteeColdResign";
|
|
401
|
+
committeeColdKeyHash: string;
|
|
402
|
+
anchor?: Anchor;
|
|
403
|
+
} | {
|
|
404
|
+
type: "DRepRegistration";
|
|
405
|
+
votingKeyHash: string;
|
|
406
|
+
coin: number;
|
|
407
|
+
anchor?: Anchor;
|
|
408
|
+
} | {
|
|
409
|
+
type: "DRepDeregistration";
|
|
410
|
+
votingKeyHash: string;
|
|
411
|
+
coin: number;
|
|
412
|
+
} | {
|
|
413
|
+
type: "DRepUpdate";
|
|
414
|
+
votingKeyHash: string;
|
|
415
|
+
anchor: Anchor;
|
|
416
|
+
};
|
|
417
|
+
type DRep = {
|
|
418
|
+
keyHash: string;
|
|
419
|
+
} | {
|
|
420
|
+
scriptHash: string;
|
|
421
|
+
} | {
|
|
422
|
+
alwaysAbstain: {};
|
|
423
|
+
} | {
|
|
424
|
+
alwaysNoConfidence: {};
|
|
425
|
+
};
|
|
426
|
+
type Anchor = {
|
|
427
|
+
anchorUrl: string;
|
|
428
|
+
anchorDataHash: string;
|
|
429
|
+
};
|
|
430
|
+
type Withdrawal = {
|
|
431
|
+
pubKeyWithdrawal: {
|
|
432
|
+
address: string;
|
|
433
|
+
coin: string;
|
|
434
|
+
};
|
|
435
|
+
} | {
|
|
436
|
+
plutusScriptWithdrawal: {
|
|
437
|
+
address: string;
|
|
438
|
+
coin: string;
|
|
439
|
+
scriptSource?: ScriptSource;
|
|
440
|
+
redeemer?: Redeemer;
|
|
441
|
+
};
|
|
442
|
+
};
|
|
443
|
+
declare const certificateToObj: (certificate: Certificate) => object;
|
|
444
|
+
|
|
445
|
+
type MeshTxBuilderBody = {
|
|
446
|
+
inputs: TxIn[];
|
|
447
|
+
outputs: Output[];
|
|
448
|
+
extraInputs: UTxO[];
|
|
449
|
+
selectionThreshold: number;
|
|
450
|
+
collaterals: PubKeyTxIn[];
|
|
451
|
+
requiredSignatures: string[];
|
|
452
|
+
referenceInputs: RefTxIn[];
|
|
453
|
+
mints: MintItem[];
|
|
454
|
+
changeAddress: string;
|
|
455
|
+
metadata: Metadata[];
|
|
456
|
+
validityRange: ValidityRange;
|
|
457
|
+
certificates: Certificate[];
|
|
458
|
+
withdrawals: Withdrawal[];
|
|
459
|
+
signingKey: string[];
|
|
460
|
+
};
|
|
461
|
+
declare const emptyTxBuilderBody: () => MeshTxBuilderBody;
|
|
462
|
+
type ValidityRange = {
|
|
463
|
+
invalidBefore?: number;
|
|
464
|
+
invalidHereafter?: number;
|
|
465
|
+
};
|
|
466
|
+
type Metadata = {
|
|
467
|
+
tag: string;
|
|
468
|
+
metadata: string;
|
|
469
|
+
};
|
|
470
|
+
type RequiredWith<T, K extends keyof T> = Required<T> & {
|
|
471
|
+
[P in K]: Required<T[P]>;
|
|
472
|
+
};
|
|
473
|
+
declare const validityRangeToObj: (validityRange: ValidityRange) => object;
|
|
474
|
+
|
|
475
|
+
type DeserializedAddress = {
|
|
476
|
+
pubKeyHash: string;
|
|
477
|
+
scriptHash: string;
|
|
478
|
+
stakeCredentialHash: string;
|
|
479
|
+
stakeScriptCredentialHash: string;
|
|
480
|
+
};
|
|
481
|
+
|
|
482
|
+
type DeserializedScript = {
|
|
483
|
+
scriptHash: string;
|
|
484
|
+
scriptCbor?: string;
|
|
485
|
+
};
|
|
486
|
+
|
|
487
|
+
declare const DEFAULT_PROTOCOL_PARAMETERS: Protocol;
|
|
488
|
+
declare const resolveTxFees: (txSize: number, minFeeA?: number, minFeeB?: number) => string;
|
|
489
|
+
|
|
490
|
+
declare const SUPPORTED_WALLETS: string[];
|
|
491
|
+
|
|
492
|
+
declare const DEFAULT_V1_COST_MODEL_LIST: number[];
|
|
493
|
+
declare const DEFAULT_V2_COST_MODEL_LIST: number[];
|
|
494
|
+
|
|
495
|
+
declare const SUPPORTED_LANGUAGE_VIEWS: Record<Era, Partial<Record<keyof typeof LANGUAGE_VERSIONS, string>>>;
|
|
496
|
+
declare const resolveLanguageView: (era: Era, version: LanguageVersion) => string | undefined;
|
|
497
|
+
|
|
498
|
+
declare const DEFAULT_REDEEMER_BUDGET: Budget;
|
|
499
|
+
declare const POLICY_ID_LENGTH = 56;
|
|
500
|
+
declare const LANGUAGE_VERSIONS: {
|
|
501
|
+
V1: string;
|
|
502
|
+
V2: string;
|
|
503
|
+
V3: string;
|
|
504
|
+
};
|
|
505
|
+
declare const HARDENED_KEY_START = 2147483648;
|
|
506
|
+
declare const SUPPORTED_CLOCKS: Record<Network, [
|
|
507
|
+
epoch: string,
|
|
508
|
+
slot: string,
|
|
509
|
+
systemStart: string,
|
|
510
|
+
epochLength: string
|
|
511
|
+
]>;
|
|
512
|
+
declare const SUPPORTED_HANDLES: Record<number, string>;
|
|
513
|
+
declare const SUPPORTED_OGMIOS_LINKS: Record<Network, string>;
|
|
514
|
+
declare const SUPPORTED_TOKENS: {
|
|
515
|
+
LQ: string;
|
|
516
|
+
MIN: string;
|
|
517
|
+
NTX: string;
|
|
518
|
+
iBTC: string;
|
|
519
|
+
iETH: string;
|
|
520
|
+
iUSD: string;
|
|
521
|
+
MILK: string;
|
|
522
|
+
AGIX: string;
|
|
523
|
+
MELD: string;
|
|
524
|
+
INDY: string;
|
|
525
|
+
CLAY: string;
|
|
526
|
+
MCOS: string;
|
|
527
|
+
DING: string;
|
|
528
|
+
GERO: string;
|
|
529
|
+
NMKR: string;
|
|
530
|
+
PAVIA: string;
|
|
531
|
+
HOSKY: string;
|
|
532
|
+
YUMMI: string;
|
|
533
|
+
C3: string;
|
|
534
|
+
GIMBAL: string;
|
|
535
|
+
SUNDAE: string;
|
|
536
|
+
GREENS: string;
|
|
537
|
+
GENS: string;
|
|
538
|
+
SOCIETY: string;
|
|
539
|
+
DJED: string;
|
|
540
|
+
SHEN: string;
|
|
541
|
+
WMT: string;
|
|
542
|
+
COPI: string;
|
|
543
|
+
};
|
|
544
|
+
declare const CIP68_100: (tokenNameHex: string) => string;
|
|
545
|
+
declare const CIP68_222: (tokenNameHex: string) => string;
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* Fetcher interface defines end points to query blockchain data.
|
|
549
|
+
*/
|
|
550
|
+
interface IFetcher {
|
|
551
|
+
fetchAccountInfo(address: string): Promise<AccountInfo>;
|
|
552
|
+
fetchAddressUTxOs(address: string, asset?: string): Promise<UTxO[]>;
|
|
553
|
+
fetchAssetAddresses(asset: string): Promise<{
|
|
554
|
+
address: string;
|
|
555
|
+
quantity: string;
|
|
556
|
+
}[]>;
|
|
557
|
+
fetchAssetMetadata(asset: string): Promise<AssetMetadata>;
|
|
558
|
+
fetchBlockInfo(hash: string): Promise<BlockInfo>;
|
|
559
|
+
fetchCollectionAssets(policyId: string, cursor?: number | string): Promise<{
|
|
560
|
+
assets: Asset[];
|
|
561
|
+
next?: string | number | null;
|
|
562
|
+
}>;
|
|
563
|
+
fetchHandle(handle: string): Promise<object>;
|
|
564
|
+
fetchHandleAddress(handle: string): Promise<string>;
|
|
565
|
+
fetchProtocolParameters(epoch: number): Promise<Protocol>;
|
|
566
|
+
fetchTxInfo(hash: string): Promise<TransactionInfo>;
|
|
567
|
+
fetchUTxOs(hash: string): Promise<UTxO[]>;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
interface IInitiator {
|
|
571
|
+
getChangeAddress(): SometimesPromise$1<string>;
|
|
572
|
+
getCollateral(): SometimesPromise$1<UTxO[]>;
|
|
573
|
+
getUtxos(): SometimesPromise$1<UTxO[]>;
|
|
574
|
+
}
|
|
575
|
+
type SometimesPromise$1<T> = Promise<T> | T;
|
|
576
|
+
|
|
577
|
+
interface IListener {
|
|
578
|
+
onTxConfirmed(txHash: string, callback: () => void, limit?: number): void;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
interface ISubmitter {
|
|
582
|
+
submitTx(tx: string): Promise<string>;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
interface IMeshTxSerializer {
|
|
586
|
+
serializeTxBody(txBuilderBody: MeshTxBuilderBody, protocolParams: Protocol): string;
|
|
587
|
+
addSigningKeys(txHex: string, signingKeys: string[]): string;
|
|
588
|
+
resolver: IResolver;
|
|
589
|
+
deserializer: IDeserializer;
|
|
590
|
+
serializeData(data: BuilderData): string;
|
|
591
|
+
serializeAddress(address: DeserializedAddress, networkId?: 0 | 1): string;
|
|
592
|
+
}
|
|
593
|
+
interface IResolver {
|
|
594
|
+
keys: {
|
|
595
|
+
resolvePrivateKey(words: string[]): string;
|
|
596
|
+
resolveRewardAddress(bech32: string): string;
|
|
597
|
+
resolveEd25519KeyHash(bech32: string): string;
|
|
598
|
+
resolveStakeKeyHash(bech32: string): string;
|
|
599
|
+
};
|
|
600
|
+
tx: {
|
|
601
|
+
resolveTxHash(txHex: string): string;
|
|
602
|
+
};
|
|
603
|
+
data: {
|
|
604
|
+
resolveDataHash(data: Data): string;
|
|
605
|
+
};
|
|
606
|
+
script: {
|
|
607
|
+
resolveScriptRef(script: NativeScript | PlutusScript): string;
|
|
608
|
+
};
|
|
609
|
+
pool: {
|
|
610
|
+
resolvePoolId(hash: string): string;
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
interface IDeserializer {
|
|
614
|
+
key: {
|
|
615
|
+
deserializeAddress(bech32: string): DeserializedAddress;
|
|
616
|
+
};
|
|
617
|
+
script: {
|
|
618
|
+
deserializeNativeScript(script: NativeScript): DeserializedScript;
|
|
619
|
+
deserializePlutusScript(script: PlutusScript): DeserializedScript;
|
|
620
|
+
};
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
interface ISigner {
|
|
624
|
+
signData(address: string, payload: string): SometimesPromise<DataSignature>;
|
|
625
|
+
signTx(unsignedTx: string, partialSign: boolean): SometimesPromise<string>;
|
|
626
|
+
signTxs(unsignedTxs: string[], partialSign: boolean): SometimesPromise<string[]>;
|
|
627
|
+
}
|
|
628
|
+
type SometimesPromise<T> = Promise<T> | T;
|
|
629
|
+
|
|
630
|
+
interface IEvaluator {
|
|
631
|
+
evaluateTx(tx: string): Promise<Omit<Action, "data">[]>;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* The Mesh Data constructor object, representing custom data type
|
|
636
|
+
*/
|
|
637
|
+
type MConStr<T = any> = {
|
|
638
|
+
alternative: number;
|
|
639
|
+
fields: T;
|
|
640
|
+
};
|
|
641
|
+
/**
|
|
642
|
+
* The Mesh Data index 0 constructor object, representing custom data type
|
|
643
|
+
*/
|
|
644
|
+
type MConStr0<T = any> = MConStr<T>;
|
|
645
|
+
/**
|
|
646
|
+
* The Mesh Data index 1 constructor object, representing custom data type
|
|
647
|
+
*/
|
|
648
|
+
type MConStr1<T = any> = MConStr<T>;
|
|
649
|
+
/**
|
|
650
|
+
* The Mesh Data index 2 constructor object, representing custom data type
|
|
651
|
+
*/
|
|
652
|
+
type MConStr2<T = any> = MConStr<T>;
|
|
653
|
+
/**
|
|
654
|
+
* The utility function to create a Mesh Data constructor object, representing custom data type
|
|
655
|
+
* @param alternative The constructor index number
|
|
656
|
+
* @param fields The items in array
|
|
657
|
+
* @returns The Mesh Data constructor object
|
|
658
|
+
*/
|
|
659
|
+
declare const mConStr: <T extends Data[]>(alternative: number, fields: T) => MConStr<T>;
|
|
660
|
+
/**
|
|
661
|
+
* The utility function to create a Mesh Data index 0 constructor object, representing custom data type
|
|
662
|
+
* @param alternative The constructor index number
|
|
663
|
+
* @param fields The items in array
|
|
664
|
+
* @returns The Mesh Data constructor object
|
|
665
|
+
*/
|
|
666
|
+
declare const mConStr0: <T extends Data[]>(fields: T) => MConStr0<T>;
|
|
667
|
+
/**
|
|
668
|
+
* The utility function to create a Mesh Data index 1 constructor object, representing custom data type
|
|
669
|
+
* @param alternative The constructor index number
|
|
670
|
+
* @param fields The items in array
|
|
671
|
+
* @returns The Mesh Data constructor object
|
|
672
|
+
*/
|
|
673
|
+
declare const mConStr1: <T extends Data[]>(fields: T) => MConStr1<T>;
|
|
674
|
+
/**
|
|
675
|
+
* The utility function to create a Mesh Data index 2 constructor object, representing custom data type
|
|
676
|
+
* @param alternative The constructor index number
|
|
677
|
+
* @param fields The items in array
|
|
678
|
+
* @returns The Mesh Data constructor object
|
|
679
|
+
*/
|
|
680
|
+
declare const mConStr2: <T extends Data[]>(fields: T) => MConStr2<T>;
|
|
681
|
+
|
|
682
|
+
/**
|
|
683
|
+
* PlutusTx alias
|
|
684
|
+
* The Mesh Data asset class
|
|
685
|
+
*/
|
|
686
|
+
type MAssetClass = MConStr0<[string, string]>;
|
|
687
|
+
/**
|
|
688
|
+
* Aiken alias
|
|
689
|
+
* The Mesh Data output reference
|
|
690
|
+
*/
|
|
691
|
+
type MOutputReference = MConStr0<[MConStr0<[string]>, number]>;
|
|
692
|
+
/**
|
|
693
|
+
* PlutusTx alias
|
|
694
|
+
* The Mesh Data TxOutRef
|
|
695
|
+
*/
|
|
696
|
+
type MTxOutRef = MConStr0<[MConStr0<[string]>, number]>;
|
|
697
|
+
/**
|
|
698
|
+
* Aiken alias
|
|
699
|
+
* The Mesh Data tuple
|
|
700
|
+
*/
|
|
701
|
+
type MTuple<K, V> = [K, V];
|
|
702
|
+
/**
|
|
703
|
+
* The utility function to create a Mesh Data asset class
|
|
704
|
+
* @param currencySymbolHex The currency symbol in hex
|
|
705
|
+
* @param tokenNameHex The token name in hex
|
|
706
|
+
* @returns The Mesh Data asset class object
|
|
707
|
+
*/
|
|
708
|
+
declare const mAssetClass: (currencySymbolHex: string, tokenNameHex: string) => MAssetClass;
|
|
709
|
+
/**
|
|
710
|
+
* The utility function to create a Mesh Data output reference in Mesh Data type
|
|
711
|
+
* @param txHash The transaction hash
|
|
712
|
+
* @param index The index of the output
|
|
713
|
+
* @returns The Mesh Data output reference object
|
|
714
|
+
*/
|
|
715
|
+
declare const mOutputReference: (txHash: string, index: number) => MOutputReference;
|
|
716
|
+
/**
|
|
717
|
+
* The utility function to create a Mesh Data TxOutRef in Mesh Data type
|
|
718
|
+
* @param txHash The transaction hash
|
|
719
|
+
* @param index The index of the output
|
|
720
|
+
* @returns The Mesh Data TxOutRef object
|
|
721
|
+
*/
|
|
722
|
+
declare const mTxOutRef: (txHash: string, index: number) => MTxOutRef;
|
|
723
|
+
/**
|
|
724
|
+
* The utility function to create a Mesh Data tuple in Mesh Data type
|
|
725
|
+
* @param key The key of the tuple
|
|
726
|
+
* @param value The value of the tuple
|
|
727
|
+
* @returns The Mesh Data tuple object
|
|
728
|
+
*/
|
|
729
|
+
declare const mTuple: <K, V>(key: K, value: V) => MTuple<K, V>;
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
* The Mesh Data staking credential
|
|
733
|
+
*/
|
|
734
|
+
type MMaybeStakingHash = MConStr1<[]> | MConStr0<[MConStr0<[MConStr0<[string]>]>]> | MConStr0<[MConStr0<[MConStr1<[string]>]>]>;
|
|
735
|
+
/**
|
|
736
|
+
* The Mesh Data public key address
|
|
737
|
+
*/
|
|
738
|
+
type MPubKeyAddress = MConStr0<[MConStr0<[string]>, MMaybeStakingHash]>;
|
|
739
|
+
/**
|
|
740
|
+
* The Mesh Data script address
|
|
741
|
+
*/
|
|
742
|
+
type MScriptAddress = MConStr0<[MConStr1<[string]>, MMaybeStakingHash]>;
|
|
743
|
+
/**
|
|
744
|
+
* The utility function to create a Mesh Data staking hash
|
|
745
|
+
* @param stakeCredential The staking credential in hex
|
|
746
|
+
* @param isScriptCredential The flag to indicate if the credential is a script credential
|
|
747
|
+
* @returns The Mesh Data staking hash object
|
|
748
|
+
*/
|
|
749
|
+
declare const mMaybeStakingHash: (stakeCredential: string, isScriptCredential?: boolean) => MMaybeStakingHash;
|
|
750
|
+
/**
|
|
751
|
+
* The utility function to create a Mesh Data public key address
|
|
752
|
+
* @param bytes The public key hash in hex
|
|
753
|
+
* @param stakeCredential The staking credential in hex
|
|
754
|
+
* @param isScriptCredential The flag to indicate if the credential is a script credential
|
|
755
|
+
* @returns The Mesh Data public key address object
|
|
756
|
+
*/
|
|
757
|
+
declare const mPubKeyAddress: (bytes: string, stakeCredential?: string, isScriptCredential?: boolean) => Data;
|
|
758
|
+
/**
|
|
759
|
+
* The utility function to create a Mesh Data script address
|
|
760
|
+
* @param bytes The validator hash in hex
|
|
761
|
+
* @param stakeCredential The staking credential in hex
|
|
762
|
+
* @param isScriptCredential The flag to indicate if the credential is a script credential
|
|
763
|
+
* @returns The Mesh Data script address object
|
|
764
|
+
*/
|
|
765
|
+
declare const mScriptAddress: (bytes: string, stakeCredential?: string, isScriptCredential?: boolean) => Data;
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* The Mesh Data boolean
|
|
769
|
+
*/
|
|
770
|
+
type MBool = MConStr0<[]> | MConStr1<[]>;
|
|
771
|
+
/**
|
|
772
|
+
* The utility function to create a Mesh Data boolean
|
|
773
|
+
* @param b boolean value
|
|
774
|
+
* @returns The Mesh Data boolean object
|
|
775
|
+
*/
|
|
776
|
+
declare const mBool: (b: boolean) => MBool;
|
|
777
|
+
/**
|
|
778
|
+
* Converting a hex string into a BuiltinByteString Array, with max 32 bytes on each items
|
|
779
|
+
* @param hexString The hex string to be converted into BuiltinByteString Array
|
|
780
|
+
* @returns The BuiltinByteString Array representation of the hex string
|
|
781
|
+
*/
|
|
782
|
+
declare const mStringToPlutusBSArray: (hexString: string) => string[];
|
|
783
|
+
/**
|
|
784
|
+
* Converting BuiltinByteString Array into a single string
|
|
785
|
+
* @param bsArray The BuiltinByteString Array to be converted into a single string
|
|
786
|
+
* @returns The string representation of the BuiltinByteString Array
|
|
787
|
+
*/
|
|
788
|
+
declare const mPlutusBSArrayToString: (bsArray: string[]) => string;
|
|
789
|
+
|
|
790
|
+
/**
|
|
791
|
+
* The Plutus Data constructor object, representing custom data type in JSON
|
|
792
|
+
*/
|
|
793
|
+
type ConStr<T = any> = {
|
|
794
|
+
constructor: number;
|
|
795
|
+
fields: T;
|
|
796
|
+
};
|
|
797
|
+
/**
|
|
798
|
+
* The Plutus Data index 0 constructor object, representing custom data type in JSON
|
|
799
|
+
*/
|
|
800
|
+
type ConStr0<T = any> = ConStr<T>;
|
|
801
|
+
/**
|
|
802
|
+
* The Plutus Data index 1 constructor object, representing custom data type in JSON
|
|
803
|
+
*/
|
|
804
|
+
type ConStr1<T = any> = ConStr<T>;
|
|
805
|
+
/**
|
|
806
|
+
* The Plutus Data index 2 constructor object, representing custom data type in JSON
|
|
807
|
+
*/
|
|
808
|
+
type ConStr2<T = any> = ConStr<T>;
|
|
809
|
+
/**
|
|
810
|
+
* The utility function to create a Plutus Data constructor object, representing custom data type in JSON
|
|
811
|
+
* @param constructor The constructor index number
|
|
812
|
+
* @param fields The items in array
|
|
813
|
+
* @returns The Plutus Data constructor object
|
|
814
|
+
*/
|
|
815
|
+
declare const conStr: <T>(constructor: number, fields: T) => ConStr<T>;
|
|
816
|
+
/**
|
|
817
|
+
* The utility function to create a Plutus Data index 0 constructor object, representing custom data type in JSON
|
|
818
|
+
* @param fields The items of in array
|
|
819
|
+
* @returns The Plutus Data constructor object
|
|
820
|
+
*/
|
|
821
|
+
declare const conStr0: <T>(fields: T) => ConStr0<T>;
|
|
822
|
+
/**
|
|
823
|
+
* The utility function to create a Plutus Data index 1 constructor object, representing custom data type in JSON
|
|
824
|
+
* @param fields The items of in array
|
|
825
|
+
* @returns The Plutus Data constructor object
|
|
826
|
+
*/
|
|
827
|
+
declare const conStr1: <T>(fields: T) => ConStr1<T>;
|
|
828
|
+
/**
|
|
829
|
+
* The utility function to create a Plutus Data index 2 constructor object, representing custom data type in JSON
|
|
830
|
+
* @param fields The items of in array
|
|
831
|
+
* @returns The Plutus Data constructor object
|
|
832
|
+
*/
|
|
833
|
+
declare const conStr2: <T>(fields: T) => ConStr2<T>;
|
|
834
|
+
|
|
835
|
+
/**
|
|
836
|
+
* The Plutus Data boolean in JSON
|
|
837
|
+
*/
|
|
838
|
+
type Bool = ConStr0<[]> | ConStr1<[]>;
|
|
839
|
+
/**
|
|
840
|
+
* The Plutus Data byte string, representing in hex, in JSON
|
|
841
|
+
*/
|
|
842
|
+
type BuiltinByteString = {
|
|
843
|
+
bytes: string;
|
|
844
|
+
};
|
|
845
|
+
/**
|
|
846
|
+
* The Plutus Data byte string, representing in hex, in JSON
|
|
847
|
+
*/
|
|
848
|
+
type ByteString = {
|
|
849
|
+
bytes: string;
|
|
850
|
+
};
|
|
851
|
+
/**
|
|
852
|
+
* The Plutus Data integer in JSON
|
|
853
|
+
*/
|
|
854
|
+
type Integer = {
|
|
855
|
+
int: number | bigint;
|
|
856
|
+
};
|
|
857
|
+
/**
|
|
858
|
+
* The Plutus Data list in JSON
|
|
859
|
+
*/
|
|
860
|
+
type List<T = any> = {
|
|
861
|
+
list: T[];
|
|
862
|
+
};
|
|
863
|
+
/**
|
|
864
|
+
* PlutusTx alias
|
|
865
|
+
* The Plutus Data association map item in JSON
|
|
866
|
+
*/
|
|
867
|
+
type AssocMapItem<K, V> = {
|
|
868
|
+
k: K;
|
|
869
|
+
v: V;
|
|
870
|
+
};
|
|
871
|
+
/**
|
|
872
|
+
* The Plutus Data association map in JSON
|
|
873
|
+
*/
|
|
874
|
+
type AssocMap<K = any, V = any> = {
|
|
875
|
+
map: AssocMapItem<K, V>[];
|
|
876
|
+
};
|
|
877
|
+
/**
|
|
878
|
+
* The utility function to create a Plutus Data boolean in JSON
|
|
879
|
+
* @param b boolean value
|
|
880
|
+
* @returns The Plutus Data boolean object
|
|
881
|
+
*/
|
|
882
|
+
declare const bool: (b: boolean) => Bool;
|
|
883
|
+
/**
|
|
884
|
+
* The utility function to create a Plutus Data byte string in JSON
|
|
885
|
+
* @param bytes The byte string in hex
|
|
886
|
+
* @returns The Plutus Data byte string object
|
|
887
|
+
*/
|
|
888
|
+
declare const builtinByteString: (bytes: string) => BuiltinByteString;
|
|
889
|
+
/**
|
|
890
|
+
* The utility function to create a Plutus Data byte string in JSON
|
|
891
|
+
* @param bytes The byte string in hex
|
|
892
|
+
* @returns The Plutus Data byte string object
|
|
893
|
+
*/
|
|
894
|
+
declare const byteString: (bytes: string) => ByteString;
|
|
895
|
+
/**
|
|
896
|
+
* The utility function to create a Plutus Data integer in JSON
|
|
897
|
+
* @param int The integer value
|
|
898
|
+
* @returns The Plutus Data integer object
|
|
899
|
+
*/
|
|
900
|
+
declare const integer: (int: number | bigint) => Integer;
|
|
901
|
+
/**
|
|
902
|
+
* The utility function to create a Plutus Data list in JSON
|
|
903
|
+
* @param pList The list of Plutus Data
|
|
904
|
+
* @param validation Default true - If current data construction would perform validation (introducing this flag due to possible performance issue in loop validation)
|
|
905
|
+
* @returns The Plutus Data list object
|
|
906
|
+
*/
|
|
907
|
+
declare const list: <T = PlutusData>(pList: T[], validation?: boolean) => List<T>;
|
|
908
|
+
/**
|
|
909
|
+
* Converting a hex string into a ByteString Array, with max 32 bytes on each items
|
|
910
|
+
* @param hexString The hex string to be converted into ByteString Array
|
|
911
|
+
* @returns The ByteString Array representation of the hex string
|
|
912
|
+
*/
|
|
913
|
+
declare const stringToBSArray: (hexString: string) => List<ByteString>;
|
|
914
|
+
/**
|
|
915
|
+
* Converting ByteString Array into a single string
|
|
916
|
+
* @param bsArray The ByteString Array to be converted into a single string
|
|
917
|
+
* @returns The string representation of the ByteString Array
|
|
918
|
+
*/
|
|
919
|
+
declare const plutusBSArrayToString: (bsArray: List<ByteString>) => string;
|
|
920
|
+
/**
|
|
921
|
+
* The utility function to create a Plutus Data association map in JSON
|
|
922
|
+
* @param mapItems The items map in array
|
|
923
|
+
* @param validation Default true - If current data construction would perform validation (introducing this flag due to possible performance issue in loop validation)
|
|
924
|
+
* @returns The Plutus Data association map object
|
|
925
|
+
*/
|
|
926
|
+
declare const assocMap: <K, V>(mapItems: [K, V][], validation?: boolean) => AssocMap<K, V>;
|
|
927
|
+
|
|
928
|
+
/**
|
|
929
|
+
* All the type aliases here represent the type name used in smart contracts from PlutusTx or Aiken.
|
|
930
|
+
* Please be aware that the types constructed here will be invalid when PlutusTx or Aiken team introduces breaking changes.
|
|
931
|
+
*/
|
|
932
|
+
|
|
933
|
+
/**
|
|
934
|
+
* The Plutus Data script hash in JSON
|
|
935
|
+
*/
|
|
936
|
+
type ScriptHash = ByteString;
|
|
937
|
+
/**
|
|
938
|
+
* The Plutus Data public key hash in JSON
|
|
939
|
+
*/
|
|
940
|
+
type PubKeyHash = ByteString;
|
|
941
|
+
/**
|
|
942
|
+
* Aiken alias
|
|
943
|
+
* The Plutus Data policy id in JSON
|
|
944
|
+
*/
|
|
945
|
+
type PolicyId = ByteString;
|
|
946
|
+
/**
|
|
947
|
+
* PlutusTx alias
|
|
948
|
+
* The Plutus Data currency symbol in JSON
|
|
949
|
+
*/
|
|
950
|
+
type CurrencySymbol = ByteString;
|
|
951
|
+
/**
|
|
952
|
+
* Aiken alias
|
|
953
|
+
* The Plutus Data asset name in JSON
|
|
954
|
+
*/
|
|
955
|
+
type AssetName = ByteString;
|
|
956
|
+
/**
|
|
957
|
+
* PlutusTx alias
|
|
958
|
+
* The Plutus Data token name in JSON
|
|
959
|
+
*/
|
|
960
|
+
type TokenName = ByteString;
|
|
961
|
+
/**
|
|
962
|
+
* PlutusTx alias
|
|
963
|
+
* The Plutus Data asset class in JSON
|
|
964
|
+
*/
|
|
965
|
+
type AssetClass = ConStr0<[CurrencySymbol, TokenName]>;
|
|
966
|
+
/**
|
|
967
|
+
* Aiken alias
|
|
968
|
+
* The Plutus Data output reference in JSON
|
|
969
|
+
*/
|
|
970
|
+
type OutputReference = ConStr0<[ConStr0<[ByteString]>, Integer]>;
|
|
971
|
+
/**
|
|
972
|
+
* PlutusTx alias
|
|
973
|
+
* The Plutus Data TxOutRef in JSON
|
|
974
|
+
*/
|
|
975
|
+
type TxOutRef = ConStr0<[ConStr0<[ByteString]>, Integer]>;
|
|
976
|
+
/**
|
|
977
|
+
* PlutusTx alias
|
|
978
|
+
* The Plutus Data POSIX time in JSON
|
|
979
|
+
*/
|
|
980
|
+
type POSIXTime = Integer;
|
|
981
|
+
/**
|
|
982
|
+
* Aiken alias
|
|
983
|
+
* The Plutus Data dictionary item in JSON
|
|
984
|
+
*/
|
|
985
|
+
type DictItem<V> = {
|
|
986
|
+
k: ByteString;
|
|
987
|
+
v: V;
|
|
988
|
+
};
|
|
989
|
+
/**
|
|
990
|
+
* Aiken alias
|
|
991
|
+
* The Plutus Data dictionary in JSON
|
|
992
|
+
*/
|
|
993
|
+
type Dict<V> = {
|
|
994
|
+
map: DictItem<V>[];
|
|
995
|
+
};
|
|
996
|
+
/**
|
|
997
|
+
* Aiken alias
|
|
998
|
+
* The Plutus Data tuple in JSON
|
|
999
|
+
*/
|
|
1000
|
+
type Tuple<K, V> = {
|
|
1001
|
+
list: [K, V];
|
|
1002
|
+
};
|
|
1003
|
+
/**
|
|
1004
|
+
* Internal utility function to create a Plutus Data byte string in JSON, checking correct length
|
|
1005
|
+
* @param bytes The byte string in hex
|
|
1006
|
+
* @returns The Plutus Data byte string object
|
|
1007
|
+
*/
|
|
1008
|
+
declare const hashByteString: (bytes: string) => ByteString;
|
|
1009
|
+
/**
|
|
1010
|
+
* The utility function to create a Plutus Data script hash in JSON
|
|
1011
|
+
* @param bytes The script hash in hex
|
|
1012
|
+
* @returns The Plutus Data script hash object
|
|
1013
|
+
*/
|
|
1014
|
+
declare const scriptHash: (bytes: string) => ScriptHash;
|
|
1015
|
+
/**
|
|
1016
|
+
* The utility function to create a Plutus Data pub key hash in JSON
|
|
1017
|
+
* @param bytes The script hash in hex
|
|
1018
|
+
* @returns The Plutus Data script hash object
|
|
1019
|
+
*/
|
|
1020
|
+
declare const pubKeyHash: (bytes: string) => ScriptHash;
|
|
1021
|
+
/**
|
|
1022
|
+
* The utility function to create a Plutus Data policy id in JSON
|
|
1023
|
+
* @param bytes The policy id in hex
|
|
1024
|
+
* @returns The Plutus Data policy id object
|
|
1025
|
+
*/
|
|
1026
|
+
declare const policyId: (bytes: string) => PolicyId;
|
|
1027
|
+
/**
|
|
1028
|
+
* The utility function to create a Plutus Data currency symbol in JSON
|
|
1029
|
+
* @param bytes The policy id in hex
|
|
1030
|
+
* @returns The Plutus Data policy id object
|
|
1031
|
+
*/
|
|
1032
|
+
declare const currencySymbol: (bytes: string) => CurrencySymbol;
|
|
1033
|
+
/**
|
|
1034
|
+
* The utility function to create a Plutus Data asset name in JSON
|
|
1035
|
+
* @param bytes The asset name in hex
|
|
1036
|
+
* @returns The Plutus Data asset name object
|
|
1037
|
+
*/
|
|
1038
|
+
declare const assetName: (bytes: string) => AssetName;
|
|
1039
|
+
/**
|
|
1040
|
+
* The utility function to create a Plutus Data token name in JSON
|
|
1041
|
+
* @param bytes The token name in hex
|
|
1042
|
+
* @returns The Plutus Data token name object
|
|
1043
|
+
*/
|
|
1044
|
+
declare const tokenName: (bytes: string) => TokenName;
|
|
1045
|
+
/**
|
|
1046
|
+
* The utility function to create a Plutus Data asset class in JSON
|
|
1047
|
+
* @param currencySymbolHex The currency symbol in hex
|
|
1048
|
+
* @param tokenNameHex The token name in hex
|
|
1049
|
+
* @returns The Plutus Data asset class object
|
|
1050
|
+
*/
|
|
1051
|
+
declare const assetClass: (currencySymbolHex: string, tokenNameHex: string) => AssetClass;
|
|
1052
|
+
/**
|
|
1053
|
+
* The utility function to create a Plutus Data output reference in JSON
|
|
1054
|
+
* @param txHash The transaction hash
|
|
1055
|
+
* @param index The index of the output
|
|
1056
|
+
* @returns The Plutus Data output reference object
|
|
1057
|
+
*/
|
|
1058
|
+
declare const outputReference: (txHash: string, index: number) => OutputReference;
|
|
1059
|
+
/**
|
|
1060
|
+
* The utility function to create a Plutus Data TxOutRef in JSON
|
|
1061
|
+
* @param txHash The transaction hash
|
|
1062
|
+
* @param index The index of the output
|
|
1063
|
+
* @returns The Plutus Data TxOutRef object
|
|
1064
|
+
*/
|
|
1065
|
+
declare const txOutRef: (txHash: string, index: number) => TxOutRef;
|
|
1066
|
+
/**
|
|
1067
|
+
* The utility function to create a Plutus Data POSIX time in JSON
|
|
1068
|
+
* @param int The integer value of the POSIX time
|
|
1069
|
+
* @returns The Plutus Data POSIX time object
|
|
1070
|
+
*/
|
|
1071
|
+
declare const posixTime: (int: number) => POSIXTime;
|
|
1072
|
+
/**
|
|
1073
|
+
* The utility function to create a Plutus Data dictionary in JSON
|
|
1074
|
+
* @param itemsMap The items map in array
|
|
1075
|
+
* @returns The Plutus Data dictionary object
|
|
1076
|
+
*/
|
|
1077
|
+
declare const dict: <V>(itemsMap: [ByteString, V][]) => Dict<V>;
|
|
1078
|
+
/**
|
|
1079
|
+
* The utility function to create a Plutus Data tuple in JSON
|
|
1080
|
+
* @param key The key of the tuple
|
|
1081
|
+
* @param value The value of the tuple
|
|
1082
|
+
* @returns The Plutus Data tuple object
|
|
1083
|
+
*/
|
|
1084
|
+
declare const tuple: <K = PlutusData, V = PlutusData>(key: K, value: V) => Tuple<K, V>;
|
|
1085
|
+
|
|
1086
|
+
/**
|
|
1087
|
+
* The Plutus Data staking credential in JSON
|
|
1088
|
+
*/
|
|
1089
|
+
type MaybeStakingHash = ConStr1<[]> | ConStr0<[ConStr0<[ConStr0<[PubKeyHash]>]>]> | ConStr0<[ConStr0<[ConStr1<[ScriptHash]>]>]>;
|
|
1090
|
+
/**
|
|
1091
|
+
* The Plutus Data public key address in JSON
|
|
1092
|
+
*/
|
|
1093
|
+
type PubKeyAddress = ConStr0<[ConStr0<[PubKeyHash]>, MaybeStakingHash]>;
|
|
1094
|
+
/**
|
|
1095
|
+
* The Plutus Data script address in JSON
|
|
1096
|
+
*/
|
|
1097
|
+
type ScriptAddress = ConStr0<[ConStr1<[ScriptHash]>, MaybeStakingHash]>;
|
|
1098
|
+
/**
|
|
1099
|
+
* The utility function to create a Plutus Data staking hash in JSON
|
|
1100
|
+
* @param stakeCredential The staking credential in hex
|
|
1101
|
+
* @param isScriptCredential The flag to indicate if the credential is a script credential
|
|
1102
|
+
* @returns The Plutus Data staking hash object
|
|
1103
|
+
*/
|
|
1104
|
+
declare const maybeStakingHash: (stakeCredential: string, isScriptCredential?: boolean) => MaybeStakingHash;
|
|
1105
|
+
/**
|
|
1106
|
+
* The utility function to create a Plutus Data public key address in JSON
|
|
1107
|
+
* @param bytes The public key hash in hex
|
|
1108
|
+
* @param stakeCredential The staking credential in hex
|
|
1109
|
+
* @param isScriptCredential The flag to indicate if the credential is a script credential
|
|
1110
|
+
* @returns The Plutus Data public key address object
|
|
1111
|
+
*/
|
|
1112
|
+
declare const pubKeyAddress: (bytes: string, stakeCredential?: string, isScriptCredential?: boolean) => PubKeyAddress;
|
|
1113
|
+
/**
|
|
1114
|
+
* The utility function to create a Plutus Data script address in JSON
|
|
1115
|
+
* @param bytes The validator hash in hex
|
|
1116
|
+
* @param stakeCredential The staking credential in hex
|
|
1117
|
+
* @param isScriptCredential The flag to indicate if the credential is a script credential
|
|
1118
|
+
* @returns The Plutus Data script address object
|
|
1119
|
+
*/
|
|
1120
|
+
declare const scriptAddress: (bytes: string, stakeCredential?: string, isScriptCredential?: boolean) => ScriptAddress;
|
|
1121
|
+
|
|
1122
|
+
type PlutusData = ConStr | Bool | ByteString | Integer | List | AssocMap | MaybeStakingHash | PubKeyAddress | ScriptAddress | AssetClass | OutputReference | PubKeyHash | POSIXTime | Dict<any> | Tuple<any, any>;
|
|
1123
|
+
|
|
1124
|
+
declare const bytesToHex: (bytes: ArrayBuffer) => string;
|
|
1125
|
+
declare const hexToBytes: (hex: string) => Buffer;
|
|
1126
|
+
declare const stringToHex: (str: string) => string;
|
|
1127
|
+
declare const hexToString: (hex: string) => string;
|
|
1128
|
+
declare const toBytes: (hex: string) => Uint8Array;
|
|
1129
|
+
declare const fromUTF8: (utf8: string) => string;
|
|
1130
|
+
declare const toUTF8: (hex: string) => string;
|
|
1131
|
+
declare const parseAssetUnit: (unit: string) => {
|
|
1132
|
+
policyId: string;
|
|
1133
|
+
assetName: string;
|
|
1134
|
+
};
|
|
1135
|
+
|
|
1136
|
+
type SlotConfig = {
|
|
1137
|
+
zeroTime: number;
|
|
1138
|
+
zeroSlot: number;
|
|
1139
|
+
slotLength: number;
|
|
1140
|
+
startEpoch: number;
|
|
1141
|
+
epochLength: number;
|
|
1142
|
+
};
|
|
1143
|
+
declare const SLOT_CONFIG_NETWORK: Record<Network, SlotConfig>;
|
|
1144
|
+
declare const slotToBeginUnixTime: (slot: number, slotConfig: SlotConfig) => number;
|
|
1145
|
+
declare const unixTimeToEnclosingSlot: (unixTime: number, slotConfig: SlotConfig) => number;
|
|
1146
|
+
declare const resolveSlotNo: (network: Network, milliseconds?: number) => string;
|
|
1147
|
+
declare const resolveEpochNo: (network: Network, milliseconds?: number) => number;
|
|
1148
|
+
|
|
1149
|
+
/**
|
|
1150
|
+
* It is suggested to keep the value representation as map of map,
|
|
1151
|
+
* where first key as policy id, second key as asset name, and final value as quantity.
|
|
1152
|
+
*/
|
|
1153
|
+
|
|
1154
|
+
type Value = AssocMap<CurrencySymbol, AssocMap<TokenName, Integer>>;
|
|
1155
|
+
type MValue = Map<string, Map<string, bigint>>;
|
|
1156
|
+
declare const value: (assets: Asset[]) => Value;
|
|
1157
|
+
declare const parsePlutusValueToAssets: (plutusValue: Value) => Asset[];
|
|
1158
|
+
|
|
1159
|
+
declare class BigNum {
|
|
1160
|
+
value: bigint;
|
|
1161
|
+
constructor(value: number | string);
|
|
1162
|
+
divFloor(other: BigNum): BigNum;
|
|
1163
|
+
checkedMul(other: BigNum): BigNum;
|
|
1164
|
+
checkedAdd(other: BigNum): BigNum;
|
|
1165
|
+
checkedSub(other: BigNum): BigNum;
|
|
1166
|
+
clampedSub(other: BigNum): BigNum;
|
|
1167
|
+
lessThan(other: BigNum): boolean;
|
|
1168
|
+
compare(other: BigNum): -1 | 0 | 1;
|
|
1169
|
+
static new: (value: number | string) => BigNum;
|
|
1170
|
+
toString(): string;
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
declare const AssetFingerprint: typeof CIP14;
|
|
1174
|
+
declare const resolveFingerprint: (policyId: string, assetName: string) => any;
|
|
1175
|
+
|
|
1176
|
+
export { type AccountInfo, type Action, type Anchor, type Asset, type AssetClass, type AssetExtended, AssetFingerprint, type AssetMetadata, type AssetName, type AssocMap, type AssocMapItem, BigNum, type BlockInfo, type Bool, type Budget, type BuilderData, type BuiltinByteString, type ByteString, CIP68_100, CIP68_222, type Certificate, type ConStr, type ConStr0, type ConStr1, type ConStr2, type CurrencySymbol, DEFAULT_PROTOCOL_PARAMETERS, DEFAULT_REDEEMER_BUDGET, DEFAULT_V1_COST_MODEL_LIST, DEFAULT_V2_COST_MODEL_LIST, type DRep, type Data, type DataSignature, type DatumSource, type DeserializedAddress, type DeserializedScript, type Dict, type DictItem, type Era, type Files, type FungibleAssetMetadata, HARDENED_KEY_START, type IDeserializer, type IEvaluator, type IFetcher, type IInitiator, type IListener, type IMeshTxSerializer, type IResolver, type ISigner, type ISubmitter, type ImageAssetMetadata, type Integer, LANGUAGE_VERSIONS, type LanguageVersion, type List, type MAssetClass, type MBool, type MConStr, type MConStr0, type MConStr1, type MConStr2, type MMaybeStakingHash, type MOutputReference, type MPubKeyAddress, type MScriptAddress, type MTuple, type MTxOutRef, type MValue, type MaybeStakingHash, type MeshTxBuilderBody, type Message, type Metadata, type Mint, type MintItem, type NativeScript, type Network, type NonFungibleAssetMetadata, type Output, type OutputReference, POLICY_ID_LENGTH, type POSIXTime, type PlutusData, type PlutusScript, type PolicyId, type PoolMetadata, type PoolParams, type Protocol, type PubKeyAddress, type PubKeyHash, type PubKeyTxIn, type Quantity, type Recipient, type Redeemer, type RedeemerTagType, type RefTxIn, type Relay, type RequiredWith, type RoyaltiesStandard, SLOT_CONFIG_NETWORK, SUPPORTED_CLOCKS, SUPPORTED_HANDLES, SUPPORTED_LANGUAGE_VIEWS, SUPPORTED_OGMIOS_LINKS, SUPPORTED_TOKENS, SUPPORTED_WALLETS, type ScriptAddress, type ScriptHash, type ScriptSource, type ScriptTxIn, type ScriptTxInParameter, type SimpleScriptSourceInfo, type SimpleScriptTxIn, type SimpleScriptTxInParameter, type SlotConfig, type Token, type TokenName, type TransactionInfo, type Tuple, type TxIn, type TxInParameter, type TxOutRef, type UTxO, type Unit, type ValidityRange, type Value, type Wallet, type Withdrawal, assetClass, assetName, assocMap, bool, builtinByteString, byteString, bytesToHex, certificateToObj, conStr, conStr0, conStr1, conStr2, currencySymbol, dict, emptyTxBuilderBody, fromUTF8, fungibleAssetKeys, hashByteString, hexToBytes, hexToString, integer, isNetwork, list, mAssetClass, mBool, mConStr, mConStr0, mConStr1, mConStr2, mMaybeStakingHash, mOutputReference, mPlutusBSArrayToString, mPubKeyAddress, mScriptAddress, mStringToPlutusBSArray, mTuple, mTxOutRef, maybeStakingHash, mergeAssets, metadataStandardKeys, metadataToCip68, outputReference, parseAssetUnit, parsePlutusValueToAssets, plutusBSArrayToString, policyId, poolMetadataToObj, poolParamsToObj, posixTime, pubKeyAddress, pubKeyHash, relayToObj, resolveEpochNo, resolveFingerprint, resolveLanguageView, resolveSlotNo, resolveTxFees, royaltiesStandardKeys, scriptAddress, scriptHash, slotToBeginUnixTime, stringToBSArray, stringToHex, toBytes, toUTF8, tokenName, tuple, txOutRef, unixTimeToEnclosingSlot, validityRangeToObj, value };
|