-
Notifications
You must be signed in to change notification settings - Fork 1
Fb takyoon onchain message #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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 |
| 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.
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')) |
There was a problem hiding this comment.
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 => { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
No description provided.