@argonprotocol/localchain 1.1.0 → 1.3.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 (2) hide show
  1. package/index.d.ts +21 -76
  2. package/package.json +9 -8
package/index.d.ts CHANGED
@@ -1,35 +1,20 @@
1
1
  /* auto-generated by NAPI-RS */
2
2
  /* eslint-disable */
3
3
  export class AccountStore {
4
- getDepositAccount(
5
- notaryId?: number | undefined | null,
6
- ): Promise<LocalAccount>;
4
+ getDepositAccount(notaryId?: number | undefined | null): Promise<LocalAccount>;
7
5
  getTaxAccount(notaryId?: number | undefined | null): Promise<LocalAccount>;
8
- get(
9
- address: string,
10
- accountType: AccountType,
11
- notaryId: number,
12
- ): Promise<LocalAccount>;
6
+ get(address: string, accountType: AccountType, notaryId: number): Promise<LocalAccount>;
13
7
  getById(id: number): Promise<LocalAccount>;
14
- hasAccount(
15
- address: string,
16
- accountType: AccountType,
17
- notaryId: number,
18
- ): Promise<boolean>;
8
+ hasAccount(address: string, accountType: AccountType, notaryId: number): Promise<boolean>;
19
9
  /** Finds an account with no balance that is not waiting for a send claim */
20
- findIdleJumpAccount(
21
- accountType: AccountType,
22
- notaryId: number,
23
- ): Promise<LocalAccount | null>;
10
+ findIdleJumpAccount(accountType: AccountType, notaryId: number): Promise<LocalAccount | null>;
24
11
  insert(
25
12
  address: string,
26
13
  accountType: AccountType,
27
14
  notaryId: number,
28
15
  hdPath?: string | undefined | null,
29
16
  ): Promise<LocalAccount>;
30
- list(
31
- includeJumpAccounts?: boolean | undefined | null,
32
- ): Promise<Array<LocalAccount>>;
17
+ list(includeJumpAccounts?: boolean | undefined | null): Promise<Array<LocalAccount>>;
33
18
  }
34
19
 
35
20
  export class BalanceChange {
@@ -64,10 +49,7 @@ export class BalanceChangeBuilder {
64
49
  get balance(): Promise<bigint>;
65
50
  get accountId32(): Promise<Uint8Array>;
66
51
  isPendingClaim(): Promise<boolean>;
67
- send(
68
- amount: bigint,
69
- restrictToAddresses?: Array<string> | undefined | null,
70
- ): Promise<void>;
52
+ send(amount: bigint, restrictToAddresses?: Array<string> | undefined | null): Promise<void>;
71
53
  claim(amount: bigint): Promise<ClaimResult>;
72
54
  claimChannelHold(amount: bigint): Promise<ClaimResult>;
73
55
  claimFromMainchain(transfer: LocalchainTransfer): Promise<void>;
@@ -95,15 +77,11 @@ export class BalanceChangeStore {
95
77
 
96
78
  export class BalanceSync {
97
79
  constructor(localchain: Localchain);
98
- sync(
99
- options?: VoteCreationOptions | undefined | null,
100
- ): Promise<BalanceSyncResult>;
80
+ sync(options?: VoteCreationOptions | undefined | null): Promise<BalanceSyncResult>;
101
81
  consolidateJumpAccounts(): Promise<Array<NotarizationTracker>>;
102
82
  syncUnsettledBalances(): Promise<Array<BalanceChange>>;
103
83
  syncMainchainTransfers(): Promise<Array<NotarizationTracker>>;
104
- convertTaxToVotes(
105
- options: VoteCreationOptions,
106
- ): Promise<Array<NotarizationTracker>>;
84
+ convertTaxToVotes(options: VoteCreationOptions): Promise<Array<NotarizationTracker>>;
107
85
  syncBalanceChange(balanceChange: BalanceChange): Promise<BalanceChange>;
108
86
  processPendingChannelHolds(): Promise<ChannelHoldResult>;
109
87
  }
@@ -169,10 +147,7 @@ export class DomainStore {
169
147
  export class Keystore {
170
148
  useExternal(
171
149
  defaultAddress: string,
172
- sign: (
173
- address: string,
174
- signatureMessage: Uint8Array,
175
- ) => Promise<Uint8Array>,
150
+ sign: (address: string, signatureMessage: Uint8Array) => Promise<Uint8Array>,
176
151
  derive: (hdPath: string) => Promise<string>,
177
152
  ): Promise<void>;
178
153
  /** Bootstrap this localchain with a new key. Must be empty or will throw an error! Defaults to SR25519 if no scheme is provided. */
@@ -186,9 +161,7 @@ export class Keystore {
186
161
  scheme: CryptoScheme,
187
162
  passwordOption?: KeystorePasswordOption | undefined | null,
188
163
  ): Promise<string>;
189
- unlock(
190
- passwordOption?: KeystorePasswordOption | undefined | null,
191
- ): Promise<void>;
164
+ unlock(passwordOption?: KeystorePasswordOption | undefined | null): Promise<void>;
192
165
  lock(): Promise<void>;
193
166
  isUnlocked(): Promise<boolean>;
194
167
  deriveAccountId(hdPath: string): Promise<string>;
@@ -252,28 +225,15 @@ export class MainchainClient {
252
225
  domainName: string,
253
226
  topLevel: DomainTopLevel,
254
227
  ): Promise<DomainRegistration | null>;
255
- getDomainZoneRecord(
256
- domainName: string,
257
- topLevel: DomainTopLevel,
258
- ): Promise<ZoneRecord | null>;
228
+ getDomainZoneRecord(domainName: string, topLevel: DomainTopLevel): Promise<ZoneRecord | null>;
259
229
  getNotaryDetails(notaryId: number): Promise<NotaryDetails | null>;
260
230
  getAccount(address: string): Promise<AccountInfo>;
261
231
  getOwnership(address: string): Promise<BalancesAccountData>;
262
- getTransferToLocalchainFinalizedBlock(
263
- transferId: number,
264
- ): Promise<number | null>;
265
- waitForLocalchainTransfer(
266
- transferId: number,
267
- ): Promise<LocalchainTransfer | null>;
268
- getAccountChangesRoot(
269
- notaryId: number,
270
- notebookNumber: number,
271
- ): Promise<Uint8Array | null>;
232
+ getTransferToLocalchainFinalizedBlock(transferId: number): Promise<number | null>;
233
+ waitForLocalchainTransfer(transferId: number): Promise<LocalchainTransfer | null>;
234
+ getAccountChangesRoot(notaryId: number, notebookNumber: number): Promise<Uint8Array | null>;
272
235
  latestFinalizedNumber(): Promise<number>;
273
- waitForNotebookImmortalized(
274
- notaryId: number,
275
- notebookNumber: number,
276
- ): Promise<number>;
236
+ waitForNotebookImmortalized(notaryId: number, notebookNumber: number): Promise<number>;
277
237
  }
278
238
 
279
239
  export class MainchainTransferStore {
@@ -317,9 +277,7 @@ export class NotarizationBuilder {
317
277
  /** Calculates the total needed to end up with the given balance */
318
278
  getTotalForAfterTaxBalance(finalBalance: bigint): bigint;
319
279
  getChannelHoldTaxAmount(amount: bigint): bigint;
320
- claimFromMainchain(
321
- transfer: LocalchainTransfer,
322
- ): Promise<BalanceChangeBuilder>;
280
+ claimFromMainchain(transfer: LocalchainTransfer): Promise<BalanceChangeBuilder>;
323
281
  claimAndPayTax(
324
282
  microgonsPlusTax: bigint,
325
283
  depositAccountId: number | undefined | null,
@@ -354,9 +312,7 @@ export class NotarizationTracker {
354
312
  /** Asks the notary for proof the transaction was included in a notebook header. If this notebook has not been finalized yet, it will return an error. */
355
313
  getNotebookProof(): Promise<Array<NotebookProof>>;
356
314
  /** Confirms the root added to the mainchain */
357
- waitForImmortalized(
358
- mainchainClient: MainchainClient,
359
- ): Promise<ImmortalizedBlock>;
315
+ waitForImmortalized(mainchainClient: MainchainClient): Promise<ImmortalizedBlock>;
360
316
  }
361
317
 
362
318
  export class NotaryClient {
@@ -369,13 +325,8 @@ export class NotaryClient {
369
325
  host: string,
370
326
  autoVerifyHeaderSignatures: boolean,
371
327
  ): Promise<NotaryClient>;
372
- getBalanceTip(
373
- address: string,
374
- accountType: AccountType,
375
- ): Promise<BalanceTipResult>;
376
- subscribeHeaders(
377
- callback: (arg0: NotebookNumber, arg1: Tick) => any,
378
- ): Promise<Subscription>;
328
+ getBalanceTip(address: string, accountType: AccountType): Promise<BalanceTipResult>;
329
+ subscribeHeaders(callback: (arg0: NotebookNumber, arg1: Tick) => any): Promise<Subscription>;
379
330
  get metadata(): Promise<NotebookMeta>;
380
331
  }
381
332
 
@@ -390,10 +341,7 @@ export class OpenChannelHold {
390
341
  get channelHold(): Promise<ChannelHold>;
391
342
  sign(settledAmount: bigint): Promise<SignatureResult>;
392
343
  exportForSend(): Promise<string>;
393
- recordUpdatedSettlement(
394
- microgons: bigint,
395
- signature: Uint8Array,
396
- ): Promise<void>;
344
+ recordUpdatedSettlement(microgons: bigint, signature: Uint8Array): Promise<void>;
397
345
  }
398
346
 
399
347
  export class OpenChannelHoldsStore {
@@ -433,10 +381,7 @@ export class Transactions {
433
381
  notaryId?: number | undefined | null,
434
382
  delegatedSignerAddress?: string | undefined | null,
435
383
  ): Promise<OpenChannelHold>;
436
- send(
437
- microgons: bigint,
438
- to?: Array<string> | undefined | null,
439
- ): Promise<string>;
384
+ send(microgons: bigint, to?: Array<string> | undefined | null): Promise<string>;
440
385
  importArgons(argonFile: string): Promise<NotarizationTracker>;
441
386
  acceptArgonRequest(argonFile: string): Promise<NotarizationTracker>;
442
387
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@argonprotocol/localchain",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "A nodejs binding to the Argon Localchain",
5
5
  "bin": "cli.js",
6
6
  "publishConfig": {
@@ -18,6 +18,7 @@
18
18
  "prepublishOnly": "napi prepublish -t npm",
19
19
  "pretest": "npm run build:debug",
20
20
  "test": "npm run pretest && vitest run --typecheck --disableConsoleIntercept",
21
+ "test:ci": "vitest run --typecheck --disableConsoleIntercept",
21
22
  "version": "napi version"
22
23
  },
23
24
  "license": "MIT",
@@ -40,8 +41,8 @@
40
41
  ]
41
42
  },
42
43
  "devDependencies": {
43
- "@argonprotocol/mainchain": "1.1.0",
44
- "@argonprotocol/testing": "1.1.0",
44
+ "@argonprotocol/mainchain": "1.3.0",
45
+ "@argonprotocol/testing": "1.3.0",
45
46
  "@napi-rs/cli": "3.0.0-alpha.55",
46
47
  "shx": "^0.3.4",
47
48
  "typescript": "^5.8.3",
@@ -52,10 +53,10 @@
52
53
  },
53
54
  "packageManager": "yarn@4.1.0",
54
55
  "optionalDependencies": {
55
- "@argonprotocol/localchain-darwin-x64": "1.1.0",
56
- "@argonprotocol/localchain-darwin-arm64": "1.1.0",
57
- "@argonprotocol/localchain-win32-x64-msvc": "1.1.0",
58
- "@argonprotocol/localchain-linux-x64-gnu": "1.1.0",
59
- "@argonprotocol/localchain-linux-arm64-gnu": "1.1.0"
56
+ "@argonprotocol/localchain-darwin-x64": "1.3.0",
57
+ "@argonprotocol/localchain-darwin-arm64": "1.3.0",
58
+ "@argonprotocol/localchain-win32-x64-msvc": "1.3.0",
59
+ "@argonprotocol/localchain-linux-x64-gnu": "1.3.0",
60
+ "@argonprotocol/localchain-linux-arm64-gnu": "1.3.0"
60
61
  }
61
62
  }