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(sdk-coin-baby): add CreateBtcDelegation transaction #5758

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sbplat
Copy link
Contributor

@sbplat sbplat commented Mar 12, 2025

Ticket: SC-1335

This pr introduces the following changes:

  1. More extensible Cosmos messages
  • allows Cosmos like chains to supply their own CustomMessage type
  • have support to send messages other than the standard ones defined by CosmosTransactionMessage (send, delegate, undelegate, etc.)
  1. Babylon CustomTransactionBuilder
  • sends Babylon specific messages
    • currently the only message is CreateBtcDelegationMessage
  • need to pass in a _kind attribute within the value of the send message to differentiate between the messages
    • the _kind of CreateBtcDelegationMessage is CreateBtcDelegation

@sbplat sbplat force-pushed the eric/SC-1335-babylon-CreateBtcDelegation branch 2 times, most recently from 47989e2 to b76d565 Compare March 18, 2025 16:08
@sbplat sbplat marked this pull request as ready for review March 18, 2025 16:50
@sbplat sbplat requested a review from a team as a code owner March 18, 2025 16:50
TICKET: SC-1335

# Conflicts:
#	modules/sdk-coin-baby/package.json
@sbplat sbplat force-pushed the eric/SC-1335-babylon-CreateBtcDelegation branch from b76d565 to 67c089a Compare March 20, 2025 13:48
@@ -59,7 +59,7 @@ interface CosmosCoinSpecific {
rootAddress: string;
}

export class CosmosCoin extends BaseCoin {
export class CosmosCoin<CustomMessage = never> extends BaseCoin {
Copy link
Contributor

Choose a reason for hiding this comment

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

How many Cosmos-like coins currently use CustomMessage? Is it only Babylon for now, or do we anticipate a broader need for this feature across other coins in the near future?

From my understanding, CustomMessage is specific to Babylon at the moment. Given this, it may not be necessary to propagate these changes throughout the entire Cosmos abstraction.

Instead, a more targeted approach would be to create a new class that extends the existing implementation and introduces the custom message logic there, such as:
export class CustomMessageCoin extends CosmosCoin

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for now, Babylon is the only coin that needs to send this custom message.

we need to modify the entire cosmos abstraction to add CustomMessage to the CosmosTransactionMessage type union. this is because we can't override the _message type from CosmosTransactionBuilder (if you have a better approach, please let me know). so even with a new class that handles the custom message logic, I think we would still need to propagate the CustomMessage type across the cosmos abstraction.

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

Successfully merging this pull request may close these issues.

2 participants