fix: end of life native loader (#404)
This commit is contained in:
committed by
Michael Vines
parent
6f05930076
commit
2e3c5e7820
@@ -4,7 +4,6 @@ export {BpfLoader} from './bpf-loader';
|
||||
export {BudgetProgram} from './budget-program';
|
||||
export {Connection} from './connection';
|
||||
export {Loader} from './loader';
|
||||
export {NativeLoader} from './native-loader';
|
||||
export {PublicKey} from './publickey';
|
||||
export {SystemProgram} from './system-program';
|
||||
export {Token, TokenAmount} from './token-program';
|
||||
|
@@ -1,41 +0,0 @@
|
||||
// @flow
|
||||
|
||||
import {Account} from './account';
|
||||
import {PublicKey} from './publickey';
|
||||
import {Loader} from './loader';
|
||||
import type {Connection} from './connection';
|
||||
|
||||
/**
|
||||
* Factory class for transactions to interact with a program loader
|
||||
*/
|
||||
export class NativeLoader {
|
||||
/**
|
||||
* Public key that identifies the NativeLoader
|
||||
*/
|
||||
static get programId(): PublicKey {
|
||||
return new PublicKey('NativeLoader1111111111111111111111111111111');
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads a native program
|
||||
*
|
||||
* @param connection The connection to use
|
||||
* @param payer System account that pays to load the program
|
||||
* @param programName Name of the native program
|
||||
*/
|
||||
static load(
|
||||
connection: Connection,
|
||||
payer: Account,
|
||||
programName: string,
|
||||
): Promise<PublicKey> {
|
||||
const bytes = [...Buffer.from(programName)];
|
||||
const program = new Account();
|
||||
return Loader.load(
|
||||
connection,
|
||||
payer,
|
||||
program,
|
||||
NativeLoader.programId,
|
||||
bytes,
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user