Class

AssetRules

AssetRules()

When an asset is defined, several options governing the assets must be specified:

  1. Traceable: Records and identities of traceable assets can be decrypted by a provided tracking key. By defaults, assets do not have any tracing policies.
  2. Transferable: Non-transferable assets can only be transferred once from the issuer to another user. By default, assets are transferable.
  3. Updatable: Whether the asset memo can be updated. By default, assets are not updatable.
  4. Transfer signature rules: Signature weights and threshold for a valid transfer. By default, there are no special signature requirements.
  5. Max units: Optional limit on the total number of units of this asset that can be issued. By default, assets do not have issuance caps.
Constructor

# new AssetRules()

See:
  • TracingPolicies for more information about tracing policies.
  • add_operation_update_memo for more information about how to add a memo update operation to a transaction.
  • SignatureRules for more information about co-signatures.
  • add_operation_create_asset for information about how to add asset rules to an asset definition.

View Source pkg/wasm.js, line 727

Methods

# static new() → {AssetRules}

Create a default set of asset rules. See class description for defaults.

View Source pkg/wasm.js, line 746

AssetRules

# add_tracing_policy(policy) → {AssetRules}

Adds an asset tracing policy.

Parameters:
Name Type Description
policy TracingPolicy

Tracing policy for the new asset.

View Source pkg/wasm.js, line 756

AssetRules

# set_max_units(max_units) → {AssetRules}

Set a cap on the number of units of this asset that can be issued.

Parameters:
Name Type Description
max_units BigInt

Maximum number of units that can be issued.

View Source pkg/wasm.js, line 769

AssetRules

# set_transfer_multisig_rules(multisig_rules) → {AssetRules}

Co-signature rules. Assets with co-signatue rules require additional weighted signatures to be transferred.

Parameters:
Name Type Description
multisig_rules SignatureRules

Co-signature restrictions.

View Source pkg/wasm.js, line 812

AssetRules

# set_transferable(transferable) → {AssetRules}

Transferability toggle. Assets that are not transferable can only be transferred by the asset issuer.

Parameters:
Name Type Description
transferable boolean

Boolean indicating whether asset can be transferred.

View Source pkg/wasm.js, line 785

AssetRules

# set_updatable(updatable) → {AssetRules}

The updatable flag determines whether the asset memo can be updated after issuance.

Parameters:
Name Type Description
updatable boolean

Boolean indicating whether asset memo can be updated.

See:
  • add_operation_update_memo for more information about how to add a memo update operation to a transaction.

View Source pkg/wasm.js, line 799

AssetRules