@arkade-os/skill 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +116 -0
  2. package/SKILL.md +269 -0
  3. package/cli/arkade.mjs +1018 -0
  4. package/dist/cjs/index.js +88 -0
  5. package/dist/cjs/index.js.map +1 -0
  6. package/dist/cjs/skills/arkadeBitcoin.js +359 -0
  7. package/dist/cjs/skills/arkadeBitcoin.js.map +1 -0
  8. package/dist/cjs/skills/index.js +78 -0
  9. package/dist/cjs/skills/index.js.map +1 -0
  10. package/dist/cjs/skills/lendaswap.js +458 -0
  11. package/dist/cjs/skills/lendaswap.js.map +1 -0
  12. package/dist/cjs/skills/lightning.js +287 -0
  13. package/dist/cjs/skills/lightning.js.map +1 -0
  14. package/dist/cjs/skills/types.js +11 -0
  15. package/dist/cjs/skills/types.js.map +1 -0
  16. package/dist/esm/index.js +72 -0
  17. package/dist/esm/index.js.map +1 -0
  18. package/dist/esm/skills/arkadeBitcoin.js +354 -0
  19. package/dist/esm/skills/arkadeBitcoin.js.map +1 -0
  20. package/dist/esm/skills/index.js +69 -0
  21. package/dist/esm/skills/index.js.map +1 -0
  22. package/dist/esm/skills/lendaswap.js +453 -0
  23. package/dist/esm/skills/lendaswap.js.map +1 -0
  24. package/dist/esm/skills/lightning.js +282 -0
  25. package/dist/esm/skills/lightning.js.map +1 -0
  26. package/dist/esm/skills/types.js +10 -0
  27. package/dist/esm/skills/types.js.map +1 -0
  28. package/dist/types/index.d.ts +72 -0
  29. package/dist/types/index.d.ts.map +1 -0
  30. package/dist/types/skills/arkadeBitcoin.d.ts +218 -0
  31. package/dist/types/skills/arkadeBitcoin.d.ts.map +1 -0
  32. package/dist/types/skills/index.d.ts +67 -0
  33. package/dist/types/skills/index.d.ts.map +1 -0
  34. package/dist/types/skills/lendaswap.d.ts +152 -0
  35. package/dist/types/skills/lendaswap.d.ts.map +1 -0
  36. package/dist/types/skills/lightning.d.ts +181 -0
  37. package/dist/types/skills/lightning.d.ts.map +1 -0
  38. package/dist/types/skills/types.d.ts +548 -0
  39. package/dist/types/skills/types.d.ts.map +1 -0
  40. package/package.json +65 -0
@@ -0,0 +1,354 @@
1
+ /**
2
+ * ArkadeBitcoinSkill - Send and receive Bitcoin over Arkade protocol.
3
+ *
4
+ * This skill provides a unified interface for Bitcoin operations
5
+ * designed for agent integration (CLI-friendly for agents like MoltBot).
6
+ *
7
+ * @module skills/arkadeBitcoin
8
+ */
9
+ import { Ramps, } from "@arkade-os/sdk";
10
+ /**
11
+ * ArkadeBitcoinSkill provides a unified interface for sending and receiving
12
+ * Bitcoin over the Arkade protocol.
13
+ *
14
+ * This skill wraps the core wallet functionality and provides:
15
+ * - Offchain Bitcoin transactions via Ark
16
+ * - Get paid onchain via boarding address + onboard
17
+ * - Pay onchain via offboard to any Bitcoin address
18
+ * - Balance management
19
+ * - Transaction history
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * import { Wallet, SingleKey } from "@arkade-os/sdk";
24
+ * import { ArkadeBitcoinSkill } from "@arkade-os/skill";
25
+ *
26
+ * // Create a wallet
27
+ * const wallet = await Wallet.create({
28
+ * identity: SingleKey.fromHex(privateKeyHex),
29
+ * arkServerUrl: "https://arkade.computer",
30
+ * });
31
+ *
32
+ * // Create the skill
33
+ * const bitcoinSkill = new ArkadeBitcoinSkill(wallet);
34
+ *
35
+ * // Get addresses for receiving
36
+ * const addresses = await bitcoinSkill.getReceiveAddresses();
37
+ * console.log("Ark Address:", addresses[0].address);
38
+ *
39
+ * // Check balance
40
+ * const balance = await bitcoinSkill.getBalance();
41
+ * console.log("Available:", balance.offchain.available, "sats");
42
+ *
43
+ * // Send Bitcoin offchain
44
+ * const result = await bitcoinSkill.send({
45
+ * address: recipientArkAddress,
46
+ * amount: 10000, // 10,000 sats
47
+ * });
48
+ * console.log("Sent! Txid:", result.txid);
49
+ * ```
50
+ */
51
+ export class ArkadeBitcoinSkill {
52
+ /**
53
+ * Creates a new ArkadeBitcoinSkill instance.
54
+ *
55
+ * @param wallet - The Arkade wallet to use for operations.
56
+ * Must be a full wallet (not readonly) for send/settle operations.
57
+ */
58
+ constructor(wallet) {
59
+ this.wallet = wallet;
60
+ this.name = "arkade-bitcoin";
61
+ this.description = "Send and receive Bitcoin over Arkade offchain, get paid onchain (onboard), pay onchain (offboard)";
62
+ this.version = "1.0.0";
63
+ this.ramps = new Ramps(wallet);
64
+ }
65
+ /**
66
+ * Get all available addresses for receiving Bitcoin.
67
+ *
68
+ * Returns both the Ark address (for offchain receipts) and the
69
+ * boarding address (for onchain deposits that can be onboarded).
70
+ *
71
+ * @returns Array of addresses with their types and descriptions
72
+ */
73
+ async getReceiveAddresses() {
74
+ const [arkAddress, boardingAddress] = await Promise.all([
75
+ this.wallet.getAddress(),
76
+ this.wallet.getBoardingAddress(),
77
+ ]);
78
+ return [
79
+ {
80
+ address: arkAddress,
81
+ type: "ark",
82
+ description: "Ark address for receiving offchain Bitcoin instantly",
83
+ },
84
+ {
85
+ address: boardingAddress,
86
+ type: "boarding",
87
+ description: "Boarding address for receiving onchain Bitcoin (requires onboarding)",
88
+ },
89
+ ];
90
+ }
91
+ /**
92
+ * Get the Ark address for receiving offchain Bitcoin.
93
+ *
94
+ * This is the primary address for receiving Bitcoin via Arkade.
95
+ * Funds sent to this address are immediately available offchain.
96
+ *
97
+ * @returns The bech32m-encoded Ark address
98
+ */
99
+ async getArkAddress() {
100
+ return this.wallet.getAddress();
101
+ }
102
+ /**
103
+ * Get the boarding address for receiving onchain Bitcoin.
104
+ *
105
+ * Funds sent to this address appear as boarding UTXOs and must be
106
+ * onboarded to become offchain VTXOs before they can be spent.
107
+ *
108
+ * @returns The Bitcoin boarding address
109
+ */
110
+ async getBoardingAddress() {
111
+ return this.wallet.getBoardingAddress();
112
+ }
113
+ /**
114
+ * Get the current balance with detailed breakdown.
115
+ *
116
+ * @returns Balance information including offchain and onchain amounts
117
+ */
118
+ async getBalance() {
119
+ const walletBalance = await this.wallet.getBalance();
120
+ return {
121
+ total: walletBalance.total,
122
+ offchain: {
123
+ settled: walletBalance.settled,
124
+ preconfirmed: walletBalance.preconfirmed,
125
+ available: walletBalance.available,
126
+ recoverable: walletBalance.recoverable,
127
+ },
128
+ onchain: {
129
+ confirmed: walletBalance.boarding.confirmed,
130
+ unconfirmed: walletBalance.boarding.unconfirmed,
131
+ total: walletBalance.boarding.total,
132
+ },
133
+ };
134
+ }
135
+ /**
136
+ * Send Bitcoin to an address.
137
+ *
138
+ * For Ark addresses, this creates an offchain transaction that is
139
+ * instantly confirmed. The recipient must also be using an Ark-compatible
140
+ * wallet connected to the same Ark server.
141
+ *
142
+ * @param params - Send parameters including address and amount
143
+ * @returns Result containing the transaction ID and details
144
+ * @throws Error if the address is invalid or insufficient balance
145
+ */
146
+ async send(params) {
147
+ const txid = await this.wallet.sendBitcoin({
148
+ address: params.address,
149
+ amount: params.amount,
150
+ feeRate: params.feeRate,
151
+ memo: params.memo,
152
+ });
153
+ return {
154
+ txid,
155
+ type: "ark",
156
+ amount: params.amount,
157
+ };
158
+ }
159
+ /**
160
+ * Get the transaction history.
161
+ *
162
+ * @returns Array of transactions with type, amount, and status
163
+ */
164
+ async getTransactionHistory() {
165
+ return this.wallet.getTransactionHistory();
166
+ }
167
+ /**
168
+ * Wait for incoming funds.
169
+ *
170
+ * This method blocks until either:
171
+ * - New VTXOs are received (offchain)
172
+ * - New UTXOs are received at the boarding address (onchain)
173
+ * - The timeout expires
174
+ *
175
+ * @param timeoutMs - Optional timeout in milliseconds (default: no timeout)
176
+ * @returns Information about the received funds
177
+ * @throws Error if timeout expires without receiving funds
178
+ */
179
+ async waitForIncomingFunds(timeoutMs) {
180
+ let stopSubscription;
181
+ let timeoutId;
182
+ let settled = false;
183
+ const fundsPromise = new Promise((resolve, reject) => {
184
+ this.wallet
185
+ .notifyIncomingFunds((funds) => {
186
+ if (settled) {
187
+ return;
188
+ }
189
+ settled = true;
190
+ resolve(funds);
191
+ })
192
+ .then((stop) => {
193
+ stopSubscription = stop;
194
+ if (settled) {
195
+ stop();
196
+ }
197
+ })
198
+ .catch((error) => {
199
+ if (settled) {
200
+ return;
201
+ }
202
+ settled = true;
203
+ reject(error);
204
+ });
205
+ if (timeoutMs !== undefined) {
206
+ timeoutId = setTimeout(() => {
207
+ if (settled) {
208
+ return;
209
+ }
210
+ settled = true;
211
+ reject(new Error("Timeout waiting for incoming funds"));
212
+ }, timeoutMs);
213
+ }
214
+ });
215
+ let result;
216
+ try {
217
+ result = await fundsPromise;
218
+ }
219
+ finally {
220
+ if (timeoutId) {
221
+ clearTimeout(timeoutId);
222
+ }
223
+ if (stopSubscription) {
224
+ stopSubscription();
225
+ }
226
+ }
227
+ if (result.type === "utxo") {
228
+ return {
229
+ type: "utxo",
230
+ amount: result.coins.reduce((sum, coin) => sum + coin.value, 0),
231
+ ids: result.coins.map((coin) => `${coin.txid}:${coin.vout}`),
232
+ };
233
+ }
234
+ else {
235
+ return {
236
+ type: "vtxo",
237
+ amount: result.newVtxos.reduce((sum, vtxo) => sum + vtxo.value, 0),
238
+ ids: result.newVtxos.map((vtxo) => `${vtxo.txid}:${vtxo.vout}`),
239
+ };
240
+ }
241
+ }
242
+ /**
243
+ * Get paid onchain: Convert received onchain BTC to offchain.
244
+ *
245
+ * Use this after receiving onchain Bitcoin to your boarding address.
246
+ * This converts boarding UTXOs into VTXOs through a cooperative
247
+ * settlement with the Ark server. After onboarding, funds are
248
+ * available for instant offchain transactions.
249
+ *
250
+ * Flow: Someone pays you onchain → funds arrive at boarding address → onboard → funds available offchain
251
+ *
252
+ * @param params - Onboard parameters
253
+ * @returns Result containing the commitment transaction ID
254
+ * @throws Error if no boarding UTXOs are available or fees exceed value
255
+ *
256
+ * @example
257
+ * ```typescript
258
+ * // Step 1: Give your boarding address to receive onchain payment
259
+ * const boardingAddress = await bitcoinSkill.getBoardingAddress();
260
+ *
261
+ * // Step 2: After receiving payment, onboard the funds
262
+ * const arkInfo = await arkProvider.getInfo();
263
+ * const result = await bitcoinSkill.onboard({
264
+ * feeInfo: arkInfo.feeInfo,
265
+ * eventCallback: (event) => console.log("Settlement event:", event.type),
266
+ * });
267
+ * console.log("Onboarded! Commitment:", result.commitmentTxid);
268
+ * ```
269
+ */
270
+ async onboard(params) {
271
+ const boardingUtxos = await this.wallet.getBoardingUtxos();
272
+ const totalBefore = boardingUtxos.reduce((sum, utxo) => sum + BigInt(utxo.value), 0n);
273
+ const commitmentTxid = await this.ramps.onboard(params.feeInfo, undefined, params.amount, params.eventCallback);
274
+ const amount = params.amount ?? totalBefore;
275
+ return {
276
+ commitmentTxid,
277
+ amount,
278
+ };
279
+ }
280
+ /**
281
+ * Pay onchain: Send offchain BTC to any onchain Bitcoin address.
282
+ *
283
+ * Use this to pay someone who needs onchain Bitcoin. This performs a
284
+ * collaborative exit, converting your VTXOs back to regular onchain
285
+ * Bitcoin UTXOs at the recipient's destination address.
286
+ *
287
+ * Flow: You have offchain funds → offboard to recipient's onchain address → they receive onchain BTC
288
+ *
289
+ * @param params - Offboard parameters including destination address
290
+ * @returns Result containing the commitment transaction ID
291
+ * @throws Error if no VTXOs are available or fees exceed value
292
+ *
293
+ * @example
294
+ * ```typescript
295
+ * // Pay someone at an onchain Bitcoin address
296
+ * const arkInfo = await arkProvider.getInfo();
297
+ * const result = await bitcoinSkill.offboard({
298
+ * destinationAddress: "bc1q...", // recipient's onchain address
299
+ * feeInfo: arkInfo.feeInfo,
300
+ * eventCallback: (event) => console.log("Settlement event:", event.type),
301
+ * });
302
+ * console.log("Paid onchain! Commitment:", result.commitmentTxid);
303
+ * ```
304
+ */
305
+ async offboard(params) {
306
+ const vtxos = await this.wallet.getVtxos({ withRecoverable: true });
307
+ const totalBefore = vtxos.reduce((sum, vtxo) => sum + BigInt(vtxo.value), 0n);
308
+ const commitmentTxid = await this.ramps.offboard(params.destinationAddress, params.feeInfo, params.amount, params.eventCallback);
309
+ const amount = params.amount ?? totalBefore;
310
+ return {
311
+ commitmentTxid,
312
+ amount,
313
+ };
314
+ }
315
+ /**
316
+ * Get the underlying wallet instance.
317
+ *
318
+ * Use this for advanced operations not covered by the skill interface.
319
+ *
320
+ * @returns The wallet instance
321
+ */
322
+ getWallet() {
323
+ return this.wallet;
324
+ }
325
+ /**
326
+ * Get detailed information about available VTXOs.
327
+ *
328
+ * @param filter - Optional filter for VTXO types to include
329
+ * @returns Array of extended virtual coins with full details
330
+ */
331
+ async getVtxos(filter) {
332
+ return this.wallet.getVtxos(filter);
333
+ }
334
+ /**
335
+ * Get detailed information about boarding UTXOs.
336
+ *
337
+ * @returns Array of extended coins with full details
338
+ */
339
+ async getBoardingUtxos() {
340
+ return this.wallet.getBoardingUtxos();
341
+ }
342
+ }
343
+ /**
344
+ * Create an ArkadeBitcoinSkill from a wallet.
345
+ *
346
+ * This is a convenience function for creating the skill.
347
+ *
348
+ * @param wallet - The Arkade wallet to use
349
+ * @returns A new ArkadeBitcoinSkill instance
350
+ */
351
+ export function createArkadeBitcoinSkill(wallet) {
352
+ return new ArkadeBitcoinSkill(wallet);
353
+ }
354
+ //# sourceMappingURL=arkadeBitcoin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arkadeBitcoin.js","sourceRoot":"","sources":["../../../src/skills/arkadeBitcoin.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAEL,KAAK,GAKN,MAAM,gBAAgB,CAAC;AAcxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,OAAO,kBAAkB;IAQ7B;;;;;OAKG;IACH,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QAblC,SAAI,GAAG,gBAAgB,CAAC;QACxB,gBAAW,GAClB,mGAAmG,CAAC;QAC7F,YAAO,GAAG,OAAO,CAAC;QAWzB,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,m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AAG,MAAM,CAAC,MAAM,IAAI,WAAW,CAAC;QAE5C,OAAO;YACL,cAAc;YACd,MAAM;SACP,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,QAAQ,CAAC,MAGd;QACC,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,gBAAgB;QACpB,OAAO,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC;IACxC,CAAC;CACF;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,wBAAwB,CAAC,MAAc;IACrD,OAAO,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC;AACxC,CAAC"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Skills module for the Arkade SDK.
3
+ *
4
+ * Skills are modular capabilities that provide specific functionality for agents
5
+ * and applications. This module provides skills for:
6
+ *
7
+ * - **ArkadeBitcoinSkill**: Send and receive Bitcoin over Arkade
8
+ * - **ArkaLightningSkill**: Lightning Network payments via Boltz swaps
9
+ * - **LendaSwapSkill**: USDC/USDT stablecoin swaps via LendaSwap
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * import { Wallet, SingleKey } from "@arkade-os/sdk";
14
+ * import {
15
+ * ArkadeBitcoinSkill,
16
+ * ArkaLightningSkill,
17
+ * LendaSwapSkill,
18
+ * } from "@arkade-os/skill";
19
+ *
20
+ * // Create a wallet
21
+ * const wallet = await Wallet.create({
22
+ * identity: SingleKey.fromHex(privateKeyHex),
23
+ * arkServerUrl: "https://arkade.computer",
24
+ * });
25
+ *
26
+ * // === Bitcoin Skill ===
27
+ * const bitcoin = new ArkadeBitcoinSkill(wallet);
28
+ *
29
+ * // Get addresses for receiving
30
+ * const arkAddress = await bitcoin.getArkAddress();
31
+ * console.log("Ark address:", arkAddress);
32
+ *
33
+ * // Check balance
34
+ * const balance = await bitcoin.getBalance();
35
+ * console.log("Balance:", balance.total, "sats");
36
+ *
37
+ * // === Lightning Skill ===
38
+ * const lightning = new ArkaLightningSkill({
39
+ * wallet,
40
+ * network: "bitcoin",
41
+ * });
42
+ *
43
+ * // Create invoice to receive Lightning payment
44
+ * const invoice = await lightning.createInvoice({
45
+ * amount: 25000,
46
+ * description: "Coffee payment",
47
+ * });
48
+ * console.log("Invoice:", invoice.bolt11);
49
+ *
50
+ * // === LendaSwap Skill ===
51
+ * const lendaswap = new LendaSwapSkill({
52
+ * wallet,
53
+ * apiKey: process.env.LENDASWAP_API_KEY,
54
+ * });
55
+ *
56
+ * // Get quote for BTC to USDC
57
+ * const quote = await lendaswap.getQuoteBtcToStablecoin(100000, "usdc_pol");
58
+ * console.log("Quote:", quote.targetAmount, "USDC");
59
+ * ```
60
+ *
61
+ * @module skills
62
+ */
63
+ // Bitcoin skill
64
+ export { ArkadeBitcoinSkill, createArkadeBitcoinSkill } from "./arkadeBitcoin";
65
+ // Lightning skill
66
+ export { ArkaLightningSkill, createLightningSkill, } from "./lightning";
67
+ // LendaSwap skill
68
+ export { LendaSwapSkill, createLendaSwapSkill, } from "./lendaswap";
69
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/skills/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAqCH,gBAAgB;AAChB,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAE/E,kBAAkB;AAClB,OAAO,EACL,kBAAkB,EAClB,oBAAoB,GAErB,MAAM,aAAa,CAAC;AAErB,kBAAkB;AAClB,OAAO,EACL,cAAc,EACd,oBAAoB,GAErB,MAAM,aAAa,CAAC"}