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 Account

PreviousSmart BalanceNextPasskey Account

Last updated 3 months ago

  • POSTCreate EOA-based smart accounts
  • POSTBuild a transaction for EOA smart account
  • POSTSubmit a signed transaction for EOA smart account
  • POSTCalculate gas fees for EOA smart account transaction

Create EOA-based smart accounts

post
Body
eoaAddressstringRequired

The EOA address to create smart accounts for

Responses
200
Smart accounts created successfully
application/json
post
POST /smart-account/create HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 59

{
  "eoaAddress": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"
}
200

Smart accounts created successfully

{
  "username": "550e8400-e29b-41d4-a716-446655440000",
  "wallet": {
    "type": "EOA",
    "scw_address": "0x123...",
    "multi_scw": [
      {
        "network": 8453,
        "address": "0x123...",
        "deployed": false
      }
    ],
    "eoa_address": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"
  }
}

Build a transaction for EOA smart account

post
Body
networkstringRequired
walletAddressstringRequired
paymasterDatastringOptional
signModestringOptional
Responses
200
Transaction built successfully
application/json
400
Invalid request parameters
500
Internal server error
post
POST /smart-account/transaction/build HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 258

{
  "transactionDetails": [
    {
      "encodedData": "0xa9059cbb000000000000000000000000...",
      "targetContractAddress": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
      "value": "0"
    }
  ],
  "network": "8453",
  "walletAddress": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
  "signMode": "ECDSA"
}
{
  "userOp": {
    "sender": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
    "nonce": "0",
    "initCode": "0x",
    "callData": "0xa9059cbb...",
    "callGasLimit": "100000",
    "verificationGasLimit": "100000",
    "preVerificationGas": "21000",
    "maxFeePerGas": "1000000000",
    "maxPriorityFeePerGas": "100000000"
  },
  "messageToSign": "0x1234...",
  "signMode": "ECDSA"
}

Submit a signed transaction for EOA smart account

post
Body
signaturestringRequired
walletAddressstringRequired
signatureTypestringOptional
Responses
200
Transaction submitted successfully
application/json
post
POST /smart-account/transaction/submit HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 114

{
  "signature": "0x1234abcd...",
  "walletAddress": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
  "signatureType": "ECDSA"
}
200

Transaction submitted successfully

{
  "userOpHash": "0x1234...",
  "txnHash": "0x5678...",
  "success": true
}

Calculate gas fees for EOA smart account transaction

post
Body
networkstringRequired
walletAddressstringRequired
Responses
200
Gas fees calculated successfully
application/json
400
Invalid request parameters
500
Internal server error
post
POST /smart-account/transaction/gas-fees HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 133

{
  "transactionDetails": [
    {
      "encodedData": "text",
      "targetContractAddress": "text",
      "value": "text"
    }
  ],
  "network": "text",
  "walletAddress": "text"
}
{
  "result": "text"
}