index.d.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. export declare const HARDENED_OFFSET: number;
  2. export interface Versions {
  3. private: number;
  4. public: number;
  5. }
  6. interface HDKeyOpt {
  7. versions?: Versions;
  8. depth?: number;
  9. index?: number;
  10. parentFingerprint?: number;
  11. chainCode?: Uint8Array;
  12. publicKey?: Uint8Array;
  13. privateKey?: Uint8Array | bigint;
  14. }
  15. export declare class HDKey {
  16. get fingerprint(): number;
  17. get identifier(): Uint8Array | undefined;
  18. get pubKeyHash(): Uint8Array | undefined;
  19. get privateKey(): Uint8Array | null;
  20. get publicKey(): Uint8Array | null;
  21. get privateExtendedKey(): string;
  22. get publicExtendedKey(): string;
  23. static fromMasterSeed(seed: Uint8Array, versions?: Versions): HDKey;
  24. static fromExtendedKey(base58key: string, versions?: Versions): HDKey;
  25. static fromJSON(json: {
  26. xpriv: string;
  27. }): HDKey;
  28. readonly versions: Versions;
  29. readonly depth: number;
  30. readonly index: number;
  31. readonly chainCode: Uint8Array | null;
  32. readonly parentFingerprint: number;
  33. private privKey?;
  34. private privKeyBytes?;
  35. private pubKey?;
  36. private pubHash;
  37. constructor(opt: HDKeyOpt);
  38. derive(path: string): HDKey;
  39. deriveChild(index: number): HDKey;
  40. sign(hash: Uint8Array): Uint8Array;
  41. verify(hash: Uint8Array, signature: Uint8Array): boolean;
  42. wipePrivateData(): this;
  43. toJSON(): {
  44. xpriv: string;
  45. xpub: string;
  46. };
  47. private serialize;
  48. }
  49. export {};
  50. //# sourceMappingURL=index.d.ts.map