-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
79 lines (72 loc) · 1.91 KB
/
index.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
export interface KeyInfo {
privateKey: string;
publicKey: string;
address: string;
}
export interface IUTXO {
txid: string;
vout: number;
}
export interface ITransactionData {
utxos: IUTXO[];
address: string;
anchor: string;
amount: number;
fee: number;
data?: string;
dataUUID?: string;
version: number;
lockUntil: number;
timestamp: string;
}
export interface WalletOptions {
beta?: boolean; // default false
shareAccountWithParentChain?: boolean; // default false
BBCUseStandardBip44ID?: boolean; // default false
MKFUseBBCBip44ID?: boolean; // default false
}
export type Symbol = 'BTC' | 'ETH' | 'BBC' | 'USDT(Omni)';
export interface Keys {
symbol: string;
keyInfo: KeyInfo;
}
declare module RNBbcWallet {
function generateMnemonic(): Promise<string>;
function importMnemonic(
mnemonic: string,
salt: string,
): Promise<KeyInfo>;
function importMnemonicWithOptions(
mnemonic: string,
path: string,
password: string,
options: WalletOptions,
symbols: Symbol[],
): Promise<Keys>;
function importPrivateKey(privateKey: string): Promise<KeyInfo>;
function signTransactionWithTemplate(
txString: string,
templateData: string,
privateKey: string
): Promise<string>;
function symbolSignWithPrivateKeyTemplate(
symbol: string,
txString: string,
templateData: string,
privateKey: string
): Promise<string>;
function signTransaction(
txString: string,
privateKey: string
): Promise<string>;
function symbolSignWithPrivateKey(
symbol: string,
txString: string,
privateKey: string
): Promise<string>;
function buildTransaction(data: ITransactionData): Promise<string>;
function addressToPublicKey(address: string): Promise<string>;
function convertHexStrToBase64(hex1: string, hex2: string): Promise<string>;
function calcTxid(symbol: string, rawTx: string): Promise<string>;
}
export default RNBbcWallet;