ETH: $
(%)
network iconEthereum

Owlracle's Seamless Web3 API documentation

Unlock the power of Web3 on your website effortlessly with our Seamless Web3 API. This innovative solution bridges the gap between Web3 functionalities and your online platform, enabling transactions without the need for additional software like browser-based wallets.

To begin the integration, developers must first register their application with us. Once registered, you can empower your users to create their own wallets through your service, allowing them to interact with the blockchain directly from your website. It's that simple! No external wallet installations, just pure Web3 engagement.

Our API is designed for ease of use with an API key, granting you some free requests per day. Should you exceed this limit, your will spend your API credits for continued access.

API keys

To create your API key and be able to make requests to our endpoints, go to the header section of this page, and click New API key on the dropdown option. On the New API key window, fill the required fields and click the Create API key button. Copy your key and secret, and keep them safe. The API key will be required to make requests to our endpoints, and the secret will be used if you want to change any information about your key.

Security tip: When using your key, keep in mind that front-end code is publicly readable, even if obfuscated. Thus, writing your key in the source-code will expose it.

After creating an API key, you must enable the SW3 module for your account. Just click on the SW3 App tab and on the Connect My API key button.

Accounts

The SW3 api provides endpoints for managing your users' accounts. You can create new accounts, list existing ones, and manage their settings.

App

Your API key is also your app. Within your app, you can have many users. Your app's settings will affect only your app's users.

App information

This endpoint allows you to fetch details about your app using your API key. Remember you can generate and manage a key in the API keys section. Check our docs for more information.

Arguments
Response
Sandbox
Code
Field
Type
Description
Default
apikey
param
Your API key. Check API keys section to learn how to generate and use one.
none
Field
Description
name
The name of the app.
apikey
The API key of the app.
users
List of users' names belonging to this app.
{
"message": "App found.",
"app": {
"name": "My App",
"apikey": "1234567890",
"users": [
"user1",
"user2",
"user3"
]
}
}
/sw3/app/
const fetch = require('node-fetch');
const url = `https://api.owlracle.info/sw3/app/`;
const data = await fetch(url).then(res => res.json());
console.log(data);

User

Every user in your app has their own set of wallets, as well as their own settings and a password. Your users will use their password to perform actions on the blockchain using their wallets, such as sending tokens.

Add user

Create new users in your app.

POST https://api.owlracle.info/sw3/user
Arguments
Response
Sandbox
Code
Field
Type
Description
Default
app
header
Your API key. Check API keys section to learn how to generate and use one.
none
username
body
The username of the user you want to create.
none
password
body
The password of the user you want to create.
none
name
body
The name of the user you want to create.
none
Field
Description
username
The username of the user.
name
The name of the user.
wallets
The wallets the user has registered in your app.
contacts
The addresses this user has saved as contacts.
tokens
The most used tokens by this user.
settings
The settings of the user.
{
"message": "User found",
"user": {
"username": "johndoe",
"name": "John Doe",
"wallets": [
{
"name": "My Wallet 1",
"address": "0x1234567890123456789012345678901234567890"
},
{
"name": "My Wallet 2",
"address": "0x1234567890123456789012345678901234567890"
}
],
"contacts": [
{
"name": "My Contact 1",
"address": "0x1234567890123456789012345678901234567890"
},
{
"name": "My Contact 2",
"address": "0x1234567890123456789012345678901234567890"
}
],
"tokens": [
{
"address": "0x1234567890123456789012345678901234567890",
"network": "ethereum",
"name": "Uniswap",
"symbol": "UNI"
}
],
"settings": {
"slippage": 1,
"payWithOWL": true
}
}
}
/sw3/user
const fetch = require('node-fetch');
const url = `https://api.owlracle.info/sw3/user`;
const data = await fetch(url, {
    method: 'POST',
}).then(res => res.json());
console.log(data);

User information

This endpoint allows you to retrieve information about a specific user in your app.

Arguments
Response
Sandbox
Code
Field
Type
Description
Default
app
header
Your API key. Check API keys section to learn how to generate and use one.
none
username
header
The username of the user you want to get info from.
none
password
header
The password of the user you want to get info from.
none
Field
Description
username
The username of the user.
name
The name of the user.
wallets
The wallets the user has registered in your app.
contacts
The addresses this user has saved as contacts.
tokens
The most used tokens by this user.
slippage
The slippage tolerance in percentage. 0.5 == 0.5%
payWithOWL
If the user wants to pay the transaction fee with OWL tokens.
{
"message": "User found",
"user": {
"username": "johndoe",
"name": "John Doe",
"wallets": [
{
"name": "My Wallet 1",
"address": "0x1234567890123456789012345678901234567890"
},
{
"name": "My Wallet 2",
"address": "0x1234567890123456789012345678901234567890"
}
],
"contacts": [
{
"name": "My Contact 1",
"address": "0x1234567890123456789012345678901234567890"
},
{
"name": "My Contact 2",
"address": "0x1234567890123456789012345678901234567890"
}
],
"tokens": [
{
"address": "0x1234567890123456789012345678901234567890",
"network": "ethereum",
"name": "Uniswap",
"symbol": "UNI"
}
],
"settings": {
"slippage": 1,
"payWithOWL": true
}
}
}
/sw3/user
const fetch = require('node-fetch');
const url = `https://api.owlracle.info/sw3/user`;
const data = await fetch(url).then(res => res.json());
console.log(data);

Wallet

Every user in your app has their own set of wallets. Your users will use their wallets to perform actions on the blockchain, such as sending tokens.

Create wallet

Create new wallets for your users.

POST https://api.owlracle.info/sw3/wallet
Arguments
Response
Sandbox
Code
Field
Type
Description
Default
app
header
Your API key. Check API keys section to learn how to generate and use one.
none
username
header
The username of the user.
none
password
header
The password of the user.
none
name
body
A nickname for the wallet you want to create.
none
description
body
A description for the wallet you want to create.
none
privatekey
body
If you want to add an existing wallet from a private key you can pass it here, otherwise a new wallet will be created.
none
Field
Description
name
The name you gave to the wallet.
description
The description you gave to the wallet.
address
The wallet's address.
privateKey
The wallet's private key.
{
"message": "Wallet created.",
"wallet": {
"name": "My Wallet",
"description": "My wallet description",
"address": "0x1234567890123456789012345678901234567890",
"privateKey": "0x1234567890123456789012345678901234567890123456789012345678901234"
}
}
/sw3/wallet
const fetch = require('node-fetch');
const url = `https://api.owlracle.info/sw3/wallet`;
const data = await fetch(url, {
    method: 'POST',
}).then(res => res.json());
console.log(data);

Wallet information

Retrieve information about a specific wallet.

Arguments
Response
Sandbox
Code
Field
Type
Description
Default
app
header
Your API key. Check API keys section to learn how to generate and use one.
none
username
header
The username of the user.
none
password
header
The password of the user.
none
network
param
The network of the wallet you want to get info from.
none
address
param
The address of the wallet you want to get info from.
none
Field
Description
name
The name you gave to the wallet.
description
The description you gave to the wallet.
address
The wallet's address.
privateKey
The wallet's private key.
balance
The wallet's balance in the network (in the native token).
{
"message": "Wallet found.",
"wallet": {
"name": "My Wallet",
"description": "My wallet description",
"address": "0x1234567890123456789012345678901234567890",
"privateKey": "0x1234567890123456789012345678901234567890123456789012345678901234",
"balance": "0.0"
}
}
/sw3/wallet/ethereum/
const fetch = require('node-fetch');
const url = `https://api.owlracle.info/sw3/wallet/ethereum/`;
const data = await fetch(url).then(res => res.json());
console.log(data);

Wallet's token balance

Retrieve the token balance of a wallet.

Arguments
Response
Sandbox
Code
Field
Type
Description
Default
app
header
Your API key. Check API keys section to learn how to generate and use one.
none
username
header
The username of the user.
none
password
header
The password of the user.
none
network
param
The network of the token you want to get your balance.
none
address
param
The address of the wallet you want to get the token balance.
none
token
param
The token address of the token you want to get your balance.
none
Field
Description
balance
The wallet's token balance in the network.
{
"balance": "0.0"
}
/sw3/wallet/ethereum//token/
const fetch = require('node-fetch');
const url = `https://api.owlracle.info/sw3/wallet/ethereum//token/`;
const data = await fetch(url).then(res => res.json());
console.log(data);

Update wallet

Change information about a wallet.

Arguments
Response
Sandbox
Code
Field
Type
Description
Default
app
header
Your API key. Check API keys section to learn how to generate and use one.
none
username
header
The username of the user.
none
password
header
The password of the user.
none
address
param
The address of the wallet you want to update.
none
name
body
The new name you want to give to the wallet.
none
description
body
The new description you want to give to the wallet.
none
Field
Description
balance
The wallet's name.
description
The wallet's description.
address
The wallet's address.
{
"message": "Wallet edited.",
"wallet": {
"name": "My Wallet",
"description": "My wallet description",
"address": "0x1234567890123456789012345678901234567890"
}
}
/sw3/wallet/
const fetch = require('node-fetch');
const url = `https://api.owlracle.info/sw3/wallet/`;
const data = await fetch(url, {
    method: 'PUT',
}).then(res => res.json());
console.log(data);

Delete wallet

Remove a wallet from your app.

Arguments
Response
Sandbox
Code
Field
Type
Description
Default
app
header
Your API key. Check API keys section to learn how to generate and use one.
none
username
header
The username of the user.
none
password
header
The password of the user.
none
address
param
The address of the wallet you want to remove.
none
Field
Description
-
-
{
"message": "Wallet deleted."
}
/sw3/wallet/
const fetch = require('node-fetch');
const url = `https://api.owlracle.info/sw3/wallet/`;
const data = await fetch(url, {
    method: 'DELETE',
}).then(res => res.json());
console.log(data);

Build-in Web3

Build-in Web3 actions are those commonly available in most web browsers extensions. Those actions include transfering tokens and swapping tokens. SW3 API provides endpoints for those actions.

Transfer

Transfer tokens from one wallet to another.

Arguments
Response
Sandbox
Code
Field
Type
Description
Default
app
header
Your API key. Check API keys section to learn how to generate and use one.
none
username
header
The username of the user.
none
password
header
The password of the user.
none
network
param
The network of the token you want to transfer.
none
wallet
body
The wallet you want to transfer the tokens from.
none
token
body
The address of the token you want to transfer. If omitted, the native token of the network will be used.
Native token addr.
amount
body
The amount of tokens you want to transfer.
0
recipient
body
The address of the recipient.
Same as wallet
payWithOWL
body
If you want to pay the transaction fee with OWL tokens.
false
Field
Description
tx
Object containing transaction informaton as returned by the RPC node.
{
"tx": "transaction object"
}
/sw3/web3/ethereum/transfer
const fetch = require('node-fetch');
const url = `https://api.owlracle.info/sw3/web3/ethereum/transfer`;
const data = await fetch(url, {
    method: 'POST',
}).then(res => res.json());
console.log(data);

Swap

Perform a token swap. Token swaps are the exchange of one token for another.

Arguments
Response
Sandbox
Code
Field
Type
Description
Default
app
header
Your API key. Check API keys section to learn how to generate and use one.
none
username
header
The username of the user.
none
password
header
The password of the user.
none
network
param
The network where the swap will be executed.
none
wallet
body
The wallet you will use in the swap.
none
tokenIn
body
The address of the token you will give in the swap. If omitted, the native token of the network will be used.
Native token addr.
tokenOut
body
The address of the token you will receive in the swap. If omitted, the native token of the network will be used.
Native token addr.
amount
body
The amount of tokens you will give in the swap.
0
payWithOWL
body
If you want to pay the transaction fee with OWL tokens.
false
slippage
body
The slippage tolerance. Overrides the user's slippage setting. 1% == 0.01.
User's settings
Field
Description
tx
Object containing transaction informaton as returned by the RPC node.
{
"tx": "transaction object"
}
/sw3/web3/ethereum/swap
const fetch = require('node-fetch');
const url = `https://api.owlracle.info/sw3/web3/ethereum/swap`;
const data = await fetch(url, {
    method: 'POST',
}).then(res => res.json());
console.log(data);

Get Transaction

Get information about a transaction.

Arguments
Response
Sandbox
Code
Field
Type
Description
Default
app
header
Your API key. Check API keys section to learn how to generate and use one.
none
network
param
The network where the transaction was sent.
none
hash
param
The hash of the transaction you want to get info from.
none
Field
Description
tx
Object containing transaction informaton as returned by the RPC node.
{
"tx": "transaction object"
}
/sw3/web3/ethereum/tx/
const fetch = require('node-fetch');
const url = `https://api.owlracle.info/sw3/web3/ethereum/tx/`;
const data = await fetch(url).then(res => res.json());
console.log(data);

Contract

Web3 contract actions are those related to smart contract interaction. Those actions allows calling any smart contract method using SW3 API, such as depositing and withdrawing tokens from a liquidity pool, lending and borrowing tokens, and more. SW3 API provides endpoints for you to interact with any smart contract.

Contract Call

Call a smart contract function. This endpoint allows you to call read-only functions, such as getting the balance of a wallet, or the total supply of a token, symbol, etc. It does not require authentication.

Arguments
Response
Sandbox
Code
Field
Type
Description
Default
app
header
Your API key. Check API keys section to learn how to generate and use one.
none
network
param
The network where the contract is deployed.
none
address
param
The address of the contract.
none
method
param
The method you want to call.
none
args
body
An array of arguments to pass to the smart contract method. This array must be a valid JSON
none
formatOutput
body
How you want the output to be formatted. Check Format output section to learn about the options available.
none
Field
Description
data
The output of the method call.
decimals
If the data response is a number and the formatOutput is used, this will be the number of decimals the output data will be formatted to.
{
"message": "Method executed successfully.",
"data": "0.0",
"decimals": 0
}
/sw3/contract/ethereum//call/
const fetch = require('node-fetch');
const url = `https://api.owlracle.info/sw3/contract/ethereum//call/`;
const data = await fetch(url, {
    method: 'POST',
}).then(res => res.json());
console.log(data);

Contract Send

Send a transaction to a smart contract. This endpoint allows you to send transactions to smart contracts. It requires authentication and allow you to send transactions that change the state of the blockchain, such as depositing tokens into a liquidity pool, or lending tokens.

Arguments
Response
Sandbox
Code
Field
Type
Description
Default
app
header
Your API key. Check API keys section to learn how to generate and use one.
none
username
header
The username of the user.
none
password
header
The password of the user.
none
network
param
The network where the contract is deployed.
none
address
param
The address of the contract.
none
method
param
The method you want to call.
none
args
body
An array of arguments to pass to the smart contract method. This array must be a valid JSON
none
wallet
body
The wallet you will use to send the transaction.
none
value
body
The amount of tokens you want to send with the transaction.
0
gasPrice
body
The gas price you want to use for the transaction. If omitted, the default gas price of the network will be used.
none
gasLimit
body
The gas limit you want to use for the transaction. If omitted, the default gas limit of the network will be used.
none
Field
Description
tx
Object containing transaction informaton as returned by the RPC node.
{
"message": "Transaction sent successfully.",
"tx": "transaction object"
}
/sw3/contract/ethereum//send/
const fetch = require('node-fetch');
const url = `https://api.owlracle.info/sw3/contract/ethereum//send/`;
const data = await fetch(url, {
    method: 'POST',
}).then(res => res.json());
console.log(data);

Estimate Gas

Estimate the gas cost of a transaction. This endpoint allows you to estimate the gas cost of a transaction before sending it.

Arguments
Response
Sandbox
Code
Field
Type
Description
Default
app
header
Your API key. Check API keys section to learn how to generate and use one.
none
network
param
The network where the contract is deployed.
none
address
param
The address of the contract.
none
method
param
The method you want to estimate gas.
none
args
body
An array of arguments to pass to the smart contract method. This array must be a valid JSON
none
wallet
body
The wallet you will use to simulate the transaction.
none
value
body
The amount of tokens you want to send with the simulated transaction.
0
gasPrice
body
The gas price you want to use for the transaction. If omitted, the default gas price of the network will be used.
none
gasLimit
body
The gas limit you want to use for the transaction. If omitted, the default gas limit of the network will be used.
none
Field
Description
gas
The estimated gas for the transaction.
{
"message": "Gas estimated successfully.",
"gas": "10000"
}
/sw3/contract/ethereum//estimate/
const fetch = require('node-fetch');
const url = `https://api.owlracle.info/sw3/contract/ethereum//estimate/`;
const data = await fetch(url, {
    method: 'POST',
}).then(res => res.json());
console.log(data);

Utils

Utils are actions that do not require authentication and are not related to any specific account. Those actions include formatting data, and more. SW3 API provides endpoints for you to perform those actions.

Format

Allows you to format data, such as converting a string value from wei to ether. You can input from and to values either as integers (18, 9, 0, etc) or as their unique names (wei, gwei, ether, etc).

Arguments
Response
Sandbox
Code
Field
Type
Description
Default
value
query
The value you want to format.
none
from
query
The number of decimals the value has.
18
to
query
The number of decimals you want the value to have.
0
Field
Description
data
The formatted value.
unit
The name of the unit representing formatted value. If the to unit does not have a name, this will be omitted.
decimals
The number of decimals the formatted value has.
{
"data": "12.3",
"unit": "gwei",
"decimals": 9
}
/sw3/utils/format
const fetch = require('node-fetch');
const url = `https://api.owlracle.info/sw3/utils/format`;
const data = await fetch(url).then(res => res.json());
console.log(data);

Decode

Allows you to decode transaction data. Along with the data, you can either the contract ABI or the contract address and network. The ABI provided can be only for the function you want to decode (E.g. ["function transfer(address to, uint256 amount) returns (bool)"]), or for the entire contract. If you provide contract address and network, the ABI will be fetched from the blockchain explorer. In this case, the contract must be verified.

Arguments
Response
Sandbox
Code
Field
Type
Description
Default
app
header
Your API key. Check API keys section to learn how to generate and use one.
none
data
body
The data you want to decode (0x...).
none
abi
body
The ABI of the contract you want to use to decode the data. Do not need the full abi, only the method you are interested: E.g. ["function transfer(address to, uint256 amount) returns (bool)"]. This is not required if the address and network are provided.
none
address
body
The address of the contract you want to use to decode the data. This is not required if the ABI is provided.
none
network
body
The network where the contract is deployed. This is only required if the abi is not provided.
none
Field
Description
args
An array of arguments decoded from the data.
functionFragment
The function fragment of the method called. This contains details about the method called, its inputs and outputs.
name
The name of the method called.
signature
The signature of the method called.
sighash
The sighash of the method called.
value
The value sent with the method call.
{
"args": [
"..."
],
"functionFragment": {
"type": "function",
"name": "transfer",
"inputs": [
{},
{},
"..."
],
"outputs": [
{},
{},
"..."
],
"payable": false,
"stateMutability": "nonpayable",
"gas": null
},
"name": "transfer",
"signature": "transfer(address,uint256)",
"sighash": "0xa9059cbb",
"value": {
"type": "BigNumber",
"hex": "0x00"
}
}
/sw3/utils/decode
const fetch = require('node-fetch');
const url = `https://api.owlracle.info/sw3/utils/decode`;
const data = await fetch(url, {
    method: 'POST',
}).then(res => res.json());
console.log(data);

Trading

Trading actions those that allow you to perform swaps under defined conditions. Those actions include limit orders, stop orders, and more. SW3 API provides endpoints for you to create and manage those orders.

🚧 SOON! 🚧

Gas API

Our Gas API provides you with the most accurate gas prices for a wide range of networks. You can use it to estimate the cost of your transactions, ensuring you always pay the right amount for your gas fees.

For more information, check our Gas API documentation.

Proxy Node

We also provide a Proxy Node service that dynamically routes your requests to the fastest available RPC. To use it, you can simply replace your existing RPC URL in your wallet with our URL.

Check out the Proxy Node documentation for more information.