@argonprotocol/localchain 0.0.16 → 0.0.18
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 +21 -22
- package/package.json +24 -8
package/index.d.ts
CHANGED
|
@@ -63,11 +63,11 @@ export class BalanceChangeStore {
|
|
|
63
63
|
|
|
64
64
|
export class BalanceSync {
|
|
65
65
|
constructor(localchain: Localchain)
|
|
66
|
-
sync(options?:
|
|
66
|
+
sync(options?: VoteCreationOptions | undefined | null): Promise<BalanceSyncResult>
|
|
67
67
|
consolidateJumpAccounts(): Promise<Array<NotarizationTracker>>
|
|
68
68
|
syncUnsettledBalances(): Promise<Array<BalanceChange>>
|
|
69
69
|
syncMainchainTransfers(): Promise<Array<NotarizationTracker>>
|
|
70
|
-
convertTaxToVotes(options:
|
|
70
|
+
convertTaxToVotes(options: VoteCreationOptions): Promise<Array<NotarizationTracker>>
|
|
71
71
|
syncBalanceChange(balanceChange: BalanceChange): Promise<BalanceChange>
|
|
72
72
|
processPendingChannelHolds(): Promise<ChannelHoldResult>
|
|
73
73
|
}
|
|
@@ -239,8 +239,8 @@ export class NotarizationBuilder {
|
|
|
239
239
|
getTotalForAfterTaxBalance(finalBalance: bigint): bigint
|
|
240
240
|
getChannelHoldTaxAmount(amount: bigint): bigint
|
|
241
241
|
claimFromMainchain(transfer: LocalchainTransfer): Promise<BalanceChangeBuilder>
|
|
242
|
-
claimAndPayTax(
|
|
243
|
-
fundJumpAccount(
|
|
242
|
+
claimAndPayTax(microgonsPlusTax: bigint, depositAccountId: number | undefined | null, useDefaultTaxAccount: boolean): Promise<BalanceChangeBuilder>
|
|
243
|
+
fundJumpAccount(microgons: bigint): Promise<BalanceChangeBuilder>
|
|
244
244
|
acceptArgonFileRequest(argonFileJson: string): Promise<void>
|
|
245
245
|
importArgonFile(argonFileJson: string): Promise<void>
|
|
246
246
|
/**
|
|
@@ -292,7 +292,7 @@ export class OpenChannelHold {
|
|
|
292
292
|
get channelHold(): Promise<ChannelHold>
|
|
293
293
|
sign(settledAmount: bigint): Promise<SignatureResult>
|
|
294
294
|
exportForSend(): Promise<string>
|
|
295
|
-
recordUpdatedSettlement(
|
|
295
|
+
recordUpdatedSettlement(microgons: bigint, signature: Uint8Array): Promise<void>
|
|
296
296
|
}
|
|
297
297
|
|
|
298
298
|
export class OpenChannelHoldsStore {
|
|
@@ -311,17 +311,17 @@ export class OverviewStore {
|
|
|
311
311
|
|
|
312
312
|
export class TickerRef {
|
|
313
313
|
get current(): number
|
|
314
|
-
tickForTime(timestampMillis: number):
|
|
315
|
-
timeForTick(tick: number):
|
|
316
|
-
millisToNextTick():
|
|
317
|
-
get channelHoldExpirationTicks():
|
|
314
|
+
tickForTime(timestampMillis: number): bigint
|
|
315
|
+
timeForTick(tick: number): number
|
|
316
|
+
millisToNextTick(): number
|
|
317
|
+
get channelHoldExpirationTicks(): number
|
|
318
318
|
}
|
|
319
319
|
|
|
320
320
|
export class Transactions {
|
|
321
321
|
create(transactionType: TransactionType): Promise<LocalchainTransaction>
|
|
322
|
-
request(
|
|
323
|
-
createChannelHold(
|
|
324
|
-
send(
|
|
322
|
+
request(microgons: bigint): Promise<string>
|
|
323
|
+
createChannelHold(channelHoldMicrogons: bigint, recipientAddress: string, domain?: string | undefined | null, notaryId?: number | undefined | null, delegatedSignerAddress?: string | undefined | null): Promise<OpenChannelHold>
|
|
324
|
+
send(microgons: bigint, to?: Array<string> | undefined | null): Promise<string>
|
|
325
325
|
importArgons(argonFile: string): Promise<NotarizationTracker>
|
|
326
326
|
acceptArgonRequest(argonFile: string): Promise<NotarizationTracker>
|
|
327
327
|
}
|
|
@@ -447,7 +447,7 @@ export interface ChainIdentity {
|
|
|
447
447
|
/** Number of ticks past the expiration of a channel_hold that a recipient has to claim. After this point, sender can recoup the channel_holded funds */
|
|
448
448
|
export const CHANNEL_HOLD_CLAWBACK_TICKS: number
|
|
449
449
|
|
|
450
|
-
/** Minimum
|
|
450
|
+
/** Minimum amount that can be settled in a channel_hold */
|
|
451
451
|
export const CHANNEL_HOLD_MINIMUM_SETTLEMENT: bigint
|
|
452
452
|
|
|
453
453
|
export interface ChannelHold {
|
|
@@ -467,12 +467,6 @@ export interface ChannelHold {
|
|
|
467
467
|
settledAmount: bigint
|
|
468
468
|
}
|
|
469
469
|
|
|
470
|
-
export interface ChannelHoldCloseOptions {
|
|
471
|
-
votesAddress?: string
|
|
472
|
-
/** What's the minimum amount of tax we should wait for before voting on blocks */
|
|
473
|
-
minimumVoteAmount?: number
|
|
474
|
-
}
|
|
475
|
-
|
|
476
470
|
export interface ClaimResult {
|
|
477
471
|
claimed: bigint
|
|
478
472
|
tax: bigint
|
|
@@ -634,17 +628,16 @@ export declare function runCli(): Promise<void>
|
|
|
634
628
|
|
|
635
629
|
export interface SignatureResult {
|
|
636
630
|
signature: Uint8Array
|
|
637
|
-
|
|
631
|
+
microgons: bigint
|
|
638
632
|
}
|
|
639
633
|
|
|
640
634
|
export interface Ticker {
|
|
641
635
|
tickDurationMillis: number
|
|
642
|
-
|
|
636
|
+
channelHoldExpirationTicks: number
|
|
643
637
|
}
|
|
644
638
|
|
|
645
639
|
export interface TickerConfig {
|
|
646
640
|
tickDurationMillis: number
|
|
647
|
-
genesisUtcTime: number
|
|
648
641
|
channelHoldExpirationTicks: number
|
|
649
642
|
ntpPoolUrl?: string
|
|
650
643
|
}
|
|
@@ -666,6 +659,12 @@ export interface VersionHost {
|
|
|
666
659
|
host: string
|
|
667
660
|
}
|
|
668
661
|
|
|
662
|
+
export interface VoteCreationOptions {
|
|
663
|
+
votesAddress?: string
|
|
664
|
+
/** What's the minimum amount of tax we should wait for before voting on blocks */
|
|
665
|
+
minimumVoteAmount?: number
|
|
666
|
+
}
|
|
667
|
+
|
|
669
668
|
export interface ZoneRecord {
|
|
670
669
|
paymentAddress: string
|
|
671
670
|
notaryId: number
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@argonprotocol/localchain",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18",
|
|
4
4
|
"description": "A nodejs binding to the Argon Localchain",
|
|
5
5
|
"bin": "cli.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"build:debug": "napi build --platform --no-const-enum --features=napi -p argon-localchain",
|
|
18
18
|
"prepublishOnly": "napi prepublish -t npm",
|
|
19
19
|
"pretest": "npm run build:debug",
|
|
20
|
-
"test": "npm run pretest &&
|
|
20
|
+
"test": "npm run pretest && jest --testTimeout=60000",
|
|
21
21
|
"version": "napi version"
|
|
22
22
|
},
|
|
23
23
|
"license": "MIT",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
]
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@argonprotocol/mainchain": "0.0.
|
|
43
|
+
"@argonprotocol/mainchain": "0.0.18",
|
|
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",
|
|
@@ -56,15 +56,31 @@
|
|
|
56
56
|
"tslib": "^2.6.2",
|
|
57
57
|
"typescript": "^5.3.3"
|
|
58
58
|
},
|
|
59
|
+
"jest": {
|
|
60
|
+
"preset": "ts-jest",
|
|
61
|
+
"testEnvironment": "node",
|
|
62
|
+
"testMatch": [
|
|
63
|
+
"**/__test__/*.test.ts"
|
|
64
|
+
],
|
|
65
|
+
"transform": {
|
|
66
|
+
"^.+\\.ts": [
|
|
67
|
+
"ts-jest",
|
|
68
|
+
{
|
|
69
|
+
"useESM": false,
|
|
70
|
+
"tsconfig": "./tsconfig-cjs.json"
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
},
|
|
59
75
|
"engines": {
|
|
60
76
|
"node": ">= 18"
|
|
61
77
|
},
|
|
62
78
|
"packageManager": "yarn@4.1.0",
|
|
63
79
|
"optionalDependencies": {
|
|
64
|
-
"@argonprotocol/localchain-darwin-x64": "0.0.
|
|
65
|
-
"@argonprotocol/localchain-darwin-arm64": "0.0.
|
|
66
|
-
"@argonprotocol/localchain-win32-x64-msvc": "0.0.
|
|
67
|
-
"@argonprotocol/localchain-linux-x64-gnu": "0.0.
|
|
68
|
-
"@argonprotocol/localchain-linux-arm64-gnu": "0.0.
|
|
80
|
+
"@argonprotocol/localchain-darwin-x64": "0.0.18",
|
|
81
|
+
"@argonprotocol/localchain-darwin-arm64": "0.0.18",
|
|
82
|
+
"@argonprotocol/localchain-win32-x64-msvc": "0.0.18",
|
|
83
|
+
"@argonprotocol/localchain-linux-x64-gnu": "0.0.18",
|
|
84
|
+
"@argonprotocol/localchain-linux-arm64-gnu": "0.0.18"
|
|
69
85
|
}
|
|
70
86
|
}
|