Skip to content

Commit

Permalink
Merge pull request #871 from bitholla/testnet
Browse files Browse the repository at this point in the history
Testnet
  • Loading branch information
abeikverdi authored Jul 8, 2021
2 parents 3d95fc5 + ff34d1c commit bd41035
Show file tree
Hide file tree
Showing 47 changed files with 379 additions and 373 deletions.
18 changes: 13 additions & 5 deletions server/api/controllers/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,8 @@ const mintAsset = (req, res) => {
description,
transaction_id,
status,
email
email,
fee
} = req.swagger.params.data.value;

loggerAdmin.info(
Expand All @@ -731,7 +732,9 @@ const mintAsset = (req, res) => {
'transaction_id',
transaction_id,
'status',
status
status,
'fee',
fee
);

toolsLib.user.getUserByKitId(user_id)
Expand All @@ -744,6 +747,7 @@ const mintAsset = (req, res) => {
currency,
amount,
{
fee,
description,
transactionId: transaction_id,
status,
Expand Down Expand Up @@ -848,7 +852,8 @@ const burnAsset = (req, res) => {
description,
transaction_id,
status,
email
email,
fee
} = req.swagger.params.data.value;

loggerAdmin.info(
Expand All @@ -862,7 +867,9 @@ const burnAsset = (req, res) => {
'transaction_id',
transaction_id,
'status',
status
status,
'fee',
fee
);

toolsLib.user.getUserByKitId(user_id)
Expand All @@ -878,7 +885,8 @@ const burnAsset = (req, res) => {
description,
transactionId: transaction_id,
status,
email
email,
fee
}
);
})
Expand Down
11 changes: 7 additions & 4 deletions server/api/controllers/notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const handleCurrencyDeposit = (req, res) => {
loggerNotification.verbose('controller/notification/handleCurrencyDeposit ip domain', ip, domain);

const currency = req.swagger.params.currency.value;
const { user_id, amount, txid, address, is_confirmed, rejected, created_at, network } = req.swagger.params.data.value;
const { user_id, amount, txid, address, is_confirmed, rejected, created_at, network, fee, description } = req.swagger.params.data.value;

toolsLib.security.verifyNetworkHmacToken(req)
.then(() => {
Expand Down Expand Up @@ -64,7 +64,9 @@ const handleCurrencyDeposit = (req, res) => {
status: is_confirmed ? 'COMPLETED' : 'PENDING',
address,
transaction_id: txid,
network
network,
fee,
description
};

if (is_confirmed) {
Expand Down Expand Up @@ -111,7 +113,7 @@ const handleCurrencyWithdrawal = (req, res) => {
loggerNotification.verbose('controller/notification/handleCurrencyWithdrawal ip domain', ip, domain);

const currency = req.swagger.params.currency.value;
const { user_id, amount, txid, address, is_confirmed, fee, rejected, created_at, network } = req.swagger.params.data.value;
const { user_id, amount, txid, address, is_confirmed, fee, rejected, created_at, network, description } = req.swagger.params.data.value;

toolsLib.security.verifyNetworkHmacToken(req)
.then(() => {
Expand Down Expand Up @@ -143,7 +145,8 @@ const handleCurrencyWithdrawal = (req, res) => {
address,
fee,
transaction_id: txid,
network
network,
description
};

publisher.publish(EVENTS_CHANNEL, JSON.stringify({
Expand Down
17 changes: 12 additions & 5 deletions server/api/controllers/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ const getVerifyUser = (req, res) => {
email = email.toLowerCase();
promiseQuery = toolsLib.user.getVerificationCodeByUserEmail(email)
.then((verificationCode) => {
if (verificationCode.verified) {
throw new Error(USER_EMAIL_IS_VERIFIED);
}
if (resendEmail) {
sendEmail(
MAILTYPE.SIGNUP,
Expand Down Expand Up @@ -703,12 +706,16 @@ const userCheckTransaction = (req, res) => {
'controllers/user/userCheckTransaction auth',
req.auth
);
const transactionId = req.swagger.params.transaction_id.value;
const address = req.swagger.params.address.value;
const currency = req.swagger.params.currency.value;
const isTestnet = req.swagger.params.is_testnet.value;

toolsLib.wallet.checkTransaction(currency, transactionId, address, isTestnet)
const {
currency,
transaction_id,
address,
network,
is_testnet
} = req.swagger.params;

toolsLib.wallet.checkTransaction(currency.value, transaction_id.value, address.value, network.value, is_testnet.value)
.then((transaction) => {
return res.json({ message: 'Success', transaction });
})
Expand Down
16 changes: 15 additions & 1 deletion server/api/swagger/swagger.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
swagger: "2.0"
info:
version: "2.1.12"
version: "2.1.13"
title: HollaEx Kit
host: api.hollaex.com
basePath: /v2
Expand Down Expand Up @@ -2400,6 +2400,11 @@ paths:
description: crypto address receiving the deposit
required: true
type: string
- in: query
name: network
description: Blockchain network of transaction
required: true
type: string
- in: query
name: is_testnet
description: specify whether or not transaction was on tesntet
Expand Down Expand Up @@ -4442,6 +4447,10 @@ definitions:
format: date-time
network:
type: string
fee:
type: number
description:
type: string
ExternalWithdrawalRequest:
type: object
required:
Expand Down Expand Up @@ -4469,6 +4478,8 @@ definitions:
format: date-time
network:
type: string
description:
type: string
OrderbooksResponse:
type: object
description: Top 10 orderbooks, where key is the symbol(currency) and the values is an object with the top 10 bids and ask.
Expand Down Expand Up @@ -4654,6 +4665,9 @@ definitions:
type: boolean
email:
type: boolean
fee:
type: number
format: double
MintBurnUpdate:
type: object
required:
Expand Down
1 change: 1 addition & 0 deletions server/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ const checkStatus = () => {
configuration.kit.info = {
name: exchange.name,
active: exchange.active,
exchange_id: exchange.id,
url: exchange.url,
is_trial: exchange.is_trial,
created_at: exchange.created_at,
Expand Down
7 changes: 5 additions & 2 deletions server/mail/strings/ar.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ const DEPOSIT = {
3: (address) => COMMON.ADDRESS(address),
4: (txid) => COMMON.TXID(txid),
5: (network) => `Network: ${network}`,
6: COMMON.EXPLORER
6: (fee) => COMMON.FEE(fee),
7: (description) => `Description: ${description}`,
8: COMMON.EXPLORER
},
CLOSING: COMMON.CLOSING
};
Expand Down Expand Up @@ -166,7 +168,8 @@ const WITHDRAWAL = {
4: (address) => COMMON.ADDRESS(address),
5: (txid) => COMMON.TXID(txid),
6: (network) => `Network: ${network}`,
7: COMMON.EXPLORER
7: (description) => `Description: ${description}`,
8: COMMON.EXPLORER
},
CLOSING: COMMON.CLOSING
};
Expand Down
7 changes: 5 additions & 2 deletions server/mail/strings/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ const DEPOSIT = {
3: (address) => COMMON.ADDRESS(address),
4: (txid) => COMMON.TXID(txid),
5: (network) => `Network: ${network}`,
6: COMMON.EXPLORER
6: (fee) => COMMON.FEE(fee),
7: (description) => `Description: ${description}`,
8: COMMON.EXPLORER
},
CLOSING: COMMON.CLOSING
};
Expand Down Expand Up @@ -167,7 +169,8 @@ const WITHDRAWAL = {
4: (address) => COMMON.ADDRESS(address),
5: (txid) => COMMON.TXID(txid),
6: (network) => `Network: ${network}`,
7: COMMON.EXPLORER
7: (description) => `Description: ${description}`,
8: COMMON.EXPLORER
},
CLOSING: COMMON.CLOSING
};
Expand Down
7 changes: 5 additions & 2 deletions server/mail/strings/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ const DEPOSIT = {
3: (address) => COMMON.ADDRESS(address),
4: (txid) => COMMON.TXID(txid),
5: (network) => `Network: ${network}`,
6: COMMON.EXPLORER
6: (fee) => COMMON.FEE(fee),
7: (description) => `Description: ${description}`,
8: COMMON.EXPLORER
},
CLOSING: COMMON.CLOSING
};
Expand Down Expand Up @@ -168,7 +170,8 @@ const WITHDRAWAL = {
4: (address) => COMMON.ADDRESS(address),
5: (txid) => COMMON.TXID(txid),
6: (network) => `Network: ${network}`,
7: COMMON.EXPLORER
7: (description) => `Description: ${description}`,
8: COMMON.EXPLORER
},
CLOSING: COMMON.CLOSING
};
Expand Down
7 changes: 5 additions & 2 deletions server/mail/strings/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ const DEPOSIT = {
3: (address) => COMMON.ADDRESS(address),
4: (txid) => COMMON.TXID(txid),
5: (network) => `Network: ${network}`,
6: COMMON.EXPLORER
6: (fee) => COMMON.FEE(fee),
7: (description) => `Description: ${description}`,
8: COMMON.EXPLORER
},
CLOSING: COMMON.CLOSING
};
Expand Down Expand Up @@ -167,7 +169,8 @@ const WITHDRAWAL = {
4: (address) => COMMON.ADDRESS(address),
5: (txid) => COMMON.TXID(txid),
6: (network) => `Network: ${network}`,
7: COMMON.EXPLORER
7: (description) => `Description: ${description}`,
8: COMMON.EXPLORER
},
CLOSING: COMMON.CLOSING
};
Expand Down
7 changes: 5 additions & 2 deletions server/mail/strings/fa.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ const DEPOSIT = {
3: (address) => COMMON.ADDRESS(address),
4: (txid) => COMMON.TXID(txid),
5: (network) => `Network: ${network}`,
6: COMMON.EXPLORER
6: (fee) => COMMON.FEE(fee),
7: (description) => `Description: ${description}`,
8: COMMON.EXPLORER
},
CLOSING: COMMON.CLOSING
};
Expand Down Expand Up @@ -170,7 +172,8 @@ const WITHDRAWAL = {
4: (address) => COMMON.ADDRESS(address),
5: (txid) => COMMON.TXID(txid),
6: (network) => `Network: ${network}`,
7: COMMON.EXPLORER
7: (description) => `Description: ${description}`,
8: COMMON.EXPLORER
},
CLOSING: COMMON.CLOSING
};
Expand Down
7 changes: 5 additions & 2 deletions server/mail/strings/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ const DEPOSIT = {
3: (address) => COMMON.ADDRESS(address),
4: (txid) => COMMON.TXID(txid),
5: (network) => `Network: ${network}`,
6: COMMON.EXPLORER
6: (fee) => COMMON.FEE(fee),
7: (description) => `Description: ${description}`,
8: COMMON.EXPLORER
},
CLOSING: COMMON.CLOSING
};
Expand Down Expand Up @@ -167,7 +169,8 @@ const WITHDRAWAL = {
4: (address) => COMMON.ADDRESS(address),
5: (txid) => COMMON.TXID(txid),
6: (network) => `Network: ${network}`,
7: COMMON.EXPLORER
7: (description) => `Description: ${description}`,
8: COMMON.EXPLORER
},
CLOSING: COMMON.CLOSING
};
Expand Down
7 changes: 5 additions & 2 deletions server/mail/strings/id.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ const DEPOSIT = {
3: (address) => COMMON.ADDRESS(address),
4: (txid) => COMMON.TXID(txid),
5: (network) => `Network: ${network}`,
6: COMMON.EXPLORER
6: (fee) => COMMON.FEE(fee),
7: (description) => `Description: ${description}`,
8: COMMON.EXPLORER
},
CLOSING: COMMON.CLOSING
};
Expand Down Expand Up @@ -167,7 +169,8 @@ const WITHDRAWAL = {
4: (address) => COMMON.ADDRESS(address),
5: (txid) => COMMON.TXID(txid),
6: (network) => `Network: ${network}`,
7: COMMON.EXPLORER
7: (description) => `Description: ${description}`,
8: COMMON.EXPLORER
},
CLOSING: COMMON.CLOSING
};
Expand Down
7 changes: 5 additions & 2 deletions server/mail/strings/ja.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ const DEPOSIT = {
3: (address) => COMMON.ADDRESS(address),
4: (txid) => COMMON.TXID(txid),
5: (network) => `Network: ${network}`,
6: COMMON.EXPLORER
6: (fee) => COMMON.FEE(fee),
7: (description) => `Description: ${description}`,
8: COMMON.EXPLORER
},
CLOSING: COMMON.CLOSING
};
Expand Down Expand Up @@ -163,7 +165,8 @@ const WITHDRAWAL = {
4: (address) => COMMON.ADDRESS(address),
5: (txid) => COMMON.TXID(txid),
6: (network) => `Network: ${network}`,
7: COMMON.EXPLORER
7: (description) => `Description: ${description}`,
8: COMMON.EXPLORER
},
CLOSING: COMMON.CLOSING
};
Expand Down
7 changes: 5 additions & 2 deletions server/mail/strings/ko.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ const DEPOSIT = {
3: (address) => COMMON.ADDRESS(address),
4: (txid) => COMMON.TXID(txid),
5: (network) => `Network: ${network}`,
6: COMMON.EXPLORER
6: (fee) => COMMON.FEE(fee),
7: (description) => `Description: ${description}`,
8: COMMON.EXPLORER
},
CLOSING: COMMON.CLOSING
};
Expand Down Expand Up @@ -164,7 +166,8 @@ const WITHDRAWAL = {
4: (address) => COMMON.ADDRESS(address),
5: (txid) => COMMON.TXID(txid),
6: (network) => `Network: ${network}`,
7: COMMON.EXPLORER
7: (description) => `Description: ${description}`,
8: COMMON.EXPLORER
},
CLOSING: COMMON.CLOSING
};
Expand Down
Loading

0 comments on commit bd41035

Please sign in to comment.