Hierarchy (view full)

Implements

  • SolanaDefaultChain

Constructors

Properties

connected: boolean = false
name: string = ""
provider: Connection
rpc_url: string = ""
signer: any = null
wallet: Keypair

Methods

  • Connects to a wallet using a private key

    Parameters

    • privateKey: string

      The private key of the wallet

    Returns Promise<Keypair>

    The wallet object

  • Returns Promise<{
        address: string;
        keypair: Keypair;
        secretKey: string;
    }>

  • Fetch the deserialized account from the network

    Parameters

    • address: Address

      The program address

    • options: SolanaReadAccountDataOptions

      Options

    Returns Promise<DecodeStruct<IdlTypeDefTyStruct, DecodedHelper<IdlTypeDef[], EmptyDefined>>>

    The account data

  • Gets the balance of a wallet

    Parameters

    • address: string

      The wallet address

    Returns Promise<string>

    The balance of the wallet as a string

  • Fetch the IDL from the network

    Parameters

    • programId: Address

      The program address

    Returns Promise<Idl>

    The IDL of the program

  • Alias

    Creates a signed transaction to transfer default chain currency

    Parameters

    • receiver: string

      The receiver's address

    • amount: string

      The amount to transfer

    • Optionaloptions: SignTxOptions

      Options

    Returns Promise<Uint8Array<ArrayBufferLike>>

    The signed transaction

    prepareTransfer

  • Creates a list of signed transactions to transfer default chain currency

    Parameters

    • payments: IPayOptions[]

      A list of transfers to prepare

    • Optionaloptions: SignTxOptions

      Options

    Returns Promise<Uint8Array<ArrayBufferLike>[]>

    An ordered list of signed transactions

  • Creates a signed transaction to transfer default chain currency

    Type Parameters

    Parameters

    • this: T
    • receiver: string

      The receiver's address

    • amount: string

      The amount to transfer

    • Optionaloptions: Options

      Options

    Returns Promise<Awaited<ReturnType<T["preparePays"]>>[number]>

    The signed transaction

  • Creatthis.provider = new JsonRpcProvider(this.rpc_url)es a list of signed transactions to transfer default chain currency

    Type Parameters

    Parameters

    Returns Promise<Awaited<ReturnType<T["preparePays"]>>>

    An ordered list of signed transactions

  • Parameters

    • programId: string
    • params: SolanarunProgramParams

    Returns Promise<Buffer<ArrayBufferLike>>

  • Parameters

    • programId: Address
    • params: SolanaRunRawProgramParams

    Returns Promise<Buffer<ArrayBufferLike>>

  • Sets the RPC URL only. Use await instance.connect() to connect to the rpc provider

    Parameters

    • rpc_url: string

    Returns void

  • Signs a message using the connected wallet

    Parameters

    • message: string

      The message to sign

    • Optionaloptions: {
          privateKey?: string;
      }

      Options

      • OptionalprivateKey?: string

    Returns Promise<string>

    The signed message

  • Signs a transaction using the connected wallet

    Parameters

    • tx: VersionedTransaction

      The transaction to sign

    • Optionaloptions: SignTxOptions

      Options

    Returns Promise<Uint8Array<ArrayBufferLike>>

    The signed transaction

  • Signs a list of transactions using the connected wallet. The transaction nonce is incremented for each transaction in order of appearance.

    Parameters

    • transactions: VersionedTransaction[]

      A list of transactions to sign

    • Optionaloptions: SignTxOptions

      Options

    Returns Promise<Uint8Array<ArrayBufferLike>[]>

  • Verifies a message using the connected wallet

    Parameters

    • message: string

      The message to verify

    • signature: string

      The signature to verify

    • publicKey: string

    Returns Promise<boolean>

    A boolean indicating if the message was verified