Module-level declarations

Queries

Link copied to clipboard
@mount("ft4.get_lock_accounts") query get_lock_accounts(account_id: byte_array): list<(id: byte_array, type: text)>

Retrieves all lock accounts for the specified account.

Note: Lock accounts are created lazily, so if the account has not yet used a lock account of a certain type, it will not be present in the list. Consequently, the list might be empty.

Link copied to clipboard
@mount("ft4.get_lock_accounts_with_non_zero_balances") query get_lock_accounts_with_non_zero_balances(account_id: byte_array): list<(id: byte_array, type: text)>

Same as get_lock_accounts() but if the account does not have any assets in in anymore, it will be omitted from the resulting list.

Link copied to clipboard
@mount("ft4.get_locked_asset_aggregated_balance") query get_locked_asset_aggregated_balance(account_id: byte_array, asset_id: byte_array, types: list<text>?): big_integer

Retrieves the total locked sum of the specified asset over various lock types, given the account that locked them. The returned value adds up the values that were locked, regardless of the lock type, for a single asset.

Link copied to clipboard
@mount("ft4.get_locked_asset_aggregated_balances") query get_locked_asset_aggregated_balances(account_id: byte_array, types: list<text>?, page_size: integer?, page_cursor: text?): paged_result

Similar to get_locked_asset_aggregated_balance, except that it allows retrieving the info for all locked assets.

Link copied to clipboard
@mount("ft4.get_locked_asset_balance") query get_locked_asset_balance(account_id: byte_array, asset_id: byte_array, types: list<text>?, page_size: integer?, page_cursor: text?): paged_result

Retrieves all balances of a certain asset that were locked from a certain account. Paginated, the returned data is a list of tuples containing the amount and a lock type label: list<(lock type, amount)>

Link copied to clipboard
@mount("ft4.get_locked_asset_balances") query get_locked_asset_balances(account_id: byte_array, types: list<text>?, page_size: integer?, page_cursor: text?): paged_result

Similar to get_locked_asset_balance, except that it allows retrieving the info for all locked assets.