@argonprotocol/localchain 1.0.11 → 1.0.13

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 (4) hide show
  1. package/cli.js +1 -1
  2. package/index.d.ts +498 -383
  3. package/index.js +1 -0
  4. package/package.json +7 -7
package/cli.js CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const {runCli} = require('./index.js')
3
+ const { runCli } = require('./index.js');
4
4
  runCli().catch(console.error);
package/index.d.ts CHANGED
@@ -1,367 +1,482 @@
1
1
  /* auto-generated by NAPI-RS */
2
2
  /* eslint-disable */
3
3
  export class AccountStore {
4
- getDepositAccount(notaryId?: number | undefined | null): Promise<LocalAccount>
5
- getTaxAccount(notaryId?: number | undefined | null): Promise<LocalAccount>
6
- get(address: string, accountType: AccountType, notaryId: number): Promise<LocalAccount>
7
- getById(id: number): Promise<LocalAccount>
8
- hasAccount(address: string, accountType: AccountType, notaryId: number): Promise<boolean>
4
+ getDepositAccount(
5
+ notaryId?: number | undefined | null,
6
+ ): Promise<LocalAccount>;
7
+ getTaxAccount(notaryId?: number | undefined | null): Promise<LocalAccount>;
8
+ get(
9
+ address: string,
10
+ accountType: AccountType,
11
+ notaryId: number,
12
+ ): Promise<LocalAccount>;
13
+ getById(id: number): Promise<LocalAccount>;
14
+ hasAccount(
15
+ address: string,
16
+ accountType: AccountType,
17
+ notaryId: number,
18
+ ): Promise<boolean>;
9
19
  /** Finds an account with no balance that is not waiting for a send claim */
10
- findIdleJumpAccount(accountType: AccountType, notaryId: number): Promise<LocalAccount | null>
11
- insert(address: string, accountType: AccountType, notaryId: number, hdPath?: string | undefined | null): Promise<LocalAccount>
12
- list(includeJumpAccounts?: boolean | undefined | null): Promise<Array<LocalAccount>>
20
+ findIdleJumpAccount(
21
+ accountType: AccountType,
22
+ notaryId: number,
23
+ ): Promise<LocalAccount | null>;
24
+ insert(
25
+ address: string,
26
+ accountType: AccountType,
27
+ notaryId: number,
28
+ hdPath?: string | undefined | null,
29
+ ): Promise<LocalAccount>;
30
+ list(
31
+ includeJumpAccounts?: boolean | undefined | null,
32
+ ): Promise<Array<LocalAccount>>;
13
33
  }
14
34
 
15
35
  export class BalanceChange {
16
- id: number
17
- accountId: number
18
- changeNumber: number
19
- balance: string
20
- netBalanceChange: string
21
- channelHoldNoteJson?: string
22
- notaryId: number
23
- notesJson: string
24
- proofJson?: string
25
- finalizedBlockNumber?: number
26
- status: BalanceChangeStatus
27
- transactionId?: number
28
- notarizationId?: number
29
- }
30
- export type BalanceChangeRow = BalanceChange
36
+ id: number;
37
+ accountId: number;
38
+ changeNumber: number;
39
+ balance: string;
40
+ netBalanceChange: string;
41
+ channelHoldNoteJson?: string;
42
+ notaryId: number;
43
+ notesJson: string;
44
+ proofJson?: string;
45
+ finalizedBlockNumber?: number;
46
+ status: BalanceChangeStatus;
47
+ transactionId?: number;
48
+ notarizationId?: number;
49
+ }
50
+ export type BalanceChangeRow = BalanceChange;
31
51
 
32
52
  export class BalanceChangeBuilder {
33
- accountType: AccountType
34
- address: string
35
- localAccountId: number
36
- changeNumber: number
37
- syncStatus?: BalanceChangeStatus
38
- static newAccount(address: string, localAccountId: number, accountType: AccountType): BalanceChangeBuilder
39
- isEmptySignature(): Promise<boolean>
40
- get balance(): Promise<bigint>
41
- get accountId32(): Promise<Uint8Array>
42
- isPendingClaim(): Promise<boolean>
43
- send(amount: bigint, restrictToAddresses?: Array<string> | undefined | null): Promise<void>
44
- claim(amount: bigint): Promise<ClaimResult>
45
- claimChannelHold(amount: bigint): Promise<ClaimResult>
46
- claimFromMainchain(transfer: LocalchainTransfer): Promise<void>
47
- sendToMainchain(amount: bigint): Promise<void>
48
- createChannelHold(amount: bigint, paymentAddress: string, domain?: string | undefined | null, delegatedSignerAddress?: string | undefined | null): Promise<void>
49
- sendToVote(amount: bigint): Promise<void>
53
+ accountType: AccountType;
54
+ address: string;
55
+ localAccountId: number;
56
+ changeNumber: number;
57
+ syncStatus?: BalanceChangeStatus;
58
+ static newAccount(
59
+ address: string,
60
+ localAccountId: number,
61
+ accountType: AccountType,
62
+ ): BalanceChangeBuilder;
63
+ isEmptySignature(): Promise<boolean>;
64
+ get balance(): Promise<bigint>;
65
+ get accountId32(): Promise<Uint8Array>;
66
+ isPendingClaim(): Promise<boolean>;
67
+ send(
68
+ amount: bigint,
69
+ restrictToAddresses?: Array<string> | undefined | null,
70
+ ): Promise<void>;
71
+ claim(amount: bigint): Promise<ClaimResult>;
72
+ claimChannelHold(amount: bigint): Promise<ClaimResult>;
73
+ claimFromMainchain(transfer: LocalchainTransfer): Promise<void>;
74
+ sendToMainchain(amount: bigint): Promise<void>;
75
+ createChannelHold(
76
+ amount: bigint,
77
+ paymentAddress: string,
78
+ domain?: string | undefined | null,
79
+ delegatedSignerAddress?: string | undefined | null,
80
+ ): Promise<void>;
81
+ sendToVote(amount: bigint): Promise<void>;
50
82
  /** Lease a Domain. Domain leases are converted in full to tax. */
51
- leaseDomain(): Promise<bigint>
83
+ leaseDomain(): Promise<bigint>;
52
84
  /** Create scale encoded signature message for the balance change. */
53
- static toSigningMessage(balanceChangeJson: string): Uint8Array
85
+ static toSigningMessage(balanceChangeJson: string): Uint8Array;
54
86
  }
55
87
 
56
88
  export class BalanceChangeStore {
57
- allForAccount(accountId: number): Promise<Array<BalanceChange>>
58
- getLatestForAccount(accountId: number): Promise<BalanceChange | null>
59
- cancel(id: number): Promise<void>
60
- getById(id: number): Promise<BalanceChange>
61
- findUnsettled(): Promise<Array<BalanceChange>>
89
+ allForAccount(accountId: number): Promise<Array<BalanceChange>>;
90
+ getLatestForAccount(accountId: number): Promise<BalanceChange | null>;
91
+ cancel(id: number): Promise<void>;
92
+ getById(id: number): Promise<BalanceChange>;
93
+ findUnsettled(): Promise<Array<BalanceChange>>;
62
94
  }
63
95
 
64
96
  export class BalanceSync {
65
- constructor(localchain: Localchain)
66
- sync(options?: VoteCreationOptions | undefined | null): Promise<BalanceSyncResult>
67
- consolidateJumpAccounts(): Promise<Array<NotarizationTracker>>
68
- syncUnsettledBalances(): Promise<Array<BalanceChange>>
69
- syncMainchainTransfers(): Promise<Array<NotarizationTracker>>
70
- convertTaxToVotes(options: VoteCreationOptions): Promise<Array<NotarizationTracker>>
71
- syncBalanceChange(balanceChange: BalanceChange): Promise<BalanceChange>
72
- processPendingChannelHolds(): Promise<ChannelHoldResult>
97
+ constructor(localchain: Localchain);
98
+ sync(
99
+ options?: VoteCreationOptions | undefined | null,
100
+ ): Promise<BalanceSyncResult>;
101
+ consolidateJumpAccounts(): Promise<Array<NotarizationTracker>>;
102
+ syncUnsettledBalances(): Promise<Array<BalanceChange>>;
103
+ syncMainchainTransfers(): Promise<Array<NotarizationTracker>>;
104
+ convertTaxToVotes(
105
+ options: VoteCreationOptions,
106
+ ): Promise<Array<NotarizationTracker>>;
107
+ syncBalanceChange(balanceChange: BalanceChange): Promise<BalanceChange>;
108
+ processPendingChannelHolds(): Promise<ChannelHoldResult>;
73
109
  }
74
110
 
75
111
  export class BalanceSyncResult {
76
- get balanceChanges(): Array<BalanceChange>
77
- get channelHoldNotarizations(): Array<NotarizationTracker>
78
- get channelHoldsUpdated(): Array<ChannelHold>
79
- get mainchainTransfers(): Array<NotarizationTracker>
80
- get jumpAccountConsolidations(): Array<NotarizationTracker>
81
- get blockVotes(): Array<NotarizationTracker>
112
+ get balanceChanges(): Array<BalanceChange>;
113
+ get channelHoldNotarizations(): Array<NotarizationTracker>;
114
+ get channelHoldsUpdated(): Array<ChannelHold>;
115
+ get mainchainTransfers(): Array<NotarizationTracker>;
116
+ get jumpAccountConsolidations(): Array<NotarizationTracker>;
117
+ get blockVotes(): Array<NotarizationTracker>;
82
118
  }
83
119
 
84
120
  export class BalanceTipResult {
85
- balanceTip: Uint8Array
86
- notebookNumber: number
87
- tick: number
121
+ balanceTip: Uint8Array;
122
+ notebookNumber: number;
123
+ tick: number;
88
124
  }
89
125
 
90
126
  export class ChannelHold {
91
- id: string
92
- initialBalanceChangeJson: string
93
- notaryId: number
94
- fromAddress: string
95
- delegatedSignerAddress?: string
96
- toAddress: string
97
- domainHash?: Array<number>
98
- expirationTick: number
99
- balanceChangeNumber: number
100
- notarizationId?: number
101
- isClient: boolean
102
- missedClaimWindow: boolean
103
- get holdAmount(): bigint
104
- get settledAmount(): bigint
105
- get settledSignature(): Uint8Array
106
- isPastClaimPeriod(currentTick: number): boolean
127
+ id: string;
128
+ initialBalanceChangeJson: string;
129
+ notaryId: number;
130
+ fromAddress: string;
131
+ delegatedSignerAddress?: string;
132
+ toAddress: string;
133
+ domainHash?: Array<number>;
134
+ expirationTick: number;
135
+ balanceChangeNumber: number;
136
+ notarizationId?: number;
137
+ isClient: boolean;
138
+ missedClaimWindow: boolean;
139
+ get holdAmount(): bigint;
140
+ get settledAmount(): bigint;
141
+ get settledSignature(): Uint8Array;
142
+ isPastClaimPeriod(currentTick: number): boolean;
107
143
  }
108
144
 
109
145
  export class ChannelHoldResult {
110
- get channelHoldNotarizations(): Array<NotarizationTracker>
111
- get channelHoldsUpdated(): Array<ChannelHold>
146
+ get channelHoldNotarizations(): Array<NotarizationTracker>;
147
+ get channelHoldsUpdated(): Array<ChannelHold>;
112
148
  }
113
149
 
114
150
  export class DomainLease {
115
- id: number
116
- name: string
117
- topLevel: string
118
- registeredToAddress: string
119
- notarizationId: number
120
- registeredAtTick: number
151
+ id: number;
152
+ name: string;
153
+ topLevel: string;
154
+ registeredToAddress: string;
155
+ notarizationId: number;
156
+ registeredAtTick: number;
121
157
  }
122
- export type DomainRow = DomainLease
158
+ export type DomainRow = DomainLease;
123
159
 
124
160
  export class DomainStore {
125
- static tldFromString(topLevel: string): DomainTopLevel
126
- get list(): Promise<Array<DomainLease>>
127
- hashDomain(domain: JsDomain): Uint8Array
128
- static getHash(domain: string): Uint8Array
129
- static parse(domain: string): Domain
130
- get(id: number): Promise<DomainLease>
161
+ static tldFromString(topLevel: string): DomainTopLevel;
162
+ get list(): Promise<Array<DomainLease>>;
163
+ hashDomain(domain: JsDomain): Uint8Array;
164
+ static getHash(domain: string): Uint8Array;
165
+ static parse(domain: string): Domain;
166
+ get(id: number): Promise<DomainLease>;
131
167
  }
132
168
 
133
169
  export class Keystore {
134
- useExternal(defaultAddress: string, sign: (address: string, signatureMessage: Uint8Array) => Promise<Uint8Array>, derive: (hdPath: string) => Promise<string>): Promise<void>
170
+ useExternal(
171
+ defaultAddress: string,
172
+ sign: (
173
+ address: string,
174
+ signatureMessage: Uint8Array,
175
+ ) => Promise<Uint8Array>,
176
+ derive: (hdPath: string) => Promise<string>,
177
+ ): Promise<void>;
135
178
  /** Bootstrap this localchain with a new key. Must be empty or will throw an error! Defaults to SR25519 if no scheme is provided. */
136
- bootstrap(scheme?: CryptoScheme | undefined | null, passwordOption?: KeystorePasswordOption | undefined | null): Promise<string>
179
+ bootstrap(
180
+ scheme?: CryptoScheme | undefined | null,
181
+ passwordOption?: KeystorePasswordOption | undefined | null,
182
+ ): Promise<string>;
137
183
  /** Import a known keypair into the embedded keystore. */
138
- importSuri(suri: string, scheme: CryptoScheme, passwordOption?: KeystorePasswordOption | undefined | null): Promise<string>
139
- unlock(passwordOption?: KeystorePasswordOption | undefined | null): Promise<void>
140
- lock(): Promise<void>
141
- isUnlocked(): Promise<boolean>
142
- deriveAccountId(hdPath: string): Promise<string>
143
- sign(address: string, message: Uint8Array): Promise<Uint8Array>
184
+ importSuri(
185
+ suri: string,
186
+ scheme: CryptoScheme,
187
+ passwordOption?: KeystorePasswordOption | undefined | null,
188
+ ): Promise<string>;
189
+ unlock(
190
+ passwordOption?: KeystorePasswordOption | undefined | null,
191
+ ): Promise<void>;
192
+ lock(): Promise<void>;
193
+ isUnlocked(): Promise<boolean>;
194
+ deriveAccountId(hdPath: string): Promise<string>;
195
+ sign(address: string, message: Uint8Array): Promise<Uint8Array>;
144
196
  }
145
197
 
146
198
  export class LocalAccount {
147
- id: number
148
- address: string
149
- hdPath?: string
150
- accountId32: string
151
- notaryId: number
152
- accountType: AccountType
153
- createdAt: number
154
- updatedAt: number
155
- origin?: NotaryAccountOrigin
199
+ id: number;
200
+ address: string;
201
+ hdPath?: string;
202
+ accountId32: string;
203
+ notaryId: number;
204
+ accountType: AccountType;
205
+ createdAt: number;
206
+ updatedAt: number;
207
+ origin?: NotaryAccountOrigin;
156
208
  }
157
209
 
158
210
  export class Localchain {
159
- path: string
160
- static load(config: LocalchainConfig): Promise<Localchain>
161
- static loadWithoutMainchain(path: string, tickerConfig: TickerConfig, keystorePassword?: KeystorePasswordOption | undefined | null): Promise<Localchain>
162
- attachMainchain(mainchainClient: MainchainClient): Promise<void>
163
- updateTicker(ntpSyncPoolUrl?: string | undefined | null): Promise<void>
164
- close(): Promise<void>
165
- accountOverview(): Promise<LocalchainOverview>
166
- static getDefaultDir(): string
167
- static setDefaultDir(value: string): void
168
- static getDefaultPath(): string
169
- get address(): Promise<string>
170
- get name(): string
171
- get currentTick(): number
172
- durationToNextTick(): bigint
173
- get ticker(): TickerRef
174
- get keystore(): Keystore
175
- get mainchainClient(): Promise<MainchainClient | null>
176
- get mainchainTransfers(): MainchainTransferStore
177
- get notaryClients(): NotaryClients
178
- get accounts(): AccountStore
179
- get balanceChanges(): BalanceChangeStore
180
- get domains(): DomainStore
181
- get openChannelHolds(): OpenChannelHoldsStore
182
- get balanceSync(): BalanceSync
183
- get transactions(): Transactions
184
- beginChange(): NotarizationBuilder
211
+ path: string;
212
+ static load(config: LocalchainConfig): Promise<Localchain>;
213
+ static loadWithoutMainchain(
214
+ path: string,
215
+ tickerConfig: TickerConfig,
216
+ keystorePassword?: KeystorePasswordOption | undefined | null,
217
+ ): Promise<Localchain>;
218
+ attachMainchain(mainchainClient: MainchainClient): Promise<void>;
219
+ updateTicker(ntpSyncPoolUrl?: string | undefined | null): Promise<void>;
220
+ close(): Promise<void>;
221
+ accountOverview(): Promise<LocalchainOverview>;
222
+ static getDefaultDir(): string;
223
+ static setDefaultDir(value: string): void;
224
+ static getDefaultPath(): string;
225
+ get address(): Promise<string>;
226
+ get name(): string;
227
+ get currentTick(): number;
228
+ durationToNextTick(): bigint;
229
+ get ticker(): TickerRef;
230
+ get keystore(): Keystore;
231
+ get mainchainClient(): Promise<MainchainClient | null>;
232
+ get mainchainTransfers(): MainchainTransferStore;
233
+ get notaryClients(): NotaryClients;
234
+ get accounts(): AccountStore;
235
+ get balanceChanges(): BalanceChangeStore;
236
+ get domains(): DomainStore;
237
+ get openChannelHolds(): OpenChannelHoldsStore;
238
+ get balanceSync(): BalanceSync;
239
+ get transactions(): Transactions;
240
+ beginChange(): NotarizationBuilder;
185
241
  }
186
242
 
187
243
  export class MainchainClient {
188
- host: string
189
- close(): Promise<void>
190
- static connect(host: string, timeoutMillis: number): Promise<MainchainClient>
191
- getTicker(): Promise<Ticker>
192
- getChainIdentity(): Promise<ChainIdentity>
193
- getBestBlockHash(): Promise<Uint8Array>
194
- getVoteBlockHash(currentTick: number): Promise<BestBlockForVote | null>
195
- getDomainRegistration(domainName: string, topLevel: DomainTopLevel): Promise<DomainRegistration | null>
196
- getDomainZoneRecord(domainName: string, topLevel: DomainTopLevel): Promise<ZoneRecord | null>
197
- getNotaryDetails(notaryId: number): Promise<NotaryDetails | null>
198
- getAccount(address: string): Promise<AccountInfo>
199
- getOwnership(address: string): Promise<BalancesAccountData>
200
- getTransferToLocalchainFinalizedBlock(transferId: number): Promise<number | null>
201
- waitForLocalchainTransfer(transferId: number): Promise<LocalchainTransfer | null>
202
- getAccountChangesRoot(notaryId: number, notebookNumber: number): Promise<Uint8Array | null>
203
- latestFinalizedNumber(): Promise<number>
204
- waitForNotebookImmortalized(notaryId: number, notebookNumber: number): Promise<number>
244
+ host: string;
245
+ close(): Promise<void>;
246
+ static connect(host: string, timeoutMillis: number): Promise<MainchainClient>;
247
+ getTicker(): Promise<Ticker>;
248
+ getChainIdentity(): Promise<ChainIdentity>;
249
+ getBestBlockHash(): Promise<Uint8Array>;
250
+ getVoteBlockHash(currentTick: number): Promise<BestBlockForVote | null>;
251
+ getDomainRegistration(
252
+ domainName: string,
253
+ topLevel: DomainTopLevel,
254
+ ): Promise<DomainRegistration | null>;
255
+ getDomainZoneRecord(
256
+ domainName: string,
257
+ topLevel: DomainTopLevel,
258
+ ): Promise<ZoneRecord | null>;
259
+ getNotaryDetails(notaryId: number): Promise<NotaryDetails | null>;
260
+ getAccount(address: string): Promise<AccountInfo>;
261
+ 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>;
272
+ latestFinalizedNumber(): Promise<number>;
273
+ waitForNotebookImmortalized(
274
+ notaryId: number,
275
+ notebookNumber: number,
276
+ ): Promise<number>;
205
277
  }
206
278
 
207
279
  export class MainchainTransferStore {
208
- sendToLocalchain(amount: bigint, notaryId?: number | undefined | null): Promise<LocalchainTransfer>
280
+ sendToLocalchain(
281
+ amount: bigint,
282
+ notaryId?: number | undefined | null,
283
+ ): Promise<LocalchainTransfer>;
209
284
  }
210
285
 
211
286
  export class NotarizationBuilder {
212
- set notaryId(notaryId: number)
213
- get notaryId(): Promise<number>
214
- set transaction(transaction: LocalchainTransaction)
215
- get transaction(): Promise<LocalchainTransaction | null>
216
- get isFinalized(): Promise<boolean>
217
- get unclaimedTax(): Promise<bigint>
218
- get channelHolds(): Promise<Array<ChannelHold>>
219
- get accounts(): Promise<Array<LocalAccount>>
220
- get balanceChangeBuilders(): Promise<Array<BalanceChangeBuilder>>
221
- get unusedVoteFunds(): Promise<bigint>
222
- get unusedDomainFunds(): Promise<bigint>
223
- get unclaimedDeposits(): Promise<bigint>
224
- getBalanceChange(account: LocalAccount): Promise<BalanceChangeBuilder>
225
- addAccount(address: string, accountType: AccountType, notaryId: number): Promise<BalanceChangeBuilder>
226
- addAccountById(localAccountId: number): Promise<BalanceChangeBuilder>
227
- getJumpAccount(accountType: AccountType): Promise<BalanceChangeBuilder>
228
- defaultDepositAccount(): Promise<BalanceChangeBuilder>
229
- defaultTaxAccount(): Promise<BalanceChangeBuilder>
230
- loadAccount(account: LocalAccount): Promise<BalanceChangeBuilder>
231
- canAddChannelHold(channelHold: OpenChannelHold): Promise<boolean>
232
- cancelChannelHold(openChannelHold: OpenChannelHold): Promise<void>
233
- claimChannelHold(openChannelHold: OpenChannelHold): Promise<void>
234
- addVote(vote: BlockVote): Promise<void>
235
- leaseDomain(domain: string, registerToAddress: string): Promise<void>
287
+ set notaryId(notaryId: number);
288
+ get notaryId(): Promise<number>;
289
+ set transaction(transaction: LocalchainTransaction);
290
+ get transaction(): Promise<LocalchainTransaction | null>;
291
+ get isFinalized(): Promise<boolean>;
292
+ get unclaimedTax(): Promise<bigint>;
293
+ get channelHolds(): Promise<Array<ChannelHold>>;
294
+ get accounts(): Promise<Array<LocalAccount>>;
295
+ get balanceChangeBuilders(): Promise<Array<BalanceChangeBuilder>>;
296
+ get unusedVoteFunds(): Promise<bigint>;
297
+ get unusedDomainFunds(): Promise<bigint>;
298
+ get unclaimedDeposits(): Promise<bigint>;
299
+ getBalanceChange(account: LocalAccount): Promise<BalanceChangeBuilder>;
300
+ addAccount(
301
+ address: string,
302
+ accountType: AccountType,
303
+ notaryId: number,
304
+ ): Promise<BalanceChangeBuilder>;
305
+ addAccountById(localAccountId: number): Promise<BalanceChangeBuilder>;
306
+ getJumpAccount(accountType: AccountType): Promise<BalanceChangeBuilder>;
307
+ defaultDepositAccount(): Promise<BalanceChangeBuilder>;
308
+ defaultTaxAccount(): Promise<BalanceChangeBuilder>;
309
+ loadAccount(account: LocalAccount): Promise<BalanceChangeBuilder>;
310
+ canAddChannelHold(channelHold: OpenChannelHold): Promise<boolean>;
311
+ cancelChannelHold(openChannelHold: OpenChannelHold): Promise<void>;
312
+ claimChannelHold(openChannelHold: OpenChannelHold): Promise<void>;
313
+ addVote(vote: BlockVote): Promise<void>;
314
+ leaseDomain(domain: string, registerToAddress: string): Promise<void>;
236
315
  /** Calculates the transfer tax on the given amount */
237
- getTransferTaxAmount(amount: bigint): bigint
316
+ getTransferTaxAmount(amount: bigint): bigint;
238
317
  /** Calculates the total needed to end up with the given balance */
239
- getTotalForAfterTaxBalance(finalBalance: bigint): bigint
240
- getChannelHoldTaxAmount(amount: bigint): bigint
241
- claimFromMainchain(transfer: LocalchainTransfer): Promise<BalanceChangeBuilder>
242
- claimAndPayTax(microgonsPlusTax: bigint, depositAccountId: number | undefined | null, useDefaultTaxAccount: boolean): Promise<BalanceChangeBuilder>
243
- fundJumpAccount(microgons: bigint): Promise<BalanceChangeBuilder>
244
- acceptArgonFileRequest(argonFileJson: string): Promise<void>
245
- importArgonFile(argonFileJson: string): Promise<void>
318
+ getTotalForAfterTaxBalance(finalBalance: bigint): bigint;
319
+ getChannelHoldTaxAmount(amount: bigint): bigint;
320
+ claimFromMainchain(
321
+ transfer: LocalchainTransfer,
322
+ ): Promise<BalanceChangeBuilder>;
323
+ claimAndPayTax(
324
+ microgonsPlusTax: bigint,
325
+ depositAccountId: number | undefined | null,
326
+ useDefaultTaxAccount: boolean,
327
+ ): Promise<BalanceChangeBuilder>;
328
+ fundJumpAccount(microgons: bigint): Promise<BalanceChangeBuilder>;
329
+ acceptArgonFileRequest(argonFileJson: string): Promise<void>;
330
+ importArgonFile(argonFileJson: string): Promise<void>;
246
331
  /**
247
332
  * Exports an argon file from this notarization builder with the intention that these will be sent to another
248
333
  * user (who will import into their own localchain).
249
334
  */
250
- exportAsFile(fileType: ArgonFileType): Promise<string>
251
- toJSON(): Promise<string>
252
- notarizeAndWaitForNotebook(): Promise<NotarizationTracker>
253
- notarize(): Promise<NotarizationTracker>
254
- verify(): Promise<void>
255
- sign(): Promise<void>
335
+ exportAsFile(fileType: ArgonFileType): Promise<string>;
336
+ toJSON(): Promise<string>;
337
+ notarizeAndWaitForNotebook(): Promise<NotarizationTracker>;
338
+ notarize(): Promise<NotarizationTracker>;
339
+ verify(): Promise<void>;
340
+ sign(): Promise<void>;
256
341
  }
257
342
 
258
343
  export class NotarizationTracker {
259
- notebookNumber: number
260
- tick: number
261
- notaryId: number
262
- notarizationId: number
263
- notarizedBalanceChanges: number
264
- notarizedVotes: number
344
+ notebookNumber: number;
345
+ tick: number;
346
+ notaryId: number;
347
+ notarizationId: number;
348
+ notarizedBalanceChanges: number;
349
+ notarizedVotes: number;
265
350
  /** Returns the balance changes that were submitted to the notary indexed by the stringified account id (napi doesn't allow numbers as keys) */
266
- get balanceChangesByAccountId(): Promise<Record<string, BalanceChange>>
267
- waitForNotebook(): Promise<void>
268
- get channelHolds(): Promise<Array<ChannelHold>>
351
+ get balanceChangesByAccountId(): Promise<Record<string, BalanceChange>>;
352
+ waitForNotebook(): Promise<void>;
353
+ get channelHolds(): Promise<Array<ChannelHold>>;
269
354
  /** 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. */
270
- getNotebookProof(): Promise<Array<NotebookProof>>
355
+ getNotebookProof(): Promise<Array<NotebookProof>>;
271
356
  /** Confirms the root added to the mainchain */
272
- waitForImmortalized(mainchainClient: MainchainClient): Promise<ImmortalizedBlock>
357
+ waitForImmortalized(
358
+ mainchainClient: MainchainClient,
359
+ ): Promise<ImmortalizedBlock>;
273
360
  }
274
361
 
275
362
  export class NotaryClient {
276
- notaryId: number
277
- autoVerifyHeaderSignatures: boolean
278
- isConnected(): Promise<boolean>
279
- static connect(notaryId: number, publicKey: Uint8Array, host: string, autoVerifyHeaderSignatures: boolean): Promise<NotaryClient>
280
- getBalanceTip(address: string, accountType: AccountType): Promise<BalanceTipResult>
281
- get metadata(): Promise<NotebookMeta>
363
+ notaryId: number;
364
+ autoVerifyHeaderSignatures: boolean;
365
+ isConnected(): Promise<boolean>;
366
+ static connect(
367
+ notaryId: number,
368
+ publicKey: Uint8Array,
369
+ host: string,
370
+ autoVerifyHeaderSignatures: boolean,
371
+ ): 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>;
379
+ get metadata(): Promise<NotebookMeta>;
282
380
  }
283
381
 
284
382
  export class NotaryClients {
285
- static new(mainchainClient: MainchainClient): NotaryClients
286
- close(): Promise<void>
287
- useClient(client: NotaryClient): Promise<void>
288
- get(notaryId: number): Promise<NotaryClient>
383
+ static new(mainchainClient: MainchainClient): NotaryClients;
384
+ close(): Promise<void>;
385
+ useClient(client: NotaryClient): Promise<void>;
386
+ get(notaryId: number): Promise<NotaryClient>;
289
387
  }
290
388
 
291
389
  export class OpenChannelHold {
292
- get channelHold(): Promise<ChannelHold>
293
- sign(settledAmount: bigint): Promise<SignatureResult>
294
- exportForSend(): Promise<string>
295
- recordUpdatedSettlement(microgons: bigint, signature: Uint8Array): Promise<void>
390
+ get channelHold(): Promise<ChannelHold>;
391
+ sign(settledAmount: bigint): Promise<SignatureResult>;
392
+ exportForSend(): Promise<string>;
393
+ recordUpdatedSettlement(
394
+ microgons: bigint,
395
+ signature: Uint8Array,
396
+ ): Promise<void>;
296
397
  }
297
398
 
298
399
  export class OpenChannelHoldsStore {
299
- get(id: string): Promise<OpenChannelHold>
300
- open(channelHold: ChannelHold): OpenChannelHold
301
- getClaimable(): Promise<Array<OpenChannelHold>>
400
+ get(id: string): Promise<OpenChannelHold>;
401
+ open(channelHold: ChannelHold): OpenChannelHold;
402
+ getClaimable(): Promise<Array<OpenChannelHold>>;
302
403
  /** Import a channel_hold from a JSON string. Verifies with the notary that the channel hold is valid. */
303
- importChannelHold(channelHoldJson: string): Promise<OpenChannelHold>
404
+ importChannelHold(channelHoldJson: string): Promise<OpenChannelHold>;
304
405
  /** Create a new channel_hold as a client. You must first notarize a channel hold note to the notary for the `client_address`. */
305
- openClientChannelHold(accountId: number): Promise<OpenChannelHold>
406
+ openClientChannelHold(accountId: number): Promise<OpenChannelHold>;
306
407
  }
307
408
 
308
409
  export class OverviewStore {
309
- get(): Promise<LocalchainOverview>
410
+ get(): Promise<LocalchainOverview>;
411
+ }
412
+
413
+ export class Subscription {
414
+ /** Cancels the subscription. */
415
+ cancel(): Promise<void>;
310
416
  }
311
417
 
312
418
  export class TickerRef {
313
- get current(): number
314
- tickForTime(timestampMillis: number): bigint
315
- timeForTick(tick: number): number
316
- millisToNextTick(): number
317
- get channelHoldExpirationTicks(): number
419
+ get current(): number;
420
+ tickForTime(timestampMillis: number): bigint;
421
+ timeForTick(tick: number): number;
422
+ millisToNextTick(): number;
423
+ get channelHoldExpirationTicks(): number;
318
424
  }
319
425
 
320
426
  export class Transactions {
321
- create(transactionType: TransactionType): Promise<LocalchainTransaction>
322
- request(microgons: bigint): Promise<string>
323
- createChannelHold(channelHoldMicrogons: bigint, recipientAddress: string, domain?: string | undefined | null, notaryId?: number | undefined | null, delegatedSignerAddress?: string | undefined | null): Promise<OpenChannelHold>
324
- send(microgons: bigint, to?: Array<string> | undefined | null): Promise<string>
325
- importArgons(argonFile: string): Promise<NotarizationTracker>
326
- acceptArgonRequest(argonFile: string): Promise<NotarizationTracker>
427
+ create(transactionType: TransactionType): Promise<LocalchainTransaction>;
428
+ request(microgons: bigint): Promise<string>;
429
+ createChannelHold(
430
+ channelHoldMicrogons: bigint,
431
+ recipientAddress: string,
432
+ domain?: string | undefined | null,
433
+ notaryId?: number | undefined | null,
434
+ delegatedSignerAddress?: string | undefined | null,
435
+ ): Promise<OpenChannelHold>;
436
+ send(
437
+ microgons: bigint,
438
+ to?: Array<string> | undefined | null,
439
+ ): Promise<string>;
440
+ importArgons(argonFile: string): Promise<NotarizationTracker>;
441
+ acceptArgonRequest(argonFile: string): Promise<NotarizationTracker>;
327
442
  }
328
443
 
329
444
  export interface AccountInfo {
330
- nonce: number
331
- consumers: number
332
- providers: number
333
- sufficients: number
334
- data: BalancesAccountData
445
+ nonce: number;
446
+ consumers: number;
447
+ providers: number;
448
+ sufficients: number;
449
+ data: BalancesAccountData;
335
450
  }
336
451
 
337
452
  export enum AccountType {
338
453
  Tax = 'tax',
339
- Deposit = 'deposit'
454
+ Deposit = 'deposit',
340
455
  }
341
456
 
342
- export const ADDRESS_PREFIX: number
457
+ export const ADDRESS_PREFIX: number;
343
458
 
344
459
  /** The version of the Argon file format. */
345
- export const ARGON_FILE_VERSION: string
460
+ export const ARGON_FILE_VERSION: string;
346
461
 
347
462
  export enum ArgonFileType {
348
463
  Send = 0,
349
- Request = 1
464
+ Request = 1,
350
465
  }
351
466
 
352
467
  export interface BalanceChangeGroup {
353
- netBalanceChange: bigint
354
- netTax: bigint
355
- heldBalance: bigint
356
- timestamp: number
357
- notes: Array<string>
358
- finalizedBlockNumber?: number
359
- status: BalanceChangeStatus
360
- notarizationId?: number
361
- transactionId?: number
362
- transactionType?: TransactionType
363
- balanceChanges: Array<BalanceChangeSummary>
364
- notebookNumber?: number
468
+ netBalanceChange: bigint;
469
+ netTax: bigint;
470
+ heldBalance: bigint;
471
+ timestamp: number;
472
+ notes: Array<string>;
473
+ finalizedBlockNumber?: number;
474
+ status: BalanceChangeStatus;
475
+ notarizationId?: number;
476
+ transactionId?: number;
477
+ transactionType?: TransactionType;
478
+ balanceChanges: Array<BalanceChangeSummary>;
479
+ notebookNumber?: number;
365
480
  }
366
481
 
367
482
  export enum BalanceChangeStatus {
@@ -376,125 +491,125 @@ export enum BalanceChangeStatus {
376
491
  /** A balance change has been sent to another user to claim. Keep checking until it is claimed. */
377
492
  WaitingForSendClaim = 'WaitingForSendClaim',
378
493
  /** A pending balance change that was canceled before being claimed by another user (channel_hold or send). */
379
- Canceled = 'Canceled'
494
+ Canceled = 'Canceled',
380
495
  }
381
496
 
382
497
  export interface BalanceChangeSummary {
383
- id: number
384
- finalBalance: bigint
385
- holdBalance: bigint
386
- netBalanceChange: bigint
387
- changeNumber: number
388
- accountId: number
389
- accountType: AccountType
390
- isJumpAccount: boolean
391
- notes: Array<string>
392
- status: BalanceChangeStatus
393
- notebookNumber?: number
394
- finalizedBlockNumber?: number
498
+ id: number;
499
+ finalBalance: bigint;
500
+ holdBalance: bigint;
501
+ netBalanceChange: bigint;
502
+ changeNumber: number;
503
+ accountId: number;
504
+ accountType: AccountType;
505
+ isJumpAccount: boolean;
506
+ notes: Array<string>;
507
+ status: BalanceChangeStatus;
508
+ notebookNumber?: number;
509
+ finalizedBlockNumber?: number;
395
510
  }
396
511
 
397
512
  export interface BalancesAccountData {
398
- free: bigint
399
- reserved: bigint
400
- frozen: bigint
401
- flags: bigint
513
+ free: bigint;
514
+ reserved: bigint;
515
+ frozen: bigint;
516
+ flags: bigint;
402
517
  }
403
518
 
404
519
  export interface BestBlockForVote {
405
- blockHash: Uint8Array
406
- voteMinimum: bigint
520
+ blockHash: Uint8Array;
521
+ voteMinimum: bigint;
407
522
  }
408
523
 
409
524
  export interface BlockVote {
410
525
  /** The creator of the seal */
411
- address: string
526
+ address: string;
412
527
  /** The block hash being voted on. Must be in last 2 ticks. */
413
- blockHash: Array<number>
528
+ blockHash: Array<number>;
414
529
  /** A unique index per account for this notebook */
415
- index: number
530
+ index: number;
416
531
  /** The voting power of this vote, determined from the amount of tax */
417
- power: bigint
532
+ power: bigint;
418
533
  /** The tick where a vote was intended */
419
- tick: number
534
+ tick: number;
420
535
  /** The domain used to create this vote */
421
- domainHash: Array<number>
536
+ domainHash: Array<number>;
422
537
  /** The domain payment address used to create this vote */
423
- domainAddress: string
538
+ domainAddress: string;
424
539
  /** The mainchain address where rewards will be sent */
425
- blockRewardsAddress: string
540
+ blockRewardsAddress: string;
426
541
  /** A signature of the vote by the account_id */
427
- signature: Array<number>
542
+ signature: Array<number>;
428
543
  }
429
544
 
430
545
  export enum Chain {
431
546
  Mainnet = 'mainnet',
432
547
  Testnet = 'testnet',
433
548
  LocalTestnet = 'local-testnet',
434
- Devnet = 'devnet'
549
+ Devnet = 'devnet',
435
550
  }
436
551
 
437
552
  export interface ChainIdentity {
438
- chain: Chain
439
- genesis: Buffer
553
+ chain: Chain;
554
+ genesis: Buffer;
440
555
  }
441
556
 
442
557
  export interface ChainIdentity {
443
- chain: Chain
444
- genesisHash: string
558
+ chain: Chain;
559
+ genesisHash: string;
445
560
  }
446
561
 
447
562
  /** Number of ticks past the expiration of a channel_hold that a recipient has to claim. After this point, sender can recoup the channel_holded funds */
448
- export const CHANNEL_HOLD_CLAWBACK_TICKS: number
563
+ export const CHANNEL_HOLD_CLAWBACK_TICKS: number;
449
564
 
450
565
  /** Minimum amount that can be settled in a channel_hold */
451
- export const CHANNEL_HOLD_MINIMUM_SETTLEMENT: bigint
566
+ export const CHANNEL_HOLD_MINIMUM_SETTLEMENT: bigint;
452
567
 
453
568
  export interface ChannelHold {
454
- id: string
455
- fromAddress: string
456
- toAddress: string
457
- balanceChangeNumber: number
458
- expirationTick: number
459
- isClient: boolean
460
- initialBalanceChangeJson: string
461
- notaryId: number
462
- holdAmount: bigint
463
- delegatedSignerAddress?: string
464
- domainHash?: Buffer
465
- notarizationId?: number
466
- missedClaimWindow: boolean
467
- settledAmount: bigint
569
+ id: string;
570
+ fromAddress: string;
571
+ toAddress: string;
572
+ balanceChangeNumber: number;
573
+ expirationTick: number;
574
+ isClient: boolean;
575
+ initialBalanceChangeJson: string;
576
+ notaryId: number;
577
+ holdAmount: bigint;
578
+ delegatedSignerAddress?: string;
579
+ domainHash?: Buffer;
580
+ notarizationId?: number;
581
+ missedClaimWindow: boolean;
582
+ settledAmount: bigint;
468
583
  }
469
584
 
470
585
  export interface ClaimResult {
471
- claimed: bigint
472
- tax: bigint
586
+ claimed: bigint;
587
+ tax: bigint;
473
588
  }
474
589
 
475
590
  export enum CryptoScheme {
476
591
  Ed25519 = 0,
477
592
  Sr25519 = 1,
478
- Ecdsa = 2
593
+ Ecdsa = 2,
479
594
  }
480
595
 
481
596
  /** Max versions that can be in a datastore zone record */
482
- export const DATASTORE_MAX_VERSIONS: number
597
+ export const DATASTORE_MAX_VERSIONS: number;
483
598
 
484
599
  export interface Domain {
485
- name: string
486
- topLevel: DomainTopLevel
600
+ name: string;
601
+ topLevel: DomainTopLevel;
487
602
  }
488
603
 
489
604
  /** Cost to lease a domain for 1 year */
490
- export const DOMAIN_LEASE_COST: bigint
605
+ export const DOMAIN_LEASE_COST: bigint;
491
606
 
492
607
  /** Minimum domain name length */
493
- export const DOMAIN_MIN_NAME_LENGTH: number
608
+ export const DOMAIN_MIN_NAME_LENGTH: number;
494
609
 
495
610
  export interface DomainRegistration {
496
- registeredToAddress: string
497
- registeredAtTick: number
611
+ registeredToAddress: string;
612
+ registeredAtTick: number;
498
613
  }
499
614
 
500
615
  export enum DomainTopLevel {
@@ -517,12 +632,12 @@ export enum DomainTopLevel {
517
632
  Sports = 16,
518
633
  Transportation = 17,
519
634
  Travel = 18,
520
- Weather = 19
635
+ Weather = 19,
521
636
  }
522
637
 
523
638
  export interface ImmortalizedBlock {
524
- immortalizedBlock: number
525
- accountChangesMerkleRoot: Uint8Array
639
+ immortalizedBlock: number;
640
+ accountChangesMerkleRoot: Uint8Array;
526
641
  }
527
642
 
528
643
  /**
@@ -531,143 +646,143 @@ export interface ImmortalizedBlock {
531
646
  */
532
647
  export interface KeystorePasswordOption {
533
648
  /** Provides a password directly for the keystore. Converted to a SecretString inside Rust, but not cleared out in javascript or napi. */
534
- password?: Buffer
649
+ password?: Buffer;
535
650
  /** Initiate a prompt from the cli to load the password. */
536
- interactiveCli?: boolean
651
+ interactiveCli?: boolean;
537
652
  /** Load the password from a file. */
538
- passwordFile?: string
653
+ passwordFile?: string;
539
654
  }
540
655
 
541
656
  export interface LocalchainConfig {
542
- path: string
543
- mainchainUrl: string
544
- ntpPoolUrl?: string
545
- keystorePassword?: KeystorePasswordOption
657
+ path: string;
658
+ mainchainUrl: string;
659
+ ntpPoolUrl?: string;
660
+ keystorePassword?: KeystorePasswordOption;
546
661
  }
547
662
 
548
663
  export interface LocalchainOverview {
549
664
  /** The name of this localchain */
550
- name: string
665
+ name: string;
551
666
  /** The primary localchain address */
552
- address: string
667
+ address: string;
553
668
  /** The current account balance */
554
- balance: bigint
669
+ balance: bigint;
555
670
  /** The net pending balance change acceptance/confirmation */
556
- pendingBalanceChange: bigint
671
+ pendingBalanceChange: bigint;
557
672
  /** Balance held in channel_hold */
558
- heldBalance: bigint
673
+ heldBalance: bigint;
559
674
  /** Tax accumulated for the account */
560
- tax: bigint
675
+ tax: bigint;
561
676
  /** The net pending tax balance change */
562
- pendingTaxChange: bigint
677
+ pendingTaxChange: bigint;
563
678
  /** Changes to the account ordered from most recent to oldest */
564
- changes: Array<BalanceChangeGroup>
679
+ changes: Array<BalanceChangeGroup>;
565
680
  /** The mainchain balance */
566
- mainchainBalance: bigint
681
+ mainchainBalance: bigint;
567
682
  /** The mainchain identity */
568
- mainchainIdentity?: ChainIdentity
683
+ mainchainIdentity?: ChainIdentity;
569
684
  /** The net pending mainchain balance pending movement in/out of the localchain */
570
- processingMainchainBalanceChange: bigint
685
+ processingMainchainBalanceChange: bigint;
571
686
  }
572
687
 
573
688
  export interface LocalchainTransaction {
574
- id: number
575
- transactionType: TransactionType
689
+ id: number;
690
+ transactionType: TransactionType;
576
691
  }
577
692
 
578
693
  export interface LocalchainTransfer {
579
- address: string
580
- amount: bigint
581
- notaryId: number
582
- expirationTick: number
583
- transferId: number
694
+ address: string;
695
+ amount: bigint;
696
+ notaryId: number;
697
+ expirationTick: number;
698
+ transferId: number;
584
699
  }
585
700
 
586
701
  /** Max balance changes that can be in a single notarization */
587
- export const NOTARIZATION_MAX_BALANCE_CHANGES: number
702
+ export const NOTARIZATION_MAX_BALANCE_CHANGES: number;
588
703
 
589
704
  /** Max notarizations that can be in a single notarization */
590
- export const NOTARIZATION_MAX_BLOCK_VOTES: number
705
+ export const NOTARIZATION_MAX_BLOCK_VOTES: number;
591
706
 
592
707
  /** Max domains that can be in a single notarization */
593
- export const NOTARIZATION_MAX_DOMAINS: number
708
+ export const NOTARIZATION_MAX_DOMAINS: number;
594
709
 
595
710
  export interface NotaryAccountOrigin {
596
- notaryId: number
597
- notebookNumber: number
598
- accountUid: number
711
+ notaryId: number;
712
+ notebookNumber: number;
713
+ accountUid: number;
599
714
  }
600
715
 
601
716
  export interface NotaryDetails {
602
- id: number
603
- hosts: Array<string>
604
- publicKey: Uint8Array
717
+ id: number;
718
+ hosts: Array<string>;
719
+ publicKey: Uint8Array;
605
720
  }
606
721
 
607
722
  export interface NotebookMeta {
608
- finalizedNotebookNumber: number
609
- finalizedTick: number
723
+ finalizedNotebookNumber: number;
724
+ finalizedTick: number;
610
725
  }
611
726
 
612
727
  export interface NotebookProof {
613
- address: string
614
- accountType: AccountType
615
- notebookNumber: number
616
- balance: bigint
728
+ address: string;
729
+ accountType: AccountType;
730
+ notebookNumber: number;
731
+ balance: bigint;
617
732
  /** H256 hash of the balance tip */
618
- balanceTip: Uint8Array
619
- changeNumber: number
620
- accountOrigin: NotaryAccountOrigin
621
- channelHoldNoteJson?: string
622
- leafIndex: number
623
- numberOfLeaves: number
624
- proof: Array<Uint8Array>
733
+ balanceTip: Uint8Array;
734
+ changeNumber: number;
735
+ accountOrigin: NotaryAccountOrigin;
736
+ channelHoldNoteJson?: string;
737
+ leafIndex: number;
738
+ numberOfLeaves: number;
739
+ proof: Array<Uint8Array>;
625
740
  }
626
741
 
627
- export declare function runCli(): Promise<void>
742
+ export declare function runCli(): Promise<void>;
628
743
 
629
744
  export interface SignatureResult {
630
- signature: Uint8Array
631
- microgons: bigint
745
+ signature: Uint8Array;
746
+ microgons: bigint;
632
747
  }
633
748
 
634
749
  export interface Ticker {
635
- tickDurationMillis: number
636
- channelHoldExpirationTicks: number
750
+ tickDurationMillis: number;
751
+ channelHoldExpirationTicks: number;
637
752
  }
638
753
 
639
754
  export interface TickerConfig {
640
- tickDurationMillis: number
641
- channelHoldExpirationTicks: number
642
- ntpPoolUrl?: string
755
+ tickDurationMillis: number;
756
+ channelHoldExpirationTicks: number;
757
+ ntpPoolUrl?: string;
643
758
  }
644
759
 
645
760
  export enum TransactionType {
646
761
  Send = 0,
647
762
  Request = 1,
648
763
  OpenChannelHold = 2,
649
- Consolidation = 3
764
+ Consolidation = 3,
650
765
  }
651
766
 
652
767
  /** Maximum tax amount that can be charged on a transfer */
653
- export const TRANSFER_TAX_CAP: bigint
768
+ export const TRANSFER_TAX_CAP: bigint;
654
769
 
655
770
  export interface VersionHost {
656
771
  /** Datastore id is a 2-50 char string that uniquely identifies a domain. */
657
- datastoreId: string
772
+ datastoreId: string;
658
773
  /** The host address where the domain can be accessed. */
659
- host: string
774
+ host: string;
660
775
  }
661
776
 
662
777
  export interface VoteCreationOptions {
663
- votesAddress?: string
778
+ votesAddress?: string;
664
779
  /** What's the minimum amount of tax we should wait for before voting on blocks */
665
- minimumVoteAmount?: number
780
+ minimumVoteAmount?: number;
666
781
  }
667
782
 
668
783
  export interface ZoneRecord {
669
- paymentAddress: string
670
- notaryId: number
784
+ paymentAddress: string;
785
+ notaryId: number;
671
786
  /** A mapping of versions to host addresses. */
672
- versions: Record<string, VersionHost>
787
+ versions: Record<string, VersionHost>;
673
788
  }
package/index.js CHANGED
@@ -386,6 +386,7 @@ module.exports.NotaryClients = nativeBinding.NotaryClients
386
386
  module.exports.OpenChannelHold = nativeBinding.OpenChannelHold
387
387
  module.exports.OpenChannelHoldsStore = nativeBinding.OpenChannelHoldsStore
388
388
  module.exports.OverviewStore = nativeBinding.OverviewStore
389
+ module.exports.Subscription = nativeBinding.Subscription
389
390
  module.exports.TickerRef = nativeBinding.TickerRef
390
391
  module.exports.Transactions = nativeBinding.Transactions
391
392
  module.exports.AccountType = nativeBinding.AccountType
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@argonprotocol/localchain",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "A nodejs binding to the Argon Localchain",
5
5
  "bin": "cli.js",
6
6
  "publishConfig": {
@@ -40,7 +40,7 @@
40
40
  ]
41
41
  },
42
42
  "devDependencies": {
43
- "@argonprotocol/mainchain": "1.0.11",
43
+ "@argonprotocol/mainchain": "1.0.13",
44
44
  "@napi-rs/cli": "3.0.0-alpha.55",
45
45
  "@types/http-proxy": "^1.17.14",
46
46
  "@types/jest": "^29.5.11",
@@ -77,10 +77,10 @@
77
77
  },
78
78
  "packageManager": "yarn@4.1.0",
79
79
  "optionalDependencies": {
80
- "@argonprotocol/localchain-darwin-x64": "1.0.11",
81
- "@argonprotocol/localchain-darwin-arm64": "1.0.11",
82
- "@argonprotocol/localchain-win32-x64-msvc": "1.0.11",
83
- "@argonprotocol/localchain-linux-x64-gnu": "1.0.11",
84
- "@argonprotocol/localchain-linux-arm64-gnu": "1.0.11"
80
+ "@argonprotocol/localchain-darwin-x64": "1.0.13",
81
+ "@argonprotocol/localchain-darwin-arm64": "1.0.13",
82
+ "@argonprotocol/localchain-win32-x64-msvc": "1.0.13",
83
+ "@argonprotocol/localchain-linux-x64-gnu": "1.0.13",
84
+ "@argonprotocol/localchain-linux-arm64-gnu": "1.0.13"
85
85
  }
86
86
  }