Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

NEM node rewards program support #677

Open
cryptoBeliever opened this issue Jun 7, 2022 · 1 comment · Fixed by #679
Open

NEM node rewards program support #677

cryptoBeliever opened this issue Jun 7, 2022 · 1 comment · Fixed by #679
Assignees

Comments

@cryptoBeliever
Copy link

cryptoBeliever commented Jun 7, 2022

What is the current behavior?

There is no NEM node rewards program support in the NEM wallet.

What is the expected behavior?

Add NEM node rewards service in NEM wallet.

Add a new module in Services for NEM Node Rewards Program:

list_of_servicesjpg

  • opt-in module (and related code) is not needed anymore - we can remove it
  • instead of an opt-in service we will add a node rewards program service

Select account component

On top of the screen there will be a selected "Account" component:

  • In case when current account is not a cosigner of any multisig accounts we should present not editable address (disabled input) and balance. Account should be considered as chosen and tabs should be presented.
  • In case when current account is a cosigner of any multisig accounts we should present a selector. Selector should contains current account with label "" + all multisig accounts (for which current account is cosigner) with label " - Multisig". When the user will choose an account, the balance field is filled and tabs are presented.

Status tab

tab_1_status

On this screen we should present registration data (if already registered):

  • node name
  • status (possible values Active - green, Inactive - red)
  • endpoint
  • public key
  • remote public key
  • total rewards

This data will be fetched using API /node/<main_public_key>
If response code will be 404 we should present no data placeholder "-" and "INACTIVE" status.

Payout History tab

image

Data fetched using /node/<node_id>/payouts (node_id is database id which is in response for /node/<main_public_key>)

Presented data:

  • from round - fromRoundId from api
  • to round - toRoundId from api
  • amount - amount is returned in microXEM but should be presented as relative (divided by 1,000,000)
  • transaction hash - hash should be link to explorer. if isPaid = false hash will be empty. In such situation we should present "-"
  • date - timestamp. Time should be converted using local user timezone

List should be paginated.

Enroll to Program tab

image

Form fields:

  • enroll address - address which user have from social media
  • ip/domain - IP or domain for node
  • fee - calculated fee. On screenshot fee for transaction + fee for multisig. In case of non-multisig there will be only one fee.
  • password - user password

Wallet on "Enroll" action should send transfer transaction:

  • to address = enroll address
  • with message enroll <ip_or_domain> <hash>

where hash should be fetch from api using /codeword/<main_public_key_str>

Validation:

  • wallet should block enroll if enroll address is not valid (validation based on api - /enrollment/check/address/<address_str> endpoint)
  • wallet should block enroll if current address already enrolled to this period. To check that wallet should first query /enrollment/successes/<main_public_key_str> get latest result (if exists) and recipientAddress from it. And next check recipientAddress against /enrollment/check/address/<address_str>

Re-enrollment:
If user is doing re-enrollment (node data are already returned by API) we should put automatically IP/domain based on endpoint returned by /node/<main_public_key> endpoint

@AnthonyLaw AnthonyLaw self-assigned this Jun 9, 2022
@OlegMakarenko OlegMakarenko self-assigned this Jun 10, 2022
@AnthonyLaw
Copy link

@cryptoBeliever For the Payout history tab.

date: I saw all the wallets are using UTC date, not sure it's a good idea to change to local date, it looks not consistent?

amount: if the value is 0 should add the Green Plus icon?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants