Skip to content
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(btc|examples): add needPaymaster option in the sendRgbppUtxos() API #199

Merged
merged 4 commits into from
May 29, 2024

Conversation

ShookLyngs
Copy link
Collaborator

@ShookLyngs ShookLyngs commented May 28, 2024

Changes

  • Add a needPaymaster?: boolean option to the sendRgbppUtxos() API, which can decide whether the paymaster output is required in a BTC_TX, if the value is undefined, everything should behave exactly as before:
    function isNeedPaymasterOutput() {
      if (needPaymaster !== undefined) {
        // new option steps in when it's not undefined
        return needPaymaster;
      } else {
        // the original check statement, if the value is undefined
        return ckbVirtualTxInputsCapacity >= ckbVirtualTxOutputsCapacity;
      }
    }  
  • Specify needPaymaster: needPaymasterCell manually in all spore exmaples, and in xudt launch examples
  • Fix the include field in the tsconfig.json of the examples

Test

  • The paymaster output should not be created when needPaymaster == false @Dawn-githup

@duanyytop
Copy link
Collaborator

duanyytop commented May 28, 2024

  • All the RGB++ Spore examples don't need paymaster cell, including transfer and leap.
  • All the RGB++ xUDT launch examples don't need paymaster cell.

@ShookLyngs
Copy link
Collaborator Author

All the RGB++ Spore examples don't need paymaster cell, including transfer and leap.
All the RGB++ xUDT launch examples don't need paymaster cell.

Updated as requested, please have another look.

@duanyytop
Copy link
Collaborator

duanyytop commented May 28, 2024

Please test and check whether there is paymaster UTXO in the outputs of the BTC transaction @Dawn-githup

@Flouse Flouse linked an issue May 29, 2024 that may be closed by this pull request
2 tasks
@Flouse Flouse merged commit 5785f5a into develop May 29, 2024
2 checks passed
@Flouse Flouse deleted the feat/need-paymaster-option branch May 29, 2024 02:22
@Dawn-githup
Copy link
Contributor

Test Transaction Records

xUDT

2-btc-transfer

3-btc-leap-ckb

launch

2-launch-rgbpp
3-distribute-rgbpp

Spore

2-create-cluster

3-create-spores

4-transfer-spore

5-leap-spore-to-ckb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow manually specifying whether a paymaster output is required
4 participants