From 0f69f942b98f462ce766c2ec9da4e8a6b94a0e66 Mon Sep 17 00:00:00 2001 From: Victor SALOMON Date: Fri, 13 May 2022 18:26:33 +0200 Subject: [PATCH] 1.0.0 --- docs/modules.html | 66 +++++++++++++++++++++++------------------------ package-lock.json | 4 +-- package.json | 2 +- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/docs/modules.html b/docs/modules.html index 86c78d4ad..3978ff26c 100644 --- a/docs/modules.html +++ b/docs/modules.html @@ -1,41 +1,41 @@ -ternoa-js
Options
All
  • Public
  • Public/Protected
  • All
Menu

ternoa-js

Index

Functions

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

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>

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

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

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

    consts

    summary

    Generic function to get a chain constant.

    example

    @@ -46,7 +46,7 @@
  • constantName: string

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

  • Returns Promise<Codec>

    The constant value

    -
    • createTxHex(txPallet: string, txExtrinsic: string, txArgs?: any[]): Promise<`0x${string}`>
    • 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

        @@ -55,70 +55,70 @@
      • txArgs: any[] = []

        Arguments of the transaction

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

      Hex value of the transaction

      -
    • generateSeed(): Promise<{ address: string; seed: string }>
    • 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>
    • 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>
    • getApiEndpoint(): Promise<string>
    • name

      getApiEndpoint

      summary

      Provides the wss api endpoint

      Returns Promise<string>

      String, the api endpoint connected with.

      -
    • getBalance(address: string): Promise<BN>
    • getBalance(address: string): Promise<BN>
    • name

      getBalance

      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

      -
    • getCapsuleMintFee(): Promise<BN>
    • getCapsuleMintFee(): Promise<BN>
    • name

      getCapsuleMintFee

      summary

      Get the amount of caps needed to mint a capsule.

      Returns Promise<BN>

      Capsule mint fee

      -
    • getKeyringFromSeed(seed: string): Promise<KeyringPair>
    • 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>
    • getMarketplaceMintFee(): Promise<BN>
    • name

      getMarketplaceMintFee

      summary

      Get the amount of caps needed to mint a marketplace.

      Returns Promise<BN>

      Marketplace mint fee

      -
    • getNftMintFee(): Promise<BN>
    • getNftMintFee(): Promise<BN>
    • name

      getNftMintFee

      summary

      Get the amount of caps needed to mint an NFT.

      Returns Promise<BN>

      NFT mint fee

      -
    • getTxFees(txHex: `0x${string}`, address: string): Promise<BN>
    • 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>
    • 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>
    • 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>
    • initializeApi(chain?: string): Promise<void>
    • name

      initializeApi

      summary

      Initialize substrate api with selected or default wss endpoint.

      description

      The default chainEndpoint is "wss://staging.chaos.ternoa.com"

      Parameters

      • chain: string = chainEndpoint

        Chain endpoint

        -

      Returns Promise<void>

    • isApiConnected(): boolean

    Returns Promise<void>

    Returns Promise<Codec>

    Result of the query storage call

    -