This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# curl -X POST https://rpc.berachain.com -H "Content-Type: application/json" -d '{ | |
# "jsonrpc": "2.0", | |
# "id": 1, | |
# "method": "eth_call", | |
# "params": [ | |
# { | |
# "to": "<ADDRESS_OF_SMART_CONTRACT>", | |
# "data": "<HEX_ENCODED_CALL_DATA>" | |
# }, | |
# "latest" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useState, useEffect } from 'react'; | |
const usePolling = (url, interval = 5000) => { | |
const [data, setData] = useState(null); | |
const [isFetching, setIsFetching] = useState(true); | |
useEffect(() => { | |
let isMounted = true; | |
let timerId; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use borsh::{BorshSerialize, BorshDeserialize}; | |
use solana_program::{ | |
account_info::{next_account_info, AccountInfo}, | |
entrypoint, | |
msg, | |
entrypoint::ProgramResult, | |
program_error::ProgramError, | |
pubkey::Pubkey, | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use borsh::{BorshSerialize, BorshDeserialize}; | |
use solana_program::{ | |
account_info::{next_account_info, AccountInfo}, | |
entrypoint, | |
msg, | |
entrypoint::ProgramResult, | |
program_error::ProgramError, | |
pubkey::Pubkey, | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const app = express(); | |
const port = 3000; | |
app.get('/v1/health', (req, res) => { | |
res.send('Hello, Clockwise software!'); | |
}); | |
app.listen(port, () => { | |
console.log(`Server running on http://localhost:${port}`); |