diff --git a/ts/client/src/scripts/example1-user-delegate.ts b/ts/client/src/scripts/example1-user-delegate.ts index 54e2bbc4e..aef36ef04 100644 --- a/ts/client/src/scripts/example1-user-delegate.ts +++ b/ts/client/src/scripts/example1-user-delegate.ts @@ -43,7 +43,9 @@ async function main() { // delegate const delegate = Keypair.fromSecretKey( - Buffer.from(JSON.parse(fs.readFileSync(process.env.DELEGATE!, 'utf-8'))), + Buffer.from( + JSON.parse(fs.readFileSync(process.env.USER3_KEYPAIR!, 'utf-8')), + ), ); const delegateWallet = new Wallet(delegate); const delegateProvider = new AnchorProvider( diff --git a/ts/client/src/scripts/mb-add-group-to-ids-json.ts b/ts/client/src/scripts/mb-add-group-to-ids-json.ts index 5010b7706..0e5a20868 100644 --- a/ts/client/src/scripts/mb-add-group-to-ids-json.ts +++ b/ts/client/src/scripts/mb-add-group-to-ids-json.ts @@ -25,7 +25,7 @@ async function main() { // build client and fetch group for admin const options = AnchorProvider.defaultOptions(); - const connection = new Connection(process.env.CLUSTER_URL, options); + const connection = new Connection(process.env.MB_CLUSTER_URL, options); const user = Keypair.fromSecretKey( Buffer.from( JSON.parse(fs.readFileSync(process.env.USER_KEYPAIR!, 'utf-8')), @@ -40,9 +40,7 @@ async function main() { ); const admin = Keypair.fromSecretKey( Buffer.from( - JSON.parse( - fs.readFileSync(process.env.MANGO_MAINNET_PAYER_KEYPAIR!, 'utf-8'), - ), + JSON.parse(fs.readFileSync(process.env.MB_PAYER_KEYPAIR!, 'utf-8')), ), ); console.log(`Admin ${admin.publicKey.toBase58()}`); diff --git a/ts/client/src/scripts/mb-example1-admin-close.ts b/ts/client/src/scripts/mb-example1-admin-close.ts index e9a5eed14..cf7bff764 100644 --- a/ts/client/src/scripts/mb-example1-admin-close.ts +++ b/ts/client/src/scripts/mb-example1-admin-close.ts @@ -16,13 +16,11 @@ const MAINNET_MINTS = new Map([ async function main() { const options = AnchorProvider.defaultOptions(); - const connection = new Connection(process.env.CLUSTER_URL, options); + const connection = new Connection(process.env.MB_CLUSTER_URL, options); const admin = Keypair.fromSecretKey( Buffer.from( - JSON.parse( - fs.readFileSync(process.env.MANGO_MAINNET_PAYER_KEYPAIR!, 'utf-8'), - ), + JSON.parse(fs.readFileSync(process.env.MB_PAYER_KEYPAIR!, 'utf-8')), ), ); const adminWallet = new Wallet(admin); diff --git a/ts/client/src/scripts/mb-example1-admin.ts b/ts/client/src/scripts/mb-example1-admin.ts index 81048279f..55aab0ee3 100644 --- a/ts/client/src/scripts/mb-example1-admin.ts +++ b/ts/client/src/scripts/mb-example1-admin.ts @@ -20,13 +20,11 @@ const MAINNET_ORACLES = new Map([ async function main() { const options = AnchorProvider.defaultOptions(); - const connection = new Connection(process.env.CLUSTER_URL, options); + const connection = new Connection(process.env.MB_CLUSTER_URL, options); const admin = Keypair.fromSecretKey( Buffer.from( - JSON.parse( - fs.readFileSync(process.env.MANGO_MAINNET_PAYER_KEYPAIR!, 'utf-8'), - ), + JSON.parse(fs.readFileSync(process.env.MB_PAYER_KEYPAIR!, 'utf-8')), ), ); const adminWallet = new Wallet(admin); diff --git a/ts/client/src/scripts/mb-example1-close-account.ts b/ts/client/src/scripts/mb-example1-close-account.ts index d9bb3fa0e..ed9f54c4d 100644 --- a/ts/client/src/scripts/mb-example1-close-account.ts +++ b/ts/client/src/scripts/mb-example1-close-account.ts @@ -9,14 +9,12 @@ import { MangoClient } from '../client'; // async function main() { const options = AnchorProvider.defaultOptions(); - const connection = new Connection(process.env.CLUSTER_URL!, options); + const connection = new Connection(process.env.MB_CLUSTER_URL!, options); // user const user = Keypair.fromSecretKey( Buffer.from( - JSON.parse( - fs.readFileSync(process.env.MANGO_MAINNET_PAYER_KEYPAIR!, 'utf-8'), - ), + JSON.parse(fs.readFileSync(process.env.MB_PAYER_KEYPAIR!, 'utf-8')), ), ); const userWallet = new Wallet(user); @@ -30,9 +28,7 @@ async function main() { // admin const admin = Keypair.fromSecretKey( Buffer.from( - JSON.parse( - fs.readFileSync(process.env.MANGO_MAINNET_PAYER_KEYPAIR!, 'utf-8'), - ), + JSON.parse(fs.readFileSync(process.env.MB_PAYER_KEYPAIR!, 'utf-8')), ), ); console.log(`Admin ${admin.publicKey.toBase58()}`); diff --git a/ts/client/src/scripts/mb-example1-ids-json.ts b/ts/client/src/scripts/mb-example1-ids-json.ts index 6998efcdd..6f816bad3 100644 --- a/ts/client/src/scripts/mb-example1-ids-json.ts +++ b/ts/client/src/scripts/mb-example1-ids-json.ts @@ -2,7 +2,7 @@ import { AnchorProvider, Wallet } from '@project-serum/anchor'; import { Connection, Keypair } from '@solana/web3.js'; import fs from 'fs'; import { HealthType } from '../accounts/mangoAccount'; -import { AccountSize, MangoClient } from '../index'; +import { MangoClient } from '../index'; import { toUiDecimals } from '../utils'; // @@ -11,13 +11,11 @@ import { toUiDecimals } from '../utils'; async function main() { const options = AnchorProvider.defaultOptions(); - const connection = new Connection(process.env.CLUSTER_URL!, options); + const connection = new Connection(process.env.MB_CLUSTER_URL!, options); const user = Keypair.fromSecretKey( Buffer.from( - JSON.parse( - fs.readFileSync(process.env.MANGO_MAINNET_PAYER_KEYPAIR!, 'utf-8'), - ), + JSON.parse(fs.readFileSync(process.env.MB_PAYER_KEYPAIR!, 'utf-8')), ), ); const userWallet = new Wallet(user); @@ -30,9 +28,7 @@ async function main() { const admin = Keypair.fromSecretKey( Buffer.from( - JSON.parse( - fs.readFileSync(process.env.MANGO_MAINNET_PAYER_KEYPAIR!, 'utf-8'), - ), + JSON.parse(fs.readFileSync(process.env.MB_PAYER_KEYPAIR!, 'utf-8')), ), ); console.log(`Admin ${admin.publicKey.toBase58()}`); diff --git a/ts/client/src/scripts/mb-flash-loan.ts b/ts/client/src/scripts/mb-flash-loan.ts index 2c8d784c8..5c6b8d2e4 100644 --- a/ts/client/src/scripts/mb-flash-loan.ts +++ b/ts/client/src/scripts/mb-flash-loan.ts @@ -10,14 +10,14 @@ import { import BN from 'bn.js'; import fs from 'fs'; import { QUOTE_DECIMALS } from '../accounts/bank'; -import { AccountSize, MangoClient } from '../index'; +import { MangoClient } from '../index'; import { getAssociatedTokenAddress } from '../utils'; -const CLUSTER_URL = - process.env.CLUSTER_URL || +const MB_CLUSTER_URL = + process.env.MB_CLUSTER_URL || 'https://mango.rpcpool.com/946ef7337da3f5b8d3e4a34e7f88'; -const MANGO_MAINNET_PAYER_KEYPAIR = - process.env.MANGO_MAINNET_PAYER_KEYPAIR || +const MB_PAYER_KEYPAIR = + process.env.MB_PAYER_KEYPAIR || '/Users/tylershipe/.config/solana/deploy.json'; // @@ -26,13 +26,11 @@ const MANGO_MAINNET_PAYER_KEYPAIR = // NOTE: we assume that ATA for source and target already exist for wallet async function main() { const options = AnchorProvider.defaultOptions(); - const connection = new Connection(CLUSTER_URL, options); + const connection = new Connection(MB_CLUSTER_URL, options); // load user key const user = Keypair.fromSecretKey( - Buffer.from( - JSON.parse(fs.readFileSync(MANGO_MAINNET_PAYER_KEYPAIR!, 'utf-8')), - ), + Buffer.from(JSON.parse(fs.readFileSync(MB_PAYER_KEYPAIR!, 'utf-8'))), ); const userWallet = new Wallet(user); const userProvider = new AnchorProvider(connection, userWallet, options); @@ -44,9 +42,7 @@ async function main() { // load admin key const admin = Keypair.fromSecretKey( - Buffer.from( - JSON.parse(fs.readFileSync(MANGO_MAINNET_PAYER_KEYPAIR!, 'utf-8')), - ), + Buffer.from(JSON.parse(fs.readFileSync(MB_PAYER_KEYPAIR!, 'utf-8'))), ); console.log(`Admin ${admin.publicKey.toBase58()}`);