/account-abstraction/operations

You need an API key for this call. Please reach out to the Blessnet team to get setup.

POST/account-abstraction/operations

The /account-abstraction/operations endpoint allows the posting of ERC-4337 operations to abstract accounts via the singleton on-chain entrypoint.

Headers

Name
Value

x-api-key

Your API key

Params

Name
Mandatory?
Default
Value

chain

No

mainnet

The chain type we are working with, either mainnet or sepolia

Request Body

  • required: true

  • content: application/json:

  • schema:

    • type: array

    {
      "ops": [
        {
          "account": <the account the operations is for>,
          "target": <the address target for the call>,
          "calldata": <the calldata to pass to the target>,
        }
      ]
    }
  • description: An array of valid operations.

Response Body

Name
Type
Description

message

string

Message response from the endpoint

requestOwner

array

The owner of the API key that made the operation request.

for

array

Array of operations requested, with account, target and calldata for each

destinationChain

number

The target chain for the operation

deliveryIds

string[]

Unique Ids for the execution of the operations.

Example Request

POST /account-abstraction/operations?chain=sepolia HTTP/1.1
Host: api.bless.net
x-api-key: <>
Content-Type: application/json
Content-Length: 763

{
  "ops": [
    {
      "account": "0xa8C46f79c72DbfE885e54b5527002c515F860875",
      "target": "0x4995423334127293b31d8c810Bb183809f82Be55",
      "calldata": "0x62a61351000000000000000000000000a8C46f79c72DbfE885e54b5527002c515F860875000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
    }
  ]
}

Response

{
    "message": "Ops requested",
    "requestOwner": "omnus",
    "for": [
        {
            "account": "0xa8C46f79c72DbfE885e54b5527002c515F860875",
            "target": "0x4995423334127293b31d8c810Bb183809f82Be55",
            "calldata": "0x62a61351000000000000000000000000a8C46f79c72DbfE885e54b5527002c515F860875000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
        }
    ],
    "destinationChain": 11145513,
    "deliveryIds": ["67c8c05d179b8cbc49505f4e"]
}

Example uses

import ethers from "ethers"

const interface = new ethers.Interface(myABI)
const calldata = interface.encodeFunctionData("myFunction", [arg1, arg2])
const ops = [{
    account: myUserAccount,
    target: myContract,
    calldata,
}]

fetch("https://api.bless.net/account-abstraction/operations", {
    method: "POST",
    body: { ops }
})

Last updated