API Reference
Note: The API is still in beta and subject to change
User Endpoints
Get User
GET
https://api.swaye.me/user
Returns the logged in users details
Headers
Authorization*
String
Bearer token received via OAuth
Get user Balance
GET
https://api.swaye.me/user/balance
Returns the native token balance of the logged in user
Headers
Authorization*
String
Bearer token received via OAuth
Get user accounts
GET
https://api.swaye.me/user/accounts
Get accounts (wallets) for a user
Headers
Authorization*
String
Bearer token received via OAuth
Block Endpoints
Get Block Information
GET
https://api.swaye.me/block/:number
Path Parameters
number*
String
Block Number
Headers
Authorization*
String
Bearer token received via OAuth
Get Latest Block Number
GET
https://api.swaye.me/block/lastestBlockNumber
Headers
Authorization*
String
Bearer token received via OAuth
Chain Endpoints
Get Chain Id
GET
https://api.swaye.me/chain/chainId
Returns the chain Id associated with the client
Headers
Authorization*
String
Bearer token received via OAuth
Contract Endpoints
Call a function on a contract
POST
https://api.swaye.me/contract/call
Headers
Authorization*
String
Bearer token received via OAuth
Request Body
functionSignature*
String
Signature of function
params*
String
Params in matching order of function signature
contractAddress*
String
Address of contract to call
Transaction Endpoint
Submit Transaction
POST
https://api.swaye.me/transaction/submit
Headers
Authorization*
Bearer ....
Bearer token received via OAuth
Request Body
functionSignature*
String
params*
String
contractAddress*
String
value
String
Get Transaction
GET
https://api.swaye.me/transaction/:hash
Path Parameters
hash*
String
TransactionHash
Headers
Authorization*
String
Bearer token received via OAuth
Get Transaction Receipt
GET
https://api.swaye.me/transaction/:hash/receipt
Path Parameters
hash*
String
Transaction hash
Headers
Authorization*
String
Bearer token received via OAuth
ERC20 Endpoints
Get Balance
GET
https://api.swaye.me/erc20/balance/:address
Path Parameters
address*
String
Contract Address
Headers
Authorization*
String
Bearer token received via OAuth
Get Allowance
GET
https://api.swaye.me/erc20/allowance/:address
Path Parameters
address*
String
Contract Address
Query Parameters
owner*
String
Owner Address
spender*
String
Spender Address
Headers
Authorization*
String
Bearer token received via OAuth
Get Total Supply
GET
https://api.swaye.me/erc20/totalSupply/:address
Path Parameters
address*
String
Contract address
Headers
Authorization*
String
Bearer token received via OAuth
Transfer
POST
https://api.swaye.me/erc20/transfer
Headers
Authorization*
Bearer token received via OAuth
Request Body
contractAddress*
String
Contract Address
amount*
String
Amount in wei
address*
String
Receiver address
Approve
POST
https://api.swaye.me/erc20/approve
Headers
Authorization*
String
Bearer token received via OAuth
Request Body
contractAddress*
String
Contract Address
amount*
String
Amount in wei
address*
String
Spender Address
Transfer From
POST
https://api.swaye.me/erc20/transferFrom
Headers
Authorization*
Bearer
Bearer token received via OAuth
Request Body
contractAddress*
String
Contract Address
from*
String
From address
to*
String
Recipient Address
amount*
String
Amount in Wei
ERC721 Endpoints
Get Balance
GET
https://api.swaye.me/erc721/balance/:address
Returns the total tokens owned by the user
Path Parameters
address*
String
Contract Address
Query Parameters
address*
String
Owner Address
Headers
Authorization*
String
Bearer token received via OAuth
Get Approved
GET
https://api.swaye.me/erc721/approved/:address/:tokenId
Returns the approved addresses for a token
Path Parameters
address*
String
Contract Address
tokenId*
String
Token ID
Headers
Authorization*
String
Bearer token received via OAuth
Get token of owner by index
GET
https://api.swaye.me/erc721/tokenOfOwnerByIndex/:address
Returns the token id for an owner at an index of their holdings
E.G:
Get Balance returns "2", meaning two tokens are owned. Index 0 would be used to retrieve the first token, and 1 for the second
Path Parameters
address*
String
Contract Address
Query Parameters
owner*
String
Owner address
index*
String
token Index
Headers
Authorization*
String
Bearer token received via OAuth
Get All Tokens of owner
GET
https://api.swaye.me/erc721/getAllTokensOfOwner/:addresss
Returns an array of tokenIds
Path Parameters
address*
String
Contract address
Query Parameters
owner*
String
Owner address
Headers
Authorization*
String
Bearer token received via OAuth
Get Token URI
GET
https://api.swaye.me/erc721/tokenURI/:address/:tokenId
Path Parameters
address*
String
Contract Address
tokenId*
String
Token Id
Headers
Authorization*
String
Bearer token received via OAuth
Transfer From
POST
https://api.swaye.me/erc721/transferFrom
Headers
Authorization*
String
Bearer token received via OAuth
Request Body
from*
String
From address
to*
String
To address
tokenId*
String
Token Id
contractAddress*
String
Contract address
Approve
POST
https://api.swaye.me/erc721/approve
Headers
Authorization*
String
Bearer token received via OAuth
Request Body
contractAddress*
String
Contract Address
tokenId*
String
approvedAddresss*
String
Address to be approved
Safe Transfer From
POST
https://api.swaye.me/erc721/safeTrasferFrom
Headers
Authorization*
String
Bearer token received via OAuth
Request Body
from*
String
Sender address
to*
String
Receiver Address
contractAddress*
String
Contract Address
tokenId*
String
Token Id
Set Approval for All
POST
https://api.swaye.me/erc721/setApprovalForAll
Sets or unsets the approval of a given operator An operator is allowed to transfer all tokens of the sender on their behalf.
Headers
Authorization*
String
Bearer token received via OAuth
Request Body
operator*
String
Operator address
approved*
boolean
contractAddress*
String
Contract address
Is Approved for all
POST
https://api.swaye.me
Headers
Authorization*
String
Bearer token received via OAuth
Request Body
owner*
String
Owner Address
operator*
String
Operator Address
contractAddress*
String
Contract Address
Last updated