Interface AccountApi

Account API

interface AccountApi {
    addCommitment: ((args: CommitmentArgs) => Promise<TransactionId | UnsignedTransaction>);
    generateSendTransactionQRCode: ((receiverId: string, amountNQT?: number, feeSuggestionType?: string, feeNQT?: number, immutable?: boolean) => Promise<ArrayBufferLike>);
    generateSendTransactionQRCodeAddress: ((receiverId: string, amountNQT?: number, feeSuggestionType?: string, feeNQT?: number, immutable?: boolean) => Promise<string>);
    getAccount: ((args: GetAccountArgs) => Promise<Account>);
    getAccountBalance: ((accountId: string) => Promise<Balance>);
    getAccountBlockIds: ((args: GetAccountBlocksArgs) => Promise<string[]>);
    getAccountBlocks: ((args: GetAccountBlocksArgs) => Promise<BlockList>);
    getAccountSubscriptions: ((accountId: string) => Promise<SubscriptionList>);
    getAccountTransactions: ((args: GetAccountTransactionsArgs) => Promise<TransactionList>);
    getAccountTransactionsBetweenSenderAndRecipient: ((args: GetAccountTransactionsSenderRecipientArgs) => Promise<TransactionList>);
    getAccountTransactionsFromSender: ((args: Omit<GetAccountTransactionsSenderRecipientArgs, "recipientId">) => Promise<TransactionList>);
    getAccountTransactionsFromSenderToRecipient: ((args: GetAccountTransactionsSenderRecipientArgs) => Promise<TransactionList>);
    getAccountTransactionsToRecipient: ((args: Omit<GetAccountTransactionsSenderRecipientArgs, "senderId">) => Promise<TransactionList>);
    getRewardRecipient: ((accountId: string) => Promise<RewardRecipient>);
    getSubscriptionsToAccount: ((accountId: string) => Promise<SubscriptionList>);
    getTradeHistoryPerAccount: ((args: GetTradeHistoryPerAccountArgs) => Promise<TradeHistory>);
    getUnconfirmedAccountTransactions: ((accountId: string, includeIndirect?: boolean) => Promise<UnconfirmedTransactionList>);
    removeCommitment: ((args: CommitmentArgs) => Promise<TransactionId | UnsignedTransaction>);
    setAccountInfo: ((args: SetAccountInfoArgs) => Promise<TransactionId | UnsignedTransaction>);
    setAlias: ((args: SetAliasArgs) => Promise<TransactionId | UnsignedTransaction>);
    setRewardRecipient: ((args: SetRewardRecipientArgs) => Promise<TransactionId | UnsignedTransaction>);
}

Properties

addCommitment: ((args: CommitmentArgs) => Promise<TransactionId | UnsignedTransaction>)

Adds an additional amount as commitment

The commitment is part of the PoC+ consensus, and allows miners to improve their mining power through additionally locked amount

Type declaration

generateSendTransactionQRCode: ((receiverId: string, amountNQT?: number, feeSuggestionType?: string, feeNQT?: number, immutable?: boolean) => Promise<ArrayBufferLike>)

Get QR Code image for a given BURST address

Type declaration

    • (receiverId, amountNQT?, feeSuggestionType?, feeNQT?, immutable?): Promise<ArrayBufferLike>
    • Parameters

      • receiverId: string

        The recipient burst

      • OptionalamountNQT: number

        The amount (in NQT) to request (Default = 0)

      • OptionalfeeSuggestionType: string

        The fee suggestion type string (Default = 'standard')

      • OptionalfeeNQT: number

        The fee amount (in NQT)

      • Optionalimmutable: boolean

        Whether to allow this to be modified

      Returns Promise<ArrayBufferLike>

      QR code image data

generateSendTransactionQRCodeAddress: ((receiverId: string, amountNQT?: number, feeSuggestionType?: string, feeNQT?: number, immutable?: boolean) => Promise<string>)

Generate the URL for a QR Code for a given BURST address. Useful for IMG tags in HTML.

Type declaration

    • (receiverId, amountNQT?, feeSuggestionType?, feeNQT?, immutable?): Promise<string>
    • Parameters

      • receiverId: string

        The recipient burst address

      • OptionalamountNQT: number

        The amount (in NQT) to request (Default = 0)

      • OptionalfeeSuggestionType: string

        The fee suggestion type string (Default = 'standard')

      • OptionalfeeNQT: number

        The fee amount (in NQT)

      • Optionalimmutable: boolean

        Whether to allow this to be modified

      Returns Promise<string>

      The url

getAccount: ((args: GetAccountArgs) => Promise<Account>)

Get an account given an ID

Type declaration

    • (args): Promise<Account>
    • Parameters

      Returns Promise<Account>

      The account from the backend, not including transactions

getAccountBalance: ((accountId: string) => Promise<Balance>)

Get the balance of an account

Type declaration

    • (accountId): Promise<Balance>
    • Parameters

      • accountId: string

      Returns Promise<Balance>

      The account's balance

getAccountBlockIds: ((args: GetAccountBlocksArgs) => Promise<string[]>)

Get blockIds forged by an account

Type declaration

    • (args): Promise<string[]>
    • Parameters

      Returns Promise<string[]>

      The list of blocks

getAccountBlocks: ((args: GetAccountBlocksArgs) => Promise<BlockList>)

Get blocks forged by an account

Type declaration

getAccountSubscriptions: ((accountId: string) => Promise<SubscriptionList>)

Gets a list of subscriptions for this account (sender)

Type declaration

getAccountTransactions: ((args: GetAccountTransactionsArgs) => Promise<TransactionList>)

Get transactions of given account

Type declaration

getAccountTransactionsBetweenSenderAndRecipient: ((args: GetAccountTransactionsSenderRecipientArgs) => Promise<TransactionList>)

Get all transactions between sender and recipient (in both transfer directions)

This method does not resolve amount of distributions to token holders

Type declaration

    • (args): Promise<TransactionList>
    • Parameters

      • args: GetAccountTransactionsSenderRecipientArgs

        The arguments

      Returns Promise<TransactionList>

      List of transactions

getAccountTransactionsFromSender: ((args: Omit<GetAccountTransactionsSenderRecipientArgs, "recipientId">) => Promise<TransactionList>)

Get all transactions from specific sender

This method does not resolve amount of distributions to token holders

Type declaration

    • (args): Promise<TransactionList>
    • Parameters

      • args: Omit<GetAccountTransactionsSenderRecipientArgs, "recipientId">

        The arguments

      Returns Promise<TransactionList>

      List of transactions

getAccountTransactionsFromSenderToRecipient: ((args: GetAccountTransactionsSenderRecipientArgs) => Promise<TransactionList>)

Get all transactions from sender to recipient

This method does not resolve amount of distributions to token holders

Type declaration

    • (args): Promise<TransactionList>
    • Parameters

      • args: GetAccountTransactionsSenderRecipientArgs

        The arguments

      Returns Promise<TransactionList>

      List of transactions

getAccountTransactionsToRecipient: ((args: Omit<GetAccountTransactionsSenderRecipientArgs, "senderId">) => Promise<TransactionList>)

Get all transactions to specific recipient

This method does not resolve amount of distributions to token holders

Type declaration

    • (args): Promise<TransactionList>
    • Parameters

      • args: Omit<GetAccountTransactionsSenderRecipientArgs, "senderId">

        The arguments

      Returns Promise<TransactionList>

      List of transactions

getRewardRecipient: ((accountId: string) => Promise<RewardRecipient>)

Gets the reward recipient for an account

So you can see, if an account is bound to a pool.

Type declaration

getSubscriptionsToAccount: ((accountId: string) => Promise<SubscriptionList>)

Gets a list of subscriptions paying to the given account (recipient)

Type declaration

getTradeHistoryPerAccount: ((args: GetTradeHistoryPerAccountArgs) => Promise<TradeHistory>)

The trade history is a journal about open/filled and/or cancelled trades for a given account and optionally set asset

Type declaration

getUnconfirmedAccountTransactions: ((accountId: string, includeIndirect?: boolean) => Promise<UnconfirmedTransactionList>)

Get unconfirmed transactions of given account

Type declaration

    • (accountId, includeIndirect?): Promise<UnconfirmedTransactionList>
    • Parameters

      • accountId: string

        The numeric accountId

      • OptionalincludeIndirect: boolean

        Includes indirect transaction, i.e. multi out payments. For BRS Versions before 2.3.2 this must be undefined

      Returns Promise<UnconfirmedTransactionList>

      List of unconfirmed transactions

removeCommitment: ((args: CommitmentArgs) => Promise<TransactionId | UnsignedTransaction>)

Removes/Reduces a miners commitment

The commitment is part of the PoC+ consensus, and allows miners to improve their mining power through additionally locked amount

Type declaration

setAccountInfo: ((args: SetAccountInfoArgs) => Promise<TransactionId | UnsignedTransaction>)

Sets account information for an account

Type declaration

setAlias: ((args: SetAliasArgs) => Promise<TransactionId | UnsignedTransaction>)

Sets or Updates an Alias

Type declaration

setRewardRecipient: ((args: SetRewardRecipientArgs) => Promise<TransactionId | UnsignedTransaction>)

Assigns a reward recipient for an account

This function is usually used to bind an account to a mining pool.

Type declaration