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.

interface Connection {
    blockchainRid: Buffer;
    client: IClient;
    getAccountById: ((accountId) => Promise<null | Account>);
    getAccountsByAuthDescriptorId: ((id, limit?, cursor?) => Promise<PaginatedEntity<Account>>);
    getAccountsBySigner: ((signer, limit?, cursor?) => Promise<PaginatedEntity<Account>>);
    getAccountsByType: ((type, limit?, cursor?) => Promise<PaginatedEntity<Account>>);
    getAllAssets: ((limit?, cursor?) => Promise<PaginatedEntity<Asset>>);
    getAssetById: ((assetId) => Promise<null | Asset>);
    getAssetsByName: ((name, limit?, cursor?) => Promise<PaginatedEntity<Asset>>);
    getAssetsBySymbol: ((symbol, limit?, cursor?) => Promise<PaginatedEntity<Asset>>);
    getAssetsByType: ((type, limit?, cursor?) => Promise<PaginatedEntity<Asset>>);
    getAuthDescriptorValidator: ((useCache) => AuthDescriptorValidator);
    getBlockHeight: (() => Promise<number>);
    getConfig: (() => Promise<Config>);
    getEnabledRegistrationStrategies: (() => Promise<string[]>);
    getTransferDetails: ((txRid, opIndex) => Promise<TransferDetail[]>);
    getTransferDetailsByAsset: ((txRid, opIndex, assetId) => Promise<TransferDetail[]>);
    getVersion: (() => Promise<string>);
}

Hierarchy (view full)

Properties

blockchainRid: Buffer
client: IClient
getAccountById: ((accountId) => Promise<null | Account>)

Fetches the account with the specified id

Type declaration

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

      • accountId: BufferId

        the id of the account to fetch

      Returns Promise<null | Account>

Returns

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

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

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

Type declaration

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

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

Type declaration

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

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

Type declaration

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

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

Type declaration

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

Retrieves asset information using its id

Type declaration

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

      • assetId: BufferId

        the id of the asset to fetch

      Returns Promise<null | Asset>

Returns

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

getAssetsByName: ((name, limit?, cursor?) => 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: ((symbol, limit?, cursor?) => 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: ((type, limit?, cursor?) => Promise<PaginatedEntity<Asset>>)

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

Type declaration

getAuthDescriptorValidator: ((useCache) => AuthDescriptorValidator)

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

Type declaration

getBlockHeight: (() => Promise<number>)

Returns the current block height of the underlying chain

Type declaration

    • (): Promise<number>
    • Returns Promise<number>

getConfig: (() => Promise<Config>)

Returns the ft config that is currently in effect

Type declaration

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

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

Type declaration

    • (): Promise<string[]>
    • Returns Promise<string[]>

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

Retrieves the details of a transfer

Type declaration

    • (txRid, opIndex): 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: ((txRid, opIndex, assetId) => Promise<TransferDetail[]>)

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

Type declaration

    • (txRid, opIndex, assetId): 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

getVersion: (() => Promise<string>)

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

Type declaration

    • (): Promise<string>
    • Returns Promise<string>