@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.
- package/README.md +26 -0
- package/dist/generated/bitcoin/api.d.ts +482 -0
- package/dist/generated/bitcoin/api.d.ts.map +1 -0
- package/dist/generated/bitcoin/api.js +336 -0
- package/dist/generated/bitcoin/api.js.map +1 -0
- package/dist/generated/bitcoin/base.d.ts +56 -0
- package/dist/generated/bitcoin/base.d.ts.map +1 -0
- package/dist/generated/bitcoin/base.js +65 -0
- package/dist/generated/bitcoin/base.js.map +1 -0
- package/dist/generated/bitcoin/common.d.ts +66 -0
- package/dist/generated/bitcoin/common.d.ts.map +1 -0
- package/dist/generated/bitcoin/common.js +153 -0
- package/dist/generated/bitcoin/common.js.map +1 -0
- package/dist/generated/bitcoin/configuration.d.ts +84 -0
- package/dist/generated/bitcoin/configuration.d.ts.map +1 -0
- package/dist/generated/bitcoin/configuration.js +43 -0
- package/dist/generated/bitcoin/configuration.js.map +1 -0
- package/dist/generated/bitcoin/index.d.ts +14 -0
- package/dist/generated/bitcoin/index.d.ts.map +1 -0
- package/dist/generated/bitcoin/index.js +28 -0
- package/dist/generated/bitcoin/index.js.map +1 -0
- package/dist/generated/ethereum/api.d.ts +554 -0
- package/dist/generated/ethereum/api.d.ts.map +1 -0
- package/dist/generated/ethereum/api.js +465 -0
- package/dist/generated/ethereum/api.js.map +1 -0
- package/dist/{packages/client/src/generated → generated}/ethereum/base.d.ts +0 -0
- package/dist/generated/ethereum/base.d.ts.map +1 -0
- package/dist/{packages/client/src/generated → generated}/ethereum/base.js +0 -0
- package/dist/generated/ethereum/base.js.map +1 -0
- package/dist/{packages/client/src/generated → generated}/ethereum/common.d.ts +0 -0
- package/dist/generated/ethereum/common.d.ts.map +1 -0
- package/dist/{packages/client/src/generated → generated}/ethereum/common.js +0 -0
- package/dist/generated/ethereum/common.js.map +1 -0
- package/dist/{packages/client/src/generated → generated}/ethereum/configuration.d.ts +0 -0
- package/dist/generated/ethereum/configuration.d.ts.map +1 -0
- package/dist/{packages/client/src/generated → generated}/ethereum/configuration.js +0 -0
- package/dist/generated/ethereum/configuration.js.map +1 -0
- package/dist/{packages/client/src/generated → generated}/ethereum/index.d.ts +0 -0
- package/dist/generated/ethereum/index.d.ts.map +1 -0
- package/dist/{packages/client/src/generated → generated}/ethereum/index.js +0 -0
- package/dist/generated/ethereum/index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/{packages/client/src/index.js → index.js} +2 -5
- package/dist/index.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +78 -535
- package/package.json +3 -3
- package/dist/coinstacks/common/api/src/index.d.ts +0 -121
- package/dist/coinstacks/common/api/src/index.d.ts.map +0 -1
- package/dist/coinstacks/common/api/src/index.js +0 -63
- package/dist/coinstacks/common/api/src/index.js.map +0 -1
- package/dist/coinstacks/common/api/src/middleware.d.ts +0 -4
- package/dist/coinstacks/common/api/src/middleware.d.ts.map +0 -1
- package/dist/coinstacks/common/api/src/middleware.js +0 -39
- package/dist/coinstacks/common/api/src/middleware.js.map +0 -1
- package/dist/coinstacks/common/api/src/models.d.ts +0 -191
- package/dist/coinstacks/common/api/src/models.d.ts.map +0 -1
- package/dist/coinstacks/common/api/src/models.js +0 -3
- package/dist/coinstacks/common/api/src/models.js.map +0 -1
- package/dist/packages/client/src/generated/ethereum/api.d.ts +0 -1074
- package/dist/packages/client/src/generated/ethereum/api.d.ts.map +0 -1
- package/dist/packages/client/src/generated/ethereum/api.js +0 -806
- package/dist/packages/client/src/generated/ethereum/api.js.map +0 -1
- package/dist/packages/client/src/generated/ethereum/base.d.ts.map +0 -1
- package/dist/packages/client/src/generated/ethereum/base.js.map +0 -1
- package/dist/packages/client/src/generated/ethereum/common.d.ts.map +0 -1
- package/dist/packages/client/src/generated/ethereum/common.js.map +0 -1
- package/dist/packages/client/src/generated/ethereum/configuration.d.ts.map +0 -1
- package/dist/packages/client/src/generated/ethereum/configuration.js.map +0 -1
- package/dist/packages/client/src/generated/ethereum/index.d.ts.map +0 -1
- package/dist/packages/client/src/generated/ethereum/index.js.map +0 -1
- package/dist/packages/client/src/index.d.ts +0 -3
- package/dist/packages/client/src/index.d.ts.map +0 -1
- package/dist/packages/client/src/index.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/generated/ethereum/api.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAoB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAKjE,OAAO,EAAiC,WAAW,EAAE,OAAO,EAAiB,MAAM,QAAQ,CAAC;AAE5F;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC5B;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;CACjB;AACD;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC5B;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;CACxB;AACD;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAChC;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;CACnB;AACD;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACvB;;;;OAIG;IACH,GAAG,EAAE,MAAM,CAAC;CACf;AACD;;;;GAIG;AACH,MAAM,WAAW,KAAK;IAClB;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,QAAQ,EAAE,MAA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B,EAAE,OAAO,CAAC,EAAE,GAAG;IAItE;;;;;;OAMG;IACI,YAAY,CAAC,iBAAiB,EAAE,wBAAwB,EAAE,OAAO,CAAC,EAAE,GAAG;IAI9E;;;;;;OAMG;IACI,MAAM,CAAC,iBAAiB,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,GAAG;CAGrE"}
|
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* @shapeshiftoss/ethereum-api
|
|
6
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 0.1.1
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
19
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
21
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.V1Api = exports.V1ApiFactory = exports.V1ApiFp = exports.V1ApiAxiosParamCreator = exports.ValidationErrorMessageEnum = void 0;
|
|
29
|
+
const axios_1 = __importDefault(require("axios"));
|
|
30
|
+
// Some imports not used depending on template conditions
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
const common_1 = require("./common");
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
const base_1 = require("./base");
|
|
35
|
+
/**
|
|
36
|
+
* @export
|
|
37
|
+
* @enum {string}
|
|
38
|
+
*/
|
|
39
|
+
var ValidationErrorMessageEnum;
|
|
40
|
+
(function (ValidationErrorMessageEnum) {
|
|
41
|
+
ValidationErrorMessageEnum["ValidationFailed"] = "Validation failed";
|
|
42
|
+
})(ValidationErrorMessageEnum = exports.ValidationErrorMessageEnum || (exports.ValidationErrorMessageEnum = {}));
|
|
43
|
+
/**
|
|
44
|
+
* V1Api - axios parameter creator
|
|
45
|
+
* @export
|
|
46
|
+
*/
|
|
47
|
+
const V1ApiAxiosParamCreator = function (configuration) {
|
|
48
|
+
return {
|
|
49
|
+
/**
|
|
50
|
+
* Get the estimated gas cost of a transaction
|
|
51
|
+
* @param {string} data input data
|
|
52
|
+
* @param {string} to to address
|
|
53
|
+
* @param {string} value transaction value in ether
|
|
54
|
+
* @param {*} [options] Override http request option.
|
|
55
|
+
* @throws {RequiredError}
|
|
56
|
+
*/
|
|
57
|
+
estimateGas: (data, to, value, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
// verify required parameter 'data' is not null or undefined
|
|
59
|
+
common_1.assertParamExists('estimateGas', 'data', data);
|
|
60
|
+
// verify required parameter 'to' is not null or undefined
|
|
61
|
+
common_1.assertParamExists('estimateGas', 'to', to);
|
|
62
|
+
// verify required parameter 'value' is not null or undefined
|
|
63
|
+
common_1.assertParamExists('estimateGas', 'value', value);
|
|
64
|
+
const localVarPath = `/api/v1/estimate-gas`;
|
|
65
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
66
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
67
|
+
let baseOptions;
|
|
68
|
+
if (configuration) {
|
|
69
|
+
baseOptions = configuration.baseOptions;
|
|
70
|
+
}
|
|
71
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
72
|
+
const localVarHeaderParameter = {};
|
|
73
|
+
const localVarQueryParameter = {};
|
|
74
|
+
if (data !== undefined) {
|
|
75
|
+
localVarQueryParameter['data'] = data;
|
|
76
|
+
}
|
|
77
|
+
if (to !== undefined) {
|
|
78
|
+
localVarQueryParameter['to'] = to;
|
|
79
|
+
}
|
|
80
|
+
if (value !== undefined) {
|
|
81
|
+
localVarQueryParameter['value'] = value;
|
|
82
|
+
}
|
|
83
|
+
common_1.setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
|
|
84
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
85
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
86
|
+
return {
|
|
87
|
+
url: common_1.toPathString(localVarUrlObj),
|
|
88
|
+
options: localVarRequestOptions,
|
|
89
|
+
};
|
|
90
|
+
}),
|
|
91
|
+
/**
|
|
92
|
+
* Get balance of a pubkey
|
|
93
|
+
* @param {string} pubkey account pubkey
|
|
94
|
+
* @param {*} [options] Override http request option.
|
|
95
|
+
* @throws {RequiredError}
|
|
96
|
+
*/
|
|
97
|
+
getBalance: (pubkey, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
// verify required parameter 'pubkey' is not null or undefined
|
|
99
|
+
common_1.assertParamExists('getBalance', 'pubkey', pubkey);
|
|
100
|
+
const localVarPath = `/api/v1/balance/{pubkey}`
|
|
101
|
+
.replace(`{${"pubkey"}}`, encodeURIComponent(String(pubkey)));
|
|
102
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
103
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
104
|
+
let baseOptions;
|
|
105
|
+
if (configuration) {
|
|
106
|
+
baseOptions = configuration.baseOptions;
|
|
107
|
+
}
|
|
108
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
109
|
+
const localVarHeaderParameter = {};
|
|
110
|
+
const localVarQueryParameter = {};
|
|
111
|
+
common_1.setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
|
|
112
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
113
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
114
|
+
return {
|
|
115
|
+
url: common_1.toPathString(localVarUrlObj),
|
|
116
|
+
options: localVarRequestOptions,
|
|
117
|
+
};
|
|
118
|
+
}),
|
|
119
|
+
/**
|
|
120
|
+
* Get the current gas price from the node
|
|
121
|
+
* @param {*} [options] Override http request option.
|
|
122
|
+
* @throws {RequiredError}
|
|
123
|
+
*/
|
|
124
|
+
getGasPrice: (options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
125
|
+
const localVarPath = `/api/v1/gas-price`;
|
|
126
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
127
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
128
|
+
let baseOptions;
|
|
129
|
+
if (configuration) {
|
|
130
|
+
baseOptions = configuration.baseOptions;
|
|
131
|
+
}
|
|
132
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
133
|
+
const localVarHeaderParameter = {};
|
|
134
|
+
const localVarQueryParameter = {};
|
|
135
|
+
common_1.setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
|
|
136
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
137
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
138
|
+
return {
|
|
139
|
+
url: common_1.toPathString(localVarUrlObj),
|
|
140
|
+
options: localVarRequestOptions,
|
|
141
|
+
};
|
|
142
|
+
}),
|
|
143
|
+
/**
|
|
144
|
+
* Get the current nonce of an address
|
|
145
|
+
* @param {string} address account address
|
|
146
|
+
* @param {*} [options] Override http request option.
|
|
147
|
+
* @throws {RequiredError}
|
|
148
|
+
*/
|
|
149
|
+
getNonce: (address, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
150
|
+
// verify required parameter 'address' is not null or undefined
|
|
151
|
+
common_1.assertParamExists('getNonce', 'address', address);
|
|
152
|
+
const localVarPath = `/api/v1/nonce/{address}`
|
|
153
|
+
.replace(`{${"address"}}`, encodeURIComponent(String(address)));
|
|
154
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
155
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
156
|
+
let baseOptions;
|
|
157
|
+
if (configuration) {
|
|
158
|
+
baseOptions = configuration.baseOptions;
|
|
159
|
+
}
|
|
160
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
161
|
+
const localVarHeaderParameter = {};
|
|
162
|
+
const localVarQueryParameter = {};
|
|
163
|
+
common_1.setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
|
|
164
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
165
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
166
|
+
return {
|
|
167
|
+
url: common_1.toPathString(localVarUrlObj),
|
|
168
|
+
options: localVarRequestOptions,
|
|
169
|
+
};
|
|
170
|
+
}),
|
|
171
|
+
/**
|
|
172
|
+
* Get transaction history of a pubkey
|
|
173
|
+
* @param {string} pubkey account pubkey
|
|
174
|
+
* @param {number} [page] page number
|
|
175
|
+
* @param {number} [pageSize] page size
|
|
176
|
+
* @param {string} [contract] filter by contract address (only supported by coins which support contracts)
|
|
177
|
+
* @param {*} [options] Override http request option.
|
|
178
|
+
* @throws {RequiredError}
|
|
179
|
+
*/
|
|
180
|
+
getTxHistory: (pubkey, page, pageSize, contract, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
181
|
+
// verify required parameter 'pubkey' is not null or undefined
|
|
182
|
+
common_1.assertParamExists('getTxHistory', 'pubkey', pubkey);
|
|
183
|
+
const localVarPath = `/api/v1/txs/{pubkey}`
|
|
184
|
+
.replace(`{${"pubkey"}}`, encodeURIComponent(String(pubkey)));
|
|
185
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
186
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
187
|
+
let baseOptions;
|
|
188
|
+
if (configuration) {
|
|
189
|
+
baseOptions = configuration.baseOptions;
|
|
190
|
+
}
|
|
191
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
192
|
+
const localVarHeaderParameter = {};
|
|
193
|
+
const localVarQueryParameter = {};
|
|
194
|
+
if (page !== undefined) {
|
|
195
|
+
localVarQueryParameter['page'] = page;
|
|
196
|
+
}
|
|
197
|
+
if (pageSize !== undefined) {
|
|
198
|
+
localVarQueryParameter['pageSize'] = pageSize;
|
|
199
|
+
}
|
|
200
|
+
if (contract !== undefined) {
|
|
201
|
+
localVarQueryParameter['contract'] = contract;
|
|
202
|
+
}
|
|
203
|
+
common_1.setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
|
|
204
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
205
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
206
|
+
return {
|
|
207
|
+
url: common_1.toPathString(localVarUrlObj),
|
|
208
|
+
options: localVarRequestOptions,
|
|
209
|
+
};
|
|
210
|
+
}),
|
|
211
|
+
/**
|
|
212
|
+
* Sends raw transaction to be broadcast to the node.
|
|
213
|
+
* @param {SendTxBody} sendTxBody serialized raw transaction hex
|
|
214
|
+
* @param {*} [options] Override http request option.
|
|
215
|
+
* @throws {RequiredError}
|
|
216
|
+
*/
|
|
217
|
+
sendTx: (sendTxBody, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
218
|
+
// verify required parameter 'sendTxBody' is not null or undefined
|
|
219
|
+
common_1.assertParamExists('sendTx', 'sendTxBody', sendTxBody);
|
|
220
|
+
const localVarPath = `/api/v1/send`;
|
|
221
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
222
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
223
|
+
let baseOptions;
|
|
224
|
+
if (configuration) {
|
|
225
|
+
baseOptions = configuration.baseOptions;
|
|
226
|
+
}
|
|
227
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
228
|
+
const localVarHeaderParameter = {};
|
|
229
|
+
const localVarQueryParameter = {};
|
|
230
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
231
|
+
common_1.setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
|
|
232
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
233
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
234
|
+
localVarRequestOptions.data = common_1.serializeDataIfNeeded(sendTxBody, localVarRequestOptions, configuration);
|
|
235
|
+
return {
|
|
236
|
+
url: common_1.toPathString(localVarUrlObj),
|
|
237
|
+
options: localVarRequestOptions,
|
|
238
|
+
};
|
|
239
|
+
}),
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
exports.V1ApiAxiosParamCreator = V1ApiAxiosParamCreator;
|
|
243
|
+
/**
|
|
244
|
+
* V1Api - functional programming interface
|
|
245
|
+
* @export
|
|
246
|
+
*/
|
|
247
|
+
const V1ApiFp = function (configuration) {
|
|
248
|
+
const localVarAxiosParamCreator = exports.V1ApiAxiosParamCreator(configuration);
|
|
249
|
+
return {
|
|
250
|
+
/**
|
|
251
|
+
* Get the estimated gas cost of a transaction
|
|
252
|
+
* @param {string} data input data
|
|
253
|
+
* @param {string} to to address
|
|
254
|
+
* @param {string} value transaction value in ether
|
|
255
|
+
* @param {*} [options] Override http request option.
|
|
256
|
+
* @throws {RequiredError}
|
|
257
|
+
*/
|
|
258
|
+
estimateGas(data, to, value, options) {
|
|
259
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
260
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.estimateGas(data, to, value, options);
|
|
261
|
+
return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
262
|
+
});
|
|
263
|
+
},
|
|
264
|
+
/**
|
|
265
|
+
* Get balance of a pubkey
|
|
266
|
+
* @param {string} pubkey account pubkey
|
|
267
|
+
* @param {*} [options] Override http request option.
|
|
268
|
+
* @throws {RequiredError}
|
|
269
|
+
*/
|
|
270
|
+
getBalance(pubkey, options) {
|
|
271
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
272
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getBalance(pubkey, options);
|
|
273
|
+
return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
274
|
+
});
|
|
275
|
+
},
|
|
276
|
+
/**
|
|
277
|
+
* Get the current gas price from the node
|
|
278
|
+
* @param {*} [options] Override http request option.
|
|
279
|
+
* @throws {RequiredError}
|
|
280
|
+
*/
|
|
281
|
+
getGasPrice(options) {
|
|
282
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
283
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getGasPrice(options);
|
|
284
|
+
return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
285
|
+
});
|
|
286
|
+
},
|
|
287
|
+
/**
|
|
288
|
+
* Get the current nonce of an address
|
|
289
|
+
* @param {string} address account address
|
|
290
|
+
* @param {*} [options] Override http request option.
|
|
291
|
+
* @throws {RequiredError}
|
|
292
|
+
*/
|
|
293
|
+
getNonce(address, options) {
|
|
294
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
295
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getNonce(address, options);
|
|
296
|
+
return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
297
|
+
});
|
|
298
|
+
},
|
|
299
|
+
/**
|
|
300
|
+
* Get transaction history of a pubkey
|
|
301
|
+
* @param {string} pubkey account pubkey
|
|
302
|
+
* @param {number} [page] page number
|
|
303
|
+
* @param {number} [pageSize] page size
|
|
304
|
+
* @param {string} [contract] filter by contract address (only supported by coins which support contracts)
|
|
305
|
+
* @param {*} [options] Override http request option.
|
|
306
|
+
* @throws {RequiredError}
|
|
307
|
+
*/
|
|
308
|
+
getTxHistory(pubkey, page, pageSize, contract, options) {
|
|
309
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
310
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getTxHistory(pubkey, page, pageSize, contract, options);
|
|
311
|
+
return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
312
|
+
});
|
|
313
|
+
},
|
|
314
|
+
/**
|
|
315
|
+
* Sends raw transaction to be broadcast to the node.
|
|
316
|
+
* @param {SendTxBody} sendTxBody serialized raw transaction hex
|
|
317
|
+
* @param {*} [options] Override http request option.
|
|
318
|
+
* @throws {RequiredError}
|
|
319
|
+
*/
|
|
320
|
+
sendTx(sendTxBody, options) {
|
|
321
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
322
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.sendTx(sendTxBody, options);
|
|
323
|
+
return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
324
|
+
});
|
|
325
|
+
},
|
|
326
|
+
};
|
|
327
|
+
};
|
|
328
|
+
exports.V1ApiFp = V1ApiFp;
|
|
329
|
+
/**
|
|
330
|
+
* V1Api - factory interface
|
|
331
|
+
* @export
|
|
332
|
+
*/
|
|
333
|
+
const V1ApiFactory = function (configuration, basePath, axios) {
|
|
334
|
+
const localVarFp = exports.V1ApiFp(configuration);
|
|
335
|
+
return {
|
|
336
|
+
/**
|
|
337
|
+
* Get the estimated gas cost of a transaction
|
|
338
|
+
* @param {string} data input data
|
|
339
|
+
* @param {string} to to address
|
|
340
|
+
* @param {string} value transaction value in ether
|
|
341
|
+
* @param {*} [options] Override http request option.
|
|
342
|
+
* @throws {RequiredError}
|
|
343
|
+
*/
|
|
344
|
+
estimateGas(data, to, value, options) {
|
|
345
|
+
return localVarFp.estimateGas(data, to, value, options).then((request) => request(axios, basePath));
|
|
346
|
+
},
|
|
347
|
+
/**
|
|
348
|
+
* Get balance of a pubkey
|
|
349
|
+
* @param {string} pubkey account pubkey
|
|
350
|
+
* @param {*} [options] Override http request option.
|
|
351
|
+
* @throws {RequiredError}
|
|
352
|
+
*/
|
|
353
|
+
getBalance(pubkey, options) {
|
|
354
|
+
return localVarFp.getBalance(pubkey, options).then((request) => request(axios, basePath));
|
|
355
|
+
},
|
|
356
|
+
/**
|
|
357
|
+
* Get the current gas price from the node
|
|
358
|
+
* @param {*} [options] Override http request option.
|
|
359
|
+
* @throws {RequiredError}
|
|
360
|
+
*/
|
|
361
|
+
getGasPrice(options) {
|
|
362
|
+
return localVarFp.getGasPrice(options).then((request) => request(axios, basePath));
|
|
363
|
+
},
|
|
364
|
+
/**
|
|
365
|
+
* Get the current nonce of an address
|
|
366
|
+
* @param {string} address account address
|
|
367
|
+
* @param {*} [options] Override http request option.
|
|
368
|
+
* @throws {RequiredError}
|
|
369
|
+
*/
|
|
370
|
+
getNonce(address, options) {
|
|
371
|
+
return localVarFp.getNonce(address, options).then((request) => request(axios, basePath));
|
|
372
|
+
},
|
|
373
|
+
/**
|
|
374
|
+
* Get transaction history of a pubkey
|
|
375
|
+
* @param {string} pubkey account pubkey
|
|
376
|
+
* @param {number} [page] page number
|
|
377
|
+
* @param {number} [pageSize] page size
|
|
378
|
+
* @param {string} [contract] filter by contract address (only supported by coins which support contracts)
|
|
379
|
+
* @param {*} [options] Override http request option.
|
|
380
|
+
* @throws {RequiredError}
|
|
381
|
+
*/
|
|
382
|
+
getTxHistory(pubkey, page, pageSize, contract, options) {
|
|
383
|
+
return localVarFp.getTxHistory(pubkey, page, pageSize, contract, options).then((request) => request(axios, basePath));
|
|
384
|
+
},
|
|
385
|
+
/**
|
|
386
|
+
* Sends raw transaction to be broadcast to the node.
|
|
387
|
+
* @param {SendTxBody} sendTxBody serialized raw transaction hex
|
|
388
|
+
* @param {*} [options] Override http request option.
|
|
389
|
+
* @throws {RequiredError}
|
|
390
|
+
*/
|
|
391
|
+
sendTx(sendTxBody, options) {
|
|
392
|
+
return localVarFp.sendTx(sendTxBody, options).then((request) => request(axios, basePath));
|
|
393
|
+
},
|
|
394
|
+
};
|
|
395
|
+
};
|
|
396
|
+
exports.V1ApiFactory = V1ApiFactory;
|
|
397
|
+
/**
|
|
398
|
+
* V1Api - object-oriented interface
|
|
399
|
+
* @export
|
|
400
|
+
* @class V1Api
|
|
401
|
+
* @extends {BaseAPI}
|
|
402
|
+
*/
|
|
403
|
+
class V1Api extends base_1.BaseAPI {
|
|
404
|
+
/**
|
|
405
|
+
* Get the estimated gas cost of a transaction
|
|
406
|
+
* @param {V1ApiEstimateGasRequest} requestParameters Request parameters.
|
|
407
|
+
* @param {*} [options] Override http request option.
|
|
408
|
+
* @throws {RequiredError}
|
|
409
|
+
* @memberof V1Api
|
|
410
|
+
*/
|
|
411
|
+
estimateGas(requestParameters, options) {
|
|
412
|
+
return exports.V1ApiFp(this.configuration).estimateGas(requestParameters.data, requestParameters.to, requestParameters.value, options).then((request) => request(this.axios, this.basePath));
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* Get balance of a pubkey
|
|
416
|
+
* @param {V1ApiGetBalanceRequest} requestParameters Request parameters.
|
|
417
|
+
* @param {*} [options] Override http request option.
|
|
418
|
+
* @throws {RequiredError}
|
|
419
|
+
* @memberof V1Api
|
|
420
|
+
*/
|
|
421
|
+
getBalance(requestParameters, options) {
|
|
422
|
+
return exports.V1ApiFp(this.configuration).getBalance(requestParameters.pubkey, options).then((request) => request(this.axios, this.basePath));
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Get the current gas price from the node
|
|
426
|
+
* @param {*} [options] Override http request option.
|
|
427
|
+
* @throws {RequiredError}
|
|
428
|
+
* @memberof V1Api
|
|
429
|
+
*/
|
|
430
|
+
getGasPrice(options) {
|
|
431
|
+
return exports.V1ApiFp(this.configuration).getGasPrice(options).then((request) => request(this.axios, this.basePath));
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Get the current nonce of an address
|
|
435
|
+
* @param {V1ApiGetNonceRequest} requestParameters Request parameters.
|
|
436
|
+
* @param {*} [options] Override http request option.
|
|
437
|
+
* @throws {RequiredError}
|
|
438
|
+
* @memberof V1Api
|
|
439
|
+
*/
|
|
440
|
+
getNonce(requestParameters, options) {
|
|
441
|
+
return exports.V1ApiFp(this.configuration).getNonce(requestParameters.address, options).then((request) => request(this.axios, this.basePath));
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* Get transaction history of a pubkey
|
|
445
|
+
* @param {V1ApiGetTxHistoryRequest} requestParameters Request parameters.
|
|
446
|
+
* @param {*} [options] Override http request option.
|
|
447
|
+
* @throws {RequiredError}
|
|
448
|
+
* @memberof V1Api
|
|
449
|
+
*/
|
|
450
|
+
getTxHistory(requestParameters, options) {
|
|
451
|
+
return exports.V1ApiFp(this.configuration).getTxHistory(requestParameters.pubkey, requestParameters.page, requestParameters.pageSize, requestParameters.contract, options).then((request) => request(this.axios, this.basePath));
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* Sends raw transaction to be broadcast to the node.
|
|
455
|
+
* @param {V1ApiSendTxRequest} requestParameters Request parameters.
|
|
456
|
+
* @param {*} [options] Override http request option.
|
|
457
|
+
* @throws {RequiredError}
|
|
458
|
+
* @memberof V1Api
|
|
459
|
+
*/
|
|
460
|
+
sendTx(requestParameters, options) {
|
|
461
|
+
return exports.V1ApiFp(this.configuration).sendTx(requestParameters.sendTxBody, options).then((request) => request(this.axios, this.basePath));
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
exports.V1Api = V1Api;
|
|
465
|
+
//# sourceMappingURL=api.js.map
|