Contract 6eb77143bed4d5cca8def5d4fa96997e67d48520285ac7cd79cde97d13d8be3d

← Back to Index 📥 Download WASM

Meta

desc Tael per-call settlement: pay a capability builder + the Tael fee atomically in one transaction.
rssdkver 27.0.2#45d378a6cb4a026d23fc7286b6ee3add9c9dd0b9
rsver 1.97.1

Instances

  • CA4FKYXKEBHG4WWYECUUTYQ6PVZO4HDQMCMCM65C64WRNULNUOPBZFER

Interface

Settle one capability call.

Moves amount of token from payer to builder (the capability's payout) and fee of token from payer to fee_to (Tael's fee wallet), atomically. payer must authorize the call, so no one can move an agent's funds without its Card's signature. A settle event is emitted with the full breakdown.

  • token - the token contract address (the USDC Stellar Asset Contract)
  • payer - the agent's Card (funds source; must authorize)
  • builder - the capability builder's payout address
  • fee_to - Tael's fee wallet
  • amount - the builder's share (must be > 0)
  • fee - Tael's fee (>= 0; skipped if 0)
fn settle(
    env: soroban_sdk::Env,
    token: soroban_sdk::Address,
    payer: soroban_sdk::Address,
    builder: soroban_sdk::Address,
    fee_to: soroban_sdk::Address,
    amount: i128,
    fee: i128,
) -> Result<(), soroban_sdk::Error>

Imports

WebAssembly Text (WAT) ▶