remove serum and replace with coral
This commit is contained in:
@@ -1,7 +1,19 @@
|
||||
import { Connection, Keypair, SystemProgram, PublicKey, Commitment } from "@solana/web3.js"
|
||||
import { Program, Wallet, AnchorProvider, Address, BN } from "@project-serum/anchor"
|
||||
import {
|
||||
Connection,
|
||||
Keypair,
|
||||
SystemProgram,
|
||||
PublicKey,
|
||||
Commitment,
|
||||
} from "@solana/web3.js";
|
||||
import {
|
||||
Program,
|
||||
Wallet,
|
||||
AnchorProvider,
|
||||
Address,
|
||||
BN,
|
||||
} from "@coral-xyz/anchor";
|
||||
import { WbaVault, IDL } from "../programs/wba_vault";
|
||||
import wallet from "../wba-wallet.json"
|
||||
import wallet from "../wba-wallet.json";
|
||||
|
||||
// Import our keypair from the wallet file
|
||||
const keypair = Keypair.fromSecretKey(new Uint8Array(wallet));
|
||||
@@ -13,7 +25,9 @@ const commitment: Commitment = "confirmed";
|
||||
const connection = new Connection("https://api.devnet.solana.com");
|
||||
|
||||
// Create our anchor provider
|
||||
const provider = new AnchorProvider(connection, new Wallet(keypair), { commitment });
|
||||
const provider = new AnchorProvider(connection, new Wallet(keypair), {
|
||||
commitment,
|
||||
});
|
||||
|
||||
// Create our program
|
||||
const program = new Program<WbaVault>(IDL, "<address>" as Address, provider);
|
||||
@@ -25,19 +39,17 @@ const vaultState = new PublicKey("<address>");
|
||||
// const closeVaultState = ???
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
|
||||
// const signature = await program.methods
|
||||
// .closeAccount()
|
||||
// .accounts({
|
||||
// ???
|
||||
// })
|
||||
// .signers([
|
||||
// keypair
|
||||
// ]).rpc();
|
||||
// console.log(`Close success! Check out your TX here:\n\nhttps://explorer.solana.com/tx/${signature}?cluster=devnet`);
|
||||
|
||||
} catch(e) {
|
||||
console.error(`Oops, something went wrong: ${e}`)
|
||||
}
|
||||
})();
|
||||
try {
|
||||
// const signature = await program.methods
|
||||
// .closeAccount()
|
||||
// .accounts({
|
||||
// ???
|
||||
// })
|
||||
// .signers([
|
||||
// keypair
|
||||
// ]).rpc();
|
||||
// console.log(`Close success! Check out your TX here:\n\nhttps://explorer.solana.com/tx/${signature}?cluster=devnet`);
|
||||
} catch (e) {
|
||||
console.error(`Oops, something went wrong: ${e}`);
|
||||
}
|
||||
})();
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
AnchorProvider,
|
||||
Address,
|
||||
BN,
|
||||
} from "@project-serum/anchor";
|
||||
} from "@coral-xyz/anchor";
|
||||
import { WbaVault, IDL } from "../programs/wba_vault";
|
||||
import wallet from "../wba-wallet.json";
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
AnchorProvider,
|
||||
Address,
|
||||
BN,
|
||||
} from "@project-serum/anchor";
|
||||
} from "@coral-xyz/anchor";
|
||||
import { WbaVault, IDL } from "../programs/wba_vault";
|
||||
import wallet from "../wba-wallet.json";
|
||||
import {
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
AnchorProvider,
|
||||
Address,
|
||||
BN,
|
||||
} from "@project-serum/anchor";
|
||||
} from "@coral-xyz/anchor";
|
||||
import { WbaVault, IDL } from "../programs/wba_vault";
|
||||
import wallet from "../wba-wallet.json";
|
||||
import {
|
||||
|
||||
@@ -5,14 +5,10 @@ import {
|
||||
PublicKey,
|
||||
Commitment,
|
||||
} from "@solana/web3.js";
|
||||
import {
|
||||
Program,
|
||||
Wallet,
|
||||
AnchorProvider,
|
||||
Address,
|
||||
} from "@project-serum/anchor";
|
||||
import { Program, Wallet, AnchorProvider, Address } from "@coral-xyz/anchor";
|
||||
import { WbaVault, IDL } from "./programs/wba_vault";
|
||||
import wallet from "./wallet/wba-wallet.json";
|
||||
/// J8qKEmQpadFeBuXAVseH8GNrvsyBhMT8MHSVD3enRgJz
|
||||
|
||||
// Import our keypair from the wallet file
|
||||
const keypair = Keypair.fromSecretKey(new Uint8Array(wallet));
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
AnchorProvider,
|
||||
Address,
|
||||
BN,
|
||||
} from "@project-serum/anchor";
|
||||
} from "@coral-xyz/anchor";
|
||||
import { WbaVault, IDL } from "../programs/wba_vault";
|
||||
import wallet from "../wba-wallet.json";
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
AnchorProvider,
|
||||
Address,
|
||||
BN,
|
||||
} from "@project-serum/anchor";
|
||||
} from "@coral-xyz/anchor";
|
||||
import { WbaVault, IDL } from "../programs/wba_vault";
|
||||
import wallet from "../wba-wallet.json";
|
||||
import {
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
AnchorProvider,
|
||||
Address,
|
||||
BN,
|
||||
} from "@project-serum/anchor";
|
||||
} from "@coral-xyz/anchor";
|
||||
import { WbaVault, IDL } from "../programs/wba_vault";
|
||||
import wallet from "../wba-wallet.json";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user