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
// npm install --save @bandprotocol/bandchain.js | |
import BandChain from '@bandprotocol/bandchain.js' | |
// Chain parameters | |
const endpoint = 'https://guanyu-devnet.bandchain.org/rest' | |
// Request parameters | |
const oracleScriptId = 13 | |
const params = { | |
"base_symbol": "BAND", | |
"quote_symbol": "USD", | |
"aggregation_method": "median", |
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
// Chain parameters | |
const endpoint = 'https://guanyu-devnet.bandchain.org/rest' | |
// Request parameters | |
const oracleScriptId = 13 | |
const params = { | |
"base_symbol": "BAND", | |
"quote_symbol": "USD", | |
"aggregation_method": "median", | |
"multiplier": 1000000 | |
} |
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
async function getLatestRequestResult() { | |
const bandchain = new BandChain(endpoint) | |
const oracleScript = await bandchain.getOracleScript(oracleScriptId) | |
const { result, resolve_time } = await bandchain.getLastMatchingRequestResult( | |
oracleScript, | |
params, | |
validatorCounts, | |
) | |
return { | |
result: parseFloat(result.px) / params.multiplier, |
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
#!/usr/bin/env bash | |
# Install Git Large File Storage (LFS) | |
brew install git-lfs | |
git lfs install | |
# Download & Install Llama | |
git clone https://github.com/ggerganov/llama.cpp | |
cd llama.cpp | |
LLAMA_METAL=1 make -j # build with Metal support for (M-series) Apple Silicon |
OlderNewer