# Wallet

# wallet_getEntropyFilesInStandardDir

Return all entropy files in standard directory

  • Parameters: none

  • Returns:

    • Array[string] Absolute paths of entropy files
  • Example:

# wallet_getAllEntropyFiles

Return all entropy files maintained in wallet

  • Parameters: none

  • Returns:

    • Array[string] Absolute paths of entropy files
  • Example:

# wallet_exportMnemonic

Return mnemonic phrase of the given entropy file

  • Parameters:

    • string : Absolute path of entropy file, or file name (address at index 0) if it is under standard directory.
    • string : Passphrase
  • Returns:

    • string: Mnemonics
  • Example:

# wallet_unlock

Unlock entropy file

  • Parameters:

    • string : Absolute path of entropy file, or file name (address at index 0) if it is under standard directory.
    • string : Passphrase
  • Returns:

    • null
  • Example:

# wallet_lock

Lock entropy file

  • Parameters:

    • string : Absolute path of entropy file, or file name (address at index 0) if it is under standard directory.
  • Returns:

    • null
  • Example:

# wallet_deriveAddressesByIndexRange

Return a list of addresses in the given entropy file

  • Parameters:

    • string : Absolute path of entropy file, or file name (address at index 0) if it is under standard directory.
    • uint32: Start index, included
    • uint32: End index, excluded
  • Returns:

    • Array[string]: Addresses
  • Example:

# wallet_createEntropyFile

Create new entropy file

  • Parameters:

    • string: Passphrase
  • Returns:

    • Object:
      • mnemonics : string : Mnemonic phrase
      • firstAddress : string : Address at index 0
      • filePath : string: Absolute path of entropy file
  • Example:

# wallet_deriveAddressByIndex

Derive address by index

  • Parameters:

    • string : Absolute path of entropy file, or file name (address at index 0) if it is under standard directory.
    • uint32: Index
  • Returns:

    • Object:
      • bip44Path : string : BIP44 path of the address
      • address : string : Address
      • privateKey : []byte: Private key in base64 format
  • Example:

# wallet_deriveAddressByPath

Derive address by bip44 path

  • Parameters:

    • string : Absolute path of entropy file, or file name (address at index 0) if it is under standard directory
    • string: BIP44 path
  • Returns:

    • Object:
      • bip44Path : string : BIP44 path of the address
      • address : string : Address
      • privateKey : []byte: Private key in base64 format
  • Example:

# wallet_recoverEntropyFile

Recover entropy file from mnemonic phrase

  • Parameters:

    • string : Mnemonic phrase
    • string: New passphrase
  • Returns:

  • Object:

    • mnemonics : string : Mnemonic phrase
    • firstAddr : string : Address at index 0
    • filePath : string: Absolute path of entropy file
  • Example:

# wallet_isUnlocked

Verify if the entropy file is unlocked

  • Parameters: string: Absolute path of entropy file, or file name (address at index 0) if it is under standard directory

  • Returns: bool If true, the entropy file is unlocked

  • Example:

# wallet_findAddr

Return the index of specified address in entropy file. The entropy file must be unlocked when calling this method

  • Parameters:

    • string: Absolute path of entropy file, or file name (address at index 0) if it is under standard directory
    • string:address: Address
  • Returns:

    • Object
      • entropyStoreFile : string : Absolute path of entropy file
      • index : uint32: Index of address
  • Example:

# wallet_globalFindAddr

Return the index of specified address

  • Parameters:

    • string:address: Address
  • Returns:

    • Object
      • entropyStoreFile : string : Absolute path of entropy file
      • index : uint32: Index of address
  • Example:

# wallet_createTxWithPassphrase

Send transaction

  • Parameters:

    • Object:
      • entropystoreFile : string : Absolute path of entropy file, or file name (address at index 0) if it is under standard directory, optional
      • selfAddr : string address : Address of current account, required
      • toAddr : string address : Address of transaction's recipient, required
      • tokenTypeId : string tokentypeid : Token id, required
      • passphrase : string : Password of entropy file, required
      • amount : string bigint : Transfer amount, required
      • data : string base64 : Additional data carried by the transaction, optional
      • difficulty : string bigint : PoW difficulty, optional
  • Returns: none

:::

# wallet_addEntropyStore

Add a new entropy file. This method can be used to add an entropy file in non-standard directory.

  • Parameters:

    • string: Absolute path of entropy file, or file name (address at index 0) if it is under standard directory, optional
  • Returns: none