Skip to content

Commit 138b31f

Browse files
bd sync: 2026-02-25 23:49:08
1 parent defeafd commit 138b31f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.beads/issues.jsonl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
{"id":"shapeshiftweb-77h.4","title":"wire Solana case in getL1RateOrQuote.ts and export solana from thorchain-utils/index.ts","description":"Two wiring tasks that activate Solana in the THORChain swapper.\n\n### packages/swapper/src/thorchain-utils/getL1RateOrQuote.ts\n\nAdd at top:\n import { PublicKey, TransactionInstruction } from '@solana/web3.js'\n const SOLANA_MEMO_PROGRAM_ID = 'MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr'\n\nReplace CHAIN_NAMESPACE.Solana case (currently lines ~444-451, returns Err 'Solana is not supported') with:\n```\ncase CHAIN_NAMESPACE.Solana: {\n const adapter = deps.assertGetSolanaChainAdapter(sellAsset.chainId)\n const sendAddress = (input as CommonTradeQuoteInput).sendAddress\n\n const maybeRoutes = await Promise.allSettled(\n perRouteValues.map(async (route): Promise\u003cT\u003e =\u003e {\n const memo = getMemo(route)\n const protocolFees = getProtocolFees(route.quote)\n\n const feeData = await (async (): Promise\u003cQuoteFeeData\u003e =\u003e {\n if (!sendAddress) return { networkFeeCryptoBaseUnit: undefined, protocolFees }\n const memoInstruction = new TransactionInstruction({\n keys: [],\n programId: new PublicKey(SOLANA_MEMO_PROGRAM_ID),\n data: Buffer.from(memo, 'utf8'),\n })\n const { fast } = await adapter.getFeeData({\n to: '',\n value: '0',\n chainSpecific: { from: sendAddress, instructions: [memoInstruction] },\n })\n return { networkFeeCryptoBaseUnit: fast.txFee, protocolFees }\n })()\n\n return makeThorTradeRateOrQuote\u003cThorUtxoOrCosmosTradeRateOrQuote\u003e({\n route, allowanceContract: '0x0', memo, feeData,\n })\n }),\n )\n\n const routes = maybeRoutes.filter(isFulfilled).map(r =\u003e r.value)\n if (!routes.length)\n return Err(makeSwapErrorRight({ message: 'Unable to create any routes', code: TradeQuoteError.UnsupportedTradePair, cause: maybeRoutes.filter(isRejected).map(r =\u003e r.reason) }))\n return Ok(routes)\n}\n```\n\n### packages/swapper/src/thorchain-utils/index.ts\nAdd: `export * as solana from './solana'` alongside evm, utxo, tron, cosmossdk.\n\nAcceptance: SOL appears as valid sell/buy chain in THORChain swapper. yarn type-check passes.","status":"closed","priority":1,"issue_type":"task","owner":"17035424+gomesalexandre@users.noreply.github.com","created_at":"2026-02-25T22:03:51Z","created_by":"gomes","updated_at":"2026-02-25T22:21:21Z","closed_at":"2026-02-25T22:21:21Z","close_reason":"Replaced Solana error stub with full Memo Program fee estimation case in getL1RateOrQuote.ts. Exported solana from thorchain-utils/index.ts.","dependencies":[{"issue_id":"shapeshiftweb-77h.4","depends_on_id":"shapeshiftweb-77h","type":"parent-child","created_at":"2026-02-25T23:03:51Z","created_by":"gomes","metadata":"{}"},{"issue_id":"shapeshiftweb-77h.4","depends_on_id":"shapeshiftweb-77h.3","type":"blocks","created_at":"2026-02-25T23:04:16Z","created_by":"gomes","metadata":"{}"}]}
66
{"id":"shapeshiftweb-77h.5","title":"wire Solana into ThorchainSwapper endpoints.ts and ThorchainSwapper.ts","description":"Wire the new Solana tx utilities into the swapper's public API.\n\n### packages/swapper/src/swappers/ThorchainSwapper/endpoints.ts\n1. Import: add `solana` to existing import from '../../thorchain-utils'\n2. Add to the returned object:\n `getUnsignedSolanaTransaction: input =\u003e solana.getUnsignedSolanaTransaction(input, swapperName),`\n `getSolanaTransactionFees: input =\u003e solana.getSolanaTransactionFees(input, swapperName),`\n\n### packages/swapper/src/swappers/ThorchainSwapper/ThorchainSwapper.ts\nAdd to the swapper class/object:\n `executeSolanaTransaction: (txToSign, { signAndBroadcastTransaction }) =\u003e signAndBroadcastTransaction(txToSign),`\n\nPattern: look at executeTronTransaction as the model (same structure: just delegates to signAndBroadcastTransaction).\n\nAcceptance: yarn type-check passes, no TS errors on swapper types.","status":"closed","priority":1,"issue_type":"task","owner":"17035424+gomesalexandre@users.noreply.github.com","created_at":"2026-02-25T22:03:59Z","created_by":"gomes","updated_at":"2026-02-25T22:21:01Z","closed_at":"2026-02-25T22:21:01Z","close_reason":"Added getUnsignedSolanaTransaction and getSolanaTransactionFees to endpoints.ts, added executeSolanaTransaction to ThorchainSwapper.ts, added solana export to thorchain-utils/index.ts. Type-check passes (only TS6305 stale dist errors).","dependencies":[{"issue_id":"shapeshiftweb-77h.5","depends_on_id":"shapeshiftweb-77h","type":"parent-child","created_at":"2026-02-25T23:03:59Z","created_by":"gomes","metadata":"{}"},{"issue_id":"shapeshiftweb-77h.5","depends_on_id":"shapeshiftweb-77h.3","type":"blocks","created_at":"2026-02-25T23:04:16Z","created_by":"gomes","metadata":"{}"}]}
77
{"id":"shapeshiftweb-77h.6","title":"create unchained-client Solana THORChain parseTx parser","description":"Create packages/unchained-client/src/solana/parser/thorchain.ts and register it.\n\n### thorchain.ts (new file)\nThe Solana Tx type has `instructions: Array\u003c{ accounts, data: string, programId: string, innerInstructions }\u003e`. data field is base58-encoded.\n\n```typescript\nimport bs58 from 'bs58'\nimport * as thorchain from '../../parser/thormaya'\nimport type { Tx } from '../types'\nimport type { SubParser, TxSpecific } from '../../parser'\n\nconst MEMO_PROGRAM_ID = 'MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr'\n\nexport class Parser implements SubParser\u003cTx\u003e {\n private readonly parser: thorchain.Parser\n\n constructor(args: { midgardUrl: string }) {\n this.parser = new thorchain.Parser({ midgardUrl: args.midgardUrl })\n }\n\n async parse(tx: Tx): Promise\u003cTxSpecific | undefined\u003e {\n const memoInstruction = tx.instructions.find(i =\u003e i.programId === MEMO_PROGRAM_ID)\n if (\\!memoInstruction) return\n\n const memo = Buffer.from(bs58.decode(memoInstruction.data)).toString('utf8')\n if (\\!memo) return\n\n return await this.parser.parse(memo, tx.txid)\n }\n}\n```\n\nLook at existing parsers in packages/unchained-client/src/solana/parser/ to understand registration pattern. Check if there's an index.ts or a base parser that SubParsers get registered into. Follow the same pattern as utxo/parser/thorchain.ts was registered.\n\nCheck if bs58 is available as a dependency (it may already be in the Solana chain adapter dependencies).\n\nAcceptance:\n- File created, exported from solana/parser/index.ts or equivalent\n- yarn type-check passes\n- A THORChain SOL swap tx would parse correctly (manual verification)","status":"closed","priority":1,"issue_type":"task","owner":"17035424+gomesalexandre@users.noreply.github.com","created_at":"2026-02-25T22:04:11Z","created_by":"gomes","updated_at":"2026-02-25T22:10:49Z","closed_at":"2026-02-25T22:10:49Z","close_reason":"Created solana/parser/thorchain.ts with Memo Program detection, base58 decode, and thormaya parser delegation. Updated types.ts to add data/TxMetadata to ParsedTx and TxSpecific. Updated index.ts to pass data through. Added bs58 dep to unchained-client.","dependencies":[{"issue_id":"shapeshiftweb-77h.6","depends_on_id":"shapeshiftweb-77h","type":"parent-child","created_at":"2026-02-25T23:04:11Z","created_by":"gomes","metadata":"{}"}]}
8-
{"id":"shapeshiftweb-9lf","title":"feat: thorchain solana lp integration","description":"Add LP (add/remove liquidity) support for SOL.SOL THORChain pool. Builds on swapper integration (shapeshiftweb-77h). LP tx structure identical to swap: native SOL to vault + SPL Memo instruction with +:SOL.SOL or -:SOL.SOL memo. parseTx already covered by swapper PR. Main work: wire Solana into LP UI chain gating. GH: #12035. Branch: feat/thorchain-solana-lp","status":"open","priority":2,"issue_type":"epic","owner":"17035424+gomesalexandre@users.noreply.github.com","created_at":"2026-02-25T21:59:41Z","created_by":"gomes","updated_at":"2026-02-25T21:59:41Z","external_ref":"gh-12035","dependencies":[{"issue_id":"shapeshiftweb-9lf","depends_on_id":"shapeshiftweb-77h","type":"blocks","created_at":"2026-02-25T23:02:25Z","created_by":"gomes","metadata":"{}"}]}
9-
{"id":"shapeshiftweb-9lf.1","title":"investigate LP chain gating and tx building for Solana support","description":"Research spike: understand how the LP UI gates chains and builds transactions, specifically to know where to add Solana.\n\nKey questions to answer (read code, don't modify):\n1. Where does the LP UI determine which chains are supported? Look for a chain allowlist/filter in src/pages/ThorChainLP/ or related hooks.\n2. Does AddLiquidityInput.tsx or RemoveLiquidity have a chain filter?\n3. How does the LP get the unsigned tx? Does it go through the swapper's getUnsignedSolanaTransaction or does it have its own tx building path?\n4. What hooks exist in src/lib/utils/thorchain/lp/ for tx building?\n5. How does the LP handle non-EVM chains currently (e.g. BTC, DOGE, RUNE)? That's the pattern to follow.\n\nOutput: Document findings in the notes of this bead, then create the implementation sub-beads with precise file targets.\n\nAcceptance: Follow-up implementation beads created with exact file paths and changes needed.","status":"open","priority":1,"issue_type":"task","owner":"17035424+gomesalexandre@users.noreply.github.com","created_at":"2026-02-25T22:04:27Z","created_by":"gomes","updated_at":"2026-02-25T22:04:27Z","dependencies":[{"issue_id":"shapeshiftweb-9lf.1","depends_on_id":"shapeshiftweb-9lf","type":"parent-child","created_at":"2026-02-25T23:04:26Z","created_by":"gomes","metadata":"{}"}]}
10-
{"id":"shapeshiftweb-9lf.2","title":"wire Solana into THORChain LP add/remove liquidity","description":"Add Solana support to the THORChain LP UI and tx building. Builds on swapper PR (shapeshiftweb-77h) and investigation spike (shapeshiftweb-9lf.1).\n\nExpected changes (confirm exact files from investigation spike):\n1. Add Solana to LP-eligible chains in whatever type/list gates LP access\n2. LP tx building: add Solana case that reuses the solana utils from thorchain-utils/solana/ (same vault + memo pattern, memo format: +:SOL.SOL:optionalPairedAddress or -:SOL.SOL)\n3. Any LP-specific send hooks that need a Solana branch\n\nConstraints:\n- Savers are dead, don't add savers support\n- parseTx is already covered by swapper PR\n- Follow the BTC/DOGE/RUNE non-EVM pattern\n\nAcceptance:\n- Solana appears in LP chain selection UI\n- Add liquidity: sends SOL to vault with +:SOL.SOL memo\n- Remove liquidity: sends SOL to vault with -:SOL.SOL memo\n- yarn type-check, yarn lint --fix pass","status":"open","priority":1,"issue_type":"task","owner":"17035424+gomesalexandre@users.noreply.github.com","created_at":"2026-02-25T22:04:35Z","created_by":"gomes","updated_at":"2026-02-25T22:04:35Z","dependencies":[{"issue_id":"shapeshiftweb-9lf.2","depends_on_id":"shapeshiftweb-9lf","type":"parent-child","created_at":"2026-02-25T23:04:35Z","created_by":"gomes","metadata":"{}"},{"issue_id":"shapeshiftweb-9lf.2","depends_on_id":"shapeshiftweb-9lf.1","type":"blocks","created_at":"2026-02-25T23:04:38Z","created_by":"gomes","metadata":"{}"}]}
8+
{"id":"shapeshiftweb-9lf","title":"feat: thorchain solana lp integration","description":"Add LP (add/remove liquidity) support for SOL.SOL THORChain pool. Builds on swapper integration (shapeshiftweb-77h). LP tx structure identical to swap: native SOL to vault + SPL Memo instruction with +:SOL.SOL or -:SOL.SOL memo. parseTx already covered by swapper PR. Main work: wire Solana into LP UI chain gating. GH: #12035. Branch: feat/thorchain-solana-lp","status":"closed","priority":2,"issue_type":"epic","owner":"17035424+gomesalexandre@users.noreply.github.com","created_at":"2026-02-25T21:59:41Z","created_by":"gomes","updated_at":"2026-02-25T22:49:02Z","closed_at":"2026-02-25T22:49:02Z","close_reason":"All sub-beads complete. THORChain Solana LP integration: investigation spike + 2-file implementation (getThorchainTransactionType + Send/utils.ts Memo Program handling). PR #12037 targeting #12036.","external_ref":"gh-12035","dependencies":[{"issue_id":"shapeshiftweb-9lf","depends_on_id":"shapeshiftweb-77h","type":"blocks","created_at":"2026-02-25T23:02:25Z","created_by":"gomes","metadata":"{}"}]}
9+
{"id":"shapeshiftweb-9lf.1","title":"investigate LP chain gating and tx building for Solana support","description":"Research spike: understand how the LP UI gates chains and builds transactions, specifically to know where to add Solana.\n\nKey questions to answer (read code, don't modify):\n1. Where does the LP UI determine which chains are supported? Look for a chain allowlist/filter in src/pages/ThorChainLP/ or related hooks.\n2. Does AddLiquidityInput.tsx or RemoveLiquidity have a chain filter?\n3. How does the LP get the unsigned tx? Does it go through the swapper's getUnsignedSolanaTransaction or does it have its own tx building path?\n4. What hooks exist in src/lib/utils/thorchain/lp/ for tx building?\n5. How does the LP handle non-EVM chains currently (e.g. BTC, DOGE, RUNE)? That's the pattern to follow.\n\nOutput: Document findings in the notes of this bead, then create the implementation sub-beads with precise file targets.\n\nAcceptance: Follow-up implementation beads created with exact file paths and changes needed.","status":"closed","priority":1,"issue_type":"task","owner":"17035424+gomesalexandre@users.noreply.github.com","created_at":"2026-02-25T22:04:27Z","created_by":"gomes","updated_at":"2026-02-25T22:36:14Z","closed_at":"2026-02-25T22:36:14Z","close_reason":"Investigation complete. Only 2 files need changes: getThorchainTransactionType in thorchain/index.ts (add solanaChainId to Send case) and Send/utils.ts (add memo instruction in Solana estimateFees + handleSend). No UI changes needed.","dependencies":[{"issue_id":"shapeshiftweb-9lf.1","depends_on_id":"shapeshiftweb-9lf","type":"parent-child","created_at":"2026-02-25T23:04:26Z","created_by":"gomes","metadata":"{}"}],"comments":[{"id":1,"issue_id":"shapeshiftweb-9lf.1","author":"gomes","text":"Investigation complete.\n\nKey findings:\n1. useSendThorTx (src/lib/utils/thorchain/hooks/useSendThorTx.tsx) is the central hook for all THORChain LP txs. It uses getThorchainTransactionType to decide which tx path to take.\n\n2. getThorchainTransactionType (src/lib/utils/thorchain/index.ts:311) currently throws for Solana. Needs: add '|| chainId === solanaChainId' to the 'Send' return condition.\n\n3. The 'Send' case in useSendThorTx uses handleSend + estimateFees from src/components/Modals/Send/utils.ts. Both already have CHAIN_NAMESPACE.Solana cases but they don't handle memo as an SPL instruction. Needs updating.\n\n4. estimateFees Solana case (~line 110): when memo is provided, build a TransactionInstruction (web3.js) and pass it in chainSpecific.instructions for getFeeData — ensures compute budget includes memo.\n\n5. handleSend Solana case (~line 331): when memo is provided, build a SolanaTxInstruction (hdwallet format: {keys:[], programId: MEMO_PROGRAM_ID, data: Buffer.from(memo,'utf8')}) and include in chainSpecific.instructions for buildSendTransaction.\n\nONLY 2 FILES needed:\n- src/lib/utils/thorchain/index.ts (1-line change in getThorchainTransactionType)\n- src/components/Modals/Send/utils.ts (add memo instruction handling in both estimateFees + handleSend Solana cases)\n\nNo UI changes needed — Solana already shows in the pool list, walletSupportsChain already works for Solana. No chain gating to change. parseTx already done in swapper PR.","created_at":"2026-02-25T22:36:09Z"}]}
10+
{"id":"shapeshiftweb-9lf.2","title":"wire Solana into THORChain LP add/remove liquidity","description":"Add Solana support to THORChain LP. Based on investigation (9lf.1), only 2 files need changes.\n\n### File 1: src/lib/utils/thorchain/index.ts\n\nIn getThorchainTransactionType (~line 311), extend the 'Send' return condition:\nBEFORE:\n if (isUtxoChainId(chainId) || chainId === cosmosChainId || chainId === tronChainId) {\nAFTER:\n if (isUtxoChainId(chainId) || chainId === cosmosChainId || chainId === tronChainId || chainId === solanaChainId) {\n\nImport solanaChainId from @shapeshiftoss/caip (check existing imports first).\n\n### File 2: src/components/Modals/Send/utils.ts\n\nMEMO_PROGRAM_ID constant near top: 'MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr'\n\n#### In estimateFees Solana case (~line 110):\nWhen memo is provided, build a web3.js TransactionInstruction for getFeeData to estimate compute budget including memo:\n```typescript\nconst MEMO_PROGRAM_ID = 'MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr'\n\n// In the Solana case of estimateFees:\nconst memoInstruction: TransactionInstruction | undefined = memo\n ? new TransactionInstruction({\n keys: [],\n programId: new PublicKey(MEMO_PROGRAM_ID),\n data: Buffer.from(memo, 'utf8'),\n })\n : undefined\n\n// Pass memo instruction alongside existing instructions logic\nconst instructions = contractAddress\n ? await adapter.buildEstimationInstructions({ from: account, to, tokenId: contractAddress, value })\n : memoInstruction ? [memoInstruction] : undefined\n\n// chainSpecific:\nchainSpecific: { from: account, tokenId: contractAddress, instructions }\n```\n\n#### In handleSend Solana case (~line 331):\nWhen memo is provided, build a SolanaTxInstruction (hdwallet format) and pass in chainSpecific.instructions:\n```typescript\nconst memoInstruction: SolanaTxInstruction | undefined = memo\n ? { keys: [], programId: MEMO_PROGRAM_ID, data: Buffer.from(memo, 'utf8') }\n : undefined\n\n// In BuildSendTxInput chainSpecific:\nchainSpecific: {\n tokenId: contractAddress,\n computeUnitLimit: instructions.length \u003e 0 ? fees.chainSpecific.computeUnits : undefined,\n computeUnitPrice: instructions.length \u003e 0 ? fees.chainSpecific.priorityFee : undefined,\n instructions: memoInstruction ? [memoInstruction] : undefined,\n}\n```\n\nSolanaTxInstruction is from @shapeshiftoss/chain-adapters solana types. Import it.\n\nAcceptance:\n- getThorchainTransactionType(solanaChainId) returns 'Send' without throwing\n- estimateFees for Solana with memo includes TransactionInstruction in getFeeData call\n- handleSend for Solana with memo includes SolanaTxInstruction in buildSendTransaction\n- yarn type-check passes, yarn lint --fix passes","status":"closed","priority":1,"issue_type":"task","owner":"17035424+gomesalexandre@users.noreply.github.com","created_at":"2026-02-25T22:04:35Z","created_by":"gomes","updated_at":"2026-02-25T22:48:00Z","closed_at":"2026-02-25T22:48:00Z","close_reason":"Added solanaChainId to getThorchainTransactionType 'Send' case. Added SPL Memo Program instruction handling in estimateFees (web3.js TransactionInstruction) and handleSend (SolanaTxInstruction) Solana cases in Send/utils.ts. Only 2 files changed.","dependencies":[{"issue_id":"shapeshiftweb-9lf.2","depends_on_id":"shapeshiftweb-9lf","type":"parent-child","created_at":"2026-02-25T23:04:35Z","created_by":"gomes","metadata":"{}"},{"issue_id":"shapeshiftweb-9lf.2","depends_on_id":"shapeshiftweb-9lf.1","type":"blocks","created_at":"2026-02-25T23:04:38Z","created_by":"gomes","metadata":"{}"}]}

0 commit comments

Comments
 (0)