Interface
Account
On this page
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;
connection: Connection;
getAuthDescriptorById: (
authDescriptorId: BufferId,
) => Promise<AnyAuthDescriptor>;
getAuthDescriptors: () => Promise<AnyAuthDescriptor[]>;
getAuthDescriptorsBySigner: (
signer: BufferId,
) => Promise<AnyAuthDescriptor[]>;
getBalanceByAssetId: (assetId: BufferId) => Promise<Balance | null>;
getBalances: (
limit?: number,
cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<Balance>>;
getLastPendingCrosschainTransfer: (
targetBlockchainRid: BufferId,
recipientId: BufferId,
assetId: BufferId,
amount: bigint,
) => Promise<PendingTransfer | null>;
getMainAuthDescriptor: () => Promise<AnyAuthDescriptor>;
getPendingCrosschainTransfers: (
limit?: OptionalLimit,
cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<PendingTransfer>>;
getRateLimit: () => Promise<RateLimit>;
getTransferHistory: (
limit?: number,
filter?: TransferHistoryFilter,
cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<TransferHistoryEntry>>;
getTransferHistoryEntry: (
rowid: number,
) => Promise<TransferHistoryEntry | null>;
id: Buffer;
isAuthDescriptorValid: (authDescriptorId: BufferId) => Promise<boolean>;
type?: string;
}Hierarchy (View Summary)
- Account
Properties
blockchainRid
blockchainRid: Bufferconnection
connection: ConnectiongetAuthDescriptorById
getAuthDescriptorById: (
authDescriptorId: BufferId,
) => Promise<AnyAuthDescriptor>Fetches an auth descriptor by its ID.
Type Declaration
Parameters
- authDescriptorId: BufferId
the id of the auth descriptor to fetch
Returns Promise<AnyAuthDescriptor>
- authDescriptorId: BufferId
(authDescriptorId: BufferId): Promise<AnyAuthDescriptor>
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
getAuthDescriptors: () => Promise<AnyAuthDescriptor[]>Retrieves all auth descriptors associated with this account
getAuthDescriptorsBySigner
getAuthDescriptorsBySigner: (signer: BufferId) => Promise<AnyAuthDescriptor[]>Retrieves all auth descriptors on which the specified signer is also a signer.
Type Declaration
Parameters
- signer: BufferId
the signer whose auth descriptors to retrieve
Returns Promise<AnyAuthDescriptor[]>
- signer: BufferId
(signer: BufferId): Promise<AnyAuthDescriptor[]>
getBalanceByAssetId
getBalanceByAssetId: (assetId: BufferId) => Promise<Balance | null>Retrieves the balance for a specific asset
Type Declaration
getBalances
getBalances: (
limit?: number,
cursor?: OptionalPageCursor,
) => 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
Parameters
Optionallimit: numbermaximum page size
Optionalcursor: OptionalPageCursorwhere the page should start
Returns Promise<PaginatedEntity<Balance>>
(limit?: number, cursor?: OptionalPageCursor): Promise<PaginatedEntity<Balance>>
getLastPendingCrosschainTransfer
getLastPendingCrosschainTransfer: (
targetBlockchainRid: BufferId,
recipientId: BufferId,
assetId: BufferId,
amount: bigint,
) => Promise<PendingTransfer | null>Retrieves the most recent pending transfer which matches the specified arguments
Type Declaration
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<PendingTransfer | null>
the latest pending transfer that matches the criteria. Or null if no such transfer is found
- targetBlockchainRid: BufferId
( targetBlockchainRid: BufferId, recipientId: BufferId, assetId: BufferId, amount: bigint, ): Promise<PendingTransfer | null>
getMainAuthDescriptor
getMainAuthDescriptor: () => Promise<AnyAuthDescriptor>Retrieves the main auth descriptor of this account
getPendingCrosschainTransfers
getPendingCrosschainTransfers: (
limit?: OptionalLimit,
cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<PendingTransfer>>Retrieves all pending (i.e., started but not yet completed) cross chain transfers initiated by this account.
Type Declaration
Parameters
Optionallimit: OptionalLimitmaximum page size
Optionalcursor: OptionalPageCursorwhere the page should start
Returns Promise<PaginatedEntity<PendingTransfer>>
( limit?: OptionalLimit, cursor?: OptionalPageCursor, ): Promise<PaginatedEntity<PendingTransfer>>
getRateLimit
getRateLimit: () => Promise<RateLimit>Retrieves the current rate limit for this account. I.e., how many points this account currently has.
getTransferHistory
getTransferHistory: (
limit?: number,
filter?: TransferHistoryFilter,
cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<TransferHistoryEntry>>Retrieves the full transfer history for this account as a paginated entity.
Type Declaration
Parameters
Optionallimit: numbermaximum page size
Optionalfilter: TransferHistoryFiltera filter to determine what type of transfer history entries to fetch
Optionalcursor: OptionalPageCursorwhere the page should start
Returns Promise<PaginatedEntity<TransferHistoryEntry>>
( limit?: number, filter?: TransferHistoryFilter, cursor?: OptionalPageCursor, ): Promise<PaginatedEntity<TransferHistoryEntry>>
getTransferHistoryEntry
getTransferHistoryEntry: (rowid: number) => Promise<TransferHistoryEntry | null>Retrieves a specific TransferHistoryEntry
Type Declaration
Parameters
- rowid: number
the rowid of the
TransferHistoryEntry
Returns Promise<TransferHistoryEntry | null>
the requested transfer history entry, or
nullif thatrowiddoes not exist.- rowid: number
(rowid: number): Promise<TransferHistoryEntry | null>
id
id: BufferisAuthDescriptorValid
isAuthDescriptorValid: (authDescriptorId: BufferId) => Promise<boolean>Determines whether the auth descriptor with the specified id is valid.
Type Declaration
Parameters
- authDescriptorId: BufferId
the id of the auth descriptor to check
Returns Promise<boolean>
true or false depending on if the auth descriptor is valid or not
- authDescriptorId: BufferId
(authDescriptorId: BufferId): Promise<boolean>
Optionaltype
type?: string