REST API

The REST API is the interface that you can use to talk to the Smart Wallet Token(SWT) blockchain and develop smart contracts.

General Rules

Basic URL

To access the public REST platform SWT you should use basic URL: http://176.113.80.7:62000/api

To specify the request, you need to add a specific route to the base URL. Specific routes are indicated for each REST API method in "Summary" paragraph, full URLs are given there as an example of public REST.

Request

Each request includes parameters, structured as a JSON data object, that follows the standard REST API rules.

In addition to those parameters, specific parameters are usually used depending on a particular request. These parameters vary for each request, and are described in the corresponding sections.

Example Request Structure

{

"authKey": "guid",

"networkAlias":"text",

"networkIp": "ip v4 address",

"networkPort": u16_value

}

Parameter Information

guid: authKey: unique identifier(token) of a client, obtained via registration

string: networkAlias: name of the network. there are two possible names at the moment: MainNet and TestNet

string: networkIp: IP address of the requested node

string: networkPort: port open for requests on the node

Parameters networkAlias and the pair networkIp, networkPort are mutually exclusive. It’s recommended to always use the first option, and use the second one only when you need to explicitly indicate the requested node. If both options are specified, networkAlias has a higher priority. Specifying one of the 2 parameters is mandatory.

Example Response

The response includes its own set of elements. However, if there’s an error during request execution, the response always has the following structure:

{

	// Error indicator

	“Success”: false,

	// Error description

	“Message”: “text”

}

API Methods

GetBlocks()

GetNodeInfo()

GetBalance()

GetWalletInfo()

GetTokenBalance()

GetTransactionsByWallet()

GetTransactionInfo()

GetContractByAddress()

GetContractFromTransaction()

GetContractMethods()

ContractValidation()

ContractCall()

TransactionPack()

TransactionExec()

Last updated