Skip to content

feat(sui): add XMN staking support#8290

Open
cynosurebit wants to merge 1 commit intomasterfrom
SC-6116-xmn-staking-support
Open

feat(sui): add XMN staking support#8290
cynosurebit wants to merge 1 commit intomasterfrom
SC-6116-xmn-staking-support

Conversation

@cynosurebit
Copy link

Summary

Adds XMN (xMoney) token staking support on the SUI blockchain.

  • Register sui:xmn (mainnet) with SUI_TOKEN_FEATURES_STAKING and add tsui:xmn (testnet) entry to statics
  • Add 4 new SuiTransactionType values: XmnStake, XmnRequestUnstake, XmnUnbond, XmnClaimRewards
  • Add xmnConfig.ts with mainnet + testnet StakingFactory contract addresses and coin types
  • Add XmnStakingBuilder, XmnUnstakeBuilder, XmnClaimRewardsBuilder following the WalrusStakingBuilder pattern
  • Wire all builders in TransactionBuilderFactory (from() routing + getter methods)
  • Update utils.ts with XMN cases in getTransactionType() and getSuiTransactionType()

Key design decisions

  • Void-return pattern: All 4 XMN Move functions (stake, request_unstake, unbond, claim_and_transfer) transfer objects internally — no tx.transferObjects() calls
  • 3 type arguments: All StakingFactory calls use <XMN, XMN, BRIDGE_TOKEN> — the Db type is BRIDGE_TOKEN, not XMN
  • Package upgrade pattern: Call target uses upgraded package ID; type tags use original package ID
  • 2-step unstake: XmnUnstakeBuilder handles both XmnRequestUnstake and XmnUnbond via this._type routing

Test plan

  • Unit tests for XMN builders (follow-up PR)
  • Build verified locally: YARN_IGNORE_ENGINES=1 yarn run build passes for both @bitgo/statics and @bitgo/sdk-coin-sui

🤖 Generated with Claude Code

@cynosurebit cynosurebit requested a review from a team as a code owner March 13, 2026 08:37
Add XMN (xMoney) token staking support on SUI blockchain:

- Register tsui:xmn testnet entry in statics with SUI_TOKEN_FEATURES_STAKING
- Upgrade sui:xmn mainnet entry from SUI_TOKEN_FEATURES to SUI_TOKEN_FEATURES_STAKING
- Add XmnStake/XmnRequestUnstake/XmnUnbond/XmnClaimRewards transaction types to iface.ts
- Add xmnConfig.ts with mainnet/testnet StakingFactory contract addresses
- Add XmnStakingBuilder, XmnUnstakeBuilder, XmnClaimRewardsBuilder
- Wire all builders in TransactionBuilderFactory.from() and getters
- Add XMN method name detection in utils.ts getSuiTransactionType()
- Fix utils.ts getTransactionType() to handle new XMN SuiTransactionTypes
- Remove unused InvalidTransactionError imports; run prettier on XMN files

XMN uses an app-level StakingFactory contract (no validators). All staking
functions have void returns and transfer objects internally — no transferObjects
calls needed. Type args for all calls: <XMN, XMN, BRIDGE_TOKEN>.

Ticket: SC-6116
@cynosurebit cynosurebit force-pushed the SC-6116-xmn-staking-support branch from 1a4d2ba to e825bf8 Compare March 13, 2026 09:33
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.

1 participant