Docs
chromia.com

Interface

Connection

On this page

An object that allows the user to make ft aware queries to the blockchain. The queries that can be made using this object are general queries that are not specific to one account. However, a Connection instance can be used to acquire an Account instance, from which account specific details can be found.

See

Account

interface Connection {
    blockchainRid: Buffer;
    client: IClient;
    getAccountAuthDescriptorsFiltered: (
        accountAuthDescriptorFilter?: AccountAuthDescriptorFilter,
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<AnyAuthDescriptor>>;
    getAccountById: (accountId: BufferId) => Promise<Account | null>;
    getAccountCreationTransfersFiltered: (
        accountCreationTransferFilter?: AccountCreationTransferFilter,
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<AccountCreationTransfer>>;
    getAccountLinksFiltered: (
        accountLinkFilter?: AccountLinkFilter,
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<{ account: Account; secondary: Account }>>;
    getAccountsByAuthDescriptorId: (
        id: BufferId,
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<Account>>;
    getAccountsBySigner: (
        signer: BufferId,
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<Account>>;
    getAccountsByType: (
        type: string,
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<Account>>;
    getAccountsFiltered: (
        accountFilter?: AccountFilter,
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<Account>>;
    getAllAssets: (
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<Asset>>;
    getApiVersion: () => Promise<number>;
    getAppliedTransfersFiltered: (
        appliedTransferFilter?: TransferFilter,
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<AppliedTransfer>>;
    getAssetById: (assetId: BufferId) => Promise<Asset | null>;
    getAssetOriginFiltered: (
        assetOriginFilter?: AssetOriginFilter,
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<AssetOrigin>>;
    getAssetsByName: (
        name: string,
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<Asset>>;
    getAssetsBySymbol: (
        symbol: string,
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<Asset>>;
    getAssetsByType: (
        type: string,
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<Asset>>;
    getAssetsFiltered: (
        assetFilter?: AssetFilter,
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<Asset>>;
    getAuthDescriptorSignersFiltered: (
        authDescriptorSignerFilter?: AuthDescriptorSignerFilter,
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<AuthDescriptorSigner>>;
    getAuthDescriptorValidator: (useCache: boolean) => AuthDescriptorValidator;
    getBalancesFiltered: (
        balanceFilter?: BalanceFilter,
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<Balance>>;
    getBlockHeight: () => Promise<number>;
    getCanceledTransfersFiltered: (
        canceledTransferFilter?: TransferFilter,
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<Transfer>>;
    getConfig: () => Promise<Config>;
    getCrosschainTransferHistoryEntriesFiltered: (
        crosschainTransferHistoryEntryFilter?: CrosschainTransferHistoryEntryFilter,
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<CrosschainTransferHistoryEntry>>;
    getEnabledRegistrationStrategies: () => Promise<string[]>;
    getMainAuthDescriptorsFiltered: (
        mainAccountAuthDescriptorFilter?: MainAccountAuthDescriptorFilter,
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<AnyAuthDescriptor>>;
    getPendingTransfersFiltered: (
        pendingTransferFilter?: PendingTransferFilter,
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<PendingTransfer>>;
    getRecalledTransfersFiltered: (
        recalledTransferFilter?: TransferFilter,
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<Transfer>>;
    getRevertedTransfersFiltered: (
        revertedTransferFilter?: TransferFilter,
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<Transfer>>;
    getRlStatesFiltered: (
        rlStateFilter?: RlStateFilter,
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<RlState>>;
    getSubscriptionsFiltered: (
        subscriptionFilter?: SubscriptionFilter,
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<Subscription>>;
    getTransferDetails: (
        txRid: BufferId,
        opIndex: number,
    ) => Promise<TransferDetail[]>;
    getTransferDetailsByAsset: (
        txRid: BufferId,
        opIndex: number,
        assetId: BufferId,
    ) => Promise<TransferDetail[]>;
    getTransferHistoryEntriesFiltered: (
        transferHistoryEntryFilter?: TransferHistoryEntryFilter,
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<TransferHistoryEntry>>;
    getUnappliedTransfersFiltered: (
        unappliedTransferFilter?: TransferFilter,
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<Transfer>>;
    getVersion: () => Promise<string>;
}

Hierarchy (View Summary)

Properties

blockchainRid

blockchainRid: Buffer

client

client: IClient

getAccountAuthDescriptorsFiltered

getAccountAuthDescriptorsFiltered: (
    accountAuthDescriptorFilter?: AccountAuthDescriptorFilter,
    limit?: number,
    cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<AnyAuthDescriptor>>

Fetches all AccountAuthDescriptors with satisfy the accountAuthDescriptor filter, paginated

Type Declaration

getAccountById

getAccountById: (accountId: BufferId) => Promise<Account | null>

Fetches the account with the specified id

Type Declaration

    • (accountId: BufferId): Promise<Account | null>
    • Parameters

      • accountId: BufferId

        the id of the account to fetch

      Returns Promise<Account | null>

      the account with the specified id, or null if no account with that id exists

getAccountCreationTransfersFiltered

getAccountCreationTransfersFiltered: (
    accountCreationTransferFilter?: AccountCreationTransferFilter,
    limit?: number,
    cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<AccountCreationTransfer>>

Fetches all AccountCreationTransfers with satisfy the accountCreationTransferFilter filter, paginated

Type Declaration

getAccountLinksFiltered

getAccountLinksFiltered: (
    accountLinkFilter?: AccountLinkFilter,
    limit?: number,
    cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<{ account: Account; secondary: Account }>>

Fetches all AccountLinks with satisfy the accountLinkFilter filter, paginated

Type Declaration

getAccountsByAuthDescriptorId

getAccountsByAuthDescriptorId: (
    id: BufferId,
    limit?: number,
    cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<Account>>

Fetches all accounts with which the auth descriptor with the specified id is associated

Type Declaration

getAccountsBySigner

getAccountsBySigner: (
    signer: BufferId,
    limit?: number,
    cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<Account>>

Fetches all accounts with which the provided signer has at least one associated auth descriptor

Type Declaration

getAccountsByType

getAccountsByType: (
    type: string,
    limit?: number,
    cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<Account>>

Returns all accounts of the specified type that is registered on the blockchain as a paginated entity

Type Declaration

getAccountsFiltered

getAccountsFiltered: (
    accountFilter?: AccountFilter,
    limit?: number,
    cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<Account>>

Fetches all accounts with satisfy the account filter, paginated

Type Declaration

getAllAssets

getAllAssets: (
    limit?: number,
    cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<Asset>>

Retrieves all assets that are registered on a blockchain as a paginated entity

Type Declaration

getApiVersion

getApiVersion: () => Promise<number>

Returns the API version of ft library installed on the blockchain. It will be an integer.

getAppliedTransfersFiltered

getAppliedTransfersFiltered: (
    appliedTransferFilter?: TransferFilter,
    limit?: number,
    cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<AppliedTransfer>>

Retrieves applied transfers based on the selected filter of TransferFilter, paginated

Type Declaration

Returns

paginated results of applied transfers based on the filter selection

Available since ApiVersion 1

getAssetById

getAssetById: (assetId: BufferId) => Promise<Asset | null>

Retrieves asset information using its id

Type Declaration

    • (assetId: BufferId): Promise<Asset | null>
    • Parameters

      • assetId: BufferId

        the id of the asset to fetch

      Returns Promise<Asset | null>

Returns

The asset details, or null if no asset with the specified id was found

getAssetOriginFiltered

getAssetOriginFiltered: (
    assetOriginFilter?: AssetOriginFilter,
    limit?: number,
    cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<AssetOrigin>>

Retrieves assets origin based on the selected filter of AssetOriginFilter, paginated

Type Declaration

Returns

paginated results of assets origin based on the filter selection

Available since ApiVersion 1

getAssetsByName

getAssetsByName: (
    name: string,
    limit?: number,
    cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<Asset>>

Retrieves asset information using its name. As there can be multiple assets with the same name, the information is returned as a paginated entity.

Type Declaration

getAssetsBySymbol

getAssetsBySymbol: (
    symbol: string,
    limit?: number,
    cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<Asset>>

Retrieves asset information using its symbol. As there can be multiple assets with the same symbol, the information is returned as a paginated entity.

Type Declaration

getAssetsByType

getAssetsByType: (
    type: string,
    limit?: number,
    cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<Asset>>

Retrieves all assets of a specific type, e.g., "ft4", as a paginated entity

Type Declaration

getAssetsFiltered

getAssetsFiltered: (
    assetFilter?: AssetFilter,
    limit?: number,
    cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<Asset>>

Retrieves all assets based on the filtering options provided in AssetFilter and that are registered on a blockchain as a paginated entity

Type Declaration

getAuthDescriptorSignersFiltered

getAuthDescriptorSignersFiltered: (
    authDescriptorSignerFilter?: AuthDescriptorSignerFilter,
    limit?: number,
    cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<AuthDescriptorSigner>>

Fetches all AuthDescriptorSigners with satisfy the authDescriptorSigner filter, paginated

Type Declaration

getAuthDescriptorValidator

getAuthDescriptorValidator: (useCache: boolean) => AuthDescriptorValidator

Gets a validator instance that can be used to validate if an auth descriptor is valid or not

Type Declaration

getBalancesFiltered

getBalancesFiltered: (
    balanceFilter?: BalanceFilter,
    limit?: number,
    cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<Balance>>

Retrieves all balances based on the filtering options provided in BalanceFilter and that are registered on a blockchain as a paginated entity

Type Declaration

getBlockHeight

getBlockHeight: () => Promise<number>

Returns the current block height of the underlying chain

getCanceledTransfersFiltered

getCanceledTransfersFiltered: (
    canceledTransferFilter?: TransferFilter,
    limit?: number,
    cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<Transfer>>

Retrieves canceled transfers based on the selected filter of in TransferFilter, paginated

Type Declaration

Returns

paginated results of canceled transfers based on the filter selection

Available since ApiVersion 1

getConfig

getConfig: () => Promise<Config>

Returns the ft config that is currently in effect

getCrosschainTransferHistoryEntriesFiltered

getCrosschainTransferHistoryEntriesFiltered: (
    crosschainTransferHistoryEntryFilter?: CrosschainTransferHistoryEntryFilter,
    limit?: number,
    cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<CrosschainTransferHistoryEntry>>

Retrieves all crosschain transfer history entries based on the filtering options provided in CrosschainTransferHistoryEntryFilter as a paginated entity

Type Declaration

getEnabledRegistrationStrategies

getEnabledRegistrationStrategies: () => Promise<string[]>

Returns a list containing the name of all of the enabled strategies

getMainAuthDescriptorsFiltered

getMainAuthDescriptorsFiltered: (
    mainAccountAuthDescriptorFilter?: MainAccountAuthDescriptorFilter,
    limit?: number,
    cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<AnyAuthDescriptor>>

Fetches all MainAuthDescriptors with satisfy the mainAccountAuthDescriptor filter, paginated

Type Declaration

getPendingTransfersFiltered

getPendingTransfersFiltered: (
    pendingTransferFilter?: PendingTransferFilter,
    limit?: number,
    cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<PendingTransfer>>

Retrieves pending transfers based on the selected filter of PendingTransferFilter, paginated

Type Declaration

Returns

paginated results of pending transfers based on the filter selection

Available since ApiVersion 1

getRecalledTransfersFiltered

getRecalledTransfersFiltered: (
    recalledTransferFilter?: TransferFilter,
    limit?: number,
    cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<Transfer>>

Retrieves recalled transfers based on the selected filter of TransferFilter, paginated

Type Declaration

Returns

paginated results of recalled transfers based on the filter selection

Available since ApiVersion 1

getRevertedTransfersFiltered

getRevertedTransfersFiltered: (
    revertedTransferFilter?: TransferFilter,
    limit?: number,
    cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<Transfer>>

Retrieves reverted transfers based on the selected filter of TransferFilter, paginated

Type Declaration

Returns

paginated results of reverted transfers based on the filter selection

Available since ApiVersion 1

getRlStatesFiltered

getRlStatesFiltered: (
    rlStateFilter?: RlStateFilter,
    limit?: number,
    cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<RlState>>

Fetches all Rate limit states with satisfy the rlState filter, paginated

Type Declaration

getSubscriptionsFiltered

getSubscriptionsFiltered: (
    subscriptionFilter?: SubscriptionFilter,
    limit?: number,
    cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<Subscription>>

Fetches all Subscriptions with satisfy the subscriptionFilter filter, paginated

Type Declaration

getTransferDetails

getTransferDetails: (
    txRid: BufferId,
    opIndex: number,
) => Promise<TransferDetail[]>

Retrieves the details of a transfer

Type Declaration

    • (txRid: BufferId, opIndex: number): Promise<TransferDetail[]>
    • Parameters

      • txRid: BufferId

        the id of the transaction in which the transfer was made

      • opIndex: number

        the index of the transfer operation within the transaction

      Returns Promise<TransferDetail[]>

Returns

Details about the transfer

getTransferDetailsByAsset

getTransferDetailsByAsset: (
    txRid: BufferId,
    opIndex: number,
    assetId: BufferId,
) => Promise<TransferDetail[]>

Retrieves details of a transfer but only the details that was made with a specific asset

Type Declaration

    • (txRid: BufferId, opIndex: number, assetId: BufferId): Promise<TransferDetail[]>
    • Parameters

      • txRid: BufferId

        the id of the transaction in which the transfer was made

      • opIndex: number

        the index of the transfer operation within the transaction

      • assetId: BufferId

        the asset id for which to return details

      Returns Promise<TransferDetail[]>

Returns

The transfer details

getTransferHistoryEntriesFiltered

getTransferHistoryEntriesFiltered: (
    transferHistoryEntryFilter?: TransferHistoryEntryFilter,
    limit?: number,
    cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<TransferHistoryEntry>>

Retrieves all transfer history entries based on the filtering options provided in TransferHistoryEntryFilter as a paginated entity

Type Declaration

getUnappliedTransfersFiltered

getUnappliedTransfersFiltered: (
    unappliedTransferFilter?: TransferFilter,
    limit?: number,
    cursor?: OptionalPageCursor,
) => Promise<PaginatedEntity<Transfer>>

Retrieves unapplied transfers based on the selected filter of TransferFilter, paginated

Type Declaration

Returns

paginated results of unapplied transfers based on the filter selection

Available since ApiVersion 1

getVersion

getVersion: () => Promise<string>

Returns the version of ft library installed on the blockchain with the format ..