@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/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@shapeshiftoss/unchained-client",
3
- "version": "0.1.3",
3
+ "version": "0.2.3",
4
4
  "license": "MIT",
5
- "main": "dist/packages/client/src/index.js",
5
+ "main": "dist/index.js",
6
6
  "source": "src/index.ts",
7
- "types": "dist/packages/client/src/index.d.ts",
7
+ "types": "dist/index.d.ts",
8
8
  "files": [
9
9
  "dist"
10
10
  ],
@@ -1,121 +0,0 @@
1
- import { Controller } from 'tsoa';
2
- import { RegistryDocument } from '@shapeshiftoss/common-mongo';
3
- import { Balance, BalanceChange, Block, RawTx, Tx, TxHistory, TxReceipt, Utxo } from './models';
4
- export * from './models';
5
- export * as middleware from './middleware';
6
- export declare type Interval = 'weekly' | 'daily' | 'hourly' | '30min' | '15min' | '10min' | '5min' | '1min';
7
- export declare const intervals: {
8
- weekly: number;
9
- daily: number;
10
- hourly: number;
11
- '30min': number;
12
- '15min': number;
13
- '10min': number;
14
- '5min': number;
15
- '1min': number;
16
- };
17
- /**
18
- * Generic api error for handling failed requests
19
- */
20
- export declare class ApiError extends Error {
21
- statusCode: number;
22
- constructor(name: string, statusCode: number, message?: string);
23
- }
24
- /**
25
- * Common API implementation which all coinstack OpenAPI Controllers must conform to.
26
- *
27
- * The route path is described in the comment before each api function.
28
- *
29
- * Typescript is unable to enforce decorators on abstract functions and also will not enforce more than the first argument for each function. Please ensure these match when adding a new coinstack api, or update all coinstack api implementations on any changes to the abstract class.
30
- */
31
- export declare abstract class CommonAPI extends Controller {
32
- /**
33
- * Get balance returns the balance of an address
34
- *
35
- * @param {string} address account address
36
- *
37
- * @returns {Promise<Balance>} account balance
38
- */
39
- abstract getBalance(address: string): Promise<Balance>;
40
- /**
41
- * Get balance history returns the balance history of an address
42
- *
43
- * @param {string} address account address
44
- * @param {Interval} interval range to group by
45
- * @param {number} [start] start date as unix timestamp
46
- * @param {number} [end] end date as unix timestamp
47
- *
48
- * @returns {Promise<Array<BalanceChange>>} balance change history
49
- */
50
- abstract getBalanceHistory(address: string, interval: Interval, from?: number, to?: number): Promise<Array<BalanceChange>>;
51
- /**
52
- * Get block returns data about a block
53
- *
54
- * @param {(number|string)} block height or hash
55
- *
56
- * @returns {Promise<Block>} block data
57
- */
58
- abstract getBlock(block: number | string): Promise<Block>;
59
- /**
60
- * Get transaction returns data about a transaction
61
- *
62
- * @param {string} txid transaction id
63
- *
64
- * @returns {Promise<Tx>} transaction data
65
- */
66
- abstract getTx(txid: string): Promise<Tx>;
67
- /**
68
- * Get the current fee price (ex. gas price, sats/byte) from the network node.
69
- *
70
- * @returns {Promise<string>} current fee price for chain for next block confirmation
71
- *
72
- */
73
- abstract getFeePrice(): Promise<string>;
74
- /**
75
- * Get transaction history returns the transaction history of an address
76
- *
77
- * @param {string} address account address
78
- * @param {number} [page] page number
79
- * @param {number} [pageSize] page number
80
- * @param {string} [contract] filter by contract address (only supported by coins which support contracts)
81
- *
82
- * @returns {Promise<TxHistory>} transaction history
83
- */
84
- abstract getTxHistory(address: string, page?: number, pageSize?: number, contract?: string): Promise<TxHistory>;
85
- /**
86
- * Register addresses for tracking incoming pending transactions and newly confirmed transactions
87
- *
88
- * @param {RegistryDocument} document Contains a list of addresses to register for a client id
89
- *
90
- * @returns {Promise<void>}
91
- */
92
- abstract register(document: RegistryDocument): Promise<void>;
93
- /**
94
- * Unregister addresses to stop tracking incoming pending transactions and newly confirmed transactions
95
- *
96
- * @param {RegistryDocument} document Contains a list of addresses to unregister for a client id. If no addresses are provided, all addresses will be unregistered.
97
- *
98
- * @returns {Promise<void>}
99
- */
100
- abstract unregister(document: RegistryDocument): Promise<void>;
101
- /**
102
- * Sends raw transaction to be broadcast to the node.
103
- *
104
- * @param {RawTx} rawTx serialized raw transaction hex
105
- *
106
- * @returns {Promise<TxReceipt>} transaction receipt
107
- */
108
- abstract sendTx(rawTx: RawTx): Promise<TxReceipt>;
109
- }
110
- export declare abstract class UtxoCommonAPI extends CommonAPI {
111
- /**
112
- * Get Utxo returns an array of unspent transaction outputs of address or xpub.
113
- *
114
- * @param {string} account address or xpub
115
- * @param {boolean} confirmed return confirmed and/or unconfirmed transactions
116
- *
117
- * @returns {Promise<Array<Utxo>>} utxo list
118
- */
119
- abstract getUtxo(account: string): Promise<Array<Utxo>>;
120
- }
121
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../coinstacks/common/api/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAC9D,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAE/F,cAAc,UAAU,CAAA;AACxB,OAAO,KAAK,UAAU,MAAM,cAAc,CAAA;AAE1C,oBAAY,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;AAEpG,eAAO,MAAM,SAAS;;;;;;;;;CASrB,CAAA;AAED;;GAEG;AACH,qBAAa,QAAS,SAAQ,KAAK;IACjC,UAAU,EAAE,MAAM,CAAA;gBACN,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;CAK/D;AAED;;;;;;GAMG;AACH,8BAAsB,SAAU,SAAQ,UAAU;IAChD;;;;;;OAMG;IAEH,QAAQ,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAEtD;;;;;;;;;OASG;IAEH,QAAQ,CAAC,iBAAiB,CACxB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,QAAQ,EAClB,IAAI,CAAC,EAAE,MAAM,EACb,EAAE,CAAC,EAAE,MAAM,GACV,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IAEhC;;;;;;OAMG;IAEH,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;IAEzD;;;;;;OAMG;IAEH,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,EAAE,CAAC;IAEzC;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAEvC;;;;;;;;;OASG;IAEH,QAAQ,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAE/G;;;;;;OAMG;IAEH,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAE5D;;;;;;OAMG;IAEH,QAAQ,CAAC,UAAU,CAAC,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAE9D;;;;;;OAMG;IAEH,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC;CAClD;AAED,8BAAsB,aAAc,SAAQ,SAAS;IACnD;;;;;;;OAOG;IAEH,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;CACxD"}
@@ -1,63 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
- };
17
- var __importStar = (this && this.__importStar) || function (mod) {
18
- if (mod && mod.__esModule) return mod;
19
- var result = {};
20
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
21
- __setModuleDefault(result, mod);
22
- return result;
23
- };
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.UtxoCommonAPI = exports.CommonAPI = exports.ApiError = exports.intervals = exports.middleware = void 0;
26
- const tsoa_1 = require("tsoa");
27
- __exportStar(require("./models"), exports);
28
- exports.middleware = __importStar(require("./middleware"));
29
- exports.intervals = {
30
- weekly: 60 * 60 * 24 * 7,
31
- daily: 60 * 60 * 24,
32
- hourly: 60 * 60,
33
- '30min': 60 * 30,
34
- '15min': 60 * 15,
35
- '10min': 60 * 10,
36
- '5min': 60 * 5,
37
- '1min': 60 * 1,
38
- };
39
- /**
40
- * Generic api error for handling failed requests
41
- */
42
- class ApiError extends Error {
43
- constructor(name, statusCode, message) {
44
- super(message);
45
- this.name = name;
46
- this.statusCode = statusCode;
47
- }
48
- }
49
- exports.ApiError = ApiError;
50
- /**
51
- * Common API implementation which all coinstack OpenAPI Controllers must conform to.
52
- *
53
- * The route path is described in the comment before each api function.
54
- *
55
- * Typescript is unable to enforce decorators on abstract functions and also will not enforce more than the first argument for each function. Please ensure these match when adding a new coinstack api, or update all coinstack api implementations on any changes to the abstract class.
56
- */
57
- class CommonAPI extends tsoa_1.Controller {
58
- }
59
- exports.CommonAPI = CommonAPI;
60
- class UtxoCommonAPI extends CommonAPI {
61
- }
62
- exports.UtxoCommonAPI = UtxoCommonAPI;
63
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../coinstacks/common/api/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAiC;AAIjC,2CAAwB;AACxB,2DAA0C;AAI7B,QAAA,SAAS,GAAG;IACvB,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IACxB,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE;IACnB,MAAM,EAAE,EAAE,GAAG,EAAE;IACf,OAAO,EAAE,EAAE,GAAG,EAAE;IAChB,OAAO,EAAE,EAAE,GAAG,EAAE;IAChB,OAAO,EAAE,EAAE,GAAG,EAAE;IAChB,MAAM,EAAE,EAAE,GAAG,CAAC;IACd,MAAM,EAAE,EAAE,GAAG,CAAC;CACf,CAAA;AAED;;GAEG;AACH,MAAa,QAAS,SAAQ,KAAK;IAEjC,YAAY,IAAY,EAAE,UAAkB,EAAE,OAAgB;QAC5D,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;IAC9B,CAAC;CACF;AAPD,4BAOC;AAED;;;;;;GAMG;AACH,MAAsB,SAAU,SAAQ,iBAAU;CAmGjD;AAnGD,8BAmGC;AAED,MAAsB,aAAc,SAAQ,SAAS;CAWpD;AAXD,sCAWC"}
@@ -1,4 +0,0 @@
1
- import { NextFunction, Response, Request } from 'express';
2
- export declare function errorHandler(err: Error, req: Request, res: Response, next: NextFunction): Response | void;
3
- export declare function notFoundHandler(_req: Request, res: Response): void;
4
- //# sourceMappingURL=middleware.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../../../../../../coinstacks/common/api/src/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAIzD,wBAAgB,YAAY,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,GAAG,QAAQ,GAAG,IAAI,CA+BzG;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,IAAI,CAMlE"}
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.notFoundHandler = exports.errorHandler = void 0;
4
- const tsoa_1 = require("tsoa");
5
- const _1 = require(".");
6
- function errorHandler(err, req, res, next) {
7
- if (err.constructor.name === tsoa_1.ValidateError.prototype.constructor.name) {
8
- const e = err;
9
- console.warn(`Caught Validation Error for ${req.path}:`, e.fields);
10
- return res.status(422).json({
11
- message: 'Validation Failed',
12
- details: e.fields,
13
- });
14
- }
15
- if (err instanceof _1.ApiError) {
16
- return res.status(err.statusCode).json(JSON.parse(err.message));
17
- }
18
- if (err instanceof SyntaxError) {
19
- return res.status(400).json({
20
- message: err.message,
21
- });
22
- }
23
- if (err instanceof Error) {
24
- console.error(err);
25
- return res.status(500).json({
26
- message: 'Internal Server Error',
27
- });
28
- }
29
- next();
30
- }
31
- exports.errorHandler = errorHandler;
32
- function notFoundHandler(_req, res) {
33
- const err = {
34
- message: 'Not Found',
35
- };
36
- res.status(404).send(err);
37
- }
38
- exports.notFoundHandler = notFoundHandler;
39
- //# sourceMappingURL=middleware.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../../../../../../coinstacks/common/api/src/middleware.ts"],"names":[],"mappings":";;;AACA,+BAAoC;AACpC,wBAA2C;AAE3C,SAAgB,YAAY,CAAC,GAAU,EAAE,GAAY,EAAE,GAAa,EAAE,IAAkB;IACtF,IAAI,GAAG,CAAC,WAAW,CAAC,IAAI,KAAK,oBAAa,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE;QACrE,MAAM,CAAC,GAAG,GAAoB,CAAA;QAE9B,OAAO,CAAC,IAAI,CAAC,+BAA+B,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,CAAA;QAElE,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;YAC1B,OAAO,EAAE,mBAAmB;YAC5B,OAAO,EAAE,CAAC,CAAC,MAAM;SAClB,CAAC,CAAA;KACH;IAED,IAAI,GAAG,YAAY,WAAQ,EAAE;QAC3B,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAA;KAChE;IAED,IAAI,GAAG,YAAY,WAAW,EAAE;QAC9B,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;YAC1B,OAAO,EAAE,GAAG,CAAC,OAAO;SACrB,CAAC,CAAA;KACH;IAED,IAAI,GAAG,YAAY,KAAK,EAAE;QACxB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAElB,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;YAC1B,OAAO,EAAE,uBAAuB;SACjC,CAAC,CAAA;KACH;IAED,IAAI,EAAE,CAAA;AACR,CAAC;AA/BD,oCA+BC;AAED,SAAgB,eAAe,CAAC,IAAa,EAAE,GAAa;IAC1D,MAAM,GAAG,GAAkB;QACzB,OAAO,EAAE,WAAW;KACrB,CAAA;IAED,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC3B,CAAC;AAND,0CAMC"}
@@ -1,191 +0,0 @@
1
- /**
2
- * Contains info about a 400 Bad Request response
3
- */
4
- export interface BadRequestError {
5
- error: string;
6
- }
7
- /**
8
- * Contains info about a 404 Not Found response
9
- */
10
- export interface NotFoundError {
11
- message: string;
12
- }
13
- /**
14
- * Contains info about a 422 Validation Error response
15
- */
16
- export interface ValidationError {
17
- message: 'Validation failed';
18
- details: {
19
- [name: string]: unknown;
20
- };
21
- }
22
- /**
23
- * Contains info about a 500 Internal Server Error response
24
- */
25
- export interface InternalServerError {
26
- message: string;
27
- }
28
- /**
29
- * Contains token info from a given address
30
- */
31
- export interface Token {
32
- type: string;
33
- name: string;
34
- path?: string;
35
- contract?: string;
36
- transfers: number;
37
- symbol?: string;
38
- decimals?: number;
39
- balance?: string;
40
- totalReceived?: string;
41
- totalSent?: string;
42
- }
43
- /**
44
- * Contains info about an addresses balance
45
- */
46
- export interface Balance {
47
- network: string;
48
- symbol: string;
49
- address: string;
50
- balance: string;
51
- totalReceived?: string;
52
- totalSent?: string;
53
- unconfirmedBalance: string;
54
- unconfirmedTxs: number;
55
- txs: number;
56
- tokens: Token[];
57
- }
58
- /**
59
- * Contains info about a balance change
60
- */
61
- export interface BalanceChange {
62
- timestamp: number;
63
- amount: string;
64
- }
65
- /**
66
- * Contains info about a block
67
- */
68
- export interface Block {
69
- network: string;
70
- hash: string;
71
- prevHash?: string;
72
- nextHash?: string;
73
- height: number;
74
- confirmations: number;
75
- timestamp?: number;
76
- txs: number;
77
- }
78
- /**
79
- * Contains ethereum specific transaction data
80
- */
81
- export interface EthereumSpecific {
82
- status: number;
83
- nonce: number;
84
- gasLimit: number;
85
- gasUsed: number;
86
- gasPrice: string;
87
- data?: string;
88
- }
89
- /**
90
- * Contains info for pagination
91
- */
92
- export interface Pagination {
93
- page: number;
94
- totalPages: number;
95
- }
96
- /**
97
- * Contains the serialized raw transaction hex
98
- */
99
- export interface RawTx {
100
- hex: string;
101
- }
102
- /**
103
- * Contains info about a token transfer done in a transaction
104
- */
105
- export interface TokenTransfer {
106
- type: string;
107
- from: string;
108
- to: string;
109
- token: string;
110
- name: string;
111
- symbol: string;
112
- decimals: number;
113
- value: string;
114
- }
115
- /**
116
- * Contains info about a transaction
117
- */
118
- export interface Tx {
119
- network: string;
120
- symbol: string;
121
- txid: string;
122
- status: string;
123
- blockHash?: string;
124
- blockHeight?: number;
125
- confirmations?: number;
126
- timestamp?: number;
127
- from: string;
128
- to?: string;
129
- value: string;
130
- fee: string;
131
- }
132
- /**
133
- * Contains paginated transaction history
134
- */
135
- export interface TxHistory extends Pagination {
136
- txs: number;
137
- transactions: Array<Tx>;
138
- }
139
- /**
140
- * Contains info about a successfully sent transaction
141
- */
142
- export interface TxReceipt {
143
- network: string;
144
- txid: string;
145
- }
146
- /**
147
- * Contains info about an unspent transaction output
148
- */
149
- export interface Utxo {
150
- txid: string;
151
- vout: number;
152
- value: string;
153
- height?: number;
154
- confirmations: number;
155
- address?: string;
156
- path?: string;
157
- locktime?: number;
158
- coinbase?: boolean;
159
- }
160
- /**
161
- * Contains info about single transaction input
162
- */
163
- export interface Vin {
164
- txid?: string;
165
- vout?: number;
166
- sequence?: number;
167
- n: number;
168
- addresses?: Array<string>;
169
- isAddress: boolean;
170
- value?: string;
171
- hex?: string;
172
- asm?: string;
173
- coinbase?: string;
174
- }
175
- /**
176
- * Contains info about single transaction output
177
- */
178
- export interface Vout {
179
- value?: string;
180
- n: number;
181
- spent?: boolean;
182
- spentTxId?: string;
183
- spentIndex?: number;
184
- spentHeight?: number;
185
- hex?: string;
186
- asm?: string;
187
- addresses: Array<string>;
188
- isAddress: boolean;
189
- type?: string;
190
- }
191
- //# sourceMappingURL=models.d.ts.map