Skip to content

v1.0

Compare
Choose a tag to compare
@ipapandinas ipapandinas released this 13 May 16:33
· 658 commits to main since this release

v1.0

ternoa-js SDK is the easiest way to build on top of Ternoa chain.
Releases will be punctuated by the mainnet roadmap.

Support for Ternoa current Alphanet and Mainnet version 1.0.
On future upgrades, take care of looking at the CHANGELOG.

Here are the first features of phase 1:

Functions

Account

  • generateSeed - Generate a new account
  • getKeyringFromSeed - Create a keyring from a seed

Balance

  • getBalance - Get the free balance of an account
  • checkBalanceForTransfer - Check if an account as enough funds to ensure a transfer
  • transfer -Transfer some liquid free balance to another account
  • transferAll -Transfer the entire transferable balance from the caller account
  • transferKeepAlive -Transfer some liquid free balance to another account with a check that the transfer will not kill the origin account

Blockchain

  • initializeApi - Initialize substrate api with selected or default wss endpoint
  • getApi - Get initialized substrate Api instance
  • isApiConnected -Check if the Api instance existed and if it is connected
  • getApiEndpoint -Provides the wss api endpoint
  • safeDisconnect - Disconnect safely from the underlying provider, halting all network traffic
  • query - Generic function to make a chain query
  • consts - Generic function to get a chain constant
  • isTransactionSuccess - Check if a transaction result is successful
  • checkTxAvailable - Check if the pallet module and the subsequent extrinsic method exist in the Api instance
  • createTxHex - Create a transaction in hex format
  • signTx - Sign a transaction
  • submitTx - Send a signed transaction on the blockchain
  • runTx - Create, sign and submit a transaction on blockchain
  • batchTx - Create a batch transaction of dispatch calls
  • batchTxHex - Create a batch transaction of dispatch calls in hex format
  • batchAllTx - Create a batchAll transaction of dispatch calls in hex format
  • batchAllTxHex - Create a batchAll transaction of dispatch calls in hex format
  • isValidAddress - Check if an address is a valid Ternoa address
  • unFormatBalance - Format balance from number to BN

Fees

  • getTxGasFee - Get the gas fee estimation for a transaction
  • getTxTreasuryFee - Get the fee needed by Ternoa treasury for specific transaction services
  • getTxFees - Get the total fees for a transaction hex
  • checkFundsForTxFees - Check if a signed transaction sender has enough funds to pay transaction gas fees on transaction submit

Documentation

A detailed documentation was created here: ternoa-js documentation