Skip to content

feat(sdk-coin-sol): derive SPL token (ATA) deposit addresses#9080

Open
rajangarg047 wants to merge 1 commit into
masterfrom
rajangarg047/wcn-1054-sol-spl-token-derive
Open

feat(sdk-coin-sol): derive SPL token (ATA) deposit addresses#9080
rajangarg047 wants to merge 1 commit into
masterfrom
rajangarg047/wcn-1054-sol-spl-token-derive

Conversation

@rajangarg047

Copy link
Copy Markdown
Contributor

Summary

Extends SOL deriveAddress to support SPL token deposit addresses. When a tokenName (e.g. sol:usdc) is supplied, it derives the native owner address as before, then returns the owner's Associated Token Account (ATA) for that token's mint.

It reuses the existing getAssociatedTokenAccountAddress helper — same statics mint + programId lookup (token-2022 aware) that the rest of the SOL coin uses to build token addresses — so the derived value matches what BitGo assigns as the token receive address. No token requested → native address as before (unchanged).

Changes

  • sdk-core: add tokenName to DeriveAddressOptions.
  • sdk-coin-sol: token (ATA) branch in deriveAddress.
  • express: accept tokenName on the address/derive request body.
  • tests: exact ATA for sol:usdc at a known index (FG1XMJdXBQ5uYaNoKposABg6erxsvzbwC283W2ipnjQB), parity check against getAssociatedTokenAccountAddress, and unknown-token error.

Context

WCN-1054 (FR-465 Phase 2) — Bullish confirmed SPL tokens are needed. ERC-20 on EVM needs nothing extra (tokens reuse the wallet/forwarder address); this is Solana-specific because token deposits go to a per-mint ATA.

Test plan

  • tsc clean (sdk-core, sdk-coin-sol, express)
  • eslint clean (0 errors)
  • 8 SOL deriveAddress unit tests pass (incl. 3 new token tests); ATA matches the independent getAssociatedTokenAccountAddress computation
  • OpenAPI regenerates; vacuum 0 errors / 0 warnings with the new tokenName field
  • CI

🤖 Generated with Claude Code

Extend SOL deriveAddress to support SPL token deposit addresses. When a tokenName
(e.g. sol:usdc) is supplied, derive the native owner address as before, then return
the owner's Associated Token Account (ATA) for that token's mint — using the same
getAssociatedTokenAccountAddress helper (statics mint + programId lookup, token-2022
aware) that the rest of the SOL coin uses, so the derived address matches what BitGo
assigns as the token receive address.

- sdk-core: add tokenName to DeriveAddressOptions.
- express: accept tokenName on the address/derive request body.
- tests: exact ATA for sol:usdc at a known index, parity with
  getAssociatedTokenAccountAddress, and unknown-token error.

WCN-1054

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@linear-code

linear-code Bot commented Jun 22, 2026

Copy link
Copy Markdown

WCN-1054

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