Represents a blockchain account which is read only. That is, using this object you can get information about an account, but you cannot submit authenticated operations with it.

For an account to which it is possible to write, see AuthenticatedAccount

interface Account {
    blockchainRid: Buffer;
    getAuthDescriptorById: ((authDescriptorId) => Promise<AnyAuthDescriptor>);
    getAuthDescriptors: (() => Promise<AnyAuthDescriptor[]>);
    getAuthDescriptorsBySigner: ((signer) => Promise<AnyAuthDescriptor[]>);
    getBalanceByAssetId: ((assetId) => Promise<null | Balance>);
    getBalances: ((limit?, cursor?) => Promise<PaginatedEntity<Balance>>);
    getLastPendingCrosschainTransfer: ((targetBlockchainRid, recipientId, assetId, amount) => Promise<null | PendingTransfer>);
    getMainAuthDescriptor: (() => Promise<AnyAuthDescriptor>);
    getPendingCrosschainTransfers: ((limit?, cursor?) => Promise<PaginatedEntity<PendingTransfer>>);
    getRateLimit: (() => Promise<RateLimit>);
    getTransferHistory: ((limit?, filter?, cursor?) => Promise<PaginatedEntity<TransferHistoryEntry>>);
    getTransferHistoryEntry: ((rowid) => Promise<null | TransferHistoryEntry>);
    id: Buffer;
    isAuthDescriptorValid: ((authDescriptorId) => Promise<boolean>);
}

Hierarchy (view full)

Properties

blockchainRid: Buffer
getAuthDescriptorById: ((authDescriptorId) => Promise<AnyAuthDescriptor>)

Fetches an auth descriptor by its ID.

Type declaration

Remarks

the auth descriptor in question needs to be associated with this account and if no auth descriptor is found, this method will throw an error

getAuthDescriptors: (() => Promise<AnyAuthDescriptor[]>)

Retrieves all auth descriptors associated with this account

Type declaration

getAuthDescriptorsBySigner: ((signer) => Promise<AnyAuthDescriptor[]>)

Retrieves all auth descriptors on which the specified signer is also a signer.

Type declaration

getBalanceByAssetId: ((assetId) => Promise<null | Balance>)

Retrieves the balance for a specific asset

Type declaration

    • (assetId): Promise<null | Balance>
    • Parameters

      • assetId: BufferId

        the id of the asset to fetch balance for

      Returns Promise<null | Balance>

Returns

the balance of the asset on this account, or null if this account does not have the asset

getBalances: ((limit?, cursor?) => Promise<PaginatedEntity<Balance>>)

Retrieves all the balances of all assets that is available on the account and returns them as a paginated entity.

Type declaration

getLastPendingCrosschainTransfer: ((targetBlockchainRid, recipientId, assetId, amount) => Promise<null | PendingTransfer>)

Retrieves the most recent pending transfer which matches the specified arguments

Type declaration

    • (targetBlockchainRid, recipientId, assetId, amount): Promise<null | PendingTransfer>
    • Parameters

      • targetBlockchainRid: BufferId

        the rid of the blockchain that the transfer was targeting

      • recipientId: BufferId

        the id of the account that is going to receive the transfer

      • assetId: BufferId

        the id of the asset that is being transferred

      • amount: bigint

        how much of the asset that is being transferred

      Returns Promise<null | PendingTransfer>

Returns

the latest pending transfer that matches the criteria. Or null if no such transfer is found

getMainAuthDescriptor: (() => Promise<AnyAuthDescriptor>)

Retrieves the main auth descriptor of this account

Type declaration

getPendingCrosschainTransfers: ((limit?, cursor?) => Promise<PaginatedEntity<PendingTransfer>>)

Retrieves all pending (i.e., started but not yet completed) cross chain transfers initiated by this account.

Type declaration

getRateLimit: (() => Promise<RateLimit>)

Retrieves the current rate limit for this account. I.e., how many points this account currently has.

Type declaration

getTransferHistory: ((limit?, filter?, cursor?) => Promise<PaginatedEntity<TransferHistoryEntry>>)

Retrieves the full transfer history for this account as a paginated entity.

Type declaration

getTransferHistoryEntry: ((rowid) => Promise<null | TransferHistoryEntry>)

Retrieves a specific TransferHistoryEntry

Type declaration

Returns

the requested transfer history entry, or null if that rowid does not exist.

id: Buffer
isAuthDescriptorValid: ((authDescriptorId) => Promise<boolean>)

Determines whether the auth descriptor with the specified id is valid.

Type declaration

    • (authDescriptorId): Promise<boolean>
    • Parameters

      • authDescriptorId: BufferId

        the id of the auth descriptor to check

      Returns Promise<boolean>

Returns

true or false depending on if the auth descriptor is valid or not