@alephium/web3 0.2.0-rc.14 → 0.2.0-rc.16

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.
@@ -172,12 +172,16 @@ class Project {
172
172
  contracts.forEach((c) => {
173
173
  files.set(c.sourceFile.contractPath, {
174
174
  sourceCodeHash: c.sourceFile.sourceCodeHash,
175
+ bytecodeDebugPatch: c.artifact.bytecodeDebugPatch,
176
+ codeHashDebug: c.artifact.codeHashDebug,
175
177
  warnings: c.warnings
176
178
  });
177
179
  });
178
180
  scripts.forEach((s) => {
179
181
  files.set(s.sourceFile.contractPath, {
180
182
  sourceCodeHash: s.sourceFile.sourceCodeHash,
183
+ bytecodeDebugPatch: s.artifact.bytecodeDebugPatch,
184
+ codeHashDebug: '',
181
185
  warnings: s.warnings
182
186
  });
183
187
  });
@@ -185,6 +189,8 @@ class Project {
185
189
  sourceFiles.slice(compiledSize).forEach((c) => {
186
190
  files.set(c.contractPath, {
187
191
  sourceCodeHash: c.sourceCodeHash,
192
+ bytecodeDebugPatch: '',
193
+ codeHashDebug: '',
188
194
  warnings: []
189
195
  });
190
196
  });
@@ -243,7 +249,7 @@ class Project {
243
249
  await this.projectArtifact.saveToFile(this.artifactsRootDir);
244
250
  }
245
251
  contractByCodeHash(codeHash) {
246
- const contract = this.contracts.find((c) => c.artifact.codeHash === codeHash);
252
+ const contract = this.contracts.find((c) => c.artifact.codeHash === codeHash || c.artifact.codeHashDebug == codeHash);
247
253
  if (typeof contract === 'undefined') {
248
254
  throw new Error(`Unknown code with code hash: ${codeHash}`);
249
255
  }
@@ -284,11 +290,11 @@ class Project {
284
290
  const warnings = info.warnings;
285
291
  const artifactDir = file.getArtifactPath(artifactsRootDir);
286
292
  if (file.type === SourceType.Contract) {
287
- const artifact = await Contract.fromArtifactFile(artifactDir);
293
+ const artifact = await Contract.fromArtifactFile(artifactDir, info.bytecodeDebugPatch, info.codeHashDebug);
288
294
  contracts.push(new Compiled(file, artifact, warnings));
289
295
  }
290
296
  else if (file.type === SourceType.Script) {
291
- const artifact = await Script.fromArtifactFile(artifactDir);
297
+ const artifact = await Script.fromArtifactFile(artifactDir, info.bytecodeDebugPatch);
292
298
  scripts.push(new Compiled(file, artifact, warnings));
293
299
  }
294
300
  }
@@ -385,15 +391,18 @@ class Artifact {
385
391
  }
386
392
  exports.Artifact = Artifact;
387
393
  class Contract extends Artifact {
388
- constructor(name, bytecode, codeHash, fieldsSig, eventsSig, functions) {
394
+ constructor(name, bytecode, bytecodeDebugPatch, codeHash, codeHashDebug, fieldsSig, eventsSig, functions) {
389
395
  super(name, functions);
390
396
  this.bytecode = bytecode;
397
+ this.bytecodeDebugPatch = bytecodeDebugPatch;
391
398
  this.codeHash = codeHash;
392
399
  this.fieldsSig = fieldsSig;
393
400
  this.eventsSig = eventsSig;
401
+ this.bytecodeDebug = ralph.buildDebugBytecode(this.bytecode, this.bytecodeDebugPatch);
402
+ this.codeHashDebug = codeHashDebug;
394
403
  }
395
404
  // TODO: safely parse json
396
- static fromJson(artifact) {
405
+ static fromJson(artifact, bytecodeDebugPatch = '', codeHashDebug = '') {
397
406
  if (artifact.name == null ||
398
407
  artifact.bytecode == null ||
399
408
  artifact.codeHash == null ||
@@ -402,17 +411,17 @@ class Contract extends Artifact {
402
411
  artifact.functions == null) {
403
412
  throw Error('The artifact JSON for contract is incomplete');
404
413
  }
405
- const contract = new Contract(artifact.name, artifact.bytecode, artifact.codeHash, artifact.fieldsSig, artifact.eventsSig, artifact.functions);
414
+ const contract = new Contract(artifact.name, artifact.bytecode, bytecodeDebugPatch, artifact.codeHash, codeHashDebug ? codeHashDebug : artifact.codeHash, artifact.fieldsSig, artifact.eventsSig, artifact.functions);
406
415
  return contract;
407
416
  }
408
417
  static fromCompileResult(result) {
409
- return new Contract(result.name, result.bytecode, result.codeHash, result.fields, result.events, result.functions);
418
+ return new Contract(result.name, result.bytecode, result.bytecodeDebugPatch, result.codeHash, result.codeHashDebug, result.fields, result.events, result.functions);
410
419
  }
411
420
  // support both 'code.ral' and 'code.ral.json'
412
- static async fromArtifactFile(path) {
421
+ static async fromArtifactFile(path, bytecodeDebugPatch, codeHashDebug) {
413
422
  const content = await fs_2.promises.readFile(path);
414
423
  const artifact = JSON.parse(content.toString());
415
- return Contract.fromJson(artifact);
424
+ return Contract.fromJson(artifact, bytecodeDebugPatch, codeHashDebug);
416
425
  }
417
426
  async fetchState(address, group) {
418
427
  const state = await Project.currentProject.nodeProvider.contracts.getContractsAddressState(address, {
@@ -450,11 +459,20 @@ class Contract extends Artifact {
450
459
  bytes[0] = 3;
451
460
  return utils_1.bs58.encode(bytes);
452
461
  }
453
- async _test(funcName, params, expectPublic, accessType) {
462
+ _printDebugMessages(funcName, messages) {
463
+ if (messages.length != 0) {
464
+ console.log(`Testing ${this.name}.${funcName}:`);
465
+ messages.forEach((m) => console.log(`Debug - ${m.contractAddress} - ${m.message}`));
466
+ }
467
+ }
468
+ async _test(funcName, params, expectPublic, accessType, printDebugMessages) {
454
469
  const apiParams = this.toTestContract(funcName, params);
455
470
  const apiResult = await Project.currentProject.nodeProvider.contracts.postContractsTestContract(apiParams);
456
471
  const methodIndex = typeof params.testMethodIndex !== 'undefined' ? params.testMethodIndex : this.getMethodIndex(funcName);
457
472
  const isPublic = this.functions[`${methodIndex}`].isPublic;
473
+ if (printDebugMessages) {
474
+ this._printDebugMessages(funcName, apiResult.debugMessages);
475
+ }
458
476
  if (isPublic === expectPublic) {
459
477
  const result = await this.fromTestContractResult(methodIndex, apiResult);
460
478
  return result;
@@ -463,11 +481,11 @@ class Contract extends Artifact {
463
481
  throw new Error(`The test method ${funcName} is not ${accessType}`);
464
482
  }
465
483
  }
466
- async testPublicMethod(funcName, params) {
467
- return this._test(funcName, params, true, 'public');
484
+ async testPublicMethod(funcName, params, printDebugMessages = true) {
485
+ return this._test(funcName, params, true, 'public', printDebugMessages);
468
486
  }
469
- async testPrivateMethod(funcName, params) {
470
- return this._test(funcName, params, false, 'private');
487
+ async testPrivateMethod(funcName, params, printDebugMessages = true) {
488
+ return this._test(funcName, params, false, 'private', printDebugMessages);
471
489
  }
472
490
  toApiFields(fields) {
473
491
  if (typeof fields === 'undefined') {
@@ -499,7 +517,7 @@ class Contract extends Artifact {
499
517
  return {
500
518
  group: params.group,
501
519
  address: params.address,
502
- bytecode: this.bytecode,
520
+ bytecode: this.bytecodeDebug,
503
521
  initialFields: this.toApiFields(params.initialFields),
504
522
  initialAsset: typeof params.initialAsset !== 'undefined' ? toApiAsset(params.initialAsset) : undefined,
505
523
  methodIndex: this.getMethodIndex(funcName),
@@ -547,6 +565,7 @@ class Contract extends Artifact {
547
565
  return {
548
566
  address: result.address,
549
567
  contractId: (0, utils_1.binToHex)((0, utils_1.contractIdFromAddress)(result.address)),
568
+ contractAddress: result.address,
550
569
  returns: (0, api_1.fromApiArray)(result.returns, this.functions[`${methodIndex}`].returnTypes),
551
570
  gasUsed: result.gasUsed,
552
571
  contracts: await Promise.all(result.contracts.map((contract) => this.fromApiContractState(contract))),
@@ -560,7 +579,8 @@ class Contract extends Artifact {
560
579
  else {
561
580
  throw Error(`Cannot find codeHash for the contract address: ${contractAddress}`);
562
581
  }
563
- }))
582
+ })),
583
+ debugMessages: result.debugMessages
564
584
  };
565
585
  }
566
586
  async paramsForDeployment(params) {
@@ -600,28 +620,29 @@ Contract.ContractDestroyedEvent = {
600
620
  fieldTypes: ['Address']
601
621
  };
602
622
  class Script extends Artifact {
603
- constructor(name, bytecodeTemplate, fieldsSig, functions) {
623
+ constructor(name, bytecodeTemplate, bytecodeDebugPatch, fieldsSig, functions) {
604
624
  super(name, functions);
605
625
  this.bytecodeTemplate = bytecodeTemplate;
626
+ this.bytecodeDebugPatch = bytecodeDebugPatch;
606
627
  this.fieldsSig = fieldsSig;
607
628
  }
608
629
  static fromCompileResult(result) {
609
- return new Script(result.name, result.bytecodeTemplate, result.fields, result.functions);
630
+ return new Script(result.name, result.bytecodeTemplate, result.bytecodeDebugPatch, result.fields, result.functions);
610
631
  }
611
632
  // TODO: safely parse json
612
- static fromJson(artifact) {
633
+ static fromJson(artifact, bytecodeDebugPatch = '') {
613
634
  if (artifact.name == null ||
614
635
  artifact.bytecodeTemplate == null ||
615
636
  artifact.fieldsSig == null ||
616
637
  artifact.functions == null) {
617
638
  throw Error('The artifact JSON for script is incomplete');
618
639
  }
619
- return new Script(artifact.name, artifact.bytecodeTemplate, artifact.fieldsSig, artifact.functions);
640
+ return new Script(artifact.name, artifact.bytecodeTemplate, bytecodeDebugPatch, artifact.fieldsSig, artifact.functions);
620
641
  }
621
- static async fromArtifactFile(path) {
642
+ static async fromArtifactFile(path, bytecodeDebugPatch) {
622
643
  const content = await fs_2.promises.readFile(path);
623
644
  const artifact = JSON.parse(content.toString());
624
- return this.fromJson(artifact);
645
+ return this.fromJson(artifact, bytecodeDebugPatch);
625
646
  }
626
647
  toString() {
627
648
  const object = {
@@ -10,3 +10,4 @@ export declare function encodeScriptField(tpe: string, value: Val): Uint8Array;
10
10
  export declare function buildScriptByteCode(bytecodeTemplate: string, fields: Fields, fieldsSig: FieldsSig): string;
11
11
  export declare function buildContractByteCode(bytecode: string, fields: Fields, fieldsSig: FieldsSig): string;
12
12
  export declare function encodeContractField(tpe: string, value: Val): Uint8Array[];
13
+ export declare function buildDebugBytecode(bytecode: string, bytecodePatch: string): string;
@@ -18,7 +18,7 @@ along with the library. If not, see <http://www.gnu.org/licenses/>.
18
18
  */
19
19
  var _a;
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.encodeContractField = exports.buildContractByteCode = exports.buildScriptByteCode = exports.encodeScriptField = exports.encodeScriptFieldAsString = exports.encodeAddress = exports.encodeByteVec = exports.encodeU256 = exports.encodeI256 = exports.encodeBool = void 0;
21
+ exports.buildDebugBytecode = exports.encodeContractField = exports.buildContractByteCode = exports.buildScriptByteCode = exports.encodeScriptField = exports.encodeScriptFieldAsString = exports.encodeAddress = exports.encodeByteVec = exports.encodeU256 = exports.encodeI256 = exports.encodeBool = void 0;
22
22
  const buffer_1 = require("buffer/");
23
23
  const utils_1 = require("../utils");
24
24
  const bigIntZero = BigInt(0);
@@ -343,6 +343,32 @@ exports.encodeContractField = encodeContractField;
343
343
  function invalidVal(tpe, value) {
344
344
  return Error(`Invalid API value ${value} for type ${tpe}`);
345
345
  }
346
+ function buildDebugBytecode(bytecode, bytecodePatch) {
347
+ if (bytecodePatch === '') {
348
+ return bytecode;
349
+ }
350
+ const pattern = /[=+-][0-9a-f]*/g;
351
+ let result = '';
352
+ let index = 0;
353
+ for (const parts of bytecodePatch.matchAll(pattern)) {
354
+ const part = parts[0];
355
+ const diffType = part[0];
356
+ if (diffType === '=') {
357
+ const length = parseInt(part.substring(1));
358
+ result = result + bytecode.slice(index, index + length);
359
+ index = index + length;
360
+ }
361
+ else if (diffType === '+') {
362
+ result = result + part.substring(1);
363
+ }
364
+ else {
365
+ const length = parseInt(part.substring(1));
366
+ index = index + length;
367
+ }
368
+ }
369
+ return result;
370
+ }
371
+ exports.buildDebugBytecode = buildDebugBytecode;
346
372
  // export function buildContractByteCode(
347
373
  // compiled: node.TemplateContractByteCode,
348
374
  // templateVariables: TemplateVariables
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alephium/web3",
3
- "version": "0.2.0-rc.14",
3
+ "version": "0.2.0-rc.16",
4
4
  "description": "A JS/TS library to interact with the Alephium platform",
5
5
  "license": "GPL",
6
6
  "main": "dist/src/index.js",
@@ -27,8 +27,8 @@
27
27
  },
28
28
  "author": "Alephium dev <dev@alephium.org>",
29
29
  "config": {
30
- "alephium_version": "1.5.0-rc8",
31
- "explorer_backend_version": "1.7.1"
30
+ "alephium_version": "1.5.0-rc9",
31
+ "explorer_backend_version": "1.9.0-rc0"
32
32
  },
33
33
  "scripts": {
34
34
  "build": "rm -rf dist/* && npx tsc --build . && webpack",
@@ -437,9 +437,13 @@ export interface ChangeActiveAddress {
437
437
  export interface CompileContractResult {
438
438
  name: string
439
439
  bytecode: string
440
+ bytecodeDebugPatch: string
440
441
 
441
442
  /** @format 32-byte-hash */
442
443
  codeHash: string
444
+
445
+ /** @format 32-byte-hash */
446
+ codeHashDebug: string
443
447
  fields: FieldsSig
444
448
  functions: FunctionSig[]
445
449
  events: EventSig[]
@@ -454,6 +458,7 @@ export interface CompileProjectResult {
454
458
  export interface CompileScriptResult {
455
459
  name: string
456
460
  bytecodeTemplate: string
461
+ bytecodeDebugPatch: string
457
462
  fields: FieldsSig
458
463
  functions: FunctionSig[]
459
464
  warnings: string[]
@@ -574,6 +579,12 @@ export interface ContractState {
574
579
  asset: AssetState
575
580
  }
576
581
 
582
+ export interface DebugMessage {
583
+ /** @format address */
584
+ contractAddress: string
585
+ message: string
586
+ }
587
+
577
588
  export interface DecodeUnsignedTx {
578
589
  unsignedTx: string
579
590
  }
@@ -895,6 +906,7 @@ export interface TestContractResult {
895
906
  txInputs: string[]
896
907
  txOutputs: Output[]
897
908
  events: ContractEventByTxId[]
909
+ debugMessages: DebugMessage[]
898
910
  }
899
911
 
900
912
  export interface TestInputAsset {
@@ -28,6 +28,29 @@ export interface AddressInfo {
28
28
  txNumber: number
29
29
  }
30
30
 
31
+ export interface AssetOutput {
32
+ /** @format int32 */
33
+ hint: number
34
+
35
+ /** @format 32-byte-hash */
36
+ key: string
37
+
38
+ /** @format uint256 */
39
+ attoAlphAmount: string
40
+ address: string
41
+ tokens?: Token[]
42
+
43
+ /** @format int64 */
44
+ lockTime?: number
45
+
46
+ /** @format hex-string */
47
+ message?: string
48
+
49
+ /** @format 32-byte-hash */
50
+ spent?: string
51
+ type: string
52
+ }
53
+
31
54
  export interface BadRequest {
32
55
  detail: string
33
56
  }
@@ -76,6 +99,23 @@ export interface ConfirmedTransaction {
76
99
  type: string
77
100
  }
78
101
 
102
+ export interface ContractOutput {
103
+ /** @format int32 */
104
+ hint: number
105
+
106
+ /** @format 32-byte-hash */
107
+ key: string
108
+
109
+ /** @format uint256 */
110
+ attoAlphAmount: string
111
+ address: string
112
+ tokens?: Token[]
113
+
114
+ /** @format 32-byte-hash */
115
+ spent?: string
116
+ type: string
117
+ }
118
+
79
119
  export interface ExplorerInfo {
80
120
  releaseVersion: string
81
121
  commit: string
@@ -90,14 +130,14 @@ export interface Hashrate {
90
130
 
91
131
  export interface Input {
92
132
  outputRef: OutputRef
93
- unlockScript?: string
94
133
 
95
- /** @format 32-byte-hash */
96
- txHashRef: string
97
- address: string
134
+ /** @format hex-string */
135
+ unlockScript?: string
136
+ address?: string
98
137
 
99
138
  /** @format uint256 */
100
- amount: string
139
+ attoAlphAmount?: string
140
+ tokens?: Token[]
101
141
  }
102
142
 
103
143
  export interface InternalServerError {
@@ -110,28 +150,17 @@ export interface ListBlocks {
110
150
  blocks?: BlockEntryLite[]
111
151
  }
112
152
 
153
+ export interface LogbackValue {
154
+ name: string
155
+ level: string
156
+ }
157
+
113
158
  export interface NotFound {
114
159
  detail: string
115
160
  resource: string
116
161
  }
117
162
 
118
- export interface Output {
119
- /** @format int32 */
120
- hint: number
121
-
122
- /** @format 32-byte-hash */
123
- key: string
124
-
125
- /** @format uint256 */
126
- amount: string
127
- address: string
128
-
129
- /** @format int64 */
130
- lockTime?: number
131
-
132
- /** @format 32-byte-hash */
133
- spent?: string
134
- }
163
+ export type Output = AssetOutput | ContractOutput
135
164
 
136
165
  export interface OutputRef {
137
166
  /** @format int32 */
@@ -198,6 +227,14 @@ export interface TimedCount {
198
227
  totalCountAllChains: number
199
228
  }
200
229
 
230
+ export interface Token {
231
+ /** @format 32-byte-hash */
232
+ id: string
233
+
234
+ /** @format uint256 */
235
+ amount: string
236
+ }
237
+
201
238
  export interface TokenSupply {
202
239
  /** @format int64 */
203
240
  timestamp: number
@@ -239,20 +276,6 @@ export interface Transaction {
239
276
 
240
277
  export type TransactionLike = ConfirmedTransaction | UnconfirmedTransaction
241
278
 
242
- export interface UInput {
243
- outputRef: OutputRef
244
- unlockScript?: string
245
- }
246
-
247
- export interface UOutput {
248
- /** @format uint256 */
249
- amount: string
250
- address: string
251
-
252
- /** @format int64 */
253
- lockTime?: number
254
- }
255
-
256
279
  export interface Unauthorized {
257
280
  detail: string
258
281
  }
@@ -266,14 +289,17 @@ export interface UnconfirmedTransaction {
266
289
 
267
290
  /** @format int32 */
268
291
  chainTo: number
269
- inputs?: UInput[]
270
- outputs?: UOutput[]
292
+ inputs?: Input[]
293
+ outputs?: AssetOutput[]
271
294
 
272
295
  /** @format int32 */
273
296
  gasAmount: number
274
297
 
275
298
  /** @format uint256 */
276
299
  gasPrice: string
300
+
301
+ /** @format int64 */
302
+ lastSeen: number
277
303
  type: string
278
304
  }
279
305
 
@@ -560,6 +586,25 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
560
586
  ...params
561
587
  }).then(convertHttpResponse)
562
588
  }
589
+ transactionByOutputRefKey = {
590
+ /**
591
+ * @description Get a transaction from a output reference key
592
+ *
593
+ * @tags Transactions
594
+ * @name GetTransactionByOutputRefKeyOutputRefKey
595
+ * @request GET:/transaction-by-output-ref-key/{output-ref-key}
596
+ */
597
+ getTransactionByOutputRefKeyOutputRefKey: (outputRefKey: string, params: RequestParams = {}) =>
598
+ this.request<
599
+ ConfirmedTransaction,
600
+ BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable
601
+ >({
602
+ path: `/transaction-by-output-ref-key/${outputRefKey}`,
603
+ method: 'GET',
604
+ format: 'json',
605
+ ...params
606
+ }).then(convertHttpResponse)
607
+ }
563
608
  addresses = {
564
609
  /**
565
610
  * @description Get address information
@@ -611,6 +656,24 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
611
656
  ...params
612
657
  }).then(convertHttpResponse),
613
658
 
659
+ /**
660
+ * @description List unconfirmed transactions of a given address
661
+ *
662
+ * @tags Addresses
663
+ * @name GetAddressesAddressUnconfirmedTransactions
664
+ * @request GET:/addresses/{address}/unconfirmed-transactions
665
+ */
666
+ getAddressesAddressUnconfirmedTransactions: (address: string, params: RequestParams = {}) =>
667
+ this.request<
668
+ UnconfirmedTransaction[],
669
+ BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable
670
+ >({
671
+ path: `/addresses/${address}/unconfirmed-transactions`,
672
+ method: 'GET',
673
+ format: 'json',
674
+ ...params
675
+ }).then(convertHttpResponse),
676
+
614
677
  /**
615
678
  * @description Get address balance
616
679
  *
@@ -624,6 +687,75 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
624
687
  method: 'GET',
625
688
  format: 'json',
626
689
  ...params
690
+ }).then(convertHttpResponse),
691
+
692
+ /**
693
+ * @description List address tokens
694
+ *
695
+ * @tags Addresses
696
+ * @name GetAddressesAddressTokens
697
+ * @request GET:/addresses/{address}/tokens
698
+ */
699
+ getAddressesAddressTokens: (address: string, params: RequestParams = {}) =>
700
+ this.request<string[], BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>({
701
+ path: `/addresses/${address}/tokens`,
702
+ method: 'GET',
703
+ format: 'json',
704
+ ...params
705
+ }).then(convertHttpResponse),
706
+
707
+ /**
708
+ * @description List address tokens
709
+ *
710
+ * @tags Addresses
711
+ * @name GetAddressesAddressTokensTokenIdTransactions
712
+ * @request GET:/addresses/{address}/tokens/{token-id}/transactions
713
+ */
714
+ getAddressesAddressTokensTokenIdTransactions: (
715
+ address: string,
716
+ tokenId: string,
717
+ query?: { page?: number; limit?: number; reverse?: boolean },
718
+ params: RequestParams = {}
719
+ ) =>
720
+ this.request<Transaction[], BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>({
721
+ path: `/addresses/${address}/tokens/${tokenId}/transactions`,
722
+ method: 'GET',
723
+ query: query,
724
+ format: 'json',
725
+ ...params
726
+ }).then(convertHttpResponse),
727
+
728
+ /**
729
+ * @description Get address balance of given token
730
+ *
731
+ * @tags Addresses
732
+ * @name GetAddressesAddressTokensTokenIdBalance
733
+ * @request GET:/addresses/{address}/tokens/{token-id}/balance
734
+ */
735
+ getAddressesAddressTokensTokenIdBalance: (address: string, tokenId: string, params: RequestParams = {}) =>
736
+ this.request<AddressBalance, BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>({
737
+ path: `/addresses/${address}/tokens/${tokenId}/balance`,
738
+ method: 'GET',
739
+ format: 'json',
740
+ ...params
741
+ }).then(convertHttpResponse)
742
+ }
743
+ addressesActive = {
744
+ /**
745
+ * @description Are the addresses active (at least 1 transaction)
746
+ *
747
+ * @tags Addresses
748
+ * @name PostAddressesActive
749
+ * @request POST:/addresses-active
750
+ */
751
+ postAddressesActive: (data?: string[], params: RequestParams = {}) =>
752
+ this.request<boolean[], BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>({
753
+ path: `/addresses-active`,
754
+ method: 'POST',
755
+ body: data,
756
+ type: ContentType.Json,
757
+ format: 'json',
758
+ ...params
627
759
  }).then(convertHttpResponse)
628
760
  }
629
761
  infos = {
@@ -760,6 +892,66 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
760
892
  }
761
893
  ).then(convertHttpResponse)
762
894
  }
895
+ unconfirmedTransactions = {
896
+ /**
897
+ * @description list unconfirmed transactions
898
+ *
899
+ * @tags Unconfirmed Transactions
900
+ * @name GetUnconfirmedTransactions
901
+ * @request GET:/unconfirmed-transactions
902
+ */
903
+ getUnconfirmedTransactions: (
904
+ query?: { page?: number; limit?: number; reverse?: boolean },
905
+ params: RequestParams = {}
906
+ ) =>
907
+ this.request<
908
+ UnconfirmedTransaction[],
909
+ BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable
910
+ >({
911
+ path: `/unconfirmed-transactions`,
912
+ method: 'GET',
913
+ query: query,
914
+ format: 'json',
915
+ ...params
916
+ }).then(convertHttpResponse)
917
+ }
918
+ tokens = {
919
+ /**
920
+ * @description List tokens
921
+ *
922
+ * @tags Tokens
923
+ * @name GetTokens
924
+ * @request GET:/tokens
925
+ */
926
+ getTokens: (query?: { page?: number; limit?: number; reverse?: boolean }, params: RequestParams = {}) =>
927
+ this.request<string[], BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>({
928
+ path: `/tokens`,
929
+ method: 'GET',
930
+ query: query,
931
+ format: 'json',
932
+ ...params
933
+ }).then(convertHttpResponse),
934
+
935
+ /**
936
+ * @description List token transactions
937
+ *
938
+ * @tags Tokens
939
+ * @name GetTokensTokenIdTransactions
940
+ * @request GET:/tokens/{token-id}/transactions
941
+ */
942
+ getTokensTokenIdTransactions: (
943
+ tokenId: string,
944
+ query?: { page?: number; limit?: number; reverse?: boolean },
945
+ params: RequestParams = {}
946
+ ) =>
947
+ this.request<Transaction[], BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>({
948
+ path: `/tokens/${tokenId}/transactions`,
949
+ method: 'GET',
950
+ query: query,
951
+ format: 'json',
952
+ ...params
953
+ }).then(convertHttpResponse)
954
+ }
763
955
  charts = {
764
956
  /**
765
957
  * @description `interval-type` query param: hourly, daily
@@ -855,17 +1047,18 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
855
1047
  }).then(convertHttpResponse),
856
1048
 
857
1049
  /**
858
- * @description Update logging file, only logback.xml is accepted
1050
+ * @description Update logback values
859
1051
  *
860
1052
  * @tags Utils
861
1053
  * @name PutUtilsUpdateLogConfig
862
1054
  * @request PUT:/utils/update-log-config
863
1055
  */
864
- putUtilsUpdateLogConfig: (data: string, params: RequestParams = {}) =>
1056
+ putUtilsUpdateLogConfig: (data?: LogbackValue[], params: RequestParams = {}) =>
865
1057
  this.request<void, BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable>({
866
1058
  path: `/utils/update-log-config`,
867
1059
  method: 'PUT',
868
1060
  body: data,
1061
+ type: ContentType.Json,
869
1062
  ...params
870
1063
  }).then(convertHttpResponse)
871
1064
  }