Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BitGo

Hierarchy

  • BitGo

Index

Constructors

constructor

Properties

env

Expose env property for backwards compatibility

deprecated

Methods

addAccessToken

  • addAccessToken(params: AddAccessTokenOptions, callback?: NodeCallback<any>): Bluebird<any>
  • addAccessToken Add a BitGo API Access Token to the current user account

    Parameters

    • params: AddAccessTokenOptions

      { otp: (required) label: (required)

    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

    { id: token: label: user: enterprise client: scope: created: expires: origin: isExtensible: extensionAddress: <address whose private key's signature is necessary for extensions> unlock: }

addWebhook

  • addWebhook(params: WebhookOptions, callback?: NodeCallback<any>): Bluebird<any>
  • Add new user webhook

    deprecated

    Parameters

    • params: WebhookOptions
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

authenticate

  • authenticate(params: AuthenticateOptions, callback?: NodeCallback<any>): Bluebird<any>
  • Login to the bitgo platform.

    Parameters

    • params: AuthenticateOptions
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

authenticateWithAccessToken

  • authenticateWithAccessToken(__namedParameters: object): void
  • Synchronous method for activating an access token.

    Parameters

    • __namedParameters: object

    Returns void

authenticateWithAuthCode

  • authenticateWithAuthCode(params: AuthenticateWithAuthCodeOptions, callback?: NodeCallback<any>): Bluebird<any>
  • Login to the bitgo system using an authcode generated via Oauth

    Parameters

    • params: AuthenticateWithAuthCodeOptions
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

blockchain

  • blockchain(): any

calculateHMAC

  • calculateHMAC(key: string, message: string): string
  • Calculate the HMAC for the given key and message

    Parameters

    • key: string

      the key to use for the HMAC

    • message: string

      the actual message to HMAC

    Returns string

    • the result of the HMAC operation

calculateHMACSubject

  • calculateHMACSubject(__namedParameters: object): string
  • Calculate the string that is to be HMACed for a certain HTTP request or response

    Parameters

    • __namedParameters: object

    Returns string

calculateMinerFeeInfo

  • calculateMinerFeeInfo(params: any, callback?: NodeCallback<any>): Bluebird<any>
  • V1 method for calculating miner fee amounts, given the number and type of transaction inputs, along with a fee rate in satoshis per vkB.

    This method should not be used for new code.

    deprecated

    Parameters

    Returns Bluebird<any>

calculateRequestHMAC

  • calculateRequestHMAC(__namedParameters: object): string
  • Calculate the HMAC for an HTTP request

    Parameters

    • __namedParameters: object

    Returns string

calculateRequestHeaders

  • calculateRequestHeaders(__namedParameters: object): RequestHeaders
  • Calculate request headers with HMAC

    Parameters

    • __namedParameters: object

    Returns RequestHeaders

changePassword

  • changePassword(__namedParameters: object, callback?: NodeCallback<any>): Bluebird<any>
  • Change the password of the currently logged in user. Also change all v1 and v2 keychain passwords if they match the given oldPassword. Returns nothing on success.

    Parameters

    • __namedParameters: object
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

clear

  • clear(): void
  • Clear out all state from this BitGo object, effectively logging out the current user.

    Returns void

coin

decrypt

  • decrypt(params?: DecryptOptions): string
  • Decrypt an encrypted string locally.

    Parameters

    • Default value params: DecryptOptions = {}

    Returns string

del

  • del(url: string, callback?: NodeCallback<superagent.Response>): superagent.Request

encrypt

  • encrypt(params?: EncryptOptions): string
  • Utility function to encrypt locally.

    Parameters

    • Default value params: EncryptOptions = {}

    Returns string

estimateFee

  • estimateFee(params?: EstimateFeeOptions, callback?: NodeCallback<any>): Bluebird<any>
  • Estimates approximate fee per kb needed for a tx to get into a block

    deprecated

    Parameters

    • Default value params: EstimateFeeOptions = {}
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

extendToken

  • extendToken(params?: ExtendTokenOptions, callback?: NodeCallback<any>): Bluebird<any>
  • Extend token, provided the current token is extendable

    Parameters

    • Default value params: ExtendTokenOptions = {}
      • duration: duration in seconds by which to extend the token, starting at the current time
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

fetchConstants

  • fetchConstants(params?: undefined | __type, callback?: NodeCallback<any>): Bluebird<any>
  • Receives a TTL and refetches as necessary

    Parameters

    • Optional params: undefined | __type
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

fromJSON

  • fromJSON(json: BitGoJson): void
  • Deserialize a JSON serialized BitGo object.

    Overwrites the properties on the current BitGo object with those of the deserialzed object.

    Parameters

    • json: BitGoJson

    Returns void

generateRandomPassword

  • generateRandomPassword(numWords?: number): string
  • Generate a random password

    Parameters

    • Default value numWords: number = 5

      Number of 32-bit words

    Returns string

    base58 random password

get

  • get(url: string, callback?: NodeCallback<superagent.Response>): superagent.Request

getBitGoFeeAddress

  • getBitGoFeeAddress(params?: undefined | __type, callback?: NodeCallback<any>): Bluebird<any>
  • Get a target address for payment of a BitGo fee

    deprecated

    Parameters

    • Optional params: undefined | __type
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

getConstants

  • getConstants(params?: undefined | __type): any
  • Synchronously get constants which are relevant to the client.

    Note: This function has a known race condition. It may return different values over time, especially if called shortly after creation of the BitGo object.

    New code should call fetchConstants() directly instead.

    deprecated

    Parameters

    • Optional params: undefined | __type

    Returns any

    The client constants object

getECDHSecret

  • getECDHSecret(__namedParameters: object): string
  • Construct an ECDH secret from a private key and other user's public key

    Parameters

    • __namedParameters: object

    Returns string

getECDHSharingKeychain

  • getECDHSharingKeychain(params?: undefined | __type, callback?: NodeCallback<any>): Bluebird<any>
  • Gets the user's private keychain, used for receiving shares

    Parameters

    • Optional params: undefined | __type
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

getEnv

getSharingKey

  • getSharingKey(__namedParameters: object, callback?: NodeCallback<any>): Bluebird<any>
  • Get a key for sharing a wallet with a user

    Parameters

    • __namedParameters: object
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

getUser

  • getUser(__namedParameters: object, callback?: NodeCallback<any>): Bluebird<any>
  • Get a user by ID (name/email only)

    Parameters

    • __namedParameters: object
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

getValidate

  • getValidate(): boolean

getWalletAddress

  • getWalletAddress(__namedParameters: object, callback?: NodeCallback<any>): Bluebird<any>
  • Gets an address object (including the wallet id) for a given address.

    deprecated

    Parameters

    • __namedParameters: object
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

handleTokenIssuance

  • handleTokenIssuance(responseBody: TokenIssuanceResponse, password?: undefined | string): TokenIssuance
  • Parameters

    • responseBody: TokenIssuanceResponse

      Response body object

    • Optional password: undefined | string

      Password for the symmetric decryption

    Returns TokenIssuance

instantGuarantee

  • instantGuarantee(params: object, callback?: NodeCallback<any>): Bluebird<any>
  • Get BitGo's guarantee using an instant id

    deprecated

    Parameters

    Returns Bluebird<any>

keychains

  • keychains(): any
  • Get the user's keychains object.

    deprecated

    Returns any

labels

  • labels(params?: undefined | __type, callback?: NodeCallback<any>): Bluebird<any>
  • Get all the address labels on all of the user's wallets

    Parameters

    • Optional params: undefined | __type
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

listAccessTokens

  • listAccessTokens(params?: undefined | __type, callback?: NodeCallback<any>): Bluebird<any>
  • listAccessTokens Get information on all of the BitGo access tokens on the user

    Parameters

    • Optional params: undefined | __type
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

    { id: label: user: enterprise client: scope: created: expires: origin: isExtensible: extensionAddress: <address whose private key's signature is necessary for extensions> unlock: }

listWebhookNotifications

  • listWebhookNotifications(params?: ListWebhookiNotificationsOptions, callback?: NodeCallback<any>): Bluebird<any>
  • Fetch list of webhook notifications for the user

    Parameters

    • Default value params: ListWebhookiNotificationsOptions = {}
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

listWebhooks

lock

  • lock(params?: undefined | __type, callback?: NodeCallback<any>): Bluebird<any>
  • Lock the session

    Parameters

    • Optional params: undefined | __type
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

logout

  • logout(params?: undefined | __type, callback?: NodeCallback<any>): Bluebird<any>
  • Logout of BitGo

    Parameters

    • Optional params: undefined | __type
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

market

  • market(params?: undefined | __type, callback?: NodeCallback<any>): Bluebird<any>
  • Get the latest bitcoin prices (Deprecated: Will be removed in the future) use bitgo.markets().latest()

    deprecated

    Parameters

    • Optional params: undefined | __type
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

markets

  • markets(): any

me

  • me(params?: undefined | __type, callback?: NodeCallback<any>): Bluebird<any>
  • Get the current logged in user

    Parameters

    • Optional params: undefined | __type
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

microservicesUrl

  • microservicesUrl(path: string): string
  • Create a url for calling BitGo microservice APIs

    Parameters

    • path: string

    Returns string

newWalletObject

  • newWalletObject(walletParams: any): any
  • A factory method to create a new Wallet object, initialized with the wallet params Can be used to reconstitute a wallet from cached data

    deprecated

    Parameters

    • walletParams: any

    Returns any

patch

  • patch(url: string, callback?: NodeCallback<superagent.Response>): superagent.Request

pendingApprovals

  • pendingApprovals(): any
  • Get pending approvals that can be approved/ or rejected

    deprecated

    Returns any

ping

  • ping(__namedParameters?: object, callback?: NodeCallback<any>): Bluebird<any>
  • Test connectivity to the server

    Parameters

    • Default value __namedParameters: object = {}
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

post

  • post(url: string, callback?: NodeCallback<superagent.Response>): superagent.Request

preprocessAuthenticationParams

  • preprocessAuthenticationParams(__namedParameters: object): ProcessedAuthenticationOptions
  • Parameters

    • __namedParameters: object

    Returns ProcessedAuthenticationOptions

put

  • put(url: string, callback?: NodeCallback<superagent.Response>): superagent.Request

reconstituteSecret

  • reconstituteSecret(__namedParameters: object): ReconstitutedSecret
  • Reconstitute a secret which was sharded with splitSecret.

    Parameters

    • __namedParameters: object

    Returns ReconstitutedSecret

refreshToken

  • refreshToken(params?: object, callback?: NodeCallback<any>): Bluebird<any>
  • Use refresh token to get new access token. If the refresh token is null/defined, then we use the stored token from auth

    Parameters

    • Default value params: object = {}
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

registerPushToken

  • registerPushToken(params: any, callback?: NodeCallback<any>): Bluebird<any>
  • deprecated

    Parameters

    • params: any
      • operatingSystem: one of ios, android
      • pushToken: hex-formatted token for the respective native push notification service
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

reject

  • reject(msg: string, callback?: NodeCallback<never>): Bluebird<never>
  • Helper function to return a rejected promise or call callback with error

    deprecated

    Parameters

    Returns Bluebird<never>

removeAccessToken

  • removeAccessToken(__namedParameters: object, callback?: NodeCallback<any>): Bluebird<any>
  • Sets the expire time of an access token matching either the id or label to the current date, effectively deleting it

    Params: id: label:

    Returns: id: label: user: enterprise client: scope: created: expires: origin: isExtensible: extensionAddress: <address whose private key's signature is ne*cessary for extensions> unlock:

    Parameters

    • __namedParameters: object
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

removeWebhook

  • removeWebhook(params: WebhookOptions, callback: any): Bluebird<any>
  • Remove user webhook

    deprecated

    Parameters

    • params: WebhookOptions
    • callback: any

    Returns Bluebird<any>

sendOTP

  • sendOTP(params?: object, callback?: NodeCallback<any>): Bluebird<any>
  • Trigger a push/sms for the OTP code

    deprecated

    Parameters

    • Default value params: object = {}
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

session

  • session(params?: undefined | __type, callback?: NodeCallback<any>): Bluebird<any>
  • Get the current session

    Parameters

    • Optional params: undefined | __type
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

setRequestTracer

  • setRequestTracer(reqTracer: RequestTracer): void
  • Set a request tracer to provide request IDs during multi-request workflows

    Parameters

    • reqTracer: RequestTracer

    Returns void

setValidate

  • setValidate(validate: boolean): void

simulateWebhook

  • simulateWebhook(params: SimulateWebhookOptions, callback?: NodeCallback<any>): Bluebird<any>
  • Simulate a user webhook

    Parameters

    • params: SimulateWebhookOptions
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

splitSecret

  • splitSecret(__namedParameters: object): SplitSecret
  • Split a secret into shards using Shamir Secret Sharing.

    Parameters

    • __namedParameters: object

    Returns SplitSecret

toJSON

  • toJSON(): BitGoJson
  • Serialize this BitGo object to a JSON object.

    Caution: contains sensitive data

    Returns BitGoJson

token

travelRule

  • travelRule(): any

unlock

  • unlock(__namedParameters: object, callback?: NodeCallback<any>): Bluebird<any>
  • Unlock the session by providing OTP

    Parameters

    • __namedParameters: object
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

url

  • url(path: string, version?: number): string
  • Create a url for calling BitGo platform APIs

    Parameters

    • path: string
    • Default value version: number = 1

    Returns string

user

  • user(): User | undefined

verifyAddress

  • verifyAddress(params?: VerifyAddressOptions): boolean
  • Verify a Bitcoin address is a valid base58 address

    deprecated

    Parameters

    • Default value params: VerifyAddressOptions = {}

    Returns boolean

verifyPassword

  • verifyPassword(params?: VerifyPasswordOptions, callback?: NodeCallback<any>): Bluebird<any>
  • Parameters

    • Default value params: VerifyPasswordOptions = {}
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

verifyPushToken

  • verifyPushToken(params: VerifyPushTokenOptions, callback?: NodeCallback<any>): Bluebird<any>
  • deprecated

    Parameters

    • params: VerifyPushTokenOptions
      • pushVerificationToken: the token received via push notification to confirm the device's mobility
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

verifyResponse

  • verifyResponse(__namedParameters: object): object
  • Verify the HMAC for an HTTP response

    Parameters

    • __namedParameters: object

    Returns object

verifyShards

  • verifyShards(__namedParameters: object): boolean
  • Parameters

    • __namedParameters: object

    Returns boolean

version

  • version(): string
  • Gets the version of the BitGoJS package

    Returns string

wallets

  • wallets(): any

yesterday

  • yesterday(params?: undefined | __type, callback?: NodeCallback<any>): Bluebird<any>
  • Get market data from yesterday (Deprecated: Will be removed in the future) use bitgo.markets().yesterday()

    Parameters

    • Optional params: undefined | __type
    • Optional callback: NodeCallback<any>

    Returns Bluebird<any>

Generated using TypeDoc