AbstractPyth.json 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777
  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": "getUpdateFee",
  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. "name": "getValidTimePeriod",
  369. "outputs": [
  370. {
  371. "internalType": "uint256",
  372. "name": "validTimePeriod",
  373. "type": "uint256"
  374. }
  375. ],
  376. "stateMutability": "view",
  377. "type": "function"
  378. },
  379. {
  380. "inputs": [
  381. {
  382. "internalType": "bytes[]",
  383. "name": "updateData",
  384. "type": "bytes[]"
  385. },
  386. {
  387. "internalType": "bytes32[]",
  388. "name": "priceIds",
  389. "type": "bytes32[]"
  390. },
  391. {
  392. "internalType": "uint64",
  393. "name": "minPublishTime",
  394. "type": "uint64"
  395. },
  396. {
  397. "internalType": "uint64",
  398. "name": "maxPublishTime",
  399. "type": "uint64"
  400. }
  401. ],
  402. "name": "parsePriceFeedUpdates",
  403. "outputs": [
  404. {
  405. "components": [
  406. {
  407. "internalType": "bytes32",
  408. "name": "id",
  409. "type": "bytes32"
  410. },
  411. {
  412. "components": [
  413. {
  414. "internalType": "int64",
  415. "name": "price",
  416. "type": "int64"
  417. },
  418. {
  419. "internalType": "uint64",
  420. "name": "conf",
  421. "type": "uint64"
  422. },
  423. {
  424. "internalType": "int32",
  425. "name": "expo",
  426. "type": "int32"
  427. },
  428. {
  429. "internalType": "uint256",
  430. "name": "publishTime",
  431. "type": "uint256"
  432. }
  433. ],
  434. "internalType": "struct PythStructs.Price",
  435. "name": "price",
  436. "type": "tuple"
  437. },
  438. {
  439. "components": [
  440. {
  441. "internalType": "int64",
  442. "name": "price",
  443. "type": "int64"
  444. },
  445. {
  446. "internalType": "uint64",
  447. "name": "conf",
  448. "type": "uint64"
  449. },
  450. {
  451. "internalType": "int32",
  452. "name": "expo",
  453. "type": "int32"
  454. },
  455. {
  456. "internalType": "uint256",
  457. "name": "publishTime",
  458. "type": "uint256"
  459. }
  460. ],
  461. "internalType": "struct PythStructs.Price",
  462. "name": "emaPrice",
  463. "type": "tuple"
  464. }
  465. ],
  466. "internalType": "struct PythStructs.PriceFeed[]",
  467. "name": "priceFeeds",
  468. "type": "tuple[]"
  469. }
  470. ],
  471. "stateMutability": "payable",
  472. "type": "function"
  473. },
  474. {
  475. "inputs": [
  476. {
  477. "internalType": "bytes[]",
  478. "name": "updateData",
  479. "type": "bytes[]"
  480. },
  481. {
  482. "internalType": "bytes32[]",
  483. "name": "priceIds",
  484. "type": "bytes32[]"
  485. },
  486. {
  487. "internalType": "uint64",
  488. "name": "minPublishTime",
  489. "type": "uint64"
  490. },
  491. {
  492. "internalType": "uint64",
  493. "name": "maxPublishTime",
  494. "type": "uint64"
  495. }
  496. ],
  497. "name": "parsePriceFeedUpdatesUnique",
  498. "outputs": [
  499. {
  500. "components": [
  501. {
  502. "internalType": "bytes32",
  503. "name": "id",
  504. "type": "bytes32"
  505. },
  506. {
  507. "components": [
  508. {
  509. "internalType": "int64",
  510. "name": "price",
  511. "type": "int64"
  512. },
  513. {
  514. "internalType": "uint64",
  515. "name": "conf",
  516. "type": "uint64"
  517. },
  518. {
  519. "internalType": "int32",
  520. "name": "expo",
  521. "type": "int32"
  522. },
  523. {
  524. "internalType": "uint256",
  525. "name": "publishTime",
  526. "type": "uint256"
  527. }
  528. ],
  529. "internalType": "struct PythStructs.Price",
  530. "name": "price",
  531. "type": "tuple"
  532. },
  533. {
  534. "components": [
  535. {
  536. "internalType": "int64",
  537. "name": "price",
  538. "type": "int64"
  539. },
  540. {
  541. "internalType": "uint64",
  542. "name": "conf",
  543. "type": "uint64"
  544. },
  545. {
  546. "internalType": "int32",
  547. "name": "expo",
  548. "type": "int32"
  549. },
  550. {
  551. "internalType": "uint256",
  552. "name": "publishTime",
  553. "type": "uint256"
  554. }
  555. ],
  556. "internalType": "struct PythStructs.Price",
  557. "name": "emaPrice",
  558. "type": "tuple"
  559. }
  560. ],
  561. "internalType": "struct PythStructs.PriceFeed[]",
  562. "name": "priceFeeds",
  563. "type": "tuple[]"
  564. }
  565. ],
  566. "stateMutability": "payable",
  567. "type": "function"
  568. },
  569. {
  570. "inputs": [
  571. {
  572. "internalType": "bytes[]",
  573. "name": "updateData",
  574. "type": "bytes[]"
  575. },
  576. {
  577. "internalType": "bytes32[]",
  578. "name": "priceIds",
  579. "type": "bytes32[]"
  580. }
  581. ],
  582. "name": "parseTwapPriceFeedUpdates",
  583. "outputs": [
  584. {
  585. "components": [
  586. {
  587. "internalType": "bytes32",
  588. "name": "id",
  589. "type": "bytes32"
  590. },
  591. {
  592. "internalType": "uint64",
  593. "name": "startTime",
  594. "type": "uint64"
  595. },
  596. {
  597. "internalType": "uint64",
  598. "name": "endTime",
  599. "type": "uint64"
  600. },
  601. {
  602. "components": [
  603. {
  604. "internalType": "int64",
  605. "name": "price",
  606. "type": "int64"
  607. },
  608. {
  609. "internalType": "uint64",
  610. "name": "conf",
  611. "type": "uint64"
  612. },
  613. {
  614. "internalType": "int32",
  615. "name": "expo",
  616. "type": "int32"
  617. },
  618. {
  619. "internalType": "uint256",
  620. "name": "publishTime",
  621. "type": "uint256"
  622. }
  623. ],
  624. "internalType": "struct PythStructs.Price",
  625. "name": "twap",
  626. "type": "tuple"
  627. },
  628. {
  629. "internalType": "uint32",
  630. "name": "downSlotsRatio",
  631. "type": "uint32"
  632. }
  633. ],
  634. "internalType": "struct PythStructs.TwapPriceFeed[]",
  635. "name": "twapPriceFeeds",
  636. "type": "tuple[]"
  637. }
  638. ],
  639. "stateMutability": "payable",
  640. "type": "function"
  641. },
  642. {
  643. "inputs": [
  644. {
  645. "internalType": "bytes32",
  646. "name": "id",
  647. "type": "bytes32"
  648. }
  649. ],
  650. "name": "priceFeedExists",
  651. "outputs": [
  652. {
  653. "internalType": "bool",
  654. "name": "exists",
  655. "type": "bool"
  656. }
  657. ],
  658. "stateMutability": "view",
  659. "type": "function"
  660. },
  661. {
  662. "inputs": [
  663. {
  664. "internalType": "bytes32",
  665. "name": "id",
  666. "type": "bytes32"
  667. }
  668. ],
  669. "name": "queryPriceFeed",
  670. "outputs": [
  671. {
  672. "components": [
  673. {
  674. "internalType": "bytes32",
  675. "name": "id",
  676. "type": "bytes32"
  677. },
  678. {
  679. "components": [
  680. {
  681. "internalType": "int64",
  682. "name": "price",
  683. "type": "int64"
  684. },
  685. {
  686. "internalType": "uint64",
  687. "name": "conf",
  688. "type": "uint64"
  689. },
  690. {
  691. "internalType": "int32",
  692. "name": "expo",
  693. "type": "int32"
  694. },
  695. {
  696. "internalType": "uint256",
  697. "name": "publishTime",
  698. "type": "uint256"
  699. }
  700. ],
  701. "internalType": "struct PythStructs.Price",
  702. "name": "price",
  703. "type": "tuple"
  704. },
  705. {
  706. "components": [
  707. {
  708. "internalType": "int64",
  709. "name": "price",
  710. "type": "int64"
  711. },
  712. {
  713. "internalType": "uint64",
  714. "name": "conf",
  715. "type": "uint64"
  716. },
  717. {
  718. "internalType": "int32",
  719. "name": "expo",
  720. "type": "int32"
  721. },
  722. {
  723. "internalType": "uint256",
  724. "name": "publishTime",
  725. "type": "uint256"
  726. }
  727. ],
  728. "internalType": "struct PythStructs.Price",
  729. "name": "emaPrice",
  730. "type": "tuple"
  731. }
  732. ],
  733. "internalType": "struct PythStructs.PriceFeed",
  734. "name": "priceFeed",
  735. "type": "tuple"
  736. }
  737. ],
  738. "stateMutability": "view",
  739. "type": "function"
  740. },
  741. {
  742. "inputs": [
  743. {
  744. "internalType": "bytes[]",
  745. "name": "updateData",
  746. "type": "bytes[]"
  747. }
  748. ],
  749. "name": "updatePriceFeeds",
  750. "outputs": [],
  751. "stateMutability": "payable",
  752. "type": "function"
  753. },
  754. {
  755. "inputs": [
  756. {
  757. "internalType": "bytes[]",
  758. "name": "updateData",
  759. "type": "bytes[]"
  760. },
  761. {
  762. "internalType": "bytes32[]",
  763. "name": "priceIds",
  764. "type": "bytes32[]"
  765. },
  766. {
  767. "internalType": "uint64[]",
  768. "name": "publishTimes",
  769. "type": "uint64[]"
  770. }
  771. ],
  772. "name": "updatePriceFeedsIfNecessary",
  773. "outputs": [],
  774. "stateMutability": "payable",
  775. "type": "function"
  776. }
  777. ]