diff --git a/package-lock.json b/package-lock.json index e64bab3d..ed53f9e2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "cardano-serialization-lib", - "version": "7.1.0", + "version": "8.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 4ef289ee..5633afeb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cardano-serialization-lib", - "version": "7.1.0", + "version": "8.0.0", "description": "(De)serialization functions for the Cardano blockchain along with related utility functions", "scripts": { "rust:build-nodejs": "rimraf ./rust/pkg && cd rust; wasm-pack build --target=nodejs; wasm-pack pack; cd .. && npm run js:flowgen", diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 5d02eba7..05ebfe86 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -52,7 +52,7 @@ checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" [[package]] name = "cardano-serialization-lib" -version = "7.1.0" +version = "8.0.0" dependencies = [ "bech32", "cbor_event", diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 66b75c74..bfcaf970 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cardano-serialization-lib" -version = "7.1.0" +version = "8.0.0" edition = "2018" authors = ["EMURGO"] license = "MIT" diff --git a/rust/pkg/cardano_serialization_lib.js.flow b/rust/pkg/cardano_serialization_lib.js.flow index cb6bc114..19d9d4a3 100644 --- a/rust/pkg/cardano_serialization_lib.js.flow +++ b/rust/pkg/cardano_serialization_lib.js.flow @@ -5,6 +5,37 @@ * @flow */ +/** + * @param {Transaction} tx + * @param {LinearFee} linear_fee + * @returns {BigNum} + */ +declare export function min_fee(tx: Transaction, linear_fee: LinearFee): BigNum; + +/** + * @param {string} password + * @param {string} salt + * @param {string} nonce + * @param {string} data + * @returns {string} + */ +declare export function encrypt_with_password( + password: string, + salt: string, + nonce: string, + data: string +): string; + +/** + * @param {string} password + * @param {string} data + * @returns {string} + */ +declare export function decrypt_with_password( + password: string, + data: string +): string; + /** * @param {TransactionHash} tx_body_hash * @param {ByronAddress} addr @@ -40,12 +71,12 @@ declare export function make_vkey_witness( ): Vkeywitness; /** - * @param {TransactionMetadata} metadata - * @returns {MetadataHash} + * @param {AuxiliaryData} auxiliary_data + * @returns {AuxiliaryDataHash} */ -declare export function hash_metadata( - metadata: TransactionMetadata -): MetadataHash; +declare export function hash_auxiliary_data( + auxiliary_data: AuxiliaryData +): AuxiliaryDataHash; /** * @param {TransactionBody} tx_body @@ -89,30 +120,6 @@ declare export function min_ada_required( minimum_utxo_val: BigNum ): BigNum; -/** - * @param {string} password - * @param {string} salt - * @param {string} nonce - * @param {string} data - * @returns {string} - */ -declare export function encrypt_with_password( - password: string, - salt: string, - nonce: string, - data: string -): string; - -/** - * @param {string} password - * @param {string} data - * @returns {string} - */ -declare export function decrypt_with_password( - password: string, - data: string -): string; - /** * @param {Uint8Array} bytes * @returns {TransactionMetadatum} @@ -149,13 +156,6 @@ declare export function decode_metadatum_to_json_str( schema: number ): string; -/** - * @param {Transaction} tx - * @param {LinearFee} linear_fee - * @returns {BigNum} - */ -declare export function min_fee(tx: Transaction, linear_fee: LinearFee): BigNum; - /** */ @@ -177,6 +177,14 @@ declare export var MIRPot: {| +Treasury: 1, // 1 |}; +/** + */ + +declare export var MIRKind: {| + +ToOtherPot: 0, // 0 + +ToStakeCredentials: 1, // 1 +|}; + /** */ @@ -209,6 +217,42 @@ declare export var ScriptHashNamespace: {| +NativeScript: 0, // 0 |}; +/** + */ + +declare export var NetworkIdKind: {| + +Testnet: 0, // 0 + +Mainnet: 1, // 1 +|}; + +/** + */ + +declare export var LanguageKind: {| + +PlutusV1: 0, // 0 +|}; + +/** + */ + +declare export var PlutusDataKind: {| + +ConstrPlutusData: 0, // 0 + +Map: 1, // 1 + +List: 2, // 2 + +Integer: 3, // 3 + +Bytes: 4, // 4 +|}; + +/** + */ + +declare export var RedeemerTagKind: {| + +Spend: 0, // 0 + +Mint: 1, // 1 + +Cert: 2, // 2 + +Reward: 3, // 3 +|}; + /** */ @@ -359,6 +403,118 @@ declare export class Assets { */ keys(): AssetNames; } +/** + */ +declare export class AuxiliaryData { + free(): void; + + /** + * @returns {Uint8Array} + */ + to_bytes(): Uint8Array; + + /** + * @param {Uint8Array} bytes + * @returns {AuxiliaryData} + */ + static from_bytes(bytes: Uint8Array): AuxiliaryData; + + /** + * @returns {AuxiliaryData} + */ + static new(): AuxiliaryData; + + /** + * @returns {GeneralTransactionMetadata | void} + */ + metadata(): GeneralTransactionMetadata | void; + + /** + * @param {GeneralTransactionMetadata} metadata + */ + set_metadata(metadata: GeneralTransactionMetadata): void; + + /** + * @returns {NativeScripts | void} + */ + native_scripts(): NativeScripts | void; + + /** + * @param {NativeScripts} native_scripts + */ + set_native_scripts(native_scripts: NativeScripts): void; + + /** + * @returns {PlutusScripts | void} + */ + plutus_scripts(): PlutusScripts | void; + + /** + * @param {PlutusScripts} plutus_scripts + */ + set_plutus_scripts(plutus_scripts: PlutusScripts): void; +} +/** + */ +declare export class AuxiliaryDataHash { + free(): void; + + /** + * @returns {Uint8Array} + */ + to_bytes(): Uint8Array; + + /** + * @param {string} prefix + * @returns {string} + */ + to_bech32(prefix: string): string; + + /** + * @param {string} bech_str + * @returns {AuxiliaryDataHash} + */ + static from_bech32(bech_str: string): AuxiliaryDataHash; + + /** + * @param {Uint8Array} bytes + * @returns {AuxiliaryDataHash} + */ + static from_bytes(bytes: Uint8Array): AuxiliaryDataHash; +} +/** + */ +declare export class AuxiliaryDataSet { + free(): void; + + /** + * @returns {AuxiliaryDataSet} + */ + static new(): AuxiliaryDataSet; + + /** + * @returns {number} + */ + len(): number; + + /** + * @param {number} tx_index + * @param {AuxiliaryData} data + * @returns {AuxiliaryData | void} + */ + insert(tx_index: number, data: AuxiliaryData): AuxiliaryData | void; + + /** + * @param {number} tx_index + * @returns {AuxiliaryData | void} + */ + get(tx_index: number): AuxiliaryData | void; + + /** + * @returns {Uint32Array} + */ + indices(): Uint32Array; +} /** */ declare export class BaseAddress { @@ -397,6 +553,38 @@ declare export class BaseAddress { */ static from_address(addr: Address): BaseAddress | void; } +/** + */ +declare export class BigInt { + free(): void; + + /** + * @returns {Uint8Array} + */ + to_bytes(): Uint8Array; + + /** + * @param {Uint8Array} bytes + * @returns {BigInt} + */ + static from_bytes(bytes: Uint8Array): BigInt; + + /** + * @returns {BigNum | void} + */ + as_u64(): BigNum | void; + + /** + * @param {string} text + * @returns {BigInt} + */ + static from_str(text: string): BigInt; + + /** + * @returns {string} + */ + to_str(): string; +} /** */ declare export class BigNum { @@ -654,22 +842,29 @@ declare export class Block { transaction_witness_sets(): TransactionWitnessSets; /** - * @returns {MapTransactionIndexToTransactionMetadata} + * @returns {AuxiliaryDataSet} + */ + auxiliary_data_set(): AuxiliaryDataSet; + + /** + * @returns {Uint32Array} */ - transaction_metadata_set(): MapTransactionIndexToTransactionMetadata; + invalid_transactions(): Uint32Array; /** * @param {Header} header * @param {TransactionBodies} transaction_bodies * @param {TransactionWitnessSets} transaction_witness_sets - * @param {MapTransactionIndexToTransactionMetadata} transaction_metadata_set + * @param {AuxiliaryDataSet} auxiliary_data_set + * @param {Uint32Array} invalid_transactions * @returns {Block} */ static new( header: Header, transaction_bodies: TransactionBodies, transaction_witness_sets: TransactionWitnessSets, - transaction_metadata_set: MapTransactionIndexToTransactionMetadata + auxiliary_data_set: AuxiliaryDataSet, + invalid_transactions: Uint32Array ): Block; } /** @@ -994,7 +1189,7 @@ declare export class Certificates { } /** */ -declare export class DNSRecordAorAAAA { +declare export class ConstrPlutusData { free(): void; /** @@ -1004,24 +1199,30 @@ declare export class DNSRecordAorAAAA { /** * @param {Uint8Array} bytes - * @returns {DNSRecordAorAAAA} + * @returns {ConstrPlutusData} */ - static from_bytes(bytes: Uint8Array): DNSRecordAorAAAA; + static from_bytes(bytes: Uint8Array): ConstrPlutusData; /** - * @param {string} dns_name - * @returns {DNSRecordAorAAAA} + * @returns {Int} */ - static new(dns_name: string): DNSRecordAorAAAA; + tag(): Int; /** - * @returns {string} + * @returns {PlutusList} */ - record(): string; + data(): PlutusList; + + /** + * @param {Int} tag + * @param {PlutusList} data + * @returns {ConstrPlutusData} + */ + static new(tag: Int, data: PlutusList): ConstrPlutusData; } /** */ -declare export class DNSRecordSRV { +declare export class CostModel { free(): void; /** @@ -1031,52 +1232,41 @@ declare export class DNSRecordSRV { /** * @param {Uint8Array} bytes - * @returns {DNSRecordSRV} + * @returns {CostModel} */ - static from_bytes(bytes: Uint8Array): DNSRecordSRV; - - /** - * @param {string} dns_name - * @returns {DNSRecordSRV} - */ - static new(dns_name: string): DNSRecordSRV; + static from_bytes(bytes: Uint8Array): CostModel; /** - * @returns {string} + * @returns {CostModel} */ - record(): string; -} -/** - */ -declare export class Ed25519KeyHash { - free(): void; + static new(): CostModel; /** - * @returns {Uint8Array} + * @returns {number} */ - to_bytes(): Uint8Array; + len(): number; /** - * @param {string} prefix - * @returns {string} + * @param {string} key + * @param {BigInt} value + * @returns {BigInt | void} */ - to_bech32(prefix: string): string; + insert(key: string, value: BigInt): BigInt | void; /** - * @param {string} bech_str - * @returns {Ed25519KeyHash} + * @param {string} key + * @returns {BigInt | void} */ - static from_bech32(bech_str: string): Ed25519KeyHash; + get(key: string): BigInt | void; /** - * @param {Uint8Array} bytes - * @returns {Ed25519KeyHash} + * @returns {Strings} */ - static from_bytes(bytes: Uint8Array): Ed25519KeyHash; + keys(): Strings; } /** */ -declare export class Ed25519KeyHashes { +declare export class Costmdls { free(): void; /** @@ -1086,14 +1276,14 @@ declare export class Ed25519KeyHashes { /** * @param {Uint8Array} bytes - * @returns {Ed25519KeyHashes} + * @returns {Costmdls} */ - static from_bytes(bytes: Uint8Array): Ed25519KeyHashes; + static from_bytes(bytes: Uint8Array): Costmdls; /** - * @returns {Ed25519KeyHashes} + * @returns {Costmdls} */ - static new(): Ed25519KeyHashes; + static new(): Costmdls; /** * @returns {number} @@ -1101,16 +1291,170 @@ declare export class Ed25519KeyHashes { len(): number; /** - * @param {number} index - * @returns {Ed25519KeyHash} + * @param {Language} key + * @param {CostModel} value + * @returns {CostModel | void} */ - get(index: number): Ed25519KeyHash; + insert(key: Language, value: CostModel): CostModel | void; /** - * @param {Ed25519KeyHash} elem + * @param {Language} key + * @returns {CostModel | void} */ - add(elem: Ed25519KeyHash): void; -} + get(key: Language): CostModel | void; + + /** + * @returns {Languages} + */ + keys(): Languages; +} +/** + */ +declare export class DNSRecordAorAAAA { + free(): void; + + /** + * @returns {Uint8Array} + */ + to_bytes(): Uint8Array; + + /** + * @param {Uint8Array} bytes + * @returns {DNSRecordAorAAAA} + */ + static from_bytes(bytes: Uint8Array): DNSRecordAorAAAA; + + /** + * @param {string} dns_name + * @returns {DNSRecordAorAAAA} + */ + static new(dns_name: string): DNSRecordAorAAAA; + + /** + * @returns {string} + */ + record(): string; +} +/** + */ +declare export class DNSRecordSRV { + free(): void; + + /** + * @returns {Uint8Array} + */ + to_bytes(): Uint8Array; + + /** + * @param {Uint8Array} bytes + * @returns {DNSRecordSRV} + */ + static from_bytes(bytes: Uint8Array): DNSRecordSRV; + + /** + * @param {string} dns_name + * @returns {DNSRecordSRV} + */ + static new(dns_name: string): DNSRecordSRV; + + /** + * @returns {string} + */ + record(): string; +} +/** + */ +declare export class DataHash { + free(): void; + + /** + * @returns {Uint8Array} + */ + to_bytes(): Uint8Array; + + /** + * @param {string} prefix + * @returns {string} + */ + to_bech32(prefix: string): string; + + /** + * @param {string} bech_str + * @returns {DataHash} + */ + static from_bech32(bech_str: string): DataHash; + + /** + * @param {Uint8Array} bytes + * @returns {DataHash} + */ + static from_bytes(bytes: Uint8Array): DataHash; +} +/** + */ +declare export class Ed25519KeyHash { + free(): void; + + /** + * @returns {Uint8Array} + */ + to_bytes(): Uint8Array; + + /** + * @param {string} prefix + * @returns {string} + */ + to_bech32(prefix: string): string; + + /** + * @param {string} bech_str + * @returns {Ed25519KeyHash} + */ + static from_bech32(bech_str: string): Ed25519KeyHash; + + /** + * @param {Uint8Array} bytes + * @returns {Ed25519KeyHash} + */ + static from_bytes(bytes: Uint8Array): Ed25519KeyHash; +} +/** + */ +declare export class Ed25519KeyHashes { + free(): void; + + /** + * @returns {Uint8Array} + */ + to_bytes(): Uint8Array; + + /** + * @param {Uint8Array} bytes + * @returns {Ed25519KeyHashes} + */ + static from_bytes(bytes: Uint8Array): Ed25519KeyHashes; + + /** + * @returns {Ed25519KeyHashes} + */ + static new(): Ed25519KeyHashes; + + /** + * @returns {number} + */ + len(): number; + + /** + * @param {number} index + * @returns {Ed25519KeyHash} + */ + get(index: number): Ed25519KeyHash; + + /** + * @param {Ed25519KeyHash} elem + */ + add(elem: Ed25519KeyHash): void; +} /** */ declare export class Ed25519Signature { @@ -1177,6 +1521,72 @@ declare export class EnterpriseAddress { */ static from_address(addr: Address): EnterpriseAddress | void; } +/** + */ +declare export class ExUnitPrices { + free(): void; + + /** + * @returns {Uint8Array} + */ + to_bytes(): Uint8Array; + + /** + * @param {Uint8Array} bytes + * @returns {ExUnitPrices} + */ + static from_bytes(bytes: Uint8Array): ExUnitPrices; + + /** + * @returns {UnitInterval} + */ + mem_price(): UnitInterval; + + /** + * @returns {UnitInterval} + */ + step_price(): UnitInterval; + + /** + * @param {UnitInterval} mem_price + * @param {UnitInterval} step_price + * @returns {ExUnitPrices} + */ + static new(mem_price: UnitInterval, step_price: UnitInterval): ExUnitPrices; +} +/** + */ +declare export class ExUnits { + free(): void; + + /** + * @returns {Uint8Array} + */ + to_bytes(): Uint8Array; + + /** + * @param {Uint8Array} bytes + * @returns {ExUnits} + */ + static from_bytes(bytes: Uint8Array): ExUnits; + + /** + * @returns {BigNum} + */ + mem(): BigNum; + + /** + * @returns {BigNum} + */ + steps(): BigNum; + + /** + * @param {BigNum} mem + * @param {BigNum} steps + * @returns {ExUnits} + */ + static new(mem: BigNum, steps: BigNum): ExUnits; +} /** */ declare export class GeneralTransactionMetadata { @@ -1630,6 +2040,58 @@ declare export class KESVKey { */ static from_bytes(bytes: Uint8Array): KESVKey; } +/** + */ +declare export class Language { + free(): void; + + /** + * @returns {Uint8Array} + */ + to_bytes(): Uint8Array; + + /** + * @param {Uint8Array} bytes + * @returns {Language} + */ + static from_bytes(bytes: Uint8Array): Language; + + /** + * @returns {Language} + */ + static new_plutus_v1(): Language; + + /** + * @returns {number} + */ + kind(): number; +} +/** + */ +declare export class Languages { + free(): void; + + /** + * @returns {Languages} + */ + static new(): Languages; + + /** + * @returns {number} + */ + len(): number; + + /** + * @param {number} index + * @returns {Language} + */ + get(index: number): Language; + + /** + * @param {Language} elem + */ + add(elem: Language): void; +} /** */ declare export class LegacyDaedalusPrivateKey { @@ -1675,64 +2137,47 @@ declare export class LinearFee { } /** */ -declare export class MapTransactionIndexToTransactionMetadata { +declare export class MIRToStakeCredentials { free(): void; /** - * @returns {MapTransactionIndexToTransactionMetadata} - */ - static new(): MapTransactionIndexToTransactionMetadata; - - /** - * @returns {number} - */ - len(): number; - - /** - * @param {number} key - * @param {TransactionMetadata} value - * @returns {TransactionMetadata | void} + * @returns {Uint8Array} */ - insert(key: number, value: TransactionMetadata): TransactionMetadata | void; + to_bytes(): Uint8Array; /** - * @param {number} key - * @returns {TransactionMetadata | void} + * @param {Uint8Array} bytes + * @returns {MIRToStakeCredentials} */ - get(key: number): TransactionMetadata | void; + static from_bytes(bytes: Uint8Array): MIRToStakeCredentials; /** - * @returns {Uint32Array} + * @returns {MIRToStakeCredentials} */ - keys(): Uint32Array; -} -/** - */ -declare export class MetadataHash { - free(): void; + static new(): MIRToStakeCredentials; /** - * @returns {Uint8Array} + * @returns {number} */ - to_bytes(): Uint8Array; + len(): number; /** - * @param {string} prefix - * @returns {string} + * @param {StakeCredential} cred + * @param {Int} delta + * @returns {Int | void} */ - to_bech32(prefix: string): string; + insert(cred: StakeCredential, delta: Int): Int | void; /** - * @param {string} bech_str - * @returns {MetadataHash} + * @param {StakeCredential} cred + * @returns {Int | void} */ - static from_bech32(bech_str: string): MetadataHash; + get(cred: StakeCredential): Int | void; /** - * @param {Uint8Array} bytes - * @returns {MetadataHash} + * @returns {StakeCredentials} */ - static from_bytes(bytes: Uint8Array): MetadataHash; + keys(): StakeCredentials; } /** */ @@ -1951,32 +2396,40 @@ declare export class MoveInstantaneousReward { /** * @param {number} pot + * @param {BigNum} amount * @returns {MoveInstantaneousReward} */ - static new(pot: number): MoveInstantaneousReward; + static new_to_other_pot(pot: number, amount: BigNum): MoveInstantaneousReward; + + /** + * @param {number} pot + * @param {MIRToStakeCredentials} amounts + * @returns {MoveInstantaneousReward} + */ + static new_to_stake_creds( + pot: number, + amounts: MIRToStakeCredentials + ): MoveInstantaneousReward; /** * @returns {number} */ - len(): number; + pot(): number; /** - * @param {StakeCredential} key - * @param {BigNum} value - * @returns {BigNum | void} + * @returns {number} */ - insert(key: StakeCredential, value: BigNum): BigNum | void; + kind(): number; /** - * @param {StakeCredential} key * @returns {BigNum | void} */ - get(key: StakeCredential): BigNum | void; + as_to_other_pot(): BigNum | void; /** - * @returns {StakeCredentials} + * @returns {MIRToStakeCredentials | void} */ - keys(): StakeCredentials; + as_to_stake_creds(): MIRToStakeCredentials | void; } /** */ @@ -2204,6 +2657,37 @@ declare export class NativeScripts { */ add(elem: NativeScript): void; } +/** + */ +declare export class NetworkId { + free(): void; + + /** + * @returns {Uint8Array} + */ + to_bytes(): Uint8Array; + + /** + * @param {Uint8Array} bytes + * @returns {NetworkId} + */ + static from_bytes(bytes: Uint8Array): NetworkId; + + /** + * @returns {NetworkId} + */ + static testnet(): NetworkId; + + /** + * @returns {NetworkId} + */ + static mainnet(): NetworkId; + + /** + * @returns {number} + */ + kind(): number; +} /** */ declare export class NetworkInfo { @@ -2318,6 +2802,218 @@ declare export class OperationalCert { sigma: Ed25519Signature ): OperationalCert; } +/** + */ +declare export class PlutusData { + free(): void; + + /** + * @returns {Uint8Array} + */ + to_bytes(): Uint8Array; + + /** + * @param {Uint8Array} bytes + * @returns {PlutusData} + */ + static from_bytes(bytes: Uint8Array): PlutusData; + + /** + * @param {ConstrPlutusData} constr_plutus_data + * @returns {PlutusData} + */ + static new_constr_plutus_data( + constr_plutus_data: ConstrPlutusData + ): PlutusData; + + /** + * @param {PlutusMap} map + * @returns {PlutusData} + */ + static new_map(map: PlutusMap): PlutusData; + + /** + * @param {PlutusList} list + * @returns {PlutusData} + */ + static new_list(list: PlutusList): PlutusData; + + /** + * @param {BigInt} integer + * @returns {PlutusData} + */ + static new_integer(integer: BigInt): PlutusData; + + /** + * @param {Uint8Array} bytes + * @returns {PlutusData} + */ + static new_bytes(bytes: Uint8Array): PlutusData; + + /** + * @returns {number} + */ + kind(): number; + + /** + * @returns {ConstrPlutusData | void} + */ + as_constr_plutus_data(): ConstrPlutusData | void; + + /** + * @returns {PlutusMap | void} + */ + as_map(): PlutusMap | void; + + /** + * @returns {PlutusList | void} + */ + as_list(): PlutusList | void; + + /** + * @returns {BigInt | void} + */ + as_integer(): BigInt | void; + + /** + * @returns {Uint8Array | void} + */ + as_bytes(): Uint8Array | void; +} +/** + */ +declare export class PlutusList { + free(): void; + + /** + * @returns {PlutusList} + */ + static new(): PlutusList; + + /** + * @returns {number} + */ + len(): number; + + /** + * @param {number} index + * @returns {PlutusData} + */ + get(index: number): PlutusData; + + /** + * @param {PlutusData} elem + */ + add(elem: PlutusData): void; +} +/** + */ +declare export class PlutusMap { + free(): void; + + /** + * @returns {Uint8Array} + */ + to_bytes(): Uint8Array; + + /** + * @param {Uint8Array} bytes + * @returns {PlutusMap} + */ + static from_bytes(bytes: Uint8Array): PlutusMap; + + /** + * @returns {PlutusMap} + */ + static new(): PlutusMap; + + /** + * @returns {number} + */ + len(): number; + + /** + * @param {PlutusData} key + * @param {PlutusData} value + * @returns {PlutusData | void} + */ + insert(key: PlutusData, value: PlutusData): PlutusData | void; + + /** + * @param {PlutusData} key + * @returns {PlutusData | void} + */ + get(key: PlutusData): PlutusData | void; + + /** + * @returns {PlutusList} + */ + keys(): PlutusList; +} +/** + */ +declare export class PlutusScript { + free(): void; + + /** + * @returns {Uint8Array} + */ + to_bytes(): Uint8Array; + + /** + * @param {Uint8Array} bytes + * @returns {PlutusScript} + */ + static from_bytes(bytes: Uint8Array): PlutusScript; + + /** + * @param {Uint8Array} bytes + * @returns {PlutusScript} + */ + static new(bytes: Uint8Array): PlutusScript; + + /** + * @returns {Uint8Array} + */ + bytes(): Uint8Array; +} +/** + */ +declare export class PlutusScripts { + free(): void; + + /** + * @returns {Uint8Array} + */ + to_bytes(): Uint8Array; + + /** + * @param {Uint8Array} bytes + * @returns {PlutusScripts} + */ + static from_bytes(bytes: Uint8Array): PlutusScripts; + + /** + * @returns {PlutusScripts} + */ + static new(): PlutusScripts; + + /** + * @returns {number} + */ + len(): number; + + /** + * @param {number} index + * @returns {PlutusScript} + */ + get(index: number): PlutusScript; + + /** + * @param {PlutusScript} elem + */ + add(elem: PlutusScript): void; +} /** */ declare export class Pointer { @@ -2406,16 +3102,44 @@ declare export class PoolMetadata { url(): URL; /** - * @returns {MetadataHash} + * @returns {PoolMetadataHash} */ - metadata_hash(): MetadataHash; + pool_metadata_hash(): PoolMetadataHash; /** * @param {URL} url - * @param {MetadataHash} metadata_hash + * @param {PoolMetadataHash} pool_metadata_hash * @returns {PoolMetadata} */ - static new(url: URL, metadata_hash: MetadataHash): PoolMetadata; + static new(url: URL, pool_metadata_hash: PoolMetadataHash): PoolMetadata; +} +/** + */ +declare export class PoolMetadataHash { + free(): void; + + /** + * @returns {Uint8Array} + */ + to_bytes(): Uint8Array; + + /** + * @param {string} prefix + * @returns {string} + */ + to_bech32(prefix: string): string; + + /** + * @param {string} bech_str + * @returns {PoolMetadataHash} + */ + static from_bech32(bech_str: string): PoolMetadataHash; + + /** + * @param {Uint8Array} bytes + * @returns {PoolMetadataHash} + */ + static from_bytes(bytes: Uint8Array): PoolMetadataHash; } /** */ @@ -2759,79 +3483,139 @@ declare export class ProtocolParamUpdate { set_n_opt(n_opt: number): void; /** - * @returns {number | void} + * @returns {number | void} + */ + n_opt(): number | void; + + /** + * @param {UnitInterval} pool_pledge_influence + */ + set_pool_pledge_influence(pool_pledge_influence: UnitInterval): void; + + /** + * @returns {UnitInterval | void} + */ + pool_pledge_influence(): UnitInterval | void; + + /** + * @param {UnitInterval} expansion_rate + */ + set_expansion_rate(expansion_rate: UnitInterval): void; + + /** + * @returns {UnitInterval | void} + */ + expansion_rate(): UnitInterval | void; + + /** + * @param {UnitInterval} treasury_growth_rate + */ + set_treasury_growth_rate(treasury_growth_rate: UnitInterval): void; + + /** + * @returns {UnitInterval | void} + */ + treasury_growth_rate(): UnitInterval | void; + + /** + * @param {UnitInterval} d + */ + set_d(d: UnitInterval): void; + + /** + * @returns {UnitInterval | void} + */ + d(): UnitInterval | void; + + /** + * @param {Nonce} extra_entropy + */ + set_extra_entropy(extra_entropy: Nonce): void; + + /** + * @returns {Nonce | void} + */ + extra_entropy(): Nonce | void; + + /** + * @param {ProtocolVersions} protocol_version + */ + set_protocol_version(protocol_version: ProtocolVersions): void; + + /** + * @returns {ProtocolVersions | void} */ - n_opt(): number | void; + protocol_version(): ProtocolVersions | void; /** - * @param {UnitInterval} pool_pledge_influence + * @param {BigNum} min_pool_cost */ - set_pool_pledge_influence(pool_pledge_influence: UnitInterval): void; + set_min_pool_cost(min_pool_cost: BigNum): void; /** - * @returns {UnitInterval | void} + * @returns {BigNum | void} */ - pool_pledge_influence(): UnitInterval | void; + min_pool_cost(): BigNum | void; /** - * @param {UnitInterval} expansion_rate + * @param {BigNum} ada_per_utxo_byte */ - set_expansion_rate(expansion_rate: UnitInterval): void; + set_ada_per_utxo_byte(ada_per_utxo_byte: BigNum): void; /** - * @returns {UnitInterval | void} + * @returns {BigNum | void} */ - expansion_rate(): UnitInterval | void; + ada_per_utxo_byte(): BigNum | void; /** - * @param {UnitInterval} treasury_growth_rate + * @param {Costmdls} cost_models */ - set_treasury_growth_rate(treasury_growth_rate: UnitInterval): void; + set_cost_models(cost_models: Costmdls): void; /** - * @returns {UnitInterval | void} + * @returns {Costmdls | void} */ - treasury_growth_rate(): UnitInterval | void; + cost_models(): Costmdls | void; /** - * @param {UnitInterval} d + * @param {ExUnitPrices} execution_costs */ - set_d(d: UnitInterval): void; + set_execution_costs(execution_costs: ExUnitPrices): void; /** - * @returns {UnitInterval | void} + * @returns {ExUnitPrices | void} */ - d(): UnitInterval | void; + execution_costs(): ExUnitPrices | void; /** - * @param {Nonce} extra_entropy + * @param {ExUnits} max_tx_ex_units */ - set_extra_entropy(extra_entropy: Nonce): void; + set_max_tx_ex_units(max_tx_ex_units: ExUnits): void; /** - * @returns {Nonce | void} + * @returns {ExUnits | void} */ - extra_entropy(): Nonce | void; + max_tx_ex_units(): ExUnits | void; /** - * @param {ProtocolVersions} protocol_version + * @param {ExUnits} max_block_ex_units */ - set_protocol_version(protocol_version: ProtocolVersions): void; + set_max_block_ex_units(max_block_ex_units: ExUnits): void; /** - * @returns {ProtocolVersions | void} + * @returns {ExUnits | void} */ - protocol_version(): ProtocolVersions | void; + max_block_ex_units(): ExUnits | void; /** - * @param {BigNum} min_utxo_value + * @param {number} max_value_size */ - set_min_utxo_value(min_utxo_value: BigNum): void; + set_max_value_size(max_value_size: number): void; /** - * @returns {BigNum | void} + * @returns {number | void} */ - min_utxo_value(): BigNum | void; + max_value_size(): number | void; /** * @returns {ProtocolParamUpdate} @@ -2978,6 +3762,123 @@ declare export class PublicKeys { */ add(key: PublicKey): void; } +/** + */ +declare export class Redeemer { + free(): void; + + /** + * @returns {Uint8Array} + */ + to_bytes(): Uint8Array; + + /** + * @param {Uint8Array} bytes + * @returns {Redeemer} + */ + static from_bytes(bytes: Uint8Array): Redeemer; + + /** + * @returns {RedeemerTag} + */ + tag(): RedeemerTag; + + /** + * @returns {BigNum} + */ + index(): BigNum; + + /** + * @returns {PlutusData} + */ + data(): PlutusData; + + /** + * @returns {ExUnits} + */ + ex_units(): ExUnits; + + /** + * @param {RedeemerTag} tag + * @param {BigNum} index + * @param {PlutusData} data + * @param {ExUnits} ex_units + * @returns {Redeemer} + */ + static new( + tag: RedeemerTag, + index: BigNum, + data: PlutusData, + ex_units: ExUnits + ): Redeemer; +} +/** + */ +declare export class RedeemerTag { + free(): void; + + /** + * @returns {Uint8Array} + */ + to_bytes(): Uint8Array; + + /** + * @param {Uint8Array} bytes + * @returns {RedeemerTag} + */ + static from_bytes(bytes: Uint8Array): RedeemerTag; + + /** + * @returns {RedeemerTag} + */ + static new_spend(): RedeemerTag; + + /** + * @returns {RedeemerTag} + */ + static new_mint(): RedeemerTag; + + /** + * @returns {RedeemerTag} + */ + static new_cert(): RedeemerTag; + + /** + * @returns {RedeemerTag} + */ + static new_reward(): RedeemerTag; + + /** + * @returns {number} + */ + kind(): number; +} +/** + */ +declare export class Redeemers { + free(): void; + + /** + * @returns {Redeemers} + */ + static new(): Redeemers; + + /** + * @returns {number} + */ + len(): number; + + /** + * @param {number} index + * @returns {Redeemer} + */ + get(index: number): Redeemer; + + /** + * @param {Redeemer} elem + */ + add(elem: Redeemer): void; +} /** */ declare export class Relay { @@ -3188,6 +4089,34 @@ declare export class ScriptAny { */ static new(native_scripts: NativeScripts): ScriptAny; } +/** + */ +declare export class ScriptDataHash { + free(): void; + + /** + * @returns {Uint8Array} + */ + to_bytes(): Uint8Array; + + /** + * @param {string} prefix + * @returns {string} + */ + to_bech32(prefix: string): string; + + /** + * @param {string} bech_str + * @returns {ScriptDataHash} + */ + static from_bech32(bech_str: string): ScriptDataHash; + + /** + * @param {Uint8Array} bytes + * @returns {ScriptDataHash} + */ + static from_bytes(bytes: Uint8Array): ScriptDataHash; +} /** */ declare export class ScriptHash { @@ -3555,6 +4484,32 @@ declare export class StakeRegistration { */ static new(stake_credential: StakeCredential): StakeRegistration; } +/** + */ +declare export class Strings { + free(): void; + + /** + * @returns {Strings} + */ + static new(): Strings; + + /** + * @returns {number} + */ + len(): number; + + /** + * @param {number} index + * @returns {string} + */ + get(index: number): string; + + /** + * @param {string} elem + */ + add(elem: string): void; +} /** */ declare export class TimelockExpiry { @@ -3636,20 +4591,20 @@ declare export class Transaction { witness_set(): TransactionWitnessSet; /** - * @returns {TransactionMetadata | void} + * @returns {AuxiliaryData | void} */ - metadata(): TransactionMetadata | void; + auxiliary_data(): AuxiliaryData | void; /** * @param {TransactionBody} body * @param {TransactionWitnessSet} witness_set - * @param {TransactionMetadata | void} metadata + * @param {AuxiliaryData | void} auxiliary_data * @returns {Transaction} */ static new( body: TransactionBody, witness_set: TransactionWitnessSet, - metadata?: TransactionMetadata + auxiliary_data?: AuxiliaryData ): Transaction; } /** @@ -3756,14 +4711,14 @@ declare export class TransactionBody { update(): Update | void; /** - * @param {MetadataHash} metadata_hash + * @param {AuxiliaryDataHash} auxiliary_data_hash */ - set_metadata_hash(metadata_hash: MetadataHash): void; + set_auxiliary_data_hash(auxiliary_data_hash: AuxiliaryDataHash): void; /** - * @returns {MetadataHash | void} + * @returns {AuxiliaryDataHash | void} */ - metadata_hash(): MetadataHash | void; + auxiliary_data_hash(): AuxiliaryDataHash | void; /** * @param {number} validity_start_interval @@ -3785,6 +4740,46 @@ declare export class TransactionBody { */ multiassets(): Mint | void; + /** + * @param {ScriptDataHash} script_data_hash + */ + set_script_data_hash(script_data_hash: ScriptDataHash): void; + + /** + * @returns {ScriptDataHash | void} + */ + script_data_hash(): ScriptDataHash | void; + + /** + * @param {TransactionInputs} collateral + */ + set_collateral(collateral: TransactionInputs): void; + + /** + * @returns {TransactionInputs | void} + */ + collateral(): TransactionInputs | void; + + /** + * @param {Ed25519KeyHashes} required_signers + */ + set_required_signers(required_signers: Ed25519KeyHashes): void; + + /** + * @returns {Ed25519KeyHashes | void} + */ + required_signers(): Ed25519KeyHashes | void; + + /** + * @param {NetworkId} network_id + */ + set_network_id(network_id: NetworkId): void; + + /** + * @returns {NetworkId | void} + */ + network_id(): NetworkId | void; + /** * @param {TransactionInputs} inputs * @param {TransactionOutputs} outputs @@ -3895,9 +4890,9 @@ declare export class TransactionBuilder { set_withdrawals(withdrawals: Withdrawals): void; /** - * @param {TransactionMetadata} metadata + * @param {AuxiliaryData} auxiliary_data */ - set_metadata(metadata: TransactionMetadata): void; + set_auxiliary_data(auxiliary_data: AuxiliaryData): void; /** * @param {LinearFee} linear_fee @@ -4059,43 +5054,6 @@ declare export class TransactionInputs { */ add(elem: TransactionInput): void; } -/** - */ -declare export class TransactionMetadata { - free(): void; - - /** - * @returns {Uint8Array} - */ - to_bytes(): Uint8Array; - - /** - * @param {Uint8Array} bytes - * @returns {TransactionMetadata} - */ - static from_bytes(bytes: Uint8Array): TransactionMetadata; - - /** - * @returns {GeneralTransactionMetadata} - */ - general(): GeneralTransactionMetadata; - - /** - * @returns {NativeScripts | void} - */ - native_scripts(): NativeScripts | void; - - /** - * @param {NativeScripts} native_scripts - */ - set_native_scripts(native_scripts: NativeScripts): void; - - /** - * @param {GeneralTransactionMetadata} general - * @returns {TransactionMetadata} - */ - static new(general: GeneralTransactionMetadata): TransactionMetadata; -} /** */ declare export class TransactionMetadatum { @@ -4235,6 +5193,16 @@ declare export class TransactionOutput { */ amount(): Value; + /** + * @returns {DataHash | void} + */ + data_hash(): DataHash | void; + + /** + * @param {DataHash} data_hash + */ + set_data_hash(data_hash: DataHash): void; + /** * @param {Address} address * @param {Value} amount @@ -4342,14 +5310,14 @@ declare export class TransactionWitnessSet { vkeys(): Vkeywitnesses | void; /** - * @param {NativeScripts} scripts + * @param {NativeScripts} native_scripts */ - set_scripts(scripts: NativeScripts): void; + set_native_scripts(native_scripts: NativeScripts): void; /** * @returns {NativeScripts | void} */ - scripts(): NativeScripts | void; + native_scripts(): NativeScripts | void; /** * @param {BootstrapWitnesses} bootstraps @@ -4361,6 +5329,36 @@ declare export class TransactionWitnessSet { */ bootstraps(): BootstrapWitnesses | void; + /** + * @param {PlutusScripts} plutus_scripts + */ + set_plutus_scripts(plutus_scripts: PlutusScripts): void; + + /** + * @returns {PlutusScripts | void} + */ + plutus_scripts(): PlutusScripts | void; + + /** + * @param {PlutusList} plutus_data + */ + set_plutus_data(plutus_data: PlutusList): void; + + /** + * @returns {PlutusList | void} + */ + plutus_data(): PlutusList | void; + + /** + * @param {Redeemers} redeemers + */ + set_redeemers(redeemers: Redeemers): void; + + /** + * @returns {Redeemers | void} + */ + redeemers(): Redeemers | void; + /** * @returns {TransactionWitnessSet} */ @@ -4682,6 +5680,32 @@ declare export class Vkey { */ public_key(): PublicKey; } +/** + */ +declare export class Vkeys { + free(): void; + + /** + * @returns {Vkeys} + */ + static new(): Vkeys; + + /** + * @returns {number} + */ + len(): number; + + /** + * @param {number} index + * @returns {Vkey} + */ + get(index: number): Vkey; + + /** + * @param {Vkey} elem + */ + add(elem: Vkey): void; +} /** */ declare export class Vkeywitness {