fix: use new api in Loader
This commit is contained in:
parent
4ae90c2944
commit
b1594439fe
|
@ -44,10 +44,11 @@ export class Loader {
|
||||||
data: Array<number>,
|
data: Array<number>,
|
||||||
): Promise<PublicKey> {
|
): Promise<PublicKey> {
|
||||||
{
|
{
|
||||||
|
const balanceNeeded = await connection.getMinimumBalanceForRentExemption(data.length);
|
||||||
const transaction = SystemProgram.createAccount(
|
const transaction = SystemProgram.createAccount(
|
||||||
payer.publicKey,
|
payer.publicKey,
|
||||||
program.publicKey,
|
program.publicKey,
|
||||||
1,
|
balanceNeeded > 0 ? balanceNeeded : 1,
|
||||||
data.length,
|
data.length,
|
||||||
programId,
|
programId,
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue