kklas / anchor-client-gen

A tool for generating solana web3 clients from anchor IDLs.
MIT License
135 stars 21 forks source link

map bytes to Uint8array #40

Closed mschneider closed 2 years ago

mschneider commented 2 years ago

Uint8Array is a js native representation for an array of unsigned bytes, the current Array mapping has bad performance characteristics, especially when working with large buffers. I'd rather leave the Array conversion to the user than making it part of the generator.

mschneider commented 2 years ago

I ran yarn build and yarn test locally to confirm this doesn't break anything, but noticed that I had a bunch of changed files not sure why. LMK if i should reset some of them, or if you want to merge them.

mschneider commented 2 years ago

I ran yarn build, but the npm package doesn't work on my platform (darwin/arm64):

Only x86_64 / Linux distributed in NPM package right now.
Trying globally installed anchor.
kklas commented 2 years ago

Ah that makes sense. It ran your globally installed version of anchor which is < anchor 0.25 and that's why the docs aren't generated. No worries, I'll build it before merging.

kklas commented 2 years ago

Alright, looks good overall! I'll finish it up from here with the build. Thanks for the PR!