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
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer token received via OAuth |
Get user accounts
GET
https://api.swaye.me/user/accounts
Get accounts (wallets) for a user
Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer token received via OAuth |
Block Endpoints
Get Block Information
GET
https://api.swaye.me/block/:number
Path Parameters
Name | Type | Description |
---|---|---|
number* | String | Block Number |
Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer token received via OAuth |
Get Latest Block Number
GET
https://api.swaye.me/block/lastestBlockNumber
Headers
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer token received via OAuth |
Contract Endpoints
Call a function on a contract
POST
https://api.swaye.me/contract/call
Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer token received via OAuth |
Request Body
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
Authorization* | Bearer .... | Bearer token received via OAuth |
Request Body
Name | Type | Description |
---|---|---|
functionSignature* | String | |
params* | String | |
contractAddress* | String | |
value | String |
Get Transaction
GET
https://api.swaye.me/transaction/:hash
Path Parameters
Name | Type | Description |
---|---|---|
hash* | String | TransactionHash |
Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer token received via OAuth |
Get Transaction Receipt
GET
https://api.swaye.me/transaction/:hash/receipt
Path Parameters
Name | Type | Description |
---|---|---|
hash* | String | Transaction hash |
Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer token received via OAuth |
ERC20 Endpoints
Get Balance
GET
https://api.swaye.me/erc20/balance/:address
Path Parameters
Name | Type | Description |
---|---|---|
address* | String | Contract Address |
Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer token received via OAuth |
Get Allowance
GET
https://api.swaye.me/erc20/allowance/:address
Path Parameters
Name | Type | Description |
---|---|---|
address* | String | Contract Address |
Query Parameters
Name | Type | Description |
---|---|---|
owner* | String | Owner Address |
spender* | String | Spender Address |
Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer token received via OAuth |
Get Total Supply
GET
https://api.swaye.me/erc20/totalSupply/:address
Path Parameters
Name | Type | Description |
---|---|---|
address* | String | Contract address |
Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer token received via OAuth |
Transfer
POST
https://api.swaye.me/erc20/transfer
Headers
Name | Type | Description |
---|---|---|
Authorization* | Bearer token received via OAuth |
Request Body
Name | Type | Description |
---|---|---|
contractAddress* | String | Contract Address |
amount* | String | Amount in wei |
address* | String | Receiver address |
Approve
POST
https://api.swaye.me/erc20/approve
Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer token received via OAuth |
Request Body
Name | Type | Description |
---|---|---|
contractAddress* | String | Contract Address |
amount* | String | Amount in wei |
address* | String | Spender Address |
Transfer From
POST
https://api.swaye.me/erc20/transferFrom
Headers
Name | Type | Description |
---|---|---|
Authorization* | Bearer | Bearer token received via OAuth |
Request Body
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
address* | String | Contract Address |
Query Parameters
Name | Type | Description |
---|---|---|
address* | String | Owner Address |
Headers
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
address* | String | Contract Address |
tokenId* | String | Token ID |
Headers
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
address* | String | Contract Address |
Query Parameters
Name | Type | Description |
---|---|---|
owner* | String | Owner address |
index* | String | token Index |
Headers
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
address* | String | Contract address |
Query Parameters
Name | Type | Description |
---|---|---|
owner* | String | Owner address |
Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer token received via OAuth |
Get Token URI
GET
https://api.swaye.me/erc721/tokenURI/:address/:tokenId
Path Parameters
Name | Type | Description |
---|---|---|
address* | String | Contract Address |
tokenId* | String | Token Id |
Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer token received via OAuth |
Transfer From
POST
https://api.swaye.me/erc721/transferFrom
Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer token received via OAuth |
Request Body
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer token received via OAuth |
Request Body
Name | Type | Description |
---|---|---|
contractAddress* | String | Contract Address |
tokenId* | String | |
approvedAddresss* | String | Address to be approved |
Safe Transfer From
POST
https://api.swaye.me/erc721/safeTrasferFrom
Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer token received via OAuth |
Request Body
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer token received via OAuth |
Request Body
Name | Type | Description |
---|---|---|
operator* | String | Operator address |
approved* | boolean | |
contractAddress* | String | Contract address |
Is Approved for all
POST
https://api.swaye.me
Headers
Name | Type | Description |
---|---|---|
Authorization* | String | Bearer token received via OAuth |
Request Body
Name | Type | Description |
---|---|---|
owner* | String | Owner Address |
operator* | String | Operator Address |
contractAddress* | String | Contract Address |
Last updated