@flarenetwork/flare-periphery-contract-artifacts 0.1.7 → 0.1.9

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 (29) hide show
  1. package/coston/artifacts/contracts/ftso/interface/IIFtso.sol/IIFtso.json +14 -1
  2. package/coston2/artifacts/contracts/ftso/interface/IIFtso.sol/IIFtso.json +14 -1
  3. package/dist/coston/StateConnector/libs/ts/AttestationDefinitionStore.d.ts +7 -2
  4. package/dist/coston/StateConnector/libs/ts/AttestationDefinitionStore.d.ts.map +1 -1
  5. package/dist/coston/StateConnector/libs/ts/AttestationDefinitionStore.js +9 -4
  6. package/dist/coston/StateConnector/libs/ts/AttestationDefinitionStore.js.map +1 -1
  7. package/dist/coston/StateConnector/libs/ts/utils.d.ts +8 -1
  8. package/dist/coston/StateConnector/libs/ts/utils.d.ts.map +1 -1
  9. package/dist/coston/StateConnector/libs/ts/utils.js +56 -2612
  10. package/dist/coston/StateConnector/libs/ts/utils.js.map +1 -1
  11. package/dist/coston/artifacts/contracts/ftso/interface/IIFtso.sol/IIFtso.json +14 -1
  12. package/dist/coston/deploys/contracts.json +231 -231
  13. package/dist/coston/index.d.ts +2 -1
  14. package/dist/coston/index.d.ts.map +1 -1
  15. package/dist/coston/index.js +15 -1
  16. package/dist/coston/index.js.map +1 -1
  17. package/dist/coston2/artifacts/contracts/ftso/interface/IIFtso.sol/IIFtso.json +14 -1
  18. package/dist/coston2/deploys/contracts.json +270 -270
  19. package/dist/flare/artifacts/contracts/ftso/interface/IIFtso.sol/IIFtso.json +14 -1
  20. package/dist/flare/deploys/contracts.json +270 -270
  21. package/dist/index.d.ts +4 -0
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +30 -3
  24. package/dist/index.js.map +1 -1
  25. package/dist/songbird/artifacts/contracts/ftso/interface/IIFtso.sol/IIFtso.json +14 -1
  26. package/dist/songbird/deploys/contracts.json +200 -200
  27. package/flare/artifacts/contracts/ftso/interface/IIFtso.sol/IIFtso.json +14 -1
  28. package/package.json +4 -1
  29. package/songbird/artifacts/contracts/ftso/interface/IIFtso.sol/IIFtso.json +14 -1
@@ -1,7 +1,33 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.serializeBigInts = exports.readAttestationTypeConfigs = exports.structsDeepEqual = exports.remapABIParsedToObjects = exports.decodeAttestationName = exports.encodeAttestationName = exports.isSupportedBasicSolidityType = exports.ZERO_BYTES_20 = exports.ZERO_BYTES_32 = exports.MIC_SALT = void 0;
26
+ exports.findPackageRoot = exports.serializeBigInts = exports.readAttestationTypeConfigs = exports.structsDeepEqual = exports.remapABIParsedToObjects = exports.decodeAttestationName = exports.encodeAttestationName = exports.isSupportedBasicSolidityType = exports.ZERO_BYTES_20 = exports.ZERO_BYTES_32 = exports.MIC_SALT = exports.DEFAULT_ATTESTATION_TYPE_CONFIGS_PATH = void 0;
4
27
  const ethers_1 = require("ethers");
28
+ const fs_1 = require("fs");
29
+ const path = __importStar(require("path"));
30
+ exports.DEFAULT_ATTESTATION_TYPE_CONFIGS_PATH = "./node_modules/@flarenetwork/flare-periphery-contract-artifacts/coston/StateConnector/configs/";
5
31
  exports.MIC_SALT = "Flare";
6
32
  exports.ZERO_BYTES_32 = ethers_1.ethers.zeroPadBytes("0x", 32);
7
33
  exports.ZERO_BYTES_20 = ethers_1.ethers.zeroPadBytes("0x", 20);
@@ -210,2618 +236,12 @@ exports.structsDeepEqual = structsDeepEqual;
210
236
  * Loader of the attestation type definition configs
211
237
  * @returns a map from attestation types to definition configs
212
238
  */
213
- function readAttestationTypeConfigs() {
239
+ function readAttestationTypeConfigs(configsPath = exports.DEFAULT_ATTESTATION_TYPE_CONFIGS_PATH) {
214
240
  const typeRecMap = new Map();
215
- typeRecMap.set("AddressValidity", {
216
- "name": "AddressValidity",
217
- "fullComment": " @custom:name AddressValidity\n @custom:id 0x05\n @custom:supported BTC, DOGE, XRP, testBTC, testDOGE, testXRP\n @author Flare\n @notice An assertion whether a string represents a valid address on an external chain.\n @custom:verification The address is checked against all validity criteria of the chain with `sourceId`.\n Indicator of validity is provided.\n If the address is valid, its standard form and standard hash are computed.\n Validity criteria for each supported chain:\n - [BTC](/specs/attestations/external-chains/address-validity/BTC.md)\n - [DOGE](/specs/attestations/external-chains/address-validity/DOGE.md)\n - [XRPL](/specs/attestations/external-chains/address-validity/XRPL.md)\n @custom:lut `0xffffffffffffffff` ($2^{64}-1$ in hex)",
218
- "description": "An assertion whether a string represents a valid address on an external chain.",
219
- "supported": [
220
- "BTC",
221
- "DOGE",
222
- "XRP",
223
- "testBTC",
224
- "testDOGE",
225
- "testXRP"
226
- ],
227
- "verification": "The address is checked against all validity criteria of the chain with `sourceId`.\n Indicator of validity is provided.\n If the address is valid, its standard form and standard hash are computed.\n Validity criteria for each supported chain:\n - [BTC](/specs/attestations/external-chains/address-validity/BTC.md)\n - [DOGE](/specs/attestations/external-chains/address-validity/DOGE.md)\n - [XRPL](/specs/attestations/external-chains/address-validity/XRPL.md)\n ",
228
- "lut": "`0xffffffffffffffff` ($2^{64}-1$ in hex)",
229
- "proof": {
230
- "name": "Proof",
231
- "description": "Toplevel proof",
232
- "above": "",
233
- "below": "",
234
- "fullComment": " @notice Toplevel proof\n @param merkleProof Merkle proof corresponding to the attestation response.\n @param data Attestation response.",
235
- "params": [
236
- {
237
- "name": "merkleProof",
238
- "type": "bytes32[]",
239
- "typeSimple": "bytes32[]",
240
- "comment": "Merkle proof corresponding to the attestation response."
241
- },
242
- {
243
- "name": "data",
244
- "type": "struct AddressValidity.Response",
245
- "typeSimple": "Response",
246
- "comment": "Attestation response."
247
- }
248
- ]
249
- },
250
- "request": {
251
- "name": "Request",
252
- "description": "Toplevel request",
253
- "above": "",
254
- "below": "",
255
- "fullComment": " @notice Toplevel request\n @param attestationType ID of the attestation type.\n @param sourceId Id of the data source.\n @param messageIntegrityCode `MessageIntegrityCode` that is derived from the expected response.\n @param requestBody Data defining the request. Type (struct) and interpretation is determined by the `attestationType`.",
256
- "params": [
257
- {
258
- "name": "attestationType",
259
- "type": "bytes32",
260
- "typeSimple": "bytes32",
261
- "comment": "ID of the attestation type."
262
- },
263
- {
264
- "name": "sourceId",
265
- "type": "bytes32",
266
- "typeSimple": "bytes32",
267
- "comment": "Id of the data source."
268
- },
269
- {
270
- "name": "messageIntegrityCode",
271
- "type": "bytes32",
272
- "typeSimple": "bytes32",
273
- "comment": "`MessageIntegrityCode` that is derived from the expected response."
274
- },
275
- {
276
- "name": "requestBody",
277
- "type": "struct AddressValidity.RequestBody",
278
- "typeSimple": "RequestBody",
279
- "comment": "Data defining the request. Type (struct) and interpretation is determined by the `attestationType`."
280
- }
281
- ]
282
- },
283
- "response": {
284
- "name": "Response",
285
- "description": "Toplevel response",
286
- "above": "",
287
- "below": "",
288
- "fullComment": " @notice Toplevel response\n @param attestationType Extracted from the request.\n @param sourceId Extracted from the request.\n @param votingRound The ID of the State Connector round in which the request was considered.\n @param lowestUsedTimestamp The lowest timestamp used to generate the response.\n @param requestBody Extracted from the request.\n @param responseBody Data defining the response. The verification rules for the construction of the response body and the type are defined per specific `attestationType`.",
289
- "params": [
290
- {
291
- "name": "attestationType",
292
- "type": "bytes32",
293
- "typeSimple": "bytes32",
294
- "comment": "Extracted from the request."
295
- },
296
- {
297
- "name": "sourceId",
298
- "type": "bytes32",
299
- "typeSimple": "bytes32",
300
- "comment": "Extracted from the request."
301
- },
302
- {
303
- "name": "votingRound",
304
- "type": "uint64",
305
- "typeSimple": "uint64",
306
- "comment": "The ID of the State Connector round in which the request was considered."
307
- },
308
- {
309
- "name": "lowestUsedTimestamp",
310
- "type": "uint64",
311
- "typeSimple": "uint64",
312
- "comment": "The lowest timestamp used to generate the response."
313
- },
314
- {
315
- "name": "requestBody",
316
- "type": "struct AddressValidity.RequestBody",
317
- "typeSimple": "RequestBody",
318
- "comment": "Extracted from the request."
319
- },
320
- {
321
- "name": "responseBody",
322
- "type": "struct AddressValidity.ResponseBody",
323
- "typeSimple": "ResponseBody",
324
- "comment": "Data defining the response. The verification rules for the construction of the response body and the type are defined per specific `attestationType`."
325
- }
326
- ]
327
- },
328
- "requestBody": {
329
- "name": "RequestBody",
330
- "description": "Request body for AddressValidity attestation type",
331
- "above": "",
332
- "below": "",
333
- "fullComment": " @notice Request body for AddressValidity attestation type\n @param addressStr Address to be verified.",
334
- "params": [
335
- {
336
- "name": "addressStr",
337
- "type": "string",
338
- "typeSimple": "string",
339
- "comment": "Address to be verified."
340
- }
341
- ]
342
- },
343
- "responseBody": {
344
- "name": "ResponseBody",
345
- "description": "Response body for AddressValidity attestation type",
346
- "above": "",
347
- "below": "",
348
- "fullComment": " @notice Response body for AddressValidity attestation type\n @param isValid Boolean indicator of the address validity.\n @param standardAddress If `isValid`, standard form of the validated address. Otherwise an empty string.\n @param standardAddressHash If `isValid`, standard address hash of the validated address. Otherwise a zero bytes32 string.",
349
- "params": [
350
- {
351
- "name": "isValid",
352
- "type": "bool",
353
- "typeSimple": "bool",
354
- "comment": "Boolean indicator of the address validity."
355
- },
356
- {
357
- "name": "standardAddress",
358
- "type": "string",
359
- "typeSimple": "string",
360
- "comment": "If `isValid`, standard form of the validated address. Otherwise an empty string."
361
- },
362
- {
363
- "name": "standardAddressHash",
364
- "type": "bytes32",
365
- "typeSimple": "bytes32",
366
- "comment": "If `isValid`, standard address hash of the validated address. Otherwise a zero bytes32 string."
367
- }
368
- ]
369
- },
370
- "requestStructs": [],
371
- "responseStructs": [],
372
- "requestAbi": {
373
- "components": [
374
- {
375
- "internalType": "bytes32",
376
- "name": "attestationType",
377
- "type": "bytes32"
378
- },
379
- {
380
- "internalType": "bytes32",
381
- "name": "sourceId",
382
- "type": "bytes32"
383
- },
384
- {
385
- "internalType": "bytes32",
386
- "name": "messageIntegrityCode",
387
- "type": "bytes32"
388
- },
389
- {
390
- "components": [
391
- {
392
- "internalType": "string",
393
- "name": "addressStr",
394
- "type": "string"
395
- }
396
- ],
397
- "internalType": "struct AddressValidity.RequestBody",
398
- "name": "requestBody",
399
- "type": "tuple"
400
- }
401
- ],
402
- "internalType": "struct AddressValidity.Request",
403
- "name": "_request",
404
- "type": "tuple"
405
- },
406
- "responseAbi": {
407
- "components": [
408
- {
409
- "internalType": "bytes32",
410
- "name": "attestationType",
411
- "type": "bytes32"
412
- },
413
- {
414
- "internalType": "bytes32",
415
- "name": "sourceId",
416
- "type": "bytes32"
417
- },
418
- {
419
- "internalType": "uint64",
420
- "name": "votingRound",
421
- "type": "uint64"
422
- },
423
- {
424
- "internalType": "uint64",
425
- "name": "lowestUsedTimestamp",
426
- "type": "uint64"
427
- },
428
- {
429
- "components": [
430
- {
431
- "internalType": "string",
432
- "name": "addressStr",
433
- "type": "string"
434
- }
435
- ],
436
- "internalType": "struct AddressValidity.RequestBody",
437
- "name": "requestBody",
438
- "type": "tuple"
439
- },
440
- {
441
- "components": [
442
- {
443
- "internalType": "bool",
444
- "name": "isValid",
445
- "type": "bool"
446
- },
447
- {
448
- "internalType": "string",
449
- "name": "standardAddress",
450
- "type": "string"
451
- },
452
- {
453
- "internalType": "bytes32",
454
- "name": "standardAddressHash",
455
- "type": "bytes32"
456
- }
457
- ],
458
- "internalType": "struct AddressValidity.ResponseBody",
459
- "name": "responseBody",
460
- "type": "tuple"
461
- }
462
- ],
463
- "internalType": "struct AddressValidity.Response",
464
- "name": "_response",
465
- "type": "tuple"
466
- },
467
- "proofAbi": {
468
- "components": [
469
- {
470
- "internalType": "bytes32[]",
471
- "name": "merkleProof",
472
- "type": "bytes32[]"
473
- },
474
- {
475
- "components": [
476
- {
477
- "internalType": "bytes32",
478
- "name": "attestationType",
479
- "type": "bytes32"
480
- },
481
- {
482
- "internalType": "bytes32",
483
- "name": "sourceId",
484
- "type": "bytes32"
485
- },
486
- {
487
- "internalType": "uint64",
488
- "name": "votingRound",
489
- "type": "uint64"
490
- },
491
- {
492
- "internalType": "uint64",
493
- "name": "lowestUsedTimestamp",
494
- "type": "uint64"
495
- },
496
- {
497
- "components": [
498
- {
499
- "internalType": "string",
500
- "name": "addressStr",
501
- "type": "string"
502
- }
503
- ],
504
- "internalType": "struct AddressValidity.RequestBody",
505
- "name": "requestBody",
506
- "type": "tuple"
507
- },
508
- {
509
- "components": [
510
- {
511
- "internalType": "bool",
512
- "name": "isValid",
513
- "type": "bool"
514
- },
515
- {
516
- "internalType": "string",
517
- "name": "standardAddress",
518
- "type": "string"
519
- },
520
- {
521
- "internalType": "bytes32",
522
- "name": "standardAddressHash",
523
- "type": "bytes32"
524
- }
525
- ],
526
- "internalType": "struct AddressValidity.ResponseBody",
527
- "name": "responseBody",
528
- "type": "tuple"
529
- }
530
- ],
531
- "internalType": "struct AddressValidity.Response",
532
- "name": "data",
533
- "type": "tuple"
534
- }
535
- ],
536
- "internalType": "struct AddressValidity.Proof",
537
- "name": "_proof",
538
- "type": "tuple"
539
- }
540
- });
541
- typeRecMap.set("BalanceDecreasingTransaction", {
542
- "name": "BalanceDecreasingTransaction",
543
- "fullComment": " @custom:name BalanceDecreasingTransaction\n @custom:id 0x02\n @custom:supported BTC, DOGE, XRP, testBTC, testDOGE, testXRP\n @author Flare\n @notice A detection of a transaction that either decreases the balance for some address or is signed by the source address.\n Such an attestation could prove a violation of an agreement and therefore provides grounds to liquidate some funds locked by a smart contract on Flare.\n A transaction is considered “balance decreasing” for the address, if the balance after the transaction is lower than before or the address is among the signers of the transaction (even if its balance is greater than before the transaction).\n @custom:verification The transaction with `transactionId` is fetched from the API of the source blockchain node or relevant indexer.\n If the transaction cannot be fetched or the transaction is in a block that does not have a sufficient [number of confirmations](/specs/attestations/configs.md#finalityconfirmation), the attestation request is rejected.\n Once the transaction is received, the response fields are extracted if the transaction is balance decreasing for the indicated address.\n Some of the request and response fields are chain specific as described below.\n The fields can be computed with the help of a [balance decreasing summary](/specs/attestations/external-chains/transactions.md#balance-decreasing-summary).\n ### UTXO (Bitcoin and Dogecoin)\n - `sourceAddressIndicator` is the the index of the transaction input in hex padded to a 0x prefixed 32-byte string.\n If the indicated input does not exist or the indicated input does not have the address, the attestation request is rejected.\n The `sourceAddress` is the address of the indicated transaction input.\n - `spentAmount` is the sum of values of all inputs with sourceAddress minus the sum of all outputs with `sourceAddress`.\n Can be negative.\n - `blockTimestamp` is the mediantime of a block.\n ### XRPL\n - `sourceAddressIndicator` is the [standard address hash](/specs/attestations/external-chains/standardAddress.md#standard-address-hash) of the address whose balance has been decreased.\n If the address indicated by `sourceAddressIndicator` is not among the signers of the transaction and the balance of the address was not lowered in the transaction, the attestation request is rejected.\n - `spentAmount` is the difference between the balance of the indicated address after and before the transaction.\n Can be negative.\n - `blockTimestamp` is the close_time of a ledger converted to unix time.\n @custom:lut `blockTimestamp`",
544
- "description": "A detection of a transaction that either decreases the balance for some address or is signed by the source address.\n Such an attestation could prove a violation of an agreement and therefore provides grounds to liquidate some funds locked by a smart contract on Flare.\n A transaction is considered “balance decreasing” for the address, if the balance after the transaction is lower than before or the address is among the signers of the transaction (even if its balance is greater than before the transaction).",
545
- "supported": [
546
- "BTC",
547
- "DOGE",
548
- "XRP",
549
- "testBTC",
550
- "testDOGE",
551
- "testXRP"
552
- ],
553
- "verification": "The transaction with `transactionId` is fetched from the API of the source blockchain node or relevant indexer.\n If the transaction cannot be fetched or the transaction is in a block that does not have a sufficient [number of confirmations](/specs/attestations/configs.md#finalityconfirmation), the attestation request is rejected.\n Once the transaction is received, the response fields are extracted if the transaction is balance decreasing for the indicated address.\n Some of the request and response fields are chain specific as described below.\n The fields can be computed with the help of a [balance decreasing summary](/specs/attestations/external-chains/transactions.md#balance-decreasing-summary).\n ### UTXO (Bitcoin and Dogecoin)\n - `sourceAddressIndicator` is the the index of the transaction input in hex padded to a 0x prefixed 32-byte string.\n If the indicated input does not exist or the indicated input does not have the address, the attestation request is rejected.\n The `sourceAddress` is the address of the indicated transaction input.\n - `spentAmount` is the sum of values of all inputs with sourceAddress minus the sum of all outputs with `sourceAddress`.\n Can be negative.\n - `blockTimestamp` is the mediantime of a block.\n ### XRPL\n - `sourceAddressIndicator` is the [standard address hash](/specs/attestations/external-chains/standardAddress.md#standard-address-hash) of the address whose balance has been decreased.\n If the address indicated by `sourceAddressIndicator` is not among the signers of the transaction and the balance of the address was not lowered in the transaction, the attestation request is rejected.\n - `spentAmount` is the difference between the balance of the indicated address after and before the transaction.\n Can be negative.\n - `blockTimestamp` is the close_time of a ledger converted to unix time.\n ",
554
- "lut": "`blockTimestamp`",
555
- "proof": {
556
- "name": "Proof",
557
- "description": "Toplevel proof",
558
- "above": "",
559
- "below": "",
560
- "fullComment": " @notice Toplevel proof\n @param merkleProof Merkle proof corresponding to the attestation response.\n @param data Attestation response.",
561
- "params": [
562
- {
563
- "name": "merkleProof",
564
- "type": "bytes32[]",
565
- "typeSimple": "bytes32[]",
566
- "comment": "Merkle proof corresponding to the attestation response."
567
- },
568
- {
569
- "name": "data",
570
- "type": "struct BalanceDecreasingTransaction.Response",
571
- "typeSimple": "Response",
572
- "comment": "Attestation response."
573
- }
574
- ]
575
- },
576
- "request": {
577
- "name": "Request",
578
- "description": "Toplevel request",
579
- "above": "",
580
- "below": "",
581
- "fullComment": " @notice Toplevel request\n @param attestationType ID of the attestation type.\n @param sourceId ID of the data source.\n @param messageIntegrityCode `MessageIntegrityCode` that is derived from the expected response.\n @param requestBody Data defining the request. Type (struct) and interpretation is determined by the `attestationType`.",
582
- "params": [
583
- {
584
- "name": "attestationType",
585
- "type": "bytes32",
586
- "typeSimple": "bytes32",
587
- "comment": "ID of the attestation type."
588
- },
589
- {
590
- "name": "sourceId",
591
- "type": "bytes32",
592
- "typeSimple": "bytes32",
593
- "comment": "ID of the data source."
594
- },
595
- {
596
- "name": "messageIntegrityCode",
597
- "type": "bytes32",
598
- "typeSimple": "bytes32",
599
- "comment": "`MessageIntegrityCode` that is derived from the expected response."
600
- },
601
- {
602
- "name": "requestBody",
603
- "type": "struct BalanceDecreasingTransaction.RequestBody",
604
- "typeSimple": "RequestBody",
605
- "comment": "Data defining the request. Type (struct) and interpretation is determined by the `attestationType`."
606
- }
607
- ]
608
- },
609
- "response": {
610
- "name": "Response",
611
- "description": "Toplevel response",
612
- "above": "",
613
- "below": "",
614
- "fullComment": " @notice Toplevel response\n @param attestationType Extracted from the request.\n @param sourceId Extracted from the request.\n @param votingRound The ID of the State Connector round in which the request was considered. This is a security measure to prevent a collision of attestation hashes.\n @param lowestUsedTimestamp The lowest timestamp used to generate the response.\n @param requestBody Extracted from the request.\n @param responseBody Data defining the response. The verification rules for the construction of the response body and the type are defined per specific `attestationType`.",
615
- "params": [
616
- {
617
- "name": "attestationType",
618
- "type": "bytes32",
619
- "typeSimple": "bytes32",
620
- "comment": "Extracted from the request."
621
- },
622
- {
623
- "name": "sourceId",
624
- "type": "bytes32",
625
- "typeSimple": "bytes32",
626
- "comment": "Extracted from the request."
627
- },
628
- {
629
- "name": "votingRound",
630
- "type": "uint64",
631
- "typeSimple": "uint64",
632
- "comment": "The ID of the State Connector round in which the request was considered. This is a security measure to prevent a collision of attestation hashes."
633
- },
634
- {
635
- "name": "lowestUsedTimestamp",
636
- "type": "uint64",
637
- "typeSimple": "uint64",
638
- "comment": "The lowest timestamp used to generate the response."
639
- },
640
- {
641
- "name": "requestBody",
642
- "type": "struct BalanceDecreasingTransaction.RequestBody",
643
- "typeSimple": "RequestBody",
644
- "comment": "Extracted from the request."
645
- },
646
- {
647
- "name": "responseBody",
648
- "type": "struct BalanceDecreasingTransaction.ResponseBody",
649
- "typeSimple": "ResponseBody",
650
- "comment": "Data defining the response. The verification rules for the construction of the response body and the type are defined per specific `attestationType`."
651
- }
652
- ]
653
- },
654
- "requestBody": {
655
- "name": "RequestBody",
656
- "description": "Request body for BalanceDecreasingTransaction attestation type",
657
- "above": "",
658
- "below": "",
659
- "fullComment": " @notice Request body for BalanceDecreasingTransaction attestation type\n @param transactionId ID of the payment transaction.\n @param sourceAddressIndicator The indicator of the address whose balance has been decreased.",
660
- "params": [
661
- {
662
- "name": "transactionId",
663
- "type": "bytes32",
664
- "typeSimple": "bytes32",
665
- "comment": "ID of the payment transaction."
666
- },
667
- {
668
- "name": "sourceAddressIndicator",
669
- "type": "bytes32",
670
- "typeSimple": "bytes32",
671
- "comment": "The indicator of the address whose balance has been decreased."
672
- }
673
- ]
674
- },
675
- "responseBody": {
676
- "name": "ResponseBody",
677
- "description": "Response body for BalanceDecreasingTransaction attestation type.",
678
- "above": "",
679
- "below": "",
680
- "fullComment": " @notice Response body for BalanceDecreasingTransaction attestation type.\n @param blockNumber The number of the block in which the transaction is included.\n @param blockTimestamp The timestamp of the block in which the transaction is included.\n @param sourceAddressHash Standard address hash of the address indicated by the `sourceAddressIndicator`.\n @param spentAmount Amount spent by the source address in minimal units.\n @param standardPaymentReference Standard payment reference of the transaction.",
681
- "params": [
682
- {
683
- "name": "blockNumber",
684
- "type": "uint64",
685
- "typeSimple": "uint64",
686
- "comment": "The number of the block in which the transaction is included."
687
- },
688
- {
689
- "name": "blockTimestamp",
690
- "type": "uint64",
691
- "typeSimple": "uint64",
692
- "comment": "The timestamp of the block in which the transaction is included."
693
- },
694
- {
695
- "name": "sourceAddressHash",
696
- "type": "bytes32",
697
- "typeSimple": "bytes32",
698
- "comment": "Standard address hash of the address indicated by the `sourceAddressIndicator`."
699
- },
700
- {
701
- "name": "spentAmount",
702
- "type": "int256",
703
- "typeSimple": "int256",
704
- "comment": "Amount spent by the source address in minimal units."
705
- },
706
- {
707
- "name": "standardPaymentReference",
708
- "type": "bytes32",
709
- "typeSimple": "bytes32",
710
- "comment": "Standard payment reference of the transaction."
711
- }
712
- ]
713
- },
714
- "requestStructs": [],
715
- "responseStructs": [],
716
- "requestAbi": {
717
- "components": [
718
- {
719
- "internalType": "bytes32",
720
- "name": "attestationType",
721
- "type": "bytes32"
722
- },
723
- {
724
- "internalType": "bytes32",
725
- "name": "sourceId",
726
- "type": "bytes32"
727
- },
728
- {
729
- "internalType": "bytes32",
730
- "name": "messageIntegrityCode",
731
- "type": "bytes32"
732
- },
733
- {
734
- "components": [
735
- {
736
- "internalType": "bytes32",
737
- "name": "transactionId",
738
- "type": "bytes32"
739
- },
740
- {
741
- "internalType": "bytes32",
742
- "name": "sourceAddressIndicator",
743
- "type": "bytes32"
744
- }
745
- ],
746
- "internalType": "struct BalanceDecreasingTransaction.RequestBody",
747
- "name": "requestBody",
748
- "type": "tuple"
749
- }
750
- ],
751
- "internalType": "struct BalanceDecreasingTransaction.Request",
752
- "name": "_request",
753
- "type": "tuple"
754
- },
755
- "responseAbi": {
756
- "components": [
757
- {
758
- "internalType": "bytes32",
759
- "name": "attestationType",
760
- "type": "bytes32"
761
- },
762
- {
763
- "internalType": "bytes32",
764
- "name": "sourceId",
765
- "type": "bytes32"
766
- },
767
- {
768
- "internalType": "uint64",
769
- "name": "votingRound",
770
- "type": "uint64"
771
- },
772
- {
773
- "internalType": "uint64",
774
- "name": "lowestUsedTimestamp",
775
- "type": "uint64"
776
- },
777
- {
778
- "components": [
779
- {
780
- "internalType": "bytes32",
781
- "name": "transactionId",
782
- "type": "bytes32"
783
- },
784
- {
785
- "internalType": "bytes32",
786
- "name": "sourceAddressIndicator",
787
- "type": "bytes32"
788
- }
789
- ],
790
- "internalType": "struct BalanceDecreasingTransaction.RequestBody",
791
- "name": "requestBody",
792
- "type": "tuple"
793
- },
794
- {
795
- "components": [
796
- {
797
- "internalType": "uint64",
798
- "name": "blockNumber",
799
- "type": "uint64"
800
- },
801
- {
802
- "internalType": "uint64",
803
- "name": "blockTimestamp",
804
- "type": "uint64"
805
- },
806
- {
807
- "internalType": "bytes32",
808
- "name": "sourceAddressHash",
809
- "type": "bytes32"
810
- },
811
- {
812
- "internalType": "int256",
813
- "name": "spentAmount",
814
- "type": "int256"
815
- },
816
- {
817
- "internalType": "bytes32",
818
- "name": "standardPaymentReference",
819
- "type": "bytes32"
820
- }
821
- ],
822
- "internalType": "struct BalanceDecreasingTransaction.ResponseBody",
823
- "name": "responseBody",
824
- "type": "tuple"
825
- }
826
- ],
827
- "internalType": "struct BalanceDecreasingTransaction.Response",
828
- "name": "_response",
829
- "type": "tuple"
830
- },
831
- "proofAbi": {
832
- "components": [
833
- {
834
- "internalType": "bytes32[]",
835
- "name": "merkleProof",
836
- "type": "bytes32[]"
837
- },
838
- {
839
- "components": [
840
- {
841
- "internalType": "bytes32",
842
- "name": "attestationType",
843
- "type": "bytes32"
844
- },
845
- {
846
- "internalType": "bytes32",
847
- "name": "sourceId",
848
- "type": "bytes32"
849
- },
850
- {
851
- "internalType": "uint64",
852
- "name": "votingRound",
853
- "type": "uint64"
854
- },
855
- {
856
- "internalType": "uint64",
857
- "name": "lowestUsedTimestamp",
858
- "type": "uint64"
859
- },
860
- {
861
- "components": [
862
- {
863
- "internalType": "bytes32",
864
- "name": "transactionId",
865
- "type": "bytes32"
866
- },
867
- {
868
- "internalType": "bytes32",
869
- "name": "sourceAddressIndicator",
870
- "type": "bytes32"
871
- }
872
- ],
873
- "internalType": "struct BalanceDecreasingTransaction.RequestBody",
874
- "name": "requestBody",
875
- "type": "tuple"
876
- },
877
- {
878
- "components": [
879
- {
880
- "internalType": "uint64",
881
- "name": "blockNumber",
882
- "type": "uint64"
883
- },
884
- {
885
- "internalType": "uint64",
886
- "name": "blockTimestamp",
887
- "type": "uint64"
888
- },
889
- {
890
- "internalType": "bytes32",
891
- "name": "sourceAddressHash",
892
- "type": "bytes32"
893
- },
894
- {
895
- "internalType": "int256",
896
- "name": "spentAmount",
897
- "type": "int256"
898
- },
899
- {
900
- "internalType": "bytes32",
901
- "name": "standardPaymentReference",
902
- "type": "bytes32"
903
- }
904
- ],
905
- "internalType": "struct BalanceDecreasingTransaction.ResponseBody",
906
- "name": "responseBody",
907
- "type": "tuple"
908
- }
909
- ],
910
- "internalType": "struct BalanceDecreasingTransaction.Response",
911
- "name": "data",
912
- "type": "tuple"
913
- }
914
- ],
915
- "internalType": "struct BalanceDecreasingTransaction.Proof",
916
- "name": "_proof",
917
- "type": "tuple"
918
- }
919
- });
920
- typeRecMap.set("ConfirmedBlockHeightExists", {
921
- "name": "ConfirmedBlockHeightExists",
922
- "fullComment": " @custom:name ConfirmedBlockHeightExists\n @custom:id 0x02\n @custom:supported BTC, DOGE, XRP, testBTC, testDOGE, testXRP\n @author Flare\n @notice An assertion that a block with `blockNumber` is confirmed.\n It also provides data to compute the block production rate in the given time range.\n @custom:verification It is checked that the block with `blockNumber` is confirmed by at least `numberOfConfirmations`.\n If it is not, the request is rejected. We note a block on the tip of the chain is confirmed by 1 block.\n Then `lowestQueryWindowBlock` is determined and its number and timestamp are extracted.\n Current confirmation heights consensus:\n | `Chain` | `chainId` | `numberOfConfirmations` | `timestamp ` |\n | ------- | --------- | ----------------------- | ------------ |\n | `BTC` | 0 | 6 | mediantime |\n | `DOGE` | 2 | 60 | mediantime |\n | `XRP` | 3 | 3 | close_time |\n @custom:lut `lowestQueryWindowBlockTimestamp`",
923
- "description": "An assertion that a block with `blockNumber` is confirmed.\n It also provides data to compute the block production rate in the given time range.",
924
- "supported": [
925
- "BTC",
926
- "DOGE",
927
- "XRP",
928
- "testBTC",
929
- "testDOGE",
930
- "testXRP"
931
- ],
932
- "verification": "It is checked that the block with `blockNumber` is confirmed by at least `numberOfConfirmations`.\n If it is not, the request is rejected. We note a block on the tip of the chain is confirmed by 1 block.\n Then `lowestQueryWindowBlock` is determined and its number and timestamp are extracted.\n Current confirmation heights consensus:\n | `Chain` | `chainId` | `numberOfConfirmations` | `timestamp ` |\n | ------- | --------- | ----------------------- | ------------ |\n | `BTC` | 0 | 6 | mediantime |\n | `DOGE` | 2 | 60 | mediantime |\n | `XRP` | 3 | 3 | close_time |\n ",
933
- "lut": "`lowestQueryWindowBlockTimestamp`",
934
- "proof": {
935
- "name": "Proof",
936
- "description": "Toplevel proof",
937
- "above": "",
938
- "below": "",
939
- "fullComment": " @notice Toplevel proof\n @param merkleProof Merkle proof corresponding to the attestation response.\n @param data Attestation response.",
940
- "params": [
941
- {
942
- "name": "merkleProof",
943
- "type": "bytes32[]",
944
- "typeSimple": "bytes32[]",
945
- "comment": "Merkle proof corresponding to the attestation response."
946
- },
947
- {
948
- "name": "data",
949
- "type": "struct ConfirmedBlockHeightExists.Response",
950
- "typeSimple": "Response",
951
- "comment": "Attestation response."
952
- }
953
- ]
954
- },
955
- "request": {
956
- "name": "Request",
957
- "description": "Toplevel request",
958
- "above": "",
959
- "below": "",
960
- "fullComment": " @notice Toplevel request\n @param attestationType ID of the attestation type.\n @param sourceId ID of the data source.\n @param messageIntegrityCode `MessageIntegrityCode` that is derived from the expected response as defined.\n @param requestBody Data defining the request. Type (struct) and interpretation is determined by the `attestationType`.",
961
- "params": [
962
- {
963
- "name": "attestationType",
964
- "type": "bytes32",
965
- "typeSimple": "bytes32",
966
- "comment": "ID of the attestation type."
967
- },
968
- {
969
- "name": "sourceId",
970
- "type": "bytes32",
971
- "typeSimple": "bytes32",
972
- "comment": "ID of the data source."
973
- },
974
- {
975
- "name": "messageIntegrityCode",
976
- "type": "bytes32",
977
- "typeSimple": "bytes32",
978
- "comment": "`MessageIntegrityCode` that is derived from the expected response as defined."
979
- },
980
- {
981
- "name": "requestBody",
982
- "type": "struct ConfirmedBlockHeightExists.RequestBody",
983
- "typeSimple": "RequestBody",
984
- "comment": "Data defining the request. Type (struct) and interpretation is determined by the `attestationType`."
985
- }
986
- ]
987
- },
988
- "response": {
989
- "name": "Response",
990
- "description": "Toplevel response",
991
- "above": "",
992
- "below": "",
993
- "fullComment": " @notice Toplevel response\n @param attestationType Extracted from the request.\n @param sourceId Extracted from the request.\n @param votingRound The ID of the State Connector round in which the request was considered.\n @param lowestUsedTimestamp The lowest timestamp used to generate the response.\n @param requestBody Extracted from the request.\n @param responseBody Data defining the response. The verification rules for the construction of the response body and the type are defined per specific `attestationType`.",
994
- "params": [
995
- {
996
- "name": "attestationType",
997
- "type": "bytes32",
998
- "typeSimple": "bytes32",
999
- "comment": "Extracted from the request."
1000
- },
1001
- {
1002
- "name": "sourceId",
1003
- "type": "bytes32",
1004
- "typeSimple": "bytes32",
1005
- "comment": "Extracted from the request."
1006
- },
1007
- {
1008
- "name": "votingRound",
1009
- "type": "uint64",
1010
- "typeSimple": "uint64",
1011
- "comment": "The ID of the State Connector round in which the request was considered."
1012
- },
1013
- {
1014
- "name": "lowestUsedTimestamp",
1015
- "type": "uint64",
1016
- "typeSimple": "uint64",
1017
- "comment": "The lowest timestamp used to generate the response."
1018
- },
1019
- {
1020
- "name": "requestBody",
1021
- "type": "struct ConfirmedBlockHeightExists.RequestBody",
1022
- "typeSimple": "RequestBody",
1023
- "comment": "Extracted from the request."
1024
- },
1025
- {
1026
- "name": "responseBody",
1027
- "type": "struct ConfirmedBlockHeightExists.ResponseBody",
1028
- "typeSimple": "ResponseBody",
1029
- "comment": "Data defining the response. The verification rules for the construction of the response body and the type are defined per specific `attestationType`."
1030
- }
1031
- ]
1032
- },
1033
- "requestBody": {
1034
- "name": "RequestBody",
1035
- "description": "Request body for ConfirmedBlockHeightExistsType attestation type",
1036
- "above": "",
1037
- "below": "",
1038
- "fullComment": " @notice Request body for ConfirmedBlockHeightExistsType attestation type\n @param blockNumber The number of the block the request wants a confirmation of.\n @param queryWindow The length of the period in which the block production rate is to be computed.",
1039
- "params": [
1040
- {
1041
- "name": "blockNumber",
1042
- "type": "uint64",
1043
- "typeSimple": "uint64",
1044
- "comment": "The number of the block the request wants a confirmation of."
1045
- },
1046
- {
1047
- "name": "queryWindow",
1048
- "type": "uint64",
1049
- "typeSimple": "uint64",
1050
- "comment": "The length of the period in which the block production rate is to be computed."
1051
- }
1052
- ]
1053
- },
1054
- "responseBody": {
1055
- "name": "ResponseBody",
1056
- "description": "Response body for ConfirmedBlockHeightExistsType attestation type",
1057
- "above": "",
1058
- "below": "`blockNumber`, `lowestQueryWindowBlockNumber`, `blockTimestamp` and `lowestQueryWindowBlockTimestamp` can be used to compute the average block production time in the specified block range.",
1059
- "fullComment": " @notice Response body for ConfirmedBlockHeightExistsType attestation type\n @custom:below `blockNumber`, `lowestQueryWindowBlockNumber`, `blockTimestamp` and `lowestQueryWindowBlockTimestamp` can be used to compute the average block production time in the specified block range.\n @param blockTimestamp The timestamp of the block with `blockNumber`.\n @param numberOfConfirmations The depth at which a block is considered confirmed depending on the chain. All attestation providers must agree on this number.\n @param lowestQueryWindowBlockNumber The block number of the latest block that has a timestamp strictly smaller than `blockTimestamp` - `queryWindow`.\n @param lowestQueryWindowBlockTimestamp The timestamp of the block at height `lowestQueryWindowBlockNumber`.",
1060
- "params": [
1061
- {
1062
- "name": "blockTimestamp",
1063
- "type": "uint64",
1064
- "typeSimple": "uint64",
1065
- "comment": "The timestamp of the block with `blockNumber`."
1066
- },
1067
- {
1068
- "name": "numberOfConfirmations",
1069
- "type": "uint64",
1070
- "typeSimple": "uint64",
1071
- "comment": "The depth at which a block is considered confirmed depending on the chain. All attestation providers must agree on this number."
1072
- },
1073
- {
1074
- "name": "lowestQueryWindowBlockNumber",
1075
- "type": "uint64",
1076
- "typeSimple": "uint64",
1077
- "comment": "The block number of the latest block that has a timestamp strictly smaller than `blockTimestamp` - `queryWindow`."
1078
- },
1079
- {
1080
- "name": "lowestQueryWindowBlockTimestamp",
1081
- "type": "uint64",
1082
- "typeSimple": "uint64",
1083
- "comment": "The timestamp of the block at height `lowestQueryWindowBlockNumber`."
1084
- }
1085
- ]
1086
- },
1087
- "requestStructs": [],
1088
- "responseStructs": [],
1089
- "requestAbi": {
1090
- "components": [
1091
- {
1092
- "internalType": "bytes32",
1093
- "name": "attestationType",
1094
- "type": "bytes32"
1095
- },
1096
- {
1097
- "internalType": "bytes32",
1098
- "name": "sourceId",
1099
- "type": "bytes32"
1100
- },
1101
- {
1102
- "internalType": "bytes32",
1103
- "name": "messageIntegrityCode",
1104
- "type": "bytes32"
1105
- },
1106
- {
1107
- "components": [
1108
- {
1109
- "internalType": "uint64",
1110
- "name": "blockNumber",
1111
- "type": "uint64"
1112
- },
1113
- {
1114
- "internalType": "uint64",
1115
- "name": "queryWindow",
1116
- "type": "uint64"
1117
- }
1118
- ],
1119
- "internalType": "struct ConfirmedBlockHeightExists.RequestBody",
1120
- "name": "requestBody",
1121
- "type": "tuple"
1122
- }
1123
- ],
1124
- "internalType": "struct ConfirmedBlockHeightExists.Request",
1125
- "name": "_request",
1126
- "type": "tuple"
1127
- },
1128
- "responseAbi": {
1129
- "components": [
1130
- {
1131
- "internalType": "bytes32",
1132
- "name": "attestationType",
1133
- "type": "bytes32"
1134
- },
1135
- {
1136
- "internalType": "bytes32",
1137
- "name": "sourceId",
1138
- "type": "bytes32"
1139
- },
1140
- {
1141
- "internalType": "uint64",
1142
- "name": "votingRound",
1143
- "type": "uint64"
1144
- },
1145
- {
1146
- "internalType": "uint64",
1147
- "name": "lowestUsedTimestamp",
1148
- "type": "uint64"
1149
- },
1150
- {
1151
- "components": [
1152
- {
1153
- "internalType": "uint64",
1154
- "name": "blockNumber",
1155
- "type": "uint64"
1156
- },
1157
- {
1158
- "internalType": "uint64",
1159
- "name": "queryWindow",
1160
- "type": "uint64"
1161
- }
1162
- ],
1163
- "internalType": "struct ConfirmedBlockHeightExists.RequestBody",
1164
- "name": "requestBody",
1165
- "type": "tuple"
1166
- },
1167
- {
1168
- "components": [
1169
- {
1170
- "internalType": "uint64",
1171
- "name": "blockTimestamp",
1172
- "type": "uint64"
1173
- },
1174
- {
1175
- "internalType": "uint64",
1176
- "name": "numberOfConfirmations",
1177
- "type": "uint64"
1178
- },
1179
- {
1180
- "internalType": "uint64",
1181
- "name": "lowestQueryWindowBlockNumber",
1182
- "type": "uint64"
1183
- },
1184
- {
1185
- "internalType": "uint64",
1186
- "name": "lowestQueryWindowBlockTimestamp",
1187
- "type": "uint64"
1188
- }
1189
- ],
1190
- "internalType": "struct ConfirmedBlockHeightExists.ResponseBody",
1191
- "name": "responseBody",
1192
- "type": "tuple"
1193
- }
1194
- ],
1195
- "internalType": "struct ConfirmedBlockHeightExists.Response",
1196
- "name": "_response",
1197
- "type": "tuple"
1198
- },
1199
- "proofAbi": {
1200
- "components": [
1201
- {
1202
- "internalType": "bytes32[]",
1203
- "name": "merkleProof",
1204
- "type": "bytes32[]"
1205
- },
1206
- {
1207
- "components": [
1208
- {
1209
- "internalType": "bytes32",
1210
- "name": "attestationType",
1211
- "type": "bytes32"
1212
- },
1213
- {
1214
- "internalType": "bytes32",
1215
- "name": "sourceId",
1216
- "type": "bytes32"
1217
- },
1218
- {
1219
- "internalType": "uint64",
1220
- "name": "votingRound",
1221
- "type": "uint64"
1222
- },
1223
- {
1224
- "internalType": "uint64",
1225
- "name": "lowestUsedTimestamp",
1226
- "type": "uint64"
1227
- },
1228
- {
1229
- "components": [
1230
- {
1231
- "internalType": "uint64",
1232
- "name": "blockNumber",
1233
- "type": "uint64"
1234
- },
1235
- {
1236
- "internalType": "uint64",
1237
- "name": "queryWindow",
1238
- "type": "uint64"
1239
- }
1240
- ],
1241
- "internalType": "struct ConfirmedBlockHeightExists.RequestBody",
1242
- "name": "requestBody",
1243
- "type": "tuple"
1244
- },
1245
- {
1246
- "components": [
1247
- {
1248
- "internalType": "uint64",
1249
- "name": "blockTimestamp",
1250
- "type": "uint64"
1251
- },
1252
- {
1253
- "internalType": "uint64",
1254
- "name": "numberOfConfirmations",
1255
- "type": "uint64"
1256
- },
1257
- {
1258
- "internalType": "uint64",
1259
- "name": "lowestQueryWindowBlockNumber",
1260
- "type": "uint64"
1261
- },
1262
- {
1263
- "internalType": "uint64",
1264
- "name": "lowestQueryWindowBlockTimestamp",
1265
- "type": "uint64"
1266
- }
1267
- ],
1268
- "internalType": "struct ConfirmedBlockHeightExists.ResponseBody",
1269
- "name": "responseBody",
1270
- "type": "tuple"
1271
- }
1272
- ],
1273
- "internalType": "struct ConfirmedBlockHeightExists.Response",
1274
- "name": "data",
1275
- "type": "tuple"
1276
- }
1277
- ],
1278
- "internalType": "struct ConfirmedBlockHeightExists.Proof",
1279
- "name": "_proof",
1280
- "type": "tuple"
1281
- }
1282
- });
1283
- typeRecMap.set("EVMTransaction", {
1284
- "name": "EVMTransaction",
1285
- "fullComment": " @custom:name EVMTransaction\n @custom:id 0x06\n @custom:supported ETH, FLR, SGB, testETH, testFLR, testSGB\n @author Flare\n @notice A relay of a transaction from an EVM chain.\n This type is only relevant for EVM-compatible chains.\n @custom:verification If a transaction with the `transactionId` is in a block on the main branch with at least `requiredConfirmations`, the specified data is relayed.\n If an indicated event does not exist, the request is rejected.\n @custom:lut `timestamp`",
1286
- "description": "A relay of a transaction from an EVM chain.\n This type is only relevant for EVM-compatible chains.",
1287
- "supported": [
1288
- "ETH",
1289
- "FLR",
1290
- "SGB",
1291
- "testETH",
1292
- "testFLR",
1293
- "testSGB"
1294
- ],
1295
- "verification": "If a transaction with the `transactionId` is in a block on the main branch with at least `requiredConfirmations`, the specified data is relayed.\n If an indicated event does not exist, the request is rejected.\n ",
1296
- "lut": "`timestamp`",
1297
- "proof": {
1298
- "name": "Proof",
1299
- "description": "Toplevel proof",
1300
- "above": "",
1301
- "below": "",
1302
- "fullComment": " @notice Toplevel proof\n @param merkleProof Merkle proof corresponding to the attestation response.\n @param data Attestation response.",
1303
- "params": [
1304
- {
1305
- "name": "merkleProof",
1306
- "type": "bytes32[]",
1307
- "typeSimple": "bytes32[]",
1308
- "comment": "Merkle proof corresponding to the attestation response."
1309
- },
1310
- {
1311
- "name": "data",
1312
- "type": "struct EVMTransaction.Response",
1313
- "typeSimple": "Response",
1314
- "comment": "Attestation response."
1315
- }
1316
- ]
1317
- },
1318
- "request": {
1319
- "name": "Request",
1320
- "description": "Toplevel request",
1321
- "above": "",
1322
- "below": "",
1323
- "fullComment": " @notice Toplevel request\n @param attestationType ID of the attestation type.\n @param sourceId ID of the data source.\n @param messageIntegrityCode `MessageIntegrityCode` that is derived from the expected response.\n @param requestBody Data defining the request. Type (struct) and interpretation is determined by the `attestationType`.",
1324
- "params": [
1325
- {
1326
- "name": "attestationType",
1327
- "type": "bytes32",
1328
- "typeSimple": "bytes32",
1329
- "comment": "ID of the attestation type."
1330
- },
1331
- {
1332
- "name": "sourceId",
1333
- "type": "bytes32",
1334
- "typeSimple": "bytes32",
1335
- "comment": "ID of the data source."
1336
- },
1337
- {
1338
- "name": "messageIntegrityCode",
1339
- "type": "bytes32",
1340
- "typeSimple": "bytes32",
1341
- "comment": "`MessageIntegrityCode` that is derived from the expected response."
1342
- },
1343
- {
1344
- "name": "requestBody",
1345
- "type": "struct EVMTransaction.RequestBody",
1346
- "typeSimple": "RequestBody",
1347
- "comment": "Data defining the request. Type (struct) and interpretation is determined by the `attestationType`."
1348
- }
1349
- ]
1350
- },
1351
- "response": {
1352
- "name": "Response",
1353
- "description": "Toplevel response",
1354
- "above": "",
1355
- "below": "",
1356
- "fullComment": " @notice Toplevel response\n @param attestationType Extracted from the request.\n @param sourceId Extracted from the request.\n @param votingRound The ID of the State Connector round in which the request was considered.\n @param lowestUsedTimestamp The lowest timestamp used to generate the response.\n @param requestBody Extracted from the request.\n @param responseBody Data defining the response. The verification rules for the construction of the response body and the type are defined per specific `attestationType`.",
1357
- "params": [
1358
- {
1359
- "name": "attestationType",
1360
- "type": "bytes32",
1361
- "typeSimple": "bytes32",
1362
- "comment": "Extracted from the request."
1363
- },
1364
- {
1365
- "name": "sourceId",
1366
- "type": "bytes32",
1367
- "typeSimple": "bytes32",
1368
- "comment": "Extracted from the request."
1369
- },
1370
- {
1371
- "name": "votingRound",
1372
- "type": "uint64",
1373
- "typeSimple": "uint64",
1374
- "comment": "The ID of the State Connector round in which the request was considered."
1375
- },
1376
- {
1377
- "name": "lowestUsedTimestamp",
1378
- "type": "uint64",
1379
- "typeSimple": "uint64",
1380
- "comment": "The lowest timestamp used to generate the response."
1381
- },
1382
- {
1383
- "name": "requestBody",
1384
- "type": "struct EVMTransaction.RequestBody",
1385
- "typeSimple": "RequestBody",
1386
- "comment": "Extracted from the request."
1387
- },
1388
- {
1389
- "name": "responseBody",
1390
- "type": "struct EVMTransaction.ResponseBody",
1391
- "typeSimple": "ResponseBody",
1392
- "comment": "Data defining the response. The verification rules for the construction of the response body and the type are defined per specific `attestationType`."
1393
- }
1394
- ]
1395
- },
1396
- "requestBody": {
1397
- "name": "RequestBody",
1398
- "description": "Request body for EVM transaction attestation type",
1399
- "above": "",
1400
- "below": "Note that events (logs) are indexed in block not in each transaction. The contract that uses the attestation should specify the order of event logs as needed and the requestor should sort `logIndices`\n with respect to the set specifications. If possible, the contact should only require one `logIndex`.",
1401
- "fullComment": " @notice Request body for EVM transaction attestation type\n @custom:below Note that events (logs) are indexed in block not in each transaction. The contract that uses the attestation should specify the order of event logs as needed and the requestor should sort `logIndices`\n with respect to the set specifications. If possible, the contact should only require one `logIndex`.\n @param transactionHash Hash of the transaction(transactionHash).\n @param requiredConfirmations The height at which a block is considered confirmed by the requestor.\n @param provideInput If true, \"input\" field is included in the response.\n @param listEvents If true, events indicated by `logIndices` are included in the response. Otherwise, no events are included in the response.\n @param logIndices If `listEvents` is `false`, this should be an empty list, otherwise, the request is rejected. If `listEvents` is `true`, this is the list of indices (logIndex) of the events to be relayed (sorted by the requestor). The array should contain at most 50 indices. If empty, it indicates all events in order capped by 50.",
1402
- "params": [
1403
- {
1404
- "name": "transactionHash",
1405
- "type": "bytes32",
1406
- "typeSimple": "bytes32",
1407
- "comment": "Hash of the transaction(transactionHash)."
1408
- },
1409
- {
1410
- "name": "requiredConfirmations",
1411
- "type": "uint16",
1412
- "typeSimple": "uint16",
1413
- "comment": "The height at which a block is considered confirmed by the requestor."
1414
- },
1415
- {
1416
- "name": "provideInput",
1417
- "type": "bool",
1418
- "typeSimple": "bool",
1419
- "comment": "If true, \"input\" field is included in the response."
1420
- },
1421
- {
1422
- "name": "listEvents",
1423
- "type": "bool",
1424
- "typeSimple": "bool",
1425
- "comment": "If true, events indicated by `logIndices` are included in the response. Otherwise, no events are included in the response."
1426
- },
1427
- {
1428
- "name": "logIndices",
1429
- "type": "uint32[]",
1430
- "typeSimple": "uint32[]",
1431
- "comment": "If `listEvents` is `false`, this should be an empty list, otherwise, the request is rejected. If `listEvents` is `true`, this is the list of indices (logIndex) of the events to be relayed (sorted by the requestor). The array should contain at most 50 indices. If empty, it indicates all events in order capped by 50."
1432
- }
1433
- ]
1434
- },
1435
- "responseBody": {
1436
- "name": "ResponseBody",
1437
- "description": "Response body for EVM transaction attestation type",
1438
- "above": "",
1439
- "below": "The fields are in line with [transaction](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionbyhash) provided by EVM node.",
1440
- "fullComment": " @notice Response body for EVM transaction attestation type\n @custom:below The fields are in line with [transaction](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionbyhash) provided by EVM node.\n @param blockNumber Number of the block in which the transaction is included.\n @param timestamp Timestamp of the block in which the transaction is included.\n @param sourceAddress The address (from) that signed the transaction.\n @param isDeployment Indicate whether it is a contract creation transaction.\n @param receivingAddress The address (to) of the receiver of the initial transaction. Zero address if `isDeployment` is `true`.\n @param value The value transferred by the initial transaction in wei.\n @param input If `provideInput`, this is the data send along with the initial transaction. Otherwise it is the default value `0x00`.\n @param status Status of the transaction 1 - success, 0 - failure.\n @param events If `listEvents` is `true`, an array of the requested events. Sorted by the logIndex in the same order as `logIndices`. Otherwise, an empty array.",
1441
- "params": [
1442
- {
1443
- "name": "blockNumber",
1444
- "type": "uint64",
1445
- "typeSimple": "uint64",
1446
- "comment": "Number of the block in which the transaction is included."
1447
- },
1448
- {
1449
- "name": "timestamp",
1450
- "type": "uint64",
1451
- "typeSimple": "uint64",
1452
- "comment": "Timestamp of the block in which the transaction is included."
1453
- },
1454
- {
1455
- "name": "sourceAddress",
1456
- "type": "address",
1457
- "typeSimple": "address",
1458
- "comment": "The address (from) that signed the transaction."
1459
- },
1460
- {
1461
- "name": "isDeployment",
1462
- "type": "bool",
1463
- "typeSimple": "bool",
1464
- "comment": "Indicate whether it is a contract creation transaction."
1465
- },
1466
- {
1467
- "name": "receivingAddress",
1468
- "type": "address",
1469
- "typeSimple": "address",
1470
- "comment": "The address (to) of the receiver of the initial transaction. Zero address if `isDeployment` is `true`."
1471
- },
1472
- {
1473
- "name": "value",
1474
- "type": "uint256",
1475
- "typeSimple": "uint256",
1476
- "comment": "The value transferred by the initial transaction in wei."
1477
- },
1478
- {
1479
- "name": "input",
1480
- "type": "bytes",
1481
- "typeSimple": "bytes",
1482
- "comment": "If `provideInput`, this is the data send along with the initial transaction. Otherwise it is the default value `0x00`."
1483
- },
1484
- {
1485
- "name": "status",
1486
- "type": "uint8",
1487
- "typeSimple": "uint8",
1488
- "comment": "Status of the transaction 1 - success, 0 - failure."
1489
- },
1490
- {
1491
- "name": "events",
1492
- "type": "struct EVMTransaction.Event[]",
1493
- "typeSimple": "Event[]",
1494
- "comment": "If `listEvents` is `true`, an array of the requested events. Sorted by the logIndex in the same order as `logIndices`. Otherwise, an empty array."
1495
- }
1496
- ]
1497
- },
1498
- "requestStructs": [],
1499
- "responseStructs": [
1500
- {
1501
- "name": "Event",
1502
- "description": "Event log record",
1503
- "above": "An `Event` is a struct with the following fields:",
1504
- "below": "The fields are in line with [EVM event logs](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges).",
1505
- "fullComment": " @notice Event log record\n @custom:above An `Event` is a struct with the following fields:\n @custom:below The fields are in line with [EVM event logs](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges).\n @param logIndex The consecutive number of the event in block.\n @param emitterAddress The address of the contract that emitted the event.\n @param topics An array of up to four 32-byte strings of indexed log arguments.\n @param data Concatenated 32-byte strings of non-indexed log arguments. At least 32 bytes long.\n @param removed It is `true` if the log was removed due to a chain reorganization and `false` if it is a valid log.",
1506
- "params": [
1507
- {
1508
- "name": "logIndex",
1509
- "type": "uint32",
1510
- "typeSimple": "uint32",
1511
- "comment": "The consecutive number of the event in block."
1512
- },
1513
- {
1514
- "name": "emitterAddress",
1515
- "type": "address",
1516
- "typeSimple": "address",
1517
- "comment": "The address of the contract that emitted the event."
1518
- },
1519
- {
1520
- "name": "topics",
1521
- "type": "bytes32[]",
1522
- "typeSimple": "bytes32[]",
1523
- "comment": "An array of up to four 32-byte strings of indexed log arguments."
1524
- },
1525
- {
1526
- "name": "data",
1527
- "type": "bytes",
1528
- "typeSimple": "bytes",
1529
- "comment": "Concatenated 32-byte strings of non-indexed log arguments. At least 32 bytes long."
1530
- },
1531
- {
1532
- "name": "removed",
1533
- "type": "bool",
1534
- "typeSimple": "bool",
1535
- "comment": "It is `true` if the log was removed due to a chain reorganization and `false` if it is a valid log."
1536
- }
1537
- ]
1538
- }
1539
- ],
1540
- "requestAbi": {
1541
- "components": [
1542
- {
1543
- "internalType": "bytes32",
1544
- "name": "attestationType",
1545
- "type": "bytes32"
1546
- },
1547
- {
1548
- "internalType": "bytes32",
1549
- "name": "sourceId",
1550
- "type": "bytes32"
1551
- },
1552
- {
1553
- "internalType": "bytes32",
1554
- "name": "messageIntegrityCode",
1555
- "type": "bytes32"
1556
- },
1557
- {
1558
- "components": [
1559
- {
1560
- "internalType": "bytes32",
1561
- "name": "transactionHash",
1562
- "type": "bytes32"
1563
- },
1564
- {
1565
- "internalType": "uint16",
1566
- "name": "requiredConfirmations",
1567
- "type": "uint16"
1568
- },
1569
- {
1570
- "internalType": "bool",
1571
- "name": "provideInput",
1572
- "type": "bool"
1573
- },
1574
- {
1575
- "internalType": "bool",
1576
- "name": "listEvents",
1577
- "type": "bool"
1578
- },
1579
- {
1580
- "internalType": "uint32[]",
1581
- "name": "logIndices",
1582
- "type": "uint32[]"
1583
- }
1584
- ],
1585
- "internalType": "struct EVMTransaction.RequestBody",
1586
- "name": "requestBody",
1587
- "type": "tuple"
1588
- }
1589
- ],
1590
- "internalType": "struct EVMTransaction.Request",
1591
- "name": "_request",
1592
- "type": "tuple"
1593
- },
1594
- "responseAbi": {
1595
- "components": [
1596
- {
1597
- "internalType": "bytes32",
1598
- "name": "attestationType",
1599
- "type": "bytes32"
1600
- },
1601
- {
1602
- "internalType": "bytes32",
1603
- "name": "sourceId",
1604
- "type": "bytes32"
1605
- },
1606
- {
1607
- "internalType": "uint64",
1608
- "name": "votingRound",
1609
- "type": "uint64"
1610
- },
1611
- {
1612
- "internalType": "uint64",
1613
- "name": "lowestUsedTimestamp",
1614
- "type": "uint64"
1615
- },
1616
- {
1617
- "components": [
1618
- {
1619
- "internalType": "bytes32",
1620
- "name": "transactionHash",
1621
- "type": "bytes32"
1622
- },
1623
- {
1624
- "internalType": "uint16",
1625
- "name": "requiredConfirmations",
1626
- "type": "uint16"
1627
- },
1628
- {
1629
- "internalType": "bool",
1630
- "name": "provideInput",
1631
- "type": "bool"
1632
- },
1633
- {
1634
- "internalType": "bool",
1635
- "name": "listEvents",
1636
- "type": "bool"
1637
- },
1638
- {
1639
- "internalType": "uint32[]",
1640
- "name": "logIndices",
1641
- "type": "uint32[]"
1642
- }
1643
- ],
1644
- "internalType": "struct EVMTransaction.RequestBody",
1645
- "name": "requestBody",
1646
- "type": "tuple"
1647
- },
1648
- {
1649
- "components": [
1650
- {
1651
- "internalType": "uint64",
1652
- "name": "blockNumber",
1653
- "type": "uint64"
1654
- },
1655
- {
1656
- "internalType": "uint64",
1657
- "name": "timestamp",
1658
- "type": "uint64"
1659
- },
1660
- {
1661
- "internalType": "address",
1662
- "name": "sourceAddress",
1663
- "type": "address"
1664
- },
1665
- {
1666
- "internalType": "bool",
1667
- "name": "isDeployment",
1668
- "type": "bool"
1669
- },
1670
- {
1671
- "internalType": "address",
1672
- "name": "receivingAddress",
1673
- "type": "address"
1674
- },
1675
- {
1676
- "internalType": "uint256",
1677
- "name": "value",
1678
- "type": "uint256"
1679
- },
1680
- {
1681
- "internalType": "bytes",
1682
- "name": "input",
1683
- "type": "bytes"
1684
- },
1685
- {
1686
- "internalType": "uint8",
1687
- "name": "status",
1688
- "type": "uint8"
1689
- },
1690
- {
1691
- "components": [
1692
- {
1693
- "internalType": "uint32",
1694
- "name": "logIndex",
1695
- "type": "uint32"
1696
- },
1697
- {
1698
- "internalType": "address",
1699
- "name": "emitterAddress",
1700
- "type": "address"
1701
- },
1702
- {
1703
- "internalType": "bytes32[]",
1704
- "name": "topics",
1705
- "type": "bytes32[]"
1706
- },
1707
- {
1708
- "internalType": "bytes",
1709
- "name": "data",
1710
- "type": "bytes"
1711
- },
1712
- {
1713
- "internalType": "bool",
1714
- "name": "removed",
1715
- "type": "bool"
1716
- }
1717
- ],
1718
- "internalType": "struct EVMTransaction.Event[]",
1719
- "name": "events",
1720
- "type": "tuple[]"
1721
- }
1722
- ],
1723
- "internalType": "struct EVMTransaction.ResponseBody",
1724
- "name": "responseBody",
1725
- "type": "tuple"
1726
- }
1727
- ],
1728
- "internalType": "struct EVMTransaction.Response",
1729
- "name": "_response",
1730
- "type": "tuple"
1731
- },
1732
- "proofAbi": {
1733
- "components": [
1734
- {
1735
- "internalType": "bytes32[]",
1736
- "name": "merkleProof",
1737
- "type": "bytes32[]"
1738
- },
1739
- {
1740
- "components": [
1741
- {
1742
- "internalType": "bytes32",
1743
- "name": "attestationType",
1744
- "type": "bytes32"
1745
- },
1746
- {
1747
- "internalType": "bytes32",
1748
- "name": "sourceId",
1749
- "type": "bytes32"
1750
- },
1751
- {
1752
- "internalType": "uint64",
1753
- "name": "votingRound",
1754
- "type": "uint64"
1755
- },
1756
- {
1757
- "internalType": "uint64",
1758
- "name": "lowestUsedTimestamp",
1759
- "type": "uint64"
1760
- },
1761
- {
1762
- "components": [
1763
- {
1764
- "internalType": "bytes32",
1765
- "name": "transactionHash",
1766
- "type": "bytes32"
1767
- },
1768
- {
1769
- "internalType": "uint16",
1770
- "name": "requiredConfirmations",
1771
- "type": "uint16"
1772
- },
1773
- {
1774
- "internalType": "bool",
1775
- "name": "provideInput",
1776
- "type": "bool"
1777
- },
1778
- {
1779
- "internalType": "bool",
1780
- "name": "listEvents",
1781
- "type": "bool"
1782
- },
1783
- {
1784
- "internalType": "uint32[]",
1785
- "name": "logIndices",
1786
- "type": "uint32[]"
1787
- }
1788
- ],
1789
- "internalType": "struct EVMTransaction.RequestBody",
1790
- "name": "requestBody",
1791
- "type": "tuple"
1792
- },
1793
- {
1794
- "components": [
1795
- {
1796
- "internalType": "uint64",
1797
- "name": "blockNumber",
1798
- "type": "uint64"
1799
- },
1800
- {
1801
- "internalType": "uint64",
1802
- "name": "timestamp",
1803
- "type": "uint64"
1804
- },
1805
- {
1806
- "internalType": "address",
1807
- "name": "sourceAddress",
1808
- "type": "address"
1809
- },
1810
- {
1811
- "internalType": "bool",
1812
- "name": "isDeployment",
1813
- "type": "bool"
1814
- },
1815
- {
1816
- "internalType": "address",
1817
- "name": "receivingAddress",
1818
- "type": "address"
1819
- },
1820
- {
1821
- "internalType": "uint256",
1822
- "name": "value",
1823
- "type": "uint256"
1824
- },
1825
- {
1826
- "internalType": "bytes",
1827
- "name": "input",
1828
- "type": "bytes"
1829
- },
1830
- {
1831
- "internalType": "uint8",
1832
- "name": "status",
1833
- "type": "uint8"
1834
- },
1835
- {
1836
- "components": [
1837
- {
1838
- "internalType": "uint32",
1839
- "name": "logIndex",
1840
- "type": "uint32"
1841
- },
1842
- {
1843
- "internalType": "address",
1844
- "name": "emitterAddress",
1845
- "type": "address"
1846
- },
1847
- {
1848
- "internalType": "bytes32[]",
1849
- "name": "topics",
1850
- "type": "bytes32[]"
1851
- },
1852
- {
1853
- "internalType": "bytes",
1854
- "name": "data",
1855
- "type": "bytes"
1856
- },
1857
- {
1858
- "internalType": "bool",
1859
- "name": "removed",
1860
- "type": "bool"
1861
- }
1862
- ],
1863
- "internalType": "struct EVMTransaction.Event[]",
1864
- "name": "events",
1865
- "type": "tuple[]"
1866
- }
1867
- ],
1868
- "internalType": "struct EVMTransaction.ResponseBody",
1869
- "name": "responseBody",
1870
- "type": "tuple"
1871
- }
1872
- ],
1873
- "internalType": "struct EVMTransaction.Response",
1874
- "name": "data",
1875
- "type": "tuple"
1876
- }
1877
- ],
1878
- "internalType": "struct EVMTransaction.Proof",
1879
- "name": "_proof",
1880
- "type": "tuple"
1881
- }
1882
- });
1883
- typeRecMap.set("Payment", {
1884
- "name": "Payment",
1885
- "fullComment": " @custom:name Payment\n @custom:id 0x01\n @custom:supported BTC, DOGE, XRP, testBTC, testDOGE, testXRP\n @author Flare\n @notice A relay of a transaction on an external chain that is considered a payment in a native currency.\n Various blockchains support different types of native payments. For each blockchain, it is specified how a payment\n transaction should be formed to be provable by this attestation type.\n The provable payments emulate traditional banking payments from entity A to entity B in native currency with an optional payment reference.\n @custom:verification The transaction with `transactionId` is fetched from the API of the blockchain node or relevant indexer.\n If the transaction cannot be fetched or the transaction is in a block that does not have a sufficient [number of confirmations](/specs/attestations/configs.md#finalityconfirmation), the attestation request is rejected.\n Once the transaction is received, the [payment summary](/specs/attestations/external-chains/transactions.md#payment-summary) is computed according to the rules for the source chain.\n If the summary is successfully calculated, the response is assembled from the summary.\n `blockNumber` and `blockTimestamp` are retrieved from the block if they are not included in the transaction data.\n For Bitcoin and Dogecoin, `blockTimestamp` is mediantime of the block.\n For XRPL, `blockTimestamp` is close time of the ledger converted to UNIX time.\n If the summary is not successfully calculated, the attestation request is rejected.\n @custom:lut `blockTimestamp`",
1886
- "description": "A relay of a transaction on an external chain that is considered a payment in a native currency.\n Various blockchains support different types of native payments. For each blockchain, it is specified how a payment\n transaction should be formed to be provable by this attestation type.\n The provable payments emulate traditional banking payments from entity A to entity B in native currency with an optional payment reference.",
1887
- "supported": [
1888
- "BTC",
1889
- "DOGE",
1890
- "XRP",
1891
- "testBTC",
1892
- "testDOGE",
1893
- "testXRP"
1894
- ],
1895
- "verification": "The transaction with `transactionId` is fetched from the API of the blockchain node or relevant indexer.\n If the transaction cannot be fetched or the transaction is in a block that does not have a sufficient [number of confirmations](/specs/attestations/configs.md#finalityconfirmation), the attestation request is rejected.\n Once the transaction is received, the [payment summary](/specs/attestations/external-chains/transactions.md#payment-summary) is computed according to the rules for the source chain.\n If the summary is successfully calculated, the response is assembled from the summary.\n `blockNumber` and `blockTimestamp` are retrieved from the block if they are not included in the transaction data.\n For Bitcoin and Dogecoin, `blockTimestamp` is mediantime of the block.\n For XRPL, `blockTimestamp` is close time of the ledger converted to UNIX time.\n If the summary is not successfully calculated, the attestation request is rejected.\n ",
1896
- "lut": "`blockTimestamp`",
1897
- "proof": {
1898
- "name": "Proof",
1899
- "description": "Toplevel proof",
1900
- "above": "",
1901
- "below": "",
1902
- "fullComment": " @notice Toplevel proof\n @param merkleProof Merkle proof corresponding to the attestation response.\n @param data Attestation response.",
1903
- "params": [
1904
- {
1905
- "name": "merkleProof",
1906
- "type": "bytes32[]",
1907
- "typeSimple": "bytes32[]",
1908
- "comment": "Merkle proof corresponding to the attestation response."
1909
- },
1910
- {
1911
- "name": "data",
1912
- "type": "struct Payment.Response",
1913
- "typeSimple": "Response",
1914
- "comment": "Attestation response."
1915
- }
1916
- ]
1917
- },
1918
- "request": {
1919
- "name": "Request",
1920
- "description": "Toplevel request",
1921
- "above": "",
1922
- "below": "",
1923
- "fullComment": " @notice Toplevel request\n @param attestationType ID of the attestation type.\n @param sourceId ID of the data source.\n @param messageIntegrityCode `MessageIntegrityCode` that is derived from the expected response.\n @param requestBody Data defining the request. Type (struct) and interpretation is determined by the `attestationType`.",
1924
- "params": [
1925
- {
1926
- "name": "attestationType",
1927
- "type": "bytes32",
1928
- "typeSimple": "bytes32",
1929
- "comment": "ID of the attestation type."
1930
- },
1931
- {
1932
- "name": "sourceId",
1933
- "type": "bytes32",
1934
- "typeSimple": "bytes32",
1935
- "comment": "ID of the data source."
1936
- },
1937
- {
1938
- "name": "messageIntegrityCode",
1939
- "type": "bytes32",
1940
- "typeSimple": "bytes32",
1941
- "comment": "`MessageIntegrityCode` that is derived from the expected response."
1942
- },
1943
- {
1944
- "name": "requestBody",
1945
- "type": "struct Payment.RequestBody",
1946
- "typeSimple": "RequestBody",
1947
- "comment": "Data defining the request. Type (struct) and interpretation is determined by the `attestationType`."
1948
- }
1949
- ]
1950
- },
1951
- "response": {
1952
- "name": "Response",
1953
- "description": "Toplevel response",
1954
- "above": "",
1955
- "below": "",
1956
- "fullComment": " @notice Toplevel response\n @param attestationType Extracted from the request.\n @param sourceId Extracted from the request.\n @param votingRound The ID of the State Connector round in which the request was considered.\n @param lowestUsedTimestamp The lowest timestamp used to generate the response.\n @param requestBody Extracted from the request.\n @param responseBody Data defining the response. The verification rules for the construction of the response body and the type are defined per specific `attestationType`.",
1957
- "params": [
1958
- {
1959
- "name": "attestationType",
1960
- "type": "bytes32",
1961
- "typeSimple": "bytes32",
1962
- "comment": "Extracted from the request."
1963
- },
1964
- {
1965
- "name": "sourceId",
1966
- "type": "bytes32",
1967
- "typeSimple": "bytes32",
1968
- "comment": "Extracted from the request."
1969
- },
1970
- {
1971
- "name": "votingRound",
1972
- "type": "uint64",
1973
- "typeSimple": "uint64",
1974
- "comment": "The ID of the State Connector round in which the request was considered."
1975
- },
1976
- {
1977
- "name": "lowestUsedTimestamp",
1978
- "type": "uint64",
1979
- "typeSimple": "uint64",
1980
- "comment": "The lowest timestamp used to generate the response."
1981
- },
1982
- {
1983
- "name": "requestBody",
1984
- "type": "struct Payment.RequestBody",
1985
- "typeSimple": "RequestBody",
1986
- "comment": "Extracted from the request."
1987
- },
1988
- {
1989
- "name": "responseBody",
1990
- "type": "struct Payment.ResponseBody",
1991
- "typeSimple": "ResponseBody",
1992
- "comment": "Data defining the response. The verification rules for the construction of the response body and the type are defined per specific `attestationType`."
1993
- }
1994
- ]
1995
- },
1996
- "requestBody": {
1997
- "name": "RequestBody",
1998
- "description": "Request body for Payment attestation type",
1999
- "above": "",
2000
- "below": "",
2001
- "fullComment": " @notice Request body for Payment attestation type\n @param transactionId ID of the payment transaction.\n @param inUtxo For UTXO chains, this is the index of the transaction input with source address. Always 0 for the non-utxo chains.\n @param utxo For UTXO chains, this is the index of the transaction output with receiving address. Always 0 for the non-utxo chains.",
2002
- "params": [
2003
- {
2004
- "name": "transactionId",
2005
- "type": "bytes32",
2006
- "typeSimple": "bytes32",
2007
- "comment": "ID of the payment transaction."
2008
- },
2009
- {
2010
- "name": "inUtxo",
2011
- "type": "uint256",
2012
- "typeSimple": "uint256",
2013
- "comment": "For UTXO chains, this is the index of the transaction input with source address. Always 0 for the non-utxo chains."
2014
- },
2015
- {
2016
- "name": "utxo",
2017
- "type": "uint256",
2018
- "typeSimple": "uint256",
2019
- "comment": "For UTXO chains, this is the index of the transaction output with receiving address. Always 0 for the non-utxo chains."
2020
- }
2021
- ]
2022
- },
2023
- "responseBody": {
2024
- "name": "ResponseBody",
2025
- "description": "Response body for Payment attestation type",
2026
- "above": "",
2027
- "below": "",
2028
- "fullComment": " @notice Response body for Payment attestation type\n @param blockNumber Number of the block in which the transaction is included.\n @param blockTimestamp The timestamp of the block in which the transaction is included.\n @param sourceAddressHash Standard address hash of the source address.\n @param receivingAddressHash Standard address hash of the receiving address. The zero 32-byte string if there is no receivingAddress (if `status` is not success).\n @param intendedReceivingAddressHash Standard address hash of the intended receiving address. Relevant if the transaction is unsuccessful.\n @param spentAmount Amount in minimal units spent by the source address.\n @param intendedSpentAmount Amount in minimal units to be spent by the source address. Relevant if the transaction status is unsuccessful.\n @param receivedAmount Amount in minimal units received by the receiving address.\n @param intendedReceivedAmount Amount in minimal units intended to be received by the receiving address. Relevant if the transaction is unsuccessful.\n @param standardPaymentReference [Standard payment reference](/specs/attestations/external-chains/standardPaymentReference.md) of the transaction.\n @param oneToOne Indicator whether only one source and one receiver are involved in the transaction.\n @param status [Succes status](/specs/attestations/external-chains/transactions.md#transaction-success-status) of the transaction: 0 - success, 1 - failed by sender's fault,x 2 - failed by receiver's fault.",
2029
- "params": [
2030
- {
2031
- "name": "blockNumber",
2032
- "type": "uint64",
2033
- "typeSimple": "uint64",
2034
- "comment": "Number of the block in which the transaction is included."
2035
- },
2036
- {
2037
- "name": "blockTimestamp",
2038
- "type": "uint64",
2039
- "typeSimple": "uint64",
2040
- "comment": "The timestamp of the block in which the transaction is included."
2041
- },
2042
- {
2043
- "name": "sourceAddressHash",
2044
- "type": "bytes32",
2045
- "typeSimple": "bytes32",
2046
- "comment": "Standard address hash of the source address."
2047
- },
2048
- {
2049
- "name": "receivingAddressHash",
2050
- "type": "bytes32",
2051
- "typeSimple": "bytes32",
2052
- "comment": "Standard address hash of the receiving address. The zero 32-byte string if there is no receivingAddress (if `status` is not success)."
2053
- },
2054
- {
2055
- "name": "intendedReceivingAddressHash",
2056
- "type": "bytes32",
2057
- "typeSimple": "bytes32",
2058
- "comment": "Standard address hash of the intended receiving address. Relevant if the transaction is unsuccessful."
2059
- },
2060
- {
2061
- "name": "spentAmount",
2062
- "type": "int256",
2063
- "typeSimple": "int256",
2064
- "comment": "Amount in minimal units spent by the source address."
2065
- },
2066
- {
2067
- "name": "intendedSpentAmount",
2068
- "type": "int256",
2069
- "typeSimple": "int256",
2070
- "comment": "Amount in minimal units to be spent by the source address. Relevant if the transaction status is unsuccessful."
2071
- },
2072
- {
2073
- "name": "receivedAmount",
2074
- "type": "int256",
2075
- "typeSimple": "int256",
2076
- "comment": "Amount in minimal units received by the receiving address."
2077
- },
2078
- {
2079
- "name": "intendedReceivedAmount",
2080
- "type": "int256",
2081
- "typeSimple": "int256",
2082
- "comment": "Amount in minimal units intended to be received by the receiving address. Relevant if the transaction is unsuccessful."
2083
- },
2084
- {
2085
- "name": "standardPaymentReference",
2086
- "type": "bytes32",
2087
- "typeSimple": "bytes32",
2088
- "comment": "[Standard payment reference](/specs/attestations/external-chains/standardPaymentReference.md) of the transaction."
2089
- },
2090
- {
2091
- "name": "oneToOne",
2092
- "type": "bool",
2093
- "typeSimple": "bool",
2094
- "comment": "Indicator whether only one source and one receiver are involved in the transaction."
2095
- },
2096
- {
2097
- "name": "status",
2098
- "type": "uint8",
2099
- "typeSimple": "uint8",
2100
- "comment": "[Succes status](/specs/attestations/external-chains/transactions.md#transaction-success-status) of the transaction: 0 - success, 1 - failed by sender's fault,x 2 - failed by receiver's fault."
2101
- }
2102
- ]
2103
- },
2104
- "requestStructs": [],
2105
- "responseStructs": [],
2106
- "requestAbi": {
2107
- "components": [
2108
- {
2109
- "internalType": "bytes32",
2110
- "name": "attestationType",
2111
- "type": "bytes32"
2112
- },
2113
- {
2114
- "internalType": "bytes32",
2115
- "name": "sourceId",
2116
- "type": "bytes32"
2117
- },
2118
- {
2119
- "internalType": "bytes32",
2120
- "name": "messageIntegrityCode",
2121
- "type": "bytes32"
2122
- },
2123
- {
2124
- "components": [
2125
- {
2126
- "internalType": "bytes32",
2127
- "name": "transactionId",
2128
- "type": "bytes32"
2129
- },
2130
- {
2131
- "internalType": "uint256",
2132
- "name": "inUtxo",
2133
- "type": "uint256"
2134
- },
2135
- {
2136
- "internalType": "uint256",
2137
- "name": "utxo",
2138
- "type": "uint256"
2139
- }
2140
- ],
2141
- "internalType": "struct Payment.RequestBody",
2142
- "name": "requestBody",
2143
- "type": "tuple"
2144
- }
2145
- ],
2146
- "internalType": "struct Payment.Request",
2147
- "name": "_request",
2148
- "type": "tuple"
2149
- },
2150
- "responseAbi": {
2151
- "components": [
2152
- {
2153
- "internalType": "bytes32",
2154
- "name": "attestationType",
2155
- "type": "bytes32"
2156
- },
2157
- {
2158
- "internalType": "bytes32",
2159
- "name": "sourceId",
2160
- "type": "bytes32"
2161
- },
2162
- {
2163
- "internalType": "uint64",
2164
- "name": "votingRound",
2165
- "type": "uint64"
2166
- },
2167
- {
2168
- "internalType": "uint64",
2169
- "name": "lowestUsedTimestamp",
2170
- "type": "uint64"
2171
- },
2172
- {
2173
- "components": [
2174
- {
2175
- "internalType": "bytes32",
2176
- "name": "transactionId",
2177
- "type": "bytes32"
2178
- },
2179
- {
2180
- "internalType": "uint256",
2181
- "name": "inUtxo",
2182
- "type": "uint256"
2183
- },
2184
- {
2185
- "internalType": "uint256",
2186
- "name": "utxo",
2187
- "type": "uint256"
2188
- }
2189
- ],
2190
- "internalType": "struct Payment.RequestBody",
2191
- "name": "requestBody",
2192
- "type": "tuple"
2193
- },
2194
- {
2195
- "components": [
2196
- {
2197
- "internalType": "uint64",
2198
- "name": "blockNumber",
2199
- "type": "uint64"
2200
- },
2201
- {
2202
- "internalType": "uint64",
2203
- "name": "blockTimestamp",
2204
- "type": "uint64"
2205
- },
2206
- {
2207
- "internalType": "bytes32",
2208
- "name": "sourceAddressHash",
2209
- "type": "bytes32"
2210
- },
2211
- {
2212
- "internalType": "bytes32",
2213
- "name": "receivingAddressHash",
2214
- "type": "bytes32"
2215
- },
2216
- {
2217
- "internalType": "bytes32",
2218
- "name": "intendedReceivingAddressHash",
2219
- "type": "bytes32"
2220
- },
2221
- {
2222
- "internalType": "int256",
2223
- "name": "spentAmount",
2224
- "type": "int256"
2225
- },
2226
- {
2227
- "internalType": "int256",
2228
- "name": "intendedSpentAmount",
2229
- "type": "int256"
2230
- },
2231
- {
2232
- "internalType": "int256",
2233
- "name": "receivedAmount",
2234
- "type": "int256"
2235
- },
2236
- {
2237
- "internalType": "int256",
2238
- "name": "intendedReceivedAmount",
2239
- "type": "int256"
2240
- },
2241
- {
2242
- "internalType": "bytes32",
2243
- "name": "standardPaymentReference",
2244
- "type": "bytes32"
2245
- },
2246
- {
2247
- "internalType": "bool",
2248
- "name": "oneToOne",
2249
- "type": "bool"
2250
- },
2251
- {
2252
- "internalType": "uint8",
2253
- "name": "status",
2254
- "type": "uint8"
2255
- }
2256
- ],
2257
- "internalType": "struct Payment.ResponseBody",
2258
- "name": "responseBody",
2259
- "type": "tuple"
2260
- }
2261
- ],
2262
- "internalType": "struct Payment.Response",
2263
- "name": "_response",
2264
- "type": "tuple"
2265
- },
2266
- "proofAbi": {
2267
- "components": [
2268
- {
2269
- "internalType": "bytes32[]",
2270
- "name": "merkleProof",
2271
- "type": "bytes32[]"
2272
- },
2273
- {
2274
- "components": [
2275
- {
2276
- "internalType": "bytes32",
2277
- "name": "attestationType",
2278
- "type": "bytes32"
2279
- },
2280
- {
2281
- "internalType": "bytes32",
2282
- "name": "sourceId",
2283
- "type": "bytes32"
2284
- },
2285
- {
2286
- "internalType": "uint64",
2287
- "name": "votingRound",
2288
- "type": "uint64"
2289
- },
2290
- {
2291
- "internalType": "uint64",
2292
- "name": "lowestUsedTimestamp",
2293
- "type": "uint64"
2294
- },
2295
- {
2296
- "components": [
2297
- {
2298
- "internalType": "bytes32",
2299
- "name": "transactionId",
2300
- "type": "bytes32"
2301
- },
2302
- {
2303
- "internalType": "uint256",
2304
- "name": "inUtxo",
2305
- "type": "uint256"
2306
- },
2307
- {
2308
- "internalType": "uint256",
2309
- "name": "utxo",
2310
- "type": "uint256"
2311
- }
2312
- ],
2313
- "internalType": "struct Payment.RequestBody",
2314
- "name": "requestBody",
2315
- "type": "tuple"
2316
- },
2317
- {
2318
- "components": [
2319
- {
2320
- "internalType": "uint64",
2321
- "name": "blockNumber",
2322
- "type": "uint64"
2323
- },
2324
- {
2325
- "internalType": "uint64",
2326
- "name": "blockTimestamp",
2327
- "type": "uint64"
2328
- },
2329
- {
2330
- "internalType": "bytes32",
2331
- "name": "sourceAddressHash",
2332
- "type": "bytes32"
2333
- },
2334
- {
2335
- "internalType": "bytes32",
2336
- "name": "receivingAddressHash",
2337
- "type": "bytes32"
2338
- },
2339
- {
2340
- "internalType": "bytes32",
2341
- "name": "intendedReceivingAddressHash",
2342
- "type": "bytes32"
2343
- },
2344
- {
2345
- "internalType": "int256",
2346
- "name": "spentAmount",
2347
- "type": "int256"
2348
- },
2349
- {
2350
- "internalType": "int256",
2351
- "name": "intendedSpentAmount",
2352
- "type": "int256"
2353
- },
2354
- {
2355
- "internalType": "int256",
2356
- "name": "receivedAmount",
2357
- "type": "int256"
2358
- },
2359
- {
2360
- "internalType": "int256",
2361
- "name": "intendedReceivedAmount",
2362
- "type": "int256"
2363
- },
2364
- {
2365
- "internalType": "bytes32",
2366
- "name": "standardPaymentReference",
2367
- "type": "bytes32"
2368
- },
2369
- {
2370
- "internalType": "bool",
2371
- "name": "oneToOne",
2372
- "type": "bool"
2373
- },
2374
- {
2375
- "internalType": "uint8",
2376
- "name": "status",
2377
- "type": "uint8"
2378
- }
2379
- ],
2380
- "internalType": "struct Payment.ResponseBody",
2381
- "name": "responseBody",
2382
- "type": "tuple"
2383
- }
2384
- ],
2385
- "internalType": "struct Payment.Response",
2386
- "name": "data",
2387
- "type": "tuple"
2388
- }
2389
- ],
2390
- "internalType": "struct Payment.Proof",
2391
- "name": "_proof",
2392
- "type": "tuple"
2393
- }
2394
- });
2395
- typeRecMap.set("ReferencedPaymentNonexistence", {
2396
- "name": "ReferencedPaymentNonexistence",
2397
- "fullComment": " @custom:name ReferencedPaymentNonexistence\n @custom:id 0x04\n @custom:supported BTC, DOGE, XRP, testBTC, testDOGE, testXRP\n @author Flare\n @notice Assertion that an agreed-upon payment has not been made by a certain deadline.\n A confirmed request shows that a transaction meeting certain criteria (address, amount, reference) did not appear in the specified block range.\n \n \n This type of attestation can be used to e.g. provide grounds to liquidate funds locked by a smart contract on Flare when a payment is missed. \n @custom:verification If `firstOverflowBlock` cannot be determined or does not have a sufficient [number of confirmations](/specs/attestations/configs.md#finalityconfirmation), the attestation request is rejected.\n If `firstOverflowBlockNumber` is higher or equal to `minimalBlockNumber`, the request is rejected.\n The search range are blocks between heights including `minimalBlockNumber` and excluding `firstOverflowBlockNumber`.\n If the verifier does not have a view of all blocks from `minimalBlockNumber` to `firstOverflowBlockNumber`, the attestation request is rejected.\n The request is confirmed if no transaction meeting the specified criteria is found in the search range.\n The criteria and timestamp are chain specific.\n ### UTXO (Bitcoin and Dogecoin)\n Criteria for the transaction:\n - It is not coinbase transaction.\n - The transaction has the specified [standardPaymentReference](/specs/attestations/external-chains/standardPaymentReference.md#btc-and-doge-blockchains).\n - The sum of values of all outputs with the specified address minus the sum of values of all inputs with the specified address is greater than `amount` (in practice the sum of all values of the inputs with the specified address is zero).\n \n Timestamp is `mediantime`.\n ### XRPL\n Criteria for the transaction:\n - The transaction is of type payment.\n - The transaction has the specified [standardPaymentReference](/specs/attestations/external-chains/standardPaymentReference.md#xrp),\n - One of the following is true:\n - Transaction status is `SUCCESS` and the amount received by the specified destination address is greater than the specified `value`.\n - Transaction status is `RECEIVER_FAILURE` and the specified destination address would receive an amount greater than the specified `value` had the transaction been successful.\n \n Timestamp is `close_time` converted to UNIX time.\n @custom:lut `minimalBlockTimestamp`",
2398
- "description": "Assertion that an agreed-upon payment has not been made by a certain deadline.\n A confirmed request shows that a transaction meeting certain criteria (address, amount, reference) did not appear in the specified block range.\n \n \n This type of attestation can be used to e.g. provide grounds to liquidate funds locked by a smart contract on Flare when a payment is missed.",
2399
- "supported": [
2400
- "BTC",
2401
- "DOGE",
2402
- "XRP",
2403
- "testBTC",
2404
- "testDOGE",
2405
- "testXRP"
2406
- ],
2407
- "verification": "If `firstOverflowBlock` cannot be determined or does not have a sufficient [number of confirmations](/specs/attestations/configs.md#finalityconfirmation), the attestation request is rejected.\n If `firstOverflowBlockNumber` is higher or equal to `minimalBlockNumber`, the request is rejected.\n The search range are blocks between heights including `minimalBlockNumber` and excluding `firstOverflowBlockNumber`.\n If the verifier does not have a view of all blocks from `minimalBlockNumber` to `firstOverflowBlockNumber`, the attestation request is rejected.\n The request is confirmed if no transaction meeting the specified criteria is found in the search range.\n The criteria and timestamp are chain specific.\n ### UTXO (Bitcoin and Dogecoin)\n Criteria for the transaction:\n - It is not coinbase transaction.\n - The transaction has the specified [standardPaymentReference](/specs/attestations/external-chains/standardPaymentReference.md#btc-and-doge-blockchains).\n - The sum of values of all outputs with the specified address minus the sum of values of all inputs with the specified address is greater than `amount` (in practice the sum of all values of the inputs with the specified address is zero).\n \n Timestamp is `mediantime`.\n ### XRPL\n Criteria for the transaction:\n - The transaction is of type payment.\n - The transaction has the specified [standardPaymentReference](/specs/attestations/external-chains/standardPaymentReference.md#xrp),\n - One of the following is true:\n - Transaction status is `SUCCESS` and the amount received by the specified destination address is greater than the specified `value`.\n - Transaction status is `RECEIVER_FAILURE` and the specified destination address would receive an amount greater than the specified `value` had the transaction been successful.\n \n Timestamp is `close_time` converted to UNIX time.\n ",
2408
- "lut": "`minimalBlockTimestamp`",
2409
- "proof": {
2410
- "name": "Proof",
2411
- "description": "Toplevel proof",
2412
- "above": "",
2413
- "below": "",
2414
- "fullComment": " @notice Toplevel proof\n @param merkleProof Merkle proof corresponding to the attestation response.\n @param data Attestation response.",
2415
- "params": [
2416
- {
2417
- "name": "merkleProof",
2418
- "type": "bytes32[]",
2419
- "typeSimple": "bytes32[]",
2420
- "comment": "Merkle proof corresponding to the attestation response."
2421
- },
2422
- {
2423
- "name": "data",
2424
- "type": "struct ReferencedPaymentNonexistence.Response",
2425
- "typeSimple": "Response",
2426
- "comment": "Attestation response."
2427
- }
2428
- ]
2429
- },
2430
- "request": {
2431
- "name": "Request",
2432
- "description": "Toplevel request",
2433
- "above": "",
2434
- "below": "",
2435
- "fullComment": " @notice Toplevel request\n @param attestationType ID of the attestation type.\n @param sourceId ID of the data source.\n @param messageIntegrityCode `MessageIntegrityCode` that is derived from the expected response as defined.\n @param requestBody Data defining the request. Type (struct) and interpretation is determined by the `attestationType`.",
2436
- "params": [
2437
- {
2438
- "name": "attestationType",
2439
- "type": "bytes32",
2440
- "typeSimple": "bytes32",
2441
- "comment": "ID of the attestation type."
2442
- },
2443
- {
2444
- "name": "sourceId",
2445
- "type": "bytes32",
2446
- "typeSimple": "bytes32",
2447
- "comment": "ID of the data source."
2448
- },
2449
- {
2450
- "name": "messageIntegrityCode",
2451
- "type": "bytes32",
2452
- "typeSimple": "bytes32",
2453
- "comment": "`MessageIntegrityCode` that is derived from the expected response as defined."
2454
- },
2455
- {
2456
- "name": "requestBody",
2457
- "type": "struct ReferencedPaymentNonexistence.RequestBody",
2458
- "typeSimple": "RequestBody",
2459
- "comment": "Data defining the request. Type (struct) and interpretation is determined by the `attestationType`."
2460
- }
2461
- ]
2462
- },
2463
- "response": {
2464
- "name": "Response",
2465
- "description": "Toplevel response",
2466
- "above": "",
2467
- "below": "",
2468
- "fullComment": " @notice Toplevel response\n @param attestationType Extracted from the request.\n @param sourceId Extracted from the request.\n @param votingRound The ID of the State Connector round in which the request was considered.\n @param lowestUsedTimestamp The lowest timestamp used to generate the response.\n @param requestBody Extracted from the request.\n @param responseBody Data defining the response. The verification rules for the construction of the response body and the type are defined per specific `attestationType`.",
2469
- "params": [
2470
- {
2471
- "name": "attestationType",
2472
- "type": "bytes32",
2473
- "typeSimple": "bytes32",
2474
- "comment": "Extracted from the request."
2475
- },
2476
- {
2477
- "name": "sourceId",
2478
- "type": "bytes32",
2479
- "typeSimple": "bytes32",
2480
- "comment": "Extracted from the request."
2481
- },
2482
- {
2483
- "name": "votingRound",
2484
- "type": "uint64",
2485
- "typeSimple": "uint64",
2486
- "comment": "The ID of the State Connector round in which the request was considered."
2487
- },
2488
- {
2489
- "name": "lowestUsedTimestamp",
2490
- "type": "uint64",
2491
- "typeSimple": "uint64",
2492
- "comment": "The lowest timestamp used to generate the response."
2493
- },
2494
- {
2495
- "name": "requestBody",
2496
- "type": "struct ReferencedPaymentNonexistence.RequestBody",
2497
- "typeSimple": "RequestBody",
2498
- "comment": "Extracted from the request."
2499
- },
2500
- {
2501
- "name": "responseBody",
2502
- "type": "struct ReferencedPaymentNonexistence.ResponseBody",
2503
- "typeSimple": "ResponseBody",
2504
- "comment": "Data defining the response. The verification rules for the construction of the response body and the type are defined per specific `attestationType`."
2505
- }
2506
- ]
2507
- },
2508
- "requestBody": {
2509
- "name": "RequestBody",
2510
- "description": "Request body for ReferencePaymentNonexistence attestation type",
2511
- "above": "",
2512
- "below": "The `standardPaymentReference` should not be zero (as a 32-byte sequence).",
2513
- "fullComment": " @notice Request body for ReferencePaymentNonexistence attestation type\n @param minimalBlockNumber The start block of the search range.\n @param deadlineBlockNumber The blockNumber to be included in the search range.\n @param deadlineTimestamp The timestamp to be included in the search range.\n @param destinationAddressHash The standard address hash of the address to which the payment had to be done.\n @param amount The requested amount in minimal units that had to be payed.\n @param standardPaymentReference The requested standard payment reference.\n @custom:below The `standardPaymentReference` should not be zero (as a 32-byte sequence).",
2514
- "params": [
2515
- {
2516
- "name": "minimalBlockNumber",
2517
- "type": "uint64",
2518
- "typeSimple": "uint64",
2519
- "comment": "The start block of the search range."
2520
- },
2521
- {
2522
- "name": "deadlineBlockNumber",
2523
- "type": "uint64",
2524
- "typeSimple": "uint64",
2525
- "comment": "The blockNumber to be included in the search range."
2526
- },
2527
- {
2528
- "name": "deadlineTimestamp",
2529
- "type": "uint64",
2530
- "typeSimple": "uint64",
2531
- "comment": "The timestamp to be included in the search range."
2532
- },
2533
- {
2534
- "name": "destinationAddressHash",
2535
- "type": "bytes32",
2536
- "typeSimple": "bytes32",
2537
- "comment": "The standard address hash of the address to which the payment had to be done."
2538
- },
2539
- {
2540
- "name": "amount",
2541
- "type": "uint256",
2542
- "typeSimple": "uint256",
2543
- "comment": "The requested amount in minimal units that had to be payed."
2544
- },
2545
- {
2546
- "name": "standardPaymentReference",
2547
- "type": "bytes32",
2548
- "typeSimple": "bytes32",
2549
- "comment": "The requested standard payment reference."
2550
- }
2551
- ]
2552
- },
2553
- "responseBody": {
2554
- "name": "ResponseBody",
2555
- "description": "Response body for ReferencePaymentNonexistence attestation type.",
2556
- "above": "",
2557
- "below": "`firstOverflowBlock` is the first block that has block number higher than `deadlineBlockNumber` and timestamp later than `deadlineTimestamp`.\n The specified search range are blocks between heights including `minimalBlockNumber` and excluding `firstOverflowBlockNumber`.",
2558
- "fullComment": " @notice Response body for ReferencePaymentNonexistence attestation type.\n @param minimalBlockTimestamp The timestamp of the minimalBlock.\n @param firstOverflowBlockNumber The height of the firstOverflowBlock.\n @param firstOverflowBlockTimestamp The timestamp of the firstOverflowBlock.\n @custom:below `firstOverflowBlock` is the first block that has block number higher than `deadlineBlockNumber` and timestamp later than `deadlineTimestamp`.\n The specified search range are blocks between heights including `minimalBlockNumber` and excluding `firstOverflowBlockNumber`.",
2559
- "params": [
2560
- {
2561
- "name": "minimalBlockTimestamp",
2562
- "type": "uint64",
2563
- "typeSimple": "uint64",
2564
- "comment": "The timestamp of the minimalBlock."
2565
- },
2566
- {
2567
- "name": "firstOverflowBlockNumber",
2568
- "type": "uint64",
2569
- "typeSimple": "uint64",
2570
- "comment": "The height of the firstOverflowBlock."
2571
- },
2572
- {
2573
- "name": "firstOverflowBlockTimestamp",
2574
- "type": "uint64",
2575
- "typeSimple": "uint64",
2576
- "comment": "The timestamp of the firstOverflowBlock."
2577
- }
2578
- ]
2579
- },
2580
- "requestStructs": [],
2581
- "responseStructs": [],
2582
- "requestAbi": {
2583
- "components": [
2584
- {
2585
- "internalType": "bytes32",
2586
- "name": "attestationType",
2587
- "type": "bytes32"
2588
- },
2589
- {
2590
- "internalType": "bytes32",
2591
- "name": "sourceId",
2592
- "type": "bytes32"
2593
- },
2594
- {
2595
- "internalType": "bytes32",
2596
- "name": "messageIntegrityCode",
2597
- "type": "bytes32"
2598
- },
2599
- {
2600
- "components": [
2601
- {
2602
- "internalType": "uint64",
2603
- "name": "minimalBlockNumber",
2604
- "type": "uint64"
2605
- },
2606
- {
2607
- "internalType": "uint64",
2608
- "name": "deadlineBlockNumber",
2609
- "type": "uint64"
2610
- },
2611
- {
2612
- "internalType": "uint64",
2613
- "name": "deadlineTimestamp",
2614
- "type": "uint64"
2615
- },
2616
- {
2617
- "internalType": "bytes32",
2618
- "name": "destinationAddressHash",
2619
- "type": "bytes32"
2620
- },
2621
- {
2622
- "internalType": "uint256",
2623
- "name": "amount",
2624
- "type": "uint256"
2625
- },
2626
- {
2627
- "internalType": "bytes32",
2628
- "name": "standardPaymentReference",
2629
- "type": "bytes32"
2630
- }
2631
- ],
2632
- "internalType": "struct ReferencedPaymentNonexistence.RequestBody",
2633
- "name": "requestBody",
2634
- "type": "tuple"
2635
- }
2636
- ],
2637
- "internalType": "struct ReferencedPaymentNonexistence.Request",
2638
- "name": "_request",
2639
- "type": "tuple"
2640
- },
2641
- "responseAbi": {
2642
- "components": [
2643
- {
2644
- "internalType": "bytes32",
2645
- "name": "attestationType",
2646
- "type": "bytes32"
2647
- },
2648
- {
2649
- "internalType": "bytes32",
2650
- "name": "sourceId",
2651
- "type": "bytes32"
2652
- },
2653
- {
2654
- "internalType": "uint64",
2655
- "name": "votingRound",
2656
- "type": "uint64"
2657
- },
2658
- {
2659
- "internalType": "uint64",
2660
- "name": "lowestUsedTimestamp",
2661
- "type": "uint64"
2662
- },
2663
- {
2664
- "components": [
2665
- {
2666
- "internalType": "uint64",
2667
- "name": "minimalBlockNumber",
2668
- "type": "uint64"
2669
- },
2670
- {
2671
- "internalType": "uint64",
2672
- "name": "deadlineBlockNumber",
2673
- "type": "uint64"
2674
- },
2675
- {
2676
- "internalType": "uint64",
2677
- "name": "deadlineTimestamp",
2678
- "type": "uint64"
2679
- },
2680
- {
2681
- "internalType": "bytes32",
2682
- "name": "destinationAddressHash",
2683
- "type": "bytes32"
2684
- },
2685
- {
2686
- "internalType": "uint256",
2687
- "name": "amount",
2688
- "type": "uint256"
2689
- },
2690
- {
2691
- "internalType": "bytes32",
2692
- "name": "standardPaymentReference",
2693
- "type": "bytes32"
2694
- }
2695
- ],
2696
- "internalType": "struct ReferencedPaymentNonexistence.RequestBody",
2697
- "name": "requestBody",
2698
- "type": "tuple"
2699
- },
2700
- {
2701
- "components": [
2702
- {
2703
- "internalType": "uint64",
2704
- "name": "minimalBlockTimestamp",
2705
- "type": "uint64"
2706
- },
2707
- {
2708
- "internalType": "uint64",
2709
- "name": "firstOverflowBlockNumber",
2710
- "type": "uint64"
2711
- },
2712
- {
2713
- "internalType": "uint64",
2714
- "name": "firstOverflowBlockTimestamp",
2715
- "type": "uint64"
2716
- }
2717
- ],
2718
- "internalType": "struct ReferencedPaymentNonexistence.ResponseBody",
2719
- "name": "responseBody",
2720
- "type": "tuple"
2721
- }
2722
- ],
2723
- "internalType": "struct ReferencedPaymentNonexistence.Response",
2724
- "name": "_response",
2725
- "type": "tuple"
2726
- },
2727
- "proofAbi": {
2728
- "components": [
2729
- {
2730
- "internalType": "bytes32[]",
2731
- "name": "merkleProof",
2732
- "type": "bytes32[]"
2733
- },
2734
- {
2735
- "components": [
2736
- {
2737
- "internalType": "bytes32",
2738
- "name": "attestationType",
2739
- "type": "bytes32"
2740
- },
2741
- {
2742
- "internalType": "bytes32",
2743
- "name": "sourceId",
2744
- "type": "bytes32"
2745
- },
2746
- {
2747
- "internalType": "uint64",
2748
- "name": "votingRound",
2749
- "type": "uint64"
2750
- },
2751
- {
2752
- "internalType": "uint64",
2753
- "name": "lowestUsedTimestamp",
2754
- "type": "uint64"
2755
- },
2756
- {
2757
- "components": [
2758
- {
2759
- "internalType": "uint64",
2760
- "name": "minimalBlockNumber",
2761
- "type": "uint64"
2762
- },
2763
- {
2764
- "internalType": "uint64",
2765
- "name": "deadlineBlockNumber",
2766
- "type": "uint64"
2767
- },
2768
- {
2769
- "internalType": "uint64",
2770
- "name": "deadlineTimestamp",
2771
- "type": "uint64"
2772
- },
2773
- {
2774
- "internalType": "bytes32",
2775
- "name": "destinationAddressHash",
2776
- "type": "bytes32"
2777
- },
2778
- {
2779
- "internalType": "uint256",
2780
- "name": "amount",
2781
- "type": "uint256"
2782
- },
2783
- {
2784
- "internalType": "bytes32",
2785
- "name": "standardPaymentReference",
2786
- "type": "bytes32"
2787
- }
2788
- ],
2789
- "internalType": "struct ReferencedPaymentNonexistence.RequestBody",
2790
- "name": "requestBody",
2791
- "type": "tuple"
2792
- },
2793
- {
2794
- "components": [
2795
- {
2796
- "internalType": "uint64",
2797
- "name": "minimalBlockTimestamp",
2798
- "type": "uint64"
2799
- },
2800
- {
2801
- "internalType": "uint64",
2802
- "name": "firstOverflowBlockNumber",
2803
- "type": "uint64"
2804
- },
2805
- {
2806
- "internalType": "uint64",
2807
- "name": "firstOverflowBlockTimestamp",
2808
- "type": "uint64"
2809
- }
2810
- ],
2811
- "internalType": "struct ReferencedPaymentNonexistence.ResponseBody",
2812
- "name": "responseBody",
2813
- "type": "tuple"
2814
- }
2815
- ],
2816
- "internalType": "struct ReferencedPaymentNonexistence.Response",
2817
- "name": "data",
2818
- "type": "tuple"
2819
- }
2820
- ],
2821
- "internalType": "struct ReferencedPaymentNonexistence.Proof",
2822
- "name": "_proof",
2823
- "type": "tuple"
2824
- }
241
+ const files = (0, fs_1.readdirSync)(configsPath);
242
+ files.forEach((fileName) => {
243
+ const name = path.basename(fileName, ".json");
244
+ typeRecMap.set(name, JSON.parse((0, fs_1.readFileSync)(`${configsPath}/${fileName}`, "utf8")));
2825
245
  });
2826
246
  return typeRecMap;
2827
247
  }
@@ -2835,4 +255,28 @@ function serializeBigInts(obj) {
2835
255
  return JSON.parse(JSON.stringify(obj, (key, value) => (typeof value === "bigint" ? value.toString() : value)));
2836
256
  }
2837
257
  exports.serializeBigInts = serializeBigInts;
258
+ /**
259
+ * Find the package root than contains the directory.
260
+ * @param moduleDir the directory of a module, typically use `__dirname`
261
+ * @returns the directory of the modules's package root.
262
+ */
263
+ function findPackageRoot(moduleDir) {
264
+ let dir = path.resolve(moduleDir);
265
+ // eslint-disable-next-line no-constant-condition
266
+ while (true) {
267
+ const packageJson = path.resolve(dir, "package.json");
268
+ const hasPackageJson = (0, fs_1.existsSync)(packageJson) && (0, fs_1.statSync)(packageJson).isFile();
269
+ const nodeModules = path.resolve(dir, "node_modules");
270
+ const hasNodeModules = (0, fs_1.existsSync)(nodeModules) && (0, fs_1.statSync)(nodeModules).isDirectory();
271
+ if (hasPackageJson && hasNodeModules) {
272
+ return dir;
273
+ }
274
+ if (path.dirname(dir) === dir) {
275
+ // arrived at filesystem root without finding package root
276
+ throw new Error("Cannot find package root");
277
+ }
278
+ dir = path.dirname(dir);
279
+ }
280
+ }
281
+ exports.findPackageRoot = findPackageRoot;
2838
282
  //# sourceMappingURL=utils.js.map