Skip to content

Commit

Permalink
fix example file (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
h2physics authored Jul 4, 2024
1 parent 8fe2831 commit 4b8d46b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions examples/example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ import {
calculateZapIn,
Dex,
NetworkId,
PoolDatum,
PoolState,
PoolV1,
} from "../src";

async function main(): Promise<void> {
Expand All @@ -41,6 +40,7 @@ async function main(): Promise<void> {
);

const blockfrostAdapter = new BlockfrostAdapter({
networkId: NetworkId.TESTNET,
blockFrost: new BlockFrostAPI({
projectId: blockfrostProjectId,
network: "preprod",
Expand Down Expand Up @@ -68,8 +68,8 @@ async function getPoolById(
network: Network,
blockfrostAdapter: BlockfrostAdapter,
poolId: string
): Promise<{ poolState: PoolState; poolDatum: PoolDatum }> {
const pool = await blockfrostAdapter.getPoolById({
): Promise<{ poolState: PoolV1.State; poolDatum: PoolV1.Datum }> {
const pool = await blockfrostAdapter.getV1PoolById({
id: poolId,
});
if (!pool) {
Expand All @@ -79,7 +79,7 @@ async function getPoolById(
const rawRoolDatum = await blockfrostAdapter.getDatumByDatumHash(
pool.datumHash
);
const poolDatum = PoolDatum.fromPlutusData(
const poolDatum = PoolV1.Datum.fromPlutusData(
network === "Mainnet" ? NetworkId.MAINNET : NetworkId.TESTNET,
Data.from(rawRoolDatum) as Constr<Data>
);
Expand Down

0 comments on commit 4b8d46b

Please sign in to comment.