diff --git a/types/coinbase/coinbase-tests.ts b/types/coinbase/coinbase-tests.ts index fb804ac566..65ec9693bd 100644 --- a/types/coinbase/coinbase-tests.ts +++ b/types/coinbase/coinbase-tests.ts @@ -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); diff --git a/types/coinbase/index.d.ts b/types/coinbase/index.d.ts index 6057f58142..82fc32a7d3 100644 --- a/types/coinbase/index.d.ts +++ b/types/coinbase/index.d.ts @@ -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"; /**