From 5e3bfba5eb3d54cc03551f98624a2e92dca5825f Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 3 Feb 2026 09:15:39 -0800 Subject: custodial ark payments --- inspect-ark.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 inspect-ark.ts (limited to 'inspect-ark.ts') 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); -- cgit v1.2.3