@arkade-os/sdk 0.3.0-alpha.1 → 0.3.0-alpha.4

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.
@@ -98,10 +98,8 @@ export class Wallet {
98
98
  // Save tapscripts
99
99
  const offchainTapscript = bareVtxoTapscript;
100
100
  // the serverUnrollScript is the one used to create output scripts of the checkpoint transactions
101
- const serverUnrollScript = CSVMultisigTapscript.encode({
102
- timelock: exitTimelock,
103
- pubkeys: [serverPubKey],
104
- });
101
+ const rawCheckpointExitClosure = hex.decode(info.checkpointExitClosure);
102
+ const serverUnrollScript = CSVMultisigTapscript.decode(rawCheckpointExitClosure);
105
103
  // parse the server forfeit address
106
104
  // server is expecting funds to be sent to this address
107
105
  const forfeitAddress = Address(network).decode(info.forfeitAddress);
@@ -167,8 +165,9 @@ export class Wallet {
167
165
  }
168
166
  async getVtxos(filter) {
169
167
  const address = await this.getAddress();
170
- // Try to get from cache first
171
- const cachedVtxos = await this.walletRepository.getVtxos(address);
168
+ // Try to get from cache first first (optional fast path)
169
+ // const cachedVtxos = await this.walletRepository.getVtxos(address);
170
+ // if (cachedVtxos.length) return cachedVtxos;
172
171
  // For now, always fetch fresh data from provider and update cache
173
172
  // In future, we can add cache invalidation logic based on timestamps
174
173
  const spendableVtxos = await this.getVirtualCoins(filter);
@@ -1,9 +1,10 @@
1
1
  import { Transaction } from "@scure/btc-signer/transaction.js";
2
2
  import { SignerSession } from "../tree/signingSession";
3
3
  export interface Identity {
4
- sign(tx: Transaction, inputIndexes?: number[]): Promise<Transaction>;
5
- xOnlyPublicKey(): Promise<Uint8Array>;
6
4
  signerSession(): SignerSession;
5
+ xOnlyPublicKey(): Promise<Uint8Array>;
6
+ compressedPublicKey(): Promise<Uint8Array>;
7
7
  signMessage(message: string): Promise<Uint8Array>;
8
+ sign(tx: Transaction, inputIndexes?: number[]): Promise<Transaction>;
8
9
  }
9
10
  export * from "./singleKey";
@@ -32,6 +32,7 @@ export declare class SingleKey implements Identity {
32
32
  */
33
33
  toHex(): string;
34
34
  sign(tx: Transaction, inputIndexes?: number[]): Promise<Transaction>;
35
+ compressedPublicKey(): Promise<Uint8Array>;
35
36
  xOnlyPublicKey(): Promise<Uint8Array>;
36
37
  signerSession(): SignerSession;
37
38
  signMessage(message: string): Promise<Uint8Array>;
@@ -84,6 +84,7 @@ export interface ArkInfo {
84
84
  vtxoMinAmount: bigint;
85
85
  vtxoMaxAmount: bigint;
86
86
  boardingExitDelay: bigint;
87
+ checkpointExitClosure: string;
87
88
  }
88
89
  export interface Intent {
89
90
  signature: string;
@@ -0,0 +1 @@
1
+ export declare function eventSourceIterator(eventSource: EventSource): AsyncGenerator<MessageEvent, void, unknown>;
@@ -13,7 +13,7 @@ export type TxTreeNode = {
13
13
  * TxTree is a graph of bitcoin transactions.
14
14
  * It is used to represent batch tree created during settlement session
15
15
  */
16
- export declare class TxTree implements Iterable<TxTree> {
16
+ export declare class TxTree {
17
17
  readonly root: Transaction;
18
18
  readonly children: Map<number, TxTree>;
19
19
  constructor(root: Transaction, children?: Map<number, TxTree>);
@@ -24,5 +24,5 @@ export declare class TxTree implements Iterable<TxTree> {
24
24
  get txid(): string;
25
25
  find(txid: string): TxTree | null;
26
26
  update(txid: string, fn: (tx: Transaction) => void): void;
27
- [Symbol.iterator](): IterableIterator<TxTree>;
27
+ iterator(): Generator<TxTree, void, unknown>;
28
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkade-os/sdk",
3
- "version": "0.3.0-alpha.1",
3
+ "version": "0.3.0-alpha.4",
4
4
  "description": "Bitcoin wallet SDK with Taproot and Ark integration",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",
@@ -58,6 +58,7 @@
58
58
  "@types/node": "24.3.1",
59
59
  "@vitest/coverage-v8": "3.2.4",
60
60
  "esbuild": "^0.25.9",
61
+ "eventsource": "4.0.0",
61
62
  "glob": "11.0.3",
62
63
  "husky": "9.1.7",
63
64
  "prettier": "3.6.2",