Collection of utility libraries for onchain and offchain solana development.
&AccountInfo
s are cheap, are Copy
, and there's no reason to clone()
them except on CPI.
So you dont have to think about getting the arg positions right.
Compare:
transfer(account_a, account_b, 100);
to:
transfer(
TransferAccounts {
from: account_a,
to: account_b,
},
100,
)
In general for instructions you wanna split stuff up into Accounts
and Args
just like how solores does.
TODO: profile performance impact of this.