removed print statement
This commit is contained in:
parent
4ac8f7b4df
commit
23ce407264
|
@ -355,6 +355,22 @@ export class MarginAccount {
|
|||
|
||||
export class MangoClient {
|
||||
|
||||
async sendTransaction2(
|
||||
connection: Connection,
|
||||
transaction: Transaction,
|
||||
payer: Account,
|
||||
additionalSigners: Account[]
|
||||
): Promise<TransactionSignature> {
|
||||
|
||||
transaction.recentBlockhash = (await connection.getRecentBlockhash('singleGossip')).blockhash
|
||||
transaction.setSigners(payer.publicKey, ...additionalSigners.map( a => a.publicKey ))
|
||||
|
||||
const signers = [payer].concat(additionalSigners)
|
||||
transaction.sign(...signers)
|
||||
const rawTransaction = transaction.serialize()
|
||||
return await sendAndConfirmRawTransaction(connection, rawTransaction, {skipPreflight: true})
|
||||
}
|
||||
|
||||
async sendTransaction(
|
||||
connection: Connection,
|
||||
transaction: Transaction,
|
||||
|
@ -940,7 +956,6 @@ export class MangoClient {
|
|||
return new MangoGroup(mangoGroupPk, decoded, srmVault.amount)
|
||||
} else {
|
||||
const acc = await connection.getAccountInfo(mangoGroupPk);
|
||||
console.log(acc?.data.toString())
|
||||
const decoded = MangoGroupLayout.decode(acc == null ? undefined : acc.data);
|
||||
return new MangoGroup(mangoGroupPk, decoded);
|
||||
}
|
||||
|
|
32
src/index.ts
32
src/index.ts
|
@ -11,22 +11,22 @@ export * from './utils'
|
|||
export { IDS }
|
||||
|
||||
|
||||
// async function testMangoGroup() {
|
||||
// const cluster = "mainnet-beta";
|
||||
// const client = new MangoClient();
|
||||
// const clusterIds = IDS[cluster]
|
||||
//
|
||||
// const connection = new Connection(IDS.cluster_urls[cluster], 'singleGossip')
|
||||
// const mangoGroupPk = new PublicKey(clusterIds.mango_groups.BTC_ETH_USDT.mango_group_pk);
|
||||
// const mangoProgramId = new PublicKey(clusterIds.mango_program_id);
|
||||
// const oraclePk = new PublicKey(IDS['mainnet-beta'].oracles['BTC/USDT'])
|
||||
//
|
||||
// const mangoGroup = await client.getMangoGroup(connection, mangoGroupPk)
|
||||
//
|
||||
// console.log(mangoGroup)
|
||||
// }
|
||||
//
|
||||
// testMangoGroup()
|
||||
async function testMangoGroup() {
|
||||
const cluster = "mainnet-beta";
|
||||
const client = new MangoClient();
|
||||
const clusterIds = IDS[cluster]
|
||||
|
||||
const connection = new Connection(IDS.cluster_urls[cluster], 'singleGossip')
|
||||
const mangoGroupPk = new PublicKey(clusterIds.mango_groups.BTC_ETH_USDT.mango_group_pk);
|
||||
const mangoProgramId = new PublicKey(clusterIds.mango_program_id);
|
||||
const oraclePk = new PublicKey(IDS['mainnet-beta'].oracles['BTC/USDT'])
|
||||
|
||||
const mangoGroup = await client.getMangoGroup(connection, mangoGroupPk)
|
||||
|
||||
console.log(mangoGroup)
|
||||
}
|
||||
|
||||
testMangoGroup()
|
||||
|
||||
// async function testSolink() {
|
||||
// const cluster = "devnet";
|
||||
|
|
Loading…
Reference in New Issue