Skip to content

Class: CBAppClient ​

REST client for Coinbase's Coinbase App API: https://docs.cdp.coinbase.com/coinbase-app/docs/welcome

Extends ​

  • BaseRestClient

Constructors ​

Constructor ​

ts
new CBAppClient(restClientOptions?: RestClientOptions, requestOptions?: AxiosRequestConfig): CBAppClient;

Parameters ​

ParameterType
restClientOptions?RestClientOptions
requestOptions?AxiosRequestConfig

Returns ​

CBAppClient

Overrides ​

BaseRestClient.constructor

Methods ​

commitDeposit() ​

ts
commitDeposit(params: object): Promise<CBAppTransfer>;

Commit Deposit

Completes a deposit that is created in commit: false state.

Parameters ​

ParameterType
params{ account_id: string; deposit_id: string; }
params.account_idstring
params.deposit_idstring

Returns ​

Promise<CBAppTransfer>


commitWithdrawal() ​

ts
commitWithdrawal(params: object): Promise<CBAppTransfer>;

Commit Withdrawal

Completes a withdrawal that is created in commit: false state.

Parameters ​

ParameterType
params{ account_id: string; withdrawal_id: string; }
params.account_idstring
params.withdrawal_idstring

Returns ​

Promise<CBAppTransfer>


createAddress() ​

ts
createAddress(params: object): Promise<{
  data: CBAppAddress;
}>;

Create Address

Creates a new address for an account. Addresses can be created for wallet account types.

Parameters ​

ParameterType
params{ account_id: string; name?: string; }
params.account_idstring
params.name?string

Returns ​

Promise<{ data: CBAppAddress; }>


deletePrivate() ​

ts
deletePrivate(endpoint: string, params?: ParamsInRequest): Promise<any>;

Parameters ​

ParameterType
endpointstring
params?ParamsInRequest

Returns ​

Promise<any>

Inherited from ​

BaseRestClient.deletePrivate


depositFunds() ​

ts
depositFunds(params: CBAppDepositFundsRequest): Promise<CBAppTransfer>;

Deposit Funds

Deposits user-defined amount of funds to a fiat account.

Parameters ​

ParameterType
paramsCBAppDepositFundsRequest

Returns ​

Promise<CBAppTransfer>


generateNewOrderId() ​

ts
generateNewOrderId(): string;

Returns ​

string

Inherited from ​

BaseRestClient.generateNewOrderId


get() ​

ts
get(endpoint: string, params?: object): Promise<any>;

Parameters ​

ParameterType
endpointstring
params?object

Returns ​

Promise<any>

Inherited from ​

BaseRestClient.get


getAccount() ​

ts
getAccount(params: object): Promise<{
  data: CBAppAccount;
}>;

Show Account

Get a current user's account by account ID or currency string.

Parameters ​

ParameterType
params{ account_id: string; }
params.account_idstring

Returns ​

Promise<{ data: CBAppAccount; }>


getAccounts() ​

ts
getAccounts(params?: object): Promise<{
  data: CBAppAccount[];
  pagination: CBAppPagination;
}>;

List Accounts

List accounts accessible to the current credentials.

This endpoint is paginated. Omit paginationURL on the first request. Pass the previous response’s pagination.next_uri as paginationURL to fetch the next page. Stop when next_uri is null.

Parameters ​

ParameterType
params?{ paginationURL?: string; starting_after?: string; }
params.paginationURL?string
params.starting_after?string

Returns ​

Promise<{ data: CBAppAccount[]; pagination: CBAppPagination; }>


getAddress() ​

ts
getAddress(params: object): Promise<{
  data: CBAppAddress;
}>;

Get a single address for an account. Pass the account ID and address ID to select GET /v2/accounts/{account_id}/addresses/{addressId}. An address can belong to only one account; use createAddress() to create another address.

Parameters ​

ParameterType
params{ account_id: string; addressId: string; }
params.account_idstring
params.addressIdstring

Returns ​

Promise<{ data: CBAppAddress; }>


getAddresses() ​

ts
getAddresses(params: object): Promise<{
  data: CBAppAddress[];
  pagination: CBAppPagination;
}>;

List Addresses

Lists addresses for an account.

This endpoint is paginated. Omit paginationURL on the first request. Pass the previous response’s pagination.next_uri as paginationURL to fetch the next page. Stop when next_uri is null.

Parameters ​

ParameterType
params{ account_id: string; paginationURL?: string; }
params.account_idstring
params.paginationURL?string

Returns ​

Promise<{ data: CBAppAddress[]; pagination: CBAppPagination; }>


getAddressTransactions() ​

ts
getAddressTransactions(params: object): Promise<{
  data: CBAppTransaction[];
  pagination: CBAppPagination;
}>;

List transactions sent to a specific address. Pass the account ID and address ID.

This endpoint is paginated. Omit paginationURL on the first request. Pass the previous response’s pagination.next_uri as paginationURL to fetch the next page. Stop when next_uri is null.

Parameters ​

ParameterType
params{ account_id: string; addressId: string; paginationURL?: string; }
params.account_idstring
params.addressIdstring
params.paginationURL?string

Returns ​

Promise<{ data: CBAppTransaction[]; pagination: CBAppPagination; }>


getBuyPrice() ​

ts
getBuyPrice(params: object): Promise<{
  data: {
     amount: string;
     currency: string;
  };
}>;

Get Buy Price

Get the total price to buy one bitcoin or ether. This endpoint doesn't require authentication.

Parameters ​

ParameterType
params{ currencyPair: string; }
params.currencyPairstring

Returns ​

Promise<{ data: { amount: string; currency: string; }; }>


getClientType() ​

ts
getClientType(): RestClientType;

Defines the client type (affecting how requests & signatures behave)

Returns ​

RestClientType

Overrides ​

BaseRestClient.getClientType


getCoinbaseOneSubscription() ​

ts
getCoinbaseOneSubscription(): Promise<{
  data: CBAppCoinbaseOneSubscription;
}>;

Get the user’s Coinbase One subscription status, tier, and current period end from GET /v2/subscriptions/coinbase-one. Requires the OAuth2 scope wallet:subscription:read and the Accept: application/json header. See available OAuth APIs.

Returns ​

Promise<{ data: CBAppCoinbaseOneSubscription; }>


getCryptocurrencies() ​

ts
getCryptocurrencies(): Promise<CBAppCryptocurrency[]>;

Get Cryptocurrencies

Lists known cryptocurrencies.

Returns ​

Promise<CBAppCryptocurrency[]>


getCurrentTime() ​

ts
getCurrentTime(): Promise<{
  data: {
     epoch: number;
     iso: string;
  };
}>;

Get Current Time

Get the API server time. This endpoint doesn't require authentication.

Returns ​

Promise<{ data: { epoch: number; iso: string; }; }>


getDeposit() ​

ts
getDeposit(params: object): Promise<{
  data: CBAppDepositWithdrawal;
}>;

Show Deposit

Get one deposit by deposit Id.

Parameters ​

ParameterType
params{ account_id: string; deposit_id: string; }
params.account_idstring
params.deposit_idstring

Returns ​

Promise<{ data: CBAppDepositWithdrawal; }>


getDeposits() ​

ts
getDeposits(params: object): Promise<{
  data: CBAppDepositWithdrawal[];
  pagination: CBAppPagination;
}>;

List Deposits

Lists fiat deposits for an account.

This endpoint is paginated. Omit paginationURL on the first request. Pass the previous response’s pagination.next_uri as paginationURL to fetch the next page. Stop when next_uri is null.

Parameters ​

ParameterType
params{ account_id: string; paginationURL?: string; }
params.account_idstring
params.paginationURL?string

Returns ​

Promise<{ data: CBAppDepositWithdrawal[]; pagination: CBAppPagination; }>


getExchangeRates() ​

ts
getExchangeRates(params?: object): Promise<{
  data: {
     currency: string;
     rates: {
      [key: string]: string;
     };
  };
}>;

Get Exchange Rates

Get current exchange rates. Default base currency is USD but it can be defined as any supported currency. Returned rates will define the exchange rate for one unit of the base currency.

Parameters ​

ParameterType
params?{ currency?: string; }
params.currency?string

Returns ​

Promise<{ data: { currency: string; rates: { [key: string]: string; }; }; }>


getFiatCurrencies() ​

ts
getFiatCurrencies(): Promise<{
  data: CBAppFiatCurrency[];
}>;

Get Fiat Currencies

Lists known fiat currencies. Currency codes conform to the ISO 4217 standard where possible. Currencies with no representation in ISO 4217 may use a custom code.

Returns ​

Promise<{ data: CBAppFiatCurrency[]; }>


getPrivate() ​

ts
getPrivate(endpoint: string, params?: object): Promise<any>;

Parameters ​

ParameterType
endpointstring
params?object

Returns ​

Promise<any>

Inherited from ​

BaseRestClient.getPrivate


getSellPrice() ​

ts
getSellPrice(params: object): Promise<{
  data: {
     amount: string;
     currency: string;
  };
}>;

Get Sell Price

Get the total price to sell one bitcoin or ether. This endpoint doesn't require authentication.

Parameters ​

ParameterType
params{ currencyPair: string; }
params.currencyPairstring

Returns ​

Promise<{ data: { amount: string; currency: string; }; }>


getSignTimestampMs() ​

ts
getSignTimestampMs(): number;

Timestamp used to sign the request. Override this method to implement your own timestamp/sync mechanism

Returns ​

number

Inherited from ​

BaseRestClient.getSignTimestampMs


getSpotPrice() ​

ts
getSpotPrice(params: object): Promise<{
  data: {
     amount: string;
     currency: string;
  };
}>;

Get Spot Price

Get the current market price for bitcoin. This is usually somewhere in between the buy and sell price. This endpoint doesn't require authentication.

Parameters ​

ParameterType
params{ currencyPair: string; date?: string; }
params.currencyPairstring
params.date?string

Returns ​

Promise<{ data: { amount: string; currency: string; }; }>


getTransaction() ​

ts
getTransaction(params: object): Promise<{
  data: CBAppTransaction;
}>;

Show Transaction

Get a single transaction for an account.

Parameters ​

ParameterType
params{ account_id: string; transactionId: string; }
params.account_idstring
params.transactionIdstring

Returns ​

Promise<{ data: CBAppTransaction; }>


getTransactions() ​

ts
getTransactions(params: object): Promise<{
  data: CBAppTransaction[];
  pagination: CBAppPagination;
}>;

List Transactions

Lists the transactions of an account by account ID.

This endpoint is paginated. Omit paginationURL on the first request. Pass the previous response’s pagination.next_uri as paginationURL to fetch the next page. Stop when next_uri is null.

Parameters ​

ParameterType
params{ account_id: string; paginationURL?: string; }
params.account_idstring
params.paginationURL?string

Returns ​

Promise<{ data: CBAppTransaction[]; pagination: CBAppPagination; }>


getWithdrawal() ​

ts
getWithdrawal(params: object): Promise<{
  data: CBAppDepositWithdrawal;
}>;

Show Withdrawal

Get a single withdrawal.

Parameters ​

ParameterType
params{ account_id: string; withdrawal_id: string; }
params.account_idstring
params.withdrawal_idstring

Returns ​

Promise<{ data: CBAppDepositWithdrawal; }>


getWithdrawals() ​

ts
getWithdrawals(params: object): Promise<{
  data: CBAppDepositWithdrawal[];
  pagination: CBAppPagination;
}>;

List Withdrawals

Lists withdrawals for an account.

This endpoint is paginated. Omit paginationURL on the first request. Pass the previous response’s pagination.next_uri as paginationURL to fetch the next page. Stop when next_uri is null.

Parameters ​

ParameterType
params{ account_id: string; paginationURL?: string; }
params.account_idstring
params.paginationURL?string

Returns ​

Promise<{ data: CBAppDepositWithdrawal[]; pagination: CBAppPagination; }>


patchPrivate() ​

ts
patchPrivate(endpoint: string, params?: ParamsInRequest): Promise<any>;

Parameters ​

ParameterType
endpointstring
params?ParamsInRequest

Returns ​

Promise<any>

Inherited from ​

BaseRestClient.patchPrivate


post() ​

ts
post(endpoint: string, params?: ParamsInRequest): Promise<any>;

Parameters ​

ParameterType
endpointstring
params?ParamsInRequest

Returns ​

Promise<any>

Inherited from ​

BaseRestClient.post


postPrivate() ​

ts
postPrivate(endpoint: string, params?: ParamsInRequest): Promise<any>;

Parameters ​

ParameterType
endpointstring
params?ParamsInRequest

Returns ​

Promise<any>

Inherited from ​

BaseRestClient.postPrivate


putPrivate() ​

ts
putPrivate(endpoint: string, params?: ParamsInRequest): Promise<any>;

Parameters ​

ParameterType
endpointstring
params?ParamsInRequest

Returns ​

Promise<any>

Inherited from ​

BaseRestClient.putPrivate


sendMoney() ​

ts
sendMoney(params: CBAppSendMoneyRequest): Promise<{
  data: CBAppTransaction;
}>;

Send supported crypto to a network address or recipient email address. Off-blockchain crypto transactions do not incur transaction fees.

See the Travel Rule data guide for required recipient information.

Parameters ​

ParameterType
paramsCBAppSendMoneyRequest

Returns ​

Promise<{ data: CBAppTransaction; }>


transferMoney() ​

ts
transferMoney(params: CBAppTransferMoneyRequest): Promise<{
  data: CBAppTransaction;
}>;

Send a transfer transaction request to POST /v2/accounts/{account_id}/transactions. The SDK request type uses type: "transfer" with to, amount, and currency; it removes account_id from the body and uses it in the path.

Parameters ​

ParameterType
paramsCBAppTransferMoneyRequest

Returns ​

Promise<{ data: CBAppTransaction; }>


withdrawFunds() ​

ts
withdrawFunds(params: CBAppWithdrawFundsRequest): Promise<CBAppTransfer>;

Withdraw Funds

Withdraws a user-defined amount of funds from a fiat account.

Parameters ​

ParameterType
paramsCBAppWithdrawFundsRequest

Returns ​

Promise<CBAppTransfer>

Built by Siebly. Open source SDKs for exchange APIs.