Members

(constant) assetClassification :Object.<string, string>

Token classification mapping.

Type:
  • Object.<string, string>

(constant) txPrerequisites :TxPrerequisites

Methods

(async) addTxOutPuts(tx, addresses, datums, j) → {Promise.<Tx>}

Add multiple outputs to a tx.

Parameters:
NameTypeDescription
txTx

Transaction.

addressesArray.<Address>

Output addresses.

datumsArray.<any>

Corresponding Values/TxOutputs payloads.

jobject

Logger.

Returns:

The tx.

Type: 
Promise.<Tx>

(async) addressFunc(walletDataopt) → {Promise.<string>}

Return bech32 address from provided (or global) walletData.

Parameters:
NameTypeAttributesDefaultDescription
walletDataobject<optional>
walletData

Wallet data.

Returns:

Bech32 address.

Type: 
Promise.<string>

(async) apiGetAssetFromPolicy(policy) → {Promise.<any>}

Fetch assets from a policy (backend PHP).

Parameters:
NameTypeDescription
policystring

Policy id.

Returns:
Type: 
Promise.<any>

(async) apiListAddressFromSpecificPolicy(policyHexTokenName) → {Promise.<any>}

Fetch addresses holding a specific token policy.

Parameters:
NameTypeDescription
policyHexTokenNamestring

Policy identifier.

Returns:
Type: 
Promise.<any>

(async) apiListTransactionsFromPolicyHexTokenName(policyHexTokenName) → {Promise.<any>}

Fetch transactions for a token by policyHexTokenName.

Parameters:
NameTypeDescription
policyHexTokenNamestring

Policy + token hex name.

Returns:
Type: 
Promise.<any>

(async) apiTokenFromAsset(mphHexAssetName) → {Promise.<any>}

Fetch token info by mphHexAssetName.

Parameters:
NameTypeDescription
mphHexAssetNamestring

Asset name with MPH.

Returns:
Type: 
Promise.<any>

(async) assetFunc(utxos) → {Promise.<Array.<{mph: string, tokenName: string, qty: number}>>}

Parse and extract asset metadata from UTXOs.

Parameters:
NameTypeDescription
utxosArray

UTXO array.

Returns:
Type: 
Promise.<Array.<{mph: string, tokenName: string, qty: number}>>

(async) assetFunc() → {Promise.<Array.<{tokenName:string, assetQty:bigint, mph:string, assetHexName:string, assetFingerPrint:string}>>}

Build simple asset listing from first UTXO set.

Returns:
Type: 
Promise.<Array.<{tokenName:string, assetQty:bigint, mph:string, assetHexName:string, assetFingerPrint:string}>>

(async) baseAddressPKH() → {Promise.<string>}

Get base address PKH (hex) from global walletData.

Returns:

PKH hex.

Type: 
Promise.<string>

bech32ToPkh(addressBech32) → {PubKeyHash|string}

Convert a bech32 address into PKH.

Parameters:
NameTypeDescription
addressBech32string

Bech32 address string.

Returns:

PKH or error message.

Type: 
PubKeyHash | string

bech32ToValidatorHash(addressBech32) → {any|string}

Convert a bech32 address to its validator hash.

Parameters:
NameTypeDescription
addressBech32string

Bech32 address (script address).

Returns:

Validator hash object or error message.

Type: 
any | string

(async) buyAssets(buyselltokens, qty) → {Promise.<string>}

Buy asset(s) from an active sale.

Reads the datum from the script UTXO, calculates the allowed quantity, pays the seller, sends purchased tokens to buyer, and if tokens remain, re-locks them at the script with an updated datum.

Parameters:
NameTypeDescription
buyselltokensstring

Helios source for the buy/sell validator.

qtybigint | number

Desired quantity to buy.

Returns:

Submitted transaction hash.

Type: 
Promise.<string>

(async) cancelAssetsSale(buyselltokens) → {Promise.<string>}

Cancel an active asset sale (seller retrieves remaining tokens).

Consumes the script UTXO with a Cancel redeemer and returns the remaining tokens to the seller address.

Parameters:
NameTypeDescription
buyselltokensstring

Helios source for the buy/sell validator.

Returns:

Submitted transaction hash.

Type: 
Promise.<string>

compileScript(scriptName) → {any}

Compile a Helios script source immediately (optimize=true).

Parameters:
NameTypeDescription
scriptNamestring

Helios source code of the script.

Returns:

Compiled program.

Type: 
any

(async) convertBech32ToPkh(addressBech32) → {Promise.<any>}

Convert a Bech32 address to its public key hash (PKH).

Parameters:
NameTypeDescription
addressBech32string

Cardano address (bech32 format).

Returns:

PKH object.

Type: 
Promise.<any>

createAsset(mphHex, tokenNameHex, qty) → {Assets}

Create an Assets map with a single (mph, tokenNameHex, qty) component.

Parameters:
NameTypeDescription
mphHexstring
tokenNameHexstring
qtybigint | number
Returns:
Type: 
Assets

createAssetClass(mphHex, tokenNameHex) → {AssetClass}

Create an AssetClass from mph + tokenNameHex.

Parameters:
NameTypeDescription
mphHexstring
tokenNameHexstring
Returns:
Type: 
AssetClass

createCIP68Token(tnNameString, intLabel) → {string}

Create a token name (hex) for known CIP-68 labels.

Parameters:
NameTypeDescription
tnNameStringstring

Human-readable name.

intLabelnumber

One of 100/222/333/444/555/666.

Returns:

Token name hex or error text.

Type: 
string

createFiveWalletAddresses(mnemonic) → {Array.<Object>}

Create 5 derived wallet addresses from mnemonic.

Parameters:
NameTypeDescription
mnemonicArray.<string>

BIP39 mnemonic words.

Returns:

Array of derived addresses and keys.

Type: 
Array.<Object>

(async) createMnemonic(bitopt) → {Promise.<Array.<string>>}

Create a BIP39 mnemonic.

Parameters:
NameTypeAttributesDefaultDescription
bitnumber<optional>
256

Bit strength.

Returns:

Array of words.

Type: 
Promise.<Array.<string>>

createOptionRadio(name, assetQty, mph, i) → {HTMLElement}

Create radio option DOM element for asset selection.

Parameters:
NameTypeDescription
namestring

Token name.

assetQtystring | number

Quantity.

mphstring

Minting policy hash.

inumber

Index for input name uniqueness.

Returns:

DOM container with radio input and label.

Type: 
HTMLElement

(async) decryptMnemonic(passphrase, salt, iv, ct) → {Promise.<string>}

Decrypt mnemonic.

Parameters:
NameTypeDescription
passphrasestring

Passphrase.

saltstring

Base64 salt.

ivstring

Base64 IV.

ctstring

Base64 ciphertext.

Returns:

Decrypted mnemonic or "error".

Type: 
Promise.<string>

(async) displayValue() → {Promise.<any>}

Dump first UTXO set Value object.

Returns:

Value structure.

Type: 
Promise.<any>

el(id) → {HTMLElement|null}

Get DOM element by ID.

Parameters:
NameTypeDescription
idstring

Element ID.

Returns:
Type: 
HTMLElement | null

elen(elem) → {number}

Get length of trimmed value of an input element. Optional

Parameters:
NameTypeDescription
elemHTMLInputElement

Input element.

Returns:

Trimmed value length.

Type: 
number

(async) encryptMnemonic(passphrase, mnemonic) → {Promise.<Object>}

Encrypt mnemonic with passphrase (Argon2id + AES-GCM).

Parameters:
NameTypeDescription
passphrasestring

Passphrase.

mnemonicstring

Mnemonic string.

Returns:

{ salt, iv, ct }

Type: 
Promise.<Object>

genKeys(phraseopt) → {Object}

Generate keys from phrase.

Parameters:
NameTypeAttributesDescription
phrasestring<optional>

Mnemonic phrase.

Returns:

{ ownerPrivateKey, ownerPublicKeyHash, ownerAddress }

Type: 
Object

generateMetadata(info) → {object}

Generate 721 metadata map for an NFT.

Parameters:
NameTypeDescription
infoobject

NFT info object (policyId, assetName, desc, IPFS, etc.).

Returns:

Metadata structure.

Type: 
object

(async) getAda() → {Promise.<string>}

Get ADA balance as string.

Returns:

ADA balance.

Type: 
Promise.<string>

(async) getAddr(address) → {Promise.<any>}

Query Koios API for an address.

Parameters:
NameTypeDescription
addressstring

Address to query.

Returns:
Type: 
Promise.<any>

(async) getAllTxInputs(scriptAddressPkh) → {Promise.<Array.<any>>}

Get all UTXOs for a given script address.

Parameters:
NameTypeDescription
scriptAddressPkhstring

Script address PKH.

Returns:

Array of UTXOs.

Type: 
Promise.<Array.<any>>

(async) getAssetsFromValue(value)

Extract asset entries from a Value object.

Parameters:
NameTypeDescription
valueany

Value object with .assets, .lovelace.

(async) getEncryptedData(url, data) → {Promise.<any>}

Get encrypted data from server.

Parameters:
NameTypeDescription
urlstring

Target endpoint.

dataObject

Data object.

Returns:

Response data.

Type: 
Promise.<any>

(async) getKeyTokens() → {Promise.<void>}

Fetch key tokens from backend.

Returns:
Type: 
Promise.<void>

(async) getKeyUtxo(address) → {Promise.<any>}

Get vesting key UTXO via PHP API.

Parameters:
NameTypeDescription
addressstring

Address to query.

Returns:

UTXO data.

Type: 
Promise.<any>

(async) getLovelace() → {Promise.<string>}

Get lovelace balance as string.

Returns:

Lovelace balance.

Type: 
Promise.<string>

(async) getNetworkParams(ntypeopt) → {Promise.<object>}

Load network parameters JSON depending on txPrerequisites.ntype.

Parameters:
NameTypeAttributesDefaultDescription
ntypenumber<optional>
0

0=preprod, 1=preview, 2=mainnet.

Returns:

Network params JSON.

Type: 
Promise.<object>

(async) getTicketMetadataCIP25(asset, blockfrostapi) → {Promise.<Ticket>}

Get on-chain ticket metadata (CIP-25).

Parameters:
NameTypeDescription
assetstring

Asset id.

blockfrostapistring

Blockfrost API key.

Returns:

Ticket info object.

Type: 
Promise.<Ticket>

(async) getTicketMetadataCIP68(asset, apiKey) → {Promise.<PrintTicketInfo>}

Get on-chain ticket metadata (CIP-68).

Parameters:
NameTypeDescription
assetstring

Asset id.

apiKeystring

Blockfrost API key.

Returns:

Parsed ticket info.

Type: 
Promise.<PrintTicketInfo>

(async) getTokenUtxoFromProgramInstance(programInstance, tokenMPH) → {Promise.<(any|null)>}

Get UTXO from compiled program instance containing given token MPH.

Parameters:
NameTypeDescription
programInstanceany

Helios program instance.

tokenMPHstring

Minting policy hash.

Returns:

UTXO or null.

Type: 
Promise.<(any|null)>

(async) getUtxoMphTokenNameHex(scriptAddressPkh, mph, tokenNameHex) → {Promise.<(any|null)>}

Similar to getUtxoMphTokenNameHexFromBech32Addr, but queries by PKH.

Parameters:
NameTypeDescription
scriptAddressPkhstring

Script address PKH.

mphstring

Minting policy hash.

tokenNameHexstring

Token name hex.

Returns:

UTXO object.

Type: 
Promise.<(any|null)>

(async) getUtxoMphTokenNameHexFromBech32Addr(scriptAddressBech32, mph, tokenNameHex) → {Promise.<(any|null)>}

Find a specific UTXO containing a token by MPH and tokenNameHex at a given bech32 script address.

Parameters:
NameTypeDescription
scriptAddressBech32string

Bech32 script address.

mphstring

Minting policy hash (hex).

tokenNameHexstring

Token name (hex).

Returns:

UTXO object or null.

Type: 
Promise.<(any|null)>

hexToByteArray()

Hex → ByteArrayData wrapper.

hexToTex(hexx) → {string}

Convert a hex string to plain text (UTF-16 code units).

Parameters:
NameTypeDescription
hexxstring | number

Hex string (without 0x).

Returns:

Decoded text.

Type: 
string

hexToText(str1) → {string}

Convert hex string to UTF-16 text.

Parameters:
NameTypeDescription
str1string

Hex string.

Returns:

Decoded text.

Type: 
string

id(length) → {string}

Generate a random alphanumeric id.

Parameters:
NameTypeDescription
lengthnumber
Returns:
Type: 
string

(async) init(j) → {Promise.<("nami"|"eternl"|"lace"|"flint"|"nufi"|"yoroi"|null)>}

Detects installed Cardano wallets (CIP-30 providers) and returns the selected id.

Parameters:
NameTypeDescription
jobject

Logger/test harness.

Returns:
Type: 
Promise.<("nami"|"eternl"|"lace"|"flint"|"nufi"|"yoroi"|null)>

isStrongPassword(password) → {boolean}

Check if password is strong.

Parameters:
NameTypeDescription
passwordstring

Password string.

Returns:

True if strong, else false.

Type: 
boolean

jAlert(title, message, iconopt, timeropt) → {void}

Show an alert using SweetAlert. Optional : https://cdn.jsdelivr.net/npm/sweetalert2@11

Parameters:
NameTypeAttributesDefaultDescription
titlestring

Alert title.

messagestring

Alert message.

iconstring<optional>
"error"

Alert icon type.

timernumber<optional>
6000

Display duration in milliseconds.

Returns:
Type: 
void

keyValueList(arList, arListv) → {Array.<BytePair>}

Convert parallel key/value arrays to CIP-68 MapData list: [[keyBytes, valBytes], ...]

Parameters:
NameTypeDescription
arListArray.<string>

Keys.

arListvArray.<string>

Values.

Returns:
Type: 
Array.<BytePair>

(async) lock(vesting, amountopt, secretMessageopt) → {Promise.<void>}

Lock funds in a vesting contract.

Parameters:
NameTypeAttributesDefaultDescription
vestingstring

Helios script source.

amountnumber<optional>
10000000

Amount in lovelace.

secretMessagestring<optional>
"secret"

Secret parameter.

Returns:
Type: 
Promise.<void>

(async) mint(ticket, data) → {Promise.<(void|string)>}

Mint new tokens on the Cardano blockchain.

Parameters:
NameTypeDescription
ticketstring

Compiled smart contract source.

dataObject

Minting metadata and user input.

Returns:
Type: 
Promise.<(void|string)>

(async) mint(data) → {Promise.<void>}

Mint new asset(s) using a provided Helios script.

Parameters:
NameTypeDescription
dataobject

Token data (assetName, title, desc, IPFS, etc.).

Returns:
Type: 
Promise.<void>

(async) mintAssets()

Mint a new NFT (internal helper).

(async) mintBurnToken(scriptForMintingNFT, scriptForLockingNFT, info) → {Promise.<string>}

Mint & lock a CIP-68-capable token at a script with inline datum. Signs and submits via provided Blockfrost client.

Parameters:
NameTypeDescription
scriptForMintingNFTstring

Minting policy (Helios source).

scriptForLockingNFTstring

Validator (Helios source).

infoobject

Payload used for parameters & metadata:

Properties
NameTypeDescription
baseAddressany

Address object of the owner.

assetNamestring

Token name (string, not hex).

quantitybigint | number

Quantity to mint.

cip68InlineDatumany

Datum.inline(...) for script output.

dbRecordStatusstring

DB marker for save_ call.

assetTitlestring
StudentNumberstring
assetNameCodestring
txhashHTMLElement

DOM node where link is set.

phpFileNamestring

Endpoint for save_.

recipientPayKeyany

Key with sign() to sign bodyHash.

TEST_BLOCKFROSTany

Blockfrost client with submitTx(unsignedTx).

Returns:

Tx hash.

Type: 
Promise.<string>

(async) mintPropertyUserSharesToken(mintPropertyUserSharesTokensScript, info, buySellTokenProperty) → {Promise.<string>}

Mint user property shares token.

Builds, signs, and submits a transaction on-chain.

Parameters:
NameTypeDescription
mintPropertyUserSharesTokensScriptstring

Helios source for minting script.

infoObject

Information object (UTxO, quantity, token metadata).

buySellTokenPropertystring

Helios program source for buy/sell.

Returns:

Transaction hash or "failed txh".

Type: 
Promise.<string>

(async) mint_(tokenName, tokenDescription, tokenImageUrl) → {Promise.<void>}

Public NFT minting wrapper.

Parameters:
NameTypeDescription
tokenNamestring

NFT name.

tokenDescriptionstring

NFT description.

tokenImageUrlstring

NFT image URL.

Returns:
Type: 
Promise.<void>

mphBin(mphHex) → {MintingPolicyHash}

Convert mph hex string to MintingPolicyHash.

Parameters:
NameTypeDescription
mphHexstring
Returns:
Type: 
MintingPolicyHash

(async) pkeys(PinCode, PrimaryEmail, PassPhrase) → {Promise.<{pk: object, pkh: object, addr: object}>}

Retrieve payment and staking keys using passphrase and PIN.

Parameters:
NameTypeDescription
PinCodestring

User PIN.

PrimaryEmailstring

User email.

PassPhrasestring

Mnemonic decryption password.

Returns:
Type: 
Promise.<{pk: object, pkh: object, addr: object}>

(async) postEncryptedData(url, data) → {Promise.<string>}

Post encrypted data using XMLHttpRequest.

Parameters:
NameTypeDescription
urlstring

Target endpoint.

dataObject

Data object.

Returns:

Response text.

Type: 
Promise.<string>

randString(length) → {string}

Generate random alphanumeric string.

Parameters:
NameTypeDescription
lengthnumber

Length of the string.

Returns:

Random string.

Type: 
string

random(bytesopt) → {string}

Generate a random hex string.

Parameters:
NameTypeAttributesDefaultDescription
bytesnumber<optional>
16

Number of bytes.

Returns:

Random hex string.

Type: 
string

randomBytes(length) → {Uint8Array}

Generate cryptographically secure random bytes.

Parameters:
NameTypeDescription
lengthnumber

Byte length.

Returns:
Type: 
Uint8Array

refTokenAssetClassCIP68(createCIP68ReferenceTokenName, qtyopt) → {CIP68AssetClass}

Create a CIP-68 reference token asset-class tuple from hex token name.

Parameters:
NameTypeAttributesDefaultDescription
createCIP68ReferenceTokenNamestring

token name hex (already labeled).

qtybigint | number<optional>
1

Quantity (or -1 if not 1).

Returns:

Asset-class object

Type: 
CIP68AssetClass

refTokenCip68AssetFromMPHAssetClass(mph, assetClassCIP68-) → {Assets}

Build a CIP-68 Reference Token Assets object from pre-built assetClassCIP68.

Parameters:
NameTypeDescription
mphstring

Policy hash hex.

assetClassCIP68-CIP68AssetClass

[tokenNameBytes, qty].

Returns:
Type: 
Assets

refTokenCip68AssetFromMphTnName(mph, tnName, qtyopt) → {Assets}

Build a CIP-68 Reference Token (label=100) Assets object from MPH & tnName.

Parameters:
NameTypeAttributesDefaultDescription
mphstring

Policy hash hex.

tnNamestring

Human token name (string).

qtybigint | number<optional>
1

Quantity; if not 1, uses -1 (per your code).

Returns:

Helios Assets object.

Type: 
Assets

save(key, valueopt) → {string|void}

Save and retrieve values from localStorage.

Parameters:
NameTypeAttributesDescription
keystring

Storage key.

valuestring<optional>

Optional value to save.

Returns:

Stored value when no value passed.

Type: 
string | void

(async) save_(tokenHexName, mph, txId, txIdx, qty, ownPKH, txh, status, tokenName, uidnullable, pidnullable, sharesTokenPricenullable, scriptAddressBech32nullable, ownAddressBech32nullable, buyerAddressBech32nullable, nftIdnullable, phpFileNameopt) → {Promise.<void>}

Save token progress on the backend.

Parameters:
NameTypeAttributesDefaultDescription
tokenHexNamestring

Token name in hex format.

mphstring

Minting Policy Hash.

txIdstring

Transaction ID.

txIdxnumber

Transaction index (UTxO).

qtybigint

Token quantity.

ownPKHstring

Owner's public key hash.

txhstring

Transaction hash.

statusstring

Token status (e.g., "open").

tokenNamestring

Human-readable token name.

uidstring<nullable>

User ID (optional).

pidstring<nullable>

Property ID (optional).

sharesTokenPricenumber<nullable>

Token price (optional).

scriptAddressBech32string<nullable>

Script address (bech32 format).

ownAddressBech32string<nullable>

Owner’s address (bech32 format).

buyerAddressBech32string<nullable>

Buyer’s address (bech32 format).

nftIdstring<nullable>

NFT identifier (optional).

phpFileNamestring<optional>
"./saveProgressTokens.php"

Target PHP file for saving.

Returns:
Type: 
Promise.<void>

save_share_token_markets(…args) → {void}

Save token data into share token markets backend.

Parameters:
NameTypeAttributesDescription
argsany<repeatable>

Similar to save_, with an additional price.

Returns:
Type: 
void

scriptAddParams(script, arList) → {any}

Add (or override) parameters on a Helios Program from key/value pairs.

Parameters:
NameTypeDescription
scriptany

Helios Program instance (not compiled).

arListArray.<KV>

Array of [key, value] tuples.

Returns:

Same script instance with parameters set.

Type: 
any

(async) sellAssets(buyselltokens, data) → {Promise.<string>}

Place asset for sale by locking it at the script address.

Builds a datum with (sellerPKH, asset, qty, saleId, unitPrice, totalPrice) and sends the assets to the script address.

Parameters:
NameTypeDescription
buyselltokensstring

Helios source for the buy/sell validator.

dataobject

Sale info.

Properties
NameTypeDescription
nftUnitPriceLovelacebigint | number

Price per token (in lovelace).

nftQuantitybigint | number

Number of tokens to sell.

saleNostring | number

Arbitrary sale sequence/id to build a unique saleId.

Returns:

Submitted transaction hash.

Type: 
Promise.<string>
Example
const txh = await sellAssets(buysellScriptSrc, {
  nftUnitPriceLovelace: 5000000n,
  nftQuantity: 3n,
  saleNo: Date.now()
});

(async) sendADA(toAddress, amountToTransfer, pk) → {Promise.<string>}

Send ADA to another address.

Parameters:
NameTypeDescription
toAddressstring

Destination address in bech32.

amountToTransfernumber | string

Amount of ADA to send.

pkobject

Payment signing key.

Returns:

Transaction hash or error.

Type: 
Promise.<string>

(async) sendADA(toAddress, amountToTransfer) → {Promise.<void>}

Send ADA to a bech32 address.

Parameters:
NameTypeDescription
toAddressstring

Destination (bech32).

amountToTransfernumber | string

ADA amount (not lovelace).

Returns:
Type: 
Promise.<void>

(async) sendAssets(data) → {Promise.<string>}

Send native assets to a recipient.

Parameters:
NameTypeDescription
dataObject

Transaction input/output details and metadata.

Returns:

Transaction hash or failure message.

Type: 
Promise.<string>

(async) sendAssets(assetMPH, assetName, assetQty, toAddress) → {Promise.<void>}

Send a native asset/NFT to an address.

Parameters:
NameTypeDescription
assetMPHstring

Minting policy hash (hex).

assetNamestring

Asset name (UTF-8).

assetQtybigint | number

Quantity.

toAddressstring

Destination (bech32).

Returns:
Type: 
Promise.<void>

(async) shortAddressFunc() → {Promise.<string>}

Get shortened base address of current wallet.

Returns:
Type: 
Promise.<string>

showPlutusCostModels(TEST_NETWORK_PARAMS_PREPROD) → {void}

Show Plutus cost model details from network parameters.

Parameters:
NameTypeDescription
TEST_NETWORK_PARAMS_PREPRODNetworkParams

Network parameters instance.

Returns:
Type: 
void

(async) showWalletData(walletData, utxoAmount, AssetClass, j) → {Promise.<(Array.<object>|null)>}

Collect wallet summary + detected assets from first UTXO set.

Parameters:
NameTypeDescription
walletDataobject

Result of walletEssentials.

utxoAmountnumber | bigint

Minimum lovelace checked earlier.

AssetClassAssetClass

Asset fingerprint helper.

jobject

Logger.

Returns:

Array where the first element is wallet info, followed by asset entries.

Type: 
Promise.<(Array.<object>|null)>

strToBytes()

Alias of stringToByteArray.

strToHex(str) → {string}

Convert a string to hex.

Parameters:
NameTypeDescription
strstring
Returns:

Hex string.

Type: 
string

stringToByteArray()

String → ByteArrayData wrapper.

(async) submitTx(walletData, tx) → {Promise.<string>}

Submit a transaction via walletAPI.

Parameters:
NameTypeDescription
walletDataobject

Wallet data with walletAPI.

txTx

Transaction.

Returns:

Tx hash hex.

Type: 
Promise.<string>

(async) sumUTXOADA(address, TxInput, addressPKH, addressRootPrivateKey, TEST_NETWORK_PARAMS_PREPROD, TEST_BLOCKFROST) → {Promise.<string>}

Sum ADA from all UTXOs of an address and submit a transaction that consolidates them.

Parameters:
NameTypeDescription
addressstring

Bech32 wallet address.

TxInputTxInput

Transaction input helper.

addressPKHany

Address public key hash.

addressRootPrivateKeyRootPrivateKey

Root private key.

TEST_NETWORK_PARAMS_PREPRODNetworkParams

Network parameters.

TEST_BLOCKFROSTBlockfrostV0

Blockfrost client instance.

Returns:

Transaction hash in hex.

Type: 
Promise.<string>

textToHex(text) → {string}

Convert UTF-8 text to hex.

Parameters:
NameTypeDescription
textstring

Input text.

Returns:

Hex string.

Type: 
string

(async) tokenFound(tokenMph) → {Promise.<boolean>}

Check if a token with given MPH exists in walletData.utxos.

Parameters:
NameTypeDescription
tokenMphstring

Minting policy hash (hex).

Returns:

True if token found.

Type: 
Promise.<boolean>

txCreateOutput(tx, changeAddress, dataList) → {Tx}

Create multiple outputs by summing token Values and emitting them to changeAddress.

Parameters:
NameTypeDescription
txTx
changeAddressany
dataListArray.<TokenOutputItem>
Returns:
Type: 
Tx

txCreateOutput_2(tx, arList1, arList2, VersionNo, refAssets, scriptAddress, minLovelace) → {Tx}

Create a single CIP-68 datumed output with ref assets and minimum lovelace.

Parameters:
NameTypeDescription
txTx
arList1Array.<string>

Keys for main MapData.

arList2Array.<string>

Keys for extra MapData.

VersionNobigint | number | string

Version integer.

refAssetsAssets

Reference token assets (e.g., CIP-68 label=100).

scriptAddressany

Script address object.

minLovelacebigint | number

Min ADA for output.

Returns:
Type: 
Tx

(async) txDeadLine(tx, deadLineMinutes) → {Promise.<Tx>}

Set transaction validity window (now → now+minutes).

Parameters:
NameTypeDescription
txTx

Transaction.

deadLineMinutesnumber

Minutes to add.

Returns:

Same tx with validity set.

Type: 
Promise.<Tx>

(async) txEnd(tx) → {Promise.<string>}

Finalize, sign, and submit a transaction using global walletData/hlib/txPrerequisites.

Parameters:
NameTypeDescription
txTx

Transaction instance.

Returns:

Submitted tx hash (hex).

Type: 
Promise.<string>

(async) txIn(tx, utxo, token, redeemer, mph, script, deadline, partyAddress, signersPKHList, signaturesList, networkParams) → {Promise.<Tx>}

Compose standard ref input + input + script + mint + signers + finalize flow.

Parameters:
NameTypeDescription
txTx
utxoany

UTXO to reference/consume.

tokenany

Mint/burn token tuple(s).

redeemerany

Redeemer data.

mphstring

Policy hash.

scriptany

Compiled script.

deadlineboolean

Whether to add validity window.

partyAddressAddress

Change/party address.

signersPKHListArray.<string>

Signers PKHs.

signaturesListArray.<any>

Signatures to add.

networkParamsany

Network params.

Returns:

Finalized tx.

Type: 
Promise.<Tx>

(async) txInputFromBlockfrost(scriptAddressPkh) → {Promise.<(any|null)>}

Fetch a single UTXO input from Blockfrost for a given script address.

Parameters:
NameTypeDescription
scriptAddressPkhstring

Script address PKH.

Returns:

A UTXO object or null if not found.

Type: 
Promise.<(any|null)>

txOutput(tx, scriptAddressHash, amount, datum, tokenName, qty) → {Tx}

Helper to add a datumed output containing ADA + a single token.

Parameters:
NameTypeDescription
txTx

Transaction to mutate.

scriptAddressHashany

Address (script) receiving.

amountbigint | number

Lovelace amount.

datumany

Datum to inline.

tokenNamestring

Human token name (string).

qtybigint | number

Quantity of token.

Returns:
Type: 
Tx

txSigners(tx, pkhList) → {Tx}

Add multiple signer PKHs to a tx.

Parameters:
NameTypeDescription
txTx
pkhListArray.<any>

List of PKH objects.

Returns:
Type: 
Tx

txValidTimeRange(tx, noHrsFromNow) → {Tx}

Set tx validity window from now-5min to +N hours (robust ordering).

Parameters:
NameTypeDescription
txTx
noHrsFromNownumber

Hours ahead for validTo.

Returns:
Type: 
Tx

(async) unLock(vesting, secretMessageopt) → {Promise.<void>}

Unlock funds from a vesting contract.

Parameters:
NameTypeAttributesDefaultDescription
vestingstring

Helios script source.

secretMessagestring<optional>
"secret"

Secret parameter.

Returns:
Type: 
Promise.<void>

(async) updateAssetsSale(buyselltokens, price, qty) → {Promise.<string>}

Update an existing sale with new unit price and/or quantity.

Reads the current datum at the script, writes a new inline datum with updated price/qty, and re-locks the same value back at the script.

Parameters:
NameTypeDescription
buyselltokensstring

Helios source for the buy/sell validator.

pricebigint | number

New unit price (lovelace).

qtybigint | number

New quantity available.

Returns:

Submitted transaction hash.

Type: 
Promise.<string>

(async) updateNFT(scriptForLockingNFT, scriptForMintingNFT, data) → {Promise.<string>}

Update an existing NFT's on-chain metadata by consuming the locked UTXO with a burn/unlock-style redeemer, then re-output with new metadata.

Parameters:
NameTypeDescription
scriptForLockingNFTstring

Helios source (validator) that locked the NFT.

scriptForMintingNFTstring

Helios source (minting policy) of the NFT.

dataobject

Update payload with fields used in metadata + controls:

Properties
NameTypeAttributesDescription
mphHexstring

Minting policy hash (hex) of the NFT (original).

tokenNameHexstring

Token name (hex) to target.

quantitybigint | number

Quantity to burn/handle.

deadlineDate | number<optional>

Optional validity upper bound (Date or ms).

Returns:

Submitted tx hash.

Type: 
Promise.<string>

utf8ToHex(str) → {string}

Convert UTF-8 string to hexadecimal.

Parameters:
NameTypeDescription
strstring

Input string.

Returns:

Hexadecimal representation.

Type: 
string

(async) utxoFromBech32(addressBech32) → {Promise.<Array.<any>>}

Get UTXOs from a bech32 address via Blockfrost.

Parameters:
NameTypeDescription
addressBech32string

Address in bech32 format.

Returns:

Array of UTXOs.

Type: 
Promise.<Array.<any>>

(async) walletEssentials(selectedWallet, Cip30Wallet, WalletHelper, Value, utxoAmount, j) → {Promise.<({wallet:any, walletEnabled:boolean, walletHelper:any, walletHandler:any, walletAPI:any, Array.<utxos:any>}|null)>}

Enable wallet, wrap with Cip30Wallet + WalletHelper, and pick UTXOs.

Parameters:
NameTypeDescription
selectedWalletstring

One of the wallet ids from init.

Cip30WalletCip30Wallet

CIP-30 wrapper.

WalletHelperWalletHelper

Helper for UTXO, addresses, etc.

ValueValue

Value class (Helios).

utxoAmountnumber | bigint

Minimum lovelace to cover.

jobject

Logger/test harness.

Returns:
Type: 
Promise.<({wallet:any, walletEnabled:boolean, walletHelper:any, walletHandler:any, walletAPI:any, Array.<utxos:any>}|null)>

Type Definitions

BytePair

Pair of bytes used in CIP-68 map entries.

Type:
  • Object
Properties
NameTypeDescription
kByteArrayData
vByteArrayData

CIP68AssetClass

CIP-68 "asset class" (token name bytes + quantity).

Type:
  • Object
Properties
NameTypeDescription
nameBytesUint8Array
qtybigint

KV

Generic key/value (string → any).

Type:
  • Object
Properties
NameTypeDescription
keystring
value*

TokenInfo

An item returned by token scanners.

Type:
  • Object
Properties
NameTypeDescription
policystring
tokenNamestring
tokenQuantitybigint

TokenOutputItem

One output item for txCreateOutput.

Type:
  • Object
Properties
NameTypeDescription
tokenTNstring
tokenQtybigint | number
mphHexstring
lovelacebigint | number

TxPrerequisites

Default prerequisites/configuration for transactions. Used to set fee limits, minimum ADA requirements, and network parameters.

Type:
  • Object
Properties
NameTypeDescription
maxTxFeebigint

Maximum transaction fee (in lovelace).

minChangeAmtbigint

Minimum amount allowed for change outputs (in lovelace).

networkParamsUrlstring

Path or URL to the network parameters JSON file.

minAdabigint

Minimum ADA required for a UTxO (in lovelace).

ntypenumber

Network type: 0 = testnet, 1 = mainnet.