Enclave
  • Introducing Enclave Money
    • Enclave Money Protocol
      • Asset Support
      • Network Support
      • Wallet Support
    • Enclave Smart Accounts
      • Security & Recovery
      • MEV Protection
  • Integrate with Enclave Money
    • SDK
      • Integrate with Privy
      • Integrate with Turnkey
    • API Reference
      • Health
      • User
      • Smart Balance
      • Smart Account
      • Passkey Account
      • Delegated Action
  • Applications
  • Business Model
  • Audits
  • Disclaimer
  • Risk Disclosure
Powered by GitBook
On this page
  1. Integrate with Enclave Money
  2. API Reference

Smart Balance

PreviousUserNextSmart Account

Last updated 3 months ago

  • GETGet smart balance for a wallet address
  • POSTGet a quote for converting smart balance between networks
  • POSTCompute solution for smart balance withdrawal

Get smart balance for a wallet address

get
Query parameters
walletAddressanyOptionalExample: 0x123...
Responses
200
Balance retrieved successfully
application/json
400
Invalid wallet address
application/json
500
Internal server error
application/json
get
GET /v3/smartbalance/getbalance HTTP/1.1
Host: 
Accept: */*
{
  "netBalance": "100.50",
  "balances": {
    "10": "50.25",
    "42161": "50.25"
  }
}

Get a quote for converting smart balance between networks

post
Body
anyOptional
Responses
200
Quote generated successfully
application/json
400
Invalid request parameters
application/json
500
Internal server error
application/json
post
POST /v3/smartbalance/getquote HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 94

{
  "walletAddress": "0x123...",
  "outputNetwork": 42161,
  "amount": "50.00",
  "type": "debit",
  "limit": 100
}
{
  "quote": {
    "amount": "50.00",
    "fee": "0.50",
    "total": "50.50"
  }
}

Compute solution for smart balance withdrawal

post
Body
anyOptional
Responses
200
Solution computed successfully
application/json
400
Missing required fields
application/json
500
Internal server error
application/json
post
POST /v3/smartbalance/computesolution HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 82

{
  "walletAddress": "0x123...",
  "amount": "50.00",
  "type": "debit",
  "outputNetwork": 42161
}
{
  "withdrawalPlan": {
    "network": 42161,
    "amount": "50.00"
  },
  "tokenToClaim": {
    "address": "0x123...",
    "amount": "50.00"
  },
  "transactions": {
    "claim": {
      "encodedData": "0x...",
      "targetContractAddress": "0x..."
    },
    "withdrawal": {
      "encodedData": "0x...",
      "targetContractAddress": "0x..."
    }
  },
  "signatures": {
    "paymaster": "0x...",
    "withdrawal": "0x..."
  }
}