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