Palindrome Crypto Pay - Blockchain Escrow Payment Solution

Wallet & Withdrawal

withdraw

async withdraw(
  walletClient: WalletClient,
  escrowId: bigint
): Promise<Hex>

Withdraws funds from an escrow wallet. The SDK automatically determines the token, amount, and destination based on the escrow state and caller. Requires proper authorization (2-of-3 multisig).

Parameters

  • walletClient: WalletClient – Authorized signer's wallet
  • escrowId: bigint – The escrow ID

Returns

Promise<Hex> – Transaction hash

import { createPalindromeSDK } from '@/lib/createSDK';

const { sdk, walletClient } = await connectAndInitSDK();

try {
  const txHash = await sdk.withdraw(walletClient, 42n);

  console.log("Withdrawal successful!");
  console.log("Transaction:", txHash);

} catch (error: any) {
  if (error.message.includes("not authorized")) {
    alert("You are not authorized to withdraw from this escrow");
  } else if (error.message.includes("insufficient balance")) {
    alert("Insufficient balance in escrow wallet");
  } else {
    console.error("Withdrawal failed:", error.shortMessage || error.message);
  }
}

When Can You Withdraw?

Escrow StateWho Can Withdraw
COMPLETESeller (minus fee)
REFUNDEDBuyer (full amount)
CANCELEDBuyer (full amount)
Previous
getDisputeMessages