Options
All
  • Public
  • Public/Protected
  • All
Menu

ternoa-js

Index

Functions

  • addNftToCollection(nftId: number, keyring: IKeyringPair, collectionId: number, callback?: (result: ISubmittableResult) => void): Promise<`0x${string}`>
  • name

    addNftToCollection

    summary

    Add an NFT to a collection.

    Parameters

    • nftId: number

      The NFT id

    • keyring: IKeyringPair

      Keyring pair to sign the data.

    • collectionId: number

      The collection id to which the NFT will belong

    • Optional callback: (result: ISubmittableResult) => void

      Callback function to enable subscription, if not given, no subscription will be made

        • (result: ISubmittableResult): void
        • Parameters

          • result: ISubmittableResult

          Returns void

    Returns Promise<`0x${string}`>

    Hash of the transaction, or an unsigned transaction to be signed if no keyring pair is passed

  • batchAllTx(txHexes: `0x${string}`[]): Promise<SubmittableExtrinsic<"promise", ISubmittableResult>>
  • name

    batchAllTx

    summary

    Create a batchAll transaction of dispatch calls.

    Parameters

    • txHexes: `0x${string}`[]

      Transactions to execute in the batch call

    Returns Promise<SubmittableExtrinsic<"promise", ISubmittableResult>>

    Submittable extrinsic unsigned

  • batchAllTxHex(txHexes: `0x${string}`[]): Promise<`0x${string}`>
  • name

    batchAllTxHex

    summary

    Create a batchAll transaction of dispatch calls in hex format.

    Parameters

    • txHexes: `0x${string}`[]

      Transactions to execute in the batch call

    Returns Promise<`0x${string}`>

    Hex of the submittable extrinsic unsigned

  • batchTx(txHexes: `0x${string}`[]): Promise<SubmittableExtrinsic<"promise", ISubmittableResult>>
  • name

    batchTx

    summary

    Create a batch transaction of dispatch calls.

    Parameters

    • txHexes: `0x${string}`[]

      Transactions to execute in the batch call

    Returns Promise<SubmittableExtrinsic<"promise", ISubmittableResult>>

    Submittable extrinsic unsigned

  • batchTxHex(txHexes: `0x${string}`[]): Promise<`0x${string}`>
  • name

    batchTxHex

    summary

    Create a batch transaction of dispatch calls in hex format.

    Parameters

    • txHexes: `0x${string}`[]

      Transactions to execute in the batch call

    Returns Promise<`0x${string}`>

    Hex of the submittable extrinsic unsigned

  • burnCollection(collectionId: number, keyring: IKeyringPair, callback?: (result: ISubmittableResult) => void): Promise<`0x${string}`>
  • name

    burnCollection

    summary

    Remove a collection from the storage.

    Parameters

    • collectionId: number

      The collection id to burn

    • keyring: IKeyringPair

      Keyring pair to sign the data. Must be the owner of the collection

    • Optional callback: (result: ISubmittableResult) => void

      Callback function to enable subscription, if not given, no subscription will be made

        • (result: ISubmittableResult): void
        • Parameters

          • result: ISubmittableResult

          Returns void

    Returns Promise<`0x${string}`>

    Hash of the transaction, or an unsigned transaction to be signed if no keyring pair is passed

  • burnNft(nftId: number, keyring: IKeyringPair, callback?: (result: ISubmittableResult) => void): Promise<`0x${string}`>
  • name

    burnNft

    summary

    Remove an NFT from the storage.

    Parameters

    • nftId: number

      The id of the NFT that need to be burned from the storage

    • keyring: IKeyringPair

      Keyring pair to sign the data

    • Optional callback: (result: ISubmittableResult) => void

      Callback function to enable subscription, if not given, no subscription will be made

        • (result: ISubmittableResult): void
        • Parameters

          • result: ISubmittableResult

          Returns void

    Returns Promise<`0x${string}`>

    Hash of the transaction, or an unsigned transaction to be signed if no keyring pair is passed

  • checkBalanceForTransfer(address: string, value: number | BN): Promise<void>
  • name

    checkBalanceForTransfer

    summary

    Check if an account as enough funds to ensure a transfer

    Parameters

    • address: string

      Public address of the account to check balance for transfer

    • value: number | BN

      Token amount to transfer

    Returns Promise<void>

  • checkBalanceToMintNft(address: string): Promise<void>
  • name

    checkBalanceToMintNft

    summary

    Checks if an account as enough funds to support the NFT mint fee.

    Parameters

    • address: string

      Public address of the account to check balance to mint an NFT

    Returns Promise<void>

  • checkCollectionOffchainDataLimit(offchainLength: number): Promise<void>
  • name

    checkCollectionOffchainDataLimit

    summary

    Checks if the collectionOffchain data length is lower than maxium authorized length.

    Parameters

    • offchainLength: number

      Offchain data length.

    Returns Promise<void>

  • checkFundsForTxFees(tx: SubmittableExtrinsic<"promise", ISubmittableResult>): Promise<void>
  • name

    checkFundsForTxFees

    summary

    Check if a signed transaction sender has enough funds to pay transaction gas fees on transaction submit.

    Parameters

    • tx: SubmittableExtrinsic<"promise", ISubmittableResult>

      Signed transaction object

    Returns Promise<void>

  • checkNftOffchainDataLimit(offchainLength: number): Promise<void>
  • name

    checkNftOffchainDataLimit

    summary

    Checks if the nftOffchain data length is lower than maxium authorized length.

    Parameters

    • offchainLength: number

      Offchain data length.

    Returns Promise<void>

  • checkTxAvailable(txPallet: string, txExtrinsic: string): Promise<boolean>
  • name

    checkTxAvailable

    summary

    Check if the pallet module and the subsequent extrinsic method exist in the Api instance.

    Parameters

    • txPallet: string

      Pallet module of the transaction

    • txExtrinsic: string

      Subsequent extrinsic method of the transaction

    Returns Promise<boolean>

    Boolean, true if the pallet module and the subsequent extrinsic method exist, throw an Error otherwise

  • closeCollection(collectionId: number, keyring: IKeyringPair, callback?: (result: ISubmittableResult) => void): Promise<`0x${string}`>
  • name

    closeCollection

    summary

    Makes the collection closed.

    Parameters

    • collectionId: number

      The collection id to close

    • keyring: IKeyringPair

      Keyring pair to sign the data. Must be the owner of the collection.

    • Optional callback: (result: ISubmittableResult) => void

      Callback function to enable subscription, if not given, no subscription will be made

        • (result: ISubmittableResult): void
        • Parameters

          • result: ISubmittableResult

          Returns void

    Returns Promise<`0x${string}`>

    Hash of the transaction, or an unsigned transaction to be signed if no keyring pair is passed

  • compareDatas(datas: any, attribute: string, value: any): Promise<void>
  • name

    compareDatas

    summary

    Compares the current value of a extrinsic attribute to the new one to avoid running a transaction if they are equal.

    Parameters

    • datas: any

      Current values to be compared

    • attribute: string

      Attribute of the element to compare (ex: nft.royalty, marketplace.commission_fee)

    • value: any

      New value to be compared to current datas

    Returns Promise<void>

  • consts(section: string, constantName: string): Promise<Codec>
  • name

    consts

    summary

    Generic function to get a chain constant.

    example

    console.log(api.consts.balances.existentialDeposit.toString())
    

    Parameters

    • section: string

      The section required to get the chain constant (eg. "balances")

    • constantName: string

      The constantName depending on the section (eg. "existentialDeposit")

    Returns Promise<Codec>

    The constant value

  • createCollection(offchainData: string, limit?: number, keyring?: IKeyringPair, callback?: (result: ISubmittableResult) => void): Promise<`0x${string}`>
  • name

    createCollection

    summary

    Create a new collection with the provided details.

    Parameters

    • offchainData: string

      Any offchain datas to add to the collection

    • Optional limit: number

      Number max of NFTs in collection

    • Optional keyring: IKeyringPair

      Keyring pair to sign the data.

    • Optional callback: (result: ISubmittableResult) => void

      Callback function to enable subscription, if not given, no subscription will be made

        • (result: ISubmittableResult): void
        • Parameters

          • result: ISubmittableResult

          Returns void

    Returns Promise<`0x${string}`>

    Hash of the transaction, or an unsigned transaction to be signed if no keyring pair is passed

  • createNft(creator: string, offchainData: string, royalty: number, collectionId?: number, isSoulbound?: boolean, keyring?: IKeyringPair, callback?: (result: ISubmittableResult) => void): Promise<`0x${string}`>
  • name

    createNft

    summary

    Create a new NFT on blockchain with the provided details.

    Parameters

    • creator: string

      Public address of the account to check balance to mint NFT

    • offchainData: string

      Any offchain datas to add to the NFT (ex: a link, ipfs datas, a text)

    • royalty: number

      Royalty can be set from 0% to 100%

    • Optional collectionId: number

      The collection id to which the NFT will belong

    • isSoulbound: boolean = false

      Boolean that lock transfert after creation

    • Optional keyring: IKeyringPair

      Keyring pair to sign the data

    • Optional callback: (result: ISubmittableResult) => void

      Callback function to enable subscription, if not given, no subscription will be made

        • (result: ISubmittableResult): void
        • Parameters

          • result: ISubmittableResult

          Returns void

    Returns Promise<`0x${string}`>

    Hash of the transaction, or an unsigned transaction to be signed if no keyring pair is passed

  • createTxHex(txPallet: string, txExtrinsic: string, txArgs?: any[]): Promise<`0x${string}`>
  • name

    createTxHex

    summary

    Create a transaction in hex format.

    Parameters

    • txPallet: string

      Pallet module of the transaction

    • txExtrinsic: string

      Subsequent extrinsic method of the transaction

    • txArgs: any[] = []

      Arguments of the transaction

    Returns Promise<`0x${string}`>

    Hex value of the transaction

  • delegateNft(nftId: number, keyring: IKeyringPair, recipient?: string, callback?: (result: ISubmittableResult) => void): Promise<`0x${string}`>
  • name

    delegateNft

    summary

    Delegate an NFT to a recipient (does not change ownership).

    Parameters

    • nftId: number

      The id of the NFT that need to be delegated

    • keyring: IKeyringPair

      Keyring pair to sign the data

    • Optional recipient: string

      Address to which the NFT will be delegated. If not specified NFT will be undelegated

    • Optional callback: (result: ISubmittableResult) => void

      Callback function to enable subscription, if not given, no subscription will be made

        • (result: ISubmittableResult): void
        • Parameters

          • result: ISubmittableResult

          Returns void

    Returns Promise<`0x${string}`>

    Hash of the transaction, or an unsigned transaction to be signed if no keyring pair is passed

  • formatRoyalty(royalty: number): Promise<number>
  • name

    formatRoyalty

    summary

    Checks that royalty is in range 0 to 100 and format to permill.

    Parameters

    • royalty: number

      Number in range from 0 to 100 with max 4 decimals

    Returns Promise<number>

    the royalty in permill format

  • generateSeed(): Promise<{ address: string; seed: string }>
  • name

    generateSeed

    summary

    Generate a new account

    Returns Promise<{ address: string; seed: string }>

    An object with the seed and the public address

  • getApi(): Promise<ApiPromise>
  • name

    getApi

    summary

    Get initialized substrate Api instance.

    Returns Promise<ApiPromise>

    Promise containing the actual Api instance, a wrapper around the RPC and interfaces of the chain.

  • getApiEndpoint(): Promise<string>
  • name

    getApiEndpoint

    summary

    Provides the wss api endpoint

    Returns Promise<string>

    String, the api endpoint connected with.

  • getBalances(address: string): Promise<{ feeFrozen: BN; free: BN; miscFrozen: BN; reserved: BN; total: BN }>
  • name

    getBalances

    summary

    Get the balances of an account including free, reserved, miscFrozen and feeFrozen balances as well as the total.

    Parameters

    • address: string

      Public address of the account to get balances

    Returns Promise<{ feeFrozen: BN; free: BN; miscFrozen: BN; reserved: BN; total: BN }>

    The balances of the account

  • getCapsuleMintFee(): Promise<BN>
  • name

    getCapsuleMintFee

    summary

    Get the amount of caps needed to mint a capsule.

    Returns Promise<BN>

    Capsule mint fee

  • getCollectionDatas(collectionId?: number): Promise<ICollectionDatas>
  • name

    getCollectionDatas

    summary

    Provides the datas related to a specific collection if an collection id is provided otherwise, get all collections datas. ex:{owner, creator, offchainData, limit, isClosed(...)}

    Parameters

    • Optional collectionId: number

      The collection id

    Returns Promise<ICollectionDatas>

    A JSON object with datas of a single or all collection(s)

  • getCollectionOffchainDataLimit(): Promise<number>
  • name

    getCollectionOffchainDataLimit

    summary

    Provides the maximum offchain data length.

    Returns Promise<number>

    Number.

  • getFreeBalance(address: string): Promise<BN>
  • name

    getFreeBalance

    summary

    Get the free balance of an account

    Parameters

    • address: string

      Public address of the account to get free balance for

    Returns Promise<BN>

    The free balance of the account

  • getKeyringFromSeed(seed: string): Promise<KeyringPair>
  • name

    getKeyringFromSeed

    summary

    Create a keyring from a seed

    Parameters

    • seed: string

    Returns Promise<KeyringPair>

    A keyring pair

  • getMarketplaceMintFee(): Promise<BN>
  • name

    getMarketplaceMintFee

    summary

    Get the amount of caps needed to mint a marketplace.

    Returns Promise<BN>

    Marketplace mint fee

  • getNextCollectionId(): Promise<BN>
  • name

    getNextCollectionId

    summary

    Get the next collection Id available.

    Returns Promise<BN>

    Number.

  • getNextNftId(): Promise<BN>
  • name

    getNextNftId

    summary

    Get the next Nft Id av available.

    Returns Promise<BN>

    Number.

  • getNftDatas(nftId?: number): Promise<INftDatas>
  • name

    getNftDatas

    summary

    Provides the NFT datas if an nftid is provided otherwise, get all NFTs datas.

    Parameters

    • Optional nftId: number

      The NFT id

    Returns Promise<INftDatas>

    A JSON object with the NFT datas or all NFTs datas. ex:{owner, creator, offchainData, (...)}

  • getNftMintFee(): Promise<BN>
  • name

    getNftMintFee

    summary

    Fee to mint an NFT (extra fee on top of the tx fees).

    Returns Promise<BN>

    NFT mint fee.

  • getNftOffchainDataLimit(): Promise<number>
  • name

    getNftOffchainDataLimit

    summary

    Provides the maximum offchain data length.

    Returns Promise<number>

    Number.

  • getTxFees(txHex: `0x${string}`, address: string): Promise<BN>
  • name

    getTxFees

    summary

    Get the total fees for a transaction hex.

    Parameters

    • txHex: `0x${string}`

      Hex of the transaction

    • address: string

      Public address of the sender

    Returns Promise<BN>

    Total estimated fee which is the sum of the chain gas fee and the treasury fee

  • getTxGasFee(txHex: `0x${string}`, address: string): Promise<Balance>
  • name

    getTxGasFee

    summary

    Get the gas fee estimation for a transaction.

    Parameters

    • txHex: `0x${string}`

      Transaction hex

    • address: string

      Public address of the sender

    Returns Promise<Balance>

    Transaction fee estimation

  • getTxTreasuryFee(txHex: `0x${string}`): Promise<BN>
  • name

    getTxTreasuryFee

    summary

    Get the fee needed by Ternoa treasury for specific transaction services.

    description

    Some Ternoa's services required additional fees on top of chain gas fees, for example: minting a marketplace, minting an NFT or creating a capsule.

    Parameters

    • txHex: `0x${string}`

      Transaction hex

    Returns Promise<BN>

    Fee estimation

  • initializeApi(chain?: string): Promise<void>
  • name

    initializeApi

    summary

    Initialize substrate api with selected or default wss endpoint.

    description

    The default chainEndpoint is "wss://alphanet.ternoa.com"

    Parameters

    • chain: string = chainEndpoint

      Chain endpoint

    Returns Promise<void>

  • isApiConnected(): boolean
  • name

    isApiConnected

    summary

    Check if the Api instance existed and if it is connected.

    Returns boolean

    Boolean, true if the underlying provider is connected, false otherwise

  • isTransactionSuccess(result: ISubmittableResult): { indexInterrupted?: number; success: boolean }
  • name

    isTransactionSuccess

    summary

    Check if a transaction result is successful.

    Parameters

    • result: ISubmittableResult

      Generic result passed as a parameter in a transaction callback

    Returns { indexInterrupted?: number; success: boolean }

    Object containing a boolean success field indicating if transaction is successful and a indexInterrupted field to indicate where the transaction stopped in case of a batch

    • Optional indexInterrupted?: number
    • success: boolean
  • isValidAddress(address: string): boolean
  • name

    isValidAddress

    summary

    Check if an address is a valid Ternoa address.

    Parameters

    • address: string

    Returns boolean

    Boolean, true if the address is valid, false otherwise

  • limitCollection(collectionId: number, setLimit: number, keyring?: IKeyringPair, callback?: (result: ISubmittableResult) => void): Promise<`0x${string}`>
  • name

    limitCollection

    summary

    Set the maximum number (limit) of nfts in the collection.

    Parameters

    • collectionId: number

      The collection id to close

    • setLimit: number

      Number max of NFTs in collection

    • Optional keyring: IKeyringPair

      Keyring pair to sign the data.

    • Optional callback: (result: ISubmittableResult) => void

      Callback function to enable subscription, if not given, no subscription will be made

        • (result: ISubmittableResult): void
        • Parameters

          • result: ISubmittableResult

          Returns void

    Returns Promise<`0x${string}`>

    Hash of the transaction, or an unsigned transaction to be signed if no keyring pair is passed

  • query(module: string, call: string, args?: any[], callback?: (result: any) => void): Promise<Codec>
  • name

    query

    summary

    Generic function to make a chain query.

    example

    // you can query without any args
    const data = await query('balances', 'totalIssuance');

    // or you can pass args parameters to the storage query
    const data = await query('system', 'account', ['5GesFQSwhmuMKAHcDrfm21Z5xrq6kW93C1ch2Xosq1rXx2Eh']);

    Parameters

    • module: string

      The section required to make the chain query (eg. "system")

    • call: string

      The call depending on the section (eg. "account")

    • args: any[] = []

      Array of args for the call

    • Optional callback: (result: any) => void

      Callback function to enable subscription, if not given, no subscription will be made

        • (result: any): void
        • Parameters

          • result: any

          Returns void

    Returns Promise<Codec>

    Result of the query storage call

  • runTx(txPallet: string, txExtrinsic: string, txArgs: any[], keyring?: IKeyringPair, callback?: (result: ISubmittableResult) => void): Promise<`0x${string}`>
  • name

    runTx

    summary

    Create, sign and submit a transaction on blockchain.

    Parameters

    • txPallet: string

      Pallet module of the transaction

    • txExtrinsic: string

      Subsequent extrinsic method of the transaction

    • txArgs: any[]

      Arguments of the transaction

    • Optional keyring: IKeyringPair

      Keyring pair to sign the data, if not given, an unsigned transaction to be signed will be returned

    • Optional callback: (result: ISubmittableResult) => void

      Callback function to enable subscription, if not given, no subscription will be made

        • (result: ISubmittableResult): void
        • Parameters

          • result: ISubmittableResult

          Returns void

    Returns Promise<`0x${string}`>

    Hash of the transaction, or an unsigned transaction to be signed if no keyring pair is passed

  • safeDisconnect(): Promise<void>
  • name

    safeDisconnect

    summary

    Disconnect safely from the underlying provider, halting all network traffic

    Returns Promise<void>

  • setNftMintFee(fee: number | BN, keyring?: IKeyringPair, callback?: (result: ISubmittableResult) => void): Promise<`0x${string}`>
  • name

    setNftMintFee

    summary

    Set the fee for minting an NFT.

    Parameters

    • fee: number | BN

      New fee to mint an NFT

    • Optional keyring: IKeyringPair

      Keyring pair to sign the data

    • Optional callback: (result: ISubmittableResult) => void

      Callback function to enable subscription, if not given, no subscription will be made

        • (result: ISubmittableResult): void
        • Parameters

          • result: ISubmittableResult

          Returns void

    Returns Promise<`0x${string}`>

    Hash of the transaction, or an unsigned transaction to be signed if no keyring pair is passed

  • setRoyalty(nftId: number, keyring: IKeyringPair, royaltyFee: number, callback?: (result: ISubmittableResult) => void): Promise<`0x${string}`>
  • name

    setRoyalty

    summary

    Set the royalty of an NFT.

    Parameters

    • nftId: number

      The id of the NFT that need to be burned from the storage

    • keyring: IKeyringPair

      Keyring pair to sign the data

    • royaltyFee: number

      Number in range from 0 to 100 with max 4 decimals

    • Optional callback: (result: ISubmittableResult) => void

      Callback function to enable subscription, if not given, no subscription will be made

        • (result: ISubmittableResult): void
        • Parameters

          • result: ISubmittableResult

          Returns void

    Returns Promise<`0x${string}`>

    Hash of the transaction, or an unsigned transaction to be signed if no keyring pair is passed

  • signTx(keyring: IKeyringPair, txHex: `0x${string}`): Promise<`0x${string}`>
  • name

    signTx

    summary

    Sign a transaction.

    Parameters

    • keyring: IKeyringPair

      Keyring pair to sign the data

    • txHex: `0x${string}`

      Tx hex of the unsigned transaction to be signed

    Returns Promise<`0x${string}`>

    Hex value of the signed transaction

  • submitTx(txHex: `0x${string}`, callback?: (result: ISubmittableResult) => void): Promise<`0x${string}`>
  • name

    submitTx

    summary

    Send a signed transaction on the blockchain.

    Parameters

    • txHex: `0x${string}`

      Transaction hex of the signed transaction to be submitted

    • Optional callback: (result: ISubmittableResult) => void

      Callback function to enable subscription, if not given, no subscription will be made

        • (result: ISubmittableResult): void
        • Parameters

          • result: ISubmittableResult

          Returns void

    Returns Promise<`0x${string}`>

    Hash of the transaction

  • transfer(from: string, to: string, value: number | BN, keyring?: IKeyringPair, callback?: (result: ISubmittableResult) => void): Promise<`0x${string}`>
  • name

    transfer

    summary

    Transfer some liquid free balance to another account

    Parameters

    • from: string

      Public address of the account to get balance for

    • to: string

      Public address of the account to transfer amount to

    • value: number | BN

      Token amount to transfer

    • Optional keyring: IKeyringPair

      Keyring pair to sign the data

    • Optional callback: (result: ISubmittableResult) => void

      Callback function to enable subscription, if not given, no subscription will be made

        • (result: ISubmittableResult): void
        • Parameters

          • result: ISubmittableResult

          Returns void

    Returns Promise<`0x${string}`>

    Hash of the transaction or the hex value of the signable tx

  • transferAll(to: string, keepAlive?: boolean, keyring?: IKeyringPair, callback?: (result: ISubmittableResult) => void): Promise<`0x${string}`>
  • name

    transferAll

    summary

    Transfer the entire transferable balance from the caller account

    Parameters

    • to: string

      Public address of the account to transfer amount to

    • keepAlive: boolean = true

      Ensure that the transfer does not kill the account, it retains the Existential Deposit

    • Optional keyring: IKeyringPair

      Keyring pair to sign the data

    • Optional callback: (result: ISubmittableResult) => void

      Callback function to enable subscription, if not given, no subscription will be made

        • (result: ISubmittableResult): void
        • Parameters

          • result: ISubmittableResult

          Returns void

    Returns Promise<`0x${string}`>

    Hash of the transaction or the hex value of the signable tx

  • transferKeepAlive(from: string, to: string, value: number | BN, keyring?: IKeyringPair, callback?: (result: ISubmittableResult) => void): Promise<`0x${string}`>
  • name

    transferKeepAlive

    summary

    Transfer some liquid free balance to another account with a check that the transfer will not kill the origin account

    Parameters

    • from: string

      Public address of the account to get balance for

    • to: string

      Public address of the account to transfer amount to

    • value: number | BN

      Token amount to transfer

    • Optional keyring: IKeyringPair

      Keyring pair to sign the data

    • Optional callback: (result: ISubmittableResult) => void

      Callback function to enable subscription, if not given, no subscription will be made

        • (result: ISubmittableResult): void
        • Parameters

          • result: ISubmittableResult

          Returns void

    Returns Promise<`0x${string}`>

    Hash of the transaction or the hex value of the signable tx

  • transferNft(nftId: number, keyring: IKeyringPair, recipient: string, callback?: (result: ISubmittableResult) => void): Promise<`0x${string}`>
  • name

    transferNft

    summary

    Transfer an NFT from an account to another one.

    Parameters

    • nftId: number

      The id of the NFT that need to be burned from the storage

    • keyring: IKeyringPair

      Keyring pair to sign the data

    • recipient: string

      Address that will received the use of the NFT

    • Optional callback: (result: ISubmittableResult) => void

      Callback function to enable subscription, if not given, no subscription will be made

        • (result: ISubmittableResult): void
        • Parameters

          • result: ISubmittableResult

          Returns void

    Returns Promise<`0x${string}`>

    Hash of the transaction, or an unsigned transaction to be signed if no keyring pair is passed

  • unFormatBalance(_input: number): Promise<BN>
  • name

    unFormatBalance

    summary

    Format balance from number to BN.

    Parameters

    • _input: number

      Number input

    Returns Promise<BN>

    BN output

Generated using TypeDoc