-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
85 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { tickers } from '@utils/pyth/config' | ||
import { hermes } from '@utils/pyth/hermes' | ||
|
||
const response = await fetch(hermes.sse([tickers.ETH, tickers.BTC])) | ||
|
||
if (!response.body) throw new Error('No reader') | ||
|
||
const reader = response.body.getReader() | ||
const decoder = new TextDecoder() | ||
while (true) { | ||
const { done, value } = await reader.read() | ||
if (done) break | ||
console.log(decoder.decode(value)) | ||
} | ||
|
||
// import { keccak256 } from 'viem' | ||
// const hasher = new Bun.CryptoHasher('shake256') | ||
|
||
// const testValue = '0x1337' | ||
// const resultBun = hasher.update(testValue, 'hex').digest('hex') | ||
// const resultViem = keccak256(testValue) | ||
|
||
// console.log('Bun:', resultBun) | ||
// console.log('Viem:', resultViem) |
This file contains 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
This file contains 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