Skip to content

Add expiry trigger for expired AmuletTransferInstructions #3381

@meiersi-da

Description

@meiersi-da

Keeps the ACS size low, and improves the UX, as users don't have to take an action to clean them up.

Relevant code:

  • -- | A transfer instruction for transferring Amulet tokens pending on receiver
    -- acceptance.
    template AmuletTransferInstruction
    with
    lockedAmulet : ContractId LockedAmulet -- ^ Locked amulet that holds the funds for executing the transfer upon acceptance
    transfer : Splice.Api.Token.TransferInstructionV1.Transfer
    where
  • -- | A specification of a transfer of holdings between two parties.
    data Transfer = Transfer with
    sender : Party
    -- ^ The sender of the transfer.
    receiver : Party
    -- ^ The receiver of the transfer.
    amount : Decimal
    -- ^ The amount to transfer.
    instrumentId : InstrumentId
    -- ^ The instrument identifier.
    requestedAt : Time
    -- ^ Wallet provided timestamp when the transfer was requested.
    -- MUST be in the past when instructing the transfer.
    executeBefore : Time
    -- ^ Until when (exclusive) the transfer may be executed. MUST be in the
    -- future when instructing the transfer.
    --
    -- Registries SHOULD NOT execute the transfer instruction after this time,
    -- so that senders can retry creating a new transfer instruction after this time.
    inputHoldingCids : [ContractId Holding]
    -- ^ The holding contracts that should be used to fund the transfer.
    --
    -- MAY be empty if the registry supports automatic selection of holdings for transfers
    -- or does not represent holdings on-ledger.
    --
    -- If specified, then the transfer MUST archive all of these holdings, so
    -- that the execution of the transfer conflicts with any other transfers
    -- using these holdings. Thereby allowing that the sender can use
    -- deliberate contention on holdings to prevent duplicate transfers.
    meta : Metadata
    -- ^ Metadata.
    deriving (Show, Eq)

Determine expiry based on transfer.executeBefore.

Make sure to include it in release notes to avoid surprises for users.

@ray-roestenburg-da @OriolMunoz-da : this slipped our attention when implementing transfer support. If you could slip that in sometime (e.g., as a tech-debt item), then that would be great.

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions