Enclave API Documentation
  • Welcome
  • Getting Started
    • Integrations
  • SDK
  • Integrating with Privy
  • Models
    • Passkey Models
    • Transaction Models
    • User Model
    • Smart Balance
  • API Reference
    • Health Check
    • User Details
    • Smart Balance
    • Smart Account Creation
    • Smart Account Transactions
    • Passkey Account Creation
    • Passkey Account Authentication
    • Passkey Account Transactions
    • Session Key
  • COMING SOON
    • SDKs
    • Network Support
    • Protocol Integration
    • Mobile Integration
    • Custom Integration
Powered by GitBook
On this page
  1. API Reference

Smart Account Transactions

Smart accounts linked to EOAs as primary signers

PreviousSmart Account CreationNextPasskey Account Creation

Last updated 6 months ago

  • POSTBuild a transaction for EOA smart account
  • POSTSubmit a signed transaction for EOA smart account
  • POSTCalculate gas fees for EOA smart account transaction

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"
}