1 |
|
2 | import * as Bluebird from 'bluebird';
|
3 | import { BitGo } from '../bitgo';
|
4 | import { BaseCoin, KeyPair } from './baseCoin';
|
5 | import { NodeCallback } from './types';
|
6 | import { Wallet } from './wallet';
|
7 | import { RequestTracer } from './internal/util';
|
8 | export interface Keychain {
|
9 | id: string;
|
10 | pub: string;
|
11 | prv?: string;
|
12 | provider?: string;
|
13 | encryptedPrv?: string;
|
14 | derivationPath?: string;
|
15 | derivedFromParentWithSeed?: string;
|
16 | }
|
17 | export interface ChangedKeychains {
|
18 | [pubkey: string]: string;
|
19 | }
|
20 | export interface ListKeychainsResult {
|
21 | keys: Keychain[];
|
22 | nextBatchPrevId?: string;
|
23 | }
|
24 | export interface GetKeychainOptions {
|
25 | id: string;
|
26 | xpub?: string;
|
27 | ethAddress?: string;
|
28 | reqId?: RequestTracer;
|
29 | }
|
30 | export interface ListKeychainOptions {
|
31 | limit?: number;
|
32 | prevId?: string;
|
33 | }
|
34 | export interface UpdatePasswordOptions {
|
35 | oldPassword: string;
|
36 | newPassword: string;
|
37 | }
|
38 | interface UpdateSingleKeychainPasswordOptions {
|
39 | keychain?: Keychain;
|
40 | oldPassword?: string;
|
41 | newPassword?: string;
|
42 | }
|
43 | interface AddKeychainOptions {
|
44 | pub?: string;
|
45 | encryptedPrv?: string;
|
46 | type?: string;
|
47 | source?: string;
|
48 | originalPasscodeEncryptionCode?: string;
|
49 | enterprise?: string;
|
50 | derivedFromParentWithSeed?: any;
|
51 | disableKRSEmail?: boolean;
|
52 | provider?: string;
|
53 | reqId?: RequestTracer;
|
54 | krsSpecific?: any;
|
55 | }
|
56 | export interface CreateBackupOptions {
|
57 | provider?: string;
|
58 | source?: string;
|
59 | disableKRSEmail?: boolean;
|
60 | krsSpecific?: any;
|
61 | type?: string;
|
62 | reqId?: RequestTracer;
|
63 | }
|
64 | interface CreateBitGoOptions {
|
65 | source?: 'bitgo';
|
66 | enterprise?: string;
|
67 | reqId?: RequestTracer;
|
68 | }
|
69 | interface GetKeysForSigningOptions {
|
70 | reqId?: RequestTracer;
|
71 | wallet?: Wallet;
|
72 | }
|
73 | export declare enum KeyIndices {
|
74 | USER = 0,
|
75 | BACKUP = 1,
|
76 | BITGO = 2
|
77 | }
|
78 | export declare class Keychains {
|
79 | private readonly bitgo;
|
80 | private readonly baseCoin;
|
81 | constructor(bitgo: BitGo, baseCoin: BaseCoin);
|
82 | /**
|
83 | * Get a keychain by ID
|
84 | * @param params
|
85 | * @param params.id
|
86 | * @param params.xpub (optional)
|
87 | * @param params.ethAddress (optional)
|
88 | * @param params.reqId (optional)
|
89 | * @param callback
|
90 | */
|
91 | get(params: GetKeychainOptions, callback?: NodeCallback<Keychain>): Bluebird<Keychain>;
|
92 | /**
|
93 | * list the users keychains
|
94 | * @param params
|
95 | * @param params.limit - Max number of results in a single call.
|
96 | * @param params.prevId - Continue iterating (provided by nextBatchPrevId in the previous list)
|
97 | * @param callback
|
98 | * @returns {*}
|
99 | */
|
100 | list(params?: ListKeychainOptions, callback?: NodeCallback<ListKeychainsResult>): Bluebird<ListKeychainsResult>;
|
101 | |
102 |
|
103 |
|
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 |
|
115 |
|
116 |
|
117 |
|
118 |
|
119 |
|
120 | updatePassword(params: UpdatePasswordOptions, callback?: NodeCallback<ChangedKeychains>): Bluebird<ChangedKeychains>;
|
121 | |
122 |
|
123 |
|
124 |
|
125 |
|
126 |
|
127 |
|
128 |
|
129 | updateSingleKeychainPassword(params?: UpdateSingleKeychainPasswordOptions): Keychain;
|
130 | |
131 |
|
132 |
|
133 |
|
134 | create(params?: {
|
135 | seed?: Buffer;
|
136 | }): KeyPair;
|
137 | |
138 |
|
139 |
|
140 |
|
141 |
|
142 | add(params?: AddKeychainOptions, callback?: NodeCallback<Keychain>): Bluebird<Keychain>;
|
143 | |
144 |
|
145 |
|
146 |
|
147 |
|
148 | createBitGo(params?: CreateBitGoOptions, callback?: NodeCallback<Keychain>): Bluebird<Keychain>;
|
149 | |
150 |
|
151 |
|
152 |
|
153 |
|
154 |
|
155 | createBackup(params?: CreateBackupOptions, callback?: NodeCallback<Keychain>): Bluebird<Keychain>;
|
156 | |
157 |
|
158 |
|
159 |
|
160 |
|
161 |
|
162 | getKeysForSigning(params?: GetKeysForSigningOptions, callback?: NodeCallback<Keychain[]>): Bluebird<Keychain[]>;
|
163 | }
|
164 | export {};
|
165 |
|
\ | No newline at end of file |