View on GitHub
File Changes
}
/**
*/
+
export class AccountBindingSignature {
+
  free(): void;
+
/**
+
* @param {PrivateKey} private_key 
+
* @param {TransactionBindingAuthData} auth_data 
+
* @returns {AccountBindingSignature} 
+
*/
+
  static new(private_key: PrivateKey, auth_data: TransactionBindingAuthData): AccountBindingSignature;
+
}
+
/**
+
*/
export class AccountIdentifier {
  free(): void;
/**
  static account_from_public_key(key: PublicKey, discrimination: number): Address;
}
/**
-
* Type for representing a Transaction with Witnesses (signatures)
-
*/
-
export class AuthenticatedTransaction {
-
  free(): void;
-
/**
-
* Get a copy of the inner Transaction, discarding the signatures
-
* @returns {Transaction} 
-
*/
-
  transaction(): Transaction;
-
/**
-
* @returns {Witnesses} 
-
*/
-
  witnesses(): Witnesses;
-
}
-
/**
* Amount of the balance in the transaction.
*/
export class Balance {
* @returns {Certificate} 
*/
  static stake_pool_registration(pool_registration: PoolRegistration): Certificate;
+
}
/**
-
* @param {PrivateKey} private_key 
+
* Delegation Ratio type express a number of parts
+
* and a list of pools and their individual parts
+
*
+
* E.g. parts: 7, pools: [(A,2), (B,1), (C,4)] means that
+
* A is associated with 2/7 of the stake, B has 1/7 of stake and C
+
* has 4/7 of the stake.
+
*
+
* It\'s invalid to have less than 2 elements in the array,
+
* and by extension parts need to be equal to the sum of individual
+
* pools parts.
*/
-
  sign(private_key: PrivateKey): void;
+
export class DelegationRatio {
+
  free(): void;
+
/**
+
* @param {number} parts 
+
* @param {PoolDelegationRatios} pools 
+
* @returns {DelegationRatio} 
+
*/
+
  static new(parts: number, pools: PoolDelegationRatios): DelegationRatio | undefined;
+
}
+
/**
+
* Set the choice of delegation:
+
*
+
* * No delegation
+
* * Full delegation of this account to a specific pool
+
* * Ratio of stake to multiple pools
+
*/
+
export class DelegationType {
+
  free(): void;
+
/**
+
* @returns {DelegationType} 
+
*/
+
  static non_delegated(): DelegationType;
+
/**
+
* @param {PoolId} pool_id 
+
* @returns {DelegationType} 
+
*/
+
  static full(pool_id: PoolId): DelegationType;
+
/**
+
* @param {DelegationRatio} r 
+
* @returns {DelegationType} 
+
*/
+
  static ratio(r: DelegationRatio): DelegationType;
}
/**
* Algorithm used to compute transaction fees
-
* Currently the only implementation if the Linear one
+
* Currently the only implementation is the Linear one
*/
export class Fee {
  free(): void;
*/
  static linear_fee(constant: Value, coefficient: Value, certificate: Value): Fee;
/**
-
* Compute the fee if possible (it can fail in case the values are out of range)
* @param {Transaction} tx 
* @returns {Value} 
*/
-
  calculate(tx: Transaction): Value | undefined;
+
  calculate(tx: Transaction): Value;
}
/**
* All possible messages recordable in the Block content
*/
export class Fragment {
  free(): void;
/**
-
* @param {AuthenticatedTransaction} tx 
-
* @returns {Fragment} 
-
*/
-
  static from_authenticated_transaction(tx: AuthenticatedTransaction): Fragment;
-
/**
-
* Deprecated: Use `from_authenticated_transaction` instead
-
* @param {AuthenticatedTransaction} tx 
+
* @param {Transaction} tx 
* @returns {Fragment} 
*/
-
  static from_generated_transaction(tx: AuthenticatedTransaction): Fragment;
+
  static from_transaction(tx: Transaction): Fragment;
/**
* Get a Transaction if the Fragment represents one
-
* @returns {AuthenticatedTransaction} 
+
* @returns {Transaction} 
*/
-
  get_transaction(): AuthenticatedTransaction;
+
  get_transaction(): Transaction;
/**
* @returns {Uint8Array} 
*/
/**
* @returns {boolean} 
*/
-
  is_pool_management(): boolean;
+
  is_pool_retirement(): boolean;
+
/**
+
* @returns {boolean} 
+
*/
+
  is_pool_update(): boolean;
/**
* @returns {boolean} 
*/
export class Fragments {
  free(): void;
/**
+
* @returns {Fragments} 
+
*/
+
  static new(): Fragments;
+
/**
* @returns {number} 
*/
  size(): number;
* @returns {Fragment} 
*/
  get(index: number): Fragment;
+
/**
+
* @param {Fragment} item 
+
*/
+
  add(item: Fragment): void;
}
/**
* Type for representing a generic Hash
}
/**
*/
+
export class IndexSignatures {
+
  free(): void;
+
/**
+
* @returns {IndexSignatures} 
+
*/
+
  static new(): IndexSignatures;
+
/**
+
* @returns {number} 
+
*/
+
  size(): number;
+
/**
+
* @param {number} index 
+
* @returns {IndexedSignature} 
+
*/
+
  get(index: number): IndexedSignature;
+
/**
+
* @param {IndexedSignature} item 
+
*/
+
  add(item: IndexedSignature): void;
+
}
+
/**
+
*/
+
export class IndexedSignature {
module.exports.Account = Account;
/**
*/
+
class AccountBindingSignature {
+

                      
+
    static __wrap(ptr) {
+
        const obj = Object.create(AccountBindingSignature.prototype);
+
        obj.ptr = ptr;
+

                      
+
        return obj;
+
    }
+

                      
+
    free() {
+
        const ptr = this.ptr;
+
        this.ptr = 0;
+

                      
+
        wasm.__wbg_accountbindingsignature_free(ptr);
+
    }
+
    /**
+
    * @param {PrivateKey} private_key
+
    * @param {TransactionBindingAuthData} auth_data
+
    * @returns {AccountBindingSignature}
+
    */
+
    static new(private_key, auth_data) {
+
        _assertClass(private_key, PrivateKey);
+
        _assertClass(auth_data, TransactionBindingAuthData);
+
        const ret = wasm.accountbindingsignature_new(private_key.ptr, auth_data.ptr);
+
        return AccountBindingSignature.__wrap(ret);
+
    }
+
}
+
module.exports.AccountBindingSignature = AccountBindingSignature;
+
/**
+
*/
class AccountIdentifier {

                      
    static __wrap(ptr) {
}
module.exports.Address = Address;
/**
-
* Type for representing a Transaction with Witnesses (signatures)
-
*/
-
class AuthenticatedTransaction {
-

                      
-
    static __wrap(ptr) {
-
        const obj = Object.create(AuthenticatedTransaction.prototype);
-
        obj.ptr = ptr;
-

                      
-
        return obj;
-
    }
-

                      
-
    free() {
-
        const ptr = this.ptr;
-
        this.ptr = 0;
-

                      
-
        wasm.__wbg_authenticatedtransaction_free(ptr);
-
    }
-
    /**
-
    * Get a copy of the inner Transaction, discarding the signatures
-
    * @returns {Transaction}
-
    */
-
    transaction() {
-
        const ret = wasm.authenticatedtransaction_transaction(this.ptr);
-
        return Transaction.__wrap(ret);
-
    }
-
    /**
-
    * @returns {Witnesses}
-
    */
-
    witnesses() {
-
        const ret = wasm.authenticatedtransaction_witnesses(this.ptr);
-
        return Witnesses.__wrap(ret);
-
    }
-
}
-
module.exports.AuthenticatedTransaction = AuthenticatedTransaction;
-
/**
* Amount of the balance in the transaction.
*/
class Balance {
        const ret = wasm.certificate_stake_pool_registration(ptr0);
        return Certificate.__wrap(ret);
    }
+
}
+
module.exports.Certificate = Certificate;
+
/**
+
* Delegation Ratio type express a number of parts
+
* and a list of pools and their individual parts
+
*
+
* E.g. parts: 7, pools: [(A,2), (B,1), (C,4)] means that
+
* A is associated with 2/7 of the stake, B has 1/7 of stake and C
+
* has 4/7 of the stake.
+
*
+
* It\'s invalid to have less than 2 elements in the array,
+
* and by extension parts need to be equal to the sum of individual
+
* pools parts.
+
*/
+
class DelegationRatio {
+

                      
+
    static __wrap(ptr) {
+
        const obj = Object.create(DelegationRatio.prototype);
+
        obj.ptr = ptr;
+

                      
+
        return obj;
+
    }
+

                      
+
    free() {
+
        const ptr = this.ptr;
+
        this.ptr = 0;
+

                      
+
        wasm.__wbg_delegationratio_free(ptr);
+
    }
    /**
-
    * @param {PrivateKey} private_key
+
    * @param {number} parts
+
    * @param {PoolDelegationRatios} pools
+
    * @returns {DelegationRatio}
    */
-
    sign(private_key) {
-
        _assertClass(private_key, PrivateKey);
-
        const ptr0 = private_key.ptr;
-
        private_key.ptr = 0;
-
        wasm.certificate_sign(this.ptr, ptr0);
+
    static new(parts, pools) {
+
        _assertClass(pools, PoolDelegationRatios);
+
        const ptr0 = pools.ptr;
+
        pools.ptr = 0;
+
        const ret = wasm.delegationratio_new(parts, ptr0);
+
        return ret === 0 ? undefined : DelegationRatio.__wrap(ret);
    }
}
-
module.exports.Certificate = Certificate;
+
module.exports.DelegationRatio = DelegationRatio;
+
/**
+
* Set the choice of delegation:
+
*
+
* * No delegation
+
* * Full delegation of this account to a specific pool
+
* * Ratio of stake to multiple pools
+
*/
+
class DelegationType {
+

                      
+
    static __wrap(ptr) {
+
        const obj = Object.create(DelegationType.prototype);
+
        obj.ptr = ptr;
+

                      
+
        return obj;
+
    }
+

                      
+
    free() {
+
        const ptr = this.ptr;
+
        this.ptr = 0;
+

                      
+
        wasm.__wbg_delegationtype_free(ptr);
+
    }
+
    /**
+
    * @returns {DelegationType}
+
    */
+
    static non_delegated() {
+
        const ret = wasm.delegationtype_non_delegated();
+
        return DelegationType.__wrap(ret);
+
    }
+
    /**
+
    * @param {PoolId} pool_id
+
    * @returns {DelegationType}
+
    */
+
    static full(pool_id) {
+
        _assertClass(pool_id, PoolId);
+
        const ptr0 = pool_id.ptr;
+
        pool_id.ptr = 0;
+
        const ret = wasm.delegationtype_full(ptr0);
+
        return DelegationType.__wrap(ret);
+
    }
+
    /**
+
    * @param {DelegationRatio} r
+
    * @returns {DelegationType}
+
    */
+
    static ratio(r) {
+
        _assertClass(r, DelegationRatio);
+
        const ptr0 = r.ptr;
+
        r.ptr = 0;
+
        const ret = wasm.delegationtype_ratio(ptr0);
+
        return DelegationType.__wrap(ret);
+
    }
+
}
+
module.exports.DelegationType = DelegationType;
/**
* Algorithm used to compute transaction fees
-
* Currently the only implementation if the Linear one
+
* Currently the only implementation is the Linear one
*/
class Fee {

                      
        return Fee.__wrap(ret);
    }
    /**
-
    * Compute the fee if possible (it can fail in case the values are out of range)
    * @param {Transaction} tx
    * @returns {Value}
export function address_single_from_public_key(a: number, b: number): number;
export function address_delegation_from_public_key(a: number, b: number, c: number): number;
export function address_account_from_public_key(a: number, b: number): number;
-
export function __wbg_transaction_free(a: number): void;
export function __wbg_outputs_free(a: number): void;
+
export function outputs_new(): number;
export function outputs_size(a: number): number;
export function outputs_get(a: number, b: number): number;
+
export function outputs_add(a: number, b: number): void;
export function __wbg_inputs_free(a: number): void;
+
export function inputs_new(): number;
export function inputs_size(a: number): number;
export function inputs_get(a: number, b: number): number;
+
export function inputs_add(a: number, b: number): void;
export function __wbg_fragments_free(a: number): void;
+
export function fragments_new(): number;
export function fragments_size(a: number): number;
export function fragments_get(a: number, b: number): number;
-
export function transaction_id(a: number): number;
-
export function transaction_inputs(a: number): number;
-
export function transaction_outputs(a: number): number;
-
export function transaction_clone(a: number): number;
-
export function __wbg_transactionbuilder_free(a: number): void;
-
export function transactionbuilder_new(): number;
-
export function transactionbuilder_new_no_payload(): number;
-
export function transactionbuilder_new_payload(a: number): number;
-
export function transactionbuilder_add_input(a: number, b: number): void;
-
export function transactionbuilder_add_output(a: number, b: number, c: number): void;
-
export function transactionbuilder_estimate_fee(a: number, b: number): number;
-
export function transactionbuilder_get_balance(a: number, b: number): number;
-
export function transactionbuilder_get_balance_without_fee(a: number): number;
-
export function transactionbuilder_unchecked_finalize(a: number): number;
-
export function transactionbuilder_seal_with_output_policy(a: number, b: number, c: number): number;
-
export function transactionbuilder_finalize(a: number, b: number, c: number): number;
+
export function fragments_add(a: number, b: number): void;
export function __wbg_outputpolicy_free(a: number): void;
export function outputpolicy_forget(): number;
export function outputpolicy_one(a: number): number;
-
export function __wbg_transactionfinalizer_free(a: number): void;
-
export function transactionfinalizer_new(a: number): number;
-
export function transactionfinalizer_set_witness(a: number, b: number, c: number): void;
-
export function transactionfinalizer_get_txid(a: number): number;
-
export function transactionfinalizer_get_tx_sign_data_hash(a: number): number;
-
export function transactionfinalizer_build(a: number): number;
-
export function transactionfinalizer_finalize(a: number): number;
-
export function __wbg_authenticatedtransaction_free(a: number): void;
-
export function authenticatedtransaction_transaction(a: number): number;
-
export function authenticatedtransaction_witnesses(a: number): number;
export function __wbg_transactionsigndatahash_free(a: number): void;
export function transactionsigndatahash_from_bytes(a: number, b: number): number;
export function transactionsigndatahash_from_hex(a: number, b: number): number;
export function __wbg_certificate_free(a: number): void;
export function __wbg_poolregistration_free(a: number): void;
export function __wbg_stakedelegation_free(a: number): void;
+
export function __wbg_delegationtype_free(a: number): void;
+
export function delegationtype_non_delegated(): number;
+
export function delegationtype_full(a: number): number;
+
export function delegationtype_ratio(a: number): number;
+
export function __wbg_delegationratio_free(a: number): void;
+
export function __wbg_pooldelegationratio_free(a: number): void;
+
export function pooldelegationratio_new(a: number, b: number): number;
+
export function __wbg_pooldelegationratios_free(a: number): void;
+
export function pooldelegationratios_new(): number;
+
export function pooldelegationratios_size(a: number): number;
+
export function pooldelegationratios_get(a: number, b: number): number;
+
export function pooldelegationratios_add(a: number, b: number): void;
+
export function delegationratio_new(a: number, b: number): number;
export function stakedelegation_new(a: number, b: number): number;
export function certificate_stake_delegation(a: number): number;
export function certificate_stake_pool_registration(a: number): number;
-
export function certificate_sign(a: number, b: number): void;
export function poolregistration_new(a: number, b: number, c: number, d: number, e: number, f: number): number;
export function poolregistration_id(a: number): number;
export function __wbg_timeoffsetseconds_free(a: number): void;
export function witness_for_account(a: number, b: number, c: number, d: number): number;
export function witness_to_bech32(a: number, b: number): void;
export function __wbg_witnesses_free(a: number): void;
+
export function witnesses_new(): number;
export function witnesses_size(a: number): number;
export function witnesses_get(a: number, b: number): number;
+
export function witnesses_add(a: number, b: number): void;
export function __wbg_spendingcounter_free(a: number): void;
export function spendingcounter_zero(): number;
export function spendingcounter_from_u32(a: number): number;
export function __wbg_fragment_free(a: number): void;
-
export function fragment_from_authenticated_transaction(a: number): number;
-
export function fragment_from_generated_transaction(a: number): number;
+
export function fragment_from_transaction(a: number): number;
export function fragment_get_transaction(a: number): number;
export function fragment_as_bytes(a: number, b: number): void;
export function fragment_is_initial(a: number): number;
export function fragment_is_transaction(a: number): number;
export function fragment_is_owner_stake_delegation(a: number): number;
export function fragment_is_stake_delegation(a: number): number;
export function fragment_is_pool_registration(a: number): number;
-
export function fragment_is_pool_management(a: number): number;
+
export function fragment_is_pool_retirement(a: number): number;
+
export function fragment_is_pool_update(a: number): number;
export function fragment_is_old_utxo_declaration(a: number): number;
export function fragment_is_update_proposal(a: number): number;
export function fragment_is_update_vote(a: number): number;
export function fragmentid_from_bytes(a: number, b: number): number;
export function fragmentid_as_bytes(a: number, b: number): void;
export function uint8array_to_hex(a: number, b: number): void;
+
export function __wbg_transaction_free(a: number): void;
+
export function transaction_id(a: number): number;
+
export function transaction_inputs(a: number): number;
+
export function transaction_outputs(a: number): number;
+
export function transaction_clone(a: number): number;
+
export function __wbg_transactionbuilder_free(a: number): void;
+
export function __wbg_transactionbuildersetios_free(a: number): void;
+
export function __wbg_transactionbuildersetwitness_free(a: number): void;
+
export function __wbg_transactionbuildersetauthdata_free(a: number): void;
+
export function transactionbuilder_new(): number;
+
export function transactionbuilder_payload(a: number, b: number): number;
+
export function transactionbuilder_no_payload(a: number): number;
+
export function transactionbuildersetios_set_ios(a: number, b: number, c: number): number;
+
export function transactionbuildersetwitness_get_auth_data_for_witness(a: number): number;
+
export function transactionbuildersetwitness_set_witnesses(a: number, b: number): number;
+
export function transactionbuildersetauthdata_get_auth_data(a: number): number;
+
export function transactionbuildersetauthdata_set_payload_auth(a: number, b: number): number;
+
export function __wbg_transactionbindingauthdata_free(a: number): void;
+
export function __wbg_payloadauthdata_free(a: number): void;
+
export function payloadauthdata_for_no_payload(): number;
+
export function payloadauthdata_for_owner_stake_delegation(): number;
+
export function payloadauthdata_for_stake_delegation(a: number): number;
+
export function payloadauthdata_for_pool_registration(a: number): number;
+
export function payloadauthdata_for_pool_retirement(a: number): number;
+
export function payloadauthdata_for_pool_update(a: number): number;
+
export function __wbg_stakedelegationauthdata_free(a: number): void;
+
export function stakedelegationauthdata_new(a: number): number;
+
export function __wbg_indexedsignature_free(a: number): void;
+
export function __wbg_indexsignatures_free(a: number): void;
+
export function indexsignatures_new(): number;
+
export function indexsignatures_size(a: number): number;
+
export function indexsignatures_get(a: number, b: number): number;
+
export function indexsignatures_add(a: number, b: number): void;
+
export function indexedsignature_new(a: number, b: number): number;
+
export function __wbg_accountbindingsignature_free(a: number): void;
+
export function accountbindingsignature_new(a: number, b: number): number;
+
export function __wbg_poolregistrationauthdata_free(a: number): void;
+
export function poolregistrationauthdata_new(a: number): number;
+
export function __wbg_poolretirementauthdata_free(a: number): void;
+
export function poolretirementauthdata_new(a: number): number;
+
export function __wbg_poolupdateauthdata_free(a: number): void;
+
export function poolupdateauthdata_new(a: number): number;
+
export function __wbg_payload_free(a: number): void;
+
export function payload_no_payload(): number;
+
export function payload_certificate(a: number): number;
+
export function __wbg_inputoutputbuilder_free(a: number): void;
+
export function inputoutputbuilder_empty(): number;
+
export function inputoutputbuilder_add_input(a: number, b: number): void;
+
export function inputoutputbuilder_add_output(a: number, b: number, c: number): void;
+
export function inputoutputbuilder_estimate_fee(a: number, b: number, c: number): number;
+
export function inputoutputbuilder_get_balance(a: number, b: number, c: number): number;
+
export function inputoutputbuilder_get_balance_without_fee(a: number): number;
+
export function inputoutputbuilder_build(a: number): number;
+
export function inputoutputbuilder_seal(a: number, b: number, c: number): number;
+
export function inputoutputbuilder_seal_with_output_policy(a: number, b: number, c: number, d: number): number;
+
export function __wbg_inputoutput_free(a: number): void;
+
export function inputoutput_inputs(a: number): number;
+
export function inputoutput_outputs(a: number): number;
export function __wbindgen_malloc(a: number): number;
export function __wbindgen_free(a: number, b: number): void;
    "Enzo Cioppettini <[email protected]>"
  ],
  "description": "Jörmungandr library, wallet and stake pool management.\n",
-
  "version": "0.1.2",
+
  "version": "0.2.0",
  "license": "MIT OR Apache-2.0",
  "repository": {
    "type": "git",