# Wallet

# wallet_listEntropyFilesInStandardDir

Return all EntropyStore in the standard directory

  • Parameters: none

  • Returns:

    • Array[string] An list of absolute paths of EntropyStore
  • Example:

# wallet_listAllEntropyFiles

Return all EntropyStore managed by the wallet

  • Parameters: none

  • Returns:

    • Array[string] An list of absolute paths of EntropyStore
  • Example:

# wallet_extractMnemonic

Return mnemonics of specified EntropyStore

  • Parameters:

    • string : The absolute file path of the EntropyStore, or EntropyStore name if the file is in standard directory. Address 0 is used as standard EntropyStore name.
    • string : Wallet password
  • Returns:

    • string: Mnemonic phrase
  • Example:

# wallet_unlock

Unlock the specified EntropyStore

  • Parameters:

    • string : The absolute file path of the EntropyStore, or EntropyStore name if the file is in standard directory. Address 0 is used as standard EntropyStore name.
    • string : Wallet password
  • Returns:

    • null
  • Example:

# wallet_lock

Lock the specified EntropyStore

  • Parameters:

    • string : The absolute file path of the EntropyStore, or EntropyStore name if the file is in standard directory. Address 0 is used as standard EntropyStore name.
  • Returns:

    • null
  • Example:

# wallet_listEntropyStoreAddresses

Return a specified range of addresses in the EntropyStore

  • Parameters:

    • string : The absolute file path of the EntropyStore, or EntropyStore name if the file is in standard directory. Address 0 is used as standard EntropyStore name.
    • uint32: Start index, included
    • uint32: End index, excluded
  • Returns:

    • Array[string]: An list of account addresses
  • Example:

# wallet_newMnemonicAndEntropyStore

Create new mnemonics and corresponding EntropyStore

  • Parameters:

    • string: Wallet password
  • Returns:

    • Object:
      • mnemonic : string : The newly created mnemonics
      • primaryAddr : string : Primary account address
      • filename : string: Absolute EntropyStore file path
  • Example:

# wallet_deriveByIndex

Generate sub address by index

  • Parameters:

    • string : The primary account address or the absolute file path of the EntropyStore
    • uint32: The index of sub address
  • Returns:

    • Object:
      • bip44Path : string : The BIP44 path of the address
      • address : string : Sub address
      • privateKey : []byte: Private key in base64 encoding
  • Example:

# wallet_deriveByFullPath

Generate sub address by BIP44 path. This method supports deriving sub address more flexibly.

  • Parameters:

    • string : The primary account address or the absolute file path of the EntropyStore
    • string: The BIP44 path of the address
  • Returns:

    • Object:
      • bip44Path : string : The BIP44 path of the address
      • address : string : Sub address
      • privateKey : []byte: Private key in base64 encoding
  • Example:

# wallet_recoverEntropyStoreFromMnemonic

Recover EntropyStore from mnemonics

  • Parameters:

    • string : Mnemonics
    • string: New wallet password
  • Returns:

  • Object:

    • mnemonic : string : Mnemonics
    • primaryAddr : string : Primary account address
    • filename : string: Absolute EntropyStore file path
  • Example:

# wallet_globalCheckAddrUnlocked

Check if the specified address is unlocked

  • Parameters: string : address Account address

  • Returns: bool Whether the address is unlocked. true means unlocked

  • Example:

# wallet_isAddrUnlocked

Check if the specified address in the EntropyStore is unlocked. The specific EntropyStore must be unlocked in advance before calling this method.

  • Parameters:

    • string : The primary account address or the absolute file path of the EntropyStore
    • string:address: Account address
  • Returns: bool Whether the address is unlocked. true means unlocked

  • Example:

# wallet_isUnlocked

Check if the specified EntropyStore is unlocked.

  • Parameters: string: The primary account address or the absolute file path of the EntropyStore

  • Returns: bool Whether the address is unlocked. true means unlocked

  • Example:

# wallet_findAddr

Return the index of specified address in the EntropyStore. The specific EntropyStore must be unlocked in advance before calling this method.

  • Parameters:

    • string: The primary account address or the absolute file path of the EntropyStore
    • string:address: Account address
  • Returns:

    • Object
      • entropyStoreFile : string : Absolute EntropyStore file path
      • index : uint32: Index of the address in the EntropyStore
  • Example:

# wallet_globalFindAddr

Return the index of specified address

  • Parameters:

    • string:address: Account address
  • Returns:

    • Object
      • entropyStoreFile : string : Absolute EntropyStore file path
      • index : uint32: Index of the address in the EntropyStore
  • Example:

# wallet_createTxWithPassphrase

Send a transaction

  • Parameters:

    • Object:
      • entropystoreFile : string : The primary account address or the absolute file path of the EntropyStore, optional
      • selfAddr : string address : The account address from which the transaction is sent, required
      • toAddr : string address : The account address to which the transaction is sent, required
      • tokenTypeId : string tokentypeid : Token ID, required
      • passphrase : string : Wallet password, 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 EntropyStore from non-standard directory.

  • Parameters:

    • string: The primary account address or the absolute file path of the EntropyStore
  • Returns: none