1 | import * as superagent from 'superagent';
|
2 | import * as bitcoin from '@bitgo/utxo-lib';
|
3 | import { BaseCoin } from './v2/baseCoin';
|
4 | import { EnvironmentName } from './v2/environments';
|
5 | import { NodeCallback, RequestTracer as IRequestTracer, V1Network } from './v2/types';
|
6 | import * as Bluebird from 'bluebird';
|
7 | declare const supportedRequestMethods: readonly ["get", "post", "put", "del", "patch"];
|
8 | export interface BitGoOptions {
|
9 | env?: EnvironmentName;
|
10 | clientId?: string;
|
11 | clientSecret?: string;
|
12 | accessToken?: string;
|
13 | userAgent?: string;
|
14 | customRootURI?: string;
|
15 | customBitcoinNetwork?: V1Network;
|
16 | customSigningAddress?: string;
|
17 | serverXpub?: string;
|
18 | stellarFederationServerUrl?: string;
|
19 | useProduction?: boolean;
|
20 | refreshToken?: string;
|
21 | validate?: boolean;
|
22 | proxy?: string;
|
23 | etherscanApiToken?: string;
|
24 | hmacVerification?: boolean;
|
25 | authVersion?: 2 | 3;
|
26 | }
|
27 | export interface User {
|
28 | username: string;
|
29 | }
|
30 | export interface BitGoJson {
|
31 | user?: User;
|
32 | token?: string;
|
33 | extensionKey?: string;
|
34 | }
|
35 | /**
|
36 | * @deprecated
|
37 | */
|
38 | export interface DeprecatedVerifyAddressOptions {
|
39 | address?: string;
|
40 | }
|
41 | export interface VerifyPasswordOptions {
|
42 | password?: string;
|
43 | }
|
44 | export interface EncryptOptions {
|
45 | input?: string;
|
46 | password?: string;
|
47 | }
|
48 | export interface DecryptOptions {
|
49 | input?: string;
|
50 | password?: string;
|
51 | }
|
52 | export interface SplitSecretOptions {
|
53 | seed: string;
|
54 | passwords: string[];
|
55 | m: number;
|
56 | }
|
57 | export interface SplitSecret {
|
58 | xpub: string;
|
59 | m: number;
|
60 | n: number;
|
61 | seedShares: any;
|
62 | }
|
63 | export interface ReconstituteSecretOptions {
|
64 | shards: string[];
|
65 | passwords: string[];
|
66 | }
|
67 | export interface ReconstitutedSecret {
|
68 | xpub: string;
|
69 | xprv: string;
|
70 | seed: string;
|
71 | }
|
72 | export interface VerifyShardsOptions {
|
73 | shards: string[];
|
74 | passwords: string[];
|
75 | m: number;
|
76 | xpub: string;
|
77 | }
|
78 | export interface GetEcdhSecretOptions {
|
79 | otherPubKeyHex: string;
|
80 | eckey: bitcoin.ECPair;
|
81 | }
|
82 | export interface AccessTokenOptions {
|
83 | accessToken: string;
|
84 | }
|
85 | export interface TokenIssuanceResponse {
|
86 | derivationPath: string;
|
87 | encryptedToken: string;
|
88 | encryptedECDHXprv?: string;
|
89 | }
|
90 | export interface TokenIssuance {
|
91 | token: string;
|
92 | ecdhXprv?: string;
|
93 | }
|
94 | export interface CalculateHmacSubjectOptions {
|
95 | urlPath: string;
|
96 | text: string;
|
97 | timestamp: number;
|
98 | method: typeof supportedRequestMethods[number];
|
99 | statusCode?: number;
|
100 | }
|
101 | export interface CalculateRequestHmacOptions {
|
102 | url: string;
|
103 | text: string;
|
104 | timestamp: number;
|
105 | token: string;
|
106 | method: typeof supportedRequestMethods[number];
|
107 | }
|
108 | export interface CalculateRequestHeadersOptions {
|
109 | url: string;
|
110 | text: string;
|
111 | token: string;
|
112 | method: typeof supportedRequestMethods[number];
|
113 | }
|
114 | export interface RequestHeaders {
|
115 | hmac: string;
|
116 | timestamp: number;
|
117 | tokenHash: string;
|
118 | }
|
119 | export interface VerifyResponseOptions extends CalculateRequestHeadersOptions {
|
120 | hmac: string;
|
121 | url: string;
|
122 | text: string;
|
123 | timestamp: number;
|
124 | method: typeof supportedRequestMethods[number];
|
125 | statusCode?: number;
|
126 | }
|
127 | export interface VerifyResponseInfo {
|
128 | isValid: boolean;
|
129 | expectedHmac: string;
|
130 | signatureSubject: string;
|
131 | isInResponseValidityWindow: boolean;
|
132 | verificationTime: number;
|
133 | }
|
134 | export interface AuthenticateOptions {
|
135 | username: string;
|
136 | password: string;
|
137 | otp?: string;
|
138 | trust?: number;
|
139 | forceSMS?: boolean;
|
140 | extensible?: boolean;
|
141 | forceV1Auth?: boolean;
|
142 | }
|
143 | export interface ProcessedAuthenticationOptions {
|
144 | email: string;
|
145 | password: string;
|
146 | forceSMS: boolean;
|
147 | otp?: string;
|
148 | trust?: number;
|
149 | extensible?: boolean;
|
150 | extensionAddress?: string;
|
151 | forceV1Auth?: boolean;
|
152 | }
|
153 | export interface AddAccessTokenOptions {
|
154 | label: string;
|
155 | otp?: string;
|
156 | duration?: number;
|
157 | ipRestrict?: string[];
|
158 | txValueLimit?: number;
|
159 | scope: string[];
|
160 | }
|
161 | export interface RemoveAccessTokenOptions {
|
162 | id?: string;
|
163 | label?: string;
|
164 | }
|
165 | export interface GetUserOptions {
|
166 | id: string;
|
167 | }
|
168 | export interface ChangePasswordOptions {
|
169 | oldPassword: string;
|
170 | newPassword: string;
|
171 | }
|
172 | export interface UnlockOptions {
|
173 | otp?: string;
|
174 | duration?: number;
|
175 | }
|
176 | export interface ExtendTokenOptions {
|
177 | duration?: string;
|
178 | }
|
179 | export interface GetSharingKeyOptions {
|
180 | email: string;
|
181 | }
|
182 | export interface PingOptions {
|
183 | reqId?: IRequestTracer;
|
184 | }
|
185 | /**
|
186 | * @deprecated
|
187 | */
|
188 | export interface EstimateFeeOptions {
|
189 | numBlocks?: number;
|
190 | maxFee?: number;
|
191 | inputs?: string[];
|
192 | txSize?: number;
|
193 | cpfpAware?: boolean;
|
194 | }
|
195 | /**
|
196 | * @deprecated
|
197 | */
|
198 | export interface WebhookOptions {
|
199 | url: string;
|
200 | type: string;
|
201 | }
|
202 | export interface ListWebhookNotificationsOptions {
|
203 | prevId?: string;
|
204 | limit?: number;
|
205 | }
|
206 | export interface BitGoSimulateWebhookOptions {
|
207 | webhookId: string;
|
208 | blockId: string;
|
209 | }
|
210 | export interface AuthenticateWithAuthCodeOptions {
|
211 | authCode: string;
|
212 | }
|
213 | /**
|
214 | * @deprecated
|
215 | */
|
216 | export interface VerifyPushTokenOptions {
|
217 | pushVerificationToken: string;
|
218 | }
|
219 | export interface BitGoRequest extends superagent.Request {
|
220 | result: (optionalField?: string) => Bluebird<any>;
|
221 | end: (callback?: NodeCallback<superagent.Response>) => void;
|
222 | }
|
223 | export interface BitGo {
|
224 | get(url: string, callback?: NodeCallback<superagent.Response>): BitGoRequest;
|
225 | post(url: string, callback?: NodeCallback<superagent.Response>): BitGoRequest;
|
226 | put(url: string, callback?: NodeCallback<superagent.Response>): BitGoRequest;
|
227 | del(url: string, callback?: NodeCallback<superagent.Response>): BitGoRequest;
|
228 | patch(url: string, callback?: NodeCallback<superagent.Response>): BitGoRequest;
|
229 | }
|
230 | export declare class BitGo {
|
231 | private static _testnetWarningMessage;
|
232 | private static _constants;
|
233 | private static _constantsExpire;
|
234 | private readonly _env;
|
235 | /**
|
236 | * Expose env property for backwards compatibility
|
237 | * @deprecated
|
238 | */
|
239 | readonly env: EnvironmentName;
|
240 | private readonly _baseUrl;
|
241 | private readonly _baseApiUrl;
|
242 | private readonly _baseApiUrlV2;
|
243 | private _user?;
|
244 | private _keychains;
|
245 | private _wallets;
|
246 | private readonly _clientId?;
|
247 | private readonly _clientSecret?;
|
248 | private _token?;
|
249 | private _refreshToken?;
|
250 | private readonly _userAgent;
|
251 | private readonly _promise;
|
252 | private _validate;
|
253 | private readonly _proxy?;
|
254 | private _reqId?;
|
255 | private _ecdhXprv?;
|
256 | private _extensionKey?;
|
257 | private _markets?;
|
258 | private _blockchain?;
|
259 | private _travelRule?;
|
260 | private _pendingApprovals?;
|
261 | private _hmacVerification;
|
262 | private readonly _authVersion;
|
263 | /**
|
264 | * Constructor for BitGo Object
|
265 | */
|
266 | constructor(params?: BitGoOptions);
|
267 | /**
|
268 | * This is a patching function which can apply our authorization
|
269 | * headers to any outbound request.
|
270 | * @param method
|
271 | */
|
272 | private createPatch;
|
273 | /**
|
274 | * Calculate the HMAC for the given key and message
|
275 | * @param key {String} - the key to use for the HMAC
|
276 | * String} - the actual message to HMAC
message { |
277 | * {*} - the result of the HMAC operation
|
278 | */
|
279 | calculateHMAC(key: string, message: string): string;
|
280 | /**
|
281 | * Create a basecoin object
|
282 | * @param coinName
|
283 | */
|
284 | coin(coinName: string): BaseCoin;
|
285 | /**
|
286 | * Create a basecoin object for a virtual token
|
287 | * @param tokenName
|
288 | * @param callback
|
289 | */
|
290 | token(tokenName: string, callback?: NodeCallback<BaseCoin>): Bluebird<BaseCoin>;
|
291 | /**
|
292 | *
|
293 | */
|
294 | getValidate(): boolean;
|
295 | /**
|
296 | *
|
297 | */
|
298 | setValidate(validate: boolean): void;
|
299 | /**
|
300 | * Return the current BitGo environment
|
301 | */
|
302 | getEnv(): EnvironmentName;
|
303 | /**
|
304 | * Return the current auth version used for requests to the BitGo server
|
305 | */
|
306 | getAuthVersion(): number;
|
307 | /**
|
308 | * Clear out all state from this BitGo object, effectively logging out the current user.
|
309 | */
|
310 | clear(): void;
|
311 | /**
|
312 | * Helper function to return a rejected promise or call callback with error
|
313 | *
|
314 | * @deprecated
|
315 | */
|
316 | reject(msg: string, callback?: NodeCallback<never>): Bluebird<never>;
|
317 | /**
|
318 | * Gets the version of the BitGoJS package
|
319 | */
|
320 | version(): string;
|
321 | /**
|
322 | * Serialize this BitGo object to a JSON object.
|
323 | *
|
324 | * Caution: contains sensitive data
|
325 | */
|
326 | toJSON(): BitGoJson;
|
327 | /**
|
328 | * Deserialize a JSON serialized BitGo object.
|
329 | *
|
330 | * Overwrites the properties on the current BitGo object with
|
331 | * those of the deserialzed object.
|
332 | *
|
333 | * @param json
|
334 | */
|
335 | fromJSON(json: BitGoJson): void;
|
336 | /**
|
337 | * Get the current user
|
338 | */
|
339 | user(): User | undefined;
|
340 | /**
|
341 | * Verify a Bitcoin address is a valid base58 address
|
342 | * @deprecated
|
343 | */
|
344 | verifyAddress(params?: DeprecatedVerifyAddressOptions): boolean;
|
345 | /**
|
346 | */
|
347 | verifyPassword(params?: VerifyPasswordOptions, callback?: NodeCallback<any>): Bluebird<any>;
|
348 | /**
|
349 | * Utility function to encrypt locally.
|
350 | */
|
351 | encrypt(params?: EncryptOptions): string;
|
352 | /**
|
353 | * Decrypt an encrypted string locally.
|
354 | */
|
355 | decrypt(params?: DecryptOptions): string;
|
356 | /**
|
357 | * Generate a random password
|
358 | * @param {Number} numWords Number of 32-bit words
|
359 | * @returns {String} base58 random password
|
360 | */
|
361 | generateRandomPassword(numWords?: number): string;
|
362 | /**
|
363 | * Split a secret into shards using Shamir Secret Sharing.
|
364 | * @param seed A hexadecimal secret to split
|
365 | * @param passwords An array of the passwords used to encrypt each share
|
366 | * @param m The threshold number of shards necessary to reconstitute the secret
|
367 | */
|
368 | splitSecret({ seed, passwords, m }: SplitSecretOptions): SplitSecret;
|
369 | /**
|
370 | * Reconstitute a secret which was sharded with `splitSecret`.
|
371 | * @param shards
|
372 | * @param passwords
|
373 | */
|
374 | reconstituteSecret({ shards, passwords }: ReconstituteSecretOptions): ReconstitutedSecret;
|
375 | /**
|
376 | *
|
377 | * @param shards
|
378 | * @param passwords
|
379 | * @param m
|
380 | * @param xpub Optional xpub to verify the results against
|
381 | */
|
382 | verifyShards({ shards, passwords, m, xpub }: VerifyShardsOptions): boolean;
|
383 | /**
|
384 | * Construct an ECDH secret from a private key and other user's public key
|
385 | */
|
386 | getECDHSecret({ otherPubKeyHex, eckey }: GetEcdhSecretOptions): string;
|
387 | /**
|
388 | * Gets the user's private keychain, used for receiving shares
|
389 | */
|
390 | getECDHSharingKeychain(params?: Record<string, never>, callback?: NodeCallback<any>): Bluebird<any>;
|
391 | /**
|
392 | * Get bitcoin market data
|
393 | */
|
394 | markets(): any;
|
395 | /**
|
396 | * Get the latest bitcoin prices
|
397 | * (Deprecated: Will be removed in the future) use `bitgo.markets().latest()`
|
398 | * @deprecated
|
399 | */
|
400 | market(params?: Record<string, never>, callback?: NodeCallback<any>): Bluebird<any>;
|
401 | /**
|
402 | * Get market data from yesterday
|
403 | * (Deprecated: Will be removed in the future) use bitgo.markets().yesterday()
|
404 | */
|
405 | yesterday(params?: Record<string, never>, callback?: NodeCallback<any>): Bluebird<any>;
|
406 | /**
|
407 | * Synchronous method for activating an access token.
|
408 | */
|
409 | authenticateWithAccessToken({ accessToken }: AccessTokenOptions): void;
|
410 | /**
|
411 | *
|
412 | * @param responseBody Response body object
|
413 | * @param password Password for the symmetric decryption
|
414 | */
|
415 | handleTokenIssuance(responseBody: TokenIssuanceResponse, password?: string): TokenIssuance;
|
416 | /**
|
417 | * Calculate the subject string that is to be HMAC'ed for a HTTP request or response
|
418 | * @param urlPath request url, including query params
|
419 | * @param text request body text
|
420 | * @param timestamp request timestamp from `Date.now()`
|
421 | * @param statusCode Only set for HTTP responses, leave blank for requests
|
422 | * @param method request method
|
423 | * @returns {string}
|
424 | */
|
425 | calculateHMACSubject({ urlPath, text, timestamp, statusCode, method }: CalculateHmacSubjectOptions): string;
|
426 | /**
|
427 | * Calculate the HMAC for an HTTP request
|
428 | */
|
429 | calculateRequestHMAC({ url: urlPath, text, timestamp, token, method }: CalculateRequestHmacOptions): string;
|
430 | /**
|
431 | * Calculate request headers with HMAC
|
432 | */
|
433 | calculateRequestHeaders({ url, text, token, method }: CalculateRequestHeadersOptions): RequestHeaders;
|
434 | /**
|
435 | * Verify the HMAC for an HTTP response
|
436 | */
|
437 | verifyResponse({ url: urlPath, statusCode, text, timestamp, token, hmac, method }: VerifyResponseOptions): VerifyResponseInfo;
|
438 | /**
|
439 | * Process the username, password and otp into an object containing the username and hashed password, ready to
|
440 | * send to bitgo for authentication.
|
441 | */
|
442 | preprocessAuthenticationParams({ username, password, otp, forceSMS, extensible, trust }: AuthenticateOptions): ProcessedAuthenticationOptions;
|
443 | /**
|
444 | * Login to the bitgo platform.
|
445 | */
|
446 | authenticate(params: AuthenticateOptions, callback?: NodeCallback<any>): Bluebird<any>;
|
447 | /**
|
448 | * @param params
|
449 | * - operatingSystem: one of ios, android
|
450 | * - pushToken: hex-formatted token for the respective native push notification service
|
451 | * @param callback
|
452 | * @returns {*}
|
453 | * @deprecated
|
454 | */
|
455 | registerPushToken(params: any, callback?: NodeCallback<any>): Bluebird<any>;
|
456 | /**
|
457 | *
|
458 | * @param params
|
459 | * - pushVerificationToken: the token received via push notification to confirm the device's mobility
|
460 | * @param callback
|
461 | * @deprecated
|
462 | */
|
463 | verifyPushToken(params: VerifyPushTokenOptions, callback?: NodeCallback<any>): Bluebird<any>;
|
464 | /**
|
465 | * Login to the bitgo system using an authcode generated via Oauth
|
466 | */
|
467 | authenticateWithAuthCode(params: AuthenticateWithAuthCodeOptions, callback?: NodeCallback<any>): Bluebird<any>;
|
468 | /**
|
469 | * Use refresh token to get new access token.
|
470 | * If the refresh token is null/defined, then we use the stored token from auth
|
471 | */
|
472 | refreshToken(params?: {
|
473 | refreshToken?: string;
|
474 | }, callback?: NodeCallback<any>): Bluebird<any>;
|
475 | /**
|
476 | *
|
477 | * listAccessTokens
|
478 | * Get information on all of the BitGo access tokens on the user
|
479 | * @return {
|
480 | * id: <id of the token>
|
481 | * label: <the user-provided label for this token>
|
482 | * user: <id of the user on the token>
|
483 | * enterprise <id of the enterprise this token is valid for>
|
484 | * client: <the auth client that this token belongs to>
|
485 | * scope: <list of allowed OAuth scope values>
|
486 | * created: <date the token was created>
|
487 | * expires: <date the token will expire>
|
488 | * origin: <the origin for which this token is valid>
|
489 | * isExtensible: <flag indicating if the token can be extended>
|
490 | * extensionAddress: <address whose private key's signature is necessary for extensions>
|
491 | * unlock: <info for actions that require an unlock before firing>
|
492 | * }
|
493 | */
|
494 | listAccessTokens(params?: Record<string, never>, callback?: NodeCallback<any>): Bluebird<any>;
|
495 | /**
|
496 | * addAccessToken
|
497 | * Add a BitGo API Access Token to the current user account
|
498 | * @param params {
|
499 | * otp: (required) <valid otp code>
|
500 | * label: (required) <label for the token>
|
501 | * duration: <length of time in seconds the token will be valid for>
|
502 | * ipRestrict: <array of IP address strings to whitelist>
|
503 | * txValueLimit: <number of outgoing satoshis allowed on this token>
|
504 | * scope: (required) <authorization scope of the requested token>
|
505 | * }
|
506 | * @param callback
|
507 | * @return {
|
508 | * id: <id of the token>
|
509 | * token: <access token hex string to be used for BitGo API request verification>
|
510 | * label: <user-provided label for this token>
|
511 | * user: <id of the user on the token>
|
512 | * enterprise <id of the enterprise this token is valid for>
|
513 | * client: <the auth client that this token belongs to>
|
514 | * scope: <list of allowed OAuth scope values>
|
515 | * created: <date the token was created>
|
516 | * expires: <date the token will expire>
|
517 | * origin: <the origin for which this token is valid>
|
518 | * isExtensible: <flag indicating if the token can be extended>
|
519 | * extensionAddress: <address whose private key's signature is necessary for extensions>
|
520 | * unlock: <info for actions that require an unlock before firing>
|
521 | * }
|
522 | */
|
523 | addAccessToken(params: AddAccessTokenOptions, callback?: NodeCallback<any>): Bluebird<any>;
|
524 | /**
|
525 | * Sets the expire time of an access token matching either the id or label to the current date, effectively deleting it
|
526 | *
|
527 | * Params:
|
528 | * id: <id of the access token to be deleted>
|
529 | * label: <label of the access token to be deleted>
|
530 | *
|
531 | * Returns:
|
532 | * id: <id of the token>
|
533 | * label: <user-provided label for this token>
|
534 | * user: <id of the user on the token>
|
535 | * enterprise <id of the enterprise this token is valid for>
|
536 | * client: <the auth client that this token belongs to>
|
537 | * scope: <list of allowed OAuth scope values>
|
538 | * created: <date the token was created>
|
539 | * expires: <date the token will expire>
|
540 | * origin: <the origin for which this token is valid>
|
541 | * isExtensible: <flag indicating if the token can be extended>
|
542 | * extensionAddress: <address whose private key's signature is ne*cessary for extensions>
|
543 | * unlock: <info for actions that require an unlock before firing>
|
544 | * @param params
|
545 | * @param callback
|
546 | */
|
547 | removeAccessToken({ id, label }: RemoveAccessTokenOptions, callback?: NodeCallback<any>): Bluebird<any>;
|
548 | /**
|
549 | * Logout of BitGo
|
550 | * @param params
|
551 | * @param callback
|
552 | */
|
553 | logout(params?: Record<string, never>, callback?: NodeCallback<any>): Bluebird<any>;
|
554 | /**
|
555 | * Get a user by ID (name/email only)
|
556 | * @param id
|
557 | * @param callback
|
558 | */
|
559 | getUser({ id }: GetUserOptions, callback?: NodeCallback<any>): Bluebird<any>;
|
560 | /**
|
561 | * Change the password of the currently logged in user.
|
562 | * Also change all v1 and v2 keychain passwords if they match the
|
563 | * given oldPassword. Returns nothing on success.
|
564 | * @param oldPassword {String} - the current password
|
565 | * @param newPassword {String} - the new password
|
566 | * @param callback
|
567 | */
|
568 | changePassword({ oldPassword, newPassword }: ChangePasswordOptions, callback?: NodeCallback<any>): Bluebird<any>;
|
569 | /**
|
570 | * Get the current logged in user
|
571 | * @param params
|
572 | * @param callback
|
573 | */
|
574 | me(params?: Record<string, never>, callback?: NodeCallback<any>): Bluebird<any>;
|
575 | /**
|
576 | * Unlock the session by providing OTP
|
577 | * @param {string} otp Required OTP code for the account.
|
578 | * @param {number} duration Desired duration of the unlock in seconds (default=600, max=3600).
|
579 | * @param callback
|
580 | */
|
581 | unlock({ otp, duration }: UnlockOptions, callback?: NodeCallback<any>): Bluebird<any>;
|
582 | /**
|
583 | * Lock the session
|
584 | * @param params
|
585 | * @param callback
|
586 | */
|
587 | lock(params?: Record<string, never>, callback?: NodeCallback<any>): Bluebird<any>;
|
588 | /**
|
589 | * Get the current session
|
590 | */
|
591 | session(params?: Record<string, never>, callback?: NodeCallback<any>): Bluebird<any>;
|
592 | /**
|
593 | * Trigger a push/sms for the OTP code
|
594 | * @param {boolean} params.forceSMS If set to true, will use SMS to send the OTP to the user even if they have other 2FA method set up.
|
595 | * @deprecated
|
596 | */
|
597 | sendOTP(params?: {
|
598 | forceSMS?: boolean;
|
599 | }, callback?: NodeCallback<any>): Bluebird<any>;
|
600 | /**
|
601 | * Extend token, provided the current token is extendable
|
602 | * @param params
|
603 | * - duration: duration in seconds by which to extend the token, starting at the current time
|
604 | * @param callback
|
605 | */
|
606 | extendToken(params?: ExtendTokenOptions, callback?: NodeCallback<any>): Bluebird<any>;
|
607 | /**
|
608 | * Get a key for sharing a wallet with a user
|
609 | * @param email email of user to share wallet with
|
610 | * @param callback
|
611 | */
|
612 | getSharingKey({ email }: GetSharingKeyOptions, callback?: NodeCallback<any>): Bluebird<any>;
|
613 | /**
|
614 | * Test connectivity to the server
|
615 | * @param params
|
616 | * @param callback
|
617 | */
|
618 | ping({ reqId }?: PingOptions, callback?: NodeCallback<any>): Bluebird<any>;
|
619 | /**
|
620 | * Get the blockchain object.
|
621 | * @deprecated
|
622 | */
|
623 | blockchain(): any;
|
624 | /**
|
625 | * Get the user's keychains object.
|
626 | * @deprecated
|
627 | */
|
628 | keychains(): any;
|
629 | /**
|
630 | * Get the user's wallets object.
|
631 | * @deprecated
|
632 | */
|
633 | wallets(): any;
|
634 | /**
|
635 | * Get the travel rule object
|
636 | * @deprecated
|
637 | */
|
638 | travelRule(): any;
|
639 | /**
|
640 | * Get pending approvals that can be approved/ or rejected
|
641 | * @deprecated
|
642 | */
|
643 | pendingApprovals(): any;
|
644 | /**
|
645 | * A factory method to create a new Wallet object, initialized with the wallet params
|
646 | * Can be used to reconstitute a wallet from cached data
|
647 | * @param walletParams
|
648 | * @deprecated
|
649 | */
|
650 | newWalletObject(walletParams: any): any;
|
651 | /**
|
652 | * Create a url for calling BitGo platform APIs
|
653 | * @param path
|
654 | * @param version
|
655 | */
|
656 | url(path: string, version?: number): string;
|
657 | /**
|
658 | * Create a url for calling BitGo microservice APIs
|
659 | */
|
660 | microservicesUrl(path: string): string;
|
661 | /**
|
662 | * Get all the address labels on all of the user's wallets
|
663 | */
|
664 | labels(params?: Record<string, never>, callback?: NodeCallback<any>): Bluebird<any>;
|
665 | /**
|
666 | * Estimates approximate fee per kb needed for a tx to get into a block
|
667 | * @param {number} params.numBlocks target blocks for the transaction to be confirmed
|
668 | * @param {number} params.maxFee maximum fee willing to be paid (for safety)
|
669 | * @param {array[string]} params.inputs list of unconfirmed txIds from which this transaction uses inputs
|
670 | * @param {number} params.txSize estimated transaction size in bytes, optional parameter used for CPFP estimation.
|
671 | * @param {boolean} params.cpfpAware flag indicating fee should take into account CPFP
|
672 | * @deprecated
|
673 | */
|
674 | estimateFee(params?: EstimateFeeOptions, callback?: NodeCallback<any>): Bluebird<any>;
|
675 | /**
|
676 | * Get BitGo's guarantee using an instant id
|
677 | * @param params
|
678 | * @param callback
|
679 | * @deprecated
|
680 | */
|
681 | instantGuarantee(params: {
|
682 | id: string;
|
683 | }, callback?: NodeCallback<any>): Bluebird<any>;
|
684 | /**
|
685 | * Get a target address for payment of a BitGo fee
|
686 | * @param params
|
687 | * @param callback
|
688 | * @deprecated
|
689 | */
|
690 | getBitGoFeeAddress(params?: Record<string, never>, callback?: NodeCallback<any>): Bluebird<any>;
|
691 | /**
|
692 | * Gets an address object (including the wallet id) for a given address.
|
693 | * @param {string} params.address The address to look up.
|
694 | * @deprecated
|
695 | */
|
696 | getWalletAddress({ address }: {
|
697 | address: string;
|
698 | }, callback?: NodeCallback<any>): Bluebird<any>;
|
699 | /**
|
700 | * Fetch list of user webhooks
|
701 | *
|
702 | * @param callback
|
703 | * @returns {*}
|
704 | * @deprecated
|
705 | */
|
706 | listWebhooks(callback?: NodeCallback<any>): Bluebird<any>;
|
707 | /**
|
708 | * Add new user webhook
|
709 | *
|
710 | * @param params
|
711 | * @param callback
|
712 | * @returns {*}
|
713 | * @deprecated
|
714 | */
|
715 | addWebhook(params: WebhookOptions, callback?: NodeCallback<any>): Bluebird<any>;
|
716 | /**
|
717 | * Remove user webhook
|
718 | *
|
719 | * @param params
|
720 | * @param callback
|
721 | * @returns {*}
|
722 | * @deprecated
|
723 | */
|
724 | removeWebhook(params: WebhookOptions, callback: any): Bluebird<any>;
|
725 | /**
|
726 | * Fetch list of webhook notifications for the user
|
727 | *
|
728 | * @param params
|
729 | * @param callback
|
730 | * @returns {*}
|
731 | */
|
732 | listWebhookNotifications(params?: ListWebhookNotificationsOptions, callback?: NodeCallback<any>): Bluebird<any>;
|
733 | /**
|
734 | * Simulate a user webhook
|
735 | *
|
736 | * @param params
|
737 | * @param callback
|
738 | * @returns {*}
|
739 | */
|
740 | simulateWebhook(params: BitGoSimulateWebhookOptions, callback?: NodeCallback<any>): Bluebird<any>;
|
741 | /**
|
742 | * Receives a TTL and refetches as necessary
|
743 | * @param params
|
744 | * @param callback
|
745 | */
|
746 | fetchConstants(params?: Record<string, never>, callback?: NodeCallback<any>): Bluebird<any>;
|
747 | /**
|
748 | * Synchronously get constants which are relevant to the client.
|
749 | *
|
750 | * Note: This function has a known race condition. It may return different values over time,
|
751 | * especially if called shortly after creation of the BitGo object.
|
752 | *
|
753 | * New code should call fetchConstants() directly instead.
|
754 | *
|
755 | * @deprecated
|
756 | * @param params
|
757 | * @return {Object} The client constants object
|
758 | */
|
759 | getConstants(params?: Record<string, never>): any;
|
760 | /**
|
761 | * V1 method for calculating miner fee amounts, given the number and
|
762 | * type of transaction inputs, along with a fee rate in satoshis per vkB.
|
763 | *
|
764 | * This method should not be used for new code.
|
765 | *
|
766 | * @deprecated
|
767 | * @param params
|
768 | * @param callback
|
769 | * @return {any}
|
770 | */
|
771 | calculateMinerFeeInfo(params: any, callback?: NodeCallback<any>): Bluebird<any>;
|
772 | /**
|
773 | * Set a request tracer to provide request IDs during multi-request workflows
|
774 | */
|
775 | setRequestTracer(reqTracer: IRequestTracer): void;
|
776 | }
|
777 | export {};
|
778 | //# sourceMappingURL=bitgo.d.ts.map |
\ | No newline at end of file |