關於我上次提到的在 Rust 中解包 Solana 帳戶數據的帖子,我們在 TS 端也需要做同樣的事情。 因此,我使用 solana/kit - gill 為我們的結構創建了一個編解碼器——這可以輕鬆地使用最新的 Solana TypeScript SDK 進行打包/解包。
lich.sol
lich.sol7月10日 00:16
after defining pdas in our Pinocchio programs, we need a simple and safe way to unpack raw solana account data on the client side into the structs we defined. so, i usually implement a small trait in my sdk for each state that handles its deserialization cleanly and safely.
1.22K