@alephium/web3 0.0.3 → 0.1.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/.editorconfig +13 -0
  2. package/.eslintignore +2 -0
  3. package/.eslintrc.json +21 -0
  4. package/README.md +2 -2
  5. package/contracts/add.ral +7 -3
  6. package/contracts/greeter.ral +3 -1
  7. package/contracts/greeter_interface.ral +3 -0
  8. package/contracts/greeter_main.ral +9 -0
  9. package/contracts/main.ral +3 -5
  10. package/dev/user.conf +8 -4
  11. package/dist/alephium-web3.min.js +1 -1
  12. package/dist/alephium-web3.min.js.map +1 -1
  13. package/dist/scripts/check-versions.d.ts +1 -0
  14. package/dist/scripts/check-versions.js +39 -0
  15. package/dist/{cli → scripts}/create-project.d.ts +0 -0
  16. package/dist/scripts/create-project.js +124 -0
  17. package/dist/scripts/header.d.ts +0 -0
  18. package/dist/scripts/header.js +18 -0
  19. package/dist/scripts/rename-gitignore.d.ts +1 -0
  20. package/dist/scripts/rename-gitignore.js +24 -0
  21. package/dist/scripts/start-devnet.d.ts +1 -0
  22. package/dist/scripts/start-devnet.js +131 -0
  23. package/dist/scripts/stop-devnet.d.ts +1 -0
  24. package/dist/scripts/stop-devnet.js +32 -0
  25. package/dist/{api → src/api}/api-alephium.d.ts +287 -168
  26. package/dist/{api → src/api}/api-alephium.js +497 -115
  27. package/dist/{api → src/api}/api-explorer.d.ts +117 -19
  28. package/dist/{api → src/api}/api-explorer.js +206 -46
  29. package/dist/src/api/index.d.ts +10 -0
  30. package/dist/src/api/index.js +55 -0
  31. package/dist/{lib → src}/constants.d.ts +0 -0
  32. package/dist/{lib → src}/constants.js +0 -0
  33. package/dist/src/contract/contract.d.ts +182 -0
  34. package/dist/src/contract/contract.js +760 -0
  35. package/dist/src/contract/events.d.ts +29 -0
  36. package/dist/src/contract/events.js +77 -0
  37. package/dist/src/contract/index.d.ts +3 -0
  38. package/dist/src/contract/index.js +32 -0
  39. package/dist/src/contract/ralph.d.ts +12 -0
  40. package/dist/src/contract/ralph.js +362 -0
  41. package/dist/src/index.d.ts +5 -0
  42. package/dist/src/index.js +34 -0
  43. package/dist/src/signer/index.d.ts +2 -0
  44. package/dist/src/signer/index.js +31 -0
  45. package/dist/src/signer/node-wallet.d.ts +13 -0
  46. package/dist/src/signer/node-wallet.js +60 -0
  47. package/dist/src/signer/signer.d.ts +143 -0
  48. package/dist/src/signer/signer.js +184 -0
  49. package/dist/src/test/index.d.ts +7 -0
  50. package/dist/src/test/index.js +41 -0
  51. package/dist/src/test/privatekey-wallet.d.ts +12 -0
  52. package/dist/src/test/privatekey-wallet.js +68 -0
  53. package/dist/{lib → src/utils}/address.d.ts +0 -0
  54. package/dist/{lib → src/utils}/address.js +1 -1
  55. package/dist/{lib → src/utils}/bs58.d.ts +2 -2
  56. package/dist/{lib → src/utils}/bs58.js +3 -1
  57. package/dist/{lib → src/utils}/djb2.d.ts +0 -0
  58. package/dist/{lib → src/utils}/djb2.js +1 -1
  59. package/dist/src/utils/index.d.ts +6 -0
  60. package/dist/src/utils/index.js +35 -0
  61. package/dist/{lib → src/utils}/password-crypto.d.ts +0 -0
  62. package/dist/{lib → src/utils}/password-crypto.js +8 -7
  63. package/dist/src/utils/transaction.d.ts +2 -0
  64. package/dist/src/utils/transaction.js +58 -0
  65. package/dist/src/utils/utils.d.ts +30 -0
  66. package/dist/{lib → src/utils}/utils.js +83 -19
  67. package/gitignore +5 -4
  68. package/package.json +55 -41
  69. package/scripts/create-project.ts +136 -0
  70. package/scripts/header.js +17 -0
  71. package/scripts/start-devnet.js +3 -3
  72. package/src/api/api-alephium.ts +2323 -0
  73. package/src/api/api-explorer.ts +808 -0
  74. package/src/api/index.ts +35 -0
  75. package/src/constants.ts +20 -0
  76. package/src/contract/contract.ts +1014 -0
  77. package/src/contract/events.ts +102 -0
  78. package/src/contract/index.ts +21 -0
  79. package/src/contract/ralph.test.ts +178 -0
  80. package/src/contract/ralph.ts +362 -0
  81. package/src/fixtures/address.json +36 -0
  82. package/src/fixtures/balance.json +9 -0
  83. package/src/fixtures/self-clique.json +19 -0
  84. package/src/fixtures/transaction.json +13 -0
  85. package/src/fixtures/transactions.json +179 -0
  86. package/src/index.ts +24 -0
  87. package/src/signer/fixtures/genesis.json +26 -0
  88. package/src/signer/fixtures/wallets.json +26 -0
  89. package/src/signer/index.ts +20 -0
  90. package/src/signer/node-wallet.ts +74 -0
  91. package/src/signer/signer.ts +313 -0
  92. package/src/test/index.ts +32 -0
  93. package/src/test/privatekey-wallet.ts +58 -0
  94. package/src/utils/address.test.ts +47 -0
  95. package/src/utils/address.ts +39 -0
  96. package/src/utils/bs58.ts +26 -0
  97. package/src/utils/djb2.test.ts +35 -0
  98. package/src/utils/djb2.ts +25 -0
  99. package/src/utils/index.ts +24 -0
  100. package/src/utils/password-crypto.test.ts +27 -0
  101. package/src/utils/password-crypto.ts +77 -0
  102. package/src/utils/transaction.test.ts +50 -0
  103. package/src/utils/transaction.ts +39 -0
  104. package/src/utils/utils.test.ts +160 -0
  105. package/src/utils/utils.ts +209 -0
  106. package/templates/{README.md → base/README.md} +4 -4
  107. package/templates/base/package.json +35 -0
  108. package/templates/base/src/greeter.ts +41 -0
  109. package/templates/base/tsconfig.json +19 -0
  110. package/templates/react/README.md +34 -0
  111. package/templates/react/config-overrides.js +18 -0
  112. package/templates/react/package.json +66 -0
  113. package/templates/react/src/App.tsx +42 -0
  114. package/templates/react/src/artifacts/greeter.ral.json +26 -0
  115. package/templates/react/src/artifacts/greeter_main.ral.json +22 -0
  116. package/templates/shared/.eslintrc.json +12 -0
  117. package/templates/shared/scripts/header.js +0 -0
  118. package/test/contract.test.ts +161 -0
  119. package/test/events.test.ts +139 -0
  120. package/webpack.config.js +1 -1
  121. package/contracts/greeter-main.ral +0 -8
  122. package/dist/cli/create-project.js +0 -87
  123. package/dist/lib/clique.d.ts +0 -23
  124. package/dist/lib/clique.js +0 -149
  125. package/dist/lib/contract.d.ts +0 -152
  126. package/dist/lib/contract.js +0 -711
  127. package/dist/lib/explorer.d.ts +0 -8
  128. package/dist/lib/explorer.js +0 -46
  129. package/dist/lib/index.d.ts +0 -12
  130. package/dist/lib/index.js +0 -60
  131. package/dist/lib/node.d.ts +0 -10
  132. package/dist/lib/node.js +0 -64
  133. package/dist/lib/numbers.d.ts +0 -7
  134. package/dist/lib/numbers.js +0 -128
  135. package/dist/lib/signer.d.ts +0 -17
  136. package/dist/lib/signer.js +0 -70
  137. package/dist/lib/storage-browser.d.ts +0 -9
  138. package/dist/lib/storage-browser.js +0 -52
  139. package/dist/lib/storage-node.d.ts +0 -9
  140. package/dist/lib/storage-node.js +0 -65
  141. package/dist/lib/utils.d.ts +0 -11
  142. package/dist/lib/wallet.d.ts +0 -30
  143. package/dist/lib/wallet.js +0 -142
  144. package/templates/package.json +0 -29
@@ -9,29 +9,17 @@
9
9
  * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
10
10
  * ---------------------------------------------------------------
11
11
  */
12
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
- return new (P || (P = Promise))(function (resolve, reject) {
15
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
- step((generator = generator.apply(thisArg, _arguments || [])).next());
19
- });
20
- };
21
- var __rest = (this && this.__rest) || function (s, e) {
22
- var t = {};
23
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
24
- t[p] = s[p];
25
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
26
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
27
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
28
- t[p[i]] = s[p[i]];
29
- }
30
- return t;
31
- };
32
12
  Object.defineProperty(exports, "__esModule", { value: true });
33
13
  exports.Api = exports.HttpClient = exports.ContentType = void 0;
34
14
  require("cross-fetch/polyfill");
15
+ function convertHttpResponse(response) {
16
+ if (response.error) {
17
+ throw new Error(response.error.detail);
18
+ }
19
+ else {
20
+ return response.data;
21
+ }
22
+ }
35
23
  var ContentType;
36
24
  (function (ContentType) {
37
25
  ContentType["Json"] = "application/json";
@@ -85,23 +73,30 @@ class HttpClient {
85
73
  this.abortControllers.delete(cancelToken);
86
74
  }
87
75
  };
88
- this.request = (_a) => __awaiter(this, void 0, void 0, function* () {
89
- var { body, secure, path, type, query, format, baseUrl, cancelToken } = _a, params = __rest(_a, ["body", "secure", "path", "type", "query", "format", "baseUrl", "cancelToken"]);
76
+ this.request = async ({ body, secure, path, type, query, format, baseUrl, cancelToken, ...params }) => {
90
77
  const secureParams = ((typeof secure === 'boolean' ? secure : this.baseApiParams.secure) &&
91
78
  this.securityWorker &&
92
- (yield this.securityWorker(this.securityData))) ||
79
+ (await this.securityWorker(this.securityData))) ||
93
80
  {};
94
81
  const requestParams = this.mergeRequestParams(params, secureParams);
95
82
  const queryString = query && this.toQueryString(query);
96
83
  const payloadFormatter = this.contentFormatters[type || ContentType.Json];
97
84
  const responseFormat = format || requestParams.format;
98
- return this.customFetch(`${baseUrl || this.baseUrl || ''}${path}${queryString ? `?${queryString}` : ''}`, Object.assign(Object.assign({}, requestParams), { headers: Object.assign(Object.assign({}, (type && type !== ContentType.FormData ? { 'Content-Type': type } : {})), (requestParams.headers || {})), signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0, body: typeof body === 'undefined' || body === null ? null : payloadFormatter(body) })).then((response) => __awaiter(this, void 0, void 0, function* () {
85
+ return this.customFetch(`${baseUrl || this.baseUrl || ''}${path}${queryString ? `?${queryString}` : ''}`, {
86
+ ...requestParams,
87
+ headers: {
88
+ ...(type && type !== ContentType.FormData ? { 'Content-Type': type } : {}),
89
+ ...(requestParams.headers || {})
90
+ },
91
+ signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,
92
+ body: typeof body === 'undefined' || body === null ? null : payloadFormatter(body)
93
+ }).then(async (response) => {
99
94
  const r = response;
100
95
  r.data = null;
101
96
  r.error = null;
102
97
  const data = !responseFormat
103
98
  ? r
104
- : yield response[responseFormat]()
99
+ : await response[responseFormat]()
105
100
  .then((data) => {
106
101
  if (r.ok) {
107
102
  r.data = data;
@@ -121,8 +116,8 @@ class HttpClient {
121
116
  if (!response.ok)
122
117
  throw data;
123
118
  return data;
124
- }));
125
- });
119
+ });
120
+ };
126
121
  Object.assign(this, apiConfig);
127
122
  }
128
123
  encodeQueryParam(key, value) {
@@ -148,13 +143,22 @@ class HttpClient {
148
143
  return queryString ? `?${queryString}` : '';
149
144
  }
150
145
  mergeRequestParams(params1, params2) {
151
- 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) || {})) });
146
+ return {
147
+ ...this.baseApiParams,
148
+ ...params1,
149
+ ...(params2 || {}),
150
+ headers: {
151
+ ...(this.baseApiParams.headers || {}),
152
+ ...(params1.headers || {}),
153
+ ...((params2 && params2.headers) || {})
154
+ }
155
+ };
152
156
  }
153
157
  }
154
158
  exports.HttpClient = HttpClient;
155
159
  /**
156
160
  * @title Alephium API
157
- * @version 1.3.0
161
+ * @version 1.4.0
158
162
  * @baseUrl {protocol}://{host}:{port}
159
163
  */
160
164
  class Api extends HttpClient {
@@ -169,7 +173,12 @@ class Api extends HttpClient {
169
173
  * @summary List available wallets
170
174
  * @request GET:/wallets
171
175
  */
172
- getWallets: (params = {}) => this.request(Object.assign({ path: `/wallets`, method: 'GET', format: 'json' }, params)),
176
+ getWallets: (params = {}) => this.request({
177
+ path: `/wallets`,
178
+ method: 'GET',
179
+ format: 'json',
180
+ ...params
181
+ }).then(convertHttpResponse),
173
182
  /**
174
183
  * No description
175
184
  *
@@ -178,7 +187,14 @@ class Api extends HttpClient {
178
187
  * @summary Restore a wallet from your mnemonic
179
188
  * @request PUT:/wallets
180
189
  */
181
- putWallets: (data, params = {}) => this.request(Object.assign({ path: `/wallets`, method: 'PUT', body: data, type: ContentType.Json, format: 'json' }, params)),
190
+ putWallets: (data, params = {}) => this.request({
191
+ path: `/wallets`,
192
+ method: 'PUT',
193
+ body: data,
194
+ type: ContentType.Json,
195
+ format: 'json',
196
+ ...params
197
+ }).then(convertHttpResponse),
182
198
  /**
183
199
  * @description A new wallet will be created and respond with a mnemonic. Make sure to keep that mnemonic safely as it will allows you to recover your wallet. Default mnemonic size is 24, (options: 12, 15, 18, 21, 24).
184
200
  *
@@ -187,7 +203,14 @@ class Api extends HttpClient {
187
203
  * @summary Create a new wallet
188
204
  * @request POST:/wallets
189
205
  */
190
- postWallets: (data, params = {}) => this.request(Object.assign({ path: `/wallets`, method: 'POST', body: data, type: ContentType.Json, format: 'json' }, params)),
206
+ postWallets: (data, params = {}) => this.request({
207
+ path: `/wallets`,
208
+ method: 'POST',
209
+ body: data,
210
+ type: ContentType.Json,
211
+ format: 'json',
212
+ ...params
213
+ }).then(convertHttpResponse),
191
214
  /**
192
215
  * No description
193
216
  *
@@ -196,7 +219,12 @@ class Api extends HttpClient {
196
219
  * @summary Get wallet's status
197
220
  * @request GET:/wallets/{wallet_name}
198
221
  */
199
- getWalletsWalletName: (walletName, params = {}) => this.request(Object.assign({ path: `/wallets/${walletName}`, method: 'GET', format: 'json' }, params)),
222
+ getWalletsWalletName: (walletName, params = {}) => this.request({
223
+ path: `/wallets/${walletName}`,
224
+ method: 'GET',
225
+ format: 'json',
226
+ ...params
227
+ }).then(convertHttpResponse),
200
228
  /**
201
229
  * No description
202
230
  *
@@ -205,7 +233,13 @@ class Api extends HttpClient {
205
233
  * @summary Delete your wallet file (can be recovered with your mnemonic)
206
234
  * @request DELETE:/wallets/{wallet_name}
207
235
  */
208
- deleteWalletsWalletName: (walletName, data, params = {}) => this.request(Object.assign({ path: `/wallets/${walletName}`, method: 'DELETE', body: data, type: ContentType.Json }, params)),
236
+ deleteWalletsWalletName: (walletName, data, params = {}) => this.request({
237
+ path: `/wallets/${walletName}`,
238
+ method: 'DELETE',
239
+ body: data,
240
+ type: ContentType.Json,
241
+ ...params
242
+ }).then(convertHttpResponse),
209
243
  /**
210
244
  * No description
211
245
  *
@@ -214,7 +248,11 @@ class Api extends HttpClient {
214
248
  * @summary Lock your wallet
215
249
  * @request POST:/wallets/{wallet_name}/lock
216
250
  */
217
- postWalletsWalletNameLock: (walletName, params = {}) => this.request(Object.assign({ path: `/wallets/${walletName}/lock`, method: 'POST' }, params)),
251
+ postWalletsWalletNameLock: (walletName, params = {}) => this.request({
252
+ path: `/wallets/${walletName}/lock`,
253
+ method: 'POST',
254
+ ...params
255
+ }).then(convertHttpResponse),
218
256
  /**
219
257
  * No description
220
258
  *
@@ -223,7 +261,13 @@ class Api extends HttpClient {
223
261
  * @summary Unlock your wallet
224
262
  * @request POST:/wallets/{wallet_name}/unlock
225
263
  */
226
- postWalletsWalletNameUnlock: (walletName, data, params = {}) => this.request(Object.assign({ path: `/wallets/${walletName}/unlock`, method: 'POST', body: data, type: ContentType.Json }, params)),
264
+ postWalletsWalletNameUnlock: (walletName, data, params = {}) => this.request({
265
+ path: `/wallets/${walletName}/unlock`,
266
+ method: 'POST',
267
+ body: data,
268
+ type: ContentType.Json,
269
+ ...params
270
+ }).then(convertHttpResponse),
227
271
  /**
228
272
  * No description
229
273
  *
@@ -232,7 +276,12 @@ class Api extends HttpClient {
232
276
  * @summary Get your total balance
233
277
  * @request GET:/wallets/{wallet_name}/balances
234
278
  */
235
- getWalletsWalletNameBalances: (walletName, query, params = {}) => this.request(Object.assign({ path: `/wallets/${walletName}/balances`, method: 'GET', query: query, format: 'json' }, params)),
279
+ getWalletsWalletNameBalances: (walletName, params = {}) => this.request({
280
+ path: `/wallets/${walletName}/balances`,
281
+ method: 'GET',
282
+ format: 'json',
283
+ ...params
284
+ }).then(convertHttpResponse),
236
285
  /**
237
286
  * No description
238
287
  *
@@ -241,7 +290,14 @@ class Api extends HttpClient {
241
290
  * @summary Reveal your mnemonic. !!! use it with caution !!!
242
291
  * @request POST:/wallets/{wallet_name}/reveal-mnemonic
243
292
  */
244
- postWalletsWalletNameRevealMnemonic: (walletName, data, params = {}) => this.request(Object.assign({ path: `/wallets/${walletName}/reveal-mnemonic`, method: 'POST', body: data, type: ContentType.Json, format: 'json' }, params)),
293
+ postWalletsWalletNameRevealMnemonic: (walletName, data, params = {}) => this.request({
294
+ path: `/wallets/${walletName}/reveal-mnemonic`,
295
+ method: 'POST',
296
+ body: data,
297
+ type: ContentType.Json,
298
+ format: 'json',
299
+ ...params
300
+ }).then(convertHttpResponse),
245
301
  /**
246
302
  * No description
247
303
  *
@@ -250,7 +306,14 @@ class Api extends HttpClient {
250
306
  * @summary Transfer ALPH from the active address
251
307
  * @request POST:/wallets/{wallet_name}/transfer
252
308
  */
253
- postWalletsWalletNameTransfer: (walletName, data, params = {}) => this.request(Object.assign({ path: `/wallets/${walletName}/transfer`, method: 'POST', body: data, type: ContentType.Json, format: 'json' }, params)),
309
+ postWalletsWalletNameTransfer: (walletName, data, params = {}) => this.request({
310
+ path: `/wallets/${walletName}/transfer`,
311
+ method: 'POST',
312
+ body: data,
313
+ type: ContentType.Json,
314
+ format: 'json',
315
+ ...params
316
+ }).then(convertHttpResponse),
254
317
  /**
255
318
  * No description
256
319
  *
@@ -259,7 +322,14 @@ class Api extends HttpClient {
259
322
  * @summary Transfer all unlocked ALPH from the active address to another address
260
323
  * @request POST:/wallets/{wallet_name}/sweep-active-address
261
324
  */
262
- postWalletsWalletNameSweepActiveAddress: (walletName, data, params = {}) => this.request(Object.assign({ path: `/wallets/${walletName}/sweep-active-address`, method: 'POST', body: data, type: ContentType.Json, format: 'json' }, params)),
325
+ postWalletsWalletNameSweepActiveAddress: (walletName, data, params = {}) => this.request({
326
+ path: `/wallets/${walletName}/sweep-active-address`,
327
+ method: 'POST',
328
+ body: data,
329
+ type: ContentType.Json,
330
+ format: 'json',
331
+ ...params
332
+ }).then(convertHttpResponse),
263
333
  /**
264
334
  * No description
265
335
  *
@@ -268,7 +338,14 @@ class Api extends HttpClient {
268
338
  * @summary Transfer unlocked ALPH from all addresses (including all mining addresses if applicable) to another address
269
339
  * @request POST:/wallets/{wallet_name}/sweep-all-addresses
270
340
  */
271
- postWalletsWalletNameSweepAllAddresses: (walletName, data, params = {}) => this.request(Object.assign({ path: `/wallets/${walletName}/sweep-all-addresses`, method: 'POST', body: data, type: ContentType.Json, format: 'json' }, params)),
341
+ postWalletsWalletNameSweepAllAddresses: (walletName, data, params = {}) => this.request({
342
+ path: `/wallets/${walletName}/sweep-all-addresses`,
343
+ method: 'POST',
344
+ body: data,
345
+ type: ContentType.Json,
346
+ format: 'json',
347
+ ...params
348
+ }).then(convertHttpResponse),
272
349
  /**
273
350
  * No description
274
351
  *
@@ -277,7 +354,14 @@ class Api extends HttpClient {
277
354
  * @summary Sign the given data and return back the signature
278
355
  * @request POST:/wallets/{wallet_name}/sign
279
356
  */
280
- postWalletsWalletNameSign: (walletName, data, params = {}) => this.request(Object.assign({ path: `/wallets/${walletName}/sign`, method: 'POST', body: data, type: ContentType.Json, format: 'json' }, params)),
357
+ postWalletsWalletNameSign: (walletName, data, params = {}) => this.request({
358
+ path: `/wallets/${walletName}/sign`,
359
+ method: 'POST',
360
+ body: data,
361
+ type: ContentType.Json,
362
+ format: 'json',
363
+ ...params
364
+ }).then(convertHttpResponse),
281
365
  /**
282
366
  * No description
283
367
  *
@@ -286,7 +370,12 @@ class Api extends HttpClient {
286
370
  * @summary List all your wallet's addresses
287
371
  * @request GET:/wallets/{wallet_name}/addresses
288
372
  */
289
- getWalletsWalletNameAddresses: (walletName, params = {}) => this.request(Object.assign({ path: `/wallets/${walletName}/addresses`, method: 'GET', format: 'json' }, params)),
373
+ getWalletsWalletNameAddresses: (walletName, params = {}) => this.request({
374
+ path: `/wallets/${walletName}/addresses`,
375
+ method: 'GET',
376
+ format: 'json',
377
+ ...params
378
+ }).then(convertHttpResponse),
290
379
  /**
291
380
  * No description
292
381
  *
@@ -295,7 +384,12 @@ class Api extends HttpClient {
295
384
  * @summary Get address' info
296
385
  * @request GET:/wallets/{wallet_name}/addresses/{address}
297
386
  */
298
- getWalletsWalletNameAddressesAddress: (walletName, address, params = {}) => this.request(Object.assign({ path: `/wallets/${walletName}/addresses/${address}`, method: 'GET', format: 'json' }, params)),
387
+ getWalletsWalletNameAddressesAddress: (walletName, address, params = {}) => this.request({
388
+ path: `/wallets/${walletName}/addresses/${address}`,
389
+ method: 'GET',
390
+ format: 'json',
391
+ ...params
392
+ }).then(convertHttpResponse),
299
393
  /**
300
394
  * @description This endpoint can only be called if the wallet was created with the `isMiner = true` flag
301
395
  *
@@ -304,7 +398,12 @@ class Api extends HttpClient {
304
398
  * @summary List all miner addresses per group
305
399
  * @request GET:/wallets/{wallet_name}/miner-addresses
306
400
  */
307
- getWalletsWalletNameMinerAddresses: (walletName, params = {}) => this.request(Object.assign({ path: `/wallets/${walletName}/miner-addresses`, method: 'GET', format: 'json' }, params)),
401
+ getWalletsWalletNameMinerAddresses: (walletName, params = {}) => this.request({
402
+ path: `/wallets/${walletName}/miner-addresses`,
403
+ method: 'GET',
404
+ format: 'json',
405
+ ...params
406
+ }).then(convertHttpResponse),
308
407
  /**
309
408
  * @description Cannot be called from a miner wallet
310
409
  *
@@ -313,7 +412,13 @@ class Api extends HttpClient {
313
412
  * @summary Derive your next address
314
413
  * @request POST:/wallets/{wallet_name}/derive-next-address
315
414
  */
316
- postWalletsWalletNameDeriveNextAddress: (walletName, query, params = {}) => this.request(Object.assign({ path: `/wallets/${walletName}/derive-next-address`, method: 'POST', query: query, format: 'json' }, params)),
415
+ postWalletsWalletNameDeriveNextAddress: (walletName, query, params = {}) => this.request({
416
+ path: `/wallets/${walletName}/derive-next-address`,
417
+ method: 'POST',
418
+ query: query,
419
+ format: 'json',
420
+ ...params
421
+ }).then(convertHttpResponse),
317
422
  /**
318
423
  * @description Your wallet need to have been created with the miner flag set to true
319
424
  *
@@ -322,7 +427,12 @@ class Api extends HttpClient {
322
427
  * @summary Derive your next miner addresses for each group
323
428
  * @request POST:/wallets/{wallet_name}/derive-next-miner-addresses
324
429
  */
325
- postWalletsWalletNameDeriveNextMinerAddresses: (walletName, params = {}) => this.request(Object.assign({ path: `/wallets/${walletName}/derive-next-miner-addresses`, method: 'POST', format: 'json' }, params)),
430
+ postWalletsWalletNameDeriveNextMinerAddresses: (walletName, params = {}) => this.request({
431
+ path: `/wallets/${walletName}/derive-next-miner-addresses`,
432
+ method: 'POST',
433
+ format: 'json',
434
+ ...params
435
+ }).then(convertHttpResponse),
326
436
  /**
327
437
  * No description
328
438
  *
@@ -331,7 +441,13 @@ class Api extends HttpClient {
331
441
  * @summary Choose the active address
332
442
  * @request POST:/wallets/{wallet_name}/change-active-address
333
443
  */
334
- postWalletsWalletNameChangeActiveAddress: (walletName, data, params = {}) => this.request(Object.assign({ path: `/wallets/${walletName}/change-active-address`, method: 'POST', body: data, type: ContentType.Json }, params))
444
+ postWalletsWalletNameChangeActiveAddress: (walletName, data, params = {}) => this.request({
445
+ path: `/wallets/${walletName}/change-active-address`,
446
+ method: 'POST',
447
+ body: data,
448
+ type: ContentType.Json,
449
+ ...params
450
+ }).then(convertHttpResponse)
335
451
  };
336
452
  this.infos = {
337
453
  /**
@@ -342,7 +458,12 @@ class Api extends HttpClient {
342
458
  * @summary Get info about that node
343
459
  * @request GET:/infos/node
344
460
  */
345
- getInfosNode: (params = {}) => this.request(Object.assign({ path: `/infos/node`, method: 'GET', format: 'json' }, params)),
461
+ getInfosNode: (params = {}) => this.request({
462
+ path: `/infos/node`,
463
+ method: 'GET',
464
+ format: 'json',
465
+ ...params
466
+ }).then(convertHttpResponse),
346
467
  /**
347
468
  * No description
348
469
  *
@@ -351,7 +472,12 @@ class Api extends HttpClient {
351
472
  * @summary Get version about that node
352
473
  * @request GET:/infos/version
353
474
  */
354
- getInfosVersion: (params = {}) => this.request(Object.assign({ path: `/infos/version`, method: 'GET', format: 'json' }, params)),
475
+ getInfosVersion: (params = {}) => this.request({
476
+ path: `/infos/version`,
477
+ method: 'GET',
478
+ format: 'json',
479
+ ...params
480
+ }).then(convertHttpResponse),
355
481
  /**
356
482
  * No description
357
483
  *
@@ -360,7 +486,12 @@ class Api extends HttpClient {
360
486
  * @summary Get key params about your blockchain
361
487
  * @request GET:/infos/chain-params
362
488
  */
363
- getInfosChainParams: (params = {}) => this.request(Object.assign({ path: `/infos/chain-params`, method: 'GET', format: 'json' }, params)),
489
+ getInfosChainParams: (params = {}) => this.request({
490
+ path: `/infos/chain-params`,
491
+ method: 'GET',
492
+ format: 'json',
493
+ ...params
494
+ }).then(convertHttpResponse),
364
495
  /**
365
496
  * No description
366
497
  *
@@ -369,7 +500,12 @@ class Api extends HttpClient {
369
500
  * @summary Get info about your own clique
370
501
  * @request GET:/infos/self-clique
371
502
  */
372
- getInfosSelfClique: (params = {}) => this.request(Object.assign({ path: `/infos/self-clique`, method: 'GET', format: 'json' }, params)),
503
+ getInfosSelfClique: (params = {}) => this.request({
504
+ path: `/infos/self-clique`,
505
+ method: 'GET',
506
+ format: 'json',
507
+ ...params
508
+ }).then(convertHttpResponse),
373
509
  /**
374
510
  * No description
375
511
  *
@@ -378,7 +514,12 @@ class Api extends HttpClient {
378
514
  * @summary Get infos about the inter cliques
379
515
  * @request GET:/infos/inter-clique-peer-info
380
516
  */
381
- getInfosInterCliquePeerInfo: (params = {}) => this.request(Object.assign({ path: `/infos/inter-clique-peer-info`, method: 'GET', format: 'json' }, params)),
517
+ getInfosInterCliquePeerInfo: (params = {}) => this.request({
518
+ path: `/infos/inter-clique-peer-info`,
519
+ method: 'GET',
520
+ format: 'json',
521
+ ...params
522
+ }).then(convertHttpResponse),
382
523
  /**
383
524
  * No description
384
525
  *
@@ -387,7 +528,12 @@ class Api extends HttpClient {
387
528
  * @summary Get discovered neighbors
388
529
  * @request GET:/infos/discovered-neighbors
389
530
  */
390
- getInfosDiscoveredNeighbors: (params = {}) => this.request(Object.assign({ path: `/infos/discovered-neighbors`, method: 'GET', format: 'json' }, params)),
531
+ getInfosDiscoveredNeighbors: (params = {}) => this.request({
532
+ path: `/infos/discovered-neighbors`,
533
+ method: 'GET',
534
+ format: 'json',
535
+ ...params
536
+ }).then(convertHttpResponse),
391
537
  /**
392
538
  * No description
393
539
  *
@@ -396,7 +542,12 @@ class Api extends HttpClient {
396
542
  * @summary Get the misbehaviors of peers
397
543
  * @request GET:/infos/misbehaviors
398
544
  */
399
- getInfosMisbehaviors: (params = {}) => this.request(Object.assign({ path: `/infos/misbehaviors`, method: 'GET', format: 'json' }, params)),
545
+ getInfosMisbehaviors: (params = {}) => this.request({
546
+ path: `/infos/misbehaviors`,
547
+ method: 'GET',
548
+ format: 'json',
549
+ ...params
550
+ }).then(convertHttpResponse),
400
551
  /**
401
552
  * No description
402
553
  *
@@ -405,7 +556,13 @@ class Api extends HttpClient {
405
556
  * @summary Ban/Unban given peers
406
557
  * @request POST:/infos/misbehaviors
407
558
  */
408
- postInfosMisbehaviors: (data, params = {}) => this.request(Object.assign({ path: `/infos/misbehaviors`, method: 'POST', body: data, type: ContentType.Json }, params)),
559
+ postInfosMisbehaviors: (data, params = {}) => this.request({
560
+ path: `/infos/misbehaviors`,
561
+ method: 'POST',
562
+ body: data,
563
+ type: ContentType.Json,
564
+ ...params
565
+ }).then(convertHttpResponse),
409
566
  /**
410
567
  * No description
411
568
  *
@@ -414,7 +571,12 @@ class Api extends HttpClient {
414
571
  * @summary Get the unreachable brokers
415
572
  * @request GET:/infos/unreachable
416
573
  */
417
- getInfosUnreachable: (params = {}) => this.request(Object.assign({ path: `/infos/unreachable`, method: 'GET', format: 'json' }, params)),
574
+ getInfosUnreachable: (params = {}) => this.request({
575
+ path: `/infos/unreachable`,
576
+ method: 'GET',
577
+ format: 'json',
578
+ ...params
579
+ }).then(convertHttpResponse),
418
580
  /**
419
581
  * No description
420
582
  *
@@ -423,7 +585,13 @@ class Api extends HttpClient {
423
585
  * @summary Set brokers to be unreachable/reachable
424
586
  * @request POST:/infos/discovery
425
587
  */
426
- postInfosDiscovery: (data, params = {}) => this.request(Object.assign({ path: `/infos/discovery`, method: 'POST', body: data, type: ContentType.Json }, params)),
588
+ postInfosDiscovery: (data, params = {}) => this.request({
589
+ path: `/infos/discovery`,
590
+ method: 'POST',
591
+ body: data,
592
+ type: ContentType.Json,
593
+ ...params
594
+ }).then(convertHttpResponse),
427
595
  /**
428
596
  * No description
429
597
  *
@@ -432,7 +600,13 @@ class Api extends HttpClient {
432
600
  * @summary Get history average hashrate on the given time interval
433
601
  * @request GET:/infos/history-hashrate
434
602
  */
435
- getInfosHistoryHashrate: (query, params = {}) => this.request(Object.assign({ path: `/infos/history-hashrate`, method: 'GET', query: query, format: 'json' }, params)),
603
+ getInfosHistoryHashrate: (query, params = {}) => this.request({
604
+ path: `/infos/history-hashrate`,
605
+ method: 'GET',
606
+ query: query,
607
+ format: 'json',
608
+ ...params
609
+ }).then(convertHttpResponse),
436
610
  /**
437
611
  * No description
438
612
  *
@@ -441,7 +615,13 @@ class Api extends HttpClient {
441
615
  * @summary Get average hashrate from `now - timespan(millis)` to `now`
442
616
  * @request GET:/infos/current-hashrate
443
617
  */
444
- getInfosCurrentHashrate: (query, params = {}) => this.request(Object.assign({ path: `/infos/current-hashrate`, method: 'GET', query: query, format: 'json' }, params))
618
+ getInfosCurrentHashrate: (query, params = {}) => this.request({
619
+ path: `/infos/current-hashrate`,
620
+ method: 'GET',
621
+ query: query,
622
+ format: 'json',
623
+ ...params
624
+ }).then(convertHttpResponse)
445
625
  };
446
626
  this.blockflow = {
447
627
  /**
@@ -452,7 +632,13 @@ class Api extends HttpClient {
452
632
  * @summary List blocks on the given time interval
453
633
  * @request GET:/blockflow
454
634
  */
455
- getBlockflow: (query, params = {}) => this.request(Object.assign({ path: `/blockflow`, method: 'GET', query: query, format: 'json' }, params)),
635
+ getBlockflow: (query, params = {}) => this.request({
636
+ path: `/blockflow`,
637
+ method: 'GET',
638
+ query: query,
639
+ format: 'json',
640
+ ...params
641
+ }).then(convertHttpResponse),
456
642
  /**
457
643
  * No description
458
644
  *
@@ -461,7 +647,12 @@ class Api extends HttpClient {
461
647
  * @summary Get a block with hash
462
648
  * @request GET:/blockflow/blocks/{block_hash}
463
649
  */
464
- getBlockflowBlocksBlockHash: (blockHash, params = {}) => this.request(Object.assign({ path: `/blockflow/blocks/${blockHash}`, method: 'GET', format: 'json' }, params)),
650
+ getBlockflowBlocksBlockHash: (blockHash, params = {}) => this.request({
651
+ path: `/blockflow/blocks/${blockHash}`,
652
+ method: 'GET',
653
+ format: 'json',
654
+ ...params
655
+ }).then(convertHttpResponse),
465
656
  /**
466
657
  * No description
467
658
  *
@@ -470,7 +661,13 @@ class Api extends HttpClient {
470
661
  * @summary Check if the block is in main chain
471
662
  * @request GET:/blockflow/is-block-in-main-chain
472
663
  */
473
- getBlockflowIsBlockInMainChain: (query, params = {}) => this.request(Object.assign({ path: `/blockflow/is-block-in-main-chain`, method: 'GET', query: query, format: 'json' }, params)),
664
+ getBlockflowIsBlockInMainChain: (query, params = {}) => this.request({
665
+ path: `/blockflow/is-block-in-main-chain`,
666
+ method: 'GET',
667
+ query: query,
668
+ format: 'json',
669
+ ...params
670
+ }).then(convertHttpResponse),
474
671
  /**
475
672
  * No description
476
673
  *
@@ -479,7 +676,13 @@ class Api extends HttpClient {
479
676
  * @summary Get all block's hashes at given height for given groups
480
677
  * @request GET:/blockflow/hashes
481
678
  */
482
- getBlockflowHashes: (query, params = {}) => this.request(Object.assign({ path: `/blockflow/hashes`, method: 'GET', query: query, format: 'json' }, params)),
679
+ getBlockflowHashes: (query, params = {}) => this.request({
680
+ path: `/blockflow/hashes`,
681
+ method: 'GET',
682
+ query: query,
683
+ format: 'json',
684
+ ...params
685
+ }).then(convertHttpResponse),
483
686
  /**
484
687
  * No description
485
688
  *
@@ -488,7 +691,13 @@ class Api extends HttpClient {
488
691
  * @summary Get infos about the chain from the given groups
489
692
  * @request GET:/blockflow/chain-info
490
693
  */
491
- getBlockflowChainInfo: (query, params = {}) => this.request(Object.assign({ path: `/blockflow/chain-info`, method: 'GET', query: query, format: 'json' }, params)),
694
+ getBlockflowChainInfo: (query, params = {}) => this.request({
695
+ path: `/blockflow/chain-info`,
696
+ method: 'GET',
697
+ query: query,
698
+ format: 'json',
699
+ ...params
700
+ }).then(convertHttpResponse),
492
701
  /**
493
702
  * No description
494
703
  *
@@ -497,7 +706,12 @@ class Api extends HttpClient {
497
706
  * @summary Get block header
498
707
  * @request GET:/blockflow/headers/{block_hash}
499
708
  */
500
- getBlockflowHeadersBlockHash: (blockHash, params = {}) => this.request(Object.assign({ path: `/blockflow/headers/${blockHash}`, method: 'GET', format: 'json' }, params))
709
+ getBlockflowHeadersBlockHash: (blockHash, params = {}) => this.request({
710
+ path: `/blockflow/headers/${blockHash}`,
711
+ method: 'GET',
712
+ format: 'json',
713
+ ...params
714
+ }).then(convertHttpResponse)
501
715
  };
502
716
  this.addresses = {
503
717
  /**
@@ -508,7 +722,12 @@ class Api extends HttpClient {
508
722
  * @summary Get the balance of an address
509
723
  * @request GET:/addresses/{address}/balance
510
724
  */
511
- getAddressesAddressBalance: (address, query, params = {}) => this.request(Object.assign({ path: `/addresses/${address}/balance`, method: 'GET', query: query, format: 'json' }, params)),
725
+ getAddressesAddressBalance: (address, params = {}) => this.request({
726
+ path: `/addresses/${address}/balance`,
727
+ method: 'GET',
728
+ format: 'json',
729
+ ...params
730
+ }).then(convertHttpResponse),
512
731
  /**
513
732
  * No description
514
733
  *
@@ -517,7 +736,12 @@ class Api extends HttpClient {
517
736
  * @summary Get the UTXOs of an address
518
737
  * @request GET:/addresses/{address}/utxos
519
738
  */
520
- getAddressesAddressUtxos: (address, query, params = {}) => this.request(Object.assign({ path: `/addresses/${address}/utxos`, method: 'GET', query: query, format: 'json' }, params)),
739
+ getAddressesAddressUtxos: (address, params = {}) => this.request({
740
+ path: `/addresses/${address}/utxos`,
741
+ method: 'GET',
742
+ format: 'json',
743
+ ...params
744
+ }).then(convertHttpResponse),
521
745
  /**
522
746
  * No description
523
747
  *
@@ -526,7 +750,12 @@ class Api extends HttpClient {
526
750
  * @summary Get the group of an address
527
751
  * @request GET:/addresses/{address}/group
528
752
  */
529
- getAddressesAddressGroup: (address, params = {}) => this.request(Object.assign({ path: `/addresses/${address}/group`, method: 'GET', format: 'json' }, params))
753
+ getAddressesAddressGroup: (address, params = {}) => this.request({
754
+ path: `/addresses/${address}/group`,
755
+ method: 'GET',
756
+ format: 'json',
757
+ ...params
758
+ }).then(convertHttpResponse)
530
759
  };
531
760
  this.transactions = {
532
761
  /**
@@ -537,7 +766,12 @@ class Api extends HttpClient {
537
766
  * @summary List unconfirmed transactions
538
767
  * @request GET:/transactions/unconfirmed
539
768
  */
540
- getTransactionsUnconfirmed: (params = {}) => this.request(Object.assign({ path: `/transactions/unconfirmed`, method: 'GET', format: 'json' }, params)),
769
+ getTransactionsUnconfirmed: (params = {}) => this.request({
770
+ path: `/transactions/unconfirmed`,
771
+ method: 'GET',
772
+ format: 'json',
773
+ ...params
774
+ }).then(convertHttpResponse),
541
775
  /**
542
776
  * No description
543
777
  *
@@ -546,7 +780,14 @@ class Api extends HttpClient {
546
780
  * @summary Build an unsigned transaction to a number of recipients
547
781
  * @request POST:/transactions/build
548
782
  */
549
- postTransactionsBuild: (data, params = {}) => this.request(Object.assign({ path: `/transactions/build`, method: 'POST', body: data, type: ContentType.Json, format: 'json' }, params)),
783
+ postTransactionsBuild: (data, params = {}) => this.request({
784
+ path: `/transactions/build`,
785
+ method: 'POST',
786
+ body: data,
787
+ type: ContentType.Json,
788
+ format: 'json',
789
+ ...params
790
+ }).then(convertHttpResponse),
550
791
  /**
551
792
  * No description
552
793
  *
@@ -555,7 +796,14 @@ class Api extends HttpClient {
555
796
  * @summary Build unsigned transactions to send all unlocked balanced of one address to another address
556
797
  * @request POST:/transactions/sweep-address/build
557
798
  */
558
- postTransactionsSweepAddressBuild: (data, params = {}) => this.request(Object.assign({ path: `/transactions/sweep-address/build`, method: 'POST', body: data, type: ContentType.Json, format: 'json' }, params)),
799
+ postTransactionsSweepAddressBuild: (data, params = {}) => this.request({
800
+ path: `/transactions/sweep-address/build`,
801
+ method: 'POST',
802
+ body: data,
803
+ type: ContentType.Json,
804
+ format: 'json',
805
+ ...params
806
+ }).then(convertHttpResponse),
559
807
  /**
560
808
  * No description
561
809
  *
@@ -564,7 +812,14 @@ class Api extends HttpClient {
564
812
  * @summary Submit a signed transaction
565
813
  * @request POST:/transactions/submit
566
814
  */
567
- postTransactionsSubmit: (data, params = {}) => this.request(Object.assign({ path: `/transactions/submit`, method: 'POST', body: data, type: ContentType.Json, format: 'json' }, params)),
815
+ postTransactionsSubmit: (data, params = {}) => this.request({
816
+ path: `/transactions/submit`,
817
+ method: 'POST',
818
+ body: data,
819
+ type: ContentType.Json,
820
+ format: 'json',
821
+ ...params
822
+ }).then(convertHttpResponse),
568
823
  /**
569
824
  * No description
570
825
  *
@@ -573,7 +828,14 @@ class Api extends HttpClient {
573
828
  * @summary Decode an unsigned transaction
574
829
  * @request POST:/transactions/decode-unsigned-tx
575
830
  */
576
- postTransactionsDecodeUnsignedTx: (data, params = {}) => this.request(Object.assign({ path: `/transactions/decode-unsigned-tx`, method: 'POST', body: data, type: ContentType.Json, format: 'json' }, params)),
831
+ postTransactionsDecodeUnsignedTx: (data, params = {}) => this.request({
832
+ path: `/transactions/decode-unsigned-tx`,
833
+ method: 'POST',
834
+ body: data,
835
+ type: ContentType.Json,
836
+ format: 'json',
837
+ ...params
838
+ }).then(convertHttpResponse),
577
839
  /**
578
840
  * No description
579
841
  *
@@ -582,7 +844,13 @@ class Api extends HttpClient {
582
844
  * @summary Get tx status
583
845
  * @request GET:/transactions/status
584
846
  */
585
- getTransactionsStatus: (query, params = {}) => this.request(Object.assign({ path: `/transactions/status`, method: 'GET', query: query, format: 'json' }, params))
847
+ getTransactionsStatus: (query, params = {}) => this.request({
848
+ path: `/transactions/status`,
849
+ method: 'GET',
850
+ query: query,
851
+ format: 'json',
852
+ ...params
853
+ }).then(convertHttpResponse)
586
854
  };
587
855
  this.contracts = {
588
856
  /**
@@ -593,16 +861,30 @@ class Api extends HttpClient {
593
861
  * @summary Compile a script
594
862
  * @request POST:/contracts/compile-script
595
863
  */
596
- postContractsCompileScript: (data, params = {}) => this.request(Object.assign({ path: `/contracts/compile-script`, method: 'POST', body: data, type: ContentType.Json, format: 'json' }, params)),
864
+ postContractsCompileScript: (data, params = {}) => this.request({
865
+ path: `/contracts/compile-script`,
866
+ method: 'POST',
867
+ body: data,
868
+ type: ContentType.Json,
869
+ format: 'json',
870
+ ...params
871
+ }).then(convertHttpResponse),
597
872
  /**
598
873
  * No description
599
874
  *
600
875
  * @tags Contracts
601
- * @name PostContractsUnsignedTxBuildScript
876
+ * @name PostContractsUnsignedTxExecuteScript
602
877
  * @summary Build an unsigned script
603
- * @request POST:/contracts/unsigned-tx/build-script
878
+ * @request POST:/contracts/unsigned-tx/execute-script
604
879
  */
605
- postContractsUnsignedTxBuildScript: (data, params = {}) => this.request(Object.assign({ path: `/contracts/unsigned-tx/build-script`, method: 'POST', body: data, type: ContentType.Json, format: 'json' }, params)),
880
+ postContractsUnsignedTxExecuteScript: (data, params = {}) => this.request({
881
+ path: `/contracts/unsigned-tx/execute-script`,
882
+ method: 'POST',
883
+ body: data,
884
+ type: ContentType.Json,
885
+ format: 'json',
886
+ ...params
887
+ }).then(convertHttpResponse),
606
888
  /**
607
889
  * No description
608
890
  *
@@ -611,16 +893,30 @@ class Api extends HttpClient {
611
893
  * @summary Compile a smart contract
612
894
  * @request POST:/contracts/compile-contract
613
895
  */
614
- postContractsCompileContract: (data, params = {}) => this.request(Object.assign({ path: `/contracts/compile-contract`, method: 'POST', body: data, type: ContentType.Json, format: 'json' }, params)),
896
+ postContractsCompileContract: (data, params = {}) => this.request({
897
+ path: `/contracts/compile-contract`,
898
+ method: 'POST',
899
+ body: data,
900
+ type: ContentType.Json,
901
+ format: 'json',
902
+ ...params
903
+ }).then(convertHttpResponse),
615
904
  /**
616
905
  * No description
617
906
  *
618
907
  * @tags Contracts
619
- * @name PostContractsUnsignedTxBuildContract
908
+ * @name PostContractsUnsignedTxDeployContract
620
909
  * @summary Build an unsigned contract
621
- * @request POST:/contracts/unsigned-tx/build-contract
910
+ * @request POST:/contracts/unsigned-tx/deploy-contract
622
911
  */
623
- postContractsUnsignedTxBuildContract: (data, params = {}) => this.request(Object.assign({ path: `/contracts/unsigned-tx/build-contract`, method: 'POST', body: data, type: ContentType.Json, format: 'json' }, params)),
912
+ postContractsUnsignedTxDeployContract: (data, params = {}) => this.request({
913
+ path: `/contracts/unsigned-tx/deploy-contract`,
914
+ method: 'POST',
915
+ body: data,
916
+ type: ContentType.Json,
917
+ format: 'json',
918
+ ...params
919
+ }).then(convertHttpResponse),
624
920
  /**
625
921
  * No description
626
922
  *
@@ -629,7 +925,13 @@ class Api extends HttpClient {
629
925
  * @summary Get contract state
630
926
  * @request GET:/contracts/{address}/state
631
927
  */
632
- getContractsAddressState: (address, query, params = {}) => this.request(Object.assign({ path: `/contracts/${address}/state`, method: 'GET', query: query, format: 'json' }, params)),
928
+ getContractsAddressState: (address, query, params = {}) => this.request({
929
+ path: `/contracts/${address}/state`,
930
+ method: 'GET',
931
+ query: query,
932
+ format: 'json',
933
+ ...params
934
+ }).then(convertHttpResponse),
633
935
  /**
634
936
  * No description
635
937
  *
@@ -638,7 +940,30 @@ class Api extends HttpClient {
638
940
  * @summary Test contract
639
941
  * @request POST:/contracts/test-contract
640
942
  */
641
- postContractsTestContract: (data, params = {}) => this.request(Object.assign({ path: `/contracts/test-contract`, method: 'POST', body: data, type: ContentType.Json, format: 'json' }, params))
943
+ postContractsTestContract: (data, params = {}) => this.request({
944
+ path: `/contracts/test-contract`,
945
+ method: 'POST',
946
+ body: data,
947
+ type: ContentType.Json,
948
+ format: 'json',
949
+ ...params
950
+ }).then(convertHttpResponse),
951
+ /**
952
+ * No description
953
+ *
954
+ * @tags Contracts
955
+ * @name PostContractsCallContract
956
+ * @summary Call contract
957
+ * @request POST:/contracts/call-contract
958
+ */
959
+ postContractsCallContract: (data, params = {}) => this.request({
960
+ path: `/contracts/call-contract`,
961
+ method: 'POST',
962
+ body: data,
963
+ type: ContentType.Json,
964
+ format: 'json',
965
+ ...params
966
+ }).then(convertHttpResponse)
642
967
  };
643
968
  this.multisig = {
644
969
  /**
@@ -649,7 +974,14 @@ class Api extends HttpClient {
649
974
  * @summary Create the multisig address and unlock script
650
975
  * @request POST:/multisig/address
651
976
  */
652
- postMultisigAddress: (data, params = {}) => this.request(Object.assign({ path: `/multisig/address`, method: 'POST', body: data, type: ContentType.Json, format: 'json' }, params)),
977
+ postMultisigAddress: (data, params = {}) => this.request({
978
+ path: `/multisig/address`,
979
+ method: 'POST',
980
+ body: data,
981
+ type: ContentType.Json,
982
+ format: 'json',
983
+ ...params
984
+ }).then(convertHttpResponse),
653
985
  /**
654
986
  * No description
655
987
  *
@@ -658,7 +990,14 @@ class Api extends HttpClient {
658
990
  * @summary Build a multisig unsigned transaction
659
991
  * @request POST:/multisig/build
660
992
  */
661
- postMultisigBuild: (data, params = {}) => this.request(Object.assign({ path: `/multisig/build`, method: 'POST', body: data, type: ContentType.Json, format: 'json' }, params)),
993
+ postMultisigBuild: (data, params = {}) => this.request({
994
+ path: `/multisig/build`,
995
+ method: 'POST',
996
+ body: data,
997
+ type: ContentType.Json,
998
+ format: 'json',
999
+ ...params
1000
+ }).then(convertHttpResponse),
662
1001
  /**
663
1002
  * No description
664
1003
  *
@@ -667,7 +1006,14 @@ class Api extends HttpClient {
667
1006
  * @summary Submit a multi-signed transaction
668
1007
  * @request POST:/multisig/submit
669
1008
  */
670
- postMultisigSubmit: (data, params = {}) => this.request(Object.assign({ path: `/multisig/submit`, method: 'POST', body: data, type: ContentType.Json, format: 'json' }, params))
1009
+ postMultisigSubmit: (data, params = {}) => this.request({
1010
+ path: `/multisig/submit`,
1011
+ method: 'POST',
1012
+ body: data,
1013
+ type: ContentType.Json,
1014
+ format: 'json',
1015
+ ...params
1016
+ }).then(convertHttpResponse)
671
1017
  };
672
1018
  this.utils = {
673
1019
  /**
@@ -678,7 +1024,14 @@ class Api extends HttpClient {
678
1024
  * @summary Verify the SecP256K1 signature of some data
679
1025
  * @request POST:/utils/verify-signature
680
1026
  */
681
- postUtilsVerifySignature: (data, params = {}) => this.request(Object.assign({ path: `/utils/verify-signature`, method: 'POST', body: data, type: ContentType.Json, format: 'json' }, params)),
1027
+ postUtilsVerifySignature: (data, params = {}) => this.request({
1028
+ path: `/utils/verify-signature`,
1029
+ method: 'POST',
1030
+ body: data,
1031
+ type: ContentType.Json,
1032
+ format: 'json',
1033
+ ...params
1034
+ }).then(convertHttpResponse),
682
1035
  /**
683
1036
  * No description
684
1037
  *
@@ -687,7 +1040,11 @@ class Api extends HttpClient {
687
1040
  * @summary Check and repair the indexing of block hashes
688
1041
  * @request PUT:/utils/check-hash-indexing
689
1042
  */
690
- putUtilsCheckHashIndexing: (params = {}) => this.request(Object.assign({ path: `/utils/check-hash-indexing`, method: 'PUT' }, params))
1043
+ putUtilsCheckHashIndexing: (params = {}) => this.request({
1044
+ path: `/utils/check-hash-indexing`,
1045
+ method: 'PUT',
1046
+ ...params
1047
+ }).then(convertHttpResponse)
691
1048
  };
692
1049
  this.miners = {
693
1050
  /**
@@ -698,7 +1055,13 @@ class Api extends HttpClient {
698
1055
  * @summary Execute an action on CPU miner. !!! for test only !!!
699
1056
  * @request POST:/miners/cpu-mining
700
1057
  */
701
- postMinersCpuMining: (query, params = {}) => this.request(Object.assign({ path: `/miners/cpu-mining`, method: 'POST', query: query, format: 'json' }, params)),
1058
+ postMinersCpuMining: (query, params = {}) => this.request({
1059
+ path: `/miners/cpu-mining`,
1060
+ method: 'POST',
1061
+ query: query,
1062
+ format: 'json',
1063
+ ...params
1064
+ }).then(convertHttpResponse),
702
1065
  /**
703
1066
  * No description
704
1067
  *
@@ -707,7 +1070,12 @@ class Api extends HttpClient {
707
1070
  * @summary List miner's addresses
708
1071
  * @request GET:/miners/addresses
709
1072
  */
710
- getMinersAddresses: (params = {}) => this.request(Object.assign({ path: `/miners/addresses`, method: 'GET', format: 'json' }, params)),
1073
+ getMinersAddresses: (params = {}) => this.request({
1074
+ path: `/miners/addresses`,
1075
+ method: 'GET',
1076
+ format: 'json',
1077
+ ...params
1078
+ }).then(convertHttpResponse),
711
1079
  /**
712
1080
  * No description
713
1081
  *
@@ -716,45 +1084,59 @@ class Api extends HttpClient {
716
1084
  * @summary Update miner's addresses, but better to use user.conf instead
717
1085
  * @request PUT:/miners/addresses
718
1086
  */
719
- putMinersAddresses: (data, params = {}) => this.request(Object.assign({ path: `/miners/addresses`, method: 'PUT', body: data, type: ContentType.Json }, params))
1087
+ putMinersAddresses: (data, params = {}) => this.request({
1088
+ path: `/miners/addresses`,
1089
+ method: 'PUT',
1090
+ body: data,
1091
+ type: ContentType.Json,
1092
+ ...params
1093
+ }).then(convertHttpResponse)
720
1094
  };
721
1095
  this.events = {
722
1096
  /**
723
1097
  * No description
724
1098
  *
725
1099
  * @tags Events
726
- * @name GetEventsContractInBlock
727
- * @summary Get events for a contract within a block
728
- * @request GET:/events/contract/in-block
729
- */
730
- getEventsContractInBlock: (query, params = {}) => this.request(Object.assign({ path: `/events/contract/in-block`, method: 'GET', query: query, format: 'json' }, params)),
731
- /**
732
- * No description
733
- *
734
- * @tags Events
735
- * @name GetEventsContractWithinBlocks
736
- * @summary Get events for a contract within a range of blocks
737
- * @request GET:/events/contract/within-blocks
738
- */
739
- getEventsContractWithinBlocks: (query, params = {}) => this.request(Object.assign({ path: `/events/contract/within-blocks`, method: 'GET', query: query, format: 'json' }, params)),
1100
+ * @name GetEventsContractContractaddress
1101
+ * @summary Get events for a contract within a counter range
1102
+ * @request GET:/events/contract/{contractAddress}
1103
+ */
1104
+ getEventsContractContractaddress: (contractAddress, query, params = {}) => this.request({
1105
+ path: `/events/contract/${contractAddress}`,
1106
+ method: 'GET',
1107
+ query: query,
1108
+ format: 'json',
1109
+ ...params
1110
+ }).then(convertHttpResponse),
740
1111
  /**
741
1112
  * No description
742
1113
  *
743
1114
  * @tags Events
744
- * @name GetEventsContractWithinTimeInterval
745
- * @summary Get events for a contract within a time interval
746
- * @request GET:/events/contract/within-time-interval
1115
+ * @name GetEventsContractContractaddressCurrentCount
1116
+ * @summary Get current value of the events counter for a contract
1117
+ * @request GET:/events/contract/{contractAddress}/current-count
747
1118
  */
748
- getEventsContractWithinTimeInterval: (query, params = {}) => this.request(Object.assign({ path: `/events/contract/within-time-interval`, method: 'GET', query: query, format: 'json' }, params)),
1119
+ getEventsContractContractaddressCurrentCount: (contractAddress, params = {}) => this.request({
1120
+ path: `/events/contract/${contractAddress}/current-count`,
1121
+ method: 'GET',
1122
+ format: 'json',
1123
+ ...params
1124
+ }).then(convertHttpResponse),
749
1125
  /**
750
1126
  * No description
751
1127
  *
752
1128
  * @tags Events
753
- * @name GetEventsTxScript
1129
+ * @name GetEventsTxIdTxid
754
1130
  * @summary Get events for a TxScript
755
- * @request GET:/events/tx-script
756
- */
757
- getEventsTxScript: (query, params = {}) => this.request(Object.assign({ path: `/events/tx-script`, method: 'GET', query: query, format: 'json' }, params))
1131
+ * @request GET:/events/tx-id/{txId}
1132
+ */
1133
+ getEventsTxIdTxid: (txId, query, params = {}) => this.request({
1134
+ path: `/events/tx-id/${txId}`,
1135
+ method: 'GET',
1136
+ query: query,
1137
+ format: 'json',
1138
+ ...params
1139
+ }).then(convertHttpResponse)
758
1140
  };
759
1141
  }
760
1142
  }