# Manage Account Resource

Sending transactions on the chain will consume gas resources. In addition to free gas resources, you can also stake TOP to exchange more gas resources.

The resource command is shown in the following table.

Command Description
topio resource stakeForGas Stake funds for gas.
topio resource withdrawFund Withdraw funds for gas.

# Stake Funds For Gas

The exchange ratio for gas is:

Snap55

The value changes by the TOP tokens staked in system.

An ordinary account can't obtain gas more than 200,000 Tgas(on-chain governance parameter) in 24-hour. This roughly equates to 800 transactions.

A contract account can't obtain more than 10,000,000 Tgas (on-chain governance parameter) in a 24-hour. This equates to 40,000 transactions or 4s of CPUT time.

Maximum gas of an account can exchange(24h)=Maximum gas of an account can obtain(24h)-free gas(24h)

Request

topio resource stakeForGas

Request Parameters

Parameter Name Required Default Value Type Description
top_num Yes - Double Staked TOP token, in TOP.

Options

Option Name Default Value Type Description
-h, --help - - Check the command's help information.

Response Parameters

Parameter Name Type Description
Transaction hash String The transaction hash that can be used to query the transaction consensus status.

Request Sample

Stake 1,000 TOP for gas.

topio resource stakeForGas 1000

Response Schema

  • Successful
Transaction hash: 0x16f7ba7580fd23b1c900323937b099c9e73c5d14df787c58de8f4388820ff1ba
Please use command 'topio querytx' to query transaction status later on!!!

Execute topio querytx to query the transaction, when the consensus final status is "success", execute topio chain queryAccount to query the account's total gas and available gas, if they have corresponding changes, then the stake is a success.

  • Failed
Transaction hash: 0xf7d951259032e9797d91a6a7d9590a845673da03a54e54fa776c2fec85afec06
Please use command 'topio querytx' to query transaction status later on!!!

Execute topio querytx to query the transaction, when the consensus final status is "failure", then failed to stake for gas.

# Withdraw Funds For Gas

After initiating the withdrawn, you have to wait 24 hours and send a transaction (not a query) before the TOP tokens are received.

Withdraw rules:

According to the ratio of withdrawn TOP to total staked TOP, the corresponding gas is released from the account. For example, staked 1200 TOP exchanges 1500Tgas and withdraw 400 TOP, which accounts for 1/3 of the total staked TOP. Accordingly, 1/3 of the total gas is released, that is, 500 Tgas.

Request

topio resource withdrawFund 

Request Parameters

Parameter Name Required Default Value Type Description
top_num - Double Withdrawn TOP tokens, in TOP.

Options

Option Name Default Value Description
-h, --help - - Check the command's help information.

Response Parameters

Parameter Name Type Description
Transaction hash String The transaction hash that can be used to query the transaction consensus status.

Request Sample

Withdraw 100 TOP.

topio resource withdrawFund 1000

Response Sample

  • Successful
Transaction hash: 0xb83f304a26d2ffe6a3b59eb01fd5269218367481c55b4ec15d60abdc6129380d
Please use command 'topio querytx' to query transaction status later on!!!

Execute topio querytx to query the transaction by transaction hash, when the consensus final status is a "success", execute topio chain queryAccount to query the account's available gas, if it has corresponding change, then succeed to withdraw TOP tokens.

  • Failed

Execute topio querytx to query the transaction by transaction hash, when the consensus final status is a "failure", then failed to withdraw TOP tokens.