Merge pull request #32518 from bennyn/patch-1

feat(coinbase): Add info about native balance
This commit is contained in:
Pranav Senthilnathan
2019-01-30 15:05:15 -08:00
committed by GitHub
2 changed files with 66 additions and 5 deletions
+2 -2
View File
@@ -25,7 +25,7 @@ client.getAccount("abcdef", (error: Error, account: coinbase.Account): void => {
account.getBuy("abcdef", (error: Error, buy: coinbase.Buy): void => undefined);
account.getBuys((error: Error, buy: coinbase.Buy[]): void => undefined);
account.getBuys(null, (error: Error, buy: coinbase.Buy[]): void => undefined);
account.getDeposit("abcdef", (error: Error, deposit: coinbase.Deposit): void => undefined);
@@ -33,7 +33,7 @@ client.getAccount("abcdef", (error: Error, account: coinbase.Account): void => {
account.getSell("abcdef", (error: Error, deposit: coinbase.Sell): void => undefined);
account.getSells((error: Error, deposit: coinbase.Sell[]): void => undefined);
account.getSells(null, (error: Error, deposit: coinbase.Sell[]): void => undefined);
account.getTransaction("abcdef", (error: Error, deposit: coinbase.Transaction): void => undefined);
+64 -3
View File
@@ -536,6 +536,21 @@ export class Account implements Resource {
*/
balance: MoneyHash;
/**
* Allow deposits
*/
allow_deposits: boolean;
/**
* Allow withdrawls
*/
allow_withdrawals: boolean;
/**
* Account worth in fiat.
*/
native_balance: MoneyHash;
/**
* Promote an account as primary account.
* Scope: wallet:accounts:update
@@ -630,7 +645,7 @@ export class Account implements Resource {
* Lists buys for an account.
* Scope: wallet:buys:read
*/
getBuys(cb: (error: Error, result: Buy[]) => void): void;
getBuys(opts: null, cb: (error: Error, result: Buy[]) => void): void;
/**
* Show an individual buy.
@@ -663,7 +678,7 @@ export class Account implements Resource {
* Lists sells for an account.
* Scope: wallet:sells:read
*/
getSells(cb: (error: Error, result: Sell[]) => void): void;
getSells(opts: null, cb: (error: Error, result: Sell[]) => void): void;
/**
* Show an individual sell.
@@ -883,7 +898,7 @@ export class Buy implements Resource {
/**
* Fee associated to this buy
*/
fee: MoneyHash;
fees: Fee[];
/**
* Has this buy been committed?
@@ -900,6 +915,26 @@ export class Buy implements Resource {
*/
payout_at?: string;
/**
* Unit price of the base currency.
*/
unit_price: UnitPrice;
/**
* Hold period for transfer.
*/
hold_business_days: number;
/**
* Is it the first buy for this symbol?
*/
is_first_buy: boolean;
/**
* Is there another action required to make the transfer pass?
*/
requires_completion_step: boolean;
/**
* Completes a buy that is created in commit: false state.
* If the exchange rate has changed since the buy was created, this call will fail with the error “The exchange rate updated while you
@@ -910,6 +945,32 @@ export class Buy implements Resource {
commit(cb: (error: Error, transaction: Buy) => void): void;
}
export interface Fee {
/**
* Amount associated to this fee
*/
amount: MoneyHash;
/**
* Fee beneficiary ("bank", "coinbase", ...)
*/
type: string;
}
export interface UnitPrice {
/**
* Amount as floating-point in a string
*/
amount: string;
/**
* Currency e.g. "BTC" (see Client#getCurrencies() for available strings)
*/
currency: string;
/**
* Type of price
*/
scale: number;
}
export type SellStatus = "created" | "completed" | "canceled";
/**