@shapeshiftoss/unchained-client 0.1.3 → 0.2.3

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 (74) hide show
  1. package/README.md +26 -0
  2. package/dist/generated/bitcoin/api.d.ts +482 -0
  3. package/dist/generated/bitcoin/api.d.ts.map +1 -0
  4. package/dist/generated/bitcoin/api.js +336 -0
  5. package/dist/generated/bitcoin/api.js.map +1 -0
  6. package/dist/generated/bitcoin/base.d.ts +56 -0
  7. package/dist/generated/bitcoin/base.d.ts.map +1 -0
  8. package/dist/generated/bitcoin/base.js +65 -0
  9. package/dist/generated/bitcoin/base.js.map +1 -0
  10. package/dist/generated/bitcoin/common.d.ts +66 -0
  11. package/dist/generated/bitcoin/common.d.ts.map +1 -0
  12. package/dist/generated/bitcoin/common.js +153 -0
  13. package/dist/generated/bitcoin/common.js.map +1 -0
  14. package/dist/generated/bitcoin/configuration.d.ts +84 -0
  15. package/dist/generated/bitcoin/configuration.d.ts.map +1 -0
  16. package/dist/generated/bitcoin/configuration.js +43 -0
  17. package/dist/generated/bitcoin/configuration.js.map +1 -0
  18. package/dist/generated/bitcoin/index.d.ts +14 -0
  19. package/dist/generated/bitcoin/index.d.ts.map +1 -0
  20. package/dist/generated/bitcoin/index.js +28 -0
  21. package/dist/generated/bitcoin/index.js.map +1 -0
  22. package/dist/generated/ethereum/api.d.ts +554 -0
  23. package/dist/generated/ethereum/api.d.ts.map +1 -0
  24. package/dist/generated/ethereum/api.js +465 -0
  25. package/dist/generated/ethereum/api.js.map +1 -0
  26. package/dist/{packages/client/src/generated → generated}/ethereum/base.d.ts +0 -0
  27. package/dist/generated/ethereum/base.d.ts.map +1 -0
  28. package/dist/{packages/client/src/generated → generated}/ethereum/base.js +0 -0
  29. package/dist/generated/ethereum/base.js.map +1 -0
  30. package/dist/{packages/client/src/generated → generated}/ethereum/common.d.ts +0 -0
  31. package/dist/generated/ethereum/common.d.ts.map +1 -0
  32. package/dist/{packages/client/src/generated → generated}/ethereum/common.js +0 -0
  33. package/dist/generated/ethereum/common.js.map +1 -0
  34. package/dist/{packages/client/src/generated → generated}/ethereum/configuration.d.ts +0 -0
  35. package/dist/generated/ethereum/configuration.d.ts.map +1 -0
  36. package/dist/{packages/client/src/generated → generated}/ethereum/configuration.js +0 -0
  37. package/dist/generated/ethereum/configuration.js.map +1 -0
  38. package/dist/{packages/client/src/generated → generated}/ethereum/index.d.ts +0 -0
  39. package/dist/generated/ethereum/index.d.ts.map +1 -0
  40. package/dist/{packages/client/src/generated → generated}/ethereum/index.js +0 -0
  41. package/dist/generated/ethereum/index.js.map +1 -0
  42. package/dist/index.d.ts +3 -0
  43. package/dist/index.d.ts.map +1 -0
  44. package/dist/{packages/client/src/index.js → index.js} +2 -5
  45. package/dist/index.js.map +1 -0
  46. package/dist/tsconfig.tsbuildinfo +78 -535
  47. package/package.json +3 -3
  48. package/dist/coinstacks/common/api/src/index.d.ts +0 -121
  49. package/dist/coinstacks/common/api/src/index.d.ts.map +0 -1
  50. package/dist/coinstacks/common/api/src/index.js +0 -63
  51. package/dist/coinstacks/common/api/src/index.js.map +0 -1
  52. package/dist/coinstacks/common/api/src/middleware.d.ts +0 -4
  53. package/dist/coinstacks/common/api/src/middleware.d.ts.map +0 -1
  54. package/dist/coinstacks/common/api/src/middleware.js +0 -39
  55. package/dist/coinstacks/common/api/src/middleware.js.map +0 -1
  56. package/dist/coinstacks/common/api/src/models.d.ts +0 -191
  57. package/dist/coinstacks/common/api/src/models.d.ts.map +0 -1
  58. package/dist/coinstacks/common/api/src/models.js +0 -3
  59. package/dist/coinstacks/common/api/src/models.js.map +0 -1
  60. package/dist/packages/client/src/generated/ethereum/api.d.ts +0 -1074
  61. package/dist/packages/client/src/generated/ethereum/api.d.ts.map +0 -1
  62. package/dist/packages/client/src/generated/ethereum/api.js +0 -806
  63. package/dist/packages/client/src/generated/ethereum/api.js.map +0 -1
  64. package/dist/packages/client/src/generated/ethereum/base.d.ts.map +0 -1
  65. package/dist/packages/client/src/generated/ethereum/base.js.map +0 -1
  66. package/dist/packages/client/src/generated/ethereum/common.d.ts.map +0 -1
  67. package/dist/packages/client/src/generated/ethereum/common.js.map +0 -1
  68. package/dist/packages/client/src/generated/ethereum/configuration.d.ts.map +0 -1
  69. package/dist/packages/client/src/generated/ethereum/configuration.js.map +0 -1
  70. package/dist/packages/client/src/generated/ethereum/index.d.ts.map +0 -1
  71. package/dist/packages/client/src/generated/ethereum/index.js.map +0 -1
  72. package/dist/packages/client/src/index.d.ts +0 -3
  73. package/dist/packages/client/src/index.d.ts.map +0 -1
  74. package/dist/packages/client/src/index.js.map +0 -1
package/README.md ADDED
@@ -0,0 +1,26 @@
1
+ # Unchained API Client
2
+
3
+ Provides a typescript axios client to interact with all supported unchained API's
4
+
5
+ ## Installing
6
+
7
+ Using npm:
8
+ ```
9
+ npm install @shapeshiftoss/unchained-client
10
+ ```
11
+
12
+ Using yarn:
13
+ ```
14
+ yarn add @shapeshiftoss/unchained-client
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ ```
20
+ import { Ethereum } from '@shapeshiftoss/unchained-client'
21
+
22
+ const config = new Ethereum.Configuration({ basePath: 'https://api.ethereum.shapeshift.com' })
23
+ const ethClient = new Ethereum.V1Api(config)
24
+
25
+ const { data } = await ethClient.getBalance({ pubkey: '0xB3DD70991aF983Cf82d95c46C24979ee98348ffa' })
26
+ ```
@@ -0,0 +1,482 @@
1
+ /**
2
+ * @shapeshiftoss/bitcoin-api
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: 0.1.1
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import { Configuration } from './configuration';
13
+ import { AxiosPromise, AxiosInstance } from 'axios';
14
+ import { RequestArgs, BaseAPI } from './base';
15
+ /**
16
+ * Contains info about a 400 Bad Request response
17
+ * @export
18
+ * @interface BadRequestError
19
+ */
20
+ export interface BadRequestError {
21
+ /**
22
+ *
23
+ * @type {string}
24
+ * @memberof BadRequestError
25
+ */
26
+ error: string;
27
+ }
28
+ /**
29
+ * Contains info about balance by pubkey (address or xpub)
30
+ * @export
31
+ * @interface Balance
32
+ */
33
+ export interface Balance {
34
+ /**
35
+ *
36
+ * @type {string}
37
+ * @memberof Balance
38
+ */
39
+ pubkey: string;
40
+ /**
41
+ *
42
+ * @type {string}
43
+ * @memberof Balance
44
+ */
45
+ balance: string;
46
+ }
47
+ /**
48
+ * Contains additional bitcoin specific balance info
49
+ * @export
50
+ * @interface BitcoinBalance
51
+ */
52
+ export interface BitcoinBalance {
53
+ /**
54
+ *
55
+ * @type {string}
56
+ * @memberof BitcoinBalance
57
+ */
58
+ pubkey: string;
59
+ /**
60
+ *
61
+ * @type {string}
62
+ * @memberof BitcoinBalance
63
+ */
64
+ balance: string;
65
+ /**
66
+ *
67
+ * @type {Array<Balance>}
68
+ * @memberof BitcoinBalance
69
+ */
70
+ addresses?: Array<Balance>;
71
+ }
72
+ /**
73
+ * Contains info about a 500 Internal Server Error response
74
+ * @export
75
+ * @interface InternalServerError
76
+ */
77
+ export interface InternalServerError {
78
+ /**
79
+ *
80
+ * @type {string}
81
+ * @memberof InternalServerError
82
+ */
83
+ message: string;
84
+ }
85
+ /**
86
+ * Contains the serialized raw transaction hex
87
+ * @export
88
+ * @interface SendTxBody
89
+ */
90
+ export interface SendTxBody {
91
+ /**
92
+ *
93
+ * @type {string}
94
+ * @memberof SendTxBody
95
+ */
96
+ hex: string;
97
+ }
98
+ /**
99
+ * Contains info about a transaction
100
+ * @export
101
+ * @interface Tx
102
+ */
103
+ export interface Tx {
104
+ /**
105
+ *
106
+ * @type {string}
107
+ * @memberof Tx
108
+ */
109
+ txid: string;
110
+ /**
111
+ *
112
+ * @type {string}
113
+ * @memberof Tx
114
+ */
115
+ status: string;
116
+ /**
117
+ *
118
+ * @type {string}
119
+ * @memberof Tx
120
+ */
121
+ blockHash?: string;
122
+ /**
123
+ *
124
+ * @type {number}
125
+ * @memberof Tx
126
+ */
127
+ blockHeight?: number;
128
+ /**
129
+ *
130
+ * @type {number}
131
+ * @memberof Tx
132
+ */
133
+ confirmations?: number;
134
+ /**
135
+ *
136
+ * @type {number}
137
+ * @memberof Tx
138
+ */
139
+ timestamp?: number;
140
+ /**
141
+ *
142
+ * @type {string}
143
+ * @memberof Tx
144
+ */
145
+ from: string;
146
+ /**
147
+ *
148
+ * @type {string}
149
+ * @memberof Tx
150
+ */
151
+ to?: string;
152
+ /**
153
+ *
154
+ * @type {string}
155
+ * @memberof Tx
156
+ */
157
+ value: string;
158
+ /**
159
+ *
160
+ * @type {string}
161
+ * @memberof Tx
162
+ */
163
+ fee: string;
164
+ }
165
+ /**
166
+ * Contains paginated transaction history
167
+ * @export
168
+ * @interface TxHistory
169
+ */
170
+ export interface TxHistory {
171
+ /**
172
+ *
173
+ * @type {number}
174
+ * @memberof TxHistory
175
+ */
176
+ page: number;
177
+ /**
178
+ *
179
+ * @type {number}
180
+ * @memberof TxHistory
181
+ */
182
+ totalPages: number;
183
+ /**
184
+ *
185
+ * @type {number}
186
+ * @memberof TxHistory
187
+ */
188
+ txs: number;
189
+ /**
190
+ *
191
+ * @type {Array<Tx>}
192
+ * @memberof TxHistory
193
+ */
194
+ transactions: Array<Tx>;
195
+ }
196
+ /**
197
+ * Contains info about an unspent transaction output
198
+ * @export
199
+ * @interface Utxo
200
+ */
201
+ export interface Utxo {
202
+ /**
203
+ *
204
+ * @type {string}
205
+ * @memberof Utxo
206
+ */
207
+ address: string;
208
+ /**
209
+ *
210
+ * @type {number}
211
+ * @memberof Utxo
212
+ */
213
+ confirmations: number;
214
+ /**
215
+ *
216
+ * @type {string}
217
+ * @memberof Utxo
218
+ */
219
+ txid: string;
220
+ /**
221
+ *
222
+ * @type {string}
223
+ * @memberof Utxo
224
+ */
225
+ value: string;
226
+ /**
227
+ *
228
+ * @type {number}
229
+ * @memberof Utxo
230
+ */
231
+ vout: number;
232
+ }
233
+ /**
234
+ * Contains info about a 422 Validation Error response
235
+ * @export
236
+ * @interface ValidationError
237
+ */
238
+ export interface ValidationError {
239
+ /**
240
+ *
241
+ * @type {string}
242
+ * @memberof ValidationError
243
+ */
244
+ message: ValidationErrorMessageEnum;
245
+ /**
246
+ *
247
+ * @type {{ [key: string]: any; }}
248
+ * @memberof ValidationError
249
+ */
250
+ details: {
251
+ [key: string]: any;
252
+ };
253
+ }
254
+ /**
255
+ * @export
256
+ * @enum {string}
257
+ */
258
+ export declare enum ValidationErrorMessageEnum {
259
+ ValidationFailed = "Validation failed"
260
+ }
261
+ /**
262
+ * V1Api - axios parameter creator
263
+ * @export
264
+ */
265
+ export declare const V1ApiAxiosParamCreator: (configuration?: Configuration | undefined) => {
266
+ /**
267
+ * Get balance of a pubkey Examples 1. Bitcoin (address) 2. Bitcoin (xpub)
268
+ * @param {string} pubkey account pubkey
269
+ * @param {*} [options] Override http request option.
270
+ * @throws {RequiredError}
271
+ */
272
+ getBalance: (pubkey: string, options?: any) => Promise<RequestArgs>;
273
+ /**
274
+ * Get transaction history of a pubkey
275
+ * @param {string} address
276
+ * @param {number} [page] page number
277
+ * @param {number} [pageSize] page size
278
+ * @param {string} [contract] filter by contract address (only supported by coins which support contracts)
279
+ * @param {*} [options] Override http request option.
280
+ * @throws {RequiredError}
281
+ */
282
+ getTxHistory: (address: string, page?: number | undefined, pageSize?: number | undefined, contract?: string | undefined, options?: any) => Promise<RequestArgs>;
283
+ /**
284
+ * Get all unspent transaction outputs for a pubkey
285
+ * @param {string} pubkey account pubkey
286
+ * @param {*} [options] Override http request option.
287
+ * @throws {RequiredError}
288
+ */
289
+ getUtxos: (pubkey: string, options?: any) => Promise<RequestArgs>;
290
+ /**
291
+ * Sends raw transaction to be broadcast to the node.
292
+ * @param {SendTxBody} sendTxBody serialized raw transaction hex
293
+ * @param {*} [options] Override http request option.
294
+ * @throws {RequiredError}
295
+ */
296
+ sendTx: (sendTxBody: SendTxBody, options?: any) => Promise<RequestArgs>;
297
+ };
298
+ /**
299
+ * V1Api - functional programming interface
300
+ * @export
301
+ */
302
+ export declare const V1ApiFp: (configuration?: Configuration | undefined) => {
303
+ /**
304
+ * Get balance of a pubkey Examples 1. Bitcoin (address) 2. Bitcoin (xpub)
305
+ * @param {string} pubkey account pubkey
306
+ * @param {*} [options] Override http request option.
307
+ * @throws {RequiredError}
308
+ */
309
+ getBalance(pubkey: string, options?: any): Promise<(axios?: AxiosInstance | undefined, basePath?: string | undefined) => AxiosPromise<BitcoinBalance>>;
310
+ /**
311
+ * Get transaction history of a pubkey
312
+ * @param {string} address
313
+ * @param {number} [page] page number
314
+ * @param {number} [pageSize] page size
315
+ * @param {string} [contract] filter by contract address (only supported by coins which support contracts)
316
+ * @param {*} [options] Override http request option.
317
+ * @throws {RequiredError}
318
+ */
319
+ getTxHistory(address: string, page?: number | undefined, pageSize?: number | undefined, contract?: string | undefined, options?: any): Promise<(axios?: AxiosInstance | undefined, basePath?: string | undefined) => AxiosPromise<TxHistory>>;
320
+ /**
321
+ * Get all unspent transaction outputs for a pubkey
322
+ * @param {string} pubkey account pubkey
323
+ * @param {*} [options] Override http request option.
324
+ * @throws {RequiredError}
325
+ */
326
+ getUtxos(pubkey: string, options?: any): Promise<(axios?: AxiosInstance | undefined, basePath?: string | undefined) => AxiosPromise<Array<Utxo>>>;
327
+ /**
328
+ * Sends raw transaction to be broadcast to the node.
329
+ * @param {SendTxBody} sendTxBody serialized raw transaction hex
330
+ * @param {*} [options] Override http request option.
331
+ * @throws {RequiredError}
332
+ */
333
+ sendTx(sendTxBody: SendTxBody, options?: any): Promise<(axios?: AxiosInstance | undefined, basePath?: string | undefined) => AxiosPromise<string>>;
334
+ };
335
+ /**
336
+ * V1Api - factory interface
337
+ * @export
338
+ */
339
+ export declare const V1ApiFactory: (configuration?: Configuration | undefined, basePath?: string | undefined, axios?: AxiosInstance | undefined) => {
340
+ /**
341
+ * Get balance of a pubkey Examples 1. Bitcoin (address) 2. Bitcoin (xpub)
342
+ * @param {string} pubkey account pubkey
343
+ * @param {*} [options] Override http request option.
344
+ * @throws {RequiredError}
345
+ */
346
+ getBalance(pubkey: string, options?: any): AxiosPromise<BitcoinBalance>;
347
+ /**
348
+ * Get transaction history of a pubkey
349
+ * @param {string} address
350
+ * @param {number} [page] page number
351
+ * @param {number} [pageSize] page size
352
+ * @param {string} [contract] filter by contract address (only supported by coins which support contracts)
353
+ * @param {*} [options] Override http request option.
354
+ * @throws {RequiredError}
355
+ */
356
+ getTxHistory(address: string, page?: number | undefined, pageSize?: number | undefined, contract?: string | undefined, options?: any): AxiosPromise<TxHistory>;
357
+ /**
358
+ * Get all unspent transaction outputs for a pubkey
359
+ * @param {string} pubkey account pubkey
360
+ * @param {*} [options] Override http request option.
361
+ * @throws {RequiredError}
362
+ */
363
+ getUtxos(pubkey: string, options?: any): AxiosPromise<Array<Utxo>>;
364
+ /**
365
+ * Sends raw transaction to be broadcast to the node.
366
+ * @param {SendTxBody} sendTxBody serialized raw transaction hex
367
+ * @param {*} [options] Override http request option.
368
+ * @throws {RequiredError}
369
+ */
370
+ sendTx(sendTxBody: SendTxBody, options?: any): AxiosPromise<string>;
371
+ };
372
+ /**
373
+ * Request parameters for getBalance operation in V1Api.
374
+ * @export
375
+ * @interface V1ApiGetBalanceRequest
376
+ */
377
+ export interface V1ApiGetBalanceRequest {
378
+ /**
379
+ * account pubkey
380
+ * @type {string}
381
+ * @memberof V1ApiGetBalance
382
+ */
383
+ readonly pubkey: string;
384
+ }
385
+ /**
386
+ * Request parameters for getTxHistory operation in V1Api.
387
+ * @export
388
+ * @interface V1ApiGetTxHistoryRequest
389
+ */
390
+ export interface V1ApiGetTxHistoryRequest {
391
+ /**
392
+ *
393
+ * @type {string}
394
+ * @memberof V1ApiGetTxHistory
395
+ */
396
+ readonly address: string;
397
+ /**
398
+ * page number
399
+ * @type {number}
400
+ * @memberof V1ApiGetTxHistory
401
+ */
402
+ readonly page?: number;
403
+ /**
404
+ * page size
405
+ * @type {number}
406
+ * @memberof V1ApiGetTxHistory
407
+ */
408
+ readonly pageSize?: number;
409
+ /**
410
+ * filter by contract address (only supported by coins which support contracts)
411
+ * @type {string}
412
+ * @memberof V1ApiGetTxHistory
413
+ */
414
+ readonly contract?: string;
415
+ }
416
+ /**
417
+ * Request parameters for getUtxos operation in V1Api.
418
+ * @export
419
+ * @interface V1ApiGetUtxosRequest
420
+ */
421
+ export interface V1ApiGetUtxosRequest {
422
+ /**
423
+ * account pubkey
424
+ * @type {string}
425
+ * @memberof V1ApiGetUtxos
426
+ */
427
+ readonly pubkey: string;
428
+ }
429
+ /**
430
+ * Request parameters for sendTx operation in V1Api.
431
+ * @export
432
+ * @interface V1ApiSendTxRequest
433
+ */
434
+ export interface V1ApiSendTxRequest {
435
+ /**
436
+ * serialized raw transaction hex
437
+ * @type {SendTxBody}
438
+ * @memberof V1ApiSendTx
439
+ */
440
+ readonly sendTxBody: SendTxBody;
441
+ }
442
+ /**
443
+ * V1Api - object-oriented interface
444
+ * @export
445
+ * @class V1Api
446
+ * @extends {BaseAPI}
447
+ */
448
+ export declare class V1Api extends BaseAPI {
449
+ /**
450
+ * Get balance of a pubkey Examples 1. Bitcoin (address) 2. Bitcoin (xpub)
451
+ * @param {V1ApiGetBalanceRequest} requestParameters Request parameters.
452
+ * @param {*} [options] Override http request option.
453
+ * @throws {RequiredError}
454
+ * @memberof V1Api
455
+ */
456
+ getBalance(requestParameters: V1ApiGetBalanceRequest, options?: any): Promise<import("axios").AxiosResponse<BitcoinBalance>>;
457
+ /**
458
+ * Get transaction history of a pubkey
459
+ * @param {V1ApiGetTxHistoryRequest} requestParameters Request parameters.
460
+ * @param {*} [options] Override http request option.
461
+ * @throws {RequiredError}
462
+ * @memberof V1Api
463
+ */
464
+ getTxHistory(requestParameters: V1ApiGetTxHistoryRequest, options?: any): Promise<import("axios").AxiosResponse<TxHistory>>;
465
+ /**
466
+ * Get all unspent transaction outputs for a pubkey
467
+ * @param {V1ApiGetUtxosRequest} requestParameters Request parameters.
468
+ * @param {*} [options] Override http request option.
469
+ * @throws {RequiredError}
470
+ * @memberof V1Api
471
+ */
472
+ getUtxos(requestParameters: V1ApiGetUtxosRequest, options?: any): Promise<import("axios").AxiosResponse<Utxo[]>>;
473
+ /**
474
+ * Sends raw transaction to be broadcast to the node.
475
+ * @param {V1ApiSendTxRequest} requestParameters Request parameters.
476
+ * @param {*} [options] Override http request option.
477
+ * @throws {RequiredError}
478
+ * @memberof V1Api
479
+ */
480
+ sendTx(requestParameters: V1ApiSendTxRequest, options?: any): Promise<import("axios").AxiosResponse<string>>;
481
+ }
482
+ //# sourceMappingURL=api.d.ts.map