Skip to content

feat(provider-okx): add sui namespace#1444

Open
llawliet-l-l wants to merge 1 commit into
nextfrom
feat/RC-307-adding-sui-to-okx
Open

feat(provider-okx): add sui namespace#1444
llawliet-l-l wants to merge 1 commit into
nextfrom
feat/RC-307-adding-sui-to-okx

Conversation

@llawliet-l-l

Copy link
Copy Markdown
Contributor

Summary

Adds Sui support to the OKX wallet provider. Sui is discovered through the wallet-standard registry (independent of OKX's injected instance map used by EVM/Solana/BTC), so it follows the wallet-standard pattern like the Slush/Phantom providers. Connect, account switch, wallet-side disconnect, eager connect, and transaction signing are all wired and verified on-device.

Changes

  • Wire the Sui namespace into the provider and register DefaultSuiSigner (conditionally, since Sui comes from the registry rather than the injected map)
  • Add a Sui metadata entry and the wallet-standard name constant
  • Account switches handled by the core standard:events change subscriber; add a dedicated subscriber for wallet-side disconnect, which OKX emits as an (undocumented) disconnect event on the same standard:events feature
  • Add the @rango-dev/signer-sui dependency (Sui signer)
  • Docs: mark OKX Sui ✅ in the status matrix and note the auto-connect limitation in the provider readme

Notes

  • OKX fires a disconnect event on standard:events that isn't in the @mysten/wallet-standard type (which only declares change), so the disconnect subscriber casts .on to accept the extra event name (TS2345 otherwise). The cast can be dropped if the event is ever added to the official types.

How tested

eslint + yarn build pass. Verified on-device with the OKX extension: connect, account switch, disconnect from the wallet UI, eager connect on reload, and a successful real Sui transaction signature.

Known limitations

  • On auto connect, OKX reconnects to the first-connected account rather than the last-switched one — no client-side workaround, as the wallet exposes no way to read the active account at reconnect time.

Comment thread wallets/provider-okx/src/builders/sui.ts Outdated
Comment thread wallets/provider-okx/src/namespaces/sui.ts
Comment thread wallets/provider-okx/src/hooks/sui.ts

@arlert-armin arlert-armin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

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