AbstractPyth.json 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911
  1. [
  2. {
  3. "inputs": [],
  4. "name": "InvalidArgument",
  5. "type": "error"
  6. },
  7. {
  8. "inputs": [],
  9. "name": "NoFreshUpdate",
  10. "type": "error"
  11. },
  12. {
  13. "inputs": [],
  14. "name": "StalePrice",
  15. "type": "error"
  16. },
  17. {
  18. "anonymous": false,
  19. "inputs": [
  20. {
  21. "indexed": true,
  22. "internalType": "bytes32",
  23. "name": "id",
  24. "type": "bytes32"
  25. },
  26. {
  27. "indexed": false,
  28. "internalType": "uint64",
  29. "name": "publishTime",
  30. "type": "uint64"
  31. },
  32. {
  33. "indexed": false,
  34. "internalType": "int64",
  35. "name": "price",
  36. "type": "int64"
  37. },
  38. {
  39. "indexed": false,
  40. "internalType": "uint64",
  41. "name": "conf",
  42. "type": "uint64"
  43. }
  44. ],
  45. "name": "PriceFeedUpdate",
  46. "type": "event"
  47. },
  48. {
  49. "anonymous": false,
  50. "inputs": [
  51. {
  52. "indexed": true,
  53. "internalType": "bytes32",
  54. "name": "id",
  55. "type": "bytes32"
  56. },
  57. {
  58. "indexed": false,
  59. "internalType": "uint64",
  60. "name": "startTime",
  61. "type": "uint64"
  62. },
  63. {
  64. "indexed": false,
  65. "internalType": "uint64",
  66. "name": "endTime",
  67. "type": "uint64"
  68. },
  69. {
  70. "indexed": false,
  71. "internalType": "int64",
  72. "name": "twapPrice",
  73. "type": "int64"
  74. },
  75. {
  76. "indexed": false,
  77. "internalType": "uint64",
  78. "name": "twapConf",
  79. "type": "uint64"
  80. },
  81. {
  82. "indexed": false,
  83. "internalType": "uint32",
  84. "name": "downSlotsRatio",
  85. "type": "uint32"
  86. }
  87. ],
  88. "name": "TwapPriceFeedUpdate",
  89. "type": "event"
  90. },
  91. {
  92. "inputs": [
  93. {
  94. "internalType": "bytes32",
  95. "name": "id",
  96. "type": "bytes32"
  97. }
  98. ],
  99. "name": "getEmaPrice",
  100. "outputs": [
  101. {
  102. "components": [
  103. {
  104. "internalType": "int64",
  105. "name": "price",
  106. "type": "int64"
  107. },
  108. {
  109. "internalType": "uint64",
  110. "name": "conf",
  111. "type": "uint64"
  112. },
  113. {
  114. "internalType": "int32",
  115. "name": "expo",
  116. "type": "int32"
  117. },
  118. {
  119. "internalType": "uint256",
  120. "name": "publishTime",
  121. "type": "uint256"
  122. }
  123. ],
  124. "internalType": "struct PythStructs.Price",
  125. "name": "price",
  126. "type": "tuple"
  127. }
  128. ],
  129. "stateMutability": "view",
  130. "type": "function"
  131. },
  132. {
  133. "inputs": [
  134. {
  135. "internalType": "bytes32",
  136. "name": "id",
  137. "type": "bytes32"
  138. },
  139. {
  140. "internalType": "uint256",
  141. "name": "age",
  142. "type": "uint256"
  143. }
  144. ],
  145. "name": "getEmaPriceNoOlderThan",
  146. "outputs": [
  147. {
  148. "components": [
  149. {
  150. "internalType": "int64",
  151. "name": "price",
  152. "type": "int64"
  153. },
  154. {
  155. "internalType": "uint64",
  156. "name": "conf",
  157. "type": "uint64"
  158. },
  159. {
  160. "internalType": "int32",
  161. "name": "expo",
  162. "type": "int32"
  163. },
  164. {
  165. "internalType": "uint256",
  166. "name": "publishTime",
  167. "type": "uint256"
  168. }
  169. ],
  170. "internalType": "struct PythStructs.Price",
  171. "name": "price",
  172. "type": "tuple"
  173. }
  174. ],
  175. "stateMutability": "view",
  176. "type": "function"
  177. },
  178. {
  179. "inputs": [
  180. {
  181. "internalType": "bytes32",
  182. "name": "id",
  183. "type": "bytes32"
  184. }
  185. ],
  186. "name": "getEmaPriceUnsafe",
  187. "outputs": [
  188. {
  189. "components": [
  190. {
  191. "internalType": "int64",
  192. "name": "price",
  193. "type": "int64"
  194. },
  195. {
  196. "internalType": "uint64",
  197. "name": "conf",
  198. "type": "uint64"
  199. },
  200. {
  201. "internalType": "int32",
  202. "name": "expo",
  203. "type": "int32"
  204. },
  205. {
  206. "internalType": "uint256",
  207. "name": "publishTime",
  208. "type": "uint256"
  209. }
  210. ],
  211. "internalType": "struct PythStructs.Price",
  212. "name": "price",
  213. "type": "tuple"
  214. }
  215. ],
  216. "stateMutability": "view",
  217. "type": "function"
  218. },
  219. {
  220. "inputs": [
  221. {
  222. "internalType": "bytes32",
  223. "name": "id",
  224. "type": "bytes32"
  225. }
  226. ],
  227. "name": "getPrice",
  228. "outputs": [
  229. {
  230. "components": [
  231. {
  232. "internalType": "int64",
  233. "name": "price",
  234. "type": "int64"
  235. },
  236. {
  237. "internalType": "uint64",
  238. "name": "conf",
  239. "type": "uint64"
  240. },
  241. {
  242. "internalType": "int32",
  243. "name": "expo",
  244. "type": "int32"
  245. },
  246. {
  247. "internalType": "uint256",
  248. "name": "publishTime",
  249. "type": "uint256"
  250. }
  251. ],
  252. "internalType": "struct PythStructs.Price",
  253. "name": "price",
  254. "type": "tuple"
  255. }
  256. ],
  257. "stateMutability": "view",
  258. "type": "function"
  259. },
  260. {
  261. "inputs": [
  262. {
  263. "internalType": "bytes32",
  264. "name": "id",
  265. "type": "bytes32"
  266. },
  267. {
  268. "internalType": "uint256",
  269. "name": "age",
  270. "type": "uint256"
  271. }
  272. ],
  273. "name": "getPriceNoOlderThan",
  274. "outputs": [
  275. {
  276. "components": [
  277. {
  278. "internalType": "int64",
  279. "name": "price",
  280. "type": "int64"
  281. },
  282. {
  283. "internalType": "uint64",
  284. "name": "conf",
  285. "type": "uint64"
  286. },
  287. {
  288. "internalType": "int32",
  289. "name": "expo",
  290. "type": "int32"
  291. },
  292. {
  293. "internalType": "uint256",
  294. "name": "publishTime",
  295. "type": "uint256"
  296. }
  297. ],
  298. "internalType": "struct PythStructs.Price",
  299. "name": "price",
  300. "type": "tuple"
  301. }
  302. ],
  303. "stateMutability": "view",
  304. "type": "function"
  305. },
  306. {
  307. "inputs": [
  308. {
  309. "internalType": "bytes32",
  310. "name": "id",
  311. "type": "bytes32"
  312. }
  313. ],
  314. "name": "getPriceUnsafe",
  315. "outputs": [
  316. {
  317. "components": [
  318. {
  319. "internalType": "int64",
  320. "name": "price",
  321. "type": "int64"
  322. },
  323. {
  324. "internalType": "uint64",
  325. "name": "conf",
  326. "type": "uint64"
  327. },
  328. {
  329. "internalType": "int32",
  330. "name": "expo",
  331. "type": "int32"
  332. },
  333. {
  334. "internalType": "uint256",
  335. "name": "publishTime",
  336. "type": "uint256"
  337. }
  338. ],
  339. "internalType": "struct PythStructs.Price",
  340. "name": "price",
  341. "type": "tuple"
  342. }
  343. ],
  344. "stateMutability": "view",
  345. "type": "function"
  346. },
  347. {
  348. "inputs": [
  349. {
  350. "internalType": "bytes[]",
  351. "name": "updateData",
  352. "type": "bytes[]"
  353. }
  354. ],
  355. "name": "getTwapUpdateFee",
  356. "outputs": [
  357. {
  358. "internalType": "uint256",
  359. "name": "feeAmount",
  360. "type": "uint256"
  361. }
  362. ],
  363. "stateMutability": "view",
  364. "type": "function"
  365. },
  366. {
  367. "inputs": [
  368. {
  369. "internalType": "bytes[]",
  370. "name": "updateData",
  371. "type": "bytes[]"
  372. }
  373. ],
  374. "name": "getUpdateFee",
  375. "outputs": [
  376. {
  377. "internalType": "uint256",
  378. "name": "feeAmount",
  379. "type": "uint256"
  380. }
  381. ],
  382. "stateMutability": "view",
  383. "type": "function"
  384. },
  385. {
  386. "inputs": [],
  387. "name": "getValidTimePeriod",
  388. "outputs": [
  389. {
  390. "internalType": "uint256",
  391. "name": "validTimePeriod",
  392. "type": "uint256"
  393. }
  394. ],
  395. "stateMutability": "view",
  396. "type": "function"
  397. },
  398. {
  399. "inputs": [
  400. {
  401. "internalType": "bytes[]",
  402. "name": "updateData",
  403. "type": "bytes[]"
  404. },
  405. {
  406. "internalType": "bytes32[]",
  407. "name": "priceIds",
  408. "type": "bytes32[]"
  409. },
  410. {
  411. "internalType": "uint64",
  412. "name": "minPublishTime",
  413. "type": "uint64"
  414. },
  415. {
  416. "internalType": "uint64",
  417. "name": "maxPublishTime",
  418. "type": "uint64"
  419. }
  420. ],
  421. "name": "parsePriceFeedUpdates",
  422. "outputs": [
  423. {
  424. "components": [
  425. {
  426. "internalType": "bytes32",
  427. "name": "id",
  428. "type": "bytes32"
  429. },
  430. {
  431. "components": [
  432. {
  433. "internalType": "int64",
  434. "name": "price",
  435. "type": "int64"
  436. },
  437. {
  438. "internalType": "uint64",
  439. "name": "conf",
  440. "type": "uint64"
  441. },
  442. {
  443. "internalType": "int32",
  444. "name": "expo",
  445. "type": "int32"
  446. },
  447. {
  448. "internalType": "uint256",
  449. "name": "publishTime",
  450. "type": "uint256"
  451. }
  452. ],
  453. "internalType": "struct PythStructs.Price",
  454. "name": "price",
  455. "type": "tuple"
  456. },
  457. {
  458. "components": [
  459. {
  460. "internalType": "int64",
  461. "name": "price",
  462. "type": "int64"
  463. },
  464. {
  465. "internalType": "uint64",
  466. "name": "conf",
  467. "type": "uint64"
  468. },
  469. {
  470. "internalType": "int32",
  471. "name": "expo",
  472. "type": "int32"
  473. },
  474. {
  475. "internalType": "uint256",
  476. "name": "publishTime",
  477. "type": "uint256"
  478. }
  479. ],
  480. "internalType": "struct PythStructs.Price",
  481. "name": "emaPrice",
  482. "type": "tuple"
  483. }
  484. ],
  485. "internalType": "struct PythStructs.PriceFeed[]",
  486. "name": "priceFeeds",
  487. "type": "tuple[]"
  488. }
  489. ],
  490. "stateMutability": "payable",
  491. "type": "function"
  492. },
  493. {
  494. "inputs": [
  495. {
  496. "internalType": "bytes[]",
  497. "name": "updateData",
  498. "type": "bytes[]"
  499. },
  500. {
  501. "internalType": "bytes32[]",
  502. "name": "priceIds",
  503. "type": "bytes32[]"
  504. },
  505. {
  506. "internalType": "uint64",
  507. "name": "minPublishTime",
  508. "type": "uint64"
  509. },
  510. {
  511. "internalType": "uint64",
  512. "name": "maxPublishTime",
  513. "type": "uint64"
  514. }
  515. ],
  516. "name": "parsePriceFeedUpdatesUnique",
  517. "outputs": [
  518. {
  519. "components": [
  520. {
  521. "internalType": "bytes32",
  522. "name": "id",
  523. "type": "bytes32"
  524. },
  525. {
  526. "components": [
  527. {
  528. "internalType": "int64",
  529. "name": "price",
  530. "type": "int64"
  531. },
  532. {
  533. "internalType": "uint64",
  534. "name": "conf",
  535. "type": "uint64"
  536. },
  537. {
  538. "internalType": "int32",
  539. "name": "expo",
  540. "type": "int32"
  541. },
  542. {
  543. "internalType": "uint256",
  544. "name": "publishTime",
  545. "type": "uint256"
  546. }
  547. ],
  548. "internalType": "struct PythStructs.Price",
  549. "name": "price",
  550. "type": "tuple"
  551. },
  552. {
  553. "components": [
  554. {
  555. "internalType": "int64",
  556. "name": "price",
  557. "type": "int64"
  558. },
  559. {
  560. "internalType": "uint64",
  561. "name": "conf",
  562. "type": "uint64"
  563. },
  564. {
  565. "internalType": "int32",
  566. "name": "expo",
  567. "type": "int32"
  568. },
  569. {
  570. "internalType": "uint256",
  571. "name": "publishTime",
  572. "type": "uint256"
  573. }
  574. ],
  575. "internalType": "struct PythStructs.Price",
  576. "name": "emaPrice",
  577. "type": "tuple"
  578. }
  579. ],
  580. "internalType": "struct PythStructs.PriceFeed[]",
  581. "name": "priceFeeds",
  582. "type": "tuple[]"
  583. }
  584. ],
  585. "stateMutability": "payable",
  586. "type": "function"
  587. },
  588. {
  589. "inputs": [
  590. {
  591. "internalType": "bytes[]",
  592. "name": "updateData",
  593. "type": "bytes[]"
  594. },
  595. {
  596. "internalType": "bytes32[]",
  597. "name": "priceIds",
  598. "type": "bytes32[]"
  599. },
  600. {
  601. "internalType": "uint64",
  602. "name": "minAllowedPublishTime",
  603. "type": "uint64"
  604. },
  605. {
  606. "internalType": "uint64",
  607. "name": "maxAllowedPublishTime",
  608. "type": "uint64"
  609. },
  610. {
  611. "internalType": "bool",
  612. "name": "checkUniqueness",
  613. "type": "bool"
  614. },
  615. {
  616. "internalType": "bool",
  617. "name": "checkUpdateDataIsMinimal",
  618. "type": "bool"
  619. },
  620. {
  621. "internalType": "bool",
  622. "name": "storeUpdatesIfFresh",
  623. "type": "bool"
  624. }
  625. ],
  626. "name": "parsePriceFeedUpdatesWithConfig",
  627. "outputs": [
  628. {
  629. "components": [
  630. {
  631. "internalType": "bytes32",
  632. "name": "id",
  633. "type": "bytes32"
  634. },
  635. {
  636. "components": [
  637. {
  638. "internalType": "int64",
  639. "name": "price",
  640. "type": "int64"
  641. },
  642. {
  643. "internalType": "uint64",
  644. "name": "conf",
  645. "type": "uint64"
  646. },
  647. {
  648. "internalType": "int32",
  649. "name": "expo",
  650. "type": "int32"
  651. },
  652. {
  653. "internalType": "uint256",
  654. "name": "publishTime",
  655. "type": "uint256"
  656. }
  657. ],
  658. "internalType": "struct PythStructs.Price",
  659. "name": "price",
  660. "type": "tuple"
  661. },
  662. {
  663. "components": [
  664. {
  665. "internalType": "int64",
  666. "name": "price",
  667. "type": "int64"
  668. },
  669. {
  670. "internalType": "uint64",
  671. "name": "conf",
  672. "type": "uint64"
  673. },
  674. {
  675. "internalType": "int32",
  676. "name": "expo",
  677. "type": "int32"
  678. },
  679. {
  680. "internalType": "uint256",
  681. "name": "publishTime",
  682. "type": "uint256"
  683. }
  684. ],
  685. "internalType": "struct PythStructs.Price",
  686. "name": "emaPrice",
  687. "type": "tuple"
  688. }
  689. ],
  690. "internalType": "struct PythStructs.PriceFeed[]",
  691. "name": "priceFeeds",
  692. "type": "tuple[]"
  693. },
  694. {
  695. "internalType": "uint64[]",
  696. "name": "slots",
  697. "type": "uint64[]"
  698. }
  699. ],
  700. "stateMutability": "payable",
  701. "type": "function"
  702. },
  703. {
  704. "inputs": [
  705. {
  706. "internalType": "bytes[]",
  707. "name": "updateData",
  708. "type": "bytes[]"
  709. },
  710. {
  711. "internalType": "bytes32[]",
  712. "name": "priceIds",
  713. "type": "bytes32[]"
  714. }
  715. ],
  716. "name": "parseTwapPriceFeedUpdates",
  717. "outputs": [
  718. {
  719. "components": [
  720. {
  721. "internalType": "bytes32",
  722. "name": "id",
  723. "type": "bytes32"
  724. },
  725. {
  726. "internalType": "uint64",
  727. "name": "startTime",
  728. "type": "uint64"
  729. },
  730. {
  731. "internalType": "uint64",
  732. "name": "endTime",
  733. "type": "uint64"
  734. },
  735. {
  736. "components": [
  737. {
  738. "internalType": "int64",
  739. "name": "price",
  740. "type": "int64"
  741. },
  742. {
  743. "internalType": "uint64",
  744. "name": "conf",
  745. "type": "uint64"
  746. },
  747. {
  748. "internalType": "int32",
  749. "name": "expo",
  750. "type": "int32"
  751. },
  752. {
  753. "internalType": "uint256",
  754. "name": "publishTime",
  755. "type": "uint256"
  756. }
  757. ],
  758. "internalType": "struct PythStructs.Price",
  759. "name": "twap",
  760. "type": "tuple"
  761. },
  762. {
  763. "internalType": "uint32",
  764. "name": "downSlotsRatio",
  765. "type": "uint32"
  766. }
  767. ],
  768. "internalType": "struct PythStructs.TwapPriceFeed[]",
  769. "name": "twapPriceFeeds",
  770. "type": "tuple[]"
  771. }
  772. ],
  773. "stateMutability": "payable",
  774. "type": "function"
  775. },
  776. {
  777. "inputs": [
  778. {
  779. "internalType": "bytes32",
  780. "name": "id",
  781. "type": "bytes32"
  782. }
  783. ],
  784. "name": "priceFeedExists",
  785. "outputs": [
  786. {
  787. "internalType": "bool",
  788. "name": "exists",
  789. "type": "bool"
  790. }
  791. ],
  792. "stateMutability": "view",
  793. "type": "function"
  794. },
  795. {
  796. "inputs": [
  797. {
  798. "internalType": "bytes32",
  799. "name": "id",
  800. "type": "bytes32"
  801. }
  802. ],
  803. "name": "queryPriceFeed",
  804. "outputs": [
  805. {
  806. "components": [
  807. {
  808. "internalType": "bytes32",
  809. "name": "id",
  810. "type": "bytes32"
  811. },
  812. {
  813. "components": [
  814. {
  815. "internalType": "int64",
  816. "name": "price",
  817. "type": "int64"
  818. },
  819. {
  820. "internalType": "uint64",
  821. "name": "conf",
  822. "type": "uint64"
  823. },
  824. {
  825. "internalType": "int32",
  826. "name": "expo",
  827. "type": "int32"
  828. },
  829. {
  830. "internalType": "uint256",
  831. "name": "publishTime",
  832. "type": "uint256"
  833. }
  834. ],
  835. "internalType": "struct PythStructs.Price",
  836. "name": "price",
  837. "type": "tuple"
  838. },
  839. {
  840. "components": [
  841. {
  842. "internalType": "int64",
  843. "name": "price",
  844. "type": "int64"
  845. },
  846. {
  847. "internalType": "uint64",
  848. "name": "conf",
  849. "type": "uint64"
  850. },
  851. {
  852. "internalType": "int32",
  853. "name": "expo",
  854. "type": "int32"
  855. },
  856. {
  857. "internalType": "uint256",
  858. "name": "publishTime",
  859. "type": "uint256"
  860. }
  861. ],
  862. "internalType": "struct PythStructs.Price",
  863. "name": "emaPrice",
  864. "type": "tuple"
  865. }
  866. ],
  867. "internalType": "struct PythStructs.PriceFeed",
  868. "name": "priceFeed",
  869. "type": "tuple"
  870. }
  871. ],
  872. "stateMutability": "view",
  873. "type": "function"
  874. },
  875. {
  876. "inputs": [
  877. {
  878. "internalType": "bytes[]",
  879. "name": "updateData",
  880. "type": "bytes[]"
  881. }
  882. ],
  883. "name": "updatePriceFeeds",
  884. "outputs": [],
  885. "stateMutability": "payable",
  886. "type": "function"
  887. },
  888. {
  889. "inputs": [
  890. {
  891. "internalType": "bytes[]",
  892. "name": "updateData",
  893. "type": "bytes[]"
  894. },
  895. {
  896. "internalType": "bytes32[]",
  897. "name": "priceIds",
  898. "type": "bytes32[]"
  899. },
  900. {
  901. "internalType": "uint64[]",
  902. "name": "publishTimes",
  903. "type": "uint64[]"
  904. }
  905. ],
  906. "name": "updatePriceFeedsIfNecessary",
  907. "outputs": [],
  908. "stateMutability": "payable",
  909. "type": "function"
  910. }
  911. ]