From f5b63351e03045573bff8498bcbb3c7cb211896d Mon Sep 17 00:00:00 2001 From: dd Date: Tue, 9 Mar 2021 08:44:39 -0500 Subject: [PATCH] cleaned up package json --- package.json | 2 +- src/index.ts | 5 ++--- src/liquidate.ts | 23 ++++++++++------------- src/test.ts | 19 +++++++++++-------- yarn.lock | 25 +++++++++++++------------ 5 files changed, 37 insertions(+), 37 deletions(-) diff --git a/package.json b/package.json index 9d95129..136e31c 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "typescript": "^4.0.5" }, "dependencies": { - "@mango/client": "git+ssh://git@github.com:blockworks-foundation/mango-client-ts.git#srm_account", + "@blockworks-foundation/mango-client": "^0.1.4", "@project-serum/serum": "^0.13.20", "@solana/spl-token": "0.0.13", "@solana/web3.js": "^0.90.0", diff --git a/src/index.ts b/src/index.ts index 41edd4b..9638c4e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1,8 @@ -import { IDS, MangoClient, MarginAccount, NUM_TOKENS } from '@mango/client'; +import { IDS, MangoClient, MarginAccount, NUM_MARKETS } from '@blockworks-foundation/mango-client'; -import { Account, Connection, PublicKey, TransactionSignature } from '@solana/web3.js'; +import { Account, Connection, PublicKey } from '@solana/web3.js'; import * as fs from 'fs'; import { Market } from '@project-serum/serum'; -import { NUM_MARKETS } from '@mango/client/lib/layout'; import { sleep } from './utils'; async function setupMarginAccounts() { diff --git a/src/liquidate.ts b/src/liquidate.ts index 74d71b4..a779458 100644 --- a/src/liquidate.ts +++ b/src/liquidate.ts @@ -1,23 +1,20 @@ -// TODO make sure funds in liquidatable account can actually be withdrawn -// -- can't be withdrawn if total deposits == total_borrows - import { + findLargestTokenAccountForOwner, getMultipleAccounts, IDS, MangoClient, MangoGroup, MarginAccount, - MarginAccountLayout, nativeToUi, - NUM_TOKENS, parseTokenAccountData, - findLargestTokenAccountForOwner, -} from '@mango/client'; -import { Account, Connection, LAMPORTS_PER_SOL, PublicKey, TransactionSignature } from '@solana/web3.js'; + nativeToUi, + NUM_MARKETS, + NUM_TOKENS, + parseTokenAccountData, +} from '@blockworks-foundation/mango-client'; +import { Account, Connection, PublicKey, TransactionSignature } from '@solana/web3.js'; import fs from 'fs'; -import { Market, OpenOrders } from '@project-serum/serum'; -import { NUM_MARKETS } from '@mango/client/lib/layout'; -import { getUnixTs, sleep } from './utils'; -import { homedir } from 'os' -import { TOKEN_PROGRAM_ID } from '@solana/spl-token'; +import { Market } from '@project-serum/serum'; +import { sleep } from './utils'; +import { homedir } from 'os'; async function drainAccount( diff --git a/src/test.ts b/src/test.ts index 12b8970..753d801 100644 --- a/src/test.ts +++ b/src/test.ts @@ -1,25 +1,28 @@ import { - findLargestTokenAccountForOwner, + createAccountInstruction, + encodeMangoInstruction, + findLargestTokenAccountForOwner, getFilteredProgramAccounts, IDS, MangoClient, MangoGroup, MarginAccount, - MarginAccountLayout, nativeToUi, + MarginAccountLayout, + nativeToUi, NUM_MARKETS, NUM_TOKENS, -} from '@mango/client'; +} from '@blockworks-foundation/mango-client'; import { Account, - Connection, LAMPORTS_PER_SOL, + Connection, + LAMPORTS_PER_SOL, PublicKey, SYSVAR_RENT_PUBKEY, Transaction, - TransactionInstruction, TransactionSignature, + TransactionInstruction, + TransactionSignature, } from '@solana/web3.js'; import fs from 'fs'; import { getUnixTs, sleep } from './utils'; -import { createAccountInstruction, getFilteredProgramAccounts } from '@mango/client/lib/utils'; -import { encodeMangoInstruction, NUM_MARKETS } from '@mango/client/lib/layout'; -import { Token, MintLayout, AccountLayout, TOKEN_PROGRAM_ID } from '@solana/spl-token'; +import { AccountLayout, TOKEN_PROGRAM_ID } from '@solana/spl-token'; import { homedir } from 'os'; import { Market } from '@project-serum/serum'; diff --git a/yarn.lock b/yarn.lock index b64bbad..66a192b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -314,6 +314,19 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@blockworks-foundation/mango-client@^0.1.4": + version "0.1.4" + resolved "https://registry.yarnpkg.com/@blockworks-foundation/mango-client/-/mango-client-0.1.4.tgz#76e2905696249626a79f67e4c6b81dc3513dc03e" + integrity sha512-vpXNWVQtJheezyWNqUXTSUwtcXnSlW4iPhbMJxWHl0Njz9bZFKEtEItWEiaNpxxA8FUDEwL5wKPiIioMvorg1w== + dependencies: + "@project-serum/serum" "^0.13.20" + "@project-serum/sol-wallet-adapter" "^0.1.4" + "@solana/spl-token" "0.0.13" + "@solana/web3.js" "^0.90.0" + bn.js "^5.1.2" + borsh "https://github.com/defactojob/borsh-js#field-mapper" + buffer-layout "^1.2.0" + "@cnakazawa/watch@^1.0.3": version "1.0.4" resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.4.tgz#f864ae85004d0fcab6f50be9141c4da368d1656a" @@ -524,18 +537,6 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" -"@mango/client@git+ssh://git@github.com:blockworks-foundation/mango-client-ts.git#srm_account": - version "0.1.2" - resolved "git+ssh://git@github.com:blockworks-foundation/mango-client-ts.git#ed8ef6c0f6740667f1f457107512f3c4ae505ff2" - dependencies: - "@project-serum/serum" "^0.13.20" - "@project-serum/sol-wallet-adapter" "^0.1.4" - "@solana/spl-token" "0.0.13" - "@solana/web3.js" "^0.90.0" - bn.js "^5.1.2" - borsh "https://github.com/defactojob/borsh-js#field-mapper" - buffer-layout "^1.2.0" - "@nodelib/fs.scandir@2.1.4": version "2.1.4" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz#d4b3549a5db5de2683e0c1071ab4f140904bbf69"