Members
(constant) assetClassification :Object.<string, string>
Token classification mapping.
- Object.<string, string>
- Source
(constant) txPrerequisites :TxPrerequisites
- Source
Methods
(async) addTxOutPuts(tx, addresses, datums, j) → {Promise.<Tx>}
Add multiple outputs to a tx.
Name | Type | Description |
---|---|---|
tx | Tx | Transaction. |
addresses | Array.<Address> | Output addresses. |
datums | Array.<any> | Corresponding Values/TxOutputs payloads. |
j | object | Logger. |
- Source
The tx.
- Type:
- Promise.<Tx>
(async) addressFunc(walletDataopt) → {Promise.<string>}
Return bech32 address from provided (or global) walletData.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
walletData | object | <optional> | walletData | Wallet data. |
- Source
Bech32 address.
- Type:
- Promise.<string>
(async) apiGetAssetFromPolicy(policy) → {Promise.<any>}
Fetch assets from a policy (backend PHP).
Name | Type | Description |
---|---|---|
policy | string | Policy id. |
- Source
- Type:
- Promise.<any>
(async) apiListAddressFromSpecificPolicy(policyHexTokenName) → {Promise.<any>}
Fetch addresses holding a specific token policy.
Name | Type | Description |
---|---|---|
policyHexTokenName | string | Policy identifier. |
- Source
- Type:
- Promise.<any>
(async) apiListTransactionsFromPolicyHexTokenName(policyHexTokenName) → {Promise.<any>}
Fetch transactions for a token by policyHexTokenName.
Name | Type | Description |
---|---|---|
policyHexTokenName | string | Policy + token hex name. |
- Source
- Type:
- Promise.<any>
(async) apiTokenFromAsset(mphHexAssetName) → {Promise.<any>}
Fetch token info by mphHexAssetName.
Name | Type | Description |
---|---|---|
mphHexAssetName | string | Asset name with MPH. |
- Source
- Type:
- Promise.<any>
(async) assetFunc(utxos) → {Promise.<Array.<{mph: string, tokenName: string, qty: number}>>}
Parse and extract asset metadata from UTXOs.
Name | Type | Description |
---|---|---|
utxos | Array | UTXO array. |
- Source
- 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.
- Source
- 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.
- Source
PKH hex.
- Type:
- Promise.<string>
bech32ToPkh(addressBech32) → {PubKeyHash|string}
Convert a bech32 address into PKH.
Name | Type | Description |
---|---|---|
addressBech32 | string | Bech32 address string. |
- Source
PKH or error message.
- Type:
- PubKeyHash |
string
bech32ToValidatorHash(addressBech32) → {any|string}
Convert a bech32 address to its validator hash.
Name | Type | Description |
---|---|---|
addressBech32 | string | Bech32 address (script address). |
- Source
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.
Name | Type | Description |
---|---|---|
buyselltokens | string | Helios source for the buy/sell validator. |
qty | bigint | | Desired quantity to buy. |
- Source
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.
Name | Type | Description |
---|---|---|
buyselltokens | string | Helios source for the buy/sell validator. |
- Source
Submitted transaction hash.
- Type:
- Promise.<string>
compileScript(scriptName) → {any}
Compile a Helios script source immediately (optimize=true).
Name | Type | Description |
---|---|---|
scriptName | string | Helios source code of the script. |
- Source
Compiled program.
- Type:
- any
(async) convertBech32ToPkh(addressBech32) → {Promise.<any>}
Convert a Bech32 address to its public key hash (PKH).
Name | Type | Description |
---|---|---|
addressBech32 | string | Cardano address (bech32 format). |
- Source
PKH object.
- Type:
- Promise.<any>
createAsset(mphHex, tokenNameHex, qty) → {Assets}
Create an Assets map with a single (mph, tokenNameHex, qty) component.
Name | Type | Description |
---|---|---|
mphHex | string | |
tokenNameHex | string | |
qty | bigint | |
- Source
- Type:
- Assets
createAssetClass(mphHex, tokenNameHex) → {AssetClass}
Create an AssetClass from mph + tokenNameHex.
Name | Type | Description |
---|---|---|
mphHex | string | |
tokenNameHex | string |
- Source
- Type:
- AssetClass
createCIP68Token(tnNameString, intLabel) → {string}
Create a token name (hex) for known CIP-68 labels.
Name | Type | Description |
---|---|---|
tnNameString | string | Human-readable name. |
intLabel | number | One of 100/222/333/444/555/666. |
- Source
Token name hex or error text.
- Type:
- string
createFiveWalletAddresses(mnemonic) → {Array.<Object>}
Create 5 derived wallet addresses from mnemonic.
Name | Type | Description |
---|---|---|
mnemonic | Array.<string> | BIP39 mnemonic words. |
- Source
Array of derived addresses and keys.
- Type:
- Array.<Object>
(async) createMnemonic(bitopt) → {Promise.<Array.<string>>}
Create a BIP39 mnemonic.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
bit | number | <optional> | 256 | Bit strength. |
- Source
Array of words.
- Type:
- Promise.<Array.<string>>
createOptionRadio(name, assetQty, mph, i) → {HTMLElement}
Create radio option DOM element for asset selection.
Name | Type | Description |
---|---|---|
name | string | Token name. |
assetQty | string | | Quantity. |
mph | string | Minting policy hash. |
i | number | Index for input name uniqueness. |
- Source
DOM container with radio input and label.
- Type:
- HTMLElement
(async) decryptMnemonic(passphrase, salt, iv, ct) → {Promise.<string>}
Decrypt mnemonic.
Name | Type | Description |
---|---|---|
passphrase | string | Passphrase. |
salt | string | Base64 salt. |
iv | string | Base64 IV. |
ct | string | Base64 ciphertext. |
- Source
Decrypted mnemonic or "error".
- Type:
- Promise.<string>
(async) displayValue() → {Promise.<any>}
Dump first UTXO set Value object.
- Source
Value structure.
- Type:
- Promise.<any>
el(id) → {HTMLElement|null}
Get DOM element by ID.
Name | Type | Description |
---|---|---|
id | string | Element ID. |
- Source
- Type:
- HTMLElement |
null
elen(elem) → {number}
Get length of trimmed value of an input element. Optional
Name | Type | Description |
---|---|---|
elem | HTMLInputElement | Input element. |
- Source
Trimmed value length.
- Type:
- number
(async) encryptMnemonic(passphrase, mnemonic) → {Promise.<Object>}
Encrypt mnemonic with passphrase (Argon2id + AES-GCM).
Name | Type | Description |
---|---|---|
passphrase | string | Passphrase. |
mnemonic | string | Mnemonic string. |
- Source
{ salt, iv, ct }
- Type:
- Promise.<Object>
genKeys(phraseopt) → {Object}
Generate keys from phrase.
Name | Type | Attributes | Description |
---|---|---|---|
phrase | string | <optional> | Mnemonic phrase. |
- Source
{ ownerPrivateKey, ownerPublicKeyHash, ownerAddress }
- Type:
- Object
generateMetadata(info) → {object}
Generate 721 metadata map for an NFT.
Name | Type | Description |
---|---|---|
info | object | NFT info object (policyId, assetName, desc, IPFS, etc.). |
- Source
Metadata structure.
- Type:
- object
(async) getAda() → {Promise.<string>}
Get ADA balance as string.
- Source
ADA balance.
- Type:
- Promise.<string>
(async) getAddr(address) → {Promise.<any>}
Query Koios API for an address.
Name | Type | Description |
---|---|---|
address | string | Address to query. |
- Source
- Type:
- Promise.<any>
(async) getAllTxInputs(scriptAddressPkh) → {Promise.<Array.<any>>}
Get all UTXOs for a given script address.
Name | Type | Description |
---|---|---|
scriptAddressPkh | string | Script address PKH. |
- Source
Array of UTXOs.
- Type:
- Promise.<Array.<any>>
(async) getAssetsFromValue(value)
Extract asset entries from a Value object.
Name | Type | Description |
---|---|---|
value | any | Value object with .assets, .lovelace. |
- Source
(async) getEncryptedData(url, data) → {Promise.<any>}
Get encrypted data from server.
Name | Type | Description |
---|---|---|
url | string | Target endpoint. |
data | Object | Data object. |
- Source
Response data.
- Type:
- Promise.<any>
(async) getKeyTokens() → {Promise.<void>}
Fetch key tokens from backend.
- Source
- Type:
- Promise.<void>
(async) getKeyUtxo(address) → {Promise.<any>}
Get vesting key UTXO via PHP API.
Name | Type | Description |
---|---|---|
address | string | Address to query. |
- Source
UTXO data.
- Type:
- Promise.<any>
(async) getLovelace() → {Promise.<string>}
Get lovelace balance as string.
- Source
Lovelace balance.
- Type:
- Promise.<string>
(async) getNetworkParams(ntypeopt) → {Promise.<object>}
Load network parameters JSON depending on txPrerequisites.ntype.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
ntype | number | <optional> | 0 | 0=preprod, 1=preview, 2=mainnet. |
- Source
Network params JSON.
- Type:
- Promise.<object>
(async) getTicketMetadataCIP25(asset, blockfrostapi) → {Promise.<Ticket>}
Get on-chain ticket metadata (CIP-25).
Name | Type | Description |
---|---|---|
asset | string | Asset id. |
blockfrostapi | string | Blockfrost API key. |
- Source
Ticket info object.
- Type:
- Promise.<Ticket>
(async) getTicketMetadataCIP68(asset, apiKey) → {Promise.<PrintTicketInfo>}
Get on-chain ticket metadata (CIP-68).
Name | Type | Description |
---|---|---|
asset | string | Asset id. |
apiKey | string | Blockfrost API key. |
- Source
Parsed ticket info.
- Type:
- Promise.<PrintTicketInfo>
(async) getTokenUtxoFromProgramInstance(programInstance, tokenMPH) → {Promise.<(any|null)>}
Get UTXO from compiled program instance containing given token MPH.
Name | Type | Description |
---|---|---|
programInstance | any | Helios program instance. |
tokenMPH | string | Minting policy hash. |
- Source
UTXO or null.
- Type:
- Promise.<(any|null)>
(async) getUtxoMphTokenNameHex(scriptAddressPkh, mph, tokenNameHex) → {Promise.<(any|null)>}
Similar to getUtxoMphTokenNameHexFromBech32Addr, but queries by PKH.
Name | Type | Description |
---|---|---|
scriptAddressPkh | string | Script address PKH. |
mph | string | Minting policy hash. |
tokenNameHex | string | Token name hex. |
- Source
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.
Name | Type | Description |
---|---|---|
scriptAddressBech32 | string | Bech32 script address. |
mph | string | Minting policy hash (hex). |
tokenNameHex | string | Token name (hex). |
- Source
UTXO object or null.
- Type:
- Promise.<(any|null)>
hexToByteArray()
Hex → ByteArrayData wrapper.
- Source
hexToTex(hexx) → {string}
Convert a hex string to plain text (UTF-16 code units).
Name | Type | Description |
---|---|---|
hexx | string | | Hex string (without |
- Source
Decoded text.
- Type:
- string
hexToText(str1) → {string}
Convert hex string to UTF-16 text.
Name | Type | Description |
---|---|---|
str1 | string | Hex string. |
- Source
Decoded text.
- Type:
- string
id(length) → {string}
Generate a random alphanumeric id.
Name | Type | Description |
---|---|---|
length | number |
- Source
- 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.
Name | Type | Description |
---|---|---|
j | object | Logger/test harness. |
- Source
- Type:
- Promise.<("nami"|"eternl"|"lace"|"flint"|"nufi"|"yoroi"|null)>
isStrongPassword(password) → {boolean}
Check if password is strong.
Name | Type | Description |
---|---|---|
password | string | Password string. |
- Source
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
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
title | string | Alert title. | ||
message | string | Alert message. | ||
icon | string | <optional> | "error" | Alert icon type. |
timer | number | <optional> | 6000 | Display duration in milliseconds. |
- Source
- Type:
- void
keyValueList(arList, arListv) → {Array.<BytePair>}
Convert parallel key/value arrays to CIP-68 MapData list: [[keyBytes, valBytes], ...]
Name | Type | Description |
---|---|---|
arList | Array.<string> | Keys. |
arListv | Array.<string> | Values. |
- Source
- Type:
- Array.<BytePair>
(async) lock(vesting, amountopt, secretMessageopt) → {Promise.<void>}
Lock funds in a vesting contract.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
vesting | string | Helios script source. | ||
amount | number | <optional> | 10000000 | Amount in lovelace. |
secretMessage | string | <optional> | "secret" | Secret parameter. |
- Source
- Type:
- Promise.<void>
(async) mint(ticket, data) → {Promise.<(void|string)>}
Mint new tokens on the Cardano blockchain.
Name | Type | Description |
---|---|---|
ticket | string | Compiled smart contract source. |
data | Object | Minting metadata and user input. |
- Source
- Type:
- Promise.<(void|string)>
(async) mint(data) → {Promise.<void>}
Mint new asset(s) using a provided Helios script.
Name | Type | Description |
---|---|---|
data | object | Token data (assetName, title, desc, IPFS, etc.). |
- Source
- Type:
- Promise.<void>
(async) mintAssets()
Mint a new NFT (internal helper).
- Source
(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.
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
scriptForMintingNFT | string | Minting policy (Helios source). | |||||||||||||||||||||||||||||||||||||||
scriptForLockingNFT | string | Validator (Helios source). | |||||||||||||||||||||||||||||||||||||||
info | object | Payload used for parameters & metadata: Properties
|
- Source
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.
Name | Type | Description |
---|---|---|
mintPropertyUserSharesTokensScript | string | Helios source for minting script. |
info | Object | Information object (UTxO, quantity, token metadata). |
buySellTokenProperty | string | Helios program source for buy/sell. |
- Source
Transaction hash or "failed txh".
- Type:
- Promise.<string>
(async) mint_(tokenName, tokenDescription, tokenImageUrl) → {Promise.<void>}
Public NFT minting wrapper.
Name | Type | Description |
---|---|---|
tokenName | string | NFT name. |
tokenDescription | string | NFT description. |
tokenImageUrl | string | NFT image URL. |
- Source
- Type:
- Promise.<void>
mphBin(mphHex) → {MintingPolicyHash}
Convert mph hex string to MintingPolicyHash.
Name | Type | Description |
---|---|---|
mphHex | string |
- Source
- Type:
- MintingPolicyHash
(async) pkeys(PinCode, PrimaryEmail, PassPhrase) → {Promise.<{pk: object, pkh: object, addr: object}>}
Retrieve payment and staking keys using passphrase and PIN.
Name | Type | Description |
---|---|---|
PinCode | string | User PIN. |
PrimaryEmail | string | User email. |
PassPhrase | string | Mnemonic decryption password. |
- Source
- Type:
- Promise.<{pk: object, pkh: object, addr: object}>
(async) postEncryptedData(url, data) → {Promise.<string>}
Post encrypted data using XMLHttpRequest.
Name | Type | Description |
---|---|---|
url | string | Target endpoint. |
data | Object | Data object. |
- Source
Response text.
- Type:
- Promise.<string>
randString(length) → {string}
Generate random alphanumeric string.
Name | Type | Description |
---|---|---|
length | number | Length of the string. |
- Source
Random string.
- Type:
- string
random(bytesopt) → {string}
Generate a random hex string.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
bytes | number | <optional> | 16 | Number of bytes. |
- Source
Random hex string.
- Type:
- string
randomBytes(length) → {Uint8Array}
Generate cryptographically secure random bytes.
Name | Type | Description |
---|---|---|
length | number | Byte length. |
- Source
- Type:
- Uint8Array
refTokenAssetClassCIP68(createCIP68ReferenceTokenName, qtyopt) → {CIP68AssetClass}
Create a CIP-68 reference token asset-class tuple from hex token name.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
createCIP68ReferenceTokenName | string | token name hex (already labeled). | ||
qty | bigint | | <optional> | 1 | Quantity (or -1 if not 1). |
- Source
Asset-class object
- Type:
- CIP68AssetClass
refTokenCip68AssetFromMPHAssetClass(mph, assetClassCIP68-) → {Assets}
Build a CIP-68 Reference Token Assets object from pre-built assetClassCIP68.
Name | Type | Description |
---|---|---|
mph | string | Policy hash hex. |
assetClassCIP68- | CIP68AssetClass | [tokenNameBytes, qty]. |
- Source
- Type:
- Assets
refTokenCip68AssetFromMphTnName(mph, tnName, qtyopt) → {Assets}
Build a CIP-68 Reference Token (label=100) Assets object from MPH & tnName.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
mph | string | Policy hash hex. | ||
tnName | string | Human token name (string). | ||
qty | bigint | | <optional> | 1 | Quantity; if not 1, uses -1 (per your code). |
- Source
Helios Assets object.
- Type:
- Assets
save(key, valueopt) → {string|void}
Save and retrieve values from localStorage.
Name | Type | Attributes | Description |
---|---|---|---|
key | string | Storage key. | |
value | string | <optional> | Optional value to save. |
- Source
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.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
tokenHexName | string | Token name in hex format. | ||
mph | string | Minting Policy Hash. | ||
txId | string | Transaction ID. | ||
txIdx | number | Transaction index (UTxO). | ||
qty | bigint | Token quantity. | ||
ownPKH | string | Owner's public key hash. | ||
txh | string | Transaction hash. | ||
status | string | Token status (e.g., "open"). | ||
tokenName | string | Human-readable token name. | ||
uid | string | <nullable> | User ID (optional). | |
pid | string | <nullable> | Property ID (optional). | |
sharesTokenPrice | number | <nullable> | Token price (optional). | |
scriptAddressBech32 | string | <nullable> | Script address (bech32 format). | |
ownAddressBech32 | string | <nullable> | Owner’s address (bech32 format). | |
buyerAddressBech32 | string | <nullable> | Buyer’s address (bech32 format). | |
nftId | string | <nullable> | NFT identifier (optional). | |
phpFileName | string | <optional> | "./saveProgressTokens.php" | Target PHP file for saving. |
- Source
- Type:
- Promise.<void>
save_share_token_markets(…args) → {void}
Save token data into share token markets backend.
Name | Type | Attributes | Description |
---|---|---|---|
args | any | <repeatable> | Similar to |
- Source
- Type:
- void
scriptAddParams(script, arList) → {any}
Add (or override) parameters on a Helios Program from key/value pairs.
Name | Type | Description |
---|---|---|
script | any | Helios Program instance (not compiled). |
arList | Array.<KV> | Array of [key, value] tuples. |
- Source
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.
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
buyselltokens | string | Helios source for the buy/sell validator. | ||||||||||||
data | object | Sale info. Properties
|
- Source
Submitted transaction hash.
- Type:
- Promise.<string>
const txh = await sellAssets(buysellScriptSrc, {
nftUnitPriceLovelace: 5000000n,
nftQuantity: 3n,
saleNo: Date.now()
});
(async) sendADA(toAddress, amountToTransfer, pk) → {Promise.<string>}
Send ADA to another address.
Name | Type | Description |
---|---|---|
toAddress | string | Destination address in bech32. |
amountToTransfer | number | | Amount of ADA to send. |
pk | object | Payment signing key. |
- Source
Transaction hash or error.
- Type:
- Promise.<string>
(async) sendADA(toAddress, amountToTransfer) → {Promise.<void>}
Send ADA to a bech32 address.
Name | Type | Description |
---|---|---|
toAddress | string | Destination (bech32). |
amountToTransfer | number | | ADA amount (not lovelace). |
- Source
- Type:
- Promise.<void>
(async) sendAssets(data) → {Promise.<string>}
Send native assets to a recipient.
Name | Type | Description |
---|---|---|
data | Object | Transaction input/output details and metadata. |
- Source
Transaction hash or failure message.
- Type:
- Promise.<string>
(async) sendAssets(assetMPH, assetName, assetQty, toAddress) → {Promise.<void>}
Send a native asset/NFT to an address.
Name | Type | Description |
---|---|---|
assetMPH | string | Minting policy hash (hex). |
assetName | string | Asset name (UTF-8). |
assetQty | bigint | | Quantity. |
toAddress | string | Destination (bech32). |
- Source
- Type:
- Promise.<void>
(async) shortAddressFunc() → {Promise.<string>}
Get shortened base address of current wallet.
- Source
- Type:
- Promise.<string>
showPlutusCostModels(TEST_NETWORK_PARAMS_PREPROD) → {void}
Show Plutus cost model details from network parameters.
Name | Type | Description |
---|---|---|
TEST_NETWORK_PARAMS_PREPROD | NetworkParams | Network parameters instance. |
- Source
- Type:
- void
(async) showWalletData(walletData, utxoAmount, AssetClass, j) → {Promise.<(Array.<object>|null)>}
Collect wallet summary + detected assets from first UTXO set.
Name | Type | Description |
---|---|---|
walletData | object | Result of |
utxoAmount | number | | Minimum lovelace checked earlier. |
AssetClass | AssetClass | Asset fingerprint helper. |
j | object | Logger. |
- Source
Array where the first element is wallet info, followed by asset entries.
- Type:
- Promise.<(Array.<object>|null)>
strToBytes()
Alias of stringToByteArray.
- Source
strToHex(str) → {string}
Convert a string to hex.
Name | Type | Description |
---|---|---|
str | string |
- Source
Hex string.
- Type:
- string
stringToByteArray()
String → ByteArrayData wrapper.
- Source
(async) submitTx(walletData, tx) → {Promise.<string>}
Submit a transaction via walletAPI.
Name | Type | Description |
---|---|---|
walletData | object | Wallet data with walletAPI. |
tx | Tx | Transaction. |
- Source
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.
Name | Type | Description |
---|---|---|
address | string | Bech32 wallet address. |
TxInput | TxInput | Transaction input helper. |
addressPKH | any | Address public key hash. |
addressRootPrivateKey | RootPrivateKey | Root private key. |
TEST_NETWORK_PARAMS_PREPROD | NetworkParams | Network parameters. |
TEST_BLOCKFROST | BlockfrostV0 | Blockfrost client instance. |
- Source
Transaction hash in hex.
- Type:
- Promise.<string>
textToHex(text) → {string}
Convert UTF-8 text to hex.
Name | Type | Description |
---|---|---|
text | string | Input text. |
- Source
Hex string.
- Type:
- string
(async) tokenFound(tokenMph) → {Promise.<boolean>}
Check if a token with given MPH exists in walletData.utxos.
Name | Type | Description |
---|---|---|
tokenMph | string | Minting policy hash (hex). |
- Source
True if token found.
- Type:
- Promise.<boolean>
txCreateOutput(tx, changeAddress, dataList) → {Tx}
Create multiple outputs by summing token Values and emitting them to changeAddress.
Name | Type | Description |
---|---|---|
tx | Tx | |
changeAddress | any | |
dataList | Array.<TokenOutputItem> |
- Source
- 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.
Name | Type | Description |
---|---|---|
tx | Tx | |
arList1 | Array.<string> | Keys for main MapData. |
arList2 | Array.<string> | Keys for extra MapData. |
VersionNo | bigint | | Version integer. |
refAssets | Assets | Reference token assets (e.g., CIP-68 label=100). |
scriptAddress | any | Script address object. |
minLovelace | bigint | | Min ADA for output. |
- Source
- Type:
- Tx
(async) txDeadLine(tx, deadLineMinutes) → {Promise.<Tx>}
Set transaction validity window (now → now+minutes).
Name | Type | Description |
---|---|---|
tx | Tx | Transaction. |
deadLineMinutes | number | Minutes to add. |
- Source
Same tx with validity set.
- Type:
- Promise.<Tx>
(async) txEnd(tx) → {Promise.<string>}
Finalize, sign, and submit a transaction using global walletData/hlib/txPrerequisites.
Name | Type | Description |
---|---|---|
tx | Tx | Transaction instance. |
- Source
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.
Name | Type | Description |
---|---|---|
tx | Tx | |
utxo | any | UTXO to reference/consume. |
token | any | Mint/burn token tuple(s). |
redeemer | any | Redeemer data. |
mph | string | Policy hash. |
script | any | Compiled script. |
deadline | boolean | Whether to add validity window. |
partyAddress | Address | Change/party address. |
signersPKHList | Array.<string> | Signers PKHs. |
signaturesList | Array.<any> | Signatures to add. |
networkParams | any | Network params. |
- Source
Finalized tx.
- Type:
- Promise.<Tx>
(async) txInputFromBlockfrost(scriptAddressPkh) → {Promise.<(any|null)>}
Fetch a single UTXO input from Blockfrost for a given script address.
Name | Type | Description |
---|---|---|
scriptAddressPkh | string | Script address PKH. |
- Source
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.
Name | Type | Description |
---|---|---|
tx | Tx | Transaction to mutate. |
scriptAddressHash | any | Address (script) receiving. |
amount | bigint | | Lovelace amount. |
datum | any | Datum to inline. |
tokenName | string | Human token name (string). |
qty | bigint | | Quantity of token. |
- Source
- Type:
- Tx
txSigners(tx, pkhList) → {Tx}
Add multiple signer PKHs to a tx.
Name | Type | Description |
---|---|---|
tx | Tx | |
pkhList | Array.<any> | List of PKH objects. |
- Source
- Type:
- Tx
txValidTimeRange(tx, noHrsFromNow) → {Tx}
Set tx validity window from now-5min to +N hours (robust ordering).
Name | Type | Description |
---|---|---|
tx | Tx | |
noHrsFromNow | number | Hours ahead for validTo. |
- Source
- Type:
- Tx
(async) unLock(vesting, secretMessageopt) → {Promise.<void>}
Unlock funds from a vesting contract.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
vesting | string | Helios script source. | ||
secretMessage | string | <optional> | "secret" | Secret parameter. |
- Source
- 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.
Name | Type | Description |
---|---|---|
buyselltokens | string | Helios source for the buy/sell validator. |
price | bigint | | New unit price (lovelace). |
qty | bigint | | New quantity available. |
- Source
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.
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
scriptForLockingNFT | string | Helios source (validator) that locked the NFT. | ||||||||||||||||||||
scriptForMintingNFT | string | Helios source (minting policy) of the NFT. | ||||||||||||||||||||
data | object | Update payload with fields used in metadata + controls: Properties
|
- Source
Submitted tx hash.
- Type:
- Promise.<string>
utf8ToHex(str) → {string}
Convert UTF-8 string to hexadecimal.
Name | Type | Description |
---|---|---|
str | string | Input string. |
- Source
Hexadecimal representation.
- Type:
- string
(async) utxoFromBech32(addressBech32) → {Promise.<Array.<any>>}
Get UTXOs from a bech32 address via Blockfrost.
Name | Type | Description |
---|---|---|
addressBech32 | string | Address in bech32 format. |
- Source
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.
Name | Type | Description |
---|---|---|
selectedWallet | string | One of the wallet ids from |
Cip30Wallet | Cip30Wallet | CIP-30 wrapper. |
WalletHelper | WalletHelper | Helper for UTXO, addresses, etc. |
Value | Value | Value class (Helios). |
utxoAmount | number | | Minimum lovelace to cover. |
j | object | Logger/test harness. |
- Source
- 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.
- Object
Name | Type | Description |
---|---|---|
k | ByteArrayData | |
v | ByteArrayData |
- Source
CIP68AssetClass
CIP-68 "asset class" (token name bytes + quantity).
- Object
Name | Type | Description |
---|---|---|
nameBytes | Uint8Array | |
qty | bigint |
- Source
KV
Generic key/value (string → any).
- Object
Name | Type | Description |
---|---|---|
key | string | |
value | * |
- Source
TokenInfo
An item returned by token scanners.
- Object
Name | Type | Description |
---|---|---|
policy | string | |
tokenName | string | |
tokenQuantity | bigint |
- Source
TokenOutputItem
One output item for txCreateOutput.
- Object
Name | Type | Description |
---|---|---|
tokenTN | string | |
tokenQty | bigint | | |
mphHex | string | |
lovelace | bigint | |
- Source
TxPrerequisites
Default prerequisites/configuration for transactions. Used to set fee limits, minimum ADA requirements, and network parameters.
- Object
Name | Type | Description |
---|---|---|
maxTxFee | bigint | Maximum transaction fee (in lovelace). |
minChangeAmt | bigint | Minimum amount allowed for change outputs (in lovelace). |
networkParamsUrl | string | Path or URL to the network parameters JSON file. |
minAda | bigint | Minimum ADA required for a UTxO (in lovelace). |
ntype | number | Network type: |
- Source