Home Reference Source
import {SystemProgram} from '@solana/web3'
public class | source

SystemProgram

Factory class for transactions to interact with the System program

Static Member Summary

Static Public Members
public static get

Public key that identifies the System program

Static Method Summary

Static Public Methods
public static

assign(from: PublicKey, programId: PublicKey): Transaction

Generate a Transaction that assigns an account to a program

public static

createAccount(from: PublicKey, newAccount: PublicKey, tokens: number, space: number, programId: PublicKey): Transaction

Generate a Transaction that creates a new account

public static

move(from: PublicKey, to: PublicKey, amount: number): Transaction

Generate a Transaction that moves tokens from one account to another

public static

spawn(programId: PublicKey): Transaction

Spawn a new program from an account

Static Public Members

public static get programId: PublicKey source

Public key that identifies the System program

Static Public Methods

public static assign(from: PublicKey, programId: PublicKey): Transaction source

Generate a Transaction that assigns an account to a program

Params:

NameTypeAttributeDescription
from PublicKey
programId PublicKey

Return:

Transaction

public static createAccount(from: PublicKey, newAccount: PublicKey, tokens: number, space: number, programId: PublicKey): Transaction source

Generate a Transaction that creates a new account

Params:

NameTypeAttributeDescription
from PublicKey
newAccount PublicKey
tokens number
space number
programId PublicKey

Return:

Transaction

public static move(from: PublicKey, to: PublicKey, amount: number): Transaction source

Generate a Transaction that moves tokens from one account to another

Params:

NameTypeAttributeDescription
from PublicKey
to PublicKey
amount number

Return:

Transaction

public static spawn(programId: PublicKey): Transaction source

Spawn a new program from an account

Params:

NameTypeAttributeDescription
programId PublicKey

Return:

Transaction