PACKAGE
lib.ft4.core.accounts
On this page
Types
- account
- Represents a user profile on a dapp. Multiple users could access this profile,
- account_auth_descriptor
- An entity that allows fine-tuned access control over accounts. It's used to specify
- auth_descriptor
- Used to represent accountauthdescriptor entities before creation.
- auth_descriptor_config
- Represents the auth descriptor configuration found on the chromia.yml file.
- auth_descriptor_signer
- Represents a keypair that has access to an auth descriptor.
- auth_flags_config
- Represents the auth flag configuration found on the chromia.yml file.
- auth_type
- Types of authentication supported for auth descriptors.
- main_auth_descriptor
- The auth descriptor that manages an account.
- module_args
- The configuration defined in the chromia.yml file.
- multi_sig_args
- What the args property of an accountauth descriptor entity or authdescriptor struct
- rate_limit_config
- Represents the rate limit configuration found on the chromia.yml file.
- rl_state
- Rate limiter state, keeping track of whether an account can do more operations.
- rule_expression
- The expression of a single rule.
- rule_operator
- The comparison operator that the auth descriptor rule will use.
- rule_parameters
- Used to simplify rule creation, it describes a rule without the operator.
- rule_variable
- The variables that an auth descriptor rule can check against.
- single_sig_args
- What the args property of an accountauth descriptor entity or authdescriptor struct
Functions
- Account
- Retrieve an account given the id
- AuthDescriptor
- Retrieve an accountauthdescriptor given the id
- account_by_id
- Finds an account based on its ID.
- account_rate_limit_config
- Extend this function to have different rate limiting for different accounts.
- add_auth_descriptor
- Adds an auth descriptor to an account.
- add_rate_limit_points
- Adds rate limit points to an account to allow calling more operations in a short amount
- add_signers
- Associates new signers with an account.
- are_and_rules_violated
- Detects whether any of a list of rule expressions is violated.
- are_rules_active
- Checks whether all the rules in the gtv are active.
- are_rules_violating
- Checks whether any of the rules in the gtv are violated currently.
- auth_descriptor_by_id
- Finds an auth descriptor based on its ID and the account it belongs to.
- block_height
- First step in creating a ruleexpression based on blockheight. Should be passed
- block_time
- First step in creating a ruleexpression based on blocktime. Should be passed
- check_auth_args
- Checks that the multi-sig auth descriptor has all the requirements to authorize an
- check_multi_sig_auth
- Checks that the multi-sig auth descriptor has all the requirements to authorize an
- check_required_flags
- Checks that the set of flags contains all the required flags, which means the auth
- check_single_sig_auth
- Checks that the single signature auth descriptor has all the requirements to authorize an
- create_account_with_auth
- Standard way of creating a user account. Account registration strategies call this function.
- create_account_without_auth
- Creates an account without auth descriptor. Used to create different "system" account types
- create_rate_limiter_state_for_account
- Creates a rate limiter state entity (rlstate) for the specified account
- current_rate_limit_points
- Returns how many rate limit points are available to a certain rlstate given
- delete_all_auth_descriptors_except_main
- Deletes all auth descriptors of an account that are not the main auth descriptor.
- delete_auth_descriptor
- Deletes an auth descriptor that is not a main auth descriptor.
- delete_expired_auth_descriptors
- Deletes all expired auth descriptors associated with an account, except keepauthdesc if
- delete_main_auth_descriptor
- Deletes the main auth descriptor for the account. It does not add a new one, so it leaves
- ensure_account_without_auth
- Finds or creates an account of specific type.
- equals
- Composes a rule from the ruleparameters and the eq operator
- evaluate_int_variable_rule
- Checks whether the rule is valid.
- get_account_id_from_signers
- Default calculation for new account IDs.
- get_auth_descriptor_config
- Retrieves the auth descriptor config
- get_auth_descriptor_data
- Extract info from an accountauthdescriptor in a more accessible format.
- get_auth_descriptors
- Returns all auth descriptors registered to an account.
- get_auth_descriptors_by_signer
- Returns all auth descriptors of which the signer takes part that are registered to
- get_auth_flags_config
- retrieve the settings for auth flags written in the chromia.yml file
- get_flags
- Extracts the flags from an auth descriptor.
- get_flags_from_args
- Extracts the set of flags found in the "args" parameter.
- get_max_allowed_auth_descriptor_rules
- Returns the maximum number of rules that can be composed to limit the duration of
- get_paginated_accounts_by_ad_id
- Retrieves all accounts the given auth descriptor can interact with, paginated.
- get_paginated_accounts_by_signer
- Retrieves all accounts the given signer can interact with, paginated.
- get_paginated_accounts_by_type
- Retrieves all accounts of the given type, paginated.
- get_rate_limit_config
- Returns the rate limit config extracted from the chromia.yml.
- get_rate_limit_config_for_account
- Retrieves the rate limit config to apply to a specific account. Defaults to the value
- get_raw_auth_flags_config
- retrieve the settings for auth flags written in the chromia.yml file, unparsed
- get_signers
- Extracts the signer list from an auth descriptor
- get_signers_from_encoded_auth_descriptor
- Extracts the signer list from an auth descriptor's args
- greater_or_equal
- Composes a rule from the ruleparameters and the ge operator
- greater_than
- Composes a rule from the ruleparameters and the gt operator
- has_flags
- Checks if an accountauthdescriptor has all the specified flags
- have_violating_rules
- Checks if any rules of the given auth descriptor are violated.
- is_active
- Checks whether all the rules of the auth descriptor are active.
- is_block_height_rule_active
- Whether the rule, which is expected to have a blockheight variable, is active.
- is_block_time_rule_active
- Whether the rule, which is expected to have a blocktime variable, is active.
- is_rule_active
- Checks whether the rule expression is active.
- is_rule_violated
- Detects whether a rule expression is violated.
- less_or_equal
- Composes a rule from the ruleparameters and the le operator
- less_than
- Composes a rule from the ruleparameters and the lt operator
- load_variables
- Loads the current value of all possible variables that can appear in an auth descriptor
- map_account
- Maps an account's info into a readable format for the frontend
- map_rule_expressions_from_gtv
- Takes a gtv representation of rules, and converts them into a list of ruleexpressions
- multi_sig_auth_descriptor
- Creates a multi-signature auth descriptor given the arguments with no expiration rules.
- op_count
- First step in creating a ruleexpression based on opcount. Should be passed
- parse_auth_flags
- Parse the values in the gtv as auth flags. Used to retrieve the configuration found in
- rate_limit
- Rate limit an account, i.e. verify that the account is only sending up to as
- require_mandatory_flags
- Checks that the auth descriptor contains all the flags deemed necessary for this dapp.
- require_valid_auth_flags
- Checks that all flags values passed are composed of letters and/or underscores.
- rule_expression_from_gtv
- Takes a GTV representation of one rule, and converts it into a single ruleexpression
- rule_expression_to_gtv
- Takes a single ruleexpression and returns the gtv representation that can be used
- serialize_rules
- Takes a list of ruleexpressions and returns the gtv representation that can be used
- set_main_auth_descriptor
- Sets an auth descriptor as mainauthdescriptor of the account
- single_sig_auth_descriptor
- Creates a single signature auth descriptor given the arguments with no expiration rules.
- update_auth_descriptor_rule_variables
- Updates the counter of the auth descriptor, which should always be increased by one
- update_main_auth_descriptor
- Sets provided auth descriptor as main auth descriptor, deleting the previous one.
- validate_auth_descriptor_args
- Checks if the auth descriptor args correspond to singlesigargs or multisigargs,
- validate_auth_descriptor_rules
- Analyze the rules before assigning them to an auth descriptor, to check that they haven't
- validate_rule
- Checks that the rule is sensible. This means that the rule does not expect:
- variable_value
- Extracts the required variable value from the state
Properties
- GTV_NULL
- The GTV representation of null
- GTV_NULL_BYTES
- The bytearray representation of null
- AUTH_DESCRIPTORS_PER_ACCOUNT_UPPER_BOUND
- Used instead of moduleargs -> authdescriptor.maxnumberperaccount
- ACCOUNT_TYPE_USER
- Constant that represents account type for regular user accounts