Skip to content

Conversation

@takYoon
Copy link

@takYoon takYoon commented Mar 22, 2023

No description provided.

takYoon and others added 12 commits May 16, 2022 21:26
* master:
  update package-lock.json
  update package-lock.json
* master:
  fix compile error on bitcore-client
* master: (135 commits)
  format code
  update fee for conversion  ( 50 XEC + 1% amount )
  change v1 subcrible push notification
  format code
  change update order api to secure validation handle case manual change status or order manually refactor code for get configswap
  change loading tokeninfo using chronik client instead of kingbch
  format code
  fix issue negative amount for chronik watcher xec edit notification
  dont use prefix with bch when sending
  tmp comment out notification for amount received of swap edit notification ( link to txId )
  fix noti for swap
  Order-model : added new property
  format code
  added logic to prevent duplicate order
  edit logic store pending reason + error
  remove logic isInQueue
  added more time to start queue
  format code
  handle case expired not work using created rate instead of updated rate
  added missing currency cny
  ...
refactor code
@takYoon takYoon requested a review from vince8x March 22, 2023 15:11
@kensauruss
Copy link

@vince8x please do not merge

var s = new Script();
s.add(Opcode.OP_RETURN);
if (!_.isUndefined(data)) {
s.add( Buffer.from('03030303', 'hex'));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we put the lokad id to constant instead of hardcode

if (value) {
return {
txid: value.txid,
outputScript: _.find(value.outputs, o => o.outputScript.includes('6a04'))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use constant op_return = '6a' + prefix length = '04' if possible

if (resultTxs && resultTxs.length > 0) {
var chronikClient = ChainService.getChronikClient(wallet.coin);
// filter get only tx have on-chain message
let filterResulTxs = _.filter(resultTxs, tx => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be filterResultTxs?

next => {
// get all txs from chronik client
if (resultTxs && resultTxs.length > 0) {
var chronikClient = ChainService.getChronikClient(wallet.coin);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use const instead of var

if (txFound) {
const outputFalse = _.find(txFound.outputs, o => o.address === 'false' || !o.address);
if (outputFalse) {
outputFalse.outputScript = txDetail.outputScript;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please comment what is the purpose of the assignment?

values = _.compact(values);

// mapping tx details from chronik with only 2 att : txid and outputScript
values = _.map(values, function(value) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should name something more meaningful, such as txidAndOutputScriptArray

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants