Skip to content

Commit

Permalink
add read-only function
Browse files Browse the repository at this point in the history
  • Loading branch information
vedhavyas committed Oct 9, 2024
1 parent 6d43fd4 commit a48d1cf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions contracts/pyth-store-v1.clar
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
(let ((entry (unwrap! (map-get? prices price-identifier) (err u404))))
(ok entry)))

(define-read-only (get-price (price-identifier (buff 32)))
(let ((entry (unwrap! (map-get? prices price-identifier) (err u404))))
(ok entry)))

(define-public (write (batch-updates (list 64 {
price-identifier: (buff 32),
price: int,
Expand Down

0 comments on commit a48d1cf

Please sign in to comment.