forked from ltonetwork/lto-api.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
interfaces.d.ts
93 lines (76 loc) · 1.71 KB
/
interfaces.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import Transaction from "./src/transactions/Transaction";
import PublicNode from "./src/node/PublicNode";
export type TBuffer = Uint8Array | number[];
export interface IHash<T> {
[key: string]: T;
}
export interface IVerifiableCredentials {
[key: string]: any;
populate(data: object): void;
issue(subject: object, issuer: object): void;
registerTo(node: PublicNode): Promise<Transaction>;
}
export interface IAccountIn {
address?: string;
publicKey?: string;
privateKey?: string;
keyType?: "ed25519" | "secp256k1" | "secp256r1";
seed?: string;
seedPassword?: string;
nonce?: number;
}
export interface ISigner {
sign(message: string|Uint8Array): IBinary;
address: string;
publicKey: string;
keyType: string;
}
export interface ISignable {
signWith(account: ISigner): this;
}
export interface IProofable {
canonicalize(): string;
}
export interface IPublicAccount {
keyType: string;
publicKey: string;
}
export interface IKeyPair {
privateKey?: string;
publicKey: string;
}
export interface IBinary extends Uint8Array {
readonly base58: string;
readonly base64: string;
readonly hex: string;
toString(): string;
}
export interface IKeyPairBytes {
privateKey?: IBinary;
publicKey: IBinary;
}
export interface ITxJSON extends IHash<any> {
type: number;
}
export interface ITransfer {
recipient: string;
amount: number;
}
// Missing interfaces
declare global {
interface Window {
msCrypto?: any;
Response?: any;
Promise: PromiseConstructor;
}
interface ErrorConstructor {
captureStackTrace(thisArg: any, func: any): void;
}
}
// Replacement for --allowJs
declare module "*.js" {
const content: {
[key: string]: any;
};
export = content;
}