@argonprotocol/localchain 1.0.12 → 1.0.14
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/cli.js +1 -1
- package/index.d.ts +494 -385
- package/package.json +7 -7
package/cli.js
CHANGED
package/index.d.ts
CHANGED
|
@@ -1,373 +1,482 @@
|
|
|
1
1
|
/* auto-generated by NAPI-RS */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export class AccountStore {
|
|
4
|
-
getDepositAccount(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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(
|
|
11
|
-
|
|
12
|
-
|
|
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(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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(
|
|
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(
|
|
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(
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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(
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
get
|
|
174
|
-
get
|
|
175
|
-
get
|
|
176
|
-
|
|
177
|
-
get
|
|
178
|
-
get
|
|
179
|
-
get
|
|
180
|
-
get
|
|
181
|
-
get
|
|
182
|
-
get
|
|
183
|
-
get
|
|
184
|
-
|
|
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(
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
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(
|
|
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(
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
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(
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
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(
|
|
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(
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
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>;
|
|
283
380
|
}
|
|
284
381
|
|
|
285
382
|
export class NotaryClients {
|
|
286
|
-
static new(mainchainClient: MainchainClient): NotaryClients
|
|
287
|
-
close(): Promise<void
|
|
288
|
-
useClient(client: NotaryClient): Promise<void
|
|
289
|
-
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>;
|
|
290
387
|
}
|
|
291
388
|
|
|
292
389
|
export class OpenChannelHold {
|
|
293
|
-
get channelHold(): Promise<ChannelHold
|
|
294
|
-
sign(settledAmount: bigint): Promise<SignatureResult
|
|
295
|
-
exportForSend(): Promise<string
|
|
296
|
-
recordUpdatedSettlement(
|
|
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>;
|
|
297
397
|
}
|
|
298
398
|
|
|
299
399
|
export class OpenChannelHoldsStore {
|
|
300
|
-
get(id: string): Promise<OpenChannelHold
|
|
301
|
-
open(channelHold: ChannelHold): OpenChannelHold
|
|
302
|
-
getClaimable(): Promise<Array<OpenChannelHold
|
|
400
|
+
get(id: string): Promise<OpenChannelHold>;
|
|
401
|
+
open(channelHold: ChannelHold): OpenChannelHold;
|
|
402
|
+
getClaimable(): Promise<Array<OpenChannelHold>>;
|
|
303
403
|
/** Import a channel_hold from a JSON string. Verifies with the notary that the channel hold is valid. */
|
|
304
|
-
importChannelHold(channelHoldJson: string): Promise<OpenChannelHold
|
|
404
|
+
importChannelHold(channelHoldJson: string): Promise<OpenChannelHold>;
|
|
305
405
|
/** Create a new channel_hold as a client. You must first notarize a channel hold note to the notary for the `client_address`. */
|
|
306
|
-
openClientChannelHold(accountId: number): Promise<OpenChannelHold
|
|
406
|
+
openClientChannelHold(accountId: number): Promise<OpenChannelHold>;
|
|
307
407
|
}
|
|
308
408
|
|
|
309
409
|
export class OverviewStore {
|
|
310
|
-
get(): Promise<LocalchainOverview
|
|
410
|
+
get(): Promise<LocalchainOverview>;
|
|
311
411
|
}
|
|
312
412
|
|
|
313
413
|
export class Subscription {
|
|
314
414
|
/** Cancels the subscription. */
|
|
315
|
-
cancel(): Promise<void
|
|
415
|
+
cancel(): Promise<void>;
|
|
316
416
|
}
|
|
317
417
|
|
|
318
418
|
export class TickerRef {
|
|
319
|
-
get current(): number
|
|
320
|
-
tickForTime(timestampMillis: number): bigint
|
|
321
|
-
timeForTick(tick: number): number
|
|
322
|
-
millisToNextTick(): number
|
|
323
|
-
get channelHoldExpirationTicks(): number
|
|
419
|
+
get current(): number;
|
|
420
|
+
tickForTime(timestampMillis: number): bigint;
|
|
421
|
+
timeForTick(tick: number): number;
|
|
422
|
+
millisToNextTick(): number;
|
|
423
|
+
get channelHoldExpirationTicks(): number;
|
|
324
424
|
}
|
|
325
425
|
|
|
326
426
|
export class Transactions {
|
|
327
|
-
create(transactionType: TransactionType): Promise<LocalchainTransaction
|
|
328
|
-
request(microgons: bigint): Promise<string
|
|
329
|
-
createChannelHold(
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
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>;
|
|
333
442
|
}
|
|
334
443
|
|
|
335
444
|
export interface AccountInfo {
|
|
336
|
-
nonce: number
|
|
337
|
-
consumers: number
|
|
338
|
-
providers: number
|
|
339
|
-
sufficients: number
|
|
340
|
-
data: BalancesAccountData
|
|
445
|
+
nonce: number;
|
|
446
|
+
consumers: number;
|
|
447
|
+
providers: number;
|
|
448
|
+
sufficients: number;
|
|
449
|
+
data: BalancesAccountData;
|
|
341
450
|
}
|
|
342
451
|
|
|
343
452
|
export enum AccountType {
|
|
344
453
|
Tax = 'tax',
|
|
345
|
-
Deposit = 'deposit'
|
|
454
|
+
Deposit = 'deposit',
|
|
346
455
|
}
|
|
347
456
|
|
|
348
|
-
export const ADDRESS_PREFIX: number
|
|
457
|
+
export const ADDRESS_PREFIX: number;
|
|
349
458
|
|
|
350
459
|
/** The version of the Argon file format. */
|
|
351
|
-
export const ARGON_FILE_VERSION: string
|
|
460
|
+
export const ARGON_FILE_VERSION: string;
|
|
352
461
|
|
|
353
462
|
export enum ArgonFileType {
|
|
354
463
|
Send = 0,
|
|
355
|
-
Request = 1
|
|
464
|
+
Request = 1,
|
|
356
465
|
}
|
|
357
466
|
|
|
358
467
|
export interface BalanceChangeGroup {
|
|
359
|
-
netBalanceChange: bigint
|
|
360
|
-
netTax: bigint
|
|
361
|
-
heldBalance: bigint
|
|
362
|
-
timestamp: number
|
|
363
|
-
notes: Array<string
|
|
364
|
-
finalizedBlockNumber?: number
|
|
365
|
-
status: BalanceChangeStatus
|
|
366
|
-
notarizationId?: number
|
|
367
|
-
transactionId?: number
|
|
368
|
-
transactionType?: TransactionType
|
|
369
|
-
balanceChanges: Array<BalanceChangeSummary
|
|
370
|
-
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;
|
|
371
480
|
}
|
|
372
481
|
|
|
373
482
|
export enum BalanceChangeStatus {
|
|
@@ -382,125 +491,125 @@ export enum BalanceChangeStatus {
|
|
|
382
491
|
/** A balance change has been sent to another user to claim. Keep checking until it is claimed. */
|
|
383
492
|
WaitingForSendClaim = 'WaitingForSendClaim',
|
|
384
493
|
/** A pending balance change that was canceled before being claimed by another user (channel_hold or send). */
|
|
385
|
-
Canceled = 'Canceled'
|
|
494
|
+
Canceled = 'Canceled',
|
|
386
495
|
}
|
|
387
496
|
|
|
388
497
|
export interface BalanceChangeSummary {
|
|
389
|
-
id: number
|
|
390
|
-
finalBalance: bigint
|
|
391
|
-
holdBalance: bigint
|
|
392
|
-
netBalanceChange: bigint
|
|
393
|
-
changeNumber: number
|
|
394
|
-
accountId: number
|
|
395
|
-
accountType: AccountType
|
|
396
|
-
isJumpAccount: boolean
|
|
397
|
-
notes: Array<string
|
|
398
|
-
status: BalanceChangeStatus
|
|
399
|
-
notebookNumber?: number
|
|
400
|
-
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;
|
|
401
510
|
}
|
|
402
511
|
|
|
403
512
|
export interface BalancesAccountData {
|
|
404
|
-
free: bigint
|
|
405
|
-
reserved: bigint
|
|
406
|
-
frozen: bigint
|
|
407
|
-
flags: bigint
|
|
513
|
+
free: bigint;
|
|
514
|
+
reserved: bigint;
|
|
515
|
+
frozen: bigint;
|
|
516
|
+
flags: bigint;
|
|
408
517
|
}
|
|
409
518
|
|
|
410
519
|
export interface BestBlockForVote {
|
|
411
|
-
blockHash: Uint8Array
|
|
412
|
-
voteMinimum: bigint
|
|
520
|
+
blockHash: Uint8Array;
|
|
521
|
+
voteMinimum: bigint;
|
|
413
522
|
}
|
|
414
523
|
|
|
415
524
|
export interface BlockVote {
|
|
416
525
|
/** The creator of the seal */
|
|
417
|
-
address: string
|
|
526
|
+
address: string;
|
|
418
527
|
/** The block hash being voted on. Must be in last 2 ticks. */
|
|
419
|
-
blockHash: Array<number
|
|
528
|
+
blockHash: Array<number>;
|
|
420
529
|
/** A unique index per account for this notebook */
|
|
421
|
-
index: number
|
|
530
|
+
index: number;
|
|
422
531
|
/** The voting power of this vote, determined from the amount of tax */
|
|
423
|
-
power: bigint
|
|
532
|
+
power: bigint;
|
|
424
533
|
/** The tick where a vote was intended */
|
|
425
|
-
tick: number
|
|
534
|
+
tick: number;
|
|
426
535
|
/** The domain used to create this vote */
|
|
427
|
-
domainHash: Array<number
|
|
536
|
+
domainHash: Array<number>;
|
|
428
537
|
/** The domain payment address used to create this vote */
|
|
429
|
-
domainAddress: string
|
|
538
|
+
domainAddress: string;
|
|
430
539
|
/** The mainchain address where rewards will be sent */
|
|
431
|
-
blockRewardsAddress: string
|
|
540
|
+
blockRewardsAddress: string;
|
|
432
541
|
/** A signature of the vote by the account_id */
|
|
433
|
-
signature: Array<number
|
|
542
|
+
signature: Array<number>;
|
|
434
543
|
}
|
|
435
544
|
|
|
436
545
|
export enum Chain {
|
|
437
546
|
Mainnet = 'mainnet',
|
|
438
547
|
Testnet = 'testnet',
|
|
439
548
|
LocalTestnet = 'local-testnet',
|
|
440
|
-
Devnet = 'devnet'
|
|
549
|
+
Devnet = 'devnet',
|
|
441
550
|
}
|
|
442
551
|
|
|
443
552
|
export interface ChainIdentity {
|
|
444
|
-
chain: Chain
|
|
445
|
-
genesis: Buffer
|
|
553
|
+
chain: Chain;
|
|
554
|
+
genesis: Buffer;
|
|
446
555
|
}
|
|
447
556
|
|
|
448
557
|
export interface ChainIdentity {
|
|
449
|
-
chain: Chain
|
|
450
|
-
genesisHash: string
|
|
558
|
+
chain: Chain;
|
|
559
|
+
genesisHash: string;
|
|
451
560
|
}
|
|
452
561
|
|
|
453
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 */
|
|
454
|
-
export const CHANNEL_HOLD_CLAWBACK_TICKS: number
|
|
563
|
+
export const CHANNEL_HOLD_CLAWBACK_TICKS: number;
|
|
455
564
|
|
|
456
565
|
/** Minimum amount that can be settled in a channel_hold */
|
|
457
|
-
export const CHANNEL_HOLD_MINIMUM_SETTLEMENT: bigint
|
|
566
|
+
export const CHANNEL_HOLD_MINIMUM_SETTLEMENT: bigint;
|
|
458
567
|
|
|
459
568
|
export interface ChannelHold {
|
|
460
|
-
id: string
|
|
461
|
-
fromAddress: string
|
|
462
|
-
toAddress: string
|
|
463
|
-
balanceChangeNumber: number
|
|
464
|
-
expirationTick: number
|
|
465
|
-
isClient: boolean
|
|
466
|
-
initialBalanceChangeJson: string
|
|
467
|
-
notaryId: number
|
|
468
|
-
holdAmount: bigint
|
|
469
|
-
delegatedSignerAddress?: string
|
|
470
|
-
domainHash?: Buffer
|
|
471
|
-
notarizationId?: number
|
|
472
|
-
missedClaimWindow: boolean
|
|
473
|
-
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;
|
|
474
583
|
}
|
|
475
584
|
|
|
476
585
|
export interface ClaimResult {
|
|
477
|
-
claimed: bigint
|
|
478
|
-
tax: bigint
|
|
586
|
+
claimed: bigint;
|
|
587
|
+
tax: bigint;
|
|
479
588
|
}
|
|
480
589
|
|
|
481
590
|
export enum CryptoScheme {
|
|
482
591
|
Ed25519 = 0,
|
|
483
592
|
Sr25519 = 1,
|
|
484
|
-
Ecdsa = 2
|
|
593
|
+
Ecdsa = 2,
|
|
485
594
|
}
|
|
486
595
|
|
|
487
596
|
/** Max versions that can be in a datastore zone record */
|
|
488
|
-
export const DATASTORE_MAX_VERSIONS: number
|
|
597
|
+
export const DATASTORE_MAX_VERSIONS: number;
|
|
489
598
|
|
|
490
599
|
export interface Domain {
|
|
491
|
-
name: string
|
|
492
|
-
topLevel: DomainTopLevel
|
|
600
|
+
name: string;
|
|
601
|
+
topLevel: DomainTopLevel;
|
|
493
602
|
}
|
|
494
603
|
|
|
495
604
|
/** Cost to lease a domain for 1 year */
|
|
496
|
-
export const DOMAIN_LEASE_COST: bigint
|
|
605
|
+
export const DOMAIN_LEASE_COST: bigint;
|
|
497
606
|
|
|
498
607
|
/** Minimum domain name length */
|
|
499
|
-
export const DOMAIN_MIN_NAME_LENGTH: number
|
|
608
|
+
export const DOMAIN_MIN_NAME_LENGTH: number;
|
|
500
609
|
|
|
501
610
|
export interface DomainRegistration {
|
|
502
|
-
registeredToAddress: string
|
|
503
|
-
registeredAtTick: number
|
|
611
|
+
registeredToAddress: string;
|
|
612
|
+
registeredAtTick: number;
|
|
504
613
|
}
|
|
505
614
|
|
|
506
615
|
export enum DomainTopLevel {
|
|
@@ -523,12 +632,12 @@ export enum DomainTopLevel {
|
|
|
523
632
|
Sports = 16,
|
|
524
633
|
Transportation = 17,
|
|
525
634
|
Travel = 18,
|
|
526
|
-
Weather = 19
|
|
635
|
+
Weather = 19,
|
|
527
636
|
}
|
|
528
637
|
|
|
529
638
|
export interface ImmortalizedBlock {
|
|
530
|
-
immortalizedBlock: number
|
|
531
|
-
accountChangesMerkleRoot: Uint8Array
|
|
639
|
+
immortalizedBlock: number;
|
|
640
|
+
accountChangesMerkleRoot: Uint8Array;
|
|
532
641
|
}
|
|
533
642
|
|
|
534
643
|
/**
|
|
@@ -537,143 +646,143 @@ export interface ImmortalizedBlock {
|
|
|
537
646
|
*/
|
|
538
647
|
export interface KeystorePasswordOption {
|
|
539
648
|
/** Provides a password directly for the keystore. Converted to a SecretString inside Rust, but not cleared out in javascript or napi. */
|
|
540
|
-
password?: Buffer
|
|
649
|
+
password?: Buffer;
|
|
541
650
|
/** Initiate a prompt from the cli to load the password. */
|
|
542
|
-
interactiveCli?: boolean
|
|
651
|
+
interactiveCli?: boolean;
|
|
543
652
|
/** Load the password from a file. */
|
|
544
|
-
passwordFile?: string
|
|
653
|
+
passwordFile?: string;
|
|
545
654
|
}
|
|
546
655
|
|
|
547
656
|
export interface LocalchainConfig {
|
|
548
|
-
path: string
|
|
549
|
-
mainchainUrl: string
|
|
550
|
-
ntpPoolUrl?: string
|
|
551
|
-
keystorePassword?: KeystorePasswordOption
|
|
657
|
+
path: string;
|
|
658
|
+
mainchainUrl: string;
|
|
659
|
+
ntpPoolUrl?: string;
|
|
660
|
+
keystorePassword?: KeystorePasswordOption;
|
|
552
661
|
}
|
|
553
662
|
|
|
554
663
|
export interface LocalchainOverview {
|
|
555
664
|
/** The name of this localchain */
|
|
556
|
-
name: string
|
|
665
|
+
name: string;
|
|
557
666
|
/** The primary localchain address */
|
|
558
|
-
address: string
|
|
667
|
+
address: string;
|
|
559
668
|
/** The current account balance */
|
|
560
|
-
balance: bigint
|
|
669
|
+
balance: bigint;
|
|
561
670
|
/** The net pending balance change acceptance/confirmation */
|
|
562
|
-
pendingBalanceChange: bigint
|
|
671
|
+
pendingBalanceChange: bigint;
|
|
563
672
|
/** Balance held in channel_hold */
|
|
564
|
-
heldBalance: bigint
|
|
673
|
+
heldBalance: bigint;
|
|
565
674
|
/** Tax accumulated for the account */
|
|
566
|
-
tax: bigint
|
|
675
|
+
tax: bigint;
|
|
567
676
|
/** The net pending tax balance change */
|
|
568
|
-
pendingTaxChange: bigint
|
|
677
|
+
pendingTaxChange: bigint;
|
|
569
678
|
/** Changes to the account ordered from most recent to oldest */
|
|
570
|
-
changes: Array<BalanceChangeGroup
|
|
679
|
+
changes: Array<BalanceChangeGroup>;
|
|
571
680
|
/** The mainchain balance */
|
|
572
|
-
mainchainBalance: bigint
|
|
681
|
+
mainchainBalance: bigint;
|
|
573
682
|
/** The mainchain identity */
|
|
574
|
-
mainchainIdentity?: ChainIdentity
|
|
683
|
+
mainchainIdentity?: ChainIdentity;
|
|
575
684
|
/** The net pending mainchain balance pending movement in/out of the localchain */
|
|
576
|
-
processingMainchainBalanceChange: bigint
|
|
685
|
+
processingMainchainBalanceChange: bigint;
|
|
577
686
|
}
|
|
578
687
|
|
|
579
688
|
export interface LocalchainTransaction {
|
|
580
|
-
id: number
|
|
581
|
-
transactionType: TransactionType
|
|
689
|
+
id: number;
|
|
690
|
+
transactionType: TransactionType;
|
|
582
691
|
}
|
|
583
692
|
|
|
584
693
|
export interface LocalchainTransfer {
|
|
585
|
-
address: string
|
|
586
|
-
amount: bigint
|
|
587
|
-
notaryId: number
|
|
588
|
-
expirationTick: number
|
|
589
|
-
transferId: number
|
|
694
|
+
address: string;
|
|
695
|
+
amount: bigint;
|
|
696
|
+
notaryId: number;
|
|
697
|
+
expirationTick: number;
|
|
698
|
+
transferId: number;
|
|
590
699
|
}
|
|
591
700
|
|
|
592
701
|
/** Max balance changes that can be in a single notarization */
|
|
593
|
-
export const NOTARIZATION_MAX_BALANCE_CHANGES: number
|
|
702
|
+
export const NOTARIZATION_MAX_BALANCE_CHANGES: number;
|
|
594
703
|
|
|
595
704
|
/** Max notarizations that can be in a single notarization */
|
|
596
|
-
export const NOTARIZATION_MAX_BLOCK_VOTES: number
|
|
705
|
+
export const NOTARIZATION_MAX_BLOCK_VOTES: number;
|
|
597
706
|
|
|
598
707
|
/** Max domains that can be in a single notarization */
|
|
599
|
-
export const NOTARIZATION_MAX_DOMAINS: number
|
|
708
|
+
export const NOTARIZATION_MAX_DOMAINS: number;
|
|
600
709
|
|
|
601
710
|
export interface NotaryAccountOrigin {
|
|
602
|
-
notaryId: number
|
|
603
|
-
notebookNumber: number
|
|
604
|
-
accountUid: number
|
|
711
|
+
notaryId: number;
|
|
712
|
+
notebookNumber: number;
|
|
713
|
+
accountUid: number;
|
|
605
714
|
}
|
|
606
715
|
|
|
607
716
|
export interface NotaryDetails {
|
|
608
|
-
id: number
|
|
609
|
-
hosts: Array<string
|
|
610
|
-
publicKey: Uint8Array
|
|
717
|
+
id: number;
|
|
718
|
+
hosts: Array<string>;
|
|
719
|
+
publicKey: Uint8Array;
|
|
611
720
|
}
|
|
612
721
|
|
|
613
722
|
export interface NotebookMeta {
|
|
614
|
-
finalizedNotebookNumber: number
|
|
615
|
-
finalizedTick: number
|
|
723
|
+
finalizedNotebookNumber: number;
|
|
724
|
+
finalizedTick: number;
|
|
616
725
|
}
|
|
617
726
|
|
|
618
727
|
export interface NotebookProof {
|
|
619
|
-
address: string
|
|
620
|
-
accountType: AccountType
|
|
621
|
-
notebookNumber: number
|
|
622
|
-
balance: bigint
|
|
728
|
+
address: string;
|
|
729
|
+
accountType: AccountType;
|
|
730
|
+
notebookNumber: number;
|
|
731
|
+
balance: bigint;
|
|
623
732
|
/** H256 hash of the balance tip */
|
|
624
|
-
balanceTip: Uint8Array
|
|
625
|
-
changeNumber: number
|
|
626
|
-
accountOrigin: NotaryAccountOrigin
|
|
627
|
-
channelHoldNoteJson?: string
|
|
628
|
-
leafIndex: number
|
|
629
|
-
numberOfLeaves: number
|
|
630
|
-
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>;
|
|
631
740
|
}
|
|
632
741
|
|
|
633
|
-
export declare function runCli(): Promise<void
|
|
742
|
+
export declare function runCli(): Promise<void>;
|
|
634
743
|
|
|
635
744
|
export interface SignatureResult {
|
|
636
|
-
signature: Uint8Array
|
|
637
|
-
microgons: bigint
|
|
745
|
+
signature: Uint8Array;
|
|
746
|
+
microgons: bigint;
|
|
638
747
|
}
|
|
639
748
|
|
|
640
749
|
export interface Ticker {
|
|
641
|
-
tickDurationMillis: number
|
|
642
|
-
channelHoldExpirationTicks: number
|
|
750
|
+
tickDurationMillis: number;
|
|
751
|
+
channelHoldExpirationTicks: number;
|
|
643
752
|
}
|
|
644
753
|
|
|
645
754
|
export interface TickerConfig {
|
|
646
|
-
tickDurationMillis: number
|
|
647
|
-
channelHoldExpirationTicks: number
|
|
648
|
-
ntpPoolUrl?: string
|
|
755
|
+
tickDurationMillis: number;
|
|
756
|
+
channelHoldExpirationTicks: number;
|
|
757
|
+
ntpPoolUrl?: string;
|
|
649
758
|
}
|
|
650
759
|
|
|
651
760
|
export enum TransactionType {
|
|
652
761
|
Send = 0,
|
|
653
762
|
Request = 1,
|
|
654
763
|
OpenChannelHold = 2,
|
|
655
|
-
Consolidation = 3
|
|
764
|
+
Consolidation = 3,
|
|
656
765
|
}
|
|
657
766
|
|
|
658
767
|
/** Maximum tax amount that can be charged on a transfer */
|
|
659
|
-
export const TRANSFER_TAX_CAP: bigint
|
|
768
|
+
export const TRANSFER_TAX_CAP: bigint;
|
|
660
769
|
|
|
661
770
|
export interface VersionHost {
|
|
662
771
|
/** Datastore id is a 2-50 char string that uniquely identifies a domain. */
|
|
663
|
-
datastoreId: string
|
|
772
|
+
datastoreId: string;
|
|
664
773
|
/** The host address where the domain can be accessed. */
|
|
665
|
-
host: string
|
|
774
|
+
host: string;
|
|
666
775
|
}
|
|
667
776
|
|
|
668
777
|
export interface VoteCreationOptions {
|
|
669
|
-
votesAddress?: string
|
|
778
|
+
votesAddress?: string;
|
|
670
779
|
/** What's the minimum amount of tax we should wait for before voting on blocks */
|
|
671
|
-
minimumVoteAmount?: number
|
|
780
|
+
minimumVoteAmount?: number;
|
|
672
781
|
}
|
|
673
782
|
|
|
674
783
|
export interface ZoneRecord {
|
|
675
|
-
paymentAddress: string
|
|
676
|
-
notaryId: number
|
|
784
|
+
paymentAddress: string;
|
|
785
|
+
notaryId: number;
|
|
677
786
|
/** A mapping of versions to host addresses. */
|
|
678
|
-
versions: Record<string, VersionHost
|
|
787
|
+
versions: Record<string, VersionHost>;
|
|
679
788
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@argonprotocol/localchain",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
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.
|
|
43
|
+
"@argonprotocol/mainchain": "1.0.14",
|
|
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.
|
|
81
|
-
"@argonprotocol/localchain-darwin-arm64": "1.0.
|
|
82
|
-
"@argonprotocol/localchain-win32-x64-msvc": "1.0.
|
|
83
|
-
"@argonprotocol/localchain-linux-x64-gnu": "1.0.
|
|
84
|
-
"@argonprotocol/localchain-linux-arm64-gnu": "1.0.
|
|
80
|
+
"@argonprotocol/localchain-darwin-x64": "1.0.14",
|
|
81
|
+
"@argonprotocol/localchain-darwin-arm64": "1.0.14",
|
|
82
|
+
"@argonprotocol/localchain-win32-x64-msvc": "1.0.14",
|
|
83
|
+
"@argonprotocol/localchain-linux-x64-gnu": "1.0.14",
|
|
84
|
+
"@argonprotocol/localchain-linux-arm64-gnu": "1.0.14"
|
|
85
85
|
}
|
|
86
86
|
}
|