coinbase-api 1.0.13 → 1.0.15-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/cjs/CBAdvancedTradeClient.js +1 -1
  2. package/dist/cjs/CBAdvancedTradeClient.js.map +1 -1
  3. package/dist/cjs/CBAppClient.d.ts +13 -8
  4. package/dist/cjs/CBAppClient.js +13 -41
  5. package/dist/cjs/CBAppClient.js.map +1 -1
  6. package/dist/cjs/CBInternationalClient.d.ts +0 -45
  7. package/dist/cjs/CBInternationalClient.js +0 -45
  8. package/dist/cjs/CBInternationalClient.js.map +1 -1
  9. package/dist/cjs/CBPrimeClient.d.ts +21 -128
  10. package/dist/cjs/CBPrimeClient.js +23 -160
  11. package/dist/cjs/CBPrimeClient.js.map +1 -1
  12. package/dist/cjs/lib/BaseRestClient.js +3 -5
  13. package/dist/cjs/lib/BaseRestClient.js.map +1 -1
  14. package/dist/cjs/lib/BaseWSClient.js +2 -2
  15. package/dist/cjs/lib/BaseWSClient.js.map +1 -1
  16. package/dist/cjs/lib/jwtNode.js +44 -0
  17. package/dist/cjs/lib/jwtNode.js.map +1 -1
  18. package/dist/cjs/lib/requestUtils.d.ts +1 -11
  19. package/dist/cjs/lib/requestUtils.js +9 -57
  20. package/dist/cjs/lib/requestUtils.js.map +1 -1
  21. package/dist/cjs/lib/websocket/websocket-util.d.ts +0 -6
  22. package/dist/cjs/lib/websocket/websocket-util.js +0 -19
  23. package/dist/cjs/lib/websocket/websocket-util.js.map +1 -1
  24. package/dist/cjs/types/request/advanced-trade-client.d.ts +0 -1
  25. package/dist/cjs/types/request/advanced-trade-client.js.map +1 -1
  26. package/dist/cjs/types/request/coinbase-app-client.d.ts +2 -19
  27. package/dist/cjs/types/request/coinbase-app-client.js.map +1 -1
  28. package/dist/cjs/types/request/coinbase-prime.d.ts +0 -66
  29. package/dist/cjs/types/response/coinbase-app-client.d.ts +2 -89
  30. package/dist/cjs/types/response/coinbase-app-client.js.map +1 -1
  31. package/dist/cjs/types/shared.types.d.ts +0 -8
  32. package/dist/mjs/CBAdvancedTradeClient.js +1 -1
  33. package/dist/mjs/CBAdvancedTradeClient.js.map +1 -1
  34. package/dist/mjs/CBAppClient.d.ts +13 -8
  35. package/dist/mjs/CBAppClient.js +14 -42
  36. package/dist/mjs/CBAppClient.js.map +1 -1
  37. package/dist/mjs/CBInternationalClient.d.ts +0 -45
  38. package/dist/mjs/CBInternationalClient.js +0 -45
  39. package/dist/mjs/CBInternationalClient.js.map +1 -1
  40. package/dist/mjs/CBPrimeClient.d.ts +21 -128
  41. package/dist/mjs/CBPrimeClient.js +23 -160
  42. package/dist/mjs/CBPrimeClient.js.map +1 -1
  43. package/dist/mjs/lib/BaseRestClient.js +3 -5
  44. package/dist/mjs/lib/BaseRestClient.js.map +1 -1
  45. package/dist/mjs/lib/BaseWSClient.js +3 -3
  46. package/dist/mjs/lib/BaseWSClient.js.map +1 -1
  47. package/dist/mjs/lib/jwtNode.js +44 -0
  48. package/dist/mjs/lib/jwtNode.js.map +1 -1
  49. package/dist/mjs/lib/requestUtils.d.ts +1 -11
  50. package/dist/mjs/lib/requestUtils.js +9 -56
  51. package/dist/mjs/lib/requestUtils.js.map +1 -1
  52. package/dist/mjs/lib/websocket/websocket-util.d.ts +0 -6
  53. package/dist/mjs/lib/websocket/websocket-util.js +0 -18
  54. package/dist/mjs/lib/websocket/websocket-util.js.map +1 -1
  55. package/dist/mjs/types/request/advanced-trade-client.d.ts +0 -1
  56. package/dist/mjs/types/request/advanced-trade-client.js.map +1 -1
  57. package/dist/mjs/types/request/coinbase-app-client.d.ts +2 -19
  58. package/dist/mjs/types/request/coinbase-app-client.js.map +1 -1
  59. package/dist/mjs/types/request/coinbase-prime.d.ts +0 -66
  60. package/dist/mjs/types/response/coinbase-app-client.d.ts +2 -89
  61. package/dist/mjs/types/response/coinbase-app-client.js.map +1 -1
  62. package/dist/mjs/types/shared.types.d.ts +0 -8
  63. package/package.json +7 -5
@@ -67,36 +67,18 @@ interface TransactionNetwork {
67
67
  status: string;
68
68
  name: string;
69
69
  hash?: string;
70
- transaction_fee?: TransactionAmount;
71
- transaction_amount?: TransactionAmount;
72
- network_name?: string;
73
- status_description?: string | null;
74
70
  }
75
71
  interface TransactionFrom {
76
72
  id: string;
77
73
  resource: string;
78
- resource_path?: string;
79
74
  }
80
75
  interface TransactionTo {
81
76
  resource: string;
82
- address?: string;
83
- email?: string;
84
- id?: string;
85
- resource_path?: string;
77
+ address: string;
86
78
  }
87
79
  interface TransactionDetails {
88
80
  title: string;
89
81
  subtitle: string;
90
- header?: string;
91
- health?: string;
92
- subsidebar_label?: string | null;
93
- }
94
- interface AdvancedTradeFill {
95
- fill_price: string;
96
- product_id: string;
97
- order_id: string;
98
- commission: string;
99
- order_side: 'BUY' | 'SELL';
100
82
  }
101
83
  export interface CBAppTransaction {
102
84
  id: string;
@@ -109,14 +91,10 @@ export interface CBAppTransaction {
109
91
  updated_at: string;
110
92
  resource: string;
111
93
  resource_path: string;
112
- network?: TransactionNetwork;
94
+ network: TransactionNetwork;
113
95
  from?: TransactionFrom;
114
96
  to?: TransactionTo;
115
97
  details?: TransactionDetails;
116
- instant_exchange?: boolean;
117
- advanced_trade_fill?: AdvancedTradeFill;
118
- cancelable?: boolean;
119
- idem?: string;
120
98
  }
121
99
  /**
122
100
  *
@@ -152,71 +130,6 @@ export interface CBAppDepositWithdrawal {
152
130
  fee: DepositWithdrawalAmountCurrency;
153
131
  payout_at: string;
154
132
  }
155
- interface TransferAmount {
156
- value: string;
157
- currency: string;
158
- }
159
- interface TransferOwner {
160
- id: string;
161
- uuid: string;
162
- user_uuid: string;
163
- type: string;
164
- }
165
- interface TransferLedgerAccount {
166
- account_id: string;
167
- currency: string;
168
- owner: TransferOwner;
169
- }
170
- interface TransferExternalPaymentMethod {
171
- payment_method_id: string;
172
- }
173
- interface TransferSource {
174
- type: string;
175
- network: string;
176
- payment_method_id: string;
177
- external_payment_method: TransferExternalPaymentMethod;
178
- }
179
- interface TransferTarget {
180
- type: string;
181
- network: string;
182
- payment_method_id: string;
183
- ledger_account: TransferLedgerAccount;
184
- }
185
- interface TransferFee {
186
- title: string;
187
- description: string;
188
- amount: TransferAmount;
189
- type: string;
190
- }
191
- export interface CBAppTransferDepositWithdrawal {
192
- user_entered_amount: TransferAmount;
193
- amount: TransferAmount;
194
- total: TransferAmount;
195
- subtotal: TransferAmount;
196
- idem: string;
197
- committed: boolean;
198
- id: string;
199
- instant: boolean;
200
- source: TransferSource;
201
- target: TransferTarget;
202
- payout_at: string;
203
- status: string;
204
- user_reference: string;
205
- type: string;
206
- created_at: string | null;
207
- updated_at: string | null;
208
- user_warnings: any[];
209
- fees: any[];
210
- total_fee: TransferFee;
211
- cancellation_reason: string | null;
212
- hold_days: number;
213
- nextStep: any | null;
214
- checkout_url: string;
215
- requires_completion_step: boolean;
216
- }
217
- export interface CBAppTransfer {
218
- transfer: CBAppTransferDepositWithdrawal;
219
- }
220
133
  /**
221
134
  *
222
135
  * DATA - Currencies Endpoints
@@ -1 +1 @@
1
- {"version":3,"file":"coinbase-app-client.js","sourceRoot":"","sources":["../../../../src/types/response/coinbase-app-client.ts"],"names":[],"mappings":";AA8QA;;;;GAIG;AAEH;;;;GAIG;AAEH;;;;GAIG"}
1
+ {"version":3,"file":"coinbase-app-client.js","sourceRoot":"","sources":["../../../../src/types/response/coinbase-app-client.ts"],"names":[],"mappings":";AA8KA;;;;GAIG;AAEH;;;;GAIG;AAEH;;;;GAIG"}
@@ -48,20 +48,12 @@ interface TriggerBracketGTD {
48
48
  stop_trigger_price: string;
49
49
  end_time: string;
50
50
  }
51
- interface TWAPLimitGTD {
52
- quote_size: string;
53
- base_size: string;
54
- start_time: string;
55
- end_time: string;
56
- limit_price: string;
57
- }
58
51
  export interface OrderConfiguration {
59
52
  market_market_ioc?: MarketMarketIOC;
60
53
  sor_limit_ioc?: SORLimitIOC;
61
54
  limit_limit_gtc?: LimitLimitGTC;
62
55
  limit_limit_gtd?: LimitLimitGTD;
63
56
  limit_limit_fok?: LimitLimitFOK;
64
- twap_limit_gtd?: TWAPLimitGTD;
65
57
  stop_limit_stop_limit_gtc?: StopLimitStopLimitGTC;
66
58
  stop_limit_stop_limit_gtd?: StopLimitStopLimitGTD;
67
59
  trigger_bracket_gtc?: TriggerBracketGTC;
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "coinbase-api",
3
- "version": "1.0.13",
3
+ "version": "1.0.15-beta.0",
4
4
  "description": "Node.js SDK for Coinbase's REST APIs and WebSockets, with TypeScript & strong end to end tests.",
5
5
  "scripts": {
6
6
  "clean": "rm -rf dist",
7
7
  "build": "npm run clean && tsc -p tsconfig.esm.json && tsc -p tsconfig.cjs.json && bash ./postBuild.sh",
8
- "test": "jest --passWithNoTests",
9
- "test:watch": "jest --watch --passWithNoTests"
8
+ "test": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' jest --passWithNoTests --config=jest.config.ts",
9
+ "test:watch:raw": "jest --watch --passWithNoTests",
10
+ "test:watch": "npm run test -- --watch",
11
+ "test:watch:v": "node --no-warnings --experimental-vm-modules $( [ -f ./node_modules/.bin/jest ] && echo ./node_modules/.bin/jest || which jest ) --watch --passWithNoTests",
12
+ "betapublish": "npm publish --tag beta"
10
13
  },
11
14
  "main": "dist/cjs/index.js",
12
15
  "module": "dist/mjs/index.js",
@@ -29,13 +32,12 @@
29
32
  "dependencies": {
30
33
  "axios": "^1.7.4",
31
34
  "isomorphic-ws": "^4.0.1",
32
- "jsonwebtoken": "^9.0.2",
35
+ "jose": "^6.0.11",
33
36
  "nanoid": "^3.3.7",
34
37
  "ws": "^7.4.0"
35
38
  },
36
39
  "devDependencies": {
37
40
  "@types/jest": "^29.5.12",
38
- "@types/jsonwebtoken": "^9.0.6",
39
41
  "@types/node": "^20.11.6",
40
42
  "@types/ws": "^8.5.10",
41
43
  "@typescript-eslint/eslint-plugin": "^7.1.0",