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

Commit

Permalink
Supernode program (#687)
Browse files Browse the repository at this point in the history
* feat: init node rewards modules (#678)

* feat: init node rewards modules

* fix: clean up comment

* [node-rewards-program] task: add service to communicate with API #679

* [node-rewards-program] task: add service

add methods: prepareEnrollTransaction, checkEnrollmentAddress, checkEnrollmentStatus and getEnrollmentHash

* [node-rewards-program] fix: typo in error message

* [node-rewards-program] fix: typo in class name

* [node-rewards-program] task: add tests

* [node-rewards-program] fix: fetch mock, improve prepareEnrollTransaction test, register service, cleanup

* [node-rewards-program] feat: add getNodePayouts() and getNodeInfo() methods, add unit tests

* [node-rewards-program] fix: typo in jsdoc

* [node-rewards-program] fix: test comments

* [node-rewards-program] fix: remove whitespaces

* [node-rewards-program] task: refactor fetch requests

* [node-rewards-program] task: refactor the enrollment and error tests, remove unused variable

* [node-rewards-program] task: update codeword test, fix runPromiseErrorTest helper

* [node-rewards-program] task: add enrollment tab component (#681)

* feat: add account selection section

* build: add object-rest-spread plugins

* feat: add node reward program alert message

* [node-rewards-program] feat: add UI Tab component

* [node-rewards-program] task: refactor UI and typo

* [node-rewards-program] task: node reward controller

* [node-rewards-program] task: add unit test

* [node-rewards-program] task: fix typo

* [node-rewards-program] task: fix send enrollment logic

* [node-rewards-program] task: refactor on assign selected account

* [node-rewards-program] task: refactor on tab and rename

* [node-rewards-program] task: fix typo and lint

* [node-rewards-program] task: change from toFixed to ceil

* [node-rewards-program] task: minor refactor on unit test

* Enhancement and feedback (#682)

* [node-rewards-program] task: fix send enrollment logic

* [node-rewards-program] task: fix typo and lint

* [node-rewards-program] fix: change payout table width

* [node-rewards-program] fix: format endpoint url to display only hostname

* [node-rewards-program] feat: add last round payout property into Status tab

* [node-rewards-program] fix: replace money bag icon

* [node-rewards-program] perf: add check required params before calling API services

* [node-rewards-program] feat: add validation for codeword hash

* [node-rewards-program] fix: assign public key for new created account

* [node-rewards-program] fix: allow update domain name when account enrolled

* [node-rewards-program] task: enable hardware wallet enrollment

* [node-rewards-program] task: fix typo

* [node-rewards-program] task: rename module to superNode program (#683)

* [node-rewards-program] bug: fix minor bug and refactor. (#684)

* [node-rewards-program] task: add count params in getNodePayouts

* [node-rewards-program] bug: fix unable send enrollement tx to update domain name

* [node-rewards-program] task: removed unused method

* [node-rewards-program] task: rename enroll in program and form data node host

* [node-rewards-program] task: refactor on the logic

* [node-rewards-program] task: new validation alert for node host

* [node-rewards-program] task: update invalid node host message

* [node-rewards-program] task: duplicated lastPayoutRound in unit test

* [node-rewards-program] task: patch fix handle lastPayoutRound in null

* [node-rewards-program] task: add translation (#685)

* [node-rewards-program] task: add chinese translation

* [node-rewards-program] task: add spanish translation

* [node-rewards-program] task: add italian translation

* [node-rewards-program] task: add japanese translation

* [node-rewards-program] task: add polish translation

* [node-rewards-program] task: add russian translation

* [node-rewards-program] task: patch spanish translation

* [node-rewards-program] task: add ukrainian translation

* [node-rewards-program] task: patch italian translation

* [node-rewards-program] task: add default translation in German, Nederlands and Portuguese

* [node-rewards-program] task: patch Polish translation

* [node-rewards-program] task: patch latest supernode program url and api endpoint

* [node-rewards-program] task: patch minor fix

Co-authored-by: OlegMakarenko <[email protected]>
  • Loading branch information
AnthonyLaw and OlegMakarenko authored Jul 28, 2022
1 parent 631def2 commit e84743f
Show file tree
Hide file tree
Showing 31 changed files with 2,416 additions and 30 deletions.
6 changes: 4 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ gulp.task('browserify', ['views'], function() {
plugins: [
"syntax-dynamic-import",
"transform-runtime",
"transform-async-to-generator"
"transform-async-to-generator",
["transform-object-rest-spread", { "useBuiltIns": true }]
],
ignore: /(bower_components)|(node_modules)/
}))
Expand All @@ -83,7 +84,8 @@ gulp.task('browserifyTests', function() {
plugins: [
"syntax-dynamic-import",
"transform-runtime",
"transform-async-to-generator"
"transform-async-to-generator",
["transform-object-rest-spread", { "useBuiltIns": true }]
],
ignore: /(bower_components)|(node_modules)/
}))
Expand Down
16 changes: 16 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"angular-translate": "2.11.0",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-plugin-transform-async-to-generator": "^6.24.1",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-es2015": "^6.3.13",
"babelify": "^7.2.0",
Expand Down
2 changes: 2 additions & 0 deletions src/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import './modules/domainNameSystem';
import './modules/importWalletQrCode';
import './modules/NEMonster';
import './modules/catapultOptin';
import './modules/superNodeProgram';

// Create and bootstrap application
const requires = [
Expand Down Expand Up @@ -116,6 +117,7 @@ const requires = [
'app.dnsSearch',
'app.NEMonster',
'app.importWalletQrCode',
'app.superNodeProgram',
'app.catapultOptin'
];

Expand Down
4 changes: 2 additions & 2 deletions src/app/modules/home/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h1 ng-bind="::$ctrl.appName"></h1>
<i class="fa fa-th fa-4x"></i>
</div>
<div class="col-md-1" ng-mouseover="$ctrl.showInfo = 5">
<img src="images/symbol.jpg" style="width: 4em;"></i>
<img src="images/moneyBag.png" style="width: 4em;"></i>
</div>
<div class="col-md-1" ng-mouseover="$ctrl.showInfo = 6">
<i class="fa fa-chain fa-4x"></i>
Expand Down Expand Up @@ -56,7 +56,7 @@ <h1 ng-bind="::$ctrl.appName"></h1>
<p>{{ 'PORTAL_HARVESTING_TEXT' | translate }}</p>
</div>
<div ng-show="$ctrl.showInfo === 5">
<p>{{ 'PORTAL_CATAPULTOPTIN_TEXT' | translate }}</p>
<p>{{ 'PORTAL_SUPER_NODE_PROGRAM_TEXT' | translate }}</p>
</div>
<div ng-show="$ctrl.showInfo === 6">
<p>{{ 'PORTAL_APOSTILLE_TEXT' | translate }}</p>
Expand Down
41 changes: 39 additions & 2 deletions src/app/modules/languages/cn.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,10 @@ function ChineseProvider($translateProvider) {
PORTAL_ADDRESS_BOOK_TEXT: ' 将标签分配给地址以轻松跟踪联系人.',
PORTAL_ADDRESS_BOOK_BTN: '地址簿管理',
PORTAL_INVOICE_TEXT: '创建账单以通过QR码共享',
PORTAL_SUPER_NODE_PROGRAM_TITLE: '超级节点活动',
PORTAL_SUPER_NODE_PROGRAM_TEXT: '参与超级节点活动以获得$XEM和保护网络,最低参与资格只需 10,000 XEM 起。',
PORTAL_SUPER_NODE_PROGRAM_TEXT_LINK: '点击此处.',
PORTAL_SUPER_NODE_PROGRAM_BTN_1: '查看超级节点活动',

// ADDRESS BOOK MODULE
ADDRESS_BOOK_TITLE: '地址簿”',
Expand Down Expand Up @@ -723,7 +727,7 @@ function ChineseProvider($translateProvider) {
FAQ_ANSWER_6_WEBSITE: '官方网站',
FAQ_ANSWER_6_BTT: '官方BTT帖子',
FAQ_QUESTION_7: '仪表板上没有显示任何内容',
FAQ_ANSWER_7: '请您务必检查顶部导航栏中的节点圆. <br> 红色圆圈表示与节点的连接失败. <br> 点击“节点”并从下拉列表中选择另一个或使用自定义节点。. <br> <a href="https://supernodes.nem.io" target="_blank">Supernodes.nem.io</a> 有很多可以使用的节点.</a>',
FAQ_ANSWER_7: '请您务必检查顶部导航栏中的节点圆. <br> 红色圆圈表示与节点的连接失败. <br> 点击“节点”并从下拉列表中选择另一个或使用自定义节点。. <br> <a href="https://www.nem.io/supernode" target="_blank">Supernode</a> 有很多可以使用的节点.</a>',
FAQ_QUESTION_8: '签署人不会看到签署交易。',
FAQ_ANSWER_8: '在这种情况下,请转到“服务”, 寻找“多重签名和多用户帐户”并点击“签署多重交易”.',
FAQ_QUESTION_9: '什么是最好的安全措施 ?',
Expand Down Expand Up @@ -992,7 +996,40 @@ function ChineseProvider($translateProvider) {
POST_OPTIN_CONFIRM_MODAL_CHECKBOX: "我确认Symbol目标地址与我的Symbol帐户地址匹配",
POST_OPTIN_CONFIRM_MODAL_TEXT_MULTISIG: "请确认 Symbol 目标地址是您的 Symbol 多重签名帐户地址。如果不匹配,请重新开始该过程并提供多重签名帐户的有效Symbol公钥。",
POST_OPTIN_CONFIRM_MODAL_CHECKBOX_MULTISIG: "我确认 Symbol 目标地址与 Symbol 多重签名帐户地址匹配",
OPTIN_NIS1_PUBLIC_KEY: '您输入的公钥是 NIS1 密钥!您需要输入一个Symbol公钥。'
OPTIN_NIS1_PUBLIC_KEY: '您输入的公钥是 NIS1 密钥!您需要输入一个Symbol公钥。',

// SUPERNODE PROGRAM MODULE
SUPER_NODE_PROGRAM_TITLE: '超级节点活动',
ACCOUNT_NAME: '帐户',
BALANCE_NAME: '余额',
TAB_STATUS_NAME: '状态',
TAB_ENROLL_IN_PROGRAM_NAME: '参与活动',
TAB_PAYOUT_HISTORY_NAME: '支付历史',

STATUS_NODE_NAME: '节点名字',
STATUS_NAME: '状态',
STATUS_ACTIVE_NAME: '活跃',
STATUS_INACTIVE_NAME: '待用',
STATUS_PUBLIC_KEY_NAME: '公钥',
STATUS_REMOTE_PUBLIC_KEY_NAME: '远程公钥',
STATUS_LAST_PAYOUT_ROUND_NAME: '最后一轮支付',
STATUS_TOTAL_REWARDS_NAME: '总奖励',

ENROLL_IN_PROGRAM_ADDRESS_NAME: '参与地址',
ENROLL_IN_PROGRAM_NODE_HOST: '节点主机',
ENROLL_IN_PROGRAM_BUTTON_NAME: '参与',

PAYOUT_HISTORY_FROM_NAME: '从',
PAYOUT_HISTORY_TO_NAME: '至',
PAYOUT_HISTORY_AMOUNT_NAME: '量',
PAYOUT_HISTORY_TRANSACTION_HASH_NAME: '交易哈希',
PAYOUT_HISTORY_DATE_NAME: '日期',

INVALID_ENROLLMENT_ADDRESS: '注册地址无效.',
ADDRESS_ENROLLED: '当前地址已注册.',
INVALID_CODEWORD_HASH: 'codeword哈希无效.',
ACCOUNT_MISSING_PUBLICKEY: '这账户必须进行一次交易来获取公钥.',
INVALID_FORMAT_NODE_HOST: '不允许使用协议 (http://) 和端口 (:7890).',
});

}
Expand Down
41 changes: 39 additions & 2 deletions src/app/modules/languages/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,10 @@ function GermanProvider($translateProvider) {
PORTAL_ADDRESS_BOOK_TEXT: 'Adressen können mit Labeln versehen werden. Diese vereinfachen die Verwaltung Ihrer Kontakte',
PORTAL_ADDRESS_BOOK_BTN: 'Adressbuch verwalten',
PORTAL_INVOICE_TEXT: 'Create an invoice to share via QR code',
PORTAL_SUPER_NODE_PROGRAM_TITLE: 'SuperNode Program',
PORTAL_SUPER_NODE_PROGRAM_TEXT: 'Enroll in the SuperNode Program to earn $XEM for securing the network. Minimum 10,000 XEM required.',
PORTAL_SUPER_NODE_PROGRAM_TEXT_LINK: 'Read more here.',
PORTAL_SUPER_NODE_PROGRAM_BTN_1: 'Check & Enroll in Program',

// ADDRESS BOOK MODULE
ADDRESS_BOOK_TITLE: 'Adressbuch',
Expand Down Expand Up @@ -720,7 +724,7 @@ function GermanProvider($translateProvider) {
FAQ_ANSWER_6_WEBSITE: 'Offizielle Webseite',
FAQ_ANSWER_6_BTT: 'Offizieller BitcoinTalk Thread',
FAQ_QUESTION_7: 'Nothing is shown on the dashboard',
FAQ_ANSWER_7: 'Please be sure to check the node circle in the top navigation bar. <br> Red circle means that connection to the node failed. <br> Click on "Node" and select another one from the dropdown list or use a custom node. <br> <a href="https://supernodes.nem.io" target="_blank">Supernodes.nem.io</a> has a lot of nodes that you can use.</a>',
FAQ_ANSWER_7: 'Please be sure to check the node circle in the top navigation bar. <br> Red circle means that connection to the node failed. <br> Click on "Node" and select another one from the dropdown list or use a custom node. <br> <a href="https://www.nem.io/supernode" target="_blank">Supernode</a> has a lot of nodes that you can use.</a>',
FAQ_QUESTION_8: 'Cosignatories cannot see the transaction to sign',
FAQ_ANSWER_8: 'In this case go to "Services", look for "Multisignature and Multi-User Accounts" and click on "Sign multisig transactions".',
FAQ_QUESTION_9: 'What are the best security practices ?',
Expand Down Expand Up @@ -998,7 +1002,40 @@ function GermanProvider($translateProvider) {
POST_OPTIN_CONFIRM_MODAL_CHECKBOX: "I confirm that the Symbol destination address matches my Symbol account address",
POST_OPTIN_CONFIRM_MODAL_TEXT_MULTISIG: "Please verify that the Symbol destination address is your Symbol multisig account address. If it doesn’t match, please start the process again and provide a valid Symbol public key of the multisig account.",
POST_OPTIN_CONFIRM_MODAL_CHECKBOX_MULTISIG: "I confirm that the Symbol destination address matches the Symbol multisig account address",
OPTIN_NIS1_PUBLIC_KEY: 'The public key you entered is a NIS1 key! You need to enter a Symbol public key.'
OPTIN_NIS1_PUBLIC_KEY: 'The public key you entered is a NIS1 key! You need to enter a Symbol public key.',

// SUPERNODE PROGRAM MODULE
SUPER_NODE_PROGRAM_TITLE: 'NEM SUPERNODE PROGRAM',
ACCOUNT_NAME: 'Account',
BALANCE_NAME: 'Balance',
TAB_STATUS_NAME: 'Status',
TAB_ENROLL_IN_PROGRAM_NAME: 'Enroll in Program',
TAB_PAYOUT_HISTORY_NAME: 'Payout History',

STATUS_NODE_NAME: 'Node Name',
STATUS_NAME: 'Status',
STATUS_ACTIVE_NAME: 'Active',
STATUS_INACTIVE_NAME: 'Inactive',
STATUS_PUBLIC_KEY_NAME: 'Public Key',
STATUS_REMOTE_PUBLIC_KEY_NAME: 'Remote Public Key',
STATUS_LAST_PAYOUT_ROUND_NAME: 'Last Payout Round',
STATUS_TOTAL_REWARDS_NAME: 'Total Rewards',

ENROLL_IN_PROGRAM_ADDRESS_NAME: 'Enroll Address',
ENROLL_IN_PROGRAM_NODE_HOST: 'Node Host',
ENROLL_IN_PROGRAM_BUTTON_NAME: 'Enroll in Program',

PAYOUT_HISTORY_FROM_NAME: 'From Round',
PAYOUT_HISTORY_TO_NAME: 'To Round',
PAYOUT_HISTORY_AMOUNT_NAME: 'Amount',
PAYOUT_HISTORY_TRANSACTION_HASH_NAME: 'Transaction Hash',
PAYOUT_HISTORY_DATE_NAME: 'Date',

INVALID_ENROLLMENT_ADDRESS: 'Invalid enrollment address.',
ADDRESS_ENROLLED: 'Current address already enrolled to this period.',
INVALID_CODEWORD_HASH: 'Invalid codeword hash.',
ACCOUNT_MISSING_PUBLICKEY: 'You need to make a transaction to get a public key.',
INVALID_FORMAT_NODE_HOST: 'Protocol (http://) and port (:7890) are not allowed.',
});

}
Expand Down
41 changes: 39 additions & 2 deletions src/app/modules/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,10 @@ function EnglishProvider($translateProvider) {
PORTAL_ADDRESS_BOOK_BTN: 'Manage address book',
PORTAL_INVOICE_TEXT: 'Create an invoice to share via QR code',
PORTAL_SIGNED_MSG_TEXT: 'Create and verify signed messages to authenticate account ownership without transacting.',
PORTAL_SUPER_NODE_PROGRAM_TITLE: 'SuperNode Program',
PORTAL_SUPER_NODE_PROGRAM_TEXT: 'Enroll in the SuperNode Program to earn $XEM for securing the network. Minimum 10,000 XEM required.',
PORTAL_SUPER_NODE_PROGRAM_TEXT_LINK: 'Read more here.',
PORTAL_SUPER_NODE_PROGRAM_BTN_1: 'Check & Enroll in Program',

// ADDRESS BOOK MODULE
ADDRESS_BOOK_TITLE: 'Address book',
Expand Down Expand Up @@ -729,7 +733,7 @@ function EnglishProvider($translateProvider) {
FAQ_ANSWER_6_WEBSITE: 'Official website',
FAQ_ANSWER_6_BTT: 'Official BitcoinTalk thread',
FAQ_QUESTION_7: 'Nothing is shown on the dashboard',
FAQ_ANSWER_7: 'Please be sure to check the node circle in the top navigation bar. <br> Red circle means that connection to the node failed. <br> Click on "Node" and select another one from the dropdown list or use a custom node. <br> <a href="https://supernodes.nem.io" target="_blank">Supernodes.nem.io</a> has a lot of nodes that you can use.</a>',
FAQ_ANSWER_7: 'Please be sure to check the node circle in the top navigation bar. <br> Red circle means that connection to the node failed. <br> Click on "Node" and select another one from the dropdown list or use a custom node. <br> <a href="https://www.nem.io/supernode" target="_blank">Supernode</a> has a lot of nodes that you can use.</a>',
FAQ_QUESTION_8: 'Cosignatories cannot see the transaction to sign',
FAQ_ANSWER_8: 'In this case go to "Services", look for "Multisignature and Multi-User Accounts" and click on "Sign multisig transactions".',
FAQ_QUESTION_9: 'What are the best security practices ?',
Expand Down Expand Up @@ -1048,7 +1052,40 @@ function EnglishProvider($translateProvider) {
POST_OPTIN_CONFIRM_MODAL_CHECKBOX: "I confirm that the Symbol destination address matches my Symbol account address",
POST_OPTIN_CONFIRM_MODAL_TEXT_MULTISIG: "Please verify that the Symbol destination address is your Symbol multisig account address. If it doesn’t match, please start the process again and provide a valid Symbol public key of the multisig account.",
POST_OPTIN_CONFIRM_MODAL_CHECKBOX_MULTISIG: "I confirm that the Symbol destination address matches the Symbol multisig account address",
OPTIN_NIS1_PUBLIC_KEY: 'The public key you entered is a NIS1 key! You need to enter a Symbol public key.'
OPTIN_NIS1_PUBLIC_KEY: 'The public key you entered is a NIS1 key! You need to enter a Symbol public key.',

// SUPERNODE PROGRAM MODULE
SUPER_NODE_PROGRAM_TITLE: 'NEM SUPERNODE PROGRAM',
ACCOUNT_NAME: 'Account',
BALANCE_NAME: 'Balance',
TAB_STATUS_NAME: 'Status',
TAB_ENROLL_IN_PROGRAM_NAME: 'Enroll in Program',
TAB_PAYOUT_HISTORY_NAME: 'Payout History',

STATUS_NODE_NAME: 'Node Name',
STATUS_NAME: 'Status',
STATUS_ACTIVE_NAME: 'Active',
STATUS_INACTIVE_NAME: 'Inactive',
STATUS_PUBLIC_KEY_NAME: 'Public Key',
STATUS_REMOTE_PUBLIC_KEY_NAME: 'Remote Public Key',
STATUS_LAST_PAYOUT_ROUND_NAME: 'Last Payout Round',
STATUS_TOTAL_REWARDS_NAME: 'Total Rewards',

ENROLL_IN_PROGRAM_ADDRESS_NAME: 'Enroll Address',
ENROLL_IN_PROGRAM_NODE_HOST: 'Node Host',
ENROLL_IN_PROGRAM_BUTTON_NAME: 'Enroll in Program',

PAYOUT_HISTORY_FROM_NAME: 'From Round',
PAYOUT_HISTORY_TO_NAME: 'To Round',
PAYOUT_HISTORY_AMOUNT_NAME: 'Amount',
PAYOUT_HISTORY_TRANSACTION_HASH_NAME: 'Transaction Hash',
PAYOUT_HISTORY_DATE_NAME: 'Date',

INVALID_ENROLLMENT_ADDRESS: 'Invalid enrollment address.',
ADDRESS_ENROLLED: 'Current address already enrolled to this period.',
INVALID_CODEWORD_HASH: 'Invalid codeword hash.',
ACCOUNT_MISSING_PUBLICKEY: 'You need to make a transaction to get a public key.',
INVALID_FORMAT_NODE_HOST: 'Protocol (http://) and port (:7890) are not allowed.',
});
}

Expand Down
Loading

0 comments on commit e84743f

Please sign in to comment.