You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(platform-wallet): optional max fee on shielded and Platform address withdrawals #5698
The SDK's withdrawal calls work out their fee internally, and the caller can't cap it. A wallet can show the user a fee and authorize it, then pay more if the fee rises between that check and the call.
PlatformWalletManager.shieldedWithdraw(walletId:resolver:account:toCoreAddress:amount:coreFeePerByte:) (rs-platform-walletshielded::operations::withdraw) picks the notes and prices the bundle inside the call. If notes are spent elsewhere after the caller priced the payment, the selector can pick more notes and charge up to a full bundle's fee.
ManagedPlatformAddressWallet.withdraw(accountIndex:coreAddress:inputs:coreFeePerByte:signer:) computes the transition fee at execution. The caller's preflight estimatedFee is advisory only.
dashwallet-ios#1117 pays DashPay contacts from Platform and Shielded through these calls. It now re-prices the fee before the PIN, before reserving the contact's address, and immediately before the SDK call, and refuses the payment if the fee rose. The last check is still only a snapshot taken just before the call, so the gap is narrow but can't be closed in the app. It is marked TODO(shielded-withdraw-fee-cap) there.
Request
Add an optional maximum fee (credits) to both withdrawal calls, through Rust, the FFI and Swift. The call fails with a typed error, before anything is broadcast and with the notes or inputs released, when the fee it would charge exceeds that maximum. That error should count as definitely not submitted, like BroadcastFailed, so callers can safely retry.
Related, but optional: the app also mirrors the PV14 contact-withdrawal rules (the 1,000-duff floor and the 190-duff Core fee carved out by try_into_asset_unlock_base_transaction_info_v1) to gross up the amount. A call that takes the amount the recipient should receive, and returns or enforces the gross amount and fee it uses, would let wallets stop hard-coding those rules.
Activity
docs(dashpay): link the withdrawal fee-cap TODO to dashpay/platform#5698