Closed mcintyre94 closed 2 months ago
Latest commit: 50ba8117e767a87104cc370d64e2f2140f7fbfb7
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Nice thanks for this! Would you mind adding a changeset and a test for this?
For the changeset, you can just run changeset
locally and for the test you can get inspired by this test and name it something like solAmount.test.ts
.
Note: #160 is a prerequisite (Graphite 💔)
This PR updates how
SolAmountTypeNode
is rendered in the new web3js renderer. Previously it just rendered its nested number type. It now renders with aLamports
type from web3js. The encoder + decoder usegetLamportsEncoder
andgetLamportsDecoder
, passing the nested number encoder/decoder as an argument.This means that you can represent Lamports in the Kinobi IDL using any numeric type, and you'll get properly typed Lamports back. This can improve eg parsing of instructions like
createAccount
where some arguments represent Lamport values.