Merge branch 'dev' into ts-client
This commit is contained in:
commit
45b9dbf383
|
@ -6,10 +6,10 @@ import {
|
|||
PublicKey,
|
||||
} from '@solana/web3.js';
|
||||
import fs from 'fs';
|
||||
import { PerpMarketIndex } from '../src/accounts/perp';
|
||||
import { MangoClient } from '../src/client';
|
||||
import { MANGO_V4_ID } from '../src/constants';
|
||||
import { buildVersionedTx } from '../src/utils';
|
||||
import { PerpMarketIndex } from '../../src/accounts/perp';
|
||||
import { MangoClient } from '../../src/client';
|
||||
import { MANGO_V4_ID } from '../../src/constants';
|
||||
import { buildVersionedTx } from '../../src/utils';
|
||||
|
||||
//
|
||||
// An example for admins based on high level api i.e. the client
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { AnchorProvider, Wallet } from '@coral-xyz/anchor';
|
||||
import { Connection, Keypair, PublicKey } from '@solana/web3.js';
|
||||
import fs from 'fs';
|
||||
import { MangoClient } from '../src/client';
|
||||
import { MANGO_V4_ID } from '../src/constants';
|
||||
import { MangoClient } from '../../src/client';
|
||||
import { MANGO_V4_ID } from '../../src/constants';
|
||||
|
||||
//
|
||||
// An example for users based on high level api i.e. the client
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { AnchorProvider, BN, Wallet } from '@coral-xyz/anchor';
|
||||
import { Connection, Keypair } from '@solana/web3.js';
|
||||
import fs from 'fs';
|
||||
import { Serum3Side } from '../src/accounts/serum3';
|
||||
import { MangoClient } from '../src/client';
|
||||
import { MANGO_V4_ID } from '../src/constants';
|
||||
import { Serum3Side } from '../../src/accounts/serum3';
|
||||
import { MangoClient } from '../../src/client';
|
||||
import { MANGO_V4_ID } from '../../src/constants';
|
||||
|
||||
//
|
||||
// script which shows how to close a mango account cleanly i.e. close all active positions, withdraw all tokens, etc.
|
||||
|
|
|
@ -2,12 +2,12 @@ import { AnchorProvider, BN, Wallet } from '@coral-xyz/anchor';
|
|||
import { Connection, Keypair, PublicKey } from '@solana/web3.js';
|
||||
import { expect } from 'chai';
|
||||
import fs from 'fs';
|
||||
import { Group } from '../src/accounts/group';
|
||||
import { HealthType } from '../src/accounts/mangoAccount';
|
||||
import { PerpOrderSide, PerpOrderType } from '../src/accounts/perp';
|
||||
import { MangoClient } from '../src/client';
|
||||
import { MANGO_V4_ID } from '../src/constants';
|
||||
import { toUiDecimalsForQuote } from '../src/utils';
|
||||
import { Group } from '../../src/accounts/group';
|
||||
import { HealthType } from '../../src/accounts/mangoAccount';
|
||||
import { PerpOrderSide, PerpOrderType } from '../../src/accounts/perp';
|
||||
import { MangoClient } from '../../src/client';
|
||||
import { MANGO_V4_ID } from '../../src/constants';
|
||||
import { toUiDecimalsForQuote } from '../../src/utils';
|
||||
|
||||
//
|
||||
// An example for users based on high level api i.e. the client
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { AnchorProvider, Wallet } from '@coral-xyz/anchor';
|
||||
import { Connection, Keypair } from '@solana/web3.js';
|
||||
import fs from 'fs';
|
||||
import { MangoClient } from '../src/client';
|
||||
import { MANGO_V4_ID } from '../src/constants';
|
||||
import { MangoClient } from '../../src/client';
|
||||
import { MANGO_V4_ID } from '../../src/constants';
|
||||
|
||||
//
|
||||
// example script to close accounts - banks, markets, group etc. which require admin to be the signer
|
||||
|
|
|
@ -3,7 +3,7 @@ import {
|
|||
ASSOCIATED_TOKEN_PROGRAM_ID,
|
||||
NATIVE_MINT,
|
||||
TOKEN_PROGRAM_ID,
|
||||
} from '../src/utils/spl';
|
||||
} from '../../src/utils/spl';
|
||||
import {
|
||||
AddressLookupTableProgram,
|
||||
ComputeBudgetProgram,
|
||||
|
@ -15,21 +15,21 @@ import {
|
|||
SystemProgram,
|
||||
} from '@solana/web3.js';
|
||||
import fs from 'fs';
|
||||
import { TokenIndex } from '../src/accounts/bank';
|
||||
import { Group } from '../src/accounts/group';
|
||||
import { TokenIndex } from '../../src/accounts/bank';
|
||||
import { Group } from '../../src/accounts/group';
|
||||
import {
|
||||
Serum3OrderType,
|
||||
Serum3SelfTradeBehavior,
|
||||
Serum3Side,
|
||||
} from '../src/accounts/serum3';
|
||||
import { Builder } from '../src/builder';
|
||||
import { MangoClient } from '../src/client';
|
||||
} from '../../src/accounts/serum3';
|
||||
import { Builder } from '../../src/builder';
|
||||
import { MangoClient } from '../../src/client';
|
||||
import {
|
||||
NullPerpEditParams,
|
||||
NullTokenEditParams,
|
||||
} from '../src/clientIxParamBuilder';
|
||||
import { MANGO_V4_ID, OPENBOOK_PROGRAM_ID } from '../src/constants';
|
||||
import { buildVersionedTx, toNative } from '../src/utils';
|
||||
} from '../../src/clientIxParamBuilder';
|
||||
import { MANGO_V4_ID, OPENBOOK_PROGRAM_ID } from '../../src/constants';
|
||||
import { buildVersionedTx, toNative } from '../../src/utils';
|
||||
|
||||
const GROUP_NUM = Number(process.env.GROUP_NUM || 0);
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { AnchorProvider, BN, Wallet } from '@coral-xyz/anchor';
|
||||
import { Connection, Keypair } from '@solana/web3.js';
|
||||
import fs from 'fs';
|
||||
import { Serum3Side } from '../src/accounts/serum3';
|
||||
import { MangoClient } from '../src/client';
|
||||
import { MANGO_V4_ID } from '../src/constants';
|
||||
import { Serum3Side } from '../../src/accounts/serum3';
|
||||
import { MangoClient } from '../../src/client';
|
||||
import { MANGO_V4_ID } from '../../src/constants';
|
||||
|
||||
//
|
||||
// (untested?) script which closes a mango account cleanly, first closes all positions, withdraws all tokens and then closes it
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { AnchorProvider, Wallet } from '@coral-xyz/anchor';
|
||||
import { Connection, Keypair, PublicKey } from '@solana/web3.js';
|
||||
import fs from 'fs';
|
||||
import { Group } from '../src/accounts/group';
|
||||
import { MangoClient } from '../src/client';
|
||||
import { MANGO_V4_ID } from '../src/constants';
|
||||
import { Group } from '../../src/accounts/group';
|
||||
import { MangoClient } from '../../src/client';
|
||||
import { MANGO_V4_ID } from '../../src/constants';
|
||||
|
||||
const GROUP_NUM = Number(process.env.GROUP_NUM || 0);
|
||||
const MANGO_ACCOUNT_PK = process.env.MANGO_ACCOUNT_PK;
|
||||
|
|
|
@ -4,8 +4,8 @@ import {
|
|||
isPythOracle,
|
||||
isSwitchboardOracle,
|
||||
parseSwitchboardOracle,
|
||||
} from '../src/accounts/oracle';
|
||||
import { toNativeI80F48 } from '../src/utils';
|
||||
} from '../../src/accounts/oracle';
|
||||
import { toNativeI80F48 } from '../../src/utils';
|
||||
const { MB_CLUSTER_URL } = process.env;
|
||||
|
||||
async function decodePrice(conn, ai): Promise<void> {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { AnchorProvider, Wallet } from '@coral-xyz/anchor';
|
||||
import { Cluster, Connection, Keypair, PublicKey } from '@solana/web3.js';
|
||||
import fs from 'fs';
|
||||
import { HealthType } from '../src/accounts/mangoAccount';
|
||||
import { PerpMarketIndex } from '../src/accounts/perp';
|
||||
import { MangoClient } from '../src/client';
|
||||
import { MANGO_V4_ID } from '../src/constants';
|
||||
import { I80F48 } from '../src/numbers/I80F48';
|
||||
import { toUiDecimalsForQuote } from '../src/utils';
|
||||
import { HealthType } from '../../src/accounts/mangoAccount';
|
||||
import { PerpMarketIndex } from '../../src/accounts/perp';
|
||||
import { MangoClient } from '../../src/client';
|
||||
import { MANGO_V4_ID } from '../../src/constants';
|
||||
import { I80F48 } from '../../src/numbers/I80F48';
|
||||
import { toUiDecimalsForQuote } from '../../src/utils';
|
||||
|
||||
const CLUSTER_URL =
|
||||
process.env.CLUSTER_URL_OVERRIDE || process.env.MB_CLUSTER_URL;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { AnchorProvider, Wallet } from '@coral-xyz/anchor';
|
||||
import { Connection, Keypair } from '@solana/web3.js';
|
||||
import fs from 'fs';
|
||||
import { HealthType } from '../src/accounts/mangoAccount';
|
||||
import { MangoClient, MANGO_V4_ID, toUiDecimalsForQuote } from '../src/index';
|
||||
import { HealthType } from '../../src/accounts/mangoAccount';
|
||||
import { MangoClient, MANGO_V4_ID, toUiDecimalsForQuote } from '../../src/index';
|
||||
|
||||
async function main() {
|
||||
const options = AnchorProvider.defaultOptions();
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
import { AnchorProvider, BN, Wallet } from '@coral-xyz/anchor';
|
||||
import { Connection, Keypair, PublicKey } from '@solana/web3.js';
|
||||
import fs from 'fs';
|
||||
import { Bank } from '../src/accounts/bank';
|
||||
import { MangoAccount } from '../src/accounts/mangoAccount';
|
||||
import { PerpMarket, PerpOrderSide, PerpOrderType } from '../src/accounts/perp';
|
||||
import { Bank } from '../../src/accounts/bank';
|
||||
import { MangoAccount } from '../../src/accounts/mangoAccount';
|
||||
import { PerpMarket, PerpOrderSide, PerpOrderType } from '../../src/accounts/perp';
|
||||
import {
|
||||
Serum3OrderType,
|
||||
Serum3SelfTradeBehavior,
|
||||
Serum3Side,
|
||||
} from '../src/accounts/serum3';
|
||||
import { Builder } from '../src/builder';
|
||||
import { MangoClient } from '../src/client';
|
||||
} from '../../src/accounts/serum3';
|
||||
import { Builder } from '../../src/builder';
|
||||
import { MangoClient } from '../../src/client';
|
||||
import {
|
||||
NullPerpEditParams,
|
||||
NullTokenEditParams,
|
||||
} from '../src/clientIxParamBuilder';
|
||||
import { MANGO_V4_ID } from '../src/constants';
|
||||
} from '../../src/clientIxParamBuilder';
|
||||
import { MANGO_V4_ID } from '../../src/constants';
|
||||
|
||||
//
|
||||
// This script creates liquidation candidates
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { AnchorProvider, Wallet } from '@coral-xyz/anchor';
|
||||
import { Connection, Keypair } from '@solana/web3.js';
|
||||
import fs from 'fs';
|
||||
import { MangoClient } from '../src/client';
|
||||
import { MANGO_V4_ID } from '../src/constants';
|
||||
import { MangoClient } from '../../src/client';
|
||||
import { MANGO_V4_ID } from '../../src/constants';
|
||||
|
||||
//
|
||||
// This script tries to withdraw all positive balances for all accounts
|
||||
|
|
Loading…
Reference in New Issue