From 26aba24f3c4201a493e1ae16e60824041e614e66 Mon Sep 17 00:00:00 2001 From: abernatskiy Date: Fri, 10 May 2024 18:24:08 +0900 Subject: [PATCH] Correcting the typegen code interface modified: docs/solana-indexing/how-to-start/indexing-orca.mdx modified: docs/solana-indexing/sdk/solana-batch/field-selection.md modified: docs/solana-indexing/sdk/typegen.md --- .../solana-indexing/how-to-start/indexing-orca.mdx | 6 +++--- .../sdk/solana-batch/field-selection.md | 2 +- docs/solana-indexing/sdk/typegen.md | 14 +++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/solana-indexing/how-to-start/indexing-orca.mdx b/docs/solana-indexing/how-to-start/indexing-orca.mdx index 1e7dd626..2322f8a8 100644 --- a/docs/solana-indexing/how-to-start/indexing-orca.mdx +++ b/docs/solana-indexing/how-to-start/indexing-orca.mdx @@ -110,9 +110,9 @@ const dataSource = new DataSourceBuilder() // were executed by the Whirlpool program, and programId: [whirlpool.programId], // have the first eight bytes of .data equal to swap descriptor, and - d8: [whirlpool.swap.d8], + d8: [whirlpool.instructions.swap.d8], // limiting to USDC-SOL pair only - ...whirlpool.swap.accountSelection({ + ...whirlpool.instructions.swap.accountSelection({ whirlpool: ['7qbRF6YsyGuLUVs6Y1q64bdVrfe4ZcUUz1JRdoVNUJnm'] }), // were successfully committed @@ -177,7 +177,7 @@ run(dataSource, database, async ctx => { for (let ins of block.instructions) { // https://read.cryptodatabytes.com/p/starter-guide-to-solana-data-analysis if (ins.programId === whirlpool.programId && - ins.d8 === whirlpool.swap.d8) { + ins.d8 === whirlpool.instructions.swap.d8) { let exchange = new Exchange({ id: ins.id, diff --git a/docs/solana-indexing/sdk/solana-batch/field-selection.md b/docs/solana-indexing/sdk/solana-batch/field-selection.md index ad0e0786..aae1baa6 100644 --- a/docs/solana-indexing/sdk/solana-batch/field-selection.md +++ b/docs/solana-indexing/sdk/solana-batch/field-selection.md @@ -312,7 +312,7 @@ const dataSource = new DataSourceBuilder() // were executed by the Whirlpool program programId: [whirlpool.programId], // have the first 8 bytes of .data equal to swap descriptor - d8: [whirlpool.swap.d8], + d8: [whirlpool.instructions.swap.d8], // were successfully committed isCommitted: true, }, diff --git a/docs/solana-indexing/sdk/typegen.md b/docs/solana-indexing/sdk/typegen.md index a852ef8b..da07a35c 100644 --- a/docs/solana-indexing/sdk/typegen.md +++ b/docs/solana-indexing/sdk/typegen.md @@ -55,7 +55,7 @@ The generated utility modules have three intended uses: .addInstruction({ where: { programId: [whirlpool.programId], - d8: [whirlpool.swap.d8] + d8: [whirlpool.instructions.swap.d8] } }) .build(); @@ -72,11 +72,11 @@ The generated utility modules have three intended uses: for (let block of blocks) { for (let ins of block.instructions) { if (ins.programId === whirlpool.programId && - ins.d8 === whirlpool.swap.d8) { + ins.d8 === whirlpool.instructions.swap.d8) { - let decodedSwap = whirlpool.swap.decode(ins) - let decodedAccounts = whirlpool.swap.decodeAccounts(ins.accounts) - let decodedData = whirlpool.swap.decodeData(ins.data) + let decodedSwap = whirlpool.instructions.swap.decode(ins) + let decodedAccounts = whirlpool.instructions.swap.decodeAccounts(ins.accounts) + let decodedData = whirlpool.instructions.swap.decodeData(ins.data) } } } @@ -88,9 +88,9 @@ The generated utility modules have three intended uses: .addInstruction({ where: { programId: [whirlpool.programId], - d8: [whirlpool.swap.d8], + d8: [whirlpool.instructions.swap.d8], // select instructions for the USDC-SOL pair only - ...whirlpool.swap.accountSelection({ + ...whirlpool.instructions.swap.accountSelection({ whirlpool: ['7qbRF6YsyGuLUVs6Y1q64bdVrfe4ZcUUz1JRdoVNUJnm'] }) }