@hardkas/localnet 0.8.14-alpha → 0.8.15-alpha
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.
- package/dist/index.d.ts +438 -0
- package/dist/index.js +2 -0
- package/package.json +7 -7
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
import * as _hardkas_artifacts from '@hardkas/artifacts';
|
|
2
|
+
import { HardkasArtifactBase, Snapshot as Snapshot$1, TxPlan, ARTIFACT_SCHEMAS, TxReceipt } from '@hardkas/artifacts';
|
|
3
|
+
import * as _hardkas_simulator from '@hardkas/simulator';
|
|
4
|
+
import { ExecutionMode, NetworkId, RuntimeContext } from '@hardkas/core';
|
|
5
|
+
import { KaspaRpcClient, KaspaNodeInfo, KaspaRpcHealth, KaspaAddressBalance, KaspaRpcUtxo, KaspaSubmitTransactionResult, MempoolEntry, BlockDagInfo, ServerInfo } from '@hardkas/kaspa-rpc';
|
|
6
|
+
|
|
7
|
+
interface HardkasAccount {
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly address: string;
|
|
10
|
+
readonly evmAddress: string;
|
|
11
|
+
readonly balanceSompi: bigint;
|
|
12
|
+
}
|
|
13
|
+
declare function createDeterministicAccounts(input?: {
|
|
14
|
+
readonly count?: number | undefined;
|
|
15
|
+
readonly initialBalanceSompi?: bigint | undefined;
|
|
16
|
+
} | undefined): HardkasAccount[];
|
|
17
|
+
declare function resolveAccountAddress(input: string): string;
|
|
18
|
+
|
|
19
|
+
interface SimulatedUtxo {
|
|
20
|
+
readonly id: string;
|
|
21
|
+
readonly address: string;
|
|
22
|
+
readonly amountSompi: bigint;
|
|
23
|
+
readonly spent: boolean;
|
|
24
|
+
}
|
|
25
|
+
interface Snapshot {
|
|
26
|
+
readonly id: string;
|
|
27
|
+
readonly utxos: readonly SimulatedUtxo[];
|
|
28
|
+
readonly daaScore: bigint;
|
|
29
|
+
}
|
|
30
|
+
declare class SimulatedKaspaChain {
|
|
31
|
+
private utxos;
|
|
32
|
+
private daaScore;
|
|
33
|
+
constructor(accounts: readonly HardkasAccount[]);
|
|
34
|
+
getDaaScore(): bigint;
|
|
35
|
+
mineBlock(): bigint;
|
|
36
|
+
getBalance(address: string): bigint;
|
|
37
|
+
getUtxos(address: string): readonly SimulatedUtxo[];
|
|
38
|
+
fund(address: string, amountSompi: bigint): SimulatedUtxo;
|
|
39
|
+
/**
|
|
40
|
+
* Creates a snapshot of the current chain state.
|
|
41
|
+
* Snapshot IDs use Date.now() and are intended for session-based
|
|
42
|
+
* debugging and restore points, not for canonical identity.
|
|
43
|
+
*/
|
|
44
|
+
snapshot(): Snapshot;
|
|
45
|
+
restore(snapshot: Snapshot): void;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
interface HardkasDevnet {
|
|
49
|
+
readonly mode: "simulated";
|
|
50
|
+
readonly accounts: readonly HardkasAccount[];
|
|
51
|
+
readonly chain: SimulatedKaspaChain;
|
|
52
|
+
stop(): Promise<void>;
|
|
53
|
+
}
|
|
54
|
+
declare function startSimulatedDevnet(input?: {
|
|
55
|
+
readonly accounts?: number | undefined;
|
|
56
|
+
readonly initialBalanceSompi?: bigint | undefined;
|
|
57
|
+
} | undefined): Promise<HardkasDevnet>;
|
|
58
|
+
|
|
59
|
+
interface LocalnetAccount {
|
|
60
|
+
name: string;
|
|
61
|
+
address: string;
|
|
62
|
+
}
|
|
63
|
+
interface LocalnetUtxo {
|
|
64
|
+
id: string;
|
|
65
|
+
address: string;
|
|
66
|
+
amountSompi: string;
|
|
67
|
+
spent: boolean;
|
|
68
|
+
createdAtDaaScore: string;
|
|
69
|
+
spentAtDaaScore?: string;
|
|
70
|
+
}
|
|
71
|
+
interface LocalnetState extends HardkasArtifactBase {
|
|
72
|
+
schema: "hardkas.localnetState.v1";
|
|
73
|
+
hardkasVersion: string;
|
|
74
|
+
version: string;
|
|
75
|
+
createdAt: string;
|
|
76
|
+
mode: ExecutionMode;
|
|
77
|
+
networkId: NetworkId;
|
|
78
|
+
workflowId?: string;
|
|
79
|
+
assumptionLevel?: string;
|
|
80
|
+
daaScore: string;
|
|
81
|
+
accounts: LocalnetAccount[];
|
|
82
|
+
utxos: LocalnetUtxo[];
|
|
83
|
+
snapshots?: Snapshot$1[];
|
|
84
|
+
dag?: SimulatedDag;
|
|
85
|
+
forkSource?: {
|
|
86
|
+
network: string;
|
|
87
|
+
rpcUrl: string;
|
|
88
|
+
daaScore: string;
|
|
89
|
+
forkedAt: string;
|
|
90
|
+
addresses: string[];
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
interface SimulatedBlock {
|
|
94
|
+
id: string;
|
|
95
|
+
parents: string[];
|
|
96
|
+
blueScore: string;
|
|
97
|
+
daaScore: string;
|
|
98
|
+
acceptedTxIds: string[];
|
|
99
|
+
isGenesis?: boolean;
|
|
100
|
+
/** GHOSTDAG blue_work for this block (computed by ApproxGhostdagEngine). */
|
|
101
|
+
blueWork?: string;
|
|
102
|
+
/** True if GHOSTDAG colored this block blue, false if red. */
|
|
103
|
+
isBlue?: boolean;
|
|
104
|
+
/** Full GHOSTDAG data if computed. */
|
|
105
|
+
ghostdagData?: _hardkas_simulator.GhostdagData;
|
|
106
|
+
}
|
|
107
|
+
interface SimulatedDag {
|
|
108
|
+
blocks: Record<string, SimulatedBlock>;
|
|
109
|
+
sink: string;
|
|
110
|
+
selectedPathToSink: string[];
|
|
111
|
+
acceptedTxIds: string[];
|
|
112
|
+
displacedTxIds: string[];
|
|
113
|
+
conflictSet: Array<{
|
|
114
|
+
outpoint: string;
|
|
115
|
+
winnerTxId: string;
|
|
116
|
+
loserTxIds: string[];
|
|
117
|
+
}>;
|
|
118
|
+
/** Internal GHOSTDAG store for this DAG session. */
|
|
119
|
+
ghostdagStore?: _hardkas_simulator.GhostdagStore;
|
|
120
|
+
/** Internal GHOSTDAG engine for this DAG session. */
|
|
121
|
+
ghostdagEngine?: _hardkas_simulator.ApproxGhostdagEngine;
|
|
122
|
+
}
|
|
123
|
+
interface StateTransition {
|
|
124
|
+
preStateHash: string;
|
|
125
|
+
postStateHash: string;
|
|
126
|
+
daaScore: string;
|
|
127
|
+
}
|
|
128
|
+
interface SimulationResult {
|
|
129
|
+
ok: boolean;
|
|
130
|
+
state: LocalnetState;
|
|
131
|
+
receipt: _hardkas_artifacts.TxReceipt;
|
|
132
|
+
planArtifact?: _hardkas_artifacts.TxPlan;
|
|
133
|
+
errors: string[];
|
|
134
|
+
}
|
|
135
|
+
interface ReplayInvariantResult {
|
|
136
|
+
ok: boolean;
|
|
137
|
+
mismatches: string[];
|
|
138
|
+
}
|
|
139
|
+
interface ReplayVerificationReport {
|
|
140
|
+
schema: "hardkas.replayReport.v1";
|
|
141
|
+
txId: string;
|
|
142
|
+
planOk: boolean;
|
|
143
|
+
receiptOk: boolean;
|
|
144
|
+
invariantsOk: boolean;
|
|
145
|
+
/** Honest check status to avoid overclaiming. */
|
|
146
|
+
checks: {
|
|
147
|
+
/** Whether the internal HardKAS workflow (Plan -> Receipt) was reproduced. */
|
|
148
|
+
workflowDeterministic: "reproduced" | "diverged" | "skipped";
|
|
149
|
+
/** HardKAS DOES NOT currently validate full Kaspa consensus (GHOSTDAG, etc). */
|
|
150
|
+
consensusValidation: "unimplemented" | "partial" | "skipped";
|
|
151
|
+
/** HardKAS DOES NOT currently validate L2 bridge logic. */
|
|
152
|
+
l2BridgeCorrectness: "unimplemented" | "partial" | "skipped";
|
|
153
|
+
};
|
|
154
|
+
divergences: Array<{
|
|
155
|
+
path: string;
|
|
156
|
+
expected: any;
|
|
157
|
+
actual: any;
|
|
158
|
+
}>;
|
|
159
|
+
errors: string[];
|
|
160
|
+
}
|
|
161
|
+
interface SnapshotVerificationResult {
|
|
162
|
+
ok: boolean;
|
|
163
|
+
hashes: {
|
|
164
|
+
accountsMatch: boolean;
|
|
165
|
+
utxoSetMatch: boolean;
|
|
166
|
+
stateMatch: boolean;
|
|
167
|
+
contentMatch: boolean;
|
|
168
|
+
};
|
|
169
|
+
errors: string[];
|
|
170
|
+
}
|
|
171
|
+
interface SnapshotRestoreResult {
|
|
172
|
+
ok: boolean;
|
|
173
|
+
previousStateHash?: string;
|
|
174
|
+
newStateHash?: string;
|
|
175
|
+
error?: string;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
interface CreateInitialStateOptions {
|
|
179
|
+
accounts?: number | undefined;
|
|
180
|
+
initialBalanceSompi?: bigint | undefined;
|
|
181
|
+
}
|
|
182
|
+
declare function createInitialLocalnetState(options?: CreateInitialStateOptions): LocalnetState;
|
|
183
|
+
declare function resolveAccountAddressFromState(state: LocalnetState, nameOrAddress: string): string;
|
|
184
|
+
/**
|
|
185
|
+
* Mathematically reconstructs the deterministc localnet state at a specific past DAA score.
|
|
186
|
+
* Annoys UTXOs created after the target DAA and revives UTXOs spent after the target DAA.
|
|
187
|
+
*
|
|
188
|
+
* @param state The current localnet state
|
|
189
|
+
* @param targetDaa The block DAG score to revert to
|
|
190
|
+
* @returns A new immutable localnet state representing the exact state at the target DAA
|
|
191
|
+
*/
|
|
192
|
+
declare function reconstructStateAtDaa(state: LocalnetState, targetDaa: bigint | string): LocalnetState;
|
|
193
|
+
|
|
194
|
+
declare function getDefaultLocalnetDir(cwd?: string): string;
|
|
195
|
+
declare function getDefaultLocalnetStatePath(cwd?: string): string;
|
|
196
|
+
declare function saveLocalnetState(state: LocalnetState, filePath?: string): Promise<void>;
|
|
197
|
+
declare function loadLocalnetState(filePath?: string): Promise<LocalnetState | null>;
|
|
198
|
+
declare function loadOrCreateLocalnetState(options?: {
|
|
199
|
+
cwd?: string;
|
|
200
|
+
accounts?: number;
|
|
201
|
+
initialBalanceSompi?: bigint;
|
|
202
|
+
}): Promise<LocalnetState>;
|
|
203
|
+
declare function resetLocalnetState(options?: {
|
|
204
|
+
cwd?: string;
|
|
205
|
+
accounts?: number;
|
|
206
|
+
initialBalanceSompi?: bigint;
|
|
207
|
+
}): Promise<LocalnetState>;
|
|
208
|
+
|
|
209
|
+
interface FundAddressInput {
|
|
210
|
+
address: string;
|
|
211
|
+
amountSompi: bigint;
|
|
212
|
+
}
|
|
213
|
+
declare function fundAddress(state: LocalnetState, input: FundAddressInput): LocalnetState;
|
|
214
|
+
|
|
215
|
+
declare function getAddressBalanceSompi(state: LocalnetState, address: string): bigint;
|
|
216
|
+
declare function getAccountBalanceSompi(state: LocalnetState, nameOrAddress: string): bigint;
|
|
217
|
+
declare function getSpendableUtxos(state: LocalnetState, address: string): LocalnetUtxo[];
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Calculates hash of the UTXO set (sorted by outpoint).
|
|
221
|
+
*/
|
|
222
|
+
declare function calculateUtxoSetHash(utxos: LocalnetUtxo[]): string;
|
|
223
|
+
/**
|
|
224
|
+
* Calculates hash of the account set (sorted by address).
|
|
225
|
+
*/
|
|
226
|
+
declare function calculateAccountsHash(accounts: LocalnetAccount[]): string;
|
|
227
|
+
/**
|
|
228
|
+
* Calculates the state hash (daaScore + accountsHash + utxoSetHash).
|
|
229
|
+
*/
|
|
230
|
+
declare function calculateStateHash(state: LocalnetState): string;
|
|
231
|
+
/**
|
|
232
|
+
* Creates a canonical deterministic snapshot.
|
|
233
|
+
*/
|
|
234
|
+
declare function createLocalnetSnapshot(state: LocalnetState, name?: string): LocalnetState;
|
|
235
|
+
/**
|
|
236
|
+
* Verifies the integrity of a snapshot.
|
|
237
|
+
*/
|
|
238
|
+
declare function verifySnapshot(snapshot: Snapshot$1): SnapshotVerificationResult;
|
|
239
|
+
/**
|
|
240
|
+
* Restores a snapshot with atomic safety and verification.
|
|
241
|
+
*/
|
|
242
|
+
declare function restoreLocalnetSnapshot(state: LocalnetState, snapshotIdOrName: string): LocalnetState;
|
|
243
|
+
|
|
244
|
+
interface SimulatedPaymentInput {
|
|
245
|
+
readonly from: string;
|
|
246
|
+
readonly to: string;
|
|
247
|
+
readonly amountSompi: bigint;
|
|
248
|
+
readonly feeRateSompiPerMass?: bigint;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Standard Kaspa dust limit (approximate).
|
|
252
|
+
*/
|
|
253
|
+
declare const DUST_LIMIT_SOMPI = 600n;
|
|
254
|
+
/**
|
|
255
|
+
* Applies a simulated payment to the localnet state with atomic safety and validation.
|
|
256
|
+
*/
|
|
257
|
+
declare function applySimulatedPayment(state: LocalnetState, input: SimulatedPaymentInput, ctx: RuntimeContext): SimulationResult;
|
|
258
|
+
/**
|
|
259
|
+
* Executes a pre-built transaction plan against the simulated state.
|
|
260
|
+
*/
|
|
261
|
+
declare function applySimulatedPlan(state: LocalnetState, planArtifact: TxPlan, ctx: RuntimeContext, options?: {
|
|
262
|
+
txId?: string;
|
|
263
|
+
}): SimulationResult;
|
|
264
|
+
|
|
265
|
+
interface StoredSimulatedTxReceipt extends HardkasArtifactBase {
|
|
266
|
+
schema: typeof ARTIFACT_SCHEMAS.TX_RECEIPT;
|
|
267
|
+
version: "1.0.0-alpha";
|
|
268
|
+
hashVersion?: number | string;
|
|
269
|
+
txId: string;
|
|
270
|
+
status: "confirmed" | "failed";
|
|
271
|
+
mode: ExecutionMode;
|
|
272
|
+
networkId: NetworkId;
|
|
273
|
+
from: {
|
|
274
|
+
address: string;
|
|
275
|
+
};
|
|
276
|
+
to: {
|
|
277
|
+
address: string;
|
|
278
|
+
};
|
|
279
|
+
amountSompi: string;
|
|
280
|
+
feeSompi: string;
|
|
281
|
+
changeSompi?: string | undefined;
|
|
282
|
+
spentUtxoIds: string[];
|
|
283
|
+
createdUtxoIds: string[];
|
|
284
|
+
daaScore: string;
|
|
285
|
+
}
|
|
286
|
+
declare function getDefaultReceiptsDir(cwd?: string): string;
|
|
287
|
+
declare function getReceiptPath(txId: string, cwd?: string): string;
|
|
288
|
+
declare function saveSimulatedReceipt(receipt: StoredSimulatedTxReceipt, options?: {
|
|
289
|
+
cwd?: string;
|
|
290
|
+
}): Promise<string>;
|
|
291
|
+
declare function loadSimulatedReceipt(txId: string, options?: {
|
|
292
|
+
cwd?: string;
|
|
293
|
+
}): Promise<StoredSimulatedTxReceipt>;
|
|
294
|
+
declare function listSimulatedReceipts(options?: {
|
|
295
|
+
cwd?: string;
|
|
296
|
+
}): Promise<StoredSimulatedTxReceipt[]>;
|
|
297
|
+
|
|
298
|
+
type StoredTraceEvent = {
|
|
299
|
+
readonly type: "phase.started";
|
|
300
|
+
readonly phase: string;
|
|
301
|
+
readonly timestamp: number;
|
|
302
|
+
} | {
|
|
303
|
+
readonly type: "phase.completed";
|
|
304
|
+
readonly phase: string;
|
|
305
|
+
readonly timestamp: number;
|
|
306
|
+
} | {
|
|
307
|
+
readonly type: "note";
|
|
308
|
+
readonly message: string;
|
|
309
|
+
readonly timestamp: number;
|
|
310
|
+
} | {
|
|
311
|
+
readonly type: "tx.failed";
|
|
312
|
+
readonly phase: string;
|
|
313
|
+
readonly reason: string;
|
|
314
|
+
readonly timestamp: number;
|
|
315
|
+
};
|
|
316
|
+
interface StoredSimulatedTxTrace extends HardkasArtifactBase {
|
|
317
|
+
readonly schema: typeof ARTIFACT_SCHEMAS.TX_TRACE;
|
|
318
|
+
readonly version: string;
|
|
319
|
+
readonly hashVersion?: number | string;
|
|
320
|
+
readonly txId: string;
|
|
321
|
+
readonly mode: ExecutionMode;
|
|
322
|
+
readonly networkId: NetworkId;
|
|
323
|
+
readonly events: readonly StoredTraceEvent[];
|
|
324
|
+
readonly receiptPath?: string | undefined;
|
|
325
|
+
}
|
|
326
|
+
declare function getDefaultTracesDir(cwd?: string): string;
|
|
327
|
+
declare function getTracePath(txId: string, cwd?: string): string;
|
|
328
|
+
declare function saveSimulatedTrace(trace: StoredSimulatedTxTrace, options?: {
|
|
329
|
+
cwd?: string;
|
|
330
|
+
}): Promise<string>;
|
|
331
|
+
declare function loadSimulatedTrace(txId: string, options?: {
|
|
332
|
+
cwd?: string;
|
|
333
|
+
}): Promise<StoredSimulatedTxTrace>;
|
|
334
|
+
declare function listSimulatedTraces(options?: {
|
|
335
|
+
cwd?: string;
|
|
336
|
+
}): Promise<StoredSimulatedTxTrace[]>;
|
|
337
|
+
|
|
338
|
+
interface SimulatedReplaySummary {
|
|
339
|
+
receipt: TxReceipt;
|
|
340
|
+
trace: StoredSimulatedTxTrace;
|
|
341
|
+
summary: {
|
|
342
|
+
spentCount: number;
|
|
343
|
+
createdCount: number;
|
|
344
|
+
transferredSompi: bigint;
|
|
345
|
+
feeSompi: bigint;
|
|
346
|
+
changeSompi: bigint;
|
|
347
|
+
finalDaaScore: string;
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Verifies that a transaction replay matches the original artifacts.
|
|
352
|
+
* Implements an honest replay model that differentiates between
|
|
353
|
+
* reproduced results and unimplemented consensus/bridge features.
|
|
354
|
+
*/
|
|
355
|
+
declare function verifyReplay(state: LocalnetState, originalPlan: TxPlan, originalReceipt: TxReceipt, ctx: RuntimeContext): ReplayVerificationReport;
|
|
356
|
+
/**
|
|
357
|
+
* Loads receipt and trace for a transaction and produces a summary.
|
|
358
|
+
*/
|
|
359
|
+
declare function getSimulatedReplaySummary(txId: string, options?: {
|
|
360
|
+
cwd?: string;
|
|
361
|
+
}): Promise<SimulatedReplaySummary>;
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Creates a fresh simulated DAG with a genesis block.
|
|
365
|
+
*/
|
|
366
|
+
declare function createSimulatedDag(options?: {
|
|
367
|
+
k?: number;
|
|
368
|
+
}): SimulatedDag;
|
|
369
|
+
/**
|
|
370
|
+
* Adds a block to the DAG.
|
|
371
|
+
*/
|
|
372
|
+
declare function addSimulatedBlock(dag: SimulatedDag, block: SimulatedBlock): SimulatedDag;
|
|
373
|
+
/**
|
|
374
|
+
* Moves the sink and recomputes the accepted transaction set.
|
|
375
|
+
*/
|
|
376
|
+
declare function moveSink(dag: SimulatedDag, newSinkId: string, txProvider: (txId: string) => {
|
|
377
|
+
inputs: string[];
|
|
378
|
+
} | undefined): SimulatedDag;
|
|
379
|
+
/**
|
|
380
|
+
* Deterministic Conflict Resolution (Approximation for 0.8.15-alpha)
|
|
381
|
+
* Priority:
|
|
382
|
+
* 1. sink ancestry priority (is part of selectedPathToSink?)
|
|
383
|
+
* 2. deterministic block order (daaScore then block ID)
|
|
384
|
+
* 3. txId lexicographic tie-break
|
|
385
|
+
*/
|
|
386
|
+
declare function resolveConflictsDeterministically(txs: Array<{
|
|
387
|
+
txId: string;
|
|
388
|
+
blockId: string;
|
|
389
|
+
inputs: string[];
|
|
390
|
+
}>, dag: SimulatedDag): {
|
|
391
|
+
accepted: string[];
|
|
392
|
+
displaced: string[];
|
|
393
|
+
conflicts: any[];
|
|
394
|
+
};
|
|
395
|
+
/**
|
|
396
|
+
* Get the blue/red coloring of all blocks in the DAG.
|
|
397
|
+
* Returns a map of blockId → { isBlue, blueWork, blueScore }.
|
|
398
|
+
*/
|
|
399
|
+
declare function getDagColoring(dag: SimulatedDag): Map<string, {
|
|
400
|
+
isBlue: boolean;
|
|
401
|
+
blueWork: string;
|
|
402
|
+
blueScore: number;
|
|
403
|
+
}>;
|
|
404
|
+
/**
|
|
405
|
+
* Get the selected parent chain from sink to genesis.
|
|
406
|
+
*/
|
|
407
|
+
declare function getSelectedChain(dag: SimulatedDag): string[];
|
|
408
|
+
/**
|
|
409
|
+
* Helper to find the best tip block according to GHOSTDAG.
|
|
410
|
+
*/
|
|
411
|
+
declare function findBestTip(dag: SimulatedDag): string;
|
|
412
|
+
|
|
413
|
+
interface ForkOptions {
|
|
414
|
+
network: string;
|
|
415
|
+
rpcUrl: string;
|
|
416
|
+
addresses: string[];
|
|
417
|
+
atDaaScore?: string;
|
|
418
|
+
}
|
|
419
|
+
declare function forkFromNetwork(rpc: KaspaRpcClient, opts: ForkOptions): Promise<LocalnetState>;
|
|
420
|
+
|
|
421
|
+
declare class LocalnetSimulatedProvider implements KaspaRpcClient {
|
|
422
|
+
private readonly workspacePath;
|
|
423
|
+
constructor(workspacePath: string);
|
|
424
|
+
getInfo(): Promise<KaspaNodeInfo>;
|
|
425
|
+
healthCheck(): Promise<KaspaRpcHealth>;
|
|
426
|
+
getBalanceByAddress(address: string): Promise<KaspaAddressBalance>;
|
|
427
|
+
getBalancesByAddresses(addresses: string[]): Promise<KaspaAddressBalance[]>;
|
|
428
|
+
getUtxosByAddress(address: string): Promise<KaspaRpcUtxo[]>;
|
|
429
|
+
getUtxosByAddresses(addresses: string[]): Promise<KaspaRpcUtxo[]>;
|
|
430
|
+
submitTransaction(rawTransaction: string): Promise<KaspaSubmitTransactionResult>;
|
|
431
|
+
getMempoolEntry(txId: string): Promise<MempoolEntry | null>;
|
|
432
|
+
getTransaction(txId: string): Promise<unknown | null>;
|
|
433
|
+
getBlockDagInfo(): Promise<BlockDagInfo>;
|
|
434
|
+
getServerInfo(): Promise<ServerInfo>;
|
|
435
|
+
close(): Promise<void>;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
export { type CreateInitialStateOptions, DUST_LIMIT_SOMPI, type ForkOptions, type FundAddressInput, type HardkasAccount, type HardkasDevnet, type LocalnetAccount, LocalnetSimulatedProvider, type LocalnetState, type LocalnetUtxo, type ReplayInvariantResult, type ReplayVerificationReport, type SimulatedBlock, type SimulatedDag, SimulatedKaspaChain, type SimulatedPaymentInput, type SimulatedReplaySummary, type SimulatedUtxo, type SimulationResult, type Snapshot, type SnapshotRestoreResult, type SnapshotVerificationResult, type StateTransition, type StoredSimulatedTxReceipt, type StoredSimulatedTxTrace, type StoredTraceEvent, addSimulatedBlock, applySimulatedPayment, applySimulatedPlan, calculateAccountsHash, calculateStateHash, calculateUtxoSetHash, createDeterministicAccounts, createInitialLocalnetState, createLocalnetSnapshot, createSimulatedDag, findBestTip, forkFromNetwork, fundAddress, getAccountBalanceSompi, getAddressBalanceSompi, getDagColoring, getDefaultLocalnetDir, getDefaultLocalnetStatePath, getDefaultReceiptsDir, getDefaultTracesDir, getReceiptPath, getSelectedChain, getSimulatedReplaySummary, getSpendableUtxos, getTracePath, listSimulatedReceipts, listSimulatedTraces, loadLocalnetState, loadOrCreateLocalnetState, loadSimulatedReceipt, loadSimulatedTrace, moveSink, reconstructStateAtDaa, resetLocalnetState, resolveAccountAddress, resolveAccountAddressFromState, resolveConflictsDeterministically, restoreLocalnetSnapshot, saveLocalnetState, saveSimulatedReceipt, saveSimulatedTrace, startSimulatedDevnet, verifyReplay, verifySnapshot };
|
package/dist/index.js
CHANGED
|
@@ -1143,6 +1143,8 @@ async function forkFromNetwork(rpc, opts) {
|
|
|
1143
1143
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1144
1144
|
// hardkas-determinism-allow: fork state creation timestamp
|
|
1145
1145
|
networkId,
|
|
1146
|
+
workflowId: "wf_system_bootstrap",
|
|
1147
|
+
assumptionLevel: "default",
|
|
1146
1148
|
daaScore: targetDaaScore,
|
|
1147
1149
|
accounts: opts.addresses.map((addr, i) => ({
|
|
1148
1150
|
name: `forked_${i}`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hardkas/localnet",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.15-alpha",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"kaspa-wasm": "0.13.0",
|
|
16
|
-
"@hardkas/
|
|
17
|
-
"@hardkas/
|
|
18
|
-
"@hardkas/
|
|
19
|
-
"@hardkas/
|
|
20
|
-
"@hardkas/
|
|
21
|
-
"@hardkas/
|
|
16
|
+
"@hardkas/artifacts": "0.8.15-alpha",
|
|
17
|
+
"@hardkas/core": "0.8.15-alpha",
|
|
18
|
+
"@hardkas/query": "0.8.15-alpha",
|
|
19
|
+
"@hardkas/kaspa-rpc": "0.8.15-alpha",
|
|
20
|
+
"@hardkas/simulator": "0.8.15-alpha",
|
|
21
|
+
"@hardkas/tx-builder": "0.8.15-alpha"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"fast-check": "^4.8.0",
|