@meshsdk/common 1.6.1 → 1.6.3
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.cjs +1635 -1
- package/dist/index.d.cts +261 -97
- package/dist/index.d.ts +261 -97
- package/dist/index.js +1505 -1
- package/package.json +8 -8
package/dist/index.d.cts
CHANGED
|
@@ -173,7 +173,6 @@ type Relay = {
|
|
|
173
173
|
type: "MultiHostName";
|
|
174
174
|
domainName: string;
|
|
175
175
|
};
|
|
176
|
-
declare const relayToObj: (relay: Relay) => object;
|
|
177
176
|
|
|
178
177
|
type PoolParams = {
|
|
179
178
|
vrfKeyHash: string;
|
|
@@ -186,12 +185,10 @@ type PoolParams = {
|
|
|
186
185
|
rewardAddress: string;
|
|
187
186
|
metadata?: PoolMetadata;
|
|
188
187
|
};
|
|
189
|
-
declare const poolParamsToObj: (poolParams: PoolParams) => object;
|
|
190
188
|
type PoolMetadata = {
|
|
191
189
|
URL: string;
|
|
192
190
|
hash: string;
|
|
193
191
|
};
|
|
194
|
-
declare const poolMetadataToObj: (poolMetadata: PoolMetadata) => object;
|
|
195
192
|
|
|
196
193
|
type Protocol = {
|
|
197
194
|
epoch: number;
|
|
@@ -215,6 +212,7 @@ type Protocol = {
|
|
|
215
212
|
maxCollateralInputs: number;
|
|
216
213
|
coinsPerUtxoSize: number;
|
|
217
214
|
};
|
|
215
|
+
declare const castProtocol: (data: Partial<Record<keyof Protocol, any>>) => Protocol;
|
|
218
216
|
|
|
219
217
|
type Token = keyof typeof SUPPORTED_TOKENS;
|
|
220
218
|
|
|
@@ -328,127 +326,81 @@ type SimpleScriptSourceInfo = {
|
|
|
328
326
|
simpleScriptHash: string;
|
|
329
327
|
};
|
|
330
328
|
|
|
331
|
-
type
|
|
332
|
-
type: "
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
329
|
+
type Certificate = {
|
|
330
|
+
type: "BasicCertificate";
|
|
331
|
+
certType: CertificateType;
|
|
332
|
+
} | {
|
|
333
|
+
type: "ScriptCertificate";
|
|
334
|
+
certType: CertificateType;
|
|
336
335
|
redeemer?: Redeemer;
|
|
337
|
-
scriptSource?: ScriptSource | SimpleScriptSourceInfo;
|
|
338
|
-
};
|
|
339
|
-
|
|
340
|
-
type Output = {
|
|
341
|
-
address: string;
|
|
342
|
-
amount: Asset[];
|
|
343
|
-
datum?: {
|
|
344
|
-
type: "Hash" | "Inline";
|
|
345
|
-
data: BuilderData;
|
|
346
|
-
};
|
|
347
|
-
referenceScript?: PlutusScript;
|
|
348
|
-
};
|
|
349
|
-
|
|
350
|
-
type RefTxIn = {
|
|
351
|
-
txHash: string;
|
|
352
|
-
txIndex: number;
|
|
353
|
-
};
|
|
354
|
-
type TxInParameter = {
|
|
355
|
-
txHash: string;
|
|
356
|
-
txIndex: number;
|
|
357
|
-
amount?: Asset[];
|
|
358
|
-
address?: string;
|
|
359
|
-
};
|
|
360
|
-
type TxIn = PubKeyTxIn | SimpleScriptTxIn | ScriptTxIn;
|
|
361
|
-
type PubKeyTxIn = {
|
|
362
|
-
type: "PubKey";
|
|
363
|
-
txIn: TxInParameter;
|
|
364
|
-
};
|
|
365
|
-
type SimpleScriptTxIn = {
|
|
366
|
-
type: "SimpleScript";
|
|
367
|
-
txIn: TxInParameter;
|
|
368
|
-
simpleScriptTxIn: SimpleScriptTxInParameter;
|
|
369
|
-
};
|
|
370
|
-
type SimpleScriptTxInParameter = {
|
|
371
|
-
scriptSource?: {
|
|
372
|
-
type: "Provided";
|
|
373
|
-
script: string;
|
|
374
|
-
} | {
|
|
375
|
-
type: "Inline";
|
|
376
|
-
txInInfo: SimpleScriptSourceInfo;
|
|
377
|
-
};
|
|
378
|
-
};
|
|
379
|
-
type ScriptTxInParameter = {
|
|
380
336
|
scriptSource?: ScriptSource;
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
type: "Script";
|
|
386
|
-
txIn: TxInParameter;
|
|
387
|
-
scriptTxIn: ScriptTxInParameter;
|
|
337
|
+
} | {
|
|
338
|
+
type: "SimpleScriptCertificate";
|
|
339
|
+
certType: CertificateType;
|
|
340
|
+
simpleScriptSource?: SimpleScriptSourceInfo;
|
|
388
341
|
};
|
|
389
|
-
|
|
390
|
-
type Certificate = {
|
|
342
|
+
type CertificateType = {
|
|
391
343
|
type: "RegisterPool";
|
|
392
344
|
poolParams: PoolParams;
|
|
393
345
|
} | {
|
|
394
346
|
type: "RegisterStake";
|
|
395
|
-
|
|
347
|
+
stakeKeyAddress: string;
|
|
396
348
|
} | {
|
|
397
349
|
type: "DelegateStake";
|
|
398
|
-
|
|
350
|
+
stakeKeyAddress: string;
|
|
399
351
|
poolId: string;
|
|
400
352
|
} | {
|
|
401
353
|
type: "DeregisterStake";
|
|
402
|
-
|
|
354
|
+
stakeKeyAddress: string;
|
|
403
355
|
} | {
|
|
404
356
|
type: "RetirePool";
|
|
405
357
|
poolId: string;
|
|
406
358
|
epoch: number;
|
|
407
359
|
} | {
|
|
408
360
|
type: "VoteDelegation";
|
|
409
|
-
|
|
361
|
+
stakeKeyAddress: string;
|
|
410
362
|
drep: DRep;
|
|
411
363
|
} | {
|
|
412
364
|
type: "StakeAndVoteDelegation";
|
|
413
|
-
|
|
365
|
+
stakeKeyAddress: string;
|
|
414
366
|
poolKeyHash: string;
|
|
415
367
|
drep: DRep;
|
|
416
368
|
} | {
|
|
417
369
|
type: "StakeRegistrationAndDelegation";
|
|
418
|
-
|
|
370
|
+
stakeKeyAddress: string;
|
|
419
371
|
poolKeyHash: string;
|
|
420
372
|
coin: number;
|
|
421
373
|
} | {
|
|
422
374
|
type: "VoteRegistrationAndDelegation";
|
|
423
|
-
|
|
375
|
+
stakeKeyAddress: string;
|
|
424
376
|
drep: DRep;
|
|
425
377
|
coin: number;
|
|
426
378
|
} | {
|
|
427
379
|
type: "StakeVoteRegistrationAndDelegation";
|
|
428
|
-
|
|
380
|
+
stakeKeyAddress: string;
|
|
429
381
|
poolKeyHash: string;
|
|
430
382
|
drep: DRep;
|
|
431
383
|
coin: number;
|
|
432
384
|
} | {
|
|
433
385
|
type: "CommitteeHotAuth";
|
|
434
|
-
|
|
435
|
-
|
|
386
|
+
committeeColdKeyAddress: string;
|
|
387
|
+
committeeHotKeyAddress: string;
|
|
436
388
|
} | {
|
|
437
389
|
type: "CommitteeColdResign";
|
|
438
|
-
|
|
390
|
+
committeeColdKeyAddress: string;
|
|
439
391
|
anchor?: Anchor;
|
|
440
392
|
} | {
|
|
441
393
|
type: "DRepRegistration";
|
|
442
|
-
|
|
394
|
+
votingKeyAddress: string;
|
|
443
395
|
coin: number;
|
|
444
396
|
anchor?: Anchor;
|
|
445
397
|
} | {
|
|
446
398
|
type: "DRepDeregistration";
|
|
447
|
-
|
|
399
|
+
votingKeyAddress: string;
|
|
448
400
|
coin: number;
|
|
449
401
|
} | {
|
|
450
402
|
type: "DRepUpdate";
|
|
451
|
-
|
|
403
|
+
votingKeyAddress: string;
|
|
452
404
|
anchor: Anchor;
|
|
453
405
|
};
|
|
454
406
|
type DRep = {
|
|
@@ -464,20 +416,85 @@ type Anchor = {
|
|
|
464
416
|
anchorUrl: string;
|
|
465
417
|
anchorDataHash: string;
|
|
466
418
|
};
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
419
|
+
|
|
420
|
+
type MintItem = {
|
|
421
|
+
type: "Plutus" | "Native";
|
|
422
|
+
policyId: string;
|
|
423
|
+
assetName: string;
|
|
424
|
+
amount: string;
|
|
425
|
+
redeemer?: Redeemer;
|
|
426
|
+
scriptSource?: ScriptSource | SimpleScriptSourceInfo;
|
|
427
|
+
};
|
|
428
|
+
|
|
429
|
+
type Output = {
|
|
430
|
+
address: string;
|
|
431
|
+
amount: Asset[];
|
|
432
|
+
datum?: {
|
|
433
|
+
type: "Hash" | "Inline";
|
|
434
|
+
data: BuilderData;
|
|
471
435
|
};
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
436
|
+
referenceScript?: PlutusScript;
|
|
437
|
+
};
|
|
438
|
+
|
|
439
|
+
type RefTxIn = {
|
|
440
|
+
txHash: string;
|
|
441
|
+
txIndex: number;
|
|
442
|
+
};
|
|
443
|
+
type TxInParameter = {
|
|
444
|
+
txHash: string;
|
|
445
|
+
txIndex: number;
|
|
446
|
+
amount?: Asset[];
|
|
447
|
+
address?: string;
|
|
448
|
+
};
|
|
449
|
+
type TxIn = PubKeyTxIn | SimpleScriptTxIn | ScriptTxIn;
|
|
450
|
+
type PubKeyTxIn = {
|
|
451
|
+
type: "PubKey";
|
|
452
|
+
txIn: TxInParameter;
|
|
453
|
+
};
|
|
454
|
+
type SimpleScriptTxIn = {
|
|
455
|
+
type: "SimpleScript";
|
|
456
|
+
txIn: TxInParameter;
|
|
457
|
+
simpleScriptTxIn: SimpleScriptTxInParameter;
|
|
458
|
+
};
|
|
459
|
+
type SimpleScriptTxInParameter = {
|
|
460
|
+
scriptSource?: {
|
|
461
|
+
type: "Provided";
|
|
462
|
+
script: string;
|
|
463
|
+
} | {
|
|
464
|
+
type: "Inline";
|
|
465
|
+
txInInfo: SimpleScriptSourceInfo;
|
|
478
466
|
};
|
|
479
467
|
};
|
|
480
|
-
|
|
468
|
+
type ScriptTxInParameter = {
|
|
469
|
+
scriptSource?: ScriptSource;
|
|
470
|
+
datumSource?: DatumSource;
|
|
471
|
+
redeemer?: Redeemer;
|
|
472
|
+
};
|
|
473
|
+
type ScriptTxIn = {
|
|
474
|
+
type: "Script";
|
|
475
|
+
txIn: TxInParameter;
|
|
476
|
+
scriptTxIn: ScriptTxInParameter;
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
type Withdrawal = PubKeyWithdrawal | ScriptWithdrawal | SimpleScriptWithdrawal;
|
|
480
|
+
type PubKeyWithdrawal = {
|
|
481
|
+
type: "PubKeyWithdrawal";
|
|
482
|
+
address: string;
|
|
483
|
+
coin: string;
|
|
484
|
+
};
|
|
485
|
+
type ScriptWithdrawal = {
|
|
486
|
+
type: "ScriptWithdrawal";
|
|
487
|
+
address: string;
|
|
488
|
+
coin: string;
|
|
489
|
+
scriptSource?: ScriptSource;
|
|
490
|
+
redeemer?: Redeemer;
|
|
491
|
+
};
|
|
492
|
+
type SimpleScriptWithdrawal = {
|
|
493
|
+
type: "SimpleScriptWithdrawal";
|
|
494
|
+
address: string;
|
|
495
|
+
coin: string;
|
|
496
|
+
scriptSource?: SimpleScriptSourceInfo;
|
|
497
|
+
};
|
|
481
498
|
|
|
482
499
|
type MeshTxBuilderBody = {
|
|
483
500
|
inputs: TxIn[];
|
|
@@ -640,6 +657,8 @@ interface IMeshTxSerializer {
|
|
|
640
657
|
deserializer: IDeserializer;
|
|
641
658
|
serializeData(data: BuilderData): string;
|
|
642
659
|
serializeAddress(address: DeserializedAddress, networkId?: 0 | 1): string;
|
|
660
|
+
serializePoolId(hash: string): string;
|
|
661
|
+
serializeRewardAddress(stakeKeyHash: string, isScriptHash?: boolean, network_id?: 0 | 1): string;
|
|
643
662
|
}
|
|
644
663
|
interface IResolver {
|
|
645
664
|
keys: {
|
|
@@ -657,9 +676,6 @@ interface IResolver {
|
|
|
657
676
|
script: {
|
|
658
677
|
resolveScriptRef(script: NativeScript | PlutusScript): string;
|
|
659
678
|
};
|
|
660
|
-
pool: {
|
|
661
|
-
resolvePoolId(hash: string): string;
|
|
662
|
-
};
|
|
663
679
|
}
|
|
664
680
|
interface IDeserializer {
|
|
665
681
|
key: {
|
|
@@ -669,6 +685,9 @@ interface IDeserializer {
|
|
|
669
685
|
deserializeNativeScript(script: NativeScript): DeserializedScript;
|
|
670
686
|
deserializePlutusScript(script: PlutusScript): DeserializedScript;
|
|
671
687
|
};
|
|
688
|
+
cert: {
|
|
689
|
+
deserializePoolId(poolId: string): string;
|
|
690
|
+
};
|
|
672
691
|
}
|
|
673
692
|
|
|
674
693
|
interface ISigner {
|
|
@@ -802,7 +821,7 @@ declare const mMaybeStakingHash: (stakeCredential: string, isScriptCredential?:
|
|
|
802
821
|
* @param isScriptCredential The flag to indicate if the credential is a script credential
|
|
803
822
|
* @returns The Mesh Data public key address object
|
|
804
823
|
*/
|
|
805
|
-
declare const mPubKeyAddress: (bytes: string, stakeCredential?: string) => Data;
|
|
824
|
+
declare const mPubKeyAddress: (bytes: string, stakeCredential?: string, isScriptCredential?: boolean) => Data;
|
|
806
825
|
/**
|
|
807
826
|
* The utility function to create a Mesh Data script address
|
|
808
827
|
* @param bytes The validator hash in hex
|
|
@@ -810,7 +829,7 @@ declare const mPubKeyAddress: (bytes: string, stakeCredential?: string) => Data;
|
|
|
810
829
|
* @param isScriptCredential The flag to indicate if the credential is a script credential
|
|
811
830
|
* @returns The Mesh Data script address object
|
|
812
831
|
*/
|
|
813
|
-
declare const mScriptAddress: (bytes: string, stakeCredential?: string) => Data;
|
|
832
|
+
declare const mScriptAddress: (bytes: string, stakeCredential?: string, isScriptCredential?: boolean) => Data;
|
|
814
833
|
|
|
815
834
|
/**
|
|
816
835
|
* The Mesh Data boolean
|
|
@@ -1230,8 +1249,26 @@ type SlotConfig = {
|
|
|
1230
1249
|
};
|
|
1231
1250
|
declare const SLOT_CONFIG_NETWORK: Record<Network, SlotConfig>;
|
|
1232
1251
|
declare const slotToBeginUnixTime: (slot: number, slotConfig: SlotConfig) => number;
|
|
1252
|
+
/**
|
|
1253
|
+
* Eqivalent to `slotToBeginUnixTime` but option to provide optional config
|
|
1254
|
+
* @param unixTime Timestamp in milliseconds
|
|
1255
|
+
* @param slotConfig Slot configuration for calculation
|
|
1256
|
+
* @returns Slot number
|
|
1257
|
+
*/
|
|
1233
1258
|
declare const unixTimeToEnclosingSlot: (unixTime: number, slotConfig: SlotConfig) => number;
|
|
1259
|
+
/**
|
|
1260
|
+
* Resolve slot number based on timestamp in milliseconds.
|
|
1261
|
+
* @param network Network: mainnet | preprod | preview.
|
|
1262
|
+
* @param milliseconds Timestamp in milliseconds
|
|
1263
|
+
* @returns Slot number
|
|
1264
|
+
*/
|
|
1234
1265
|
declare const resolveSlotNo: (network: Network, milliseconds?: number) => string;
|
|
1266
|
+
/**
|
|
1267
|
+
* Resolve epoch number based on timestamp in milliseconds.
|
|
1268
|
+
* @param network Network: mainnet | preprod | preview.
|
|
1269
|
+
* @param milliseconds Timestamp in milliseconds
|
|
1270
|
+
* @returns Epoch number
|
|
1271
|
+
*/
|
|
1235
1272
|
declare const resolveEpochNo: (network: Network, milliseconds?: number) => number;
|
|
1236
1273
|
|
|
1237
1274
|
/**
|
|
@@ -1239,14 +1276,145 @@ declare const resolveEpochNo: (network: Network, milliseconds?: number) => numbe
|
|
|
1239
1276
|
* where first key as policy id, second key as asset name, and final value as quantity.
|
|
1240
1277
|
*/
|
|
1241
1278
|
|
|
1279
|
+
/**
|
|
1280
|
+
* Aiken alias
|
|
1281
|
+
* Value is the JSON representation of Cardano data Value
|
|
1282
|
+
*/
|
|
1242
1283
|
type Value = AssocMap<CurrencySymbol, AssocMap<TokenName, Integer>>;
|
|
1284
|
+
/**
|
|
1285
|
+
* Aiken alias
|
|
1286
|
+
* MValue is the Cardano data Value in Mesh Data type
|
|
1287
|
+
*/
|
|
1243
1288
|
type MValue = Map<string, Map<string, bigint>>;
|
|
1289
|
+
/**
|
|
1290
|
+
* The utility function to convert assets into Cardano data Value in JSON
|
|
1291
|
+
* @param assets The assets to convert
|
|
1292
|
+
* @returns The Cardano data Value in JSON
|
|
1293
|
+
*/
|
|
1244
1294
|
declare const value: (assets: Asset[]) => Value;
|
|
1245
|
-
|
|
1295
|
+
/**
|
|
1296
|
+
* The utility function to convert assets into Cardano data Value in Mesh Data type
|
|
1297
|
+
* @param assets The assets to convert
|
|
1298
|
+
* @returns The Cardano data Value in Mesh Data type
|
|
1299
|
+
*/
|
|
1300
|
+
declare const mValue: (assets: Asset[]) => MValue;
|
|
1301
|
+
/**
|
|
1302
|
+
* MeshValue provide utility to handle the Cardano value manipulation. It offers certain axioms:
|
|
1303
|
+
* 1. No duplication of asset - adding assets with same asset name will increase the quantity of the asset in the same record.
|
|
1304
|
+
* 2. No zero and negative entry - the quantity of the asset should not be zero or negative.
|
|
1305
|
+
* 3. Sanitization of lovelace asset name - the class handle back and forth conversion of lovelace asset name to empty string.
|
|
1306
|
+
* 4. Easy convertion to Cardano data - offer utility to convert into either Mesh Data type and JSON type for its Cardano data representation.
|
|
1307
|
+
*/
|
|
1308
|
+
declare class MeshValue {
|
|
1309
|
+
value: Record<string, bigint>;
|
|
1310
|
+
constructor(value?: Record<string, bigint>);
|
|
1311
|
+
/**
|
|
1312
|
+
* Converting assets into MeshValue
|
|
1313
|
+
* @param assets The assets to convert
|
|
1314
|
+
* @returns MeshValue
|
|
1315
|
+
*/
|
|
1316
|
+
static fromAssets: (assets: Asset[]) => MeshValue;
|
|
1317
|
+
/**
|
|
1318
|
+
* Converting Value (the JSON representation of Cardano data Value) into MeshValue
|
|
1319
|
+
* @param plutusValue The Value to convert
|
|
1320
|
+
* @returns MeshValue
|
|
1321
|
+
*/
|
|
1322
|
+
static fromValue: (plutusValue: Value) => MeshValue;
|
|
1323
|
+
/**
|
|
1324
|
+
* Add an asset to the Value class's value record.
|
|
1325
|
+
* @param asset The asset to add
|
|
1326
|
+
* @returns The updated MeshValue object
|
|
1327
|
+
*/
|
|
1328
|
+
addAsset: (asset: Asset) => this;
|
|
1329
|
+
/**
|
|
1330
|
+
* Add an array of assets to the Value class's value record.
|
|
1331
|
+
* @param assets The assets to add
|
|
1332
|
+
* @returns The updated MeshValue object
|
|
1333
|
+
*/
|
|
1334
|
+
addAssets: (assets: Asset[]) => this;
|
|
1335
|
+
/**
|
|
1336
|
+
* Substract an asset from the Value class's value record.
|
|
1337
|
+
* @param asset The asset to subtract
|
|
1338
|
+
* @returns The updated MeshValue object
|
|
1339
|
+
*/
|
|
1340
|
+
negateAsset: (asset: Asset) => this;
|
|
1341
|
+
/**
|
|
1342
|
+
* Subtract an array of assets from the Value class's value record.
|
|
1343
|
+
* @param assets The assets to subtract
|
|
1344
|
+
* @returns The updated MeshValue object
|
|
1345
|
+
*/
|
|
1346
|
+
negateAssets: (assets: Asset[]) => this;
|
|
1347
|
+
/**
|
|
1348
|
+
* Get the quantity of asset object per unit
|
|
1349
|
+
* @param unit The unit to get the quantity of
|
|
1350
|
+
* @returns The quantity of the asset
|
|
1351
|
+
*/
|
|
1352
|
+
get: (unit: string) => bigint;
|
|
1353
|
+
/**
|
|
1354
|
+
* Get all asset units
|
|
1355
|
+
* @returns The asset units
|
|
1356
|
+
*/
|
|
1357
|
+
units: () => string[];
|
|
1358
|
+
/**
|
|
1359
|
+
* Check if the value is greater than or equal to another value
|
|
1360
|
+
* @param other - The value to compare against
|
|
1361
|
+
* @returns boolean
|
|
1362
|
+
*/
|
|
1363
|
+
geq: (other: MeshValue) => boolean;
|
|
1364
|
+
/**
|
|
1365
|
+
* Check if the specific unit of value is greater than or equal to that unit of another value
|
|
1366
|
+
* @param unit - The unit to compare
|
|
1367
|
+
* @param other - The value to compare against
|
|
1368
|
+
* @returns boolean
|
|
1369
|
+
*/
|
|
1370
|
+
geqUnit: (unit: string, other: MeshValue) => boolean;
|
|
1371
|
+
/**
|
|
1372
|
+
* Check if the value is less than or equal to another value
|
|
1373
|
+
* @param other - The value to compare against
|
|
1374
|
+
* @returns boolean
|
|
1375
|
+
*/
|
|
1376
|
+
leq: (other: MeshValue) => boolean;
|
|
1377
|
+
/**
|
|
1378
|
+
* Check if the specific unit of value is less than or equal to that unit of another value
|
|
1379
|
+
* @param unit - The unit to compare
|
|
1380
|
+
* @param other - The value to compare against
|
|
1381
|
+
* @returns boolean
|
|
1382
|
+
*/
|
|
1383
|
+
leqUnit: (unit: string, other: MeshValue) => boolean;
|
|
1384
|
+
/**
|
|
1385
|
+
* Check if the value is empty
|
|
1386
|
+
* @returns boolean
|
|
1387
|
+
*/
|
|
1388
|
+
isEmpty: () => boolean;
|
|
1389
|
+
/**
|
|
1390
|
+
* Merge the given values
|
|
1391
|
+
* @param values The other values to merge
|
|
1392
|
+
* @returns this
|
|
1393
|
+
*/
|
|
1394
|
+
merge: (values: MeshValue | MeshValue[]) => this;
|
|
1395
|
+
/**
|
|
1396
|
+
* Convert the MeshValue object into an array of Asset
|
|
1397
|
+
* @returns The array of Asset
|
|
1398
|
+
*/
|
|
1399
|
+
toAssets: () => Asset[];
|
|
1400
|
+
/**
|
|
1401
|
+
* Convert the MeshValue object into Cardano data Value in Mesh Data type
|
|
1402
|
+
*/
|
|
1403
|
+
toData: () => MValue;
|
|
1404
|
+
/**
|
|
1405
|
+
* Convert the MeshValue object into a JSON representation of Cardano data Value
|
|
1406
|
+
* @returns Cardano data Value in JSON
|
|
1407
|
+
*/
|
|
1408
|
+
toJSON: () => Value;
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
declare const AssetFingerprint: typeof CIP14;
|
|
1412
|
+
declare const resolveFingerprint: (policyId: string, assetName: string) => any;
|
|
1246
1413
|
|
|
1247
1414
|
declare class BigNum {
|
|
1248
1415
|
value: bigint;
|
|
1249
|
-
constructor(value
|
|
1416
|
+
constructor(value?: bigint | number | string);
|
|
1417
|
+
static new(value: number | string | bigint | undefined): BigNum;
|
|
1250
1418
|
divFloor(other: BigNum): BigNum;
|
|
1251
1419
|
checkedMul(other: BigNum): BigNum;
|
|
1252
1420
|
checkedAdd(other: BigNum): BigNum;
|
|
@@ -1254,11 +1422,7 @@ declare class BigNum {
|
|
|
1254
1422
|
clampedSub(other: BigNum): BigNum;
|
|
1255
1423
|
lessThan(other: BigNum): boolean;
|
|
1256
1424
|
compare(other: BigNum): -1 | 0 | 1;
|
|
1257
|
-
static new: (value: number | string) => BigNum;
|
|
1258
1425
|
toString(): string;
|
|
1259
1426
|
}
|
|
1260
1427
|
|
|
1261
|
-
|
|
1262
|
-
declare const resolveFingerprint: (policyId: string, assetName: string) => any;
|
|
1263
|
-
|
|
1264
|
-
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, UtxoSelection, type UtxoSelectionStrategy, type ValidityRange, type Value, type Wallet, type Withdrawal, assetClass, assetName, assocMap, bool, builtinByteString, byteString, bytesToHex, certificateToObj, conStr, conStr0, conStr1, conStr2, currencySymbol, dict, emptyTxBuilderBody, experimentalSelectUtxos, fromUTF8, fungibleAssetKeys, hashByteString, hexToBytes, hexToString, integer, isNetwork, keepRelevant, largestFirst, largestFirstMultiAsset, 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 };
|
|
1428
|
+
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 CertificateType, 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, MeshValue, 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 PubKeyWithdrawal, 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 ScriptWithdrawal, type SimpleScriptSourceInfo, type SimpleScriptTxIn, type SimpleScriptTxInParameter, type SimpleScriptWithdrawal, type SlotConfig, type Token, type TokenName, type TransactionInfo, type Tuple, type TxIn, type TxInParameter, type TxOutRef, type UTxO, type Unit, UtxoSelection, type UtxoSelectionStrategy, type ValidityRange, type Value, type Wallet, type Withdrawal, assetClass, assetName, assocMap, bool, builtinByteString, byteString, bytesToHex, castProtocol, conStr, conStr0, conStr1, conStr2, currencySymbol, dict, emptyTxBuilderBody, experimentalSelectUtxos, fromUTF8, fungibleAssetKeys, hashByteString, hexToBytes, hexToString, integer, isNetwork, keepRelevant, largestFirst, largestFirstMultiAsset, list, mAssetClass, mBool, mConStr, mConStr0, mConStr1, mConStr2, mMaybeStakingHash, mOutputReference, mPlutusBSArrayToString, mPubKeyAddress, mScriptAddress, mStringToPlutusBSArray, mTuple, mTxOutRef, mValue, maybeStakingHash, mergeAssets, metadataStandardKeys, metadataToCip68, outputReference, parseAssetUnit, plutusBSArrayToString, policyId, posixTime, pubKeyAddress, pubKeyHash, resolveEpochNo, resolveFingerprint, resolveLanguageView, resolveSlotNo, resolveTxFees, royaltiesStandardKeys, scriptAddress, scriptHash, slotToBeginUnixTime, stringToBSArray, stringToHex, toBytes, toUTF8, tokenName, tuple, txOutRef, unixTimeToEnclosingSlot, validityRangeToObj, value };
|