Skip to content

Commit

Permalink
Merge pull request #2363 from hollaex/beta
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
abeikverdi committed Oct 3, 2023
2 parents f9b550a + 710f6ce commit fc09a44
Show file tree
Hide file tree
Showing 14 changed files with 64 additions and 63 deletions.
67 changes: 32 additions & 35 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -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

# ---

Expand Down Expand Up @@ -144,9 +144,6 @@ trigger:
# - deployment
# event:
# - push

---

kind: pipeline
type: docker
name: hollaex_kit_amd64_build
Expand Down Expand Up @@ -282,7 +279,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
Expand Down
2 changes: 2 additions & 0 deletions server/api/controllers/notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}));
Expand Down Expand Up @@ -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()
}));
Expand Down
2 changes: 1 addition & 1 deletion server/api/swagger/swagger.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.8.1",
"version": "2.8.2",
"private": false,
"description": "HollaEx Kit",
"keywords": [
Expand Down
32 changes: 16 additions & 16 deletions server/utils/hollaex-tools-lib/tools/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 = {
Expand Down
3 changes: 2 additions & 1 deletion server/ws/sub.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
});
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.8.1
2.8.2
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hollaex-kit",
"version": "2.8.1",
"version": "2.8.2",
"private": true,
"dependencies": {
"@ant-design/compatible": "1.0.5",
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/CheckDeposit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions web/src/containers/Deposit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'];

Expand Down
3 changes: 2 additions & 1 deletion web/src/containers/Deposit/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ const RenderContentForm = ({
</div>
{(currency === 'xrp' ||
currency === 'xlm' ||
selectedNetwork === 'xlm') && (
selectedNetwork === 'xlm' ||
selectedNetwork === 'ton') && (
<div className="d-flex">
<div className="d-flex align-items-baseline field_warning_wrapper">
<ExclamationCircleFilled className="field_warning_icon" />
Expand Down
2 changes: 1 addition & 1 deletion web/src/containers/Withdraw/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down
2 changes: 1 addition & 1 deletion web/src/containers/Withdraw/formUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion web/src/containers/Withdraw/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit fc09a44

Please sign in to comment.