@exodus/solana-web3.js
Version:
Solana Javascript API
54 lines (53 loc) • 2.13 kB
TypeScript
/// <reference types="node" />
import { Buffer } from 'buffer';
import { PublicKey } from '../publickey.js';
import { TransactionInstruction } from '../transaction/index.js';
/**
* Params for creating an secp256k1 instruction using a public key
*/
export declare type CreateSecp256k1InstructionWithPublicKeyParams = {
publicKey: Buffer | Uint8Array | Array<number>;
message: Buffer | Uint8Array | Array<number>;
signature: Buffer | Uint8Array | Array<number>;
recoveryId: number;
instructionIndex?: number;
};
/**
* Params for creating an secp256k1 instruction using an Ethereum address
*/
export declare type CreateSecp256k1InstructionWithEthAddressParams = {
ethAddress: Buffer | Uint8Array | Array<number> | string;
message: Buffer | Uint8Array | Array<number>;
signature: Buffer | Uint8Array | Array<number>;
recoveryId: number;
instructionIndex?: number;
};
/**
* Params for creating an secp256k1 instruction using a private key
*/
export declare type CreateSecp256k1InstructionWithPrivateKeyParams = {
privateKey: Buffer | Uint8Array | Array<number>;
message: Buffer | Uint8Array | Array<number>;
instructionIndex?: number;
};
export declare class Secp256k1Program {
/**
* Public key that identifies the secp256k1 program
*/
static programId: PublicKey;
/**
* Construct an Ethereum address from a secp256k1 public key buffer.
* @param {Buffer} publicKey a 64 byte secp256k1 public key buffer
*/
static publicKeyToEthAddress(publicKey: Buffer | Uint8Array | Array<number>): Buffer;
/**
* Create an secp256k1 instruction with a public key. The public key
* must be a buffer that is 64 bytes long.
*/
static createInstructionWithPublicKey(params: CreateSecp256k1InstructionWithPublicKeyParams): TransactionInstruction;
/**
* Create an secp256k1 instruction with an Ethereum address. The address
* must be a hex string or a buffer that is 20 bytes long.
*/
static createInstructionWithEthAddress(params: CreateSecp256k1InstructionWithEthAddressParams): TransactionInstruction;
}