Skip to main content

Operations

sendTo

Executes a transaction operation from "sender" to "receiver".

Params

  • sender : String - Sender wallet Address
  • passphrase : String - Sender Wallet Password
  • receiver : String - Receiver wallet Address
  • amount : String - Coins to be transferred (SNC)
  • payload : HexString - Payload "item" that will be included in this operation (Option)

Result

Example1

Request
curl -X POST --data '{"jsonrpc":"2.0","method":"sendTo","params":{"sender":"HN51F32BB5917012F193D79EF313D84F3E4594F046A1D37E","passphrase":"SenderPassword","receiver":"HN5610C66C78B38E8986FECFB41759DEB757CF401C890593","amount":"100"},"id":123456}' http://localhost:8121
Response
{"result":{"block":0,"time":1644208478,"opblock":0,"maturation":null,"optype":2,"subtype":0,"nopsp":67,"niopsp":0,"oprice":"3076923076230769","ioprice":"3076923076230769","signer_account":"HN51F32BB5917012F193D79EF313D84F3E4594F046A1D37E","n_operation":1,"amount":"100000000000000000000","senders":[{"account":"HN51F32BB5917012F193D79EF313D84F3E4594F046A1D37E","payload":"","payload_type":0}],"receivers":[{"account":"HN5610C66C78B38E8986FECFB41759DEB757CF401C890593"}],"optxt":"Transfer 100.0 ","ophash":"000000000B000000010000007D7C16950DB3578C3EC1900DAFADDE5C95D61F31"},"id":"123456","jsonrpc":"2.0"}

Example2

If you change the test to hexstring, it will be 74657374.

Request
curl -X POST --data '{"jsonrpc":"2.0","method":"sendTo","params":{"sender":"HN51F32BB5917012F193D79EF313D84F3E4594F046A1D37E","passphrase":"SenderPassword","receiver":"HN5610C66C78B38E8986FECFB41759DEB757CF401C890593","amount":"100","payload":"74657374"},"id":123456}' http://localhost:8121
Response
{"result":{"block":0,"time":1644208478,"opblock":0,"maturation":null,"optype":2,"subtype":0,"nopsp":67,"niopsp":0,"oprice":"3076923076230769","ioprice":"3076923076230769","signer_account":"HN51F32BB5917012F193D79EF313D84F3E4594F046A1D37E","n_operation":1,"amount":"100000000000000000000","senders":[{"account":"HN51F32BB5917012F193D79EF313D84F3E4594F046A1D37E","payload":"74657374","payload_type":0}],"receivers":[{"account":"HN5610C66C78B38E8986FECFB41759DEB757CF401C890593"}],"optxt":"Transfer 100.0 ","ophash":"000000000B000000010000007D7C16950DB3578C3EC1900DAFADDE5C95D61F31"},"id":"123456","jsonrpc":"2.0"}

rawSendTo

Creates and signs a "sendTo" operation without checking information and without transfering to the network.

:::info Information It's usefull for "cold wallets" that are off-line (not synchronized with the network) and only holds private keys. :::

Params

  • senderAccount : Integer - Sender account (obtained with an "Account Object", for example when called to "getWalletInfo")
  • senderWallet : String - Sender wallet Address
  • senderNOperation : Integer - Sender Last value of n_operation (obtained with an "Account Object", for example when called to "getWalletInfo")
  • passphrase : String - Sender Wallet Password
  • receiverAccount : Integer - Sender account (obtained with an "Account Object", for example when called to "getWalletInfo")
  • amount : String - Coins to be transferred (SNC)
  • payload : HexString - Payload "item" that will be included in this operation (Option)

Result

:::caution Note Remember that rawoperation are operations that maybe are not correct. :::

Example

Request
curl -X POST --data '{"jsonrpc":"2.0","method":"rawSendTo","params":{"senderAccount":12345,"senderWallet":"HN51F32BB5917012F193D79EF313D84F3E4594F046A1D37E","senderNOperation":14,"passphrase":"SenderPassword","receiverAccount":23456,"amount":"100"},"id":123456}' http://localhost:8121
Response
{"result":{"amount":"100000000000000000000","fee":"210000000000000000","rawoperation":"030000000B000000010000007D7C16950DB3578C3EC1900DAFADDE5C95D61F31"},"id":"123456","jsonrpc":"2.0"}

InfoRaw

Check the information in the rawoperation.

Params

  • rawoperation : HexString - HexString value created with "rawSendTo" etc.

Result

Example

Request
curl -X POST --data '{"jsonrpc":"2.0","method":"InfoRaw","params":{"rawoperation":"030000000B000000010000007D7C16950DB3578C3EC1900DAFADDE5C95D61F31"},"id":123456}' http://localhost:8121
Response
{"result":[{"block":0,"time":1644208478,"opblock":0,"maturation":null,"optype":2,"subtype":0,"nopsp":67,"niopsp":0,"oprice":"3076923076230769","ioprice":"3076923076230769","signer_account":"HN51F32BB5917012F193D79EF313D84F3E4594F046A1D37E","n_operation":1,"amount":"100000000000000000000","senders":[{"account":"HN51F32BB5917012F193D79EF313D84F3E4594F046A1D37E","payload":"74657374","payload_type":0}],"receivers":[{"account":"HN5610C66C78B38E8986FECFB41759DEB757CF401C890593"}],"optxt":"Transfer 100.0 ","ophash":"000000000B000000010000007D7C16950DB3578C3EC1900DAFADDE5C95D61F31"}],"id":"123456","jsonrpc":"2.0"}

excuteRaw

Executes operations included in rawopertion param and transfers to the network.

:::info Information Raw operation can include "sendTo" oprations. :::

Params

  • rawoperation : HexString - HexString value created with "rawSendTo" etc.

Result

:::caution Note if there is an error, param valid will be false and param errors will show error description. Otherwise, operation is correct and will contain ophash param. :::

Example

Request
curl -X POST --data '{"jsonrpc":"2.0","method":"excuteRaw","params":{"rawoperation":"030000000B000000010000007D7C16950DB3578C3EC1900DAFADDE5C95D61F31"},"id":123456}' http://localhost:8121
Response
{"result":{"block":0,"time":1644208478,"opblock":0,"maturation":null,"optype":2,"subtype":0,"nopsp":67,"niopsp":0,"oprice":"3076923076230769","ioprice":"3076923076230769","signer_account":"HN51F32BB5917012F193D79EF313D84F3E4594F046A1D37E","n_operation":1,"amount":"100000000000000000000","senders":[{"account":"HN51F32BB5917012F193D79EF313D84F3E4594F046A1D37E","payload":"74657374","payload_type":0}],"receivers":[{"account":"HN5610C66C78B38E8986FECFB41759DEB757CF401C890593"}],"optxt":"Transfer 100.0 ","ophash":"000000000B000000010000007D7C16950DB3578C3EC1900DAFADDE5C95D61F31"},"id":"123456","jsonrpc":"2.0"}

privSendTo

From "sender" to "receiver", the transaction is executed using the private key.

:::danger Important Please control risks when using this API. To ensure environmental security, please do not invoke APIs provided by other or invoke this very API on a public network. :::

Params

  • sender : String - Sender wallet Address
  • priv : HEXASTRING - Sender Wallet Encoded PrivateKey
  • receiver : String - Receiver wallet Address
  • amount : String - Coins to be transferred (SNC)

Result

Example

Request
curl -X POST --data '{"jsonrpc":"2.0","method":"privSendTo","params":{"sender":"HN51F32BB5917012F193D79EF313D84F3E4594F046A1D37E","priv":"SenderPrivatekey","receiver":"HN5610C66C78B38E8986FECFB41759DEB757CF401C890593","amount":"100"},"id":123456}' http://localhost:8121
Response
{"result":{"block":0,"time":1644208478,"opblock":0,"maturation":null,"optype":2,"subtype":0,"nopsp":67,"niopsp":0,"oprice":"3076923076230769","ioprice":"3076923076230769","signer_account":"HN51F32BB5917012F193D79EF313D84F3E4594F046A1D37E","n_operation":1,"amount":"100000000000000000000","senders":[{"account":"HN51F32BB5917012F193D79EF313D84F3E4594F046A1D37E","payload":"","payload_type":0}],"receivers":[{"account":"HN5610C66C78B38E8986FECFB41759DEB757CF401C890593"}],"optxt":"Transfer 100.0 ","ophash":"000000000B000000010000007D7C16950DB3578C3EC1900DAFADDE5C95D61F31"},"id":"123456","jsonrpc":"2.0"}

getPendingOperation

Get pendings operation to be included in the chain.

Params

  • none

Result

Example

Request
curl -X POST --data '{"jsonrpc":"2.0","method":"getPendingOperation","id":123456}' http://localhost:8121
Response
{"result":[{"block":0,"time":1644208478,"opblock":0,"maturation":null,"optype":2,"subtype":0,"nopsp":67,"niopsp":0,"oprice":"3076923076230769","ioprice":"3076923076230769","signer_account":"HN51F32BB5917012F193D79EF313D84F3E4594F046A1D37E","n_operation":1,"amount":"100000000000000000000","senders":[{"account":"HN51F32BB5917012F193D79EF313D84F3E4594F046A1D37E","payload":"","payload_type":0}],"receivers":[{"account":"HN5610C66C78B38E8986FECFB41759DEB757CF401C890593"}],"optxt":"Transfer 100.0 ","ophash":"000000000B000000010000007D7C16950DB3578C3EC1900DAFADDE5C95D61F31"}],"id":"123456","jsonrpc":"2.0"}

getPendingCount

Get pending opertions count.

Params

  • none

Result

  • Integer with count of pending opertions

Example

Request
curl -X POST --data '{"jsonrpc":"2.0","method":"getPendingCount","id":123456}' http://localhost:8121
Response
{"result":2,"id":"123456","jsonrpc":"2.0"}

getBlockOperations

Get operations of specified block.

Params

  • block : Integer - Block number

Result

Example

Request
curl -X POST --data '{"jsonrpc":"2.0","method":"getBlockOperations","params":{"block":34},"id":123456}' http://localhost:8121
Response
{"result":[{"block":34,"time":1644207342,"opblock":0,"maturation":0,"optype":5,"subtype":0,"nopsp":0,"niopsp":0,"oprice":"0","ioprice":"0","signer_account":"HN55A334AAA0F309761BB626C33DF83F3586F2E0FE27B90C","amount":"0","senders":[{"account":"HN55A334AAA0F309761BB626C33DF83F3586F2E0FE27B90C","payload":"","payload_type":0}],"receivers":[],"optxt":"Active Wallet","ophash":"2200000000000000000000008EC5EA106A116BF5F9A58E271F6BFEC3179BA7B3"}],"id":"123456","jsonrpc":"2.0"}

getActPrice

Get Operation Act Price.

Params

  • none

Result

  • Returns an integer with Operation Act Price

Example

Request
curl -X POST --data '{"jsonrpc":"2.0","method":"getActPrice","id":123456}' http://localhost:8121
Response
{"result":3076923076230769,"id":"123456","jsonrpc":"2.0"}

findOperation

Search for Operation using Ophash.

Params

  • ophash : HEXASTRING - Operation hash used to find this operation in the chain

Result

Example

Request
curl -X POST --data '{"jsonrpc":"2.0","method":"findOperation","params":{"ophash":"000000000B000000010000007D7C16950DB3578C3EC1900DAFADDE5C95D61F31"},"id":123456}' http://localhost:8121
Response
{"result":[{"block":35,"time":1641995799,"opblock":0,"maturation":0,"optype":2,"subtype":0,"nopsp":67,"niopsp":0,"oprice":"3076923076230769","ioprice":"3076923076230769","signer_account":"HN51F32BB5917012F193D79EF313D84F3E4594F046A1D37E","n_operation":1,"amount":"100000000000000000000","senders":[{"account":"HN51F32BB5917012F193D79EF313D84F3E4594F046A1D37E","payload":"","payload_type":0}],"receivers":[{"account":"HN5610C66C78B38E8986FECFB41759DEB757CF401C890593"}],"optxt":"Transfer 100.0 ","ophash":"230000000B000000010000007D7C16950DB3578C3EC1900DAFADDE5C95D61F31"}],"id":"123456","jsonrpc":"2.0"}

decodeOpHash

Information that decoded ophash

Params

  • ophash : HEXASTRING - Operation hash used to find this operation in the chain

Result

  • block : Integer - Block number
  • account : Integer - Wallet Number
  • n_operation : Integer - Operations made by this account
  • mdhash : HEXASTRING - Operation md Hash

Example

Request
curl -X POST --data '{"jsonrpc":"2.0","method":"findOperation","params":{"ophash":"000000000B000000010000007D7C16950DB3578C3EC1900DAFADDE5C95D61F31"},"id":123456}' http://localhost:8121
Response
{"result":[{"block":0,"account":11,"n_operation":1,"ophash":"7D7C16950DB3578C3EC1900DAFADDE5C95D61F31"}],"id":"123456","jsonrpc":"2.0"}