A simple library to call oracle methods from SEP-0040.
# Node
npx jsr add @creit-tech/stellar-sep-0040
# Deno
deno add jsr:@creit-tech/stellar-sep-0040You can check more installation options in the JSR package.
import { Oracle } from "@creit-tech/stellar-sep-0040";
const oracle: Oracle = new Oracle({ oracleId: "CAFJZQWSED6YAWZU3GWRTOCNPPCGBN32L7QV43XX5LZLFTK6JLN34DLN" });
const [price, timestamp] = await oracle.lastPrice({ asset: [AssetType.Other, "BTC"] });
console.log(`BTC price: ${price}`);Licensed under the MIT License, Copyright © 2025-present Creit Tech.
Check out the LICENSE.md file for more details.