aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/ark-send.ts
blob: d8230eda18ff6fdaff393053421d80f9a2e679f7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { sendArk } from "../lib/ark.js";

const address = process.argv[2];
const amount = parseInt(process.argv[3]);

if (!address || !amount) {
  console.log("Usage: bun scripts/ark-send.ts <ark_address> <amount_sats>");
  process.exit(1);
}

console.log(`Sending ${amount} sats to ${address}...`);

sendArk(address, amount)
  .then((result) => {
    console.log("Success!");
    console.log("Result:", JSON.stringify(result, null, 2));
  })
  .catch((e) => {
    console.error("Error:", e.message);
    process.exit(1);
  });