Patch Wallet API
  • 👋Welcome to the Patch Docs
  • API
    • ▶️Overview
    • Go to Postman Collection
    • App Authentication
    • User Authentication
    • Resolver API
    • Kernel Account API
    • ENS Resolver (usr.id)
    • Networks Supported
    • Errors
  • Other
    • Admin
      • 🚧 🚧 🚧 Patch Maintenance 🚧 🚧 🚧
    • Other
      • 🏗️Request for Projects
      • Base Account API [DEPRECATED]
      • DustSweeper API [WIP]
      • Safe Account API
        • Accounts
        • Send Transactions
        • View Transaction Status
  • Protocol
Powered by GitBook
On this page
  • Submit a Transaction
  • Sign a Message
  1. API

Kernel Account API

PreviousResolver APINextENS Resolver (usr.id)

Last updated 1 year ago

The Kernel Account API powers and controls the smart contract wallets called, Kernel Accounts.

Kernel Accounts are a simple smart contract wallet with the same address on all EVM chains and connected to a user's email, social account, phone, or an app provider. The Kernel Account API can be used to submit a transaction or sign a message through a target wallet.

Submit a Transaction

To send a transaction through a Kernel Account, see the Kernel Tx endpoint in Postman.

var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "Bearer {{access_token}}");

var raw = JSON.stringify({
  "userId": "test:elonmusk",
  "chain": "matic",
  "to": [
    "0x74427681c620DE258Aa53a382d6a4C865738A06C"
  ],
  "value": [
    "10000000000000"
  ],
  "data": [
    "0x"
  ],
  "delegatecall": 0, // Optional parameter. Set to 1 for a delegatecall().
  "auth": ""
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://paymagicapi.com/v1/kernel/tx", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Sign a Message

Sign any arbitrary message using an EIP-1271 signature from your Patch wallet. Commonly used to sign into an application, submit a trade, or list an NFT on a marketplace.

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://paymagicapi.com/v1/kernel/sign',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer {{access_token}}'
  },
  body: JSON.stringify({
    "userId": "test:elonmusk",
    "hash": "0xec3608877ecbf8084c29896b7eab2a368b2b3c8d003288584d145613dfa4706c"
  })

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
Patch wallets
EIP-4337 account abstraction