[Utopian Dev] Add Wallet's Claim Rewards

in #utopian-io7 years ago (edited)

image.png

This is another installment for porting the busy wallet to Utopian.

New Feature

  • Wallet Claim Rewards

  • image.png

  • image.png

Added updateAuthUser action and reducer that gets the user account to update the ClaimRewardsBlock once the user clicks on the Claim rewards button.

  • image.png

Added the ClaimRewardsBlock on the right side bar.

  • image.png

Modified the sc2 (Steem Connect v2) to support broadcast with callback. Added the claimRewardBalance() sc2 method.

In busy's latest codes from master, they used an updated version of sc2-sdk (v1.0.1). I had to decide whether to switch to that latest version or retain the current sc2-sdk that Utopian uses (v.0.0.5).

I decided to go with the latter and ported the codes from v1.0.1 to Utopian's local copy sc2.js.

  • Added the callback (cb) parameter to the broadcast function.

image.png

  • Added the claimRewardBalance() function.
function claimRewardBalance(account, rewardSteem, rewardSbd, rewardVests, cb) {
  var params = {
    account: account,
    reward_steem: rewardSteem,
    reward_sbd: rewardSbd,
    reward_vests: rewardVests
  };
  return broadcast([['claim_reward_balance', params]], cb);
};

Original source code licensed under MIT License. Copyright Busy.



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

Great post, clean code. Good use of animated gif.
Keep it up!

You can contact us on Discord.
[utopian-moderator]

Hey @helo, I just gave you a tip for your hard work on moderation. Upvote this comment to support the utopian moderators and increase your future rewards!

Hey @eastmael I am @utopian-io. I have just upvoted you!

Achievements

  • WOW WOW WOW People loved what you did here. GREAT JOB!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Thanks for sharing...

You've been very supportive to others...

Salamat.

Thank you. Just giving back what I received.

I like your post

Interesting

Nice post.I respect you very much because you contribute to steemit.I will do activities like you.I would like to extend the steemit