Skip to content

Commit

Permalink
Update sandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
ryangoree committed Nov 8, 2024
1 parent a26ede8 commit c756ceb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
3 changes: 1 addition & 2 deletions apps/sdk-sandbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
"@delvtech/drift-viem": "^0.0.1-beta.13",
"@delvtech/fixed-point-wasm": "*",
"@delvtech/hyperdrive-appconfig": "*",
"@delvtech/hyperdrive-viem": "*",
"@delvtech/hyperdrive-js-core": "*",
"@delvtech/hyperdrive-js": "*",
"@delvtech/hyperdrive-wasm": "*",
"viem": "^2.9.2"
},
Expand Down
19 changes: 9 additions & 10 deletions apps/sdk-sandbox/scripts/example.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import { IHyperdrive } from "@delvtech/hyperdrive-artifacts/IHyperdrive";
import { ReadHyperdrive } from "@delvtech/hyperdrive-viem";
import { Drift } from "@delvtech/drift";
import { viemAdapter } from "@delvtech/drift-viem";
import { ReadHyperdrive } from "@delvtech/hyperdrive-js";
import { publicClient } from "../client";

const drift = new Drift(viemAdapter({ publicClient }));

const pool = new ReadHyperdrive({
address: "0x1cB0E96C07910fee9a22607bb9228c73848903a3",
publicClient,
address: "0x324395D5d835F84a02A75Aa26814f6fD22F25698",
drift,
});

const kind = await pool.getKind();
const name = await publicClient.readContract({
abi: IHyperdrive.abi,
address: "0x1cB0E96C07910fee9a22607bb9228c73848903a3",
functionName: "name",
});
const config = await pool.getPoolConfig();

console.log(`
address: ${pool.address}
kind: ${kind}
name: ${name}
baseToken: ${config.baseToken}
sharesToken: ${config.vaultSharesToken}
`);

0 comments on commit c756ceb

Please sign in to comment.