Skip to content
This repository was archived by the owner on May 27, 2025. It is now read-only.

Conversation

@fghdotio
Copy link
Contributor

This update introduces offline mode support for compatible xUDT type scripts by adding an optional offline parameter to related methods. That is, if a user chooses to stay completely offline during the transaction building process, the compatible xUDT type scripts used will be the local ones instead of fetching them from the network.

The offline behavior is determined by the vendorCellDeps parameter, so there's no need for an extra parameter. Given the current implementation of using rgbpp-sdk in offline mode, it's safe to deduce the user's intention simply by checking whether vendorCellDeps is provided.

Compatible xUDT testing transactions on Testnet3 in offline mode:

  1. Jumping from CKB to BTC:
  1. Transferring on BTC:
  1. Jumping from BTC to CKB:
  1. Unlock BTC time lock cell:

*/
export const isCompatibleUDTTypesSupported = (type: CKBComponents.Script): boolean => {
const compatibleList = CompatibleXUDTRegistry.getCompatibleTokens();
export const isCompatibleUDTTypesSupported = (type: CKBComponents.Script, offline: boolean = false): boolean => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is recommended that all isOffline parameters are optional, otherwise many functions will be incompatible

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I've updated throwErrorWhenRgbppCellsInvalid to mark isOffline as optional as well. Using an optional parameter instead of a default value better reflects its optionality. Thanks for the feedback!

@Flouse Flouse requested a review from ShookLyngs February 14, 2025 04:04
@duanyytop duanyytop added this pull request to the merge queue Feb 17, 2025
Merged via the queue into utxostack:develop with commit 5914a7c Feb 17, 2025
0 of 4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants