From 6d9de2a5d985e2dd8c7fa94505ab3ee7875e1f51 Mon Sep 17 00:00:00 2001 From: Benny Neugebauer Date: Sat, 26 Jan 2019 21:40:46 +0100 Subject: [PATCH 01/10] Add info about native balance --- types/coinbase/index.d.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/types/coinbase/index.d.ts b/types/coinbase/index.d.ts index 6057f58142..6731ff3a79 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 native balance. + */ + native_balance: MoneyHash; + /** * Promote an account as primary account. * Scope: wallet:accounts:update From 4962cb4cfdda1122a9efcda11f1ad87927f38561 Mon Sep 17 00:00:00 2001 From: Benny Neugebauer Date: Sat, 26 Jan 2019 21:44:46 +0100 Subject: [PATCH 02/10] v2.0.8 --- types/coinbase/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/coinbase/index.d.ts b/types/coinbase/index.d.ts index 6731ff3a79..1ef91bbcbb 100644 --- a/types/coinbase/index.d.ts +++ b/types/coinbase/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for coinbase 2.0 +// Type definitions for coinbase 2.0.8 // Project: https://github.com/coinbase/coinbase-node // Definitions by: Rogier Schouten // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 7e7b62dfcc7f8a19a7c610f85b3e25ba46ccf5f9 Mon Sep 17 00:00:00 2001 From: Benny Neugebauer Date: Sat, 26 Jan 2019 21:51:10 +0100 Subject: [PATCH 03/10] Update index.d.ts --- types/coinbase/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/coinbase/index.d.ts b/types/coinbase/index.d.ts index 1ef91bbcbb..6731ff3a79 100644 --- a/types/coinbase/index.d.ts +++ b/types/coinbase/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for coinbase 2.0.8 +// Type definitions for coinbase 2.0 // Project: https://github.com/coinbase/coinbase-node // Definitions by: Rogier Schouten // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 324fab550d52313b7862f8d1ffc68974cbfc7b56 Mon Sep 17 00:00:00 2001 From: Benny Neugebauer Date: Sat, 26 Jan 2019 22:38:58 +0100 Subject: [PATCH 04/10] Update index.d.ts --- types/coinbase/index.d.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/types/coinbase/index.d.ts b/types/coinbase/index.d.ts index 6731ff3a79..27768610a2 100644 --- a/types/coinbase/index.d.ts +++ b/types/coinbase/index.d.ts @@ -547,7 +547,7 @@ export class Account implements Resource { allow_withdrawals: boolean; /** - * Account worth in native balance. + * Account worth in fiat. */ native_balance: MoneyHash; @@ -914,6 +914,11 @@ export class Buy implements Resource { * When a buy isn’t executed instantly, it will receive a payout date for the time it will be executed. ISO timestamp */ payout_at?: string; + + /** + * Transaction worth in fiat. + */ + native_balance: MoneyHash; /** * Completes a buy that is created in commit: false state. From 64100c212e1bf27066caea74ac636af66942dd48 Mon Sep 17 00:00:00 2001 From: Benny Neugebauer Date: Sat, 26 Jan 2019 22:45:47 +0100 Subject: [PATCH 05/10] Update index.d.ts --- types/coinbase/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/coinbase/index.d.ts b/types/coinbase/index.d.ts index 27768610a2..e30a049b15 100644 --- a/types/coinbase/index.d.ts +++ b/types/coinbase/index.d.ts @@ -914,7 +914,7 @@ export class Buy implements Resource { * When a buy isn’t executed instantly, it will receive a payout date for the time it will be executed. ISO timestamp */ payout_at?: string; - + /** * Transaction worth in fiat. */ From 5f07f4ebc9a5f2e135e19359efd83d7b44255fa0 Mon Sep 17 00:00:00 2001 From: Benny Neugebauer Date: Sat, 26 Jan 2019 22:52:17 +0100 Subject: [PATCH 06/10] Update index.d.ts --- types/coinbase/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/coinbase/index.d.ts b/types/coinbase/index.d.ts index e30a049b15..e92fcef8e7 100644 --- a/types/coinbase/index.d.ts +++ b/types/coinbase/index.d.ts @@ -645,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. From f55a8706f0309b3add7e8ce3f8505ce953c53de7 Mon Sep 17 00:00:00 2001 From: Benny Neugebauer Date: Sun, 27 Jan 2019 19:52:15 +0100 Subject: [PATCH 07/10] Update index.d.ts --- types/coinbase/index.d.ts | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/types/coinbase/index.d.ts b/types/coinbase/index.d.ts index e92fcef8e7..5f9f8682f0 100644 --- a/types/coinbase/index.d.ts +++ b/types/coinbase/index.d.ts @@ -898,7 +898,7 @@ export class Buy implements Resource { /** * Fee associated to this buy */ - fee: MoneyHash; + fees: Fee[]; /** * Has this buy been committed? @@ -915,10 +915,13 @@ export class Buy implements Resource { */ payout_at?: string; - /** - * Transaction worth in fiat. - */ - native_balance: MoneyHash; + unit_price: UnitPrice; + + hold_business_days: number; + + is_first_buy: boolean; + + requires_completion_step: boolean; /** * Completes a buy that is created in commit: false state. @@ -930,6 +933,17 @@ export class Buy implements Resource { commit(cb: (error: Error, transaction: Buy) => void): void; } +export interface Fee { + amount: string; + type: string; +} + +export interface UnitPrice { + amount: string; + currency: string; + scale: number; +} + export type SellStatus = "created" | "completed" | "canceled"; /** From 1eabe68093f538e2d6b4b7501430ef012f884207 Mon Sep 17 00:00:00 2001 From: Benny Neugebauer Date: Mon, 28 Jan 2019 08:39:02 +0100 Subject: [PATCH 08/10] Fix tests --- types/coinbase/coinbase-tests.ts | 2 +- types/coinbase/index.d.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/coinbase/coinbase-tests.ts b/types/coinbase/coinbase-tests.ts index fb804ac566..e7d53012d7 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); diff --git a/types/coinbase/index.d.ts b/types/coinbase/index.d.ts index 5f9f8682f0..4580179195 100644 --- a/types/coinbase/index.d.ts +++ b/types/coinbase/index.d.ts @@ -918,9 +918,9 @@ export class Buy implements Resource { unit_price: UnitPrice; hold_business_days: number; - + is_first_buy: boolean; - + requires_completion_step: boolean; /** From fb63f59f6b6364cb7d7861e4b022bb2c120e69fc Mon Sep 17 00:00:00 2001 From: Benny Neugebauer Date: Tue, 29 Jan 2019 08:16:59 +0100 Subject: [PATCH 09/10] getSells --- types/coinbase/coinbase-tests.ts | 2 +- types/coinbase/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/coinbase/coinbase-tests.ts b/types/coinbase/coinbase-tests.ts index e7d53012d7..65ec9693bd 100644 --- a/types/coinbase/coinbase-tests.ts +++ b/types/coinbase/coinbase-tests.ts @@ -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 4580179195..1e94f04295 100644 --- a/types/coinbase/index.d.ts +++ b/types/coinbase/index.d.ts @@ -678,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. From ea9401ad865543ea29901d650c295203c0c9c3b8 Mon Sep 17 00:00:00 2001 From: Benny Neugebauer Date: Wed, 30 Jan 2019 00:17:32 +0100 Subject: [PATCH 10/10] Added documentation --- types/coinbase/index.d.ts | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/types/coinbase/index.d.ts b/types/coinbase/index.d.ts index 1e94f04295..82fc32a7d3 100644 --- a/types/coinbase/index.d.ts +++ b/types/coinbase/index.d.ts @@ -915,12 +915,24 @@ 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; /** @@ -934,13 +946,28 @@ export class Buy implements Resource { } export interface Fee { - amount: string; + /** + * 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; }