Open
Conversation
* 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
|
@vince8x please do not merge |
vince8x
reviewed
Mar 26, 2023
| var s = new Script(); | ||
| s.add(Opcode.OP_RETURN); | ||
| if (!_.isUndefined(data)) { | ||
| s.add( Buffer.from('03030303', 'hex')); |
There was a problem hiding this comment.
Can we put the lokad id to constant instead of hardcode
vince8x
reviewed
Mar 26, 2023
| if (value) { | ||
| return { | ||
| txid: value.txid, | ||
| outputScript: _.find(value.outputs, o => o.outputScript.includes('6a04')) |
There was a problem hiding this comment.
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 => { |
| next => { | ||
| // get all txs from chronik client | ||
| if (resultTxs && resultTxs.length > 0) { | ||
| var chronikClient = ChainService.getChronikClient(wallet.coin); |
| if (txFound) { | ||
| const outputFalse = _.find(txFound.outputs, o => o.address === 'false' || !o.address); | ||
| if (outputFalse) { | ||
| outputFalse.outputScript = txDetail.outputScript; |
There was a problem hiding this comment.
Could you please comment what is the purpose of the assignment?
vince8x
reviewed
Mar 26, 2023
| values = _.compact(values); | ||
|
|
||
| // mapping tx details from chronik with only 2 att : txid and outputScript | ||
| values = _.map(values, function(value) { |
There was a problem hiding this comment.
We should name something more meaningful, such as txidAndOutputScriptArray
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.