-
Notifications
You must be signed in to change notification settings - Fork 20
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
feat(rgbpp): support for batch transferring of RGBPP XUDT assets #270
Conversation
Mocked a test for the
The expected result:
The actual transaction groups generated from the process: |
@@ -0,0 +1,80 @@ | |||
import { |
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.
I suggest this file should be moved to rgbpp-sdk/btc
and examples can reuse it
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.
Maybe we should, but a concern is we may not handle P2TR well, because it can be complicated.
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.
After reviewing the current codebase of the packages/examples, I think this is not a good timing to do this. Examples and tests have different needs for the feature, and it's a big change to refactor them all.
Have you tested the case where the BTC transaction requires additional inputs to pay tx fee? |
When the fee rate is higher, utxo will be collected from the from address to pay the fee. |
Discussion or TODO
|
@duanyytop and I had a few discussions about the PR:
My thoughts:
The btc/ckb lib contain some methods that are not mockable, meaning that when calling the I think @duanyytop is concerned about redundant test cases, as there are too many "same pieces of code" in the examples and integration tests. If we add more tests to the rgbpp lib alone, that would increase redundancy. Personally, I believe the unit tests for the rgbpp library are different from the examples and integration tests because the unit tests allow more room for unexpected cases. However, writing tests for the
Agreed, so I moved most of the utilities from the rgbpp lib to the btc/ckb libs at c492cf3.
Yes, but it would be hard to write a set of examples just to prepare the assets. If we provide only one example for users who already have many assets, it would be much easier. We may add such example in |
Regarding the transfer-all example, we are currently facing an issue: if we use this file to create a BTC account and sign transactions, with
|
I think it depends on how complicated the examples need to be. If we're writing a simple example that transfers all XUDT1 from A to B, then a single account is enough. However, if we're writing an example that transfers all XUDT1 from [A, B] to C, then we'll need at least 2 accounts for signing. It's best to draft a TODO list of the examples first. cc @Flouse @Dawn-githup |
…the utxo as invalid
|
ok, please add an introduction to https://github.com/ckb-cell/rgbpp-sdk/blob/develop/examples/rgbpp/README.md to explain the use case of this example later. |
Changes
buildRgbppTransferAllTxs()
API to generate one or more BTC/CKB transaction groups for transferring the entire amount of a specific type of RGBPP XUDT asset from one or more BTC addresses to a recipientsendRgbppTxGroups()
API for sending BTC/CKB transaction groups to theBtcAssetsApi
TODOs
Update examples? (no place for the example)