Author Topic: Claiming my "Vested cashback balance"  (Read 2319 times)

0 Members and 1 Guest are viewing this topic.

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc

Offline pc

  • Hero Member
  • *****
  • Posts: 1530
    • View Profile
    • Bitcoin - Perspektive oder Risiko?
  • BitShares: cyrano
Would not be enough "withdraw_vesting joereform <amount> BTS true" ?

AFAIK withdraw_vesting can only withdraw witness income, i. e. block rewards, not cashback.
Bitcoin - Perspektive oder Risiko? ISBN 978-3-8442-6568-2 http://bitcoin.quisquis.de

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Ui .. thanks for showing "get_prototype_operation" .. didn't know this exists :)

Offline Bhuz

  • Committee member
  • Sr. Member
  • *
  • Posts: 467
    • View Profile
  • BitShares: bhuz


In the cli_wallet you'd basically do this:

Code: [Select]
locked >>> get_vesting_balances joereform
get_vesting_balances joereform
[{
    "id": "1.13.368",
    "owner": "1.2.16957",
    "balance": {
      "amount": 7418124,
      "asset_id": "1.3.0"
    },
    "policy": [
      1,{
        "vesting_seconds": 7776000,
        "start_claim": "1970-01-01T00:00:00",
        "coin_seconds_earned": "57683332224000",
        "coin_seconds_earned_last_update": "2015-11-23T02:00:00"
      }
    ],
    "allowed_withdraw": {
      "amount": 7418124,
      "asset_id": "1.3.0"
    },
    "allowed_withdraw_time": "2015-11-23T16:51:06"
  }
]

Take note of the id, the owner and the allowed_withdraw amount. Asset_id 1.3.0 is (unsurprisingly) BTS.

Now you need to know what a withdraw_vesting_balance operation looks like.

Code: [Select]
locked >>> get_prototype_operation vesting_balance_withdraw_operation
get_prototype_operation vesting_balance_withdraw_operation
[
  33,{
    "fee": {
      "amount": 0,
      "asset_id": "1.3.0"
    },
    "vesting_balance": "1.13.0",
    "owner": "1.2.0",
    "amount": {
      "amount": 0,
      "asset_id": "1.3.0"
    }
  }
]

This gives you the numeric operation id 33 and the general structure of the withdraw operation. Open a text editor and fill in the details with the  data from your own vesting_balance. It should look like this (but don't paste this into the cli_wallet command line yet):

Code: [Select]
[
  33,{
    "fee": {
      "amount": 0,
      "asset_id": "1.3.0"
    },
    "vesting_balance": "1.13.368",
    "owner": "1.2.16957",
    "amount": {
      "amount": 7418124,
      "asset_id": "1.3.0"
    }
  }
]

Now you must wrap the operation into a transaction. This is done using the transaction builder. Start a new transaction like this:

Code: [Select]
locked >>> begin_builder_transaction
begin_builder_transaction
0

Not the 0 at the end - this is the builder id. You'll need this for the next steps.
Now add the withdraw operation from above. You'll have to remove linefeeds before pasting the data into the CLI, I think:

Code: [Select]
locked >>> add_operation_to_builder_transaction 0 [ 33,{ "fee": { "amount": 0, "asset_id": "1.3.0" }, "vesting_balance": "1.13.368", "owner": "1.2.16957", "amount": { "amount": 7418124, "asset_id": "1.3.0" } } ]
add_operation_to_builder_transaction 0 [ 33,{ "fee": { "amount": 0, "asset_id": "1.3.0" }, "vesting_balance": "1.13.368", "owner": "1.2.16957", "amount": { "amount": 7418124, "asset_id": "1.3.0" } } ]
null

Now have it fill in the correct fee amount:

Code: [Select]
locked >>> set_fees_on_builder_transaction 0 BTS
set_fees_on_builder_transaction 0 BTS
{
  "amount": "100000000000000",
  "asset_id": "1.3.0"
}

Again, the 0 is the builder id, not the fee amount. As you can see, the fees for vesting withdrawals are currently ridiculously high. This is to avoid a bug that has triggered chain forks in the past. Once the bug is fixed you'll be able to withdraw for a reasonable fee.
Now, preview the resulting transaction:

Code: [Select]
locked >>> preview_builder_transaction 0
preview_builder_transaction 0
{
  "ref_block_num": 0,
  "ref_block_prefix": 0,
  "expiration": "1970-01-01T00:00:00",
  "operations": [[
      33,{
        "fee": {
          "amount": "100000000000000",
          "asset_id": "1.3.0"
        },
        "vesting_balance": "1.13.368",
        "owner": "1.2.16957",
        "amount": {
          "amount": 7418124,
          "asset_id": "1.3.0"
        }
      }
    ]
  ],
  "extensions": []
}

Now, if your wallet is unlocked and contains the private keys of your account, you can sign the transaction and broadcast it:

Code: [Select]
locked >>> sign_builder_transaction 0 true

Maybe I misunderstood the OP question...
Would not be enough "withdraw_vesting joereform <amount> BTS true" ?

Offline pc

  • Hero Member
  • *****
  • Posts: 1530
    • View Profile
    • Bitcoin - Perspektive oder Risiko?
  • BitShares: cyrano
In the cli_wallet you'd basically do this:

Code: [Select]
locked >>> get_vesting_balances joereform
get_vesting_balances joereform
[{
    "id": "1.13.368",
    "owner": "1.2.16957",
    "balance": {
      "amount": 7418124,
      "asset_id": "1.3.0"
    },
    "policy": [
      1,{
        "vesting_seconds": 7776000,
        "start_claim": "1970-01-01T00:00:00",
        "coin_seconds_earned": "57683332224000",
        "coin_seconds_earned_last_update": "2015-11-23T02:00:00"
      }
    ],
    "allowed_withdraw": {
      "amount": 7418124,
      "asset_id": "1.3.0"
    },
    "allowed_withdraw_time": "2015-11-23T16:51:06"
  }
]

Take note of the id, the owner and the allowed_withdraw amount. Asset_id 1.3.0 is (unsurprisingly) BTS.

Now you need to know what a withdraw_vesting_balance operation looks like.

Code: [Select]
locked >>> get_prototype_operation vesting_balance_withdraw_operation
get_prototype_operation vesting_balance_withdraw_operation
[
  33,{
    "fee": {
      "amount": 0,
      "asset_id": "1.3.0"
    },
    "vesting_balance": "1.13.0",
    "owner": "1.2.0",
    "amount": {
      "amount": 0,
      "asset_id": "1.3.0"
    }
  }
]

This gives you the numeric operation id 33 and the general structure of the withdraw operation. Open a text editor and fill in the details with the  data from your own vesting_balance. It should look like this (but don't paste this into the cli_wallet command line yet):

Code: [Select]
[
  33,{
    "fee": {
      "amount": 0,
      "asset_id": "1.3.0"
    },
    "vesting_balance": "1.13.368",
    "owner": "1.2.16957",
    "amount": {
      "amount": 7418124,
      "asset_id": "1.3.0"
    }
  }
]

Now you must wrap the operation into a transaction. This is done using the transaction builder. Start a new transaction like this:

Code: [Select]
locked >>> begin_builder_transaction
begin_builder_transaction
0

Not the 0 at the end - this is the builder id. You'll need this for the next steps.
Now add the withdraw operation from above. You'll have to remove linefeeds before pasting the data into the CLI, I think:

Code: [Select]
locked >>> add_operation_to_builder_transaction 0 [ 33,{ "fee": { "amount": 0, "asset_id": "1.3.0" }, "vesting_balance": "1.13.368", "owner": "1.2.16957", "amount": { "amount": 7418124, "asset_id": "1.3.0" } } ]
add_operation_to_builder_transaction 0 [ 33,{ "fee": { "amount": 0, "asset_id": "1.3.0" }, "vesting_balance": "1.13.368", "owner": "1.2.16957", "amount": { "amount": 7418124, "asset_id": "1.3.0" } } ]
null

Now have it fill in the correct fee amount:

Code: [Select]
locked >>> set_fees_on_builder_transaction 0 BTS
set_fees_on_builder_transaction 0 BTS
{
  "amount": "100000000000000",
  "asset_id": "1.3.0"
}

Again, the 0 is the builder id, not the fee amount. As you can see, the fees for vesting withdrawals are currently ridiculously high. This is to avoid a bug that has triggered chain forks in the past. Once the bug is fixed you'll be able to withdraw for a reasonable fee.
Now, preview the resulting transaction:

Code: [Select]
locked >>> preview_builder_transaction 0
preview_builder_transaction 0
{
  "ref_block_num": 0,
  "ref_block_prefix": 0,
  "expiration": "1970-01-01T00:00:00",
  "operations": [[
      33,{
        "fee": {
          "amount": "100000000000000",
          "asset_id": "1.3.0"
        },
        "vesting_balance": "1.13.368",
        "owner": "1.2.16957",
        "amount": {
          "amount": 7418124,
          "asset_id": "1.3.0"
        }
      }
    ]
  ],
  "extensions": []
}

Now, if your wallet is unlocked and contains the private keys of your account, you can sign the transaction and broadcast it:

Code: [Select]
locked >>> sign_builder_transaction 0 true
Bitcoin - Perspektive oder Risiko? ISBN 978-3-8442-6568-2 http://bitcoin.quisquis.de

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
The GUI currently does not yet support this operation. Devs are working on fixing pressing bugs right now ..
In the meantime, you could use the cli-wallet to claim your vested cashback .. but we don't have a proper documentation for it yet either :(

Offline joereform

I am a lifetime member running the GUI version of the light wallet. How do I claim the vesting cashback balance on my account?