Module-level declarations
Types
The configuration for this module, to be defined in the chromia.yml
Represents an account's subscription, used to maintain the account active
Functions
Calculates the account details for the account that will be registered using the ft4.ras_transfer_subscription
strategy.
Returns a list of operations that are considered free on this chain
Returns the ID of the account that receives the fee payments, or null for the default one
To get the account, the proper usage is:
val account = transfer.ensure_chain_fee_account(subscription_account_id());
Returns the assets configured in module_args.asset
.
Returns the number of days a subscription lasts
The action
for the subscription _strategy
. Transfers the funds to the account, paying the fee and creating a subscription
entity for the given account.
Throws "FORBIDDEN ASSET"
if the asset:
cannot be used to pay the fee, or
is not found.
Throws if the transfer cannot be executed. Common cases are:
an account with the fee account ID exists, but it's not of
transfer.ACCOUNT_TYPE_FEE
Throws if the chain configuration cannot be parsed.
Queries
Returns a list of assets that can be used to pay for the subscription fee, alongside the amount to be paid.
Returns details about the subscription of the specified account, including the asset ID, the total duration of the subscription and the timestamp of the last payment.
Throws if the account does not exist.
Throws "MISSING SUBSCRIPTION"
if no subscription was found for the account.
Returns the number of milliseconds that take for a subscription to expire.
Operations
The operation that defines this strategy. The subscription strategy allows users to register a new account by paying a recurring fee. It does not grant the account any additional benefits.
Throws if the next operation in the transaction is not accepted by require_register_account_next_operation
Renews the subscription for an account by paying from that account with the given asset.
Must be signed by an auth descriptor with the accounts.AUTH_FLAG_TRANSFER
.
Throws "MISSING SUBSCRIPTION"
if the account does not have a subscription.
Throws "INPUT ERROR"
if the asset cannot be used to pay the fees.
Throws if the transfer cannot be executed. Common cases are:
the account does not have enough funds
an account with the fee account ID exists, but it's not of
transfer.ACCOUNT_TYPE_FEE