FreezeBalance

POST: http://172.104.51.182:16667/wallet/freezebalance

Stake an amount of Wel to obtain bandwidth OR Energy and WEL Power (voting rights) . Optionally, user can stake Wel to grant Energy or Bandwidth to others. Balance amount in the denomination of sun.

BODY PARAMS

{

owner_address string

frozen_balance int64

frozen_duration int32

resource string

receiver_address string

permission_id int32

visible boolean

}

Example:

curl --request POST --url http://172.104.51.182:16667/wallet/freezebalance --header 'Accept: application/json' --header 'Content-Type: application/json' --data @- <<EOF

{ "owner_address": "WRSrWnjsK5ePhAVQGHr2JSFdKSjE3vKwE7", "frozen_duration": 3, "frozen_balance":2000000, "resource": "ENERGY", "visible": true } EOF

Input:

{

"owner_address": "WRSrWnjsK5ePhAVQGHr2JSFdKSjE3vKwE7", "frozen_duration": 3, "frozen_balance":2000000, "resource": "ENERGY", "visible": true

}

Response:

{

"visible": true, "txID": "b1f4bbec47e1b743bd6527c9cc0bb63db050e8da86b30a5d8c7ba5368da49d5a", "raw_data": { "contract": [ { "parameter": { "value": { "resource": "ENERGY", "frozen_duration": 3, "frozen_balance": 2000000, "owner_address": "WRSrWnjsK5ePhAVQGHr2JSFdKSjE3vKwE7" }, "type_url": "type.googleapis.com/protocol.FreezeBalanceContract" }, "type": "FreezeBalanceContract" } ], "ref_block_bytes": "83ce", "ref_block_hash": "de07f3deb051961a", "expiration": 1639400256000, "timestamp": 1639400196186 }, "raw_data_hex": "0a0283ce2208de07f3deb051961a4080e4fa9edb2f5a59080b12550a32747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e467265657a6542616c616e6365436f6e7472616374121f0a1541a9c46373aeb4749e3ce45aca242b027a46f486f91080897a1803500170da90f79edb2f"

}

=> Continue call gettransactionsign API then call broadcasttransaction API

We will the final result: The transaction created success on WEL network.

{

"result": true,

"txid": "b1f4bbec47e1b743bd6527c9cc0bb63db050e8da86b30a5d8c7ba5368da49d5a"

}

Last updated