const LogosAccount = new LogosAccount({
label: null,
address: null,
publicKey: null,
balance: '0',
pendingBalance: '0',
wallet: null,
chain: [],
receiveChain: [],
pendingChain: [],
privateKey: null
tokenBalances: {},
tokens: [],
pendingTokenBalances: {},
index: null
})
All logos account options are optional defaults are shown in the example above
Account Options | Description |
---|---|
label | Account label e.g. Checking Account |
address | Address is the lgs_ string |
publicKey | Public key of the account |
balance | Balance of the account in the minor unit of Logos |
pendingBalance | balance of the account including pending transaction in the minor unit of Logos |
wallet | reference back to the parent wallet class |
chain | Array of Request that are confirmed on this account's send chain |
receiveChain | Array of Request that are confirmed on this account's receive chain |
pendingChain | Array of Request that are not confirmed on this account's send chain |
privateKey | Private key of the account used to sign transactions |
tokenBalances | Balances tokens that this account has in their |
tokens | Array of token addresses associated with this account |
pendingTokenBalances | Unconfirmed balances of the tokens |
index | index of the account |
The address of the account
The balance of the account in reason
The balance of the account in reason
Return the balance of the account in Logos
The label of the account
The label of the account
The pending balance of the account in reason
pending balance is balance minus the sends that are pending
The pending balance of the account in reason
pending balance is balance minus the sends that are pending
array of pending requests on the account
These requests have been sent for consensus but we haven't heard back on if they are confirmed yet.
array of pending requests on the account
These requests have been sent for consensus but we haven't heard back on if they are confirmed yet.
Gets the total number of requests on the pending chain
The pending token balance of the account in the minor token unit
pending token balance is balance minus the token sends that are pending
const pendingTokenBalances = logosAccount.pendingTokenBalances
Return the previous request as hash
hash of the previous transaction
The public key of the account
Gets the total number of requests on the receive chain
Gets the total number of requests on the send chain
Return the sequence value
sequence of for the next transaction
If the account has been synced with the RPC
If the account has been synced with the RPC
The balance of the tokens in the minor token unit
const tokenBalances = logosAccount.tokenBalances
Array of associated token ids to this account (full list available only with fullsync)
const tokens = logosAccount.tokens
Account version of webwallet SDK
Creates a request object from the mqtt info and adds the request to the appropriate chain
Adds the request to the Receive chain if it doesn't already exist
Request Object
Adds the request to the Send chain if it doesn't already exist
Request Object
Adds a token to the accounts associated tokens if it doesn't already exist
The TokenID you are associating with this account (this will be converted into a token account when stored)
Array of all the associated tokens
const token = await logosAccount.addToken('lgs_3q69z3kf6cq9n9smago3p1ptuyqy9pa3mdykyi9o8f7gnof47qdyxj9gejxd')
Broadcasts the first pending request
Batchs send requests
Creates a request from the specified information
The Token ID, feeRate, and feeType
Creates a request from the specified information
The Token ID, account, and status
Creates a Burn Token Request from the specified information
The Token ID & amount
Creates a ChangeSetting Token Request from the specified information
Token ID, setting, value
Creates a request from the specified information
The Token ID & transaction
Creates a ImmuteSetting Token Request from the specified information
Token ID, setting
Creates a IssueAdditional Token Request from the specified information
The Token ID & amount
Creates a Revoke Token Request from the specified information
Token ID, transaction, source
Creates a request from the specified information
The account destinations and amounts you wish to send them
Creates a request from the specified information
The options for the token creation
Creates a request from the specified information
The token address or token id
The account destinations and amounts you wish to send them
Creates a request from the specified information
The Token ID, action ('add' or 'remove'), and controller
Creates a request from the specified information
The Token ID and issuerInfo
Creates a request from the specified information
The Token ID & transaction
Creates a request from the specified information
The Token ID & transaction
Finds the request object of the specified request hash in the confirmed chain
The hash of the request we are looking for
false if no request object of the specified hash was found
Finds the request object of the specified request hash in the pending chain
The hash of the request we are looking for
false if no request object of the specified hash was found
Gets the requests up to a certain hash from the pending chain
Hash of the request you wish to stop retrieving requests at
all the requests up to and including the specified request
Gets the requests up to a certain hash from the receive chain
Hash of the request you wish to stop retrieving requests at
all the requests up to and including the specified request
Finds the request object of the specified request hash in the recieve chain
The hash of the request we are looking for
false if no request object of the specified hash was found
Finds the request object of the specified request hash
The hash of the request we are looking for
null if no request object of the specified hash was found
Gets the requests up to a certain hash from the send chain
Hash of the request you wish to stop retrieving requests at
all the requests up to and including the specified request
Gets tokenAccount
Checks if the account is synced
const isSynced = await logosAccount.isSynced()
Confirms the request in the local chain
Retreives pending requests from the send chain
Number of requests you wish to retrieve
Number of requests back from the frontier tip you wish to start at
all the requests
Retreives requests from the receive chain
Number of requests you wish to retrieve
Number of requests back from the frontier tip you wish to start at
all the requests
Retreives requests from the send chain
Number of requests you wish to retrieve
Number of requests back from the frontier tip you wish to start at
all the requests
Called when a request is confirmed to remove it from the pending request pool
The hash of the request we are confirming
true or false if the pending request was found and removed
Determines if you shold combine requests
Returns true if the pending chain has x sends and the count of total transactions is <= (x-minimumSaved) * 8
The minimum amount of requests saved in order to combine defaults to 1
The balance of the given token in the minor unit and major unit (if available)
The balance in minor unit or converted units
const tokenBalance = logosAccount.tokenBalance('lgs_3q69z3kf6cq9n9smago3p1ptuyqy9pa3mdykyi9o8f7gnof47qdyxj9gejxd')
Updates the balances of the account by traversing the chain
logosAccount.updateBalancesFromChain()
Updates the balances of the account by doing math on the previous balance when given a new request Also updates the pending balance based on the new balance and the pending chain
Validates that the account has enough funds at the current time to publish the request
Verify the integrity of the send & pending chains
Verify the integrity of the receive chain
Generated using TypeDoc
Logos Account
This class is the base class of an account on the Logos Network. The most common uses for this account is to check the balance, history, and create new requests from this account as the origin.