@shapeshiftoss/unchained-client 9.0.1 → 9.1.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.
- package/dist/evm/avalanche/index.d.ts +2 -0
- package/dist/{ethereum → evm/avalanche}/index.js +1 -2
- package/dist/evm/avalanche/parser/index.d.ts +5 -0
- package/dist/evm/avalanche/parser/index.js +16 -0
- package/dist/evm/ethereum/index.d.ts +2 -0
- package/dist/evm/ethereum/index.js +18 -0
- package/dist/{ethereum → evm/ethereum}/parser/abi/foxyStaking.d.ts +0 -0
- package/dist/{ethereum → evm/ethereum}/parser/abi/foxyStaking.js +0 -0
- package/dist/{ethereum → evm/ethereum}/parser/abi/shapeShiftRouter.d.ts +0 -0
- package/dist/{ethereum → evm/ethereum}/parser/abi/shapeShiftRouter.js +0 -0
- package/dist/{ethereum → evm/ethereum}/parser/abi/thor.d.ts +0 -0
- package/dist/{ethereum → evm/ethereum}/parser/abi/thor.js +0 -0
- package/dist/{ethereum → evm/ethereum}/parser/abi/uniV2.d.ts +0 -0
- package/dist/{ethereum → evm/ethereum}/parser/abi/uniV2.js +0 -0
- package/dist/{ethereum → evm/ethereum}/parser/abi/uniV2StakingRewards.d.ts +0 -0
- package/dist/{ethereum → evm/ethereum}/parser/abi/uniV2StakingRewards.js +0 -0
- package/dist/{ethereum → evm/ethereum}/parser/abi/weth.d.ts +0 -0
- package/dist/{ethereum → evm/ethereum}/parser/abi/weth.js +0 -0
- package/dist/{ethereum → evm/ethereum}/parser/abi/yearnVault.d.ts +0 -0
- package/dist/{ethereum → evm/ethereum}/parser/abi/yearnVault.js +0 -0
- package/dist/{ethereum → evm/ethereum}/parser/constants.d.ts +0 -0
- package/dist/{ethereum → evm/ethereum}/parser/constants.js +0 -0
- package/dist/{ethereum → evm/ethereum}/parser/foxy.d.ts +3 -3
- package/dist/{ethereum → evm/ethereum}/parser/foxy.js +4 -4
- package/dist/evm/ethereum/parser/index.d.ts +5 -0
- package/dist/evm/ethereum/parser/index.js +55 -0
- package/dist/{ethereum → evm/ethereum}/parser/thor.d.ts +3 -3
- package/dist/{ethereum → evm/ethereum}/parser/thor.js +4 -4
- package/dist/{ethereum → evm/ethereum}/parser/uniV2.d.ts +3 -3
- package/dist/{ethereum → evm/ethereum}/parser/uniV2.js +8 -8
- package/dist/{ethereum → evm/ethereum}/parser/weth.d.ts +3 -3
- package/dist/{ethereum → evm/ethereum}/parser/weth.js +4 -4
- package/dist/{ethereum → evm/ethereum}/parser/yearn.d.ts +3 -3
- package/dist/{ethereum → evm/ethereum}/parser/yearn.js +3 -3
- package/dist/evm/ethereum/parser/zrx.d.ts +5 -0
- package/dist/{ethereum → evm/ethereum}/parser/zrx.js +3 -3
- package/dist/evm/index.d.ts +2 -0
- package/dist/evm/index.js +28 -0
- package/dist/{ethereum → evm}/parser/abi/erc20.d.ts +0 -0
- package/dist/{ethereum → evm}/parser/abi/erc20.js +0 -0
- package/dist/{ethereum → evm}/parser/erc20.d.ts +3 -4
- package/dist/{ethereum → evm}/parser/erc20.js +1 -1
- package/dist/evm/parser/index.d.ts +26 -0
- package/dist/{ethereum → evm}/parser/index.js +28 -38
- package/dist/{ethereum → evm/parser}/types.d.ts +6 -4
- package/dist/{ethereum → evm/parser}/types.js +0 -0
- package/dist/evm/parser/utils.d.ts +4 -0
- package/dist/{ethereum → evm}/parser/utils.js +0 -0
- package/dist/generated/avalanche/api.d.ts +766 -0
- package/dist/generated/avalanche/api.js +490 -0
- package/dist/generated/avalanche/base.d.ts +55 -0
- package/dist/generated/avalanche/base.js +64 -0
- package/dist/generated/avalanche/common.d.ts +65 -0
- package/dist/generated/avalanche/common.js +137 -0
- package/dist/generated/avalanche/configuration.d.ts +83 -0
- package/dist/generated/avalanche/configuration.js +42 -0
- package/dist/generated/avalanche/index.d.ts +13 -0
- package/dist/generated/avalanche/index.js +31 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +7 -7
- package/package.json +5 -5
- package/dist/ethereum/index.d.ts +0 -3
- package/dist/ethereum/parser/index.d.ts +0 -23
- package/dist/ethereum/parser/utils.d.ts +0 -3
- package/dist/ethereum/parser/zrx.d.ts +0 -5
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* @shapeshiftoss/avalanche-api
|
|
6
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 7.0.0
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.V1Api = exports.V1ApiFactory = exports.V1ApiFp = exports.V1ApiAxiosParamCreator = exports.ValidationErrorMessageEnum = void 0;
|
|
20
|
+
const axios_1 = __importDefault(require("axios"));
|
|
21
|
+
// Some imports not used depending on template conditions
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
const common_1 = require("./common");
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
const base_1 = require("./base");
|
|
26
|
+
exports.ValidationErrorMessageEnum = {
|
|
27
|
+
ValidationFailed: 'Validation failed'
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* V1Api - axios parameter creator
|
|
31
|
+
* @export
|
|
32
|
+
*/
|
|
33
|
+
const V1ApiAxiosParamCreator = function (configuration) {
|
|
34
|
+
return {
|
|
35
|
+
/**
|
|
36
|
+
* Get the estimated gas cost of a transaction
|
|
37
|
+
* @param {string} data input data
|
|
38
|
+
* @param {string} from from address
|
|
39
|
+
* @param {string} to to address
|
|
40
|
+
* @param {string} value transaction value in wei
|
|
41
|
+
* @param {*} [options] Override http request option.
|
|
42
|
+
* @throws {RequiredError}
|
|
43
|
+
*/
|
|
44
|
+
estimateGas: async (data, from, to, value, options = {}) => {
|
|
45
|
+
// verify required parameter 'data' is not null or undefined
|
|
46
|
+
(0, common_1.assertParamExists)('estimateGas', 'data', data);
|
|
47
|
+
// verify required parameter 'from' is not null or undefined
|
|
48
|
+
(0, common_1.assertParamExists)('estimateGas', 'from', from);
|
|
49
|
+
// verify required parameter 'to' is not null or undefined
|
|
50
|
+
(0, common_1.assertParamExists)('estimateGas', 'to', to);
|
|
51
|
+
// verify required parameter 'value' is not null or undefined
|
|
52
|
+
(0, common_1.assertParamExists)('estimateGas', 'value', value);
|
|
53
|
+
const localVarPath = `/api/v1/gas/estimate`;
|
|
54
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
55
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
56
|
+
let baseOptions;
|
|
57
|
+
if (configuration) {
|
|
58
|
+
baseOptions = configuration.baseOptions;
|
|
59
|
+
}
|
|
60
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
|
|
61
|
+
const localVarHeaderParameter = {};
|
|
62
|
+
const localVarQueryParameter = {};
|
|
63
|
+
if (data !== undefined) {
|
|
64
|
+
localVarQueryParameter['data'] = data;
|
|
65
|
+
}
|
|
66
|
+
if (from !== undefined) {
|
|
67
|
+
localVarQueryParameter['from'] = from;
|
|
68
|
+
}
|
|
69
|
+
if (to !== undefined) {
|
|
70
|
+
localVarQueryParameter['to'] = to;
|
|
71
|
+
}
|
|
72
|
+
if (value !== undefined) {
|
|
73
|
+
localVarQueryParameter['value'] = value;
|
|
74
|
+
}
|
|
75
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
76
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
77
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
78
|
+
return {
|
|
79
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
80
|
+
options: localVarRequestOptions,
|
|
81
|
+
};
|
|
82
|
+
},
|
|
83
|
+
/**
|
|
84
|
+
* Get account details by address
|
|
85
|
+
* @param {string} pubkey account address
|
|
86
|
+
* @param {*} [options] Override http request option.
|
|
87
|
+
* @throws {RequiredError}
|
|
88
|
+
*/
|
|
89
|
+
getAccount: async (pubkey, options = {}) => {
|
|
90
|
+
// verify required parameter 'pubkey' is not null or undefined
|
|
91
|
+
(0, common_1.assertParamExists)('getAccount', 'pubkey', pubkey);
|
|
92
|
+
const localVarPath = `/api/v1/account/{pubkey}`
|
|
93
|
+
.replace(`{${"pubkey"}}`, encodeURIComponent(String(pubkey)));
|
|
94
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
95
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
96
|
+
let baseOptions;
|
|
97
|
+
if (configuration) {
|
|
98
|
+
baseOptions = configuration.baseOptions;
|
|
99
|
+
}
|
|
100
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
|
|
101
|
+
const localVarHeaderParameter = {};
|
|
102
|
+
const localVarQueryParameter = {};
|
|
103
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
104
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
105
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
106
|
+
return {
|
|
107
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
108
|
+
options: localVarRequestOptions,
|
|
109
|
+
};
|
|
110
|
+
},
|
|
111
|
+
/**
|
|
112
|
+
* Get the current recommended gas fees to use in a transaction * For EIP-1559 transactions, use `maxFeePerGas` and `maxPriorityFeePerGas` * For Legacy transactions, use `gasPrice`
|
|
113
|
+
* @param {*} [options] Override http request option.
|
|
114
|
+
* @throws {RequiredError}
|
|
115
|
+
*/
|
|
116
|
+
getGasFees: async (options = {}) => {
|
|
117
|
+
const localVarPath = `/api/v1/gas/fees`;
|
|
118
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
119
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
120
|
+
let baseOptions;
|
|
121
|
+
if (configuration) {
|
|
122
|
+
baseOptions = configuration.baseOptions;
|
|
123
|
+
}
|
|
124
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
|
|
125
|
+
const localVarHeaderParameter = {};
|
|
126
|
+
const localVarQueryParameter = {};
|
|
127
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
128
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
129
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
130
|
+
return {
|
|
131
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
132
|
+
options: localVarRequestOptions,
|
|
133
|
+
};
|
|
134
|
+
},
|
|
135
|
+
/**
|
|
136
|
+
* Get information about the running coinstack
|
|
137
|
+
* @param {*} [options] Override http request option.
|
|
138
|
+
* @throws {RequiredError}
|
|
139
|
+
*/
|
|
140
|
+
getInfo: async (options = {}) => {
|
|
141
|
+
const localVarPath = `/api/v1/info`;
|
|
142
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
143
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
144
|
+
let baseOptions;
|
|
145
|
+
if (configuration) {
|
|
146
|
+
baseOptions = configuration.baseOptions;
|
|
147
|
+
}
|
|
148
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
|
|
149
|
+
const localVarHeaderParameter = {};
|
|
150
|
+
const localVarQueryParameter = {};
|
|
151
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
152
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
153
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
154
|
+
return {
|
|
155
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
156
|
+
options: localVarRequestOptions,
|
|
157
|
+
};
|
|
158
|
+
},
|
|
159
|
+
/**
|
|
160
|
+
* Get transaction details
|
|
161
|
+
* @param {string} txid transaction hash
|
|
162
|
+
* @param {*} [options] Override http request option.
|
|
163
|
+
* @throws {RequiredError}
|
|
164
|
+
*/
|
|
165
|
+
getTransaction: async (txid, options = {}) => {
|
|
166
|
+
// verify required parameter 'txid' is not null or undefined
|
|
167
|
+
(0, common_1.assertParamExists)('getTransaction', 'txid', txid);
|
|
168
|
+
const localVarPath = `/api/v1/tx/{txid}`
|
|
169
|
+
.replace(`{${"txid"}}`, encodeURIComponent(String(txid)));
|
|
170
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
171
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
172
|
+
let baseOptions;
|
|
173
|
+
if (configuration) {
|
|
174
|
+
baseOptions = configuration.baseOptions;
|
|
175
|
+
}
|
|
176
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
|
|
177
|
+
const localVarHeaderParameter = {};
|
|
178
|
+
const localVarQueryParameter = {};
|
|
179
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
180
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
181
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
182
|
+
return {
|
|
183
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
184
|
+
options: localVarRequestOptions,
|
|
185
|
+
};
|
|
186
|
+
},
|
|
187
|
+
/**
|
|
188
|
+
* Get transaction history by address
|
|
189
|
+
* @param {string} pubkey account address
|
|
190
|
+
* @param {string} [cursor] the cursor returned in previous query (base64 encoded json object with a \'page\' property)
|
|
191
|
+
* @param {number} [pageSize] page size (10 by default)
|
|
192
|
+
* @param {*} [options] Override http request option.
|
|
193
|
+
* @throws {RequiredError}
|
|
194
|
+
*/
|
|
195
|
+
getTxHistory: async (pubkey, cursor, pageSize, options = {}) => {
|
|
196
|
+
// verify required parameter 'pubkey' is not null or undefined
|
|
197
|
+
(0, common_1.assertParamExists)('getTxHistory', 'pubkey', pubkey);
|
|
198
|
+
const localVarPath = `/api/v1/account/{pubkey}/txs`
|
|
199
|
+
.replace(`{${"pubkey"}}`, encodeURIComponent(String(pubkey)));
|
|
200
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
201
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
202
|
+
let baseOptions;
|
|
203
|
+
if (configuration) {
|
|
204
|
+
baseOptions = configuration.baseOptions;
|
|
205
|
+
}
|
|
206
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
|
|
207
|
+
const localVarHeaderParameter = {};
|
|
208
|
+
const localVarQueryParameter = {};
|
|
209
|
+
if (cursor !== undefined) {
|
|
210
|
+
localVarQueryParameter['cursor'] = cursor;
|
|
211
|
+
}
|
|
212
|
+
if (pageSize !== undefined) {
|
|
213
|
+
localVarQueryParameter['pageSize'] = pageSize;
|
|
214
|
+
}
|
|
215
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
216
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
217
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
218
|
+
return {
|
|
219
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
220
|
+
options: localVarRequestOptions,
|
|
221
|
+
};
|
|
222
|
+
},
|
|
223
|
+
/**
|
|
224
|
+
* Sends raw transaction to be broadcast to the node.
|
|
225
|
+
* @param {SendTxBody} sendTxBody serialized raw transaction hex
|
|
226
|
+
* @param {*} [options] Override http request option.
|
|
227
|
+
* @throws {RequiredError}
|
|
228
|
+
*/
|
|
229
|
+
sendTx: async (sendTxBody, options = {}) => {
|
|
230
|
+
// verify required parameter 'sendTxBody' is not null or undefined
|
|
231
|
+
(0, common_1.assertParamExists)('sendTx', 'sendTxBody', sendTxBody);
|
|
232
|
+
const localVarPath = `/api/v1/send`;
|
|
233
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
234
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
235
|
+
let baseOptions;
|
|
236
|
+
if (configuration) {
|
|
237
|
+
baseOptions = configuration.baseOptions;
|
|
238
|
+
}
|
|
239
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
|
|
240
|
+
const localVarHeaderParameter = {};
|
|
241
|
+
const localVarQueryParameter = {};
|
|
242
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
243
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
244
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
245
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
246
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(sendTxBody, localVarRequestOptions, configuration);
|
|
247
|
+
return {
|
|
248
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
249
|
+
options: localVarRequestOptions,
|
|
250
|
+
};
|
|
251
|
+
},
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
exports.V1ApiAxiosParamCreator = V1ApiAxiosParamCreator;
|
|
255
|
+
/**
|
|
256
|
+
* V1Api - functional programming interface
|
|
257
|
+
* @export
|
|
258
|
+
*/
|
|
259
|
+
const V1ApiFp = function (configuration) {
|
|
260
|
+
const localVarAxiosParamCreator = (0, exports.V1ApiAxiosParamCreator)(configuration);
|
|
261
|
+
return {
|
|
262
|
+
/**
|
|
263
|
+
* Get the estimated gas cost of a transaction
|
|
264
|
+
* @param {string} data input data
|
|
265
|
+
* @param {string} from from address
|
|
266
|
+
* @param {string} to to address
|
|
267
|
+
* @param {string} value transaction value in wei
|
|
268
|
+
* @param {*} [options] Override http request option.
|
|
269
|
+
* @throws {RequiredError}
|
|
270
|
+
*/
|
|
271
|
+
async estimateGas(data, from, to, value, options) {
|
|
272
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.estimateGas(data, from, to, value, options);
|
|
273
|
+
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
274
|
+
},
|
|
275
|
+
/**
|
|
276
|
+
* Get account details by address
|
|
277
|
+
* @param {string} pubkey account address
|
|
278
|
+
* @param {*} [options] Override http request option.
|
|
279
|
+
* @throws {RequiredError}
|
|
280
|
+
*/
|
|
281
|
+
async getAccount(pubkey, options) {
|
|
282
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getAccount(pubkey, options);
|
|
283
|
+
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
284
|
+
},
|
|
285
|
+
/**
|
|
286
|
+
* Get the current recommended gas fees to use in a transaction * For EIP-1559 transactions, use `maxFeePerGas` and `maxPriorityFeePerGas` * For Legacy transactions, use `gasPrice`
|
|
287
|
+
* @param {*} [options] Override http request option.
|
|
288
|
+
* @throws {RequiredError}
|
|
289
|
+
*/
|
|
290
|
+
async getGasFees(options) {
|
|
291
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getGasFees(options);
|
|
292
|
+
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
293
|
+
},
|
|
294
|
+
/**
|
|
295
|
+
* Get information about the running coinstack
|
|
296
|
+
* @param {*} [options] Override http request option.
|
|
297
|
+
* @throws {RequiredError}
|
|
298
|
+
*/
|
|
299
|
+
async getInfo(options) {
|
|
300
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getInfo(options);
|
|
301
|
+
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
302
|
+
},
|
|
303
|
+
/**
|
|
304
|
+
* Get transaction details
|
|
305
|
+
* @param {string} txid transaction hash
|
|
306
|
+
* @param {*} [options] Override http request option.
|
|
307
|
+
* @throws {RequiredError}
|
|
308
|
+
*/
|
|
309
|
+
async getTransaction(txid, options) {
|
|
310
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getTransaction(txid, options);
|
|
311
|
+
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
312
|
+
},
|
|
313
|
+
/**
|
|
314
|
+
* Get transaction history by address
|
|
315
|
+
* @param {string} pubkey account address
|
|
316
|
+
* @param {string} [cursor] the cursor returned in previous query (base64 encoded json object with a \'page\' property)
|
|
317
|
+
* @param {number} [pageSize] page size (10 by default)
|
|
318
|
+
* @param {*} [options] Override http request option.
|
|
319
|
+
* @throws {RequiredError}
|
|
320
|
+
*/
|
|
321
|
+
async getTxHistory(pubkey, cursor, pageSize, options) {
|
|
322
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getTxHistory(pubkey, cursor, pageSize, options);
|
|
323
|
+
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
324
|
+
},
|
|
325
|
+
/**
|
|
326
|
+
* Sends raw transaction to be broadcast to the node.
|
|
327
|
+
* @param {SendTxBody} sendTxBody serialized raw transaction hex
|
|
328
|
+
* @param {*} [options] Override http request option.
|
|
329
|
+
* @throws {RequiredError}
|
|
330
|
+
*/
|
|
331
|
+
async sendTx(sendTxBody, options) {
|
|
332
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.sendTx(sendTxBody, options);
|
|
333
|
+
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
334
|
+
},
|
|
335
|
+
};
|
|
336
|
+
};
|
|
337
|
+
exports.V1ApiFp = V1ApiFp;
|
|
338
|
+
/**
|
|
339
|
+
* V1Api - factory interface
|
|
340
|
+
* @export
|
|
341
|
+
*/
|
|
342
|
+
const V1ApiFactory = function (configuration, basePath, axios) {
|
|
343
|
+
const localVarFp = (0, exports.V1ApiFp)(configuration);
|
|
344
|
+
return {
|
|
345
|
+
/**
|
|
346
|
+
* Get the estimated gas cost of a transaction
|
|
347
|
+
* @param {string} data input data
|
|
348
|
+
* @param {string} from from address
|
|
349
|
+
* @param {string} to to address
|
|
350
|
+
* @param {string} value transaction value in wei
|
|
351
|
+
* @param {*} [options] Override http request option.
|
|
352
|
+
* @throws {RequiredError}
|
|
353
|
+
*/
|
|
354
|
+
estimateGas(data, from, to, value, options) {
|
|
355
|
+
return localVarFp.estimateGas(data, from, to, value, options).then((request) => request(axios, basePath));
|
|
356
|
+
},
|
|
357
|
+
/**
|
|
358
|
+
* Get account details by address
|
|
359
|
+
* @param {string} pubkey account address
|
|
360
|
+
* @param {*} [options] Override http request option.
|
|
361
|
+
* @throws {RequiredError}
|
|
362
|
+
*/
|
|
363
|
+
getAccount(pubkey, options) {
|
|
364
|
+
return localVarFp.getAccount(pubkey, options).then((request) => request(axios, basePath));
|
|
365
|
+
},
|
|
366
|
+
/**
|
|
367
|
+
* Get the current recommended gas fees to use in a transaction * For EIP-1559 transactions, use `maxFeePerGas` and `maxPriorityFeePerGas` * For Legacy transactions, use `gasPrice`
|
|
368
|
+
* @param {*} [options] Override http request option.
|
|
369
|
+
* @throws {RequiredError}
|
|
370
|
+
*/
|
|
371
|
+
getGasFees(options) {
|
|
372
|
+
return localVarFp.getGasFees(options).then((request) => request(axios, basePath));
|
|
373
|
+
},
|
|
374
|
+
/**
|
|
375
|
+
* Get information about the running coinstack
|
|
376
|
+
* @param {*} [options] Override http request option.
|
|
377
|
+
* @throws {RequiredError}
|
|
378
|
+
*/
|
|
379
|
+
getInfo(options) {
|
|
380
|
+
return localVarFp.getInfo(options).then((request) => request(axios, basePath));
|
|
381
|
+
},
|
|
382
|
+
/**
|
|
383
|
+
* Get transaction details
|
|
384
|
+
* @param {string} txid transaction hash
|
|
385
|
+
* @param {*} [options] Override http request option.
|
|
386
|
+
* @throws {RequiredError}
|
|
387
|
+
*/
|
|
388
|
+
getTransaction(txid, options) {
|
|
389
|
+
return localVarFp.getTransaction(txid, options).then((request) => request(axios, basePath));
|
|
390
|
+
},
|
|
391
|
+
/**
|
|
392
|
+
* Get transaction history by address
|
|
393
|
+
* @param {string} pubkey account address
|
|
394
|
+
* @param {string} [cursor] the cursor returned in previous query (base64 encoded json object with a \'page\' property)
|
|
395
|
+
* @param {number} [pageSize] page size (10 by default)
|
|
396
|
+
* @param {*} [options] Override http request option.
|
|
397
|
+
* @throws {RequiredError}
|
|
398
|
+
*/
|
|
399
|
+
getTxHistory(pubkey, cursor, pageSize, options) {
|
|
400
|
+
return localVarFp.getTxHistory(pubkey, cursor, pageSize, options).then((request) => request(axios, basePath));
|
|
401
|
+
},
|
|
402
|
+
/**
|
|
403
|
+
* Sends raw transaction to be broadcast to the node.
|
|
404
|
+
* @param {SendTxBody} sendTxBody serialized raw transaction hex
|
|
405
|
+
* @param {*} [options] Override http request option.
|
|
406
|
+
* @throws {RequiredError}
|
|
407
|
+
*/
|
|
408
|
+
sendTx(sendTxBody, options) {
|
|
409
|
+
return localVarFp.sendTx(sendTxBody, options).then((request) => request(axios, basePath));
|
|
410
|
+
},
|
|
411
|
+
};
|
|
412
|
+
};
|
|
413
|
+
exports.V1ApiFactory = V1ApiFactory;
|
|
414
|
+
/**
|
|
415
|
+
* V1Api - object-oriented interface
|
|
416
|
+
* @export
|
|
417
|
+
* @class V1Api
|
|
418
|
+
* @extends {BaseAPI}
|
|
419
|
+
*/
|
|
420
|
+
class V1Api extends base_1.BaseAPI {
|
|
421
|
+
/**
|
|
422
|
+
* Get the estimated gas cost of a transaction
|
|
423
|
+
* @param {V1ApiEstimateGasRequest} requestParameters Request parameters.
|
|
424
|
+
* @param {*} [options] Override http request option.
|
|
425
|
+
* @throws {RequiredError}
|
|
426
|
+
* @memberof V1Api
|
|
427
|
+
*/
|
|
428
|
+
estimateGas(requestParameters, options) {
|
|
429
|
+
return (0, exports.V1ApiFp)(this.configuration).estimateGas(requestParameters.data, requestParameters.from, requestParameters.to, requestParameters.value, options).then((request) => request(this.axios, this.basePath));
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Get account details by address
|
|
433
|
+
* @param {V1ApiGetAccountRequest} requestParameters Request parameters.
|
|
434
|
+
* @param {*} [options] Override http request option.
|
|
435
|
+
* @throws {RequiredError}
|
|
436
|
+
* @memberof V1Api
|
|
437
|
+
*/
|
|
438
|
+
getAccount(requestParameters, options) {
|
|
439
|
+
return (0, exports.V1ApiFp)(this.configuration).getAccount(requestParameters.pubkey, options).then((request) => request(this.axios, this.basePath));
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Get the current recommended gas fees to use in a transaction * For EIP-1559 transactions, use `maxFeePerGas` and `maxPriorityFeePerGas` * For Legacy transactions, use `gasPrice`
|
|
443
|
+
* @param {*} [options] Override http request option.
|
|
444
|
+
* @throws {RequiredError}
|
|
445
|
+
* @memberof V1Api
|
|
446
|
+
*/
|
|
447
|
+
getGasFees(options) {
|
|
448
|
+
return (0, exports.V1ApiFp)(this.configuration).getGasFees(options).then((request) => request(this.axios, this.basePath));
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Get information about the running coinstack
|
|
452
|
+
* @param {*} [options] Override http request option.
|
|
453
|
+
* @throws {RequiredError}
|
|
454
|
+
* @memberof V1Api
|
|
455
|
+
*/
|
|
456
|
+
getInfo(options) {
|
|
457
|
+
return (0, exports.V1ApiFp)(this.configuration).getInfo(options).then((request) => request(this.axios, this.basePath));
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Get transaction details
|
|
461
|
+
* @param {V1ApiGetTransactionRequest} requestParameters Request parameters.
|
|
462
|
+
* @param {*} [options] Override http request option.
|
|
463
|
+
* @throws {RequiredError}
|
|
464
|
+
* @memberof V1Api
|
|
465
|
+
*/
|
|
466
|
+
getTransaction(requestParameters, options) {
|
|
467
|
+
return (0, exports.V1ApiFp)(this.configuration).getTransaction(requestParameters.txid, options).then((request) => request(this.axios, this.basePath));
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* Get transaction history by address
|
|
471
|
+
* @param {V1ApiGetTxHistoryRequest} requestParameters Request parameters.
|
|
472
|
+
* @param {*} [options] Override http request option.
|
|
473
|
+
* @throws {RequiredError}
|
|
474
|
+
* @memberof V1Api
|
|
475
|
+
*/
|
|
476
|
+
getTxHistory(requestParameters, options) {
|
|
477
|
+
return (0, exports.V1ApiFp)(this.configuration).getTxHistory(requestParameters.pubkey, requestParameters.cursor, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* Sends raw transaction to be broadcast to the node.
|
|
481
|
+
* @param {V1ApiSendTxRequest} requestParameters Request parameters.
|
|
482
|
+
* @param {*} [options] Override http request option.
|
|
483
|
+
* @throws {RequiredError}
|
|
484
|
+
* @memberof V1Api
|
|
485
|
+
*/
|
|
486
|
+
sendTx(requestParameters, options) {
|
|
487
|
+
return (0, exports.V1ApiFp)(this.configuration).sendTx(requestParameters.sendTxBody, options).then((request) => request(this.axios, this.basePath));
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
exports.V1Api = V1Api;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @shapeshiftoss/avalanche-api
|
|
3
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 7.0.0
|
|
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 { AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
14
|
+
export declare const BASE_PATH: string;
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @export
|
|
18
|
+
*/
|
|
19
|
+
export declare const COLLECTION_FORMATS: {
|
|
20
|
+
csv: string;
|
|
21
|
+
ssv: string;
|
|
22
|
+
tsv: string;
|
|
23
|
+
pipes: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @export
|
|
28
|
+
* @interface RequestArgs
|
|
29
|
+
*/
|
|
30
|
+
export interface RequestArgs {
|
|
31
|
+
url: string;
|
|
32
|
+
options: AxiosRequestConfig;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @export
|
|
37
|
+
* @class BaseAPI
|
|
38
|
+
*/
|
|
39
|
+
export declare class BaseAPI {
|
|
40
|
+
protected basePath: string;
|
|
41
|
+
protected axios: AxiosInstance;
|
|
42
|
+
protected configuration: Configuration | undefined;
|
|
43
|
+
constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
* @export
|
|
48
|
+
* @class RequiredError
|
|
49
|
+
* @extends {Error}
|
|
50
|
+
*/
|
|
51
|
+
export declare class RequiredError extends Error {
|
|
52
|
+
field: string;
|
|
53
|
+
name: "RequiredError";
|
|
54
|
+
constructor(field: string, msg?: string);
|
|
55
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* @shapeshiftoss/avalanche-api
|
|
6
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 7.0.0
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
|
|
20
|
+
// Some imports not used depending on template conditions
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
const axios_1 = __importDefault(require("axios"));
|
|
23
|
+
exports.BASE_PATH = "https://dev-api.avalanche.shapeshift.com".replace(/\/+$/, "");
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @export
|
|
27
|
+
*/
|
|
28
|
+
exports.COLLECTION_FORMATS = {
|
|
29
|
+
csv: ",",
|
|
30
|
+
ssv: " ",
|
|
31
|
+
tsv: "\t",
|
|
32
|
+
pipes: "|",
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @export
|
|
37
|
+
* @class BaseAPI
|
|
38
|
+
*/
|
|
39
|
+
class BaseAPI {
|
|
40
|
+
constructor(configuration, basePath = exports.BASE_PATH, axios = axios_1.default) {
|
|
41
|
+
this.basePath = basePath;
|
|
42
|
+
this.axios = axios;
|
|
43
|
+
if (configuration) {
|
|
44
|
+
this.configuration = configuration;
|
|
45
|
+
this.basePath = configuration.basePath || this.basePath;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.BaseAPI = BaseAPI;
|
|
50
|
+
;
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
* @export
|
|
54
|
+
* @class RequiredError
|
|
55
|
+
* @extends {Error}
|
|
56
|
+
*/
|
|
57
|
+
class RequiredError extends Error {
|
|
58
|
+
constructor(field, msg) {
|
|
59
|
+
super(msg);
|
|
60
|
+
this.field = field;
|
|
61
|
+
this.name = "RequiredError";
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.RequiredError = RequiredError;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @shapeshiftoss/avalanche-api
|
|
3
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 7.0.0
|
|
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 { RequestArgs } from "./base";
|
|
14
|
+
import { AxiosInstance, AxiosResponse } from 'axios';
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @export
|
|
18
|
+
*/
|
|
19
|
+
export declare const DUMMY_BASE_URL = "https://example.com";
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @throws {RequiredError}
|
|
23
|
+
* @export
|
|
24
|
+
*/
|
|
25
|
+
export declare const assertParamExists: (functionName: string, paramName: string, paramValue: unknown) => void;
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @export
|
|
29
|
+
*/
|
|
30
|
+
export declare const setApiKeyToObject: (object: any, keyParamName: string, configuration?: Configuration | undefined) => Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @export
|
|
34
|
+
*/
|
|
35
|
+
export declare const setBasicAuthToObject: (object: any, configuration?: Configuration | undefined) => void;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @export
|
|
39
|
+
*/
|
|
40
|
+
export declare const setBearerAuthToObject: (object: any, configuration?: Configuration | undefined) => Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* @export
|
|
44
|
+
*/
|
|
45
|
+
export declare const setOAuthToObject: (object: any, name: string, scopes: string[], configuration?: Configuration | undefined) => Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @export
|
|
49
|
+
*/
|
|
50
|
+
export declare const setSearchParams: (url: URL, ...objects: any[]) => void;
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
* @export
|
|
54
|
+
*/
|
|
55
|
+
export declare const serializeDataIfNeeded: (value: any, requestOptions: any, configuration?: Configuration | undefined) => any;
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
* @export
|
|
59
|
+
*/
|
|
60
|
+
export declare const toPathString: (url: URL) => string;
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
63
|
+
* @export
|
|
64
|
+
*/
|
|
65
|
+
export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration | undefined) => <T = unknown, R = AxiosResponse<T, any>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
|