Skip to content

feat(bitget): wire real signers for Cosmos + Solana (V3 flow)#14

Merged
towanTG merged 2 commits intodevelopfrom
feat/bitget-cosmos-solana-v3
Apr 16, 2026
Merged

feat(bitget): wire real signers for Cosmos + Solana (V3 flow)#14
towanTG merged 2 commits intodevelopfrom
feat/bitget-cosmos-solana-v3

Conversation

@towanTG
Copy link
Copy Markdown
Contributor

@towanTG towanTG commented Apr 16, 2026

Summary

  • Cosmos: drop the dead `signTransaction: async () => ({} as any)` stub. Spread → `Object.assign(offlineSigner, { getAddress })` so `signAmino`/`getAccounts` keep their `this` binding when the toolbox calls them.
  • Solana: stop spreading the provider — `Object.assign(provider, { getAddress })` so `signTransaction` / `signAndSendTransaction` stay bound to the provider instance the toolbox uses for V3.

Why

The V3 SwapKit plugin invokes `wallet.signAndBroadcastTransaction(payload)`. The Cosmos / Solana toolboxes synthesize that method on top of the signer's primitives. Today:

  • BitGet Cosmos hands the toolbox a fake `signTransaction` stub layered on top of the real OfflineAminoSigner — when V3 lands, the stub wins and broadcasts `{}`.
  • BitGet Solana spreads the provider, which can lose `this` binding on class-bound methods (Phantom uses the provider directly for the same reason).

Notes

Amino-only signer is sufficient — V3 swaps on Cosmos Hub use `MsgSend` / IBC `MsgTransfer`, both amino-safe. We can swap to dual signer later if a CosmWasm-bound chain comes in.

Test plan

  • Connect BitGet → Cosmos, run a V3 ATOM swap, confirm txid on Mintscan
  • Connect BitGet → Solana, run a V3 SOL swap, confirm signature on Solscan
  • Regression: legacy `wallet.transfer({...})` for both chains still works

🤖 Generated with Claude Code

github-actions bot and others added 2 commits April 16, 2026 11:53
Cosmos: drop the dead `signTransaction: async () => ({} as any)` stub
and use Object.assign so the toolbox's V3 signAndBroadcastTransaction can
reach the real signAmino/getAccounts on the OfflineAminoSigner BitGet
already returns.

Solana: stop spreading the provider — Object.assign keeps signTransaction
and signAndSendTransaction bound to the provider instance so the toolbox
can call them with VersionedTransaction.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
getOfflineSignerAuto returns OfflineDirectSigner on hot wallets and
falls back to OfflineAminoSigner on Ledger — V3's proto SignDoc path
signs natively without amino downconversion.

Also extend the bitkeep.keplr type with getOfflineSignerAuto +
OfflineDirectSigner import.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@towanTG towanTG merged commit ed1dfdc into develop Apr 16, 2026
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