From 6e92785af3f5bc10e288cfb6a3f6be9ec51fc011 Mon Sep 17 00:00:00 2001 From: Yechan Kim Date: Thu, 21 Sep 2023 20:36:57 +0900 Subject: [PATCH 1/8] Dropped the version comparison job --- .drone.yml | 62 +++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/.drone.yml b/.drone.yml index 9b6f7e2dfc..5a89e386bf 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,39 +1,39 @@ -kind: pipeline -type: docker -name: block_duplicated_pr_merged +# kind: pipeline +# type: docker +# name: block_duplicated_pr_merged -steps: -- name: current_hollaex_kit_version - image: alpine - commands: - - export PACKAGE_VERSION="$(cat version)" && echo "$PACKAGE_VERSION" > .tags_current - - echo "Current Release tag is :" && cat .tags_current +# steps: +# - name: current_hollaex_kit_version +# image: alpine +# commands: +# - export PACKAGE_VERSION="$(cat version)" && echo "$PACKAGE_VERSION" > .tags_current +# - echo "Current Release tag is :" && cat .tags_current -- name: previous_hollaex_kit_version - image: byrnedo/alpine-curl - commands: - - curl https://raw.githubusercontent.com/hollaex/hollaex-kit/master/version > .tags_previous - - echo "The previous master release tag is :" && cat .tags_previous +# - name: previous_hollaex_kit_version +# image: byrnedo/alpine-curl +# commands: +# - curl https://raw.githubusercontent.com/hollaex/hollaex-kit/master/version > .tags_previous +# - echo "The previous master release tag is :" && cat .tags_previous -- name: version_comparison - image: frolvlad/alpine-bash - commands: - - export TAGS_CURRENT=$(cat .tags_current) && export TAGS_PREVIOUS=$(cat .tags_previous) && if [ "$TAGS_PREVIOUS" == "$TAGS_CURRENT" ]; then echo "Blocking the merge since the versions are same..." && exit 1; else echo "hi"; fi +# - name: version_comparison +# image: frolvlad/alpine-bash +# commands: +# - export TAGS_CURRENT=$(cat .tags_current) && export TAGS_PREVIOUS=$(cat .tags_previous) && if [ "$TAGS_PREVIOUS" == "$TAGS_CURRENT" ]; then echo "Blocking the merge since the versions are same..." && exit 1; else echo "hi"; fi -- name: slack_noti_job_end - image: plugins/slack - settings: - channel: deployment - webhook: - from_secret: slack_webhook - when: - status: [failure] +# - name: slack_noti_job_end +# image: plugins/slack +# settings: +# channel: deployment +# webhook: +# from_secret: slack_webhook +# when: +# status: [failure] -trigger: - branch: - - master - event: - - pull_request +# trigger: +# branch: +# - master +# event: +# - pull_request # --- From 0f6bea254588b527fe8830b1d113057476c76d79 Mon Sep 17 00:00:00 2001 From: Yechan Kim Date: Thu, 21 Sep 2023 21:39:23 +0900 Subject: [PATCH 2/8] Update .drone.yml --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 5a89e386bf..994d9815b5 100644 --- a/.drone.yml +++ b/.drone.yml @@ -282,7 +282,7 @@ steps: - cat .tags - docker manifest create hollaex/hollaex-kit:$(cat .tags) hollaex/hollaex-kit:$(cat .tags)-amd64 hollaex/hollaex-kit:$(cat .tags)-arm64v8 --amend - docker manifest annotate hollaex/hollaex-kit:$(cat .tags) hollaex/hollaex-kit:$(cat .tags)-amd64 --arch amd64 - - docker manifest annotate hollaex/hollaex-kit:$(cat .tags) hollaex/hollaex-kit:$(cat .tags)-arm64v8 --arch arm64v8 + - docker manifest annotate hollaex/hollaex-kit:$(cat .tags) hollaex/hollaex-kit:$(cat .tags)-arm64v8 --arch arm64 - docker manifest push hollaex/hollaex-kit:$(cat .tags) when: branch: master From 508777af051a7c4bcff1907a37a10518e2f7432e Mon Sep 17 00:00:00 2001 From: fetok12 Date: Thu, 21 Sep 2023 23:20:38 +0300 Subject: [PATCH 3/8] Fix deposit withdrawal notification --- server/api/controllers/notification.js | 2 ++ server/ws/sub.js | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/server/api/controllers/notification.js b/server/api/controllers/notification.js index 0834ab05b5..4a10a214d1 100644 --- a/server/api/controllers/notification.js +++ b/server/api/controllers/notification.js @@ -90,6 +90,7 @@ const handleCurrencyDeposit = (req, res) => { topic: 'deposit', action: 'insert', user_id: user.id, + user_network_id: user.network_id, data: depositData, time: moment().unix() })); @@ -186,6 +187,7 @@ const handleCurrencyWithdrawal = (req, res) => { topic: 'withdrawal', action: 'insert', user_id: user.id, + user_network_id: user.network_id, data: data, time: moment().unix() })); diff --git a/server/ws/sub.js b/server/ws/sub.js index 82800907c2..8f6dcdd4fa 100644 --- a/server/ws/sub.js +++ b/server/ws/sub.js @@ -327,8 +327,9 @@ const handleDepositWithdrawalData = (data) => { switch (data.topic) { case 'deposit': case 'withdrawal': - each(getChannels()[WEBSOCKET_CHANNEL(data.topic, data.user_id)], (ws) => { + each(getChannels()[WEBSOCKET_CHANNEL(data.topic, data.user_network_id)], (ws) => { if (ws.readyState === WebSocket.OPEN) { + delete data.user_network_id; ws.send(JSON.stringify(data)); } }); From 1e9f452b4db138cf60dcbddc366bb05c481ab6ac Mon Sep 17 00:00:00 2001 From: Ali Beikverdi Date: Fri, 22 Sep 2023 13:44:15 +0900 Subject: [PATCH 4/8] version update --- server/api/swagger/swagger.js | 2 +- server/package.json | 2 +- version | 2 +- web/package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/api/swagger/swagger.js b/server/api/swagger/swagger.js index ed32275ab5..7dbecd7302 100644 --- a/server/api/swagger/swagger.js +++ b/server/api/swagger/swagger.js @@ -4,7 +4,7 @@ const definition = { swagger: '2.0', info: { title: 'HollaEx Kit', - version: '2.8.1' + version: '2.8.2' }, host: 'api.hollaex.com', basePath: '/v2', diff --git a/server/package.json b/server/package.json index e3bb12007d..5117c3a48b 100644 --- a/server/package.json +++ b/server/package.json @@ -1,5 +1,5 @@ { - "version": "2.8.1", + "version": "2.8.2", "private": false, "description": "HollaEx Kit", "keywords": [ diff --git a/version b/version index 96d771776b..cae9add96b 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.8.1 \ No newline at end of file +2.8.2 \ No newline at end of file diff --git a/web/package.json b/web/package.json index ff2332cb8e..3e624b0741 100644 --- a/web/package.json +++ b/web/package.json @@ -1,6 +1,6 @@ { "name": "hollaex-kit", - "version": "2.8.1", + "version": "2.8.2", "private": true, "dependencies": { "@ant-design/compatible": "1.0.5", From f1291666af0efe97b570ec7976b994fb1e7d14b1 Mon Sep 17 00:00:00 2001 From: Yechan Kim Date: Mon, 2 Oct 2023 15:05:33 +0900 Subject: [PATCH 5/8] Update .drone.yml --- .drone.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 994d9815b5..032bd6ed29 100644 --- a/.drone.yml +++ b/.drone.yml @@ -144,9 +144,6 @@ # - deployment # event: # - push - ---- - kind: pipeline type: docker name: hollaex_kit_amd64_build From e1b2a9b750d26dfe3fd632334986cb8a57c0a1a8 Mon Sep 17 00:00:00 2001 From: Yechan Kim Date: Mon, 2 Oct 2023 15:06:03 +0900 Subject: [PATCH 6/8] Update .drone.yml --- .drone.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.drone.yml b/.drone.yml index 032bd6ed29..386d2154d2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -308,6 +308,7 @@ trigger: branch: - testnet - master + - deployment event: - push From b3c2a4a21eef30d413a50294a219fd3b35a52ffc Mon Sep 17 00:00:00 2001 From: Yechan Kim Date: Mon, 2 Oct 2023 15:06:18 +0900 Subject: [PATCH 7/8] Update .drone.yml --- .drone.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 386d2154d2..032bd6ed29 100644 --- a/.drone.yml +++ b/.drone.yml @@ -308,7 +308,6 @@ trigger: branch: - testnet - master - - deployment event: - push From 7660836e2baf28e6d86b3106e926f02f796fc2e9 Mon Sep 17 00:00:00 2001 From: Ali Beikverdi Date: Mon, 2 Oct 2023 19:55:21 +0900 Subject: [PATCH 8/8] ton memo support --- .../utils/hollaex-tools-lib/tools/wallet.js | 32 +++++++++---------- web/src/components/CheckDeposit/index.js | 2 +- web/src/containers/Deposit/index.js | 4 +-- web/src/containers/Deposit/utils.js | 3 +- web/src/containers/Withdraw/form.js | 2 +- web/src/containers/Withdraw/formUtils.js | 2 +- web/src/containers/Withdraw/index.js | 2 +- 7 files changed, 24 insertions(+), 23 deletions(-) diff --git a/server/utils/hollaex-tools-lib/tools/wallet.js b/server/utils/hollaex-tools-lib/tools/wallet.js index 8a0d031408..c6cc6c1285 100644 --- a/server/utils/hollaex-tools-lib/tools/wallet.js +++ b/server/utils/hollaex-tools-lib/tools/wallet.js @@ -49,7 +49,7 @@ const isValidAddress = (currency, address, network) => { return WAValidator.validate(address, currency); } else if (currency === 'xrp') { return WAValidator.validate(address.split(':')[0], currency); - } else if (currency === 'etn') { + } else if (currency === 'etn' || currency === 'ton') { // skip the validation return true; } else { @@ -1205,23 +1205,23 @@ const getWallets = async ( format: (format && (format === 'csv' || format === 'all')) ? 'all' : null, // for csv get all data ...opts }) - .then(async (wallets) => { - if (wallets.data.length > 0) { - const networkIds = wallets.data.map((wallet) => wallet.user_id); - const idDictionary = await mapNetworkIdToKitId(networkIds); - for (let wallet of wallets.data) { - const user_kit_id = idDictionary[wallet.user_id]; - wallet.network_id = wallet.user_id; - wallet.user_id = user_kit_id; - if (wallet.User) wallet.User.id = user_kit_id; + .then(async (wallets) => { + if (wallets.data.length > 0) { + const networkIds = wallets.data.map((wallet) => wallet.user_id); + const idDictionary = await mapNetworkIdToKitId(networkIds); + for (let wallet of wallets.data) { + const user_kit_id = idDictionary[wallet.user_id]; + wallet.network_id = wallet.user_id; + wallet.user_id = user_kit_id; + if (wallet.User) wallet.User.id = user_kit_id; + } } - } - if(format === 'csv'){ - const csv = parse(wallets.data, Object.keys(wallets.data[0])); + if(format === 'csv'){ + const csv = parse(wallets.data, Object.keys(wallets.data[0])); return csv; - } - return wallets; - }); + } + return wallets; + }); }; module.exports = { diff --git a/web/src/components/CheckDeposit/index.js b/web/src/components/CheckDeposit/index.js index 9c4afa0394..b1bce6c481 100644 --- a/web/src/components/CheckDeposit/index.js +++ b/web/src/components/CheckDeposit/index.js @@ -107,7 +107,7 @@ const CheckDeposit = ({ placeholder: STRINGS['DEPOSIT_STATUS.DESTINATION_TAG_PLACEHOLDER'], fullWidth: true, }; - } else if (formValues.currency === 'xlm' || formValues.network === 'xlm') { + } else if (formValues.currency === 'xlm' || formValues.network === 'xlm' || formValues.network === 'ton') { formFields.destination_tag = { type: 'text', stringId: 'DEPOSIT_STATUS.MEMO_LABEL,DEPOSIT_STATUS.MEMO_PLACEHOLDER', diff --git a/web/src/containers/Deposit/index.js b/web/src/containers/Deposit/index.js index a652f8b972..984fd3ac17 100644 --- a/web/src/containers/Deposit/index.js +++ b/web/src/containers/Deposit/index.js @@ -168,14 +168,14 @@ class Deposit extends Component { let address = getWallet(currency, network, wallet, networks); let destinationAddress = ''; - if (currency === 'xrp' || currency === 'xlm' || network === 'xlm') { + if (currency === 'xrp' || currency === 'xlm' || network === 'xlm' || network === 'ton') { const temp = address.split(':'); address = temp[0] ? temp[0] : address; destinationAddress = temp[1] ? temp[1] : ''; } const additionalText = - currency === 'xlm' || network === 'xlm' + currency === 'xlm' || network === 'xlm' || network === 'ton' ? STRINGS['DEPOSIT.CRYPTO_LABELS.MEMO'] : STRINGS['DEPOSIT.CRYPTO_LABELS.DESTINATION_TAG']; diff --git a/web/src/containers/Deposit/utils.js b/web/src/containers/Deposit/utils.js index 5ae44020ec..ba30f1b575 100644 --- a/web/src/containers/Deposit/utils.js +++ b/web/src/containers/Deposit/utils.js @@ -199,7 +199,8 @@ const RenderContentForm = ({ {(currency === 'xrp' || currency === 'xlm' || - selectedNetwork === 'xlm') && ( + selectedNetwork === 'xlm' || + selectedNetwork === 'ton') && (
diff --git a/web/src/containers/Withdraw/form.js b/web/src/containers/Withdraw/form.js index 773e91a2d6..a900b3ffc9 100644 --- a/web/src/containers/Withdraw/form.js +++ b/web/src/containers/Withdraw/form.js @@ -301,7 +301,7 @@ class Form extends Component { const { dialogIsOpen, dialogOtpOpen } = this.state; const hasDestinationTag = - currency === 'xrp' || currency === 'xlm' || selectedNetwork === 'xlm'; + currency === 'xrp' || currency === 'xlm' || selectedNetwork === 'xlm' || selectedNetwork === 'ton'; const coinObject = coins[currency]; diff --git a/web/src/containers/Withdraw/formUtils.js b/web/src/containers/Withdraw/formUtils.js index f13a0b927e..b8fb39fd8c 100644 --- a/web/src/containers/Withdraw/formUtils.js +++ b/web/src/containers/Withdraw/formUtils.js @@ -309,7 +309,7 @@ export const generateFormValues = ( fullWidth: true, ishorizontalfield: true, }; - } else if (!isEmail && (symbol === 'xlm' || selectedNetwork === 'xlm')) { + } else if (!isEmail && (symbol === 'xlm' || selectedNetwork === 'xlm' || selectedNetwork === 'ton')) { fields.destination_tag = { type: 'text', stringId: diff --git a/web/src/containers/Withdraw/index.js b/web/src/containers/Withdraw/index.js index 2930ba8817..f491bcdad6 100644 --- a/web/src/containers/Withdraw/index.js +++ b/web/src/containers/Withdraw/index.js @@ -339,7 +339,7 @@ class Withdraw extends Component { const { currency } = this.state; const { dispatch, selectedNetwork } = this.props; - if (currency === 'xrp' || currency === 'xlm' || selectedNetwork === 'xlm') { + if (currency === 'xrp' || currency === 'xlm' || selectedNetwork === 'xlm' || selectedNetwork === 'ton') { const [address = '', destinationTag = ''] = data?.split(':') || []; dispatch(change(FORM_NAME, 'address', address)); dispatch(change(FORM_NAME, 'destination_tag', destinationTag));