Announcing Oxlint + tsrs
A drop-in replacement for tsgolint for type-aware linting & typechecking.
Up to 7× faster, with up to 75% less memory.
https://t.co/y3tXeT1U4U
This is what open standards are for. Codama IDLs and sRFC 39 describe what a transaction does. Ledger put that on a secure screen. Every wallet on Solana can build on the same foundation now.
Kudos to @lorismatic for the implementation.
Thanks for the deep dive Andy! Some feedback as usual. ☺️
☞ There was some unnecessary `await` before instructions like `client.memo.instructions.addMemo`. Only some of these need to await because they do thing like computing the minimum balance for you (e.g. the `createMint` plan). Also best to use Promise.all to run these in parallel when possible.
☞ If you want to mix `Instructions` and `InstructionPlans` outside the `sendTransaction()` function, you can always combine them in one bigger `InstructionPlan` yourself. Something like `sequentialInstructionPlan([ixA, ixPlanB, ixC])`.
☞ Note on treeshakability: program plugins bring lots of convenience but the tradeoff is it may bundle code your app don’t actually need. If that’s a concern for your app then it’s best to import these standalone helpers explicitly. Alternatively, you can use the program plugin for development/discovery and convert them into standalone imports before shipping to prod.
☞ There is a generated `package.json` file when you run `codama run js` for the first time that contains all the required dependencies so a `pnpm i` on the `clients/js` folder should have been enough.
@a_milz@HeyAndyS@callum_codes Yeah if you use Codama Macros in your program to generate a Codama IDL you can use the Rust CLI:
codama-rs generate-idl ./my-program -o idl.json
Then you can use the JS CLI to read that IDL and generate various clients from it:
pnpm install codama
codama init
codama run --all
Thanks for the great video as usual Andy!
Looks like we need to wire a few more options on the default planner implementations, thanks for catching this! I’ll fix it today.
You can use helpers like `flattenTransactionPlanResult` or `summarizeTransactionPlanResult` to get a quick flat view over the result when sending multiple transactions.
FYI, the new `context` argument in the executor allows you to gradually build the result’s context as you execute your plan so that, if it fails at any point, the failed result is able to tell you about the partial context that was collected so far. E.g. you now get the transaction signature of a failed transaction if you were able to sign it.
The Solana Kit is my go to for client side scripts
and it keeps surprising me what it can do...
sending a tx in basically 3 lines of code
using Kit Plugins 👇
@SolPlay_jonas@a_milz@solana@0x_febo@anza_xyz v2's address is the same as v3's actually. So it goes:
- v1: original address
- v1 → v2: deploy to a new address
- v2 → v3: upgrade program (same address)
- v3 → v4: deploy to a new address
@SolPlay_jonas@a_milz@solana@0x_febo@anza_xyz Fair point. The v4 program has been around for a while now though and it's not the first time this program gets a new address (v3 jump did that too) so there's a precedent for it which hopefully means memo consumers have already catered for the new address. 🙏
@SolPlay_jonas@a_milz@solana@0x_febo@anza_xyz Not really, it’s the same API (akin to token vs p-token). But the clients got breaking change bumps anyway (minor bump since still in v0.x).
Nature is healing.
With Transactions V1 around the corner and the clankers faster and better than ever before, there's no valid reason to stay with web3.js besides stockholm syndrome.
If you didn't start you upgrade to @solana/kit yet, let this be your signal. 🫡
@HeyAndyS Thanks Andy! Do Kit Plugins next. 🙏
Instruction Plans become much easier to use because you’re provided with a default planner and executor so you pass the instructions and it just works.
Big win for Solana JavaScript development!
@lorismatic, @callum_codes and I got together to talk about how to improve Kit and Web3.js v3 interop. One of the improvements discussed was to make Codama generated clients compatible with non-Kit consumers.
We’ve just finished migrating from legacy @solana/web3.js to @solana/kit.
Beside the dependency updates, this gives us a smaller, safer and more flexible foundation for building on Solana.
Here’s what improves 🧵
Public apology to the world: it was me. I used Fable to generate codama renderers for Lua, PHP, Ruby, and Python. The government has now sunset Fable. I understand their decision. @solana powers were never meant to be PHP.
Repo links below