@avalabs/glacier-sdk 2.4.1-alpha.10
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/CHANGELOG.md +32 -0
- package/LICENSE.md +0 -0
- package/README.md +15 -0
- package/__tests__/glacier-sdk.test.js +7 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +252 -0
- package/dist/index.js.map +1 -0
- package/dist/src/V1.d.ts +113 -0
- package/dist/src/V1.d.ts.map +1 -0
- package/dist/src/data-contracts.d.ts +214 -0
- package/dist/src/data-contracts.d.ts.map +1 -0
- package/dist/src/http-client.d.ts +59 -0
- package/dist/src/http-client.d.ts.map +1 -0
- package/index.ts +2 -0
- package/package.json +39 -0
- package/regenerate-sdk.sh +3 -0
- package/rollup.config.js +33 -0
- package/src/V1.ts +231 -0
- package/src/data-contracts.ts +277 -0
- package/src/http-client.ts +250 -0
- package/swagger/glacier.json +866 -0
- package/tsconfig.json +7 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
## 2.4.1-alpha.10 (2022-07-18)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @avalabs/glacier-sdk
|
|
9
|
+
|
|
10
|
+
## 2.4.1-alpha.9 (2022-07-14)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @avalabs/glacier-sdk
|
|
13
|
+
|
|
14
|
+
## 2.4.1-alpha.8 (2022-07-07)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @avalabs/glacier-sdk
|
|
17
|
+
|
|
18
|
+
## 2.4.1-alpha.7 (2022-07-07)
|
|
19
|
+
|
|
20
|
+
**Note:** Version bump only for package @avalabs/glacier-sdk
|
|
21
|
+
|
|
22
|
+
## 2.4.1-alpha.6 (2022-07-07)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @avalabs/glacier-sdk
|
|
25
|
+
|
|
26
|
+
## 2.4.1-alpha.5 (2022-07-07)
|
|
27
|
+
|
|
28
|
+
**Note:** Version bump only for package @avalabs/glacier-sdk
|
|
29
|
+
|
|
30
|
+
## 2.4.1-alpha.4 (2022-07-06)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package glacier-sdk
|
package/LICENSE.md
ADDED
|
File without changes
|
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# glacier-sdk
|
|
2
|
+
|
|
3
|
+
This package contains typescript api generated from the openAPI file from glacier.
|
|
4
|
+
|
|
5
|
+
To generate a new version based on the latest changes from glacier dev run:
|
|
6
|
+
|
|
7
|
+
```shell
|
|
8
|
+
$ yarn codegen
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
const glacierApi = new V1("https://glacier-api.avax.network/")
|
|
13
|
+
|
|
14
|
+
const resp = glacierApi.getNativeBalance(")
|
|
15
|
+
```
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
/*! *****************************************************************************
|
|
6
|
+
Copyright (c) Microsoft Corporation.
|
|
7
|
+
|
|
8
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
9
|
+
purpose with or without fee is hereby granted.
|
|
10
|
+
|
|
11
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
12
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
13
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
14
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
15
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
16
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
17
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
18
|
+
***************************************************************************** */
|
|
19
|
+
|
|
20
|
+
function __rest(s, e) {
|
|
21
|
+
var t = {};
|
|
22
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
23
|
+
t[p] = s[p];
|
|
24
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
25
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
26
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
27
|
+
t[p[i]] = s[p[i]];
|
|
28
|
+
}
|
|
29
|
+
return t;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
33
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
34
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
35
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
36
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
37
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
38
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* eslint-disable */
|
|
43
|
+
var ContentType;
|
|
44
|
+
(function (ContentType) {
|
|
45
|
+
ContentType["Json"] = "application/json";
|
|
46
|
+
ContentType["FormData"] = "multipart/form-data";
|
|
47
|
+
ContentType["UrlEncoded"] = "application/x-www-form-urlencoded";
|
|
48
|
+
})(ContentType || (ContentType = {}));
|
|
49
|
+
class HttpClient {
|
|
50
|
+
constructor(apiConfig = {}) {
|
|
51
|
+
this.baseUrl = '';
|
|
52
|
+
this.securityData = null;
|
|
53
|
+
this.abortControllers = new Map();
|
|
54
|
+
this.customFetch = (...fetchParams) => fetch(...fetchParams);
|
|
55
|
+
this.baseApiParams = {
|
|
56
|
+
credentials: 'same-origin',
|
|
57
|
+
headers: {},
|
|
58
|
+
redirect: 'follow',
|
|
59
|
+
referrerPolicy: 'no-referrer',
|
|
60
|
+
};
|
|
61
|
+
this.setSecurityData = (data) => {
|
|
62
|
+
this.securityData = data;
|
|
63
|
+
};
|
|
64
|
+
this.contentFormatters = {
|
|
65
|
+
[ContentType.Json]: (input) => input !== null && (typeof input === 'object' || typeof input === 'string')
|
|
66
|
+
? JSON.stringify(input)
|
|
67
|
+
: input,
|
|
68
|
+
[ContentType.FormData]: (input) => Object.keys(input || {}).reduce((formData, key) => {
|
|
69
|
+
const property = input[key];
|
|
70
|
+
formData.append(key, property instanceof Blob
|
|
71
|
+
? property
|
|
72
|
+
: typeof property === 'object' && property !== null
|
|
73
|
+
? JSON.stringify(property)
|
|
74
|
+
: `${property}`);
|
|
75
|
+
return formData;
|
|
76
|
+
}, new FormData()),
|
|
77
|
+
[ContentType.UrlEncoded]: (input) => this.toQueryString(input),
|
|
78
|
+
};
|
|
79
|
+
this.createAbortSignal = (cancelToken) => {
|
|
80
|
+
if (this.abortControllers.has(cancelToken)) {
|
|
81
|
+
const abortController = this.abortControllers.get(cancelToken);
|
|
82
|
+
if (abortController) {
|
|
83
|
+
return abortController.signal;
|
|
84
|
+
}
|
|
85
|
+
return void 0;
|
|
86
|
+
}
|
|
87
|
+
const abortController = new AbortController();
|
|
88
|
+
this.abortControllers.set(cancelToken, abortController);
|
|
89
|
+
return abortController.signal;
|
|
90
|
+
};
|
|
91
|
+
this.abortRequest = (cancelToken) => {
|
|
92
|
+
const abortController = this.abortControllers.get(cancelToken);
|
|
93
|
+
if (abortController) {
|
|
94
|
+
abortController.abort();
|
|
95
|
+
this.abortControllers.delete(cancelToken);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
this.request = (_a) => __awaiter(this, void 0, void 0, function* () {
|
|
99
|
+
var { body, secure, path, type, query, format, baseUrl, cancelToken } = _a, params = __rest(_a, ["body", "secure", "path", "type", "query", "format", "baseUrl", "cancelToken"]);
|
|
100
|
+
const secureParams = ((typeof secure === 'boolean' ? secure : this.baseApiParams.secure) &&
|
|
101
|
+
this.securityWorker &&
|
|
102
|
+
(yield this.securityWorker(this.securityData))) ||
|
|
103
|
+
{};
|
|
104
|
+
const requestParams = this.mergeRequestParams(params, secureParams);
|
|
105
|
+
const queryString = query && this.toQueryString(query);
|
|
106
|
+
const payloadFormatter = this.contentFormatters[type || ContentType.Json];
|
|
107
|
+
const responseFormat = format || requestParams.format;
|
|
108
|
+
return this.customFetch(`${baseUrl || this.baseUrl || ''}${path}${queryString ? `?${queryString}` : ''}`, Object.assign(Object.assign({}, requestParams), { headers: Object.assign(Object.assign({}, (type && type !== ContentType.FormData
|
|
109
|
+
? { 'Content-Type': type }
|
|
110
|
+
: {})), (requestParams.headers || {})), signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, body: typeof body === 'undefined' || body === null
|
|
111
|
+
? null
|
|
112
|
+
: payloadFormatter(body) })).then((response) => __awaiter(this, void 0, void 0, function* () {
|
|
113
|
+
const r = response;
|
|
114
|
+
r.data = null;
|
|
115
|
+
r.error = null;
|
|
116
|
+
const data = !responseFormat
|
|
117
|
+
? r
|
|
118
|
+
: yield response[responseFormat]()
|
|
119
|
+
.then((data) => {
|
|
120
|
+
if (r.ok) {
|
|
121
|
+
r.data = data;
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
r.error = data;
|
|
125
|
+
}
|
|
126
|
+
return r;
|
|
127
|
+
})
|
|
128
|
+
.catch((e) => {
|
|
129
|
+
r.error = e;
|
|
130
|
+
return r;
|
|
131
|
+
});
|
|
132
|
+
if (cancelToken) {
|
|
133
|
+
this.abortControllers.delete(cancelToken);
|
|
134
|
+
}
|
|
135
|
+
if (!response.ok)
|
|
136
|
+
throw data;
|
|
137
|
+
return data;
|
|
138
|
+
}));
|
|
139
|
+
});
|
|
140
|
+
Object.assign(this, apiConfig);
|
|
141
|
+
}
|
|
142
|
+
encodeQueryParam(key, value) {
|
|
143
|
+
const encodedKey = encodeURIComponent(key);
|
|
144
|
+
return `${encodedKey}=${encodeURIComponent(typeof value === 'number' ? value : `${value}`)}`;
|
|
145
|
+
}
|
|
146
|
+
addQueryParam(query, key) {
|
|
147
|
+
return this.encodeQueryParam(key, query[key]);
|
|
148
|
+
}
|
|
149
|
+
addArrayQueryParam(query, key) {
|
|
150
|
+
const value = query[key];
|
|
151
|
+
return value.map((v) => this.encodeQueryParam(key, v)).join('&');
|
|
152
|
+
}
|
|
153
|
+
toQueryString(rawQuery) {
|
|
154
|
+
const query = rawQuery || {};
|
|
155
|
+
const keys = Object.keys(query).filter((key) => 'undefined' !== typeof query[key]);
|
|
156
|
+
return keys
|
|
157
|
+
.map((key) => Array.isArray(query[key])
|
|
158
|
+
? this.addArrayQueryParam(query, key)
|
|
159
|
+
: this.addQueryParam(query, key))
|
|
160
|
+
.join('&');
|
|
161
|
+
}
|
|
162
|
+
addQueryParams(rawQuery) {
|
|
163
|
+
const queryString = this.toQueryString(rawQuery);
|
|
164
|
+
return queryString ? `?${queryString}` : '';
|
|
165
|
+
}
|
|
166
|
+
mergeRequestParams(params1, params2) {
|
|
167
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({}, this.baseApiParams), params1), (params2 || {})), { headers: Object.assign(Object.assign(Object.assign({}, (this.baseApiParams.headers || {})), (params1.headers || {})), ((params2 && params2.headers) || {})) });
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/* eslint-disable */
|
|
172
|
+
class V1 extends HttpClient {
|
|
173
|
+
constructor() {
|
|
174
|
+
super(...arguments);
|
|
175
|
+
/**
|
|
176
|
+
* No description
|
|
177
|
+
*
|
|
178
|
+
* @name HealthCheck
|
|
179
|
+
* @summary Get the health of the service.
|
|
180
|
+
* @request GET:/v1/health-check
|
|
181
|
+
* @response `200` `{ status?: string, info?: Record<string, { status?: string }>, error?: Record<string, { status?: string }>, details?: Record<string, { status?: string }> }` The Health Check is successful
|
|
182
|
+
* @response `503` `{ status?: string, info?: Record<string, { status?: string }>, error?: Record<string, { status?: string }>, details?: Record<string, { status?: string }> }` The Health Check is not successful
|
|
183
|
+
*/
|
|
184
|
+
this.healthCheck = (params = {}) => this.request(Object.assign({ path: `/v1/health-check`, method: 'GET', format: 'json' }, params));
|
|
185
|
+
/**
|
|
186
|
+
* No description
|
|
187
|
+
*
|
|
188
|
+
* @name GetNativeBalance
|
|
189
|
+
* @summary Get native token balance of a wallet address for a given chain.
|
|
190
|
+
* @request GET:/v1/chains/{chainId}/addresses/{address}/balances:getNative
|
|
191
|
+
* @response `200` `NativeBalanceDto`
|
|
192
|
+
*/
|
|
193
|
+
this.getNativeBalance = (chainId, address, query, params = {}) => this.request(Object.assign({ path: `/v1/chains/${chainId}/addresses/${address}/balances:getNative`, method: 'GET', query: query, format: 'json' }, params));
|
|
194
|
+
/**
|
|
195
|
+
* No description
|
|
196
|
+
*
|
|
197
|
+
* @name ListErc20Balances
|
|
198
|
+
* @summary Get erc-20 token balances of a wallet address for a given chain.
|
|
199
|
+
* @request GET:/v1/chains/{chainId}/addresses/{address}/balances:listErc20
|
|
200
|
+
* @response `200` `Erc20BalancesDto`
|
|
201
|
+
*/
|
|
202
|
+
this.listErc20Balances = (chainId, address, query, params = {}) => this.request(Object.assign({ path: `/v1/chains/${chainId}/addresses/${address}/balances:listErc20`, method: 'GET', query: query, format: 'json' }, params));
|
|
203
|
+
/**
|
|
204
|
+
* No description
|
|
205
|
+
*
|
|
206
|
+
* @name ListErc721Balances
|
|
207
|
+
* @summary Get erc-721 token balances of a wallet address for a given chain.
|
|
208
|
+
* @request GET:/v1/chains/{chainId}/addresses/{address}/balances:listErc721
|
|
209
|
+
* @response `200` `Erc721BalancesDto`
|
|
210
|
+
*/
|
|
211
|
+
this.listErc721Balances = (chainId, address, query, params = {}) => this.request(Object.assign({ path: `/v1/chains/${chainId}/addresses/${address}/balances:listErc721`, method: 'GET', query: query, format: 'json' }, params));
|
|
212
|
+
/**
|
|
213
|
+
* @description Gets a list of transactions where the given wallet address had an on-chain interaction for a given chain. The erc20 transfers, erc721 transfers, and internal transactions returned as part of the native transactions are only those where the address had an interaction. Therefore the transactions returned from this list may not be complete representations of the on-chain data. For a complete view of a transaction use the `/chains/:chainId/transactions/:txHash` endpoint.
|
|
214
|
+
*
|
|
215
|
+
* @name ListTransactions
|
|
216
|
+
* @summary Gets a list of transactions for a wallet address and chain.
|
|
217
|
+
* @request GET:/v1/chains/{chainId}/addresses/{address}/transactions
|
|
218
|
+
* @response `200` `ListTransactionDetailsDto`
|
|
219
|
+
*/
|
|
220
|
+
this.listTransactions = (chainId, address, query, params = {}) => this.request(Object.assign({ path: `/v1/chains/${chainId}/addresses/${address}/transactions`, method: 'GET', query: query, format: 'json' }, params));
|
|
221
|
+
/**
|
|
222
|
+
* No description
|
|
223
|
+
*
|
|
224
|
+
* @name GetTransaction
|
|
225
|
+
* @summary Gets the details of a single transaction.
|
|
226
|
+
* @request GET:/v1/chains/{chainId}/transactions/{txHash}
|
|
227
|
+
* @response `200` `TransactionDetailsDto`
|
|
228
|
+
*/
|
|
229
|
+
this.getTransaction = (chainId, txHash, params = {}) => this.request(Object.assign({ path: `/v1/chains/${chainId}/transactions/${txHash}`, method: 'GET', format: 'json' }, params));
|
|
230
|
+
/**
|
|
231
|
+
* No description
|
|
232
|
+
*
|
|
233
|
+
* @name SupportedChains
|
|
234
|
+
* @summary Gets the list of chains supported by the api.
|
|
235
|
+
* @request GET:/v1/chains
|
|
236
|
+
* @response `200` `ChainsDto`
|
|
237
|
+
*/
|
|
238
|
+
this.supportedChains = (params = {}) => this.request(Object.assign({ path: `/v1/chains`, method: 'GET', format: 'json' }, params));
|
|
239
|
+
/**
|
|
240
|
+
* No description
|
|
241
|
+
*
|
|
242
|
+
* @name GetChainInfo
|
|
243
|
+
* @summary Gets chain information by chain id.
|
|
244
|
+
* @request GET:/v1/chains/{chainId}
|
|
245
|
+
* @response `200` `ChainInfoDto`
|
|
246
|
+
*/
|
|
247
|
+
this.getChainInfo = (chainId, params = {}) => this.request(Object.assign({ path: `/v1/chains/${chainId}`, method: 'GET', format: 'json' }, params));
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
exports.V1 = V1;
|
|
252
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/http-client.ts","../src/V1.ts"],"sourcesContent":["/* eslint-disable */\n/* tslint:disable */\n/*\n * ---------------------------------------------------------------\n * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##\n * ## ##\n * ## AUTHOR: acacode ##\n * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##\n * ---------------------------------------------------------------\n */\n\nexport type QueryParamsType = Record<string | number, any>;\nexport type ResponseFormat = keyof Omit<Body, 'body' | 'bodyUsed'>;\n\nexport interface FullRequestParams extends Omit<RequestInit, 'body'> {\n /** set parameter to `true` for call `securityWorker` for this request */\n secure?: boolean;\n /** request path */\n path: string;\n /** content type of request body */\n type?: ContentType;\n /** query params */\n query?: QueryParamsType;\n /** format of response (i.e. response.json() -> format: \"json\") */\n format?: ResponseFormat;\n /** request body */\n body?: unknown;\n /** base url */\n baseUrl?: string;\n /** request cancellation token */\n cancelToken?: CancelToken;\n}\n\nexport type RequestParams = Omit<\n FullRequestParams,\n 'body' | 'method' | 'query' | 'path'\n>;\n\nexport interface ApiConfig<SecurityDataType = unknown> {\n baseUrl?: string;\n baseApiParams?: Omit<RequestParams, 'baseUrl' | 'cancelToken' | 'signal'>;\n securityWorker?: (\n securityData: SecurityDataType | null\n ) => Promise<RequestParams | void> | RequestParams | void;\n customFetch?: typeof fetch;\n}\n\nexport interface HttpResponse<D extends unknown, E extends unknown = unknown>\n extends Response {\n data: D;\n error: E;\n}\n\ntype CancelToken = Symbol | string | number;\n\nexport enum ContentType {\n Json = 'application/json',\n FormData = 'multipart/form-data',\n UrlEncoded = 'application/x-www-form-urlencoded',\n}\n\nexport class HttpClient<SecurityDataType = unknown> {\n public baseUrl: string = '';\n private securityData: SecurityDataType | null = null;\n private securityWorker?: ApiConfig<SecurityDataType>['securityWorker'];\n private abortControllers = new Map<CancelToken, AbortController>();\n private customFetch = (...fetchParams: Parameters<typeof fetch>) =>\n fetch(...fetchParams);\n\n private baseApiParams: RequestParams = {\n credentials: 'same-origin',\n headers: {},\n redirect: 'follow',\n referrerPolicy: 'no-referrer',\n };\n\n constructor(apiConfig: ApiConfig<SecurityDataType> = {}) {\n Object.assign(this, apiConfig);\n }\n\n public setSecurityData = (data: SecurityDataType | null) => {\n this.securityData = data;\n };\n\n private encodeQueryParam(key: string, value: any) {\n const encodedKey = encodeURIComponent(key);\n return `${encodedKey}=${encodeURIComponent(\n typeof value === 'number' ? value : `${value}`\n )}`;\n }\n\n private addQueryParam(query: QueryParamsType, key: string) {\n return this.encodeQueryParam(key, query[key]);\n }\n\n private addArrayQueryParam(query: QueryParamsType, key: string) {\n const value = query[key];\n return value.map((v: any) => this.encodeQueryParam(key, v)).join('&');\n }\n\n protected toQueryString(rawQuery?: QueryParamsType): string {\n const query = rawQuery || {};\n const keys = Object.keys(query).filter(\n (key) => 'undefined' !== typeof query[key]\n );\n return keys\n .map((key) =>\n Array.isArray(query[key])\n ? this.addArrayQueryParam(query, key)\n : this.addQueryParam(query, key)\n )\n .join('&');\n }\n\n protected addQueryParams(rawQuery?: QueryParamsType): string {\n const queryString = this.toQueryString(rawQuery);\n return queryString ? `?${queryString}` : '';\n }\n\n private contentFormatters: Record<ContentType, (input: any) => any> = {\n [ContentType.Json]: (input: any) =>\n input !== null && (typeof input === 'object' || typeof input === 'string')\n ? JSON.stringify(input)\n : input,\n [ContentType.FormData]: (input: any) =>\n Object.keys(input || {}).reduce((formData, key) => {\n const property = input[key];\n formData.append(\n key,\n property instanceof Blob\n ? property\n : typeof property === 'object' && property !== null\n ? JSON.stringify(property)\n : `${property}`\n );\n return formData;\n }, new FormData()),\n [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input),\n };\n\n private mergeRequestParams(\n params1: RequestParams,\n params2?: RequestParams\n ): RequestParams {\n return {\n ...this.baseApiParams,\n ...params1,\n ...(params2 || {}),\n headers: {\n ...(this.baseApiParams.headers || {}),\n ...(params1.headers || {}),\n ...((params2 && params2.headers) || {}),\n },\n };\n }\n\n private createAbortSignal = (\n cancelToken: CancelToken\n ): AbortSignal | undefined => {\n if (this.abortControllers.has(cancelToken)) {\n const abortController = this.abortControllers.get(cancelToken);\n if (abortController) {\n return abortController.signal;\n }\n return void 0;\n }\n\n const abortController = new AbortController();\n this.abortControllers.set(cancelToken, abortController);\n return abortController.signal;\n };\n\n public abortRequest = (cancelToken: CancelToken) => {\n const abortController = this.abortControllers.get(cancelToken);\n\n if (abortController) {\n abortController.abort();\n this.abortControllers.delete(cancelToken);\n }\n };\n\n public request = async <T = any, E = any>({\n body,\n secure,\n path,\n type,\n query,\n format,\n baseUrl,\n cancelToken,\n ...params\n }: FullRequestParams): Promise<HttpResponse<T, E>> => {\n const secureParams =\n ((typeof secure === 'boolean' ? secure : this.baseApiParams.secure) &&\n this.securityWorker &&\n (await this.securityWorker(this.securityData))) ||\n {};\n const requestParams = this.mergeRequestParams(params, secureParams);\n const queryString = query && this.toQueryString(query);\n const payloadFormatter = this.contentFormatters[type || ContentType.Json];\n const responseFormat = format || requestParams.format;\n\n return this.customFetch(\n `${baseUrl || this.baseUrl || ''}${path}${\n queryString ? `?${queryString}` : ''\n }`,\n {\n ...requestParams,\n headers: {\n ...(type && type !== ContentType.FormData\n ? { 'Content-Type': type }\n : {}),\n ...(requestParams.headers || {}),\n },\n signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,\n body:\n typeof body === 'undefined' || body === null\n ? null\n : payloadFormatter(body),\n }\n ).then(async (response) => {\n const r = response as HttpResponse<T, E>;\n r.data = null as unknown as T;\n r.error = null as unknown as E;\n\n const data = !responseFormat\n ? r\n : await response[responseFormat]()\n .then((data) => {\n if (r.ok) {\n r.data = data;\n } else {\n r.error = data;\n }\n return r;\n })\n .catch((e) => {\n r.error = e;\n return r;\n });\n\n if (cancelToken) {\n this.abortControllers.delete(cancelToken);\n }\n\n if (!response.ok) throw data;\n return data;\n });\n };\n}\n","/* eslint-disable */\n/* tslint:disable */\n/*\n * ---------------------------------------------------------------\n * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##\n * ## ##\n * ## AUTHOR: acacode ##\n * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##\n * ---------------------------------------------------------------\n */\n\nimport {\n ChainInfoDto,\n ChainsDto,\n Erc20BalancesDto,\n Erc721BalancesDto,\n ListTransactionDetailsDto,\n NativeBalanceDto,\n TransactionDetailsDto,\n} from './data-contracts';\nimport { HttpClient, RequestParams } from './http-client';\n\nexport class V1<\n SecurityDataType = unknown\n> extends HttpClient<SecurityDataType> {\n /**\n * No description\n *\n * @name HealthCheck\n * @summary Get the health of the service.\n * @request GET:/v1/health-check\n * @response `200` `{ status?: string, info?: Record<string, { status?: string }>, error?: Record<string, { status?: string }>, details?: Record<string, { status?: string }> }` The Health Check is successful\n * @response `503` `{ status?: string, info?: Record<string, { status?: string }>, error?: Record<string, { status?: string }>, details?: Record<string, { status?: string }> }` The Health Check is not successful\n */\n healthCheck = (params: RequestParams = {}) =>\n this.request<\n {\n status?: string;\n info?: Record<string, { status?: string }>;\n error?: Record<string, { status?: string }>;\n details?: Record<string, { status?: string }>;\n },\n {\n status?: string;\n info?: Record<string, { status?: string }>;\n error?: Record<string, { status?: string }>;\n details?: Record<string, { status?: string }>;\n }\n >({\n path: `/v1/health-check`,\n method: 'GET',\n format: 'json',\n ...params,\n });\n /**\n * No description\n *\n * @name GetNativeBalance\n * @summary Get native token balance of a wallet address for a given chain.\n * @request GET:/v1/chains/{chainId}/addresses/{address}/balances:getNative\n * @response `200` `NativeBalanceDto`\n */\n getNativeBalance = (\n chainId: string,\n address: string,\n query?: {\n currency?:\n | 'usd'\n | 'eur'\n | 'aud'\n | 'cad'\n | 'chf'\n | 'clp'\n | 'czk'\n | 'dkk'\n | 'gbp'\n | 'hkd'\n | 'huf';\n },\n params: RequestParams = {}\n ) =>\n this.request<NativeBalanceDto, any>({\n path: `/v1/chains/${chainId}/addresses/${address}/balances:getNative`,\n method: 'GET',\n query: query,\n format: 'json',\n ...params,\n });\n /**\n * No description\n *\n * @name ListErc20Balances\n * @summary Get erc-20 token balances of a wallet address for a given chain.\n * @request GET:/v1/chains/{chainId}/addresses/{address}/balances:listErc20\n * @response `200` `Erc20BalancesDto`\n */\n listErc20Balances = (\n chainId: string,\n address: string,\n query?: {\n pageSize?: number;\n pageToken?: string;\n currency?:\n | 'usd'\n | 'eur'\n | 'aud'\n | 'cad'\n | 'chf'\n | 'clp'\n | 'czk'\n | 'dkk'\n | 'gbp'\n | 'hkd'\n | 'huf';\n },\n params: RequestParams = {}\n ) =>\n this.request<Erc20BalancesDto, any>({\n path: `/v1/chains/${chainId}/addresses/${address}/balances:listErc20`,\n method: 'GET',\n query: query,\n format: 'json',\n ...params,\n });\n /**\n * No description\n *\n * @name ListErc721Balances\n * @summary Get erc-721 token balances of a wallet address for a given chain.\n * @request GET:/v1/chains/{chainId}/addresses/{address}/balances:listErc721\n * @response `200` `Erc721BalancesDto`\n */\n listErc721Balances = (\n chainId: string,\n address: string,\n query?: {\n pageSize?: number;\n pageToken?: string;\n currency?:\n | 'usd'\n | 'eur'\n | 'aud'\n | 'cad'\n | 'chf'\n | 'clp'\n | 'czk'\n | 'dkk'\n | 'gbp'\n | 'hkd'\n | 'huf';\n },\n params: RequestParams = {}\n ) =>\n this.request<Erc721BalancesDto, any>({\n path: `/v1/chains/${chainId}/addresses/${address}/balances:listErc721`,\n method: 'GET',\n query: query,\n format: 'json',\n ...params,\n });\n /**\n * @description Gets a list of transactions where the given wallet address had an on-chain interaction for a given chain. The erc20 transfers, erc721 transfers, and internal transactions returned as part of the native transactions are only those where the address had an interaction. Therefore the transactions returned from this list may not be complete representations of the on-chain data. For a complete view of a transaction use the `/chains/:chainId/transactions/:txHash` endpoint.\n *\n * @name ListTransactions\n * @summary Gets a list of transactions for a wallet address and chain.\n * @request GET:/v1/chains/{chainId}/addresses/{address}/transactions\n * @response `200` `ListTransactionDetailsDto`\n */\n listTransactions = (\n chainId: string,\n address: string,\n query?: { pageSize?: number; pageToken?: string },\n params: RequestParams = {}\n ) =>\n this.request<ListTransactionDetailsDto, any>({\n path: `/v1/chains/${chainId}/addresses/${address}/transactions`,\n method: 'GET',\n query: query,\n format: 'json',\n ...params,\n });\n /**\n * No description\n *\n * @name GetTransaction\n * @summary Gets the details of a single transaction.\n * @request GET:/v1/chains/{chainId}/transactions/{txHash}\n * @response `200` `TransactionDetailsDto`\n */\n getTransaction = (\n chainId: string,\n txHash: string,\n params: RequestParams = {}\n ) =>\n this.request<TransactionDetailsDto, any>({\n path: `/v1/chains/${chainId}/transactions/${txHash}`,\n method: 'GET',\n format: 'json',\n ...params,\n });\n /**\n * No description\n *\n * @name SupportedChains\n * @summary Gets the list of chains supported by the api.\n * @request GET:/v1/chains\n * @response `200` `ChainsDto`\n */\n supportedChains = (params: RequestParams = {}) =>\n this.request<ChainsDto, any>({\n path: `/v1/chains`,\n method: 'GET',\n format: 'json',\n ...params,\n });\n /**\n * No description\n *\n * @name GetChainInfo\n * @summary Gets chain information by chain id.\n * @request GET:/v1/chains/{chainId}\n * @response `200` `ChainInfoDto`\n */\n getChainInfo = (chainId: string, params: RequestParams = {}) =>\n this.request<ChainInfoDto, any>({\n path: `/v1/chains/${chainId}`,\n method: 'GET',\n format: 'json',\n ...params,\n });\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAuDA,IAAY,WAIX,CAAA;AAJD,CAAA,UAAY,WAAW,EAAA;AACrB,IAAA,WAAA,CAAA,MAAA,CAAA,GAAA,kBAAyB,CAAA;AACzB,IAAA,WAAA,CAAA,UAAA,CAAA,GAAA,qBAAgC,CAAA;AAChC,IAAA,WAAA,CAAA,YAAA,CAAA,GAAA,mCAAgD,CAAA;AAClD,CAAC,EAJW,WAAW,KAAX,WAAW,GAItB,EAAA,CAAA,CAAA,CAAA;MAEY,UAAU,CAAA;AAerB,IAAA,WAAA,CAAY,YAAyC,EAAE,EAAA;QAdhD,IAAO,CAAA,OAAA,GAAW,EAAE,CAAC;QACpB,IAAY,CAAA,YAAA,GAA4B,IAAI,CAAC;AAE7C,QAAA,IAAA,CAAA,gBAAgB,GAAG,IAAI,GAAG,EAAgC,CAAC;AAC3D,QAAA,IAAA,CAAA,WAAW,GAAG,CAAC,GAAG,WAAqC,KAC7D,KAAK,CAAC,GAAG,WAAW,CAAC,CAAC;AAEhB,QAAA,IAAA,CAAA,aAAa,GAAkB;AACrC,YAAA,WAAW,EAAE,aAAa;AAC1B,YAAA,OAAO,EAAE,EAAE;AACX,YAAA,QAAQ,EAAE,QAAQ;AAClB,YAAA,cAAc,EAAE,aAAa;SAC9B,CAAC;AAMK,QAAA,IAAA,CAAA,eAAe,GAAG,CAAC,IAA6B,KAAI;AACzD,YAAA,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;AAC3B,SAAC,CAAC;AAqCM,QAAA,IAAA,CAAA,iBAAiB,GAA6C;YACpE,CAAC,WAAW,CAAC,IAAI,GAAG,CAAC,K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,0 +1,113 @@
|
|
|
1
|
+
import { ChainInfoDto, ChainsDto, Erc20BalancesDto, Erc721BalancesDto, ListTransactionDetailsDto, NativeBalanceDto, TransactionDetailsDto } from './data-contracts';
|
|
2
|
+
import { HttpClient, RequestParams } from './http-client';
|
|
3
|
+
export declare class V1<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
|
|
4
|
+
/**
|
|
5
|
+
* No description
|
|
6
|
+
*
|
|
7
|
+
* @name HealthCheck
|
|
8
|
+
* @summary Get the health of the service.
|
|
9
|
+
* @request GET:/v1/health-check
|
|
10
|
+
* @response `200` `{ status?: string, info?: Record<string, { status?: string }>, error?: Record<string, { status?: string }>, details?: Record<string, { status?: string }> }` The Health Check is successful
|
|
11
|
+
* @response `503` `{ status?: string, info?: Record<string, { status?: string }>, error?: Record<string, { status?: string }>, details?: Record<string, { status?: string }> }` The Health Check is not successful
|
|
12
|
+
*/
|
|
13
|
+
healthCheck: (params?: RequestParams) => Promise<import("./http-client").HttpResponse<{
|
|
14
|
+
status?: string | undefined;
|
|
15
|
+
info?: Record<string, {
|
|
16
|
+
status?: string | undefined;
|
|
17
|
+
}> | undefined;
|
|
18
|
+
error?: Record<string, {
|
|
19
|
+
status?: string | undefined;
|
|
20
|
+
}> | undefined;
|
|
21
|
+
details?: Record<string, {
|
|
22
|
+
status?: string | undefined;
|
|
23
|
+
}> | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
status?: string | undefined;
|
|
26
|
+
info?: Record<string, {
|
|
27
|
+
status?: string | undefined;
|
|
28
|
+
}> | undefined;
|
|
29
|
+
error?: Record<string, {
|
|
30
|
+
status?: string | undefined;
|
|
31
|
+
}> | undefined;
|
|
32
|
+
details?: Record<string, {
|
|
33
|
+
status?: string | undefined;
|
|
34
|
+
}> | undefined;
|
|
35
|
+
}>>;
|
|
36
|
+
/**
|
|
37
|
+
* No description
|
|
38
|
+
*
|
|
39
|
+
* @name GetNativeBalance
|
|
40
|
+
* @summary Get native token balance of a wallet address for a given chain.
|
|
41
|
+
* @request GET:/v1/chains/{chainId}/addresses/{address}/balances:getNative
|
|
42
|
+
* @response `200` `NativeBalanceDto`
|
|
43
|
+
*/
|
|
44
|
+
getNativeBalance: (chainId: string, address: string, query?: {
|
|
45
|
+
currency?: "usd" | "eur" | "aud" | "cad" | "chf" | "clp" | "czk" | "dkk" | "gbp" | "hkd" | "huf" | undefined;
|
|
46
|
+
} | undefined, params?: RequestParams) => Promise<import("./http-client").HttpResponse<NativeBalanceDto, any>>;
|
|
47
|
+
/**
|
|
48
|
+
* No description
|
|
49
|
+
*
|
|
50
|
+
* @name ListErc20Balances
|
|
51
|
+
* @summary Get erc-20 token balances of a wallet address for a given chain.
|
|
52
|
+
* @request GET:/v1/chains/{chainId}/addresses/{address}/balances:listErc20
|
|
53
|
+
* @response `200` `Erc20BalancesDto`
|
|
54
|
+
*/
|
|
55
|
+
listErc20Balances: (chainId: string, address: string, query?: {
|
|
56
|
+
pageSize?: number | undefined;
|
|
57
|
+
pageToken?: string | undefined;
|
|
58
|
+
currency?: "usd" | "eur" | "aud" | "cad" | "chf" | "clp" | "czk" | "dkk" | "gbp" | "hkd" | "huf" | undefined;
|
|
59
|
+
} | undefined, params?: RequestParams) => Promise<import("./http-client").HttpResponse<Erc20BalancesDto, any>>;
|
|
60
|
+
/**
|
|
61
|
+
* No description
|
|
62
|
+
*
|
|
63
|
+
* @name ListErc721Balances
|
|
64
|
+
* @summary Get erc-721 token balances of a wallet address for a given chain.
|
|
65
|
+
* @request GET:/v1/chains/{chainId}/addresses/{address}/balances:listErc721
|
|
66
|
+
* @response `200` `Erc721BalancesDto`
|
|
67
|
+
*/
|
|
68
|
+
listErc721Balances: (chainId: string, address: string, query?: {
|
|
69
|
+
pageSize?: number | undefined;
|
|
70
|
+
pageToken?: string | undefined;
|
|
71
|
+
currency?: "usd" | "eur" | "aud" | "cad" | "chf" | "clp" | "czk" | "dkk" | "gbp" | "hkd" | "huf" | undefined;
|
|
72
|
+
} | undefined, params?: RequestParams) => Promise<import("./http-client").HttpResponse<Erc721BalancesDto, any>>;
|
|
73
|
+
/**
|
|
74
|
+
* @description Gets a list of transactions where the given wallet address had an on-chain interaction for a given chain. The erc20 transfers, erc721 transfers, and internal transactions returned as part of the native transactions are only those where the address had an interaction. Therefore the transactions returned from this list may not be complete representations of the on-chain data. For a complete view of a transaction use the `/chains/:chainId/transactions/:txHash` endpoint.
|
|
75
|
+
*
|
|
76
|
+
* @name ListTransactions
|
|
77
|
+
* @summary Gets a list of transactions for a wallet address and chain.
|
|
78
|
+
* @request GET:/v1/chains/{chainId}/addresses/{address}/transactions
|
|
79
|
+
* @response `200` `ListTransactionDetailsDto`
|
|
80
|
+
*/
|
|
81
|
+
listTransactions: (chainId: string, address: string, query?: {
|
|
82
|
+
pageSize?: number | undefined;
|
|
83
|
+
pageToken?: string | undefined;
|
|
84
|
+
} | undefined, params?: RequestParams) => Promise<import("./http-client").HttpResponse<ListTransactionDetailsDto, any>>;
|
|
85
|
+
/**
|
|
86
|
+
* No description
|
|
87
|
+
*
|
|
88
|
+
* @name GetTransaction
|
|
89
|
+
* @summary Gets the details of a single transaction.
|
|
90
|
+
* @request GET:/v1/chains/{chainId}/transactions/{txHash}
|
|
91
|
+
* @response `200` `TransactionDetailsDto`
|
|
92
|
+
*/
|
|
93
|
+
getTransaction: (chainId: string, txHash: string, params?: RequestParams) => Promise<import("./http-client").HttpResponse<TransactionDetailsDto, any>>;
|
|
94
|
+
/**
|
|
95
|
+
* No description
|
|
96
|
+
*
|
|
97
|
+
* @name SupportedChains
|
|
98
|
+
* @summary Gets the list of chains supported by the api.
|
|
99
|
+
* @request GET:/v1/chains
|
|
100
|
+
* @response `200` `ChainsDto`
|
|
101
|
+
*/
|
|
102
|
+
supportedChains: (params?: RequestParams) => Promise<import("./http-client").HttpResponse<ChainsDto, any>>;
|
|
103
|
+
/**
|
|
104
|
+
* No description
|
|
105
|
+
*
|
|
106
|
+
* @name GetChainInfo
|
|
107
|
+
* @summary Gets chain information by chain id.
|
|
108
|
+
* @request GET:/v1/chains/{chainId}
|
|
109
|
+
* @response `200` `ChainInfoDto`
|
|
110
|
+
*/
|
|
111
|
+
getChainInfo: (chainId: string, params?: RequestParams) => Promise<import("./http-client").HttpResponse<ChainInfoDto, any>>;
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=V1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V1.d.ts","sourceRoot":"","sources":["../../src/V1.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,yBAAyB,EACzB,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE1D,qBAAa,EAAE,CACb,gBAAgB,GAAG,OAAO,CAC1B,SAAQ,UAAU,CAAC,gBAAgB,CAAC;IACpC;;;;;;;;OAQG;IACH,WAAW,YAAY,aAAa;;;;;;;;;;;;;;;;;;;;;;QAmB/B;IACL;;;;;;;OAOG;IACH,gBAAgB,YACL,MAAM,WACN,MAAM;;4BAeP,aAAa,0EAQlB;IACL;;;;;;;OAOG;IACH,iBAAiB,YACN,MAAM,WACN,MAAM;;;;4BAiBP,aAAa,0EAQlB;IACL;;;;;;;OAOG;IACH,kBAAkB,YACP,MAAM,WACN,MAAM;;;;4BAiBP,aAAa,2EAQlB;IACL;;;;;;;OAOG;IACH,gBAAgB,YACL,MAAM,WACN,MAAM;;;4BAEP,aAAa,mFAQlB;IACL;;;;;;;OAOG;IACH,cAAc,YACH,MAAM,UACP,MAAM,WACN,aAAa,+EAOlB;IACL;;;;;;;OAOG;IACH,eAAe,YAAY,aAAa,mEAMnC;IACL;;;;;;;OAOG;IACH,YAAY,YAAa,MAAM,WAAU,aAAa,sEAMjD;CACN"}
|