Skip to content

Conversation

@Neopallium
Copy link
Contributor

@Neopallium Neopallium commented Dec 19, 2025

changelog

new features

  • Add support for account based asset transfers.

new external API

  • Added extrinsics transfer_asset and receiver_affirm_asset_transfer to the Asset pallet.

new events

  • Added events Transferred { asset_id: AssetId, from: AccountId, to: AccountId, amount: u128, memo: Option<Memo> } and TransferPending { pending_transfer_id: PendingTransferId, asset_id: AssetId, from: AccountId, to: AccountId, amount: u128, memo: Option<Memo> } to the Assets pallet.

@Neopallium Neopallium changed the title [WIP] Add account key base asset transfer support. Add account key base asset transfer support. Dec 19, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for account-based asset transfers by introducing new extrinsics transfer_asset and receiver_affirm_asset_transfer to the Asset pallet. The implementation leverages the settlement engine to handle transfers between default portfolios, with support for receiver affirmations when required.

Key changes include:

  • New settlement trait (SettlementFnTrait) providing a unified interface for asset and NFT transfers
  • Modified WeightMeter::from_limit API to auto-adjust limits instead of returning errors
  • New pending transfer storage and events for tracking transfers awaiting receiver affirmation

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
primitives/src/weight_meter.rs Changed from_limit to return Self instead of Result, auto-adjusting limit when below minimum
primitives/src/traits/settlement.rs New trait defining settlement functions for transferring fungible and non-fungible assets
primitives/src/traits.rs Added exports for the new settlement trait module
pallets/weights/src/pallet_asset.rs Added weight functions for the new transfer extrinsics
pallets/settlement/src/lib.rs Implemented SettlementFnTrait, added new error type, and updated weight meter validation
pallets/runtime/common/src/runtime.rs Configured the Asset pallet to use the Settlement pallet for transfers
pallets/asset/src/lib.rs Added new extrinsics, events, storage, and implementation for account-based asset transfers
pallets/asset/src/benchmarking.rs Added benchmarks for new transfer functions and updated existing benchmarks with new parameter
pallets/sto/src/benchmarking.rs Updated benchmark calls with new move_to_sender_portfolio parameter
pallets/settlement/src/benchmarking.rs Updated benchmark calls with new move_to_sender_portfolio parameter

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants