@chromia/ft4 - v2.1.0
    Preparing search index...

    Interface Session

    An object which allows the user to interact with an account by both querying and submitting signed transactions.

    interface Session {
        account: AuthenticatedAccount;
        blockchainRid: Buffer;
        call: (
            ...operations: Operation[],
        ) => Web3PromiEvent<
            TransactionWithReceipt,
            { built: SignedTransaction; sent: Buffer },
        >;
        callWithoutNop: (
            ...operations: Operation[],
        ) => Web3PromiEvent<
            TransactionWithReceipt,
            { built: SignedTransaction; sent: 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>;
        sign: (tx: RawGtx | GTX | SignedTransaction) => Promise<SignedTransaction>;
        signAndSend: (
            tx: RawGtx | GTX | SignedTransaction,
        ) => Promise<TransactionReceipt>;
        transactionBuilder: () => TransactionBuilder;
    }

    Hierarchy (View Summary)

    Index

    Properties

    blockchainRid: Buffer
    call: (
        ...operations: Operation[],
    ) => Web3PromiEvent<
        TransactionWithReceipt,
        { built: SignedTransaction; sent: Buffer },
    >

    Builds and sends a transaction containing the specified operations. This method will also make sure to perform the appropriate authentication and signing of each operation, as well as inserting a nop operation at the end to make each transaction unique. If you don't want the tx to include a nop use callWithoutNop instead.

    Type Declaration

      • (
            ...operations: Operation[],
        ): Web3PromiEvent<
            TransactionWithReceipt,
            { built: SignedTransaction; sent: Buffer },
        >
      • Parameters

        • ...operations: Operation[]

          the operations to include in the transaction

        Returns Web3PromiEvent<
            TransactionWithReceipt,
            { built: SignedTransaction; sent: Buffer },
        >

    callWithoutNop: (
        ...operations: Operation[],
    ) => Web3PromiEvent<
        TransactionWithReceipt,
        { built: SignedTransaction; sent: Buffer },
    >

    Same as call but it does not include a nop at the end. Meaning that subsequent calls to this function with the same arguments is likely to be rejected.

    Type Declaration

      • (
            ...operations: Operation[],
        ): Web3PromiEvent<
            TransactionWithReceipt,
            { built: SignedTransaction; sent: Buffer },
        >
      • Parameters

        • ...operations: Operation[]

          the operations to include in the transaction

        Returns Web3PromiEvent<
            TransactionWithReceipt,
            { built: SignedTransaction; sent: Buffer },
        >

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

    Fetches all AccountAuthDescriptors with satisfy the accountAuthDescriptor filter, paginated

    Type Declaration

    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: (
        accountCreationTransferFilter?: AccountCreationTransferFilter,
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<AccountCreationTransfer>>

    Fetches all AccountCreationTransfers with satisfy the accountCreationTransferFilter filter, paginated

    Type Declaration

    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: (
        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: (
        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: (
        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: (
        accountFilter?: AccountFilter,
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<Account>>

    Fetches all accounts with satisfy the account filter, paginated

    Type Declaration

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

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

    Type Declaration

    getApiVersion: () => Promise<number>

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

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

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

    Type Declaration

    paginated results of applied transfers based on the filter selection

    Available since ApiVersion 1

    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>

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

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

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

    Type Declaration

    paginated results of assets origin based on the filter selection

    Available since ApiVersion 1

    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: (
        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: (
        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: (
        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: (
        authDescriptorSignerFilter?: AuthDescriptorSignerFilter,
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<AuthDescriptorSigner>>

    Fetches all AuthDescriptorSigners with satisfy the authDescriptorSigner filter, paginated

    Type Declaration

    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: (
        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: () => Promise<number>

    Returns the current block height of the underlying chain

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

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

    Type Declaration

    paginated results of canceled transfers based on the filter selection

    Available since ApiVersion 1

    getConfig: () => Promise<Config>

    Returns the ft config that is currently in effect

    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: () => Promise<string[]>

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

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

    Fetches all MainAuthDescriptors with satisfy the mainAccountAuthDescriptor filter, paginated

    Type Declaration

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

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

    Type Declaration

    paginated results of pending transfers based on the filter selection

    Available since ApiVersion 1

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

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

    Type Declaration

    paginated results of recalled transfers based on the filter selection

    Available since ApiVersion 1

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

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

    Type Declaration

    paginated results of reverted transfers based on the filter selection

    Available since ApiVersion 1

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

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

    Type Declaration

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

    Fetches all Subscriptions with satisfy the subscriptionFilter filter, paginated

    Type Declaration

    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[]>

    Details about the transfer

    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[]>

    The transfer details

    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: (
        unappliedTransferFilter?: TransferFilter,
        limit?: number,
        cursor?: OptionalPageCursor,
    ) => Promise<PaginatedEntity<Transfer>>

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

    Type Declaration

    paginated results of unapplied transfers based on the filter selection

    Available since ApiVersion 1

    getVersion: () => Promise<string>

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

    sign: (tx: RawGtx | GTX | SignedTransaction) => Promise<SignedTransaction>

    Signs a transaction using an available key

    Type Declaration

      • (tx: RawGtx | GTX | SignedTransaction): Promise<SignedTransaction>
      • Parameters

        • tx: RawGtx | GTX | SignedTransaction

          the transaction to sign

        Returns Promise<SignedTransaction>

        the original transaction with the appropriate signatures added

    signAndSend: (
        tx: RawGtx | GTX | SignedTransaction,
    ) => Promise<TransactionReceipt>

    Same as sign but it also submits the resulting transaction to the blockchain.

    Type Declaration

      • (tx: RawGtx | GTX | SignedTransaction): Promise<TransactionReceipt>
      • Parameters

        • tx: RawGtx | GTX | SignedTransaction

          the transaction to sign and send

        Returns Promise<TransactionReceipt>

        a receipt with the result of submitting the transaction

    transactionBuilder: () => TransactionBuilder

    Returns a TransactionBuilder instance configured to use the same keys as enclosed in this Session instance.