@kaiachain/web3js-ext
Version:
web3.js extension for kaiachain blockchain
79 lines (78 loc) • 4.66 kB
TypeScript
import { Transaction as LegacyTransaction, TxOptions } from "web3-eth-accounts";
import { KlaytnTxData } from "../types.js";
export declare const secp256k1: Readonly<{
create: (hash: import("@noble/curves/abstract/utils.js").CHash) => import("@noble/curves/abstract/weierstrass.js").CurveFn;
CURVE: Readonly<{
readonly nBitLength: number;
readonly nByteLength: number;
readonly Fp: import("@noble/curves/abstract/modular.js").IField<bigint>;
readonly n: bigint;
readonly h: bigint;
readonly hEff?: bigint | undefined;
readonly Gx: bigint;
readonly Gy: bigint;
readonly allowInfinityPoint?: boolean | undefined;
readonly a: bigint;
readonly b: bigint;
readonly allowedPrivateKeyLengths?: readonly number[] | undefined;
readonly wrapPrivateKey?: boolean | undefined;
readonly endo?: {
beta: bigint;
splitScalar: (k: bigint) => {
k1neg: boolean;
k1: bigint;
k2neg: boolean;
k2: bigint;
};
} | undefined;
readonly isTorsionFree?: ((c: import("@noble/curves/abstract/weierstrass.js").ProjConstructor<bigint>, point: import("@noble/curves/abstract/weierstrass.js").ProjPointType<bigint>) => boolean) | undefined;
readonly clearCofactor?: ((c: import("@noble/curves/abstract/weierstrass.js").ProjConstructor<bigint>, point: import("@noble/curves/abstract/weierstrass.js").ProjPointType<bigint>) => import("@noble/curves/abstract/weierstrass.js").ProjPointType<bigint>) | undefined;
readonly hash: import("@noble/curves/abstract/utils.js").CHash;
readonly hmac: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array;
readonly randomBytes: (bytesLength?: number | undefined) => Uint8Array;
lowS: boolean;
readonly bits2int?: ((bytes: Uint8Array) => bigint) | undefined;
readonly bits2int_modN?: ((bytes: Uint8Array) => bigint) | undefined;
readonly p: bigint;
}>;
getPublicKey: (privateKey: import("@noble/curves/abstract/utils.js").PrivKey, isCompressed?: boolean | undefined) => Uint8Array;
getSharedSecret: (privateA: import("@noble/curves/abstract/utils.js").PrivKey, publicB: import("@noble/curves/abstract/utils.js").Hex, isCompressed?: boolean | undefined) => Uint8Array;
sign: (msgHash: import("@noble/curves/abstract/utils.js").Hex, privKey: import("@noble/curves/abstract/utils.js").PrivKey, opts?: import("@noble/curves/abstract/weierstrass.js").SignOpts | undefined) => import("@noble/curves/abstract/weierstrass.js").RecoveredSignatureType;
verify: (signature: import("@noble/curves/abstract/utils.js").Hex | {
r: bigint;
s: bigint;
}, msgHash: import("@noble/curves/abstract/utils.js").Hex, publicKey: import("@noble/curves/abstract/utils.js").Hex, opts?: import("@noble/curves/abstract/weierstrass.js").VerOpts | undefined) => boolean;
ProjectivePoint: import("@noble/curves/abstract/weierstrass.js").ProjConstructor<bigint>;
Signature: import("@noble/curves/abstract/weierstrass.js").SignatureConstructor;
utils: {
normPrivateKeyToScalar: (key: import("@noble/curves/abstract/utils.js").PrivKey) => bigint;
isValidPrivateKey(privateKey: import("@noble/curves/abstract/utils.js").PrivKey): boolean;
randomPrivateKey: () => Uint8Array;
precompute: (windowSize?: number | undefined, point?: import("@noble/curves/abstract/weierstrass.js").ProjPointType<bigint> | undefined) => import("@noble/curves/abstract/weierstrass.js").ProjPointType<bigint>;
};
}>;
export declare class KlaytnTypedTransaction extends LegacyTransaction {
private readonly _klaytnType;
get type(): number;
readonly from?: string;
readonly chainId?: bigint;
readonly key?: any;
readonly feePayer?: string;
readonly feePayer_v?: bigint;
readonly feePayer_r?: bigint;
readonly feePayer_s?: bigint;
readonly txSignatures?: any;
readonly feePayerSignatures?: any;
readonly feeRatio?: number;
private readonly coreKlaytnTx;
constructor(txData: KlaytnTxData, txOptions?: TxOptions);
getMessageToSign(hashMessage: false): Uint8Array[];
getMessageToSign(hashMessage?: true): Uint8Array;
getMessageToSignAsFeePayer(hashMessage: false): Uint8Array[];
getMessageToSignAsFeePayer(hashMessage?: true): Uint8Array;
sign(privateKey: Uint8Array): KlaytnTypedTransaction;
signAsFeePayer(privateKey: Uint8Array): KlaytnTypedTransaction;
serialize(): Uint8Array;
serializeAsFeePayer(): Uint8Array;
private _eip155sign;
}