|
1 | 1 | declare module "@zondax/filecoin-signing-tools/js" { |
2 | 2 |
|
3 | | - export class ExtendedKey { |
4 | | - constructor(privateKey: Buffer, testnet?: boolean) |
5 | | - address: string; |
6 | | - privateKey: Buffer | Uint8Array; |
7 | | - publicKey: Buffer | Uint8Array; |
8 | | - // getters |
9 | | - get public_raw(): Uint8Array; |
10 | | - get private_raw(): Uint8Array; |
11 | | - get public_hexstring(): string; |
12 | | - get private_hexstring(): string; |
13 | | - get public_base64(): string; |
14 | | - get private_base64(): string; |
| 3 | + export class ExtendedKey { |
| 4 | + constructor(privateKey: Buffer, testnet?: boolean) |
| 5 | + address: string; |
| 6 | + privateKey: Buffer | Uint8Array; |
| 7 | + publicKey: Buffer | Uint8Array; |
| 8 | + // getters |
| 9 | + get public_raw(): Uint8Array; |
| 10 | + get private_raw(): Uint8Array; |
| 11 | + get public_hexstring(): string; |
| 12 | + get private_hexstring(): string; |
| 13 | + get public_base64(): string; |
| 14 | + get private_base64(): string; |
| 15 | + } |
| 16 | + |
| 17 | + export interface Message { |
| 18 | + to: string; |
| 19 | + from: string; |
| 20 | + nonce: number; |
| 21 | + value: string; |
| 22 | + gasfeecap: string; |
| 23 | + gaspremium: string; |
| 24 | + gaslimit: number; |
| 25 | + method: number; |
| 26 | + params?: string; |
| 27 | + } |
| 28 | + |
| 29 | + export interface SignedMessage { |
| 30 | + message: Message; |
| 31 | + signature: { |
| 32 | + data: string; |
| 33 | + type: number; |
15 | 34 | } |
| 35 | + } |
16 | 36 |
|
17 | | - export interface Message { |
18 | | - to: string; |
19 | | - from: string; |
20 | | - nonce: number; |
21 | | - value: string; |
22 | | - gasfeecap: string; |
23 | | - gaspremium: string; |
24 | | - gaslimit: number; |
25 | | - method: number; |
26 | | - params?: string; |
27 | | - } |
28 | | - |
29 | | - export interface SignedMessage { |
30 | | - message: Message; |
31 | | - signature: { |
32 | | - data: string; |
33 | | - type: number; |
34 | | - } |
35 | | - } |
| 37 | + export function generateMnemonic(): string; |
| 38 | + export function keyDeriveFromSeed(seed: string, path: string): ExtendedKey; |
36 | 39 |
|
37 | | - export function generateMnemonic(): string; |
38 | | - export function keyDeriveFromSeed(seed: string, path: string): ExtendedKey; |
| 40 | + export function transactionSerializeRaw(transaction: Message): Buffer; |
| 41 | + export function transactionSerialize(transaction: Message): string; |
39 | 42 |
|
40 | | - export function transactionSerializeRaw(transaction: Message): Buffer; |
41 | | - export function transactionSerialize(transaction: Message): string; |
| 43 | + export function transactionSignRaw(unsignedMessage: Message | string, privateKey: string): Buffer; |
| 44 | + export function transactionSign(unsignedMessage: Message, privateKey: string): SignedMessage; |
42 | 45 |
|
43 | | - export function transactionSignRaw(unsignedMessage: Message | string, privateKey: string): Buffer; |
44 | | - export function transactionSign(unsignedMessage: Message, privateKey: string): SignedMessage; |
| 46 | + export function keyRecover(privateKey: Buffer, testnet: boolean): ExtendedKey; |
45 | 47 |
|
46 | | - export function keyRecover(privateKey: Buffer, testnet: boolean): ExtendedKey; |
47 | | - |
48 | | - export interface Buffer { |
49 | | - toString(encoding: "utf8" | "hex" | "binary" | "base64" | "ascii"): string; |
50 | | - } |
| 48 | + export interface Buffer { |
| 49 | + toString(encoding: "utf8" | "hex" | "binary" | "base64" | "ascii"): string; |
| 50 | + } |
51 | 51 | } |
0 commit comments