This repository was archived by the owner on May 27, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
feat(rgbpp-sdk/btc): btc rgbpp transactions #26
Merged
Merged
Conversation
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
Collaborator
|
I found that the constructor of |
Collaborator
Author
You're right, the |
Flouse
reviewed
Mar 19, 2024
Flouse
reviewed
Mar 19, 2024
Flouse
reviewed
Mar 19, 2024
Contributor
Flouse
left a comment
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.
Other codes LGTM.
Flouse
reviewed
Mar 19, 2024
duanyytop
reviewed
Mar 20, 2024
duanyytop
reviewed
Mar 21, 2024
3199c74 to
06c4eb1
Compare
48e265b to
b93177b
Compare
duanyytop
approved these changes
Mar 21, 2024
Flouse
approved these changes
Mar 21, 2024
|
|
||
| const liveCell = await props.ckbCollector.getLiveCell(input.previousOutput); | ||
| const isRgbppLock = isRgbppLockCell(liveCell.output, isCkbMainnet); | ||
| const isRgbppTimeLock = isBtcTimeLockCell(liveCell.output, isCkbMainnet); |
Contributor
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.
Is this line unused?
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Main changes
networkTypeprop from BTC APIsNext
Details
The sendUtxos() API
The sendRgbppUtxos() API
Here's a L1 -> L1 example transaction, showing how A transfers 400 RGBPP to B:
Since A is transferring some RGBPP assets to B, when building the BtcVirtualTx, you should specify the
addressforRGBPP_UTXO_2, otherwise by default the address of the RGBPP_UTXO_2 will be set to A (as thefromprop specified):Output markers
This output with the
fixedmark will NOT be deducted for satoshi/fee collection:This output is marked as
protected, so the free satoshi in this output can be deducted (but this output cannot be removed):This output without any marker can be deducted during the satoshi/fee collection process, and this output can be removed from the transaction if necessary:
Satoshi/fee collection
The satoshi/fee collection process has been rewritten for comlex situations like in a RGBPP transaction:
(output.protected == true && output.fixed == false)condition, the collection process will try to collect free satoshi from those outputs. An output's free satoshi isoutput.value - output.minUtxoSatoshi.(sum(inputs) > sum(outputs)), then the change satoshi can be returned in the first output that matches the(output.fixed == false && output.address == changeAddress)condition.BTW, since the entire collection process has been rewritten, I believe we need to conduct thorough tests on the fee estimation part. Although I have added many tests to cover various scenarios, there may still be additional issues that need to be discovered. Therefore, we could greatly benefit from more tests and reviews. cc @Dawn-github.