@@ -16,6 +16,7 @@ import { AccountMetaData } from '@solana/spl-governance'
1616import { Connection , PublicKey } from '@solana/web3.js'
1717import { abbreviateAddress } from '@utils/formatting'
1818import tokenPriceService from '@utils/services/tokenPrice'
19+ import { tryGetTokenMint } from '@utils/tokens'
1920import { UiOpenOrder } from '@utils/uiTypes/manifest'
2021
2122export type CancelOrderInstructionArgs = {
@@ -102,12 +103,36 @@ export const MANIFEST_INSTRUCTIONS = {
102103 const amount = params . baseAtoms
103104
104105 const side = params . isBid ? 'Buy' : 'Sell'
105- const quoteTokenInfo = tokenPriceService . getTokenInfo (
106+ let quoteTokenInfo = tokenPriceService . getTokenInfo (
106107 accounts [ 15 ] . pubkey . toBase58 ( ) ,
107108 )
108- const baseTokenInfo = tokenPriceService . getTokenInfo (
109+ let baseTokenInfo = tokenPriceService . getTokenInfo (
110+ accounts [ 10 ] . pubkey . toBase58 ( ) ,
111+ )
112+ console . log (
113+ accounts [ 15 ] . pubkey . toBase58 ( ) ,
109114 accounts [ 10 ] . pubkey . toBase58 ( ) ,
110115 )
116+ if ( ! baseTokenInfo ) {
117+ const resp = await connection . getParsedAccountInfo (
118+ accounts [ 10 ] . pubkey ,
119+ )
120+ baseTokenInfo = {
121+ //@ts -ignore
122+ decimals : resp . value ?. data . parsed . info . decimals ,
123+ symbol : accounts [ 10 ] . pubkey . toBase58 ( ) ,
124+ } as any
125+ }
126+ if ( ! quoteTokenInfo ) {
127+ const resp = await connection . getParsedAccountInfo (
128+ accounts [ 15 ] . pubkey ,
129+ )
130+ quoteTokenInfo = {
131+ //@ts -ignore
132+ decimals : resp . value ?. data . parsed . info . decimals ,
133+ symbol : accounts [ 15 ] . pubkey . toBase58 ( ) ,
134+ } as any
135+ }
111136
112137 const market = accounts [ 3 ] . pubkey
113138
0 commit comments