feat: add API for decoding system instructions

This commit is contained in:
Justin Starry
2020-03-03 16:05:50 +08:00
committed by Michael Vines
parent 662ce22cdd
commit 6ed2bad9d0
12 changed files with 932 additions and 580 deletions

View File

@ -58,13 +58,13 @@ export class Loader {
const balanceNeeded = await connection.getMinimumBalanceForRentExemption(
data.length,
);
const transaction = SystemProgram.createAccount(
payer.publicKey,
program.publicKey,
balanceNeeded > 0 ? balanceNeeded : 1,
data.length,
const transaction = SystemProgram.createAccount({
fromPubkey: payer.publicKey,
newAccountPubkey: program.publicKey,
lamports: balanceNeeded > 0 ? balanceNeeded : 1,
space: data.length,
programId,
);
});
await sendAndConfirmTransaction(connection, transaction, payer, program);
}