Skip to content

Commit

Permalink
Updating the interface for the token program ABI
Browse files Browse the repository at this point in the history
	modified:   docs/solana-indexing/how-to-start/indexing-orca.mdx
  • Loading branch information
abernatskiy committed May 10, 2024
1 parent 26aba24 commit 7742304
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/solana-indexing/how-to-start/indexing-orca.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ run(dataSource, database, async ctx => {
})

assert(ins.inner.length == 2)
let srcTransfer = tokenProgram.transfer.decode(ins.inner[0])
let destTransfer = tokenProgram.transfer.decode(ins.inner[1])
let srcTransfer = tokenProgram.instructions.transfer.decode(ins.inner[0])
let destTransfer = tokenProgram.instructions.transfer.decode(ins.inner[1])

let srcBalance = ins.getTransaction().tokenBalances.find(tb => tb.account == srcTransfer.accounts.source)
let destBalance = ins.getTransaction().tokenBalances.find(tb => tb.account === destTransfer.accounts.destination)
Expand Down Expand Up @@ -217,7 +217,7 @@ run(dataSource, database, async ctx => {
```
This goes through all the instructions in the block, verifies that they indeed are `swap` instruction from the Whirlpool program and decodes the data of each inner instruction.
Then it retrieves the transaction from the decoded inner instruction and source and destination accounts.
The decoding is done with the `tokenProgram.transfer.decode` function from the Typescript ABI provided in the project.
The decoding is done with the `tokenProgram.instructions.transfer.decode` function from the Typescript ABI provided in the project.

At this point the squid is ready for its first test run. Execute
```bash
Expand Down

0 comments on commit 7742304

Please sign in to comment.