-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Problem
AssetTransferInstructions includes totalReceiveAmount (the amount the recipient will receive after fees), but there is no field indicating which asset that amount is denominated in.
For same-asset transfers (e.g., USDC -> USDC), this is implicitly understood. However, for cross-asset transfers (e.g., USDC -> USDT, BRL -> USDC), the consumer has no way to know which asset totalReceiveAmount refers to.
Existing pattern
AssetFeeBreakdown already solves this problem for fees:
{
"assetFee": {
"lineItems": [{ "value": "2000", "purpose": "VALUE_VARIABLE", "asset": "$USDC" }],
"totalPricedIn": "$USDC",
"total": "2000"
}
}total is the amount, and totalPricedIn identifies the asset.
Proposal
Add a companion field to totalReceiveAmount that identifies the asset, following the same pattern as fees. For example:
// In AssetTransferInstructions (common.ts L586-602)
{
assetFee: string | AssetFeeBreakdown;
totalReceiveAmount?: string;
totalReceiveAmountAsset?: MovableAssetSearchCanonical; // <-- new field
}Naming options
| Option | Pros | Cons |
|---|---|---|
totalReceiveAmountAsset |
Explicit, directly pairs with totalReceiveAmount |
Verbose |
receiveIn |
Concise, mirrors totalPricedIn concept |
Less explicit about what it pairs with |
totalReceiveAmountPricedIn |
Consistent with totalPricedIn naming |
Very verbose |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels