REST API
Last updated
Last updated
The REST API is the interface that you can use to talk to the Smart Wallet Token(SWT) blockchain and develop smart contracts.
To access the public REST platform SWT you should use basic URL:
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.
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.
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.
The response includes its own set of elements. However, if there’s an error during request execution, the response always has the following structure:
GetBlocks()
GetNodeInfo()
GetBalance()
GetWalletInfo()
GetTokenBalance()
GetTransactionsByWallet()
GetTransactionInfo()
GetContractByAddress()
GetContractFromTransaction()
GetContractMethods()
ContractValidation()
ContractCall()
TransactionPack()
TransactionExec()