Palindrome Crypto Pay - Blockchain Escrow Payment Solution

Signatures (EIP-712)

signWalletAuthorization

async signWalletAuthorization(
  walletClient: WalletClient,
  walletAddress: Address,
  escrowId: bigint
): Promise<Hex>

Signs an EIP-712 typed message authorizing a participant (buyer, seller, or arbiter) for the escrow's 2-of-3 multisig wallet. This signature is required for deposits, confirmations, and withdrawals.

Parameters

  • walletClient: WalletClient – The participant's connected wallet
  • walletAddress: Address – The escrow's dedicated wallet address
  • escrowId: bigint – The escrow ID

Returns

Promise<Hex> – 65-byte EIP-712 signature

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

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

// Get escrow to find wallet address
const escrow = await sdk.getEscrowByIdParsed(42n);

try {
  const signature = await sdk.signWalletAuthorization(
    walletClient,
    escrow.wallet,
    42n
  );

  console.log("Wallet authorization signature:", signature);
  // 0x1234...abcd (130 hex chars + 0x prefix = 132 total)

} catch (error: any) {
  console.error("Signing failed:", error.message);
}

Signature Structure (EIP-712)

// Domain
{
  name: "PalindromeEscrowWallet",
  version: "1",
  chainId: 84532,  // Base Sepolia
  verifyingContract: walletAddress
}

// Types
{
  WalletAuthorization: [
    { name: "escrowId", type: "uint256" },
    { name: "wallet", type: "address" },
    { name: "participant", type: "address" }
  ]
}

// Message
{
  escrowId: 42n,
  wallet: "0xEscrowWallet...",
  participant: "0xYourAddress..."
}

When It's Used

This signature is automatically generated by other SDK methods:

MethodWho Signs
createEscrow()Seller
createEscrowAndDeposit()Buyer
deposit()Buyer
acceptEscrow()Seller
confirmDelivery()Buyer
requestCancel()Buyer or Seller
submitArbiterDecision()Arbiter

Manual Usage

You typically don't need to call this directly — the SDK handles it. But for custom flows:

// Predict wallet before escrow exists
const nextId = await sdk.getNextEscrowId();
const predictedWallet = await sdk.predictWalletAddress(nextId);

// Pre-sign authorization
const sig = await sdk.signWalletAuthorization(
  walletClient,
  predictedWallet,
  nextId
);

// Use in custom contract call
await contract.write.customFunction([escrowId, sig]);

See alsopredictWalletAddress() · deposit()

Previous
predictWalletAddress