Skip to content
GitHub

Two-phase transfers

Rafiki allows for two-phase transfers, which moves funds in two stages.

  1. Reserve funds (pending)
  2. Resolve funds (post, void, or expire)

The following transactions support two-phase transfers:

  • Asset liquidity withdrawal
  • Peer liquidity withdrawal
  • Incoming payment withdrawal
  • Outgoing payment withdrawal
  • Wallet address withdrawal

When a withdraw-liquidity transaction is requested with a timeout greater than 0, the transaction is processed as a two-phase transfer. A 0 denotes the absence of a timeout.

If the timeout interval passes before the transaction posts or is voided, the transaction expires and the full amount is returned to the original account.

Manage two-phase transfers using the Backend Admin API

Post and commit a successful transfer

mutation PostLiquidityWithdrawal($input: PostLiquidityWithdrawalInput!) {
postLiquidityWithdrawal(input: $input) {
error
success
}
}

Void and roll-back an unsuccessful transfer

mutation VoidLiquidityWithdrawal($input: VoidLiquidityWithdrawalInput!) {
voidLiquidityWithdrawal(input: $input) {
error
success
}
}