diff options
| author | Adam Soltys <[email protected]> | 2026-02-03 09:15:39 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-02-06 08:58:12 -0800 |
| commit | 5e3bfba5eb3d54cc03551f98624a2e92dca5825f (patch) | |
| tree | 723e0be4e4f0a987fa2375fcf0360022f1232eaa /inspect-ark.ts | |
| parent | 4850177f50b7ff5a0f37acaa92190219d6f72da5 (diff) | |
| download | coinos-server-5e3bfba5eb3d54cc03551f98624a2e92dca5825f.tar.gz coinos-server-5e3bfba5eb3d54cc03551f98624a2e92dca5825f.zip | |
custodial ark payments
Diffstat (limited to 'inspect-ark.ts')
| -rw-r--r-- | inspect-ark.ts | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/inspect-ark.ts b/inspect-ark.ts new file mode 100644 index 00000000..8c1a551b --- /dev/null +++ b/inspect-ark.ts @@ -0,0 +1,23 @@ +import { EventSource } from "eventsource"; +if (!globalThis.EventSource) globalThis.EventSource = EventSource; +import { SingleKey, Wallet } from "@arkade-os/sdk"; + +const key = "0ebe9a690651e9e08d7c2f4db106d8ec264725241fdb34c57aedb26155b0e027"; +const identity = SingleKey.fromHex(key); +const wallet = await Wallet.create({ identity, arkServerUrl: "http://localhost:7070" }); + +const balance = await wallet.getBalance(); +console.log("Balance:", JSON.stringify(balance)); + +console.log("Settling..."); +try { + const txid = await wallet.settle(); + console.log("Settle txid:", txid); + + const balanceAfter = await wallet.getBalance(); + console.log("Balance after:", JSON.stringify(balanceAfter)); +} catch(e: any) { + console.error("Error:", e.message); +} + +process.exit(0); |
