raydium-io / raydium-sdk-V2-demo

Open-source Typescript SDK demos
50 stars 31 forks source link

How to load Raydium with fetched tokenAccount by default? #20

Closed dexweb3 closed 4 months ago

dexweb3 commented 4 months ago

https://github.com/raydium-io/raydium-sdk-V2-demo/blob/6c0404904a561558ff15c40907c0838552ae1be7/src/config.ts.template#L13

When load Raydium it doesn't provide data about tokenAccount by default. It updates after manipulation only (buy or sell something, for example). Is it possible to get it before make transaction?

cruzshia commented 4 months ago

await radium.account.fetchWalletTokenAccounts()

then you can access account related data in raydium.account object

dexweb3 commented 4 months ago

Thanks @cruzshia 👍