From 477fbe7b52be43ef7e3a1ed1b93624d4056aac94 Mon Sep 17 00:00:00 2001 From: Yerassyl Zhanymkanov Date: Sat, 27 Jul 2024 19:49:31 +0500 Subject: [PATCH] chore: enhance readme code highlights --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 736e9ca..4c97070 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ $ yarn add @raydium-io/raydium-sdk-v2 ### Initialization -``` +```javascript import { Raydium } from '@raydium-io/raydium-sdk' const raydium = await Raydium.load({ connection, @@ -37,7 +37,7 @@ const raydium = await Raydium.load({ #### how to transform token account data -``` +```javascript import { parseTokenAccountResp } from '@raydium-io/raydium-sdk' const solAccountResp = await connection.getAccountInfo(owner.publicKey) @@ -70,29 +70,29 @@ raydium.account.tokenAccountRawInfos #### Api methods (https://github.com/raydium-io/raydium-sdk-V2/blob/master/src/api/api.ts) - fetch raydium default mint list -``` +```javascript const data = await raydium.api.getTokenList() ``` - fetch mints recognizable by raydium -``` +```javascript const data = await raydium.api.getTokenInfo(['So11111111111111111111111111111111111111112', '4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R']) ``` - fetch pool list available fetch params defined here: https://github.com/raydium-io/raydium-sdk-V2/blob/master/src/api/type.ts#L249 -``` +```javascript const data = await raydium.api.getPoolList({}) ``` - fetch poolInfo by id -``` +```javascript // ids: join pool ids by comma(,) const data = await raydium.api.fetchPoolById({ ids: 'AVs9TA4nWDzfPJE9gGVNJMVhcQy3V9PGazuz33BfG2RA,8sLbNZoA1cfnvMJLPfp98ZLAnFSYCFApfJKMbiXNLwxj' }) ``` - fetch pool list by mints -``` +```javascript const data = await raydium.api.fetchPoolByMints({ mint1: 'So11111111111111111111111111111111111111112', mint2: '4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R' // optional, @@ -101,7 +101,7 @@ const data = await raydium.api.fetchPoolByMints({ ``` - fetch farmInfo by id -``` +```javascript // ids: join farm ids by comma(,) const data = await raydium.api.fetchFarmInfoById({ ids: '4EwbZo8BZXP5313z5A2H11MRBP15M5n6YxfmkjXESKAW,HUDr9BDaAGqi37xbQHzxCyXvfMCKPTPNF8g9c9bPu1Fu' }) ```