assist/addresses

This module incorporates code for generating valid wallet and script addresses, ensuring their correctness. Empty keys are treated as intentional, and address subtypes are not combined nor mixed.

Functions

create_address(pkh: PublicKeyHash, sc: PublicKeyHash) -> Address

Creates a enterprise or base address from the public key hash and stake credential. An empty sc means enterpise address by default. This function assumes proper key lengths for pkh and sc.

addresses.create_address(datum.wallet.pkh, datum.wallet.sc)

create_script_address(vkh: ValidatorHash, sc: ValidatorHash) -> Address

Creates a script address for a smart contract. The type does not mix address types. Staked smart contracts are contracts as well. An empty sc is assumed to be not staked. This function assumes proper key lengths for vkh and sc.

addresses.create_script_address(datum.script.vkh, datum.script.sc)

from_wallet(wallet: Wallet) -> Address

Creates an address from the wallet type.

let addr: Address = types.from_wallet(this_wallet)
Search Document