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

Secp256k1Program

Static Member Summary

Static Public Members
public static get

Public key that identifies the secp256k1 program

Static Method Summary

Static Public Methods
public static

Create an secp256k1 instruction with an Ethereum address.

public static

Create an secp256k1 instruction with a private key.

public static

Create an secp256k1 instruction with a public key.

public static

publicKeyToEthAddress(publicKey: Buffer): Buffer

Construct an Ethereum address from a secp256k1 public key buffer.

Static Public Members

public static get programId: PublicKey source

Public key that identifies the secp256k1 program

Static Public Methods

public static createInstructionWithEthAddress(params: CreateSecp256k1InstructionWithEthAddressParams): TransactionInstruction source

Create an secp256k1 instruction with an Ethereum address. The address must be a hex string or a buffer that is 20 bytes long.

Params:

NameTypeAttributeDescription
params CreateSecp256k1InstructionWithEthAddressParams

public static createInstructionWithPrivateKey(params: CreateSecp256k1InstructionWithPrivateKeyParams): TransactionInstruction source

Create an secp256k1 instruction with a private key. The private key must be a buffer that is 32 bytes long.

Params:

NameTypeAttributeDescription
params CreateSecp256k1InstructionWithPrivateKeyParams

public static createInstructionWithPublicKey(params: CreateSecp256k1InstructionWithPublicKeyParams): TransactionInstruction source

Create an secp256k1 instruction with a public key. The public key must be a buffer that is 64 bytes long.

Params:

NameTypeAttributeDescription
params CreateSecp256k1InstructionWithPublicKeyParams

public static publicKeyToEthAddress(publicKey: Buffer): Buffer source

Construct an Ethereum address from a secp256k1 public key buffer.

Params:

NameTypeAttributeDescription
publicKey Buffer

a 64 byte secp256k1 public key buffer

Return:

Buffer