fixes
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -12,8 +12,8 @@ import {
|
||||
Address,
|
||||
BN,
|
||||
} from "@coral-xyz/anchor";
|
||||
import { WbaVault, IDL } from "../programs/wba_vault";
|
||||
import wallet from "../wba-wallet.json";
|
||||
import { WbaVault, IDL } from "./programs/wba_vault";
|
||||
import wallet from "./wallet/wba-wallet.json";
|
||||
|
||||
// Import our keypair from the wallet file
|
||||
const keypair = Keypair.fromSecretKey(new Uint8Array(wallet));
|
||||
|
||||
@@ -12,14 +12,14 @@ import {
|
||||
Address,
|
||||
BN,
|
||||
} from "@coral-xyz/anchor";
|
||||
import { WbaVault, IDL } from "../programs/wba_vault";
|
||||
import wallet from "../wba-wallet.json";
|
||||
import { WbaVault, IDL } from "./programs/wba_vault";
|
||||
import wallet from "./wallet/wba-wallet.json";
|
||||
|
||||
// Import our keypair from the wallet file
|
||||
const keypair = Keypair.fromSecretKey(new Uint8Array(wallet));
|
||||
|
||||
// Commitment
|
||||
const commitment: Commitment = "confirmed";
|
||||
const commitment: Commitment = "finalized";
|
||||
|
||||
// Create a devnet connection
|
||||
const connection = new Connection("https://api.devnet.solana.com");
|
||||
@@ -33,29 +33,26 @@ const provider = new AnchorProvider(connection, new Wallet(keypair), {
|
||||
const program = new Program<WbaVault>(IDL, "<address>" as Address, provider);
|
||||
|
||||
// Create a random keypair
|
||||
const vaultState = new PublicKey("<address>")(
|
||||
// Create the PDA for our enrollment account
|
||||
// Seeds are "auth", vaultState
|
||||
// const vaultAuth = ???
|
||||
const vaultState = new PublicKey("<address>");
|
||||
// Create the PDA for our enrollment account
|
||||
// const vaultAuth = ???
|
||||
|
||||
// Create the vault key
|
||||
// Seeds are "vault", vaultAuth
|
||||
// const vault = ???
|
||||
// Create the vault key
|
||||
// const vault = ???
|
||||
|
||||
// Execute our enrollment transaction
|
||||
async () => {
|
||||
try {
|
||||
// const signature = await program.methods
|
||||
// .deposit(new BN(<number>) )
|
||||
// .accounts({
|
||||
// ???
|
||||
// })
|
||||
// .signers([
|
||||
// keypair
|
||||
// ]).rpc();
|
||||
// console.log(`Deposit success! Check out your TX here:\n\nhttps://explorer.solana.com/tx/${signature}?cluster=devnet`);
|
||||
} catch (e) {
|
||||
console.error(`Oops, something went wrong: ${e}`);
|
||||
}
|
||||
},
|
||||
)();
|
||||
// Execute our enrollment transaction
|
||||
(async () => {
|
||||
try {
|
||||
// const signature = await program.methods
|
||||
// .deposit(new BN(<number>) )
|
||||
// .accounts({
|
||||
// ???
|
||||
// })
|
||||
// .signers([
|
||||
// keypair
|
||||
// ]).rpc();
|
||||
// console.log(`Deposit success! Check out your TX here:\n\nhttps://explorer.solana.com/tx/${signature}?cluster=devnet`);
|
||||
} catch (e) {
|
||||
console.error(`Oops, something went wrong: ${e}`);
|
||||
}
|
||||
})();
|
||||
|
||||
@@ -12,8 +12,8 @@ import {
|
||||
Address,
|
||||
BN,
|
||||
} from "@coral-xyz/anchor";
|
||||
import { WbaVault, IDL } from "../programs/wba_vault";
|
||||
import wallet from "../wba-wallet.json";
|
||||
import { WbaVault, IDL } from "./programs/wba_vault";
|
||||
import wallet from "./wallet/wba-wallet.json";
|
||||
import {
|
||||
ASSOCIATED_TOKEN_PROGRAM_ID,
|
||||
TOKEN_PROGRAM_ID,
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
const keypair = Keypair.fromSecretKey(new Uint8Array(wallet));
|
||||
|
||||
// Commitment
|
||||
const commitment: Commitment = "confirmed";
|
||||
const commitment: Commitment = "finalized";
|
||||
|
||||
// Create a devnet connection
|
||||
const connection = new Connection("https://api.devnet.solana.com");
|
||||
@@ -41,11 +41,9 @@ const program = new Program<WbaVault>(IDL, "<address>" as Address, provider);
|
||||
const vaultState = new PublicKey("<address>");
|
||||
|
||||
// Create the PDA for our enrollment account
|
||||
// Seeds are "auth", vaultState
|
||||
// const vaultAuth = ???
|
||||
|
||||
// Create the vault key
|
||||
// Seeds are "vault", vaultAuth
|
||||
// const vault = ???
|
||||
|
||||
// Mint address
|
||||
|
||||
@@ -23,7 +23,7 @@ import {
|
||||
const keypair = Keypair.fromSecretKey(new Uint8Array(wallet));
|
||||
|
||||
// Commitment
|
||||
const commitment: Commitment = "confirmed";
|
||||
const commitment: Commitment = "finalized";
|
||||
|
||||
// Create a devnet connection
|
||||
const connection = new Connection("https://api.devnet.solana.com");
|
||||
@@ -40,11 +40,9 @@ const program = new Program<WbaVault>(IDL, "<address>" as Address, provider);
|
||||
const vaultState = new PublicKey("<address>");
|
||||
|
||||
// Create the PDA for our enrollment account
|
||||
// Seeds are "auth", vaultState
|
||||
// const vaultAuth = ???
|
||||
|
||||
// Create the vault key
|
||||
// Seeds are "vault", vaultAuth
|
||||
// const vault = ???
|
||||
|
||||
// const token_decimals = ???
|
||||
|
||||
@@ -25,7 +25,11 @@ const provider = new AnchorProvider(connection, new Wallet(keypair), {
|
||||
});
|
||||
|
||||
// Create our program
|
||||
const program = new Program<WbaVault>(IDL, "<addressIDL>" as Address, provider);
|
||||
const program = new Program<WbaVault>(
|
||||
IDL,
|
||||
"D51uEDHLbWAxNfodfQDv7qkp8WZtxrhi3uganGbNos7o" as Address,
|
||||
provider,
|
||||
);
|
||||
|
||||
// Create a random keypair
|
||||
const vaultState = Keypair.generate();
|
||||
|
||||
@@ -12,8 +12,8 @@ import {
|
||||
Address,
|
||||
BN,
|
||||
} from "@coral-xyz/anchor";
|
||||
import { WbaVault, IDL } from "../programs/wba_vault";
|
||||
import wallet from "../wba-wallet.json";
|
||||
import { WbaVault, IDL } from "./programs/wba_vault";
|
||||
import wallet from "./wallet/wba-wallet.json";
|
||||
|
||||
// Import our keypair from the wallet file
|
||||
const keypair = Keypair.fromSecretKey(new Uint8Array(wallet));
|
||||
@@ -33,29 +33,28 @@ const provider = new AnchorProvider(connection, new Wallet(keypair), {
|
||||
const program = new Program<WbaVault>(IDL, "<address>" as Address, provider);
|
||||
|
||||
// Create a random keypair
|
||||
const vaultState = new PublicKey("<address>")(
|
||||
// Create the PDA for our enrollment account
|
||||
// Seeds are "auth", vaultState
|
||||
// const vaultAuth = ???
|
||||
const vaultState = new PublicKey("<address>");
|
||||
// Create the PDA for our enrollment account
|
||||
// Seeds are "auth", vaultState
|
||||
// const vaultAuth = ???
|
||||
|
||||
// Create the vault key
|
||||
// Seeds are "vault", vaultAuth
|
||||
// const vault = ???
|
||||
// Create the vault key
|
||||
// Seeds are "vault", vaultAuth
|
||||
// const vault = ???
|
||||
|
||||
// Execute our enrollment transaction
|
||||
async () => {
|
||||
try {
|
||||
// const signature = await program.methods
|
||||
// .withdraw(new BN(<number>))
|
||||
// .accounts({
|
||||
// ???
|
||||
// })
|
||||
// .signers([
|
||||
// keypair
|
||||
// ]).rpc();
|
||||
// console.log(`Withdraw success! Check out your TX here:\n\nhttps://explorer.solana.com/tx/${signature}?cluster=devnet`);
|
||||
} catch (e) {
|
||||
console.error(`Oops, something went wrong: ${e}`);
|
||||
}
|
||||
},
|
||||
)();
|
||||
// Execute our enrollment transaction
|
||||
(async () => {
|
||||
try {
|
||||
// const signature = await program.methods
|
||||
// .withdraw(new BN(<number>))
|
||||
// .accounts({
|
||||
// ???
|
||||
// })
|
||||
// .signers([
|
||||
// keypair
|
||||
// ]).rpc();
|
||||
// console.log(`Withdraw success! Check out your TX here:\n\nhttps://explorer.solana.com/tx/${signature}?cluster=devnet`);
|
||||
} catch (e) {
|
||||
console.error(`Oops, something went wrong: ${e}`);
|
||||
}
|
||||
})();
|
||||
|
||||
@@ -12,8 +12,8 @@ import {
|
||||
Address,
|
||||
BN,
|
||||
} from "@coral-xyz/anchor";
|
||||
import { WbaVault, IDL } from "../programs/wba_vault";
|
||||
import wallet from "../wba-wallet.json";
|
||||
import { WbaVault, IDL } from "./programs/wba_vault";
|
||||
import wallet from "./wallet/wba-wallet.json";
|
||||
import {
|
||||
ASSOCIATED_TOKEN_PROGRAM_ID,
|
||||
TOKEN_PROGRAM_ID,
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
const keypair = Keypair.fromSecretKey(new Uint8Array(wallet));
|
||||
|
||||
// Commitment
|
||||
const commitment: Commitment = "confirmed";
|
||||
const commitment: Commitment = "finalized";
|
||||
|
||||
// Create a devnet connection
|
||||
const connection = new Connection("https://api.devnet.solana.com");
|
||||
|
||||
@@ -12,14 +12,14 @@ import {
|
||||
Address,
|
||||
BN,
|
||||
} from "@coral-xyz/anchor";
|
||||
import { WbaVault, IDL } from "../programs/wba_vault";
|
||||
import wallet from "../wba-wallet.json";
|
||||
import { WbaVault, IDL } from "./programs/wba_vault";
|
||||
import wallet from "./wallet/wba-wallet.json";
|
||||
|
||||
// Import our keypair from the wallet file
|
||||
const keypair = Keypair.fromSecretKey(new Uint8Array(wallet));
|
||||
|
||||
// Commitment
|
||||
const commitment: Commitment = "confirmed";
|
||||
const commitment: Commitment = "finalized";
|
||||
|
||||
// Create a devnet connection
|
||||
const connection = new Connection("https://api.devnet.solana.com");
|
||||
@@ -33,7 +33,7 @@ const provider = new AnchorProvider(connection, new Wallet(keypair), {
|
||||
const program = new Program<WbaVault>(IDL, "<address>" as Address, provider);
|
||||
|
||||
// Create a random keypair
|
||||
const vaultState = new PublicKey("<address>")(
|
||||
const vaultState = new PublicKey("<address>");
|
||||
// Create the PDA for our enrollment account
|
||||
// Seeds are "auth", vaultState
|
||||
// const vaultAuth = ???
|
||||
@@ -57,5 +57,5 @@ const vaultState = new PublicKey("<address>")(
|
||||
} catch (e) {
|
||||
console.error(`Oops, something went wrong: ${e}`);
|
||||
}
|
||||
},
|
||||
}
|
||||
)();
|
||||
|
||||
Reference in New Issue
Block a user