Base Account API

The Base Account API powers Patch wallets and controls the EIP-4337 account abstraction smart contract wallets called, Base Accounts.
Base 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 browser session. They are centered around the concept of a user_id which is a combination of a provider and username.

user_ids:

Read

To read the Base Account address associated with a given user_id and available on all EVM chains, use the Universal Resolver API. 👇
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer {{access_token}}");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"userIds": "twitter:elonmusk,email:[email protected],github:torvalds"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://paymagicapi.com/v1/resolver", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));

Create

Base Account addresses are available instantly with no gas needed and can receive NFTs and tokens. But to sign or submit transactions, a Base Account contract must be deployed to the target EVM chain, which can be done via the create endpoint.

Submit Tx / Sign

Base Accounts can sign messages and submit transactions via the API.