BitShares Forum

Main => Technical Support => Topic started by: joereform on November 23, 2015, 08:16:21 am

Title: Claiming my "Vested cashback balance"
Post by: joereform on November 23, 2015, 08:16:21 am
I am a lifetime member running the GUI version of the light wallet. How do I claim the vesting cashback balance on my account?
Title: Re: Claiming my "Vested cashback balance"
Post by: xeroc on November 23, 2015, 08:26:09 am
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 :(
Title: Re: Claiming my "Vested cashback balance"
Post by: pc on November 23, 2015, 05:46:36 pm
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
Title: Re: Claiming my "Vested cashback balance"
Post by: Bhuz on November 23, 2015, 10:04:49 pm


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" ?
Title: Re: Claiming my "Vested cashback balance"
Post by: xeroc on November 24, 2015, 08:16:10 am
Ui .. thanks for showing "get_prototype_operation" .. didn't know this exists :)
Title: Re: Claiming my &quot;Vested cashback balance&quot;
Post by: pc on November 24, 2015, 04:59:08 pm
Would not be enough "withdraw_vesting joereform <amount> BTS true" ?

AFAIK withdraw_vesting can only withdraw witness income, i. e. block rewards, not cashback.
Title: Re: Claiming my "Vested cashback balance"
Post by: xeroc on November 24, 2015, 05:31:29 pm
That's what the doxygen docs say too:
https://bitshares.org/doxygen/classgraphene_1_1wallet_1_1wallet__api.html#a72d9316ead7ac6825fbcd62be81e235a

only witness pay