https://github.com/hirosystems/clarinet-pyth-example
Example of a pyth project relying on Pyth data
https://github.com/hirosystems/clarinet-pyth-example
Last synced: 12 months ago
JSON representation
Example of a pyth project relying on Pyth data
- Host: GitHub
- URL: https://github.com/hirosystems/clarinet-pyth-example
- Owner: hirosystems
- License: apache-2.0
- Created: 2025-01-28T16:47:31.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-12T15:29:50.000Z (about 1 year ago)
- Last Synced: 2025-06-26T11:56:52.370Z (about 1 year ago)
- Language: Clarity
- Homepage:
- Size: 255 KB
- Stars: 0
- Watchers: 16
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Clarinet Transaction Simulation Demo
See it in action:
```sh
$ npm i
$ npm t
```
## Details
This project currently uses clarinet-sdk latest beta
(`"@hirosystems/clarinet-sdk": "^2.13.0-beta15"` or above).
### Enable remote data fetching
Remote data fetching is enabled with the following setting.
The Simnet will fork mainnet from block 522000.
> [!IMPORTANT]
> This is still in beta and could change in the near future.
```toml
# clarinet.toml
[repl.remote_data]
enabled = true
api_url = "https://api.hiro.so"
initial_height = 522000
```
### Usage
See usage examples in the test file.
Nothing really changes in the way we interact with contract,
except that it will use data from mainnet.
```ts
const { result } = simnet.callReadOnlyFn(
"SP3R4F6C1J3JQWWCVZ3S7FRRYPMYG6ZW6RZK31FXY.pyth-storage-v3",
"get-price",
[btcFeed],
address1,
);
```