Find answers instantly with AI search. Start typing your prompt below and let AI do the digging for you!

Un-staking Tokens

Command

Tokens staked on SSC can be un-staked (unbonded) by using the following command:

sscd tx staking unbond <validator operator address> <amount-to-unbond> --from <key>
$ sscd tx staking unbond sagavaloper1rdssl22ysxyendrkh2exw9zm7hvj8d2jj6rezq \
30usaga --from ashish \
--node <address of an SSC node e.g. tcp://134.167.114.164:26657> \
--chain-id <Chain Id of the SSC chain e.g. ssc-1>
auth_info:
  fee:
    amount: []
    gas_limit: "200000"
    granter: ""
    payer: ""
  signer_infos: []
  tip: null
body:
  extension_options: []
  memo: ""
  messages:
  - '@type': /cosmos.staking.v1beta1.MsgUndelegate
    amount:
      amount: "30"
      denom: usaga
    delegator_address: saga1rdssl22ysxyendrkh2exw9zm7hvj8d2ju346g3
    validator_address: sagavaloper1rdssl22ysxyendrkh2exw9zm7hvj8d2jj6rezq
  non_critical_extension_options: []
  timeout_height: "0"
signatures: []
confirm transaction before signing and broadcasting [y/N]: y
code: 0
codespace: ""
data: ""
events: []
gas_used: "0"
gas_wanted: "0"
height: "0"
info: ""
logs: []
raw_log: '[]'
timestamp: ""
tx: null
txhash: 3A53E1C1C27A0E18F3A762095A89BF1E413736F9835063F64E99595735E98DFA

The above transaction was successful.

Next, we can check the delegated amounts to this validator and also see other information about the tokens we have unbonded.

sscd q staking delegations-to sagavaloper1rdssl22ysxyendrkh2exw9zm7hvj8d2jj6rezq
delegation_responses:
- balance:
    amount: "49000000000000"
    denom: usaga
  delegation:
    delegator_address: saga1rdssl22ysxyendrkh2exw9zm7hvj8d2ju346g3
    shares: "49000000000000.000000000000000000"
    validator_address: sagavaloper1rdssl22ysxyendrkh2exw9zm7hvj8d2jj6rezq
pagination:
  next_key: null
  total: "0"

As mentioned above, the balance of the delegated amount and delegation shares does show as reduced by the amount of tokens unbonded, however these tokens are still not available for use.

Checking Unbonding-In-Progress Tokens

Tokens that were unbonded but are not fully available for use can be queried by:

$ sscd q staking unbonding-delegation saga1rdssl22ysxyendrkh2exw9zm7hvj8d2ju346g3 \
 sagavaloper1rdssl22ysxyendrkh2exw9zm7hvj8d2jj6rezq
delegator_address: saga1rdssl22ysxyendrkh2exw9zm7hvj8d2ju346g3
entries:
- balance: "30"
  completion_time: "2023-10-29T02:03:14.886680756Z"
  creation_height: "37172"
  initial_balance: "30"
  unbonding_id: "3"
  unbonding_on_hold_ref_count: "0"
validator_address: sagavaloper1rdssl22ysxyendrkh2exw9zm7hvj8d2jj6rezq

These tokens can be re-delegated to another validator immediately, but they cannot be withdrawn or be available for general use until the completion_time has passed, which in this example is 2023-10-29T02:03:14.886680756Z.

Last updated