feat: add Secp256k1 support to solana-web3.js (#12958)
* feat: add secp256k1 instruction * feat: use buffer-layout for encoding as well * style: use consistent naming for types * style: update typings and make program functions static * fix: attempt to resolve rollup issue * fix: expose sysvar in typings * fix: remove decode instruction functionality (for now)
This commit is contained in:
26
web3.js/module.d.ts
vendored
26
web3.js/module.d.ts
vendored
@ -531,6 +531,7 @@ declare module '@solana/web3.js' {
|
||||
export const SYSVAR_RENT_PUBKEY: PublicKey;
|
||||
export const SYSVAR_REWARDS_PUBKEY: PublicKey;
|
||||
export const SYSVAR_STAKE_HISTORY_PUBKEY: PublicKey;
|
||||
export const SYSVAR_INSTRUCTIONS_PUBKEY: PublicKey;
|
||||
|
||||
// === src/vote-account.js ===
|
||||
export const VOTE_PROGRAM_ID: PublicKey;
|
||||
@ -966,6 +967,31 @@ declare module '@solana/web3.js' {
|
||||
): AuthorizeNonceParams;
|
||||
}
|
||||
|
||||
// === src/secp256k1-program.js ===
|
||||
export type CreateSecp256k1InstructionWithPublicKeyParams = {
|
||||
publicKey: Buffer | Uint8Array | Array<number>;
|
||||
message: Buffer | Uint8Array | Array<number>;
|
||||
signature: Buffer | Uint8Array | Array<number>;
|
||||
recoveryId: number;
|
||||
};
|
||||
|
||||
export type CreateSecp256k1InstructionWithPrivateKeyParams = {
|
||||
privateKey: Buffer | Uint8Array | Array<number>;
|
||||
message: Buffer | Uint8Array | Array<number>;
|
||||
};
|
||||
|
||||
export class Secp256k1Program {
|
||||
static get programId(): PublicKey;
|
||||
|
||||
static createInstructionWithPublicKey(
|
||||
params: CreateSecp256k1InstructionWithPublicKeyParams,
|
||||
): TransactionInstruction;
|
||||
|
||||
static createInstructionWithPrivateKey(
|
||||
params: CreateSecp256k1InstructionWithPrivateKeyParams,
|
||||
): TransactionInstruction;
|
||||
}
|
||||
|
||||
// === src/loader.js ===
|
||||
export class Loader {
|
||||
static getMinNumSignatures(dataLength: number): number;
|
||||
|
Reference in New Issue
Block a user