rename env vars (#154)
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
parent
9fd4817da8
commit
970187af41
|
@ -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(
|
||||
|
|
|
@ -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()}`);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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()}`);
|
||||
|
|
|
@ -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()}`);
|
||||
|
|
|
@ -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()}`);
|
||||
|
||||
|
|
Loading…
Reference in New Issue