account module

Module Overview

The Account Module is the basic module that provides information about the various functions of the account.It mainly supports the functions of account generation, security and custody, and information acquisition. Other modules can use various functions of the account and obtain account information according to the interface provided by the account module. Users or other applications can be based on rpc. The interface makes the account more practical and personalized.The account is the basic module and the carrier of the user data.

Interface function

  • Account generation
  • Create an account, import an account
  • Account security and custody
  • Backup of account, setting account password, modifying account password, removing account
  • Acquisition of account information
  • Query individual account information, obtain multiple account information, obtain account address, check account balance, and query account alias
  • Other useful and personalized features to set account aliases, set account notes, verify account encryption, sign, verify account address format, verify account password is correct, etc.

Interface List

ac_removeAccount

Remove specified account/Remove specified account

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes
address string account address yes
password string account password yes

return value

Field Name Field Type Parameter Description
value boolean success

ac_getAccountList

Get all account collections and put them in the cache /query all account collections and put them in cache

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes

return value

Field Name Field Type Parameter Description
list list<object> Return to account collection
        address string Account Address
        alias string Alias
        pubkeyHex string Public Key
        encryptedPrikeyHex string Encrypted Private Key

ac_signDigest

Data digest signature / Data digest signature

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes
address string account address yes
password string account password yes
data string to be signed data yes

return value

Field Name Field Type Parameter Description
signature string Post-Signature Data

ac_getAccountByAddress

Get account information by address /get account info according to address

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes
address string account address yes

return value

Field Name Field Type Parameter Description
address string Account Address
alias string alias
pubkeyHex string Public Key
encryptedPrikeyHex string Encrypted Private Key

ac_signBlockDigest

Block data digest signature

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes
address string account address yes
password string account password yes
data string to be signed data yes

return value

Field Name Field Type Parameter Description
signature string Post-Signature Data

ac_setRemark

Set up a note for the account / Set remark for accounts

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes
address string account address yes
remark string Notes Yes

return value

Field Name Field Type Parameter Description
value boolean success

ac_importAccountByPriKey

Import account based on private key /Import accounts by private key

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes
password string set new password yes
priKey string Account Private Key Yes
overwrite boolean If the account already exists, overwrite Yes

return value

Field Name Field Type Parameter Description
address string Imported account address

ac_createOfflineAccount

Create an offline account, the account will not be saved to the database, and will return all information to the account / create an offline account, which is not saved to the database and will directly return all information to the account.

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes
count int The number of accounts that need to be created Yes
password string account password yes

return value

Field Name Field Type Parameter Description
list list<object> Offline Account Collection
        address string Account Address
        pubKey string Public Key
        priKey string Private Key
        encryptedPriKey string Encrypted Private Key
        extend string Other Information
        createTime long Create Time
        encrypted boolean Account Encryption
        remark string Account Notes

ac_createContractAccount

Create smart contract account /create smart contract account

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes

return value

Field Name Field Type Parameter Description
address string Smart Contract Address

ac_getEncryptedAddressList

Get a list of locally encrypted accounts

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes

return value

Field Name Field Type Parameter Description
list list<string> Return to account address collection

ac_getAddressList

Paging query account address list

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes
pageNumber int Page Number Yes
pageSize int Number of records per page Yes

return value

Field Name Field Type Parameter Description
Return value list<string> Returns a Page object, account collection

ac_getPriKeyByAddress

Inquire the account's private key according to the address by the account address and password

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes
address string account address yes
password string account password yes

return value

Field Name Field Type Parameter Description
priKey string Private Key
pubKey string public key

ac_getAllPriKey

Get all local account account private keys, you must ensure that all account passwords are consistent. If the passwords in the local accounts are inconsistent, the error message will be returned / Get the all local private keys. if the password in the local account is different, the error message will be Returned.

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes
password string account password yes

return value

Field Name Field Type Parameter Description
list list<string> Private Key Collection

ac_importAccountByKeystore

Import account/Import accounts by AccountKeyStore according to AccountKeyStore

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes
password string set new password yes
keyStore string keyStore string yes
overwrite boolean If the account already exists, overwrite Yes

return value

Field Name Field Type Parameter Description
address string Imported account address

ac_exportKeyStoreJson

Export AccountKeyStore string /export account KeyStore json

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes
address string account address yes
password string account password yes

return value

Field Name Field Type Parameter Description
keyStore string keyStore string

ac_exportAccountKeyStore

Account backup, export AccountKeyStore string /export account KeyStore

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes
address string account address yes
password string account password yes
filePath string backup address no

return value

Field Name Field Type Parameter Description
path string The address of the actual backup file

ac_updatePassword

Modify the account password by the original password

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes
address string account address yes
password string old password yes
newPassword string Account New Password Yes

return value

Field Name Field Type Parameter Description
value boolean Whether to set success

ac_updateOfflineAccountPassword

Offline account change password /Offer account change password

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes
address string account address yes
password string old password yes
newPassword string Account New Password Yes
priKey string Account Private Key Yes

return value

Field Name Field Type Parameter Description
encryptedPriKey string Returns the modified private key

ac_validationPassword

Verify that the account password is correct / Verify that the account password is correct

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes
address string account address yes
password string account password yes

return value

Field Name Field Type Parameter Description
value boolean Is the account password correct?

ac_verifySignData

Verify Data Signature / Verification Data Signature

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
pubKey string Account Public Key Yes
sig string Signature Yes
data string to be signed data yes

return value

Field Name Field Type Parameter Description
signature boolean Signature is correct

ac_createAccount

Create a specified number of accounts / create a specified number of accounts

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes
count int The number of accounts that need to be created Yes
password string account password yes

return value

Field Name Field Type Parameter Description
list list<string> Created account address collection

ac_getPubKey

According to the account address and password, query the account public key / Get the account's public key

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes
address string account address yes
password string account password yes

return value

Field Name Field Type Parameter Description
pubKey string public key

ac_getAliasByAddress

Get the alias based on the address /get the alias by address

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes
address string account address yes

return value

Field Name Field Type Parameter Description
alias string alias

ac_setAlias

Set the alias of account

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes
address string account address yes
password string account password yes
alias string alias yes

return value

Field Name Field Type Parameter Description
txHash string set alias transaction hash

ac_isAliasUsable

Check if the alias is available /check whether the account is usable

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes
alias string alias yes

return value

Field Name Field Type Parameter Description
value boolean Is the alias available?

ac_getAllAddressPrefix

Get the address prefix of all chains

scope:public

version:1.0

parameter list

No parameters

return value

Field Name Field Type Parameter Description
chainId integer chain id
addressPrefix string address prefix

ac_getAddressPrefixByChainId

Get the address prefix by chain id

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes

return value

Field Name Field Type Parameter Description
chainId integer chain id
addressPrefix string address prefix

ac_addAddressPrefix

Add an address prefix, the chain management module will call the interface

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
prefixList list Chain Address Prefix List Yes
        chainId integer chain id yes
        addressPrefix string address prefix yes

return value

Field Name Field Type Parameter Description
N/A void No specific return value, no error is successful

ac_transfer

Create a general transfer transaction / create transfer transaction

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes
inputs list Transaction payer data Yes
        address string Account Address Yes
        assetsChainId integer Asset Chain ID Yes
        assetsId integer Asset ID Yes
        amount biginteger Quantity Yes
        password string The password for the outgoing account (from), ignored when assembling the recipient (to) data No
        lockTime long unlock time, -1 is always locked, 0 is not locked (default) no
outputs list Transaction Recipient Data Yes
        address string Account Address Yes
        assetsChainId integer Asset Chain ID Yes
        assetsId integer Asset ID Yes
        amount biginteger Quantity Yes
        password string The password for the outgoing account (from), ignored when assembling the recipient (to) data No
        lockTime long unlock time, -1 is always locked, 0 is not locked (default) no
remark string Transaction Notes Yes

return value

Field Name Field Type Parameter Description
value string transaction hash

ac_createMultiSignTransfer

Create a multi-signal address transfer transaction /create multi sign transfer

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes
inputs list Transaction payer data Yes
        address string Account Address Yes
        assetsChainId integer Asset Chain ID Yes
        assetsId integer Asset ID Yes
        amount biginteger Quantity Yes
outputs list Transaction Recipient Data Yes
        address string Account Address Yes
        assetsChainId integer Asset Chain ID Yes
        assetsId integer Asset ID Yes
        amount biginteger Quantity Yes
        lockTime long unlock time, -1 is always locked, 0 is not locked (default) no
remark string Transaction Notes Yes
signAddress string The first signature account address (without filling, only create transactions are not signed) No
signPassword string The first signature account password (without filling, only create transactions are not signed) No

return value

Field Name Field Type Parameter Description
tx string Complete transaction serialization string, continue signature if the transaction does not reach the minimum number of signatures
txHash string Trading hash
completed boolean true: the transaction is complete (broadcast), false: the transaction is not completed, the minimum number of signatures has not been reached

ac_signMultiSignTransaction

Multi-sign transaction signature / sign MultiSign Transaction

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes
tx string Transaction Data String Yes
signAddress string Signature Account Address Yes
signPassword string Signature Account Password Yes

return value

Field Name Field Type Parameter Description
tx string Complete transaction serialization string, continue signature if the transaction does not reach the minimum number of signatures
txHash string Trading hash
completed boolean true: the transaction is complete (broadcast), false: the transaction is not completed, the minimum number of signatures has not been reached

ac_createMultiSignAccount

Create a multi-sign account /create a multi sign account

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes
pubKeys list<string> Public key collection (public key of any common address or common account address present in the current node) Yes
minSigns int Minimum Signature Yes

return value

Field Name Field Type Parameter Description
address string Multi-Sign Account Address

ac_removeMultiSignAccount

Remove multi-sign account /remove the multi sign account

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes
address string Multi-Sign Account Address Yes

return value

Field Name Field Type Parameter Description
value boolean Whether to remove success

ac_setMultiSignAlias

Set the alias of multi sign account

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes
address string Multi-Sign Account Address Yes
alias string alias yes
signAddress string The first signature account address (without filling, only create transactions are not signed) No
signPassword string The first signature account password (without filling, only create transactions are not signed) No

return value

Field Name Field Type Parameter Description
tx string Complete transaction serialization string, continue signature if the transaction does not reach the minimum number of signatures
txHash string Trading hash
completed boolean true: the transaction is complete (broadcast), false: the transaction is not completed, the minimum number of signatures has not been reached

ac_getMultiSignAccount

Get a full multi-signature account by searching for a multi-signature account

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes
address string Multi-Sign Account Address Yes

return value

Field Name Field Type Parameter Description
value string Multi-Sign Account Serialization Data String

ac_isMultiSignAccountBuilder

Verify that one of the creators of the multi-signed account /Whether it is multiSign account Builder

scope:public

version:1.0

parameter list

Parameter Name Parameter Type Parameter Description Is Not Empty
chainId int chain id yes
address string Multi-Sign Account Address Yes
pubKey string creator public key or address already present at the current node Yes

return value

Field Name Field Type Parameter Description
value boolean Whether to sign one of the creators of the account
Last Updated: 9/5/2019, 4:50:57 PM