@meshsdk/core-cst 1.9.0-beta.98 → 1.9.0
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 +68772 -1696
- package/dist/index.d.cts +23 -5
- package/dist/index.d.ts +23 -5
- package/dist/index.js +68774 -1696
- package/package.json +7 -8
package/dist/index.d.cts
CHANGED
|
@@ -7,7 +7,7 @@ import * as util from '@cardano-sdk/util';
|
|
|
7
7
|
export { util as CardanoSDKUtil };
|
|
8
8
|
import * as Crypto from '@cardano-sdk/crypto';
|
|
9
9
|
export { Crypto };
|
|
10
|
-
import { DataSignature, BuilderData, PlutusDataType, NativeScript as NativeScript$1, PlutusScript, IMeshTxSerializer, Protocol, DeserializedAddress, IDeserializer, IResolver, MeshTxBuilderBody, Asset, Output, ITxParser, UTxO, LanguageVersion, Data, PubKeyAddress, ScriptAddress, Anchor, GovernanceActionId, GovernanceAction } from '@meshsdk/common';
|
|
10
|
+
import { DataSignature, BuilderData, PlutusDataType, NativeScript as NativeScript$1, PlutusScript, IMeshTxSerializer, Protocol, DeserializedAddress, IDeserializer, IResolver, MeshTxBuilderBody, Asset, Output, ITxParser, UTxO, LanguageVersion, Data, PubKeyAddress, ScriptAddress, Anchor, GovernanceActionId, GovernanceAction, IEvaluator, SlotConfig, IFetcher, Network, Action } from '@meshsdk/common';
|
|
11
11
|
import { Buffer as Buffer$1 } from 'buffer';
|
|
12
12
|
import { CborMap, CborBytes } from '@harmoniclabs/cbor';
|
|
13
13
|
|
|
@@ -337,10 +337,10 @@ declare class CardanoSDKSerializer implements IMeshTxSerializer {
|
|
|
337
337
|
}
|
|
338
338
|
|
|
339
339
|
declare const buildBaseAddress: (networkId: number, paymentKeyHash: Hash28ByteBase16, stakeKeyHash: Hash28ByteBase16, paymentCredType?: CredentialType, stakeCredType?: CredentialType) => BaseAddress;
|
|
340
|
-
declare const buildEnterpriseAddress: (networkId: number, paymentKeyHash: Hash28ByteBase16) => EnterpriseAddress;
|
|
340
|
+
declare const buildEnterpriseAddress: (networkId: number, paymentKeyHash: Hash28ByteBase16, paymentCredType?: CredentialType) => EnterpriseAddress;
|
|
341
341
|
declare const clampScalar: (scalar: Buffer) => Buffer;
|
|
342
342
|
declare const buildBip32PrivateKey: (entropy: string, password?: string) => Bip32PrivateKey;
|
|
343
|
-
declare const buildRewardAddress: (networkId: number, stakeKeyHash: Hash28ByteBase16) => RewardAddress;
|
|
343
|
+
declare const buildRewardAddress: (networkId: number, stakeKeyHash: Hash28ByteBase16, stakeCredType?: CredentialType) => RewardAddress;
|
|
344
344
|
/**
|
|
345
345
|
* Build a set of keys from a given private key
|
|
346
346
|
*
|
|
@@ -380,6 +380,8 @@ declare const getDRepIds: (dRepId: string) => {
|
|
|
380
380
|
cip129: string;
|
|
381
381
|
};
|
|
382
382
|
declare const toPlutusLanguageVersion: (version: LanguageVersion) => PlutusLanguageVersion;
|
|
383
|
+
declare const utxosToCborMap: (utxos: UTxO[]) => string;
|
|
384
|
+
declare const cborMapToUtxos: (cborMaps: string[]) => UTxO[];
|
|
383
385
|
|
|
384
386
|
declare const deserializeEd25519KeyHash: (ed25519KeyHash: string) => Ed25519KeyHash;
|
|
385
387
|
declare const deserializePlutusScript: (plutusScript: string, version: LanguageVersion) => PlutusV1Script | PlutusV2Script | PlutusV3Script;
|
|
@@ -409,7 +411,7 @@ declare const parseInlineDatum: <T extends {
|
|
|
409
411
|
declare const deserializeDataHash: (dataHash: string) => DatumHash;
|
|
410
412
|
declare const deserializePlutusData: (plutusData: string) => PlutusData;
|
|
411
413
|
|
|
412
|
-
declare const
|
|
414
|
+
declare const serializeAddress: (deserializedAddress: Partial<DeserializedAddress>, networkId?: number) => string;
|
|
413
415
|
declare const addrBech32ToPlutusDataHex: (bech32: string) => string;
|
|
414
416
|
declare const addrBech32ToPlutusDataObj: <T>(bech32: string) => T;
|
|
415
417
|
declare const serializeAddressObj: (plutusDataAddressObject: PubKeyAddress | ScriptAddress, networkId?: number) => string;
|
|
@@ -456,4 +458,20 @@ declare const normalizePlutusScript: (plutusScript: string, encoding: OutputEnco
|
|
|
456
458
|
declare const applyEncoding: (plutusScript: Uint8Array, outputEncoding: OutputEncoding) => Uint8Array;
|
|
457
459
|
declare const applyParamsToScript: (rawScript: string, params: object[] | Data[], type?: PlutusDataType) => string;
|
|
458
460
|
|
|
459
|
-
|
|
461
|
+
declare class OfflineEvaluatorScalus implements IEvaluator {
|
|
462
|
+
private readonly fetcher;
|
|
463
|
+
private readonly network;
|
|
464
|
+
slotConfig: Omit<Omit<SlotConfig, "startEpoch">, "epochLength">;
|
|
465
|
+
costModels: number[][];
|
|
466
|
+
/**
|
|
467
|
+
* Creates a new instance of OfflineEvaluatorScalus.
|
|
468
|
+
* @param fetcher - An implementation of IFetcher to resolve transaction UTXOs
|
|
469
|
+
* @param network - The network to evaluate scripts for
|
|
470
|
+
* @param slotConfig - Slot configuration for the network (optional, defaults to network-specific values)
|
|
471
|
+
* @param customCostModels - Custom cost models for Plutus versions (optional, defaults to mainnet cost models)
|
|
472
|
+
*/
|
|
473
|
+
constructor(fetcher: IFetcher, network: Network, slotConfig?: Omit<Omit<SlotConfig, "startEpoch">, "epochLength">, customCostModels?: number[][]);
|
|
474
|
+
evaluateTx(tx: string, additionalUtxos?: UTxO[], additionalTxs?: string[]): Promise<Omit<Action, "data">[]>;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
export { Address, AddressType, AssetFingerprint, AssetId, AssetName, type AuxiliaryData, AuxilliaryData, BaseAddress, Bip32PrivateKey, Bip32PrivateKeyHex, Bip32PublicKey, Bip32PublicKeyHex, BootstrapWitness, type ByronAttributes, CardanoSDKSerializer, CborSet, CborWriter, CertIndex, Certificate, CertificateType, ConstrPlutusData, CoseSign1, CostModel, type CostModels, Costmdls, Credential, type CredentialCore, CredentialType, DRep, DRepID, Datum, DatumHash, DatumKind, Ed25519KeyHash, Ed25519KeyHashHex, Ed25519PrivateExtendedKeyHex, Ed25519PrivateKey, Ed25519PrivateNormalKeyHex, Ed25519PublicKey, Ed25519PublicKeyHex, Ed25519Signature, Ed25519SignatureHex, EnterpriseAddress, ExUnits, Hash, Hash28ByteBase16, Hash32ByteBase16, HexBlob, type Metadatum, MetadatumList, MetadatumMap, NativeScript, NetworkId, OfflineEvaluatorScalus, type OutputEncoding, PaymentAddress, PlutusData, PlutusDataKind, PlutusLanguageVersion, PlutusList, PlutusMap, PlutusV1Script, PlutusV2Script, PlutusV3Script, PointerAddress, PolicyId, PoolId, Redeemer, RedeemerPurpose, RedeemerTag, Redeemers, RequireAllOf, RequireAnyOf, RequireNOf, RequireSignature, RequireTimeAfter, RequireTimeBefore, RewardAccount, RewardAddress, Script, ScriptHash, ScriptPubkey, type Signatures, type Signer, Slot, StakeCredentialStatus, StakeDelegation, type StakeDelegationCertificate, StakeRegistration, type TokenMap, Transaction, TransactionBody, TransactionId, TransactionInput, type TransactionInputSet, TransactionMetadatum, TransactionOutput, TransactionUnspentOutput, type TransactionWitnessPlutusData, TransactionWitnessSet, TxCBOR, TxIndex, Value, VkeyWitness, VrfVkBech32, type Witness, addVKeyWitnessSetToTransaction, addrBech32ToPlutusDataHex, addrBech32ToPlutusDataObj, addressToBech32, applyEncoding, applyParamsToScript, assetTypes, blake2b, buildBaseAddress, buildBip32PrivateKey, buildDRepID, buildEd25519PrivateKeyFromSecretKey, buildEnterpriseAddress, buildKeys, buildRewardAddress, buildScriptPubkey, bytesToHex, calculateFees, cborMapToUtxos, checkSignature, clampScalar, computeAuxiliaryDataHash, deserializeAddress, deserializeBech32Address, deserializeDataHash, deserializeEd25519KeyHash, deserializeNativeScript, deserializePlutusData, deserializePlutusScript, deserializeScriptHash, deserializeScriptRef, deserializeTx, deserializeTxHash, deserializeTxUnspentOutput, deserializeValue, empty, fromBuilderToPlutusData, fromJsonToPlutusData, fromNativeScript, fromPlutusDataToJson, fromScriptRef, fromTxUnspentOutput, fromValue, generateNonce, getCoseKeyFromPublicKey, getDRepIds, getPublicKeyFromCoseKey, hexToBech32, hexToBytes, keyHashToRewardAddress, mergeValue, negateValue, negatives, normalizePlutusScript, parseDatumCbor, parseInlineDatum, resolveDataHash, resolveEd25519KeyHash, resolveNativeScriptAddress, resolveNativeScriptHash, resolvePaymentKeyHash, resolvePlutusScriptAddress, resolvePlutusScriptHash, resolvePoolId, resolvePrivateKey, resolveRewardAddress, resolveScriptHashDRepId, resolveScriptRef, resolveStakeKeyHash, resolveTxHash, scriptHashToBech32, scriptHashToRewardAddress, serializeAddress, serializeAddressObj, serializePlutusAddressToBech32, signData, subValue, toAddress, toBaseAddress, toCardanoAddress, toCardanoAnchor, toCardanoGovernanceActionId, toCardanoProposalProcedure, toDRep, toEnterpriseAddress, toNativeScript, toPlutusData, toPlutusLanguageVersion, toRewardAddress, toScriptRef, toTxUnspentOutput, toValue, utf8ToBytes, utf8ToHex, utxosToCborMap, v2ScriptToBech32 };
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import * as util from '@cardano-sdk/util';
|
|
|
7
7
|
export { util as CardanoSDKUtil };
|
|
8
8
|
import * as Crypto from '@cardano-sdk/crypto';
|
|
9
9
|
export { Crypto };
|
|
10
|
-
import { DataSignature, BuilderData, PlutusDataType, NativeScript as NativeScript$1, PlutusScript, IMeshTxSerializer, Protocol, DeserializedAddress, IDeserializer, IResolver, MeshTxBuilderBody, Asset, Output, ITxParser, UTxO, LanguageVersion, Data, PubKeyAddress, ScriptAddress, Anchor, GovernanceActionId, GovernanceAction } from '@meshsdk/common';
|
|
10
|
+
import { DataSignature, BuilderData, PlutusDataType, NativeScript as NativeScript$1, PlutusScript, IMeshTxSerializer, Protocol, DeserializedAddress, IDeserializer, IResolver, MeshTxBuilderBody, Asset, Output, ITxParser, UTxO, LanguageVersion, Data, PubKeyAddress, ScriptAddress, Anchor, GovernanceActionId, GovernanceAction, IEvaluator, SlotConfig, IFetcher, Network, Action } from '@meshsdk/common';
|
|
11
11
|
import { Buffer as Buffer$1 } from 'buffer';
|
|
12
12
|
import { CborMap, CborBytes } from '@harmoniclabs/cbor';
|
|
13
13
|
|
|
@@ -337,10 +337,10 @@ declare class CardanoSDKSerializer implements IMeshTxSerializer {
|
|
|
337
337
|
}
|
|
338
338
|
|
|
339
339
|
declare const buildBaseAddress: (networkId: number, paymentKeyHash: Hash28ByteBase16, stakeKeyHash: Hash28ByteBase16, paymentCredType?: CredentialType, stakeCredType?: CredentialType) => BaseAddress;
|
|
340
|
-
declare const buildEnterpriseAddress: (networkId: number, paymentKeyHash: Hash28ByteBase16) => EnterpriseAddress;
|
|
340
|
+
declare const buildEnterpriseAddress: (networkId: number, paymentKeyHash: Hash28ByteBase16, paymentCredType?: CredentialType) => EnterpriseAddress;
|
|
341
341
|
declare const clampScalar: (scalar: Buffer) => Buffer;
|
|
342
342
|
declare const buildBip32PrivateKey: (entropy: string, password?: string) => Bip32PrivateKey;
|
|
343
|
-
declare const buildRewardAddress: (networkId: number, stakeKeyHash: Hash28ByteBase16) => RewardAddress;
|
|
343
|
+
declare const buildRewardAddress: (networkId: number, stakeKeyHash: Hash28ByteBase16, stakeCredType?: CredentialType) => RewardAddress;
|
|
344
344
|
/**
|
|
345
345
|
* Build a set of keys from a given private key
|
|
346
346
|
*
|
|
@@ -380,6 +380,8 @@ declare const getDRepIds: (dRepId: string) => {
|
|
|
380
380
|
cip129: string;
|
|
381
381
|
};
|
|
382
382
|
declare const toPlutusLanguageVersion: (version: LanguageVersion) => PlutusLanguageVersion;
|
|
383
|
+
declare const utxosToCborMap: (utxos: UTxO[]) => string;
|
|
384
|
+
declare const cborMapToUtxos: (cborMaps: string[]) => UTxO[];
|
|
383
385
|
|
|
384
386
|
declare const deserializeEd25519KeyHash: (ed25519KeyHash: string) => Ed25519KeyHash;
|
|
385
387
|
declare const deserializePlutusScript: (plutusScript: string, version: LanguageVersion) => PlutusV1Script | PlutusV2Script | PlutusV3Script;
|
|
@@ -409,7 +411,7 @@ declare const parseInlineDatum: <T extends {
|
|
|
409
411
|
declare const deserializeDataHash: (dataHash: string) => DatumHash;
|
|
410
412
|
declare const deserializePlutusData: (plutusData: string) => PlutusData;
|
|
411
413
|
|
|
412
|
-
declare const
|
|
414
|
+
declare const serializeAddress: (deserializedAddress: Partial<DeserializedAddress>, networkId?: number) => string;
|
|
413
415
|
declare const addrBech32ToPlutusDataHex: (bech32: string) => string;
|
|
414
416
|
declare const addrBech32ToPlutusDataObj: <T>(bech32: string) => T;
|
|
415
417
|
declare const serializeAddressObj: (plutusDataAddressObject: PubKeyAddress | ScriptAddress, networkId?: number) => string;
|
|
@@ -456,4 +458,20 @@ declare const normalizePlutusScript: (plutusScript: string, encoding: OutputEnco
|
|
|
456
458
|
declare const applyEncoding: (plutusScript: Uint8Array, outputEncoding: OutputEncoding) => Uint8Array;
|
|
457
459
|
declare const applyParamsToScript: (rawScript: string, params: object[] | Data[], type?: PlutusDataType) => string;
|
|
458
460
|
|
|
459
|
-
|
|
461
|
+
declare class OfflineEvaluatorScalus implements IEvaluator {
|
|
462
|
+
private readonly fetcher;
|
|
463
|
+
private readonly network;
|
|
464
|
+
slotConfig: Omit<Omit<SlotConfig, "startEpoch">, "epochLength">;
|
|
465
|
+
costModels: number[][];
|
|
466
|
+
/**
|
|
467
|
+
* Creates a new instance of OfflineEvaluatorScalus.
|
|
468
|
+
* @param fetcher - An implementation of IFetcher to resolve transaction UTXOs
|
|
469
|
+
* @param network - The network to evaluate scripts for
|
|
470
|
+
* @param slotConfig - Slot configuration for the network (optional, defaults to network-specific values)
|
|
471
|
+
* @param customCostModels - Custom cost models for Plutus versions (optional, defaults to mainnet cost models)
|
|
472
|
+
*/
|
|
473
|
+
constructor(fetcher: IFetcher, network: Network, slotConfig?: Omit<Omit<SlotConfig, "startEpoch">, "epochLength">, customCostModels?: number[][]);
|
|
474
|
+
evaluateTx(tx: string, additionalUtxos?: UTxO[], additionalTxs?: string[]): Promise<Omit<Action, "data">[]>;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
export { Address, AddressType, AssetFingerprint, AssetId, AssetName, type AuxiliaryData, AuxilliaryData, BaseAddress, Bip32PrivateKey, Bip32PrivateKeyHex, Bip32PublicKey, Bip32PublicKeyHex, BootstrapWitness, type ByronAttributes, CardanoSDKSerializer, CborSet, CborWriter, CertIndex, Certificate, CertificateType, ConstrPlutusData, CoseSign1, CostModel, type CostModels, Costmdls, Credential, type CredentialCore, CredentialType, DRep, DRepID, Datum, DatumHash, DatumKind, Ed25519KeyHash, Ed25519KeyHashHex, Ed25519PrivateExtendedKeyHex, Ed25519PrivateKey, Ed25519PrivateNormalKeyHex, Ed25519PublicKey, Ed25519PublicKeyHex, Ed25519Signature, Ed25519SignatureHex, EnterpriseAddress, ExUnits, Hash, Hash28ByteBase16, Hash32ByteBase16, HexBlob, type Metadatum, MetadatumList, MetadatumMap, NativeScript, NetworkId, OfflineEvaluatorScalus, type OutputEncoding, PaymentAddress, PlutusData, PlutusDataKind, PlutusLanguageVersion, PlutusList, PlutusMap, PlutusV1Script, PlutusV2Script, PlutusV3Script, PointerAddress, PolicyId, PoolId, Redeemer, RedeemerPurpose, RedeemerTag, Redeemers, RequireAllOf, RequireAnyOf, RequireNOf, RequireSignature, RequireTimeAfter, RequireTimeBefore, RewardAccount, RewardAddress, Script, ScriptHash, ScriptPubkey, type Signatures, type Signer, Slot, StakeCredentialStatus, StakeDelegation, type StakeDelegationCertificate, StakeRegistration, type TokenMap, Transaction, TransactionBody, TransactionId, TransactionInput, type TransactionInputSet, TransactionMetadatum, TransactionOutput, TransactionUnspentOutput, type TransactionWitnessPlutusData, TransactionWitnessSet, TxCBOR, TxIndex, Value, VkeyWitness, VrfVkBech32, type Witness, addVKeyWitnessSetToTransaction, addrBech32ToPlutusDataHex, addrBech32ToPlutusDataObj, addressToBech32, applyEncoding, applyParamsToScript, assetTypes, blake2b, buildBaseAddress, buildBip32PrivateKey, buildDRepID, buildEd25519PrivateKeyFromSecretKey, buildEnterpriseAddress, buildKeys, buildRewardAddress, buildScriptPubkey, bytesToHex, calculateFees, cborMapToUtxos, checkSignature, clampScalar, computeAuxiliaryDataHash, deserializeAddress, deserializeBech32Address, deserializeDataHash, deserializeEd25519KeyHash, deserializeNativeScript, deserializePlutusData, deserializePlutusScript, deserializeScriptHash, deserializeScriptRef, deserializeTx, deserializeTxHash, deserializeTxUnspentOutput, deserializeValue, empty, fromBuilderToPlutusData, fromJsonToPlutusData, fromNativeScript, fromPlutusDataToJson, fromScriptRef, fromTxUnspentOutput, fromValue, generateNonce, getCoseKeyFromPublicKey, getDRepIds, getPublicKeyFromCoseKey, hexToBech32, hexToBytes, keyHashToRewardAddress, mergeValue, negateValue, negatives, normalizePlutusScript, parseDatumCbor, parseInlineDatum, resolveDataHash, resolveEd25519KeyHash, resolveNativeScriptAddress, resolveNativeScriptHash, resolvePaymentKeyHash, resolvePlutusScriptAddress, resolvePlutusScriptHash, resolvePoolId, resolvePrivateKey, resolveRewardAddress, resolveScriptHashDRepId, resolveScriptRef, resolveStakeKeyHash, resolveTxHash, scriptHashToBech32, scriptHashToRewardAddress, serializeAddress, serializeAddressObj, serializePlutusAddressToBech32, signData, subValue, toAddress, toBaseAddress, toCardanoAddress, toCardanoAnchor, toCardanoGovernanceActionId, toCardanoProposalProcedure, toDRep, toEnterpriseAddress, toNativeScript, toPlutusData, toPlutusLanguageVersion, toRewardAddress, toScriptRef, toTxUnspentOutput, toValue, utf8ToBytes, utf8ToHex, utxosToCborMap, v2ScriptToBech32 };
|