Skip to main content

Full Pallet API Reference - v8.1.3 to v8.2.1

Every structural API change between Polymesh chain v8.1.3 and v8.2.1. It complements the narrative pages in the v8.1.3 → v8.2.1 changelog. This reference was produced by comparing the v8.1.3 metadata of the live networks with the v8.2.0 metadata snapshots, then adding the v8.2.1 changes. Items new in v8.2.1 are marked (v8.2.1); the v8.2.0 → v8.2.1 delta is summarized in What Changed in v8.2.1.

Scope:

  • transaction_version is unchanged at 8. Existing signing code needs no update, apart from the new transaction extension for signers that hard-code the list.
  • Mainnet gains two pallets, WorkerModules (60) and ConfidentialAssets (70). Testnet and Develop gain WorkerModules, and their existing ConfidentialAssets pallet changes in ways that are not backwards compatible.
  • In every other pallet, everything is appended, so existing call, event and error indices are unchanged. Nothing is removed or renamed outside ConfidentialAssets.
  • pallet-precompiles adds nothing to metadata. Precompile changes are in Precompile Changes.

Summary​

PalletCallsEventsErrorsConstantsStorage
ConfidentialAssets5 added, 4 changed (Testnet)7 added12 added, 1 removed, indices shift (Testnet)3 added, 1 changed6 added, 1 changed, 1 removed (Testnet)
WorkerModulesNew pallet (4)New pallet (4)New pallet (8)—New pallet (5)
ExternalAgents——1 added—1 added
MultiSig——1 added——
Nft1 added1 added2 added—1 added
Portfolio——1 added——
Settlement——1 added——
Validators————1 added

On Mainnet, every ConfidentialAssets item is new. The "changed" and "removed" entries apply to Testnet and Develop.

Storage versions: pallet-validators 1 → 2, migrated automatically. pallet-confidential-assets is at version 1: on Testnet and Develop its 0 → 1 migration ran at v8.2.0, and on Mainnet the pallet is new. See the overview.

Several calls change behaviour or cost without a signature change. See Behaviour changes without a signature change.


ConfidentialAssets​

Pallet index 70. New on Mainnet. See Confidential Assets for the behaviour, and the Confidential Assets documentation for how the calls fit together.

Calls​

The complete call list, for Mainnet integrators:

IndexCallChange since v8.1.3 (Testnet)
0register_accounts
1register_encryption_keys
2create_assetNow checks role claims
3register_account_assets
4mint_asset
5create_settlementLeg limit, frozen-asset check
6sender_affirmation
7receiver_affirmation
8mediator_affirmationArgument type changed
9sender_update_counter
10sender_revert_affirmation
11receiver_revert_affirmation
12receiver_claim
13batched_settlementProofs bound to the signer (v8.2.1)
14register_fee_accounts
15topup_fee_accounts
16submit_batched_proofsArgument type changed; proofs bound to the signer (v8.2.1)
17relayer_submit_batched_proofsArgument type changed; must be top-level
18execute_instant_settlementArgument type changed; proofs bound to the signer (v8.2.1)
19instant_sender_affirmation
20instant_receiver_affirmation
21set_required_claimAdded
22remove_required_claimAdded
23distribute_encryption_keyAdded
24update_asset_keysAdded
25set_asset_frozenAdded

All proofs must come from DART v1.0.1, so every proof-carrying call needs new client code on Testnet, whether or not its argument type changed. Calls 13, 16 and 18 verify every proof in the batch under non_relayer_batch_proof_context(signer): the SCALE encoding of (b"polymesh/dart/submission/v1", 2u8, account_id). Call 17 binds to the fee nullifier, as in v8.2.0. See Proof submission contexts.

The added calls:

CallArgumentsOrigin
set_required_claimrole: RoleKind, claim: Claim, trusted_issuers: BoundedVec<IdentityId>Root
remove_required_claimrole: RoleKindRoot
distribute_encryption_keyproof: KeyDistributionProofSigned, Auditor claim
update_asset_keysasset_id: u32, mediators: BoundedBTreeMap<AccountPublicKey, EncryptionPublicKey>, auditors: BoundedBTreeSet<EncryptionPublicKey>Asset issuer
set_asset_frozenasset_id: u32, frozen: boolAsset issuer or Root

RoleKind is AssetCreator, Auditor or Mediator. FreezeOrigin is Issuer or Root.

Events​

Added at the end of the enum:

IndexEventFields
26RequiredClaimSetrole: RoleKind, claim: Claim, trusted_issuers: BoundedVec<IdentityId>
27RequiredClaimRemovedrole: RoleKind
28EncryptionKeyDistributedcaller_did: IdentityId, encryption_key: EncryptionPublicKey, proof: KeyDistributionProof
29AssetFrozenasset_id: u32, freeze_origin: FreezeOrigin
30AssetUnfrozenasset_id: u32, unfreeze_origin: FreezeOrigin
31AccountStateUpdated (v8.2.1)leaf_index: u32, account_commitment: AccountStateCommitment, update_action: AccountStateUpdateAction
32FeeAccountStateUpdated (v8.2.1)leaf_index: u32, fee_account_commitment: FeeAccountStateCommitment, update_action: FeeAccountStateUpdateAction

AssetStateLeafUpdated is now emitted after every asset leaf write, including key updates and freezes.

AccountStateLeafInserted (17) and FeeAccountStateLeafInserted (18) are deprecated in favour of AccountStateUpdated and FeeAccountStateUpdated. They are still emitted, unchanged, immediately before the new events. See Account-state update events for the update_action variants.

Errors​

Testnet and Develop: InsufficientFeePaymentAmount (previously index 6) is removed, and errors previously at indices 7 to 45 move down by one. Decoders that work by index must be regenerated.

New errors, at the end of the list:

IndexErrorRaised when
45MissingLegMediatorsThe mediators for a settlement leg are missing
46EncryptionKeyMismatchAn encryption key does not match the key registered for the account
47MissingRequiredClaimAn identity lacks the claim required for a role
48NoKeyRecipientsdistribute_encryption_key names no recipients
49TooManySharedKeyRecipientsIt names more than MaxSharedKeyRecipients
50EncryptionKeyNotSharedA mediator's encryption key is neither its own nor shared with it
51AssetIsFrozenA new settlement names a frozen asset
52AssetFrozenByRootThe issuer tries to change a Root freeze
53AssetIdOverflowNo more confidential asset ids are available
54TooManyProofsA registration or proof batch exceeds its limit
55RelayerCallMustBeTopLevelrelayer_submit_batched_proofs is nested inside another call
56SettlementLegCountMismatchThe leg count given with a batched proof does not match the settlement

Constants​

ConstantValueChange
MaxFeeAccountCurveTreeRootAge14,400,000 ms (4 hours)Was 172,800,000 ms (2 days)
MaxRelayerCommission10 POLYXAdded
MaxSharedKeyRecipients5Added
MaxTrustedClaimIssuers2Added

Other limits are unchanged and identical on all three networks: at most 2 auditors and 2 mediators per asset, 10 legs per settlement, 10 proofs per batch, and root ages of 24 hours (assets) and 2 days (accounts).

Storage​

ItemShapeChange
RequiredClaimsRoleKind → RequiredClaimAdded
SharedKeyRecipientsEncryptionPublicKey → BoundedBTreeSet<EncryptionPublicKey>Added
AssetFrozenu32 → FreezeOriginAdded
LegMediators(SettlementRef, u8) → LegMediatorKeysAdded
CachedDartParametersVersionProtocolVersionAdded
RelayerSubmitExtensionMarker()Added (transient, used by the transaction extension)
Keysu32 → AssetKeysValue type changed (Testnet)
FeeAccountRegistrationsRemoved (Testnet)

After finalization, a settlement keeps only its SettlementState entry. Its legs, memo, affirmation status, counters and LegMediators entries are removed.

Client helper​

pallet_confidential_assets::non_relayer_batch_proof_context(account) → Vec<u8> (v8.2.1) is a Rust helper, not a runtime call. It returns the context bytes for proofs submitted through batched_settlement, submit_batched_proofs and execute_instant_settlement by account. Clients in other languages can compute the same SCALE encoding.

Runtime API​

ConfidentialAssetsApi::relayer_submit_batched_fee_info(batch: BatchedProofs) → RelayerSubmitBatchedFeeInfo { weight, fee } returns the dispatch weight, including transaction extensions, and the full transaction fee of a relayer_submit_batched_proofs transaction for the batch.


WorkerModules​

Pallet index 60. New on every network. All calls require Root. See Worker Modules and Node Changes.

Calls​

IndexCallArguments
0register_protocolprotocol_id: ProtocolId, metadata: ProtocolMetadata
1upload_protocol_module_codeprotocol: Protocol, code: BoundedVec<u8>, module_version: u32
2upload_protocol_module_contextprotocol: Protocol, context: BoundedVec<u8>
3upload_protocol_module_configconfig: ProtocolModuleConfig

Events​

EventFields
ProtocolRegisteredprotocol_id: ProtocolId, metadata: ProtocolMetadata
ProtocolModuleCodeUploadedprotocol: Protocol, code: BoundedVec<u8>, code_hash: BackendCodeHash
ProtocolModuleContextUploadedprotocol: Protocol, context: BoundedVec<u8>, context_hash: BackendContextHash
ProtocolModuleConfigUploadedprotocol: Protocol, config: ProtocolModuleConfig, config_hash: ProtocolModuleConfigHash

The code and context events carry the full uploaded bytes, up to several MiB.

Errors​

ProtocolAlreadyRegistered, ProtocolNotRegistered, InvalidProtocolMetadata, ProtocolModuleCodeAlreadyExists, ProtocolModuleContextAlreadyExists, ProtocolModuleConfigAlreadyExists, ModuleCodeMissing, ModuleContextMissing.

Storage​

ItemShape
MetadataProtocolId → ProtocolMetadata
ProtocolConfigHashProtocol → ProtocolModuleConfigHash (the active config)
ProtocolConfig(Protocol, ProtocolModuleConfigHash) → ProtocolModuleConfig
ProtocolCode(Protocol, BackendCodeHash) → BoundedVec<u8>
ProtocolContext(Protocol, BackendContextHash) → BoundedVec<u8>

Limits are set in the runtime: module code up to 3 MiB, context up to 2 MiB, and up to 8 modules per configuration.


ExternalAgents​

KindItemDetail
ErrorStaleAuthorization (8)A BecomeAgent authorization was issued before the target was last removed as an agent of the asset
StorageAgentAuthCutoff(AssetId, IdentityId) → u64: the authorization id at the time of the agent's last removal. Default 0

MultiSig​

KindItemDetail
ErrorDuplicateSigners (25)create_multisig, add_multisig_signers or add_multisig_signers_via_admin lists an account twice

Nft​

KindItemDetail
Callset_nfts_frozen (8)holder: AssetHolder, nfts: NFTs, frozen: bool. Agent of the collection
EventNFTsFrozenStatusUpdated (7)caller_did: IdentityId, holder: AssetHolder, nfts: NFTs, frozen: bool
ErrorInvalidNFTTransferNFTIsFrozen (32)A transfer, settlement execution or report includes an NFT frozen for the sender
ErrorNFTIsFrozen (33)Locking (affirming) or redeeming an NFT frozen for its holder
StorageFrozenNFT(AssetId, AssetHolder, NFTId) → bool. Default false

See NFT Freezing.

Portfolio​

KindItemDetail
ErrorInvalidTransferNFTIsFrozen (24)move_portfolio_funds includes an NFT frozen for the source

Settlement​

KindItemDetail
ErrorInstructionHasNoLegs (61)An instruction is created with no legs

Validators​

KindItemDetail
StorageIdentityValidatorStashes(IdentityId, AccountId32) → (): the stashes of each identity that are validating. Filled by the 1 → 2 migration

Transaction extensions​

CheckRelayerSubmitBatchedProofs is added after CheckMetadataHash and before SetOrigin, on every runtime. Its explicit and implicit data are (), so it adds no bytes to the extrinsic or the signed payload. See Other Runtime Changes.

Runtime APIs​

ConfidentialAssetsApi is new, with one method, relayer_submit_batched_fee_info. No other runtime API changes its version or signature.

The NFT transfer report behind NFTApi and the settlement report APIs now returns every applicable ownership error, rather than only the first. See NFT Freezing.

Behaviour changes without a signature change​

CallChange
Nft::controller_transfer, Nft::controller_transfer_toUnfreeze the NFTs they take, emitting NFTsFrozenStatusUpdated first
Nft::transfer_nft, Nft::redeem_nft, Settlement::* affirm and execute, Portfolio::move_portfolio_fundsRefuse NFTs frozen for the sender
MultiSig::remove_multisig_signers, remove_multisig_signers_via_adminOutdate pending authorizations for the removed keys
ExternalAgents::remove_agent, abdicateRecord an authorization cutoff for the removed agent
Identity::remove_authorizationAccepts outdated authorizations
Settlement affirmation countsCount a leg on both sides when the holders include its sender and receiver
Settlement NFT transfersFail if the receiving portfolio does not exist
Portfolio::accept_portfolio_custodyFails if the portfolio does not exist
Asset::set_asset_metadata, set_asset_metadata_detailsRefuse to lock an empty value
Committee votingA motion needs at least one vote; removed members lose all their votes
Validators::remove_permissioned_validatorChills the identity's validating stashes
Relayer subsidiesRelayer calls are self-paid before the subsidy allowance is checked
Asset::redeem, controller_transfer, controller_transfer_to, CapitalDistribution::claim, push_benefitDeclare worst-case weight and refund the difference

See Other Runtime Changes for each.