@argonprotocol/localchain 0.0.8 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.d.ts +37 -9
  2. package/index.js +1 -0
  3. package/package.json +7 -10
package/index.d.ts CHANGED
@@ -47,7 +47,7 @@ export class BalanceChangeBuilder {
47
47
  sendToMainchain(amount: bigint): Promise<void>
48
48
  createChannelHold(amount: bigint, paymentAddress: string, domain?: string | undefined | null, delegatedSignerAddress?: string | undefined | null): Promise<void>
49
49
  sendToVote(amount: bigint): Promise<void>
50
- /** Lease a data domain. Domain leases are converted in full to tax. */
50
+ /** Lease a Domain. Domain leases are converted in full to tax. */
51
51
  leaseDomain(): Promise<bigint>
52
52
  /** Create scale encoded signature message for the balance change. */
53
53
  static toSigningMessage(balanceChangeJson: string): Uint8Array
@@ -67,15 +67,18 @@ export class BalanceSync {
67
67
  consolidateJumpAccounts(): Promise<Array<NotarizationTracker>>
68
68
  syncUnsettledBalances(): Promise<Array<BalanceChange>>
69
69
  syncMainchainTransfers(): Promise<Array<NotarizationTracker>>
70
+ convertTaxToVotes(options: ChannelHoldCloseOptions): Promise<Array<NotarizationTracker>>
70
71
  syncBalanceChange(balanceChange: BalanceChange): Promise<BalanceChange>
71
- processPendingChannelHolds(options?: ChannelHoldCloseOptions | undefined | null): Promise<Array<NotarizationBuilder>>
72
+ processPendingChannelHolds(): Promise<ChannelHoldResult>
72
73
  }
73
74
 
74
75
  export class BalanceSyncResult {
75
76
  get balanceChanges(): Array<BalanceChange>
76
- get channelHoldNotarizations(): Array<NotarizationBuilder>
77
+ get channelHoldNotarizations(): Array<NotarizationTracker>
78
+ get channelHoldsUpdated(): Array<ChannelHold>
77
79
  get mainchainTransfers(): Array<NotarizationTracker>
78
80
  get jumpAccountConsolidations(): Array<NotarizationTracker>
81
+ get blockVotes(): Array<NotarizationTracker>
79
82
  }
80
83
 
81
84
  export class BalanceTipResult {
@@ -103,6 +106,11 @@ export class ChannelHold {
103
106
  isPastClaimPeriod(currentTick: number): boolean
104
107
  }
105
108
 
109
+ export class ChannelHoldResult {
110
+ get channelHoldNotarizations(): Array<NotarizationTracker>
111
+ get channelHoldsUpdated(): Array<ChannelHold>
112
+ }
113
+
106
114
  export class DomainLease {
107
115
  id: number
108
116
  name: string
@@ -257,6 +265,7 @@ export class NotarizationTracker {
257
265
  /** Returns the balance changes that were submitted to the notary indexed by the stringified account id (napi doesn't allow numbers as keys) */
258
266
  get balanceChangesByAccountId(): Promise<Record<string, BalanceChange>>
259
267
  waitForNotebook(): Promise<void>
268
+ get channelHolds(): Promise<Array<ChannelHold>>
260
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. */
261
270
  getNotebookProof(): Promise<Array<NotebookProof>>
262
271
  /** Confirms the root added to the mainchain */
@@ -406,9 +415,11 @@ export interface BlockVote {
406
415
  index: number
407
416
  /** The voting power of this vote, determined from the amount of tax */
408
417
  power: bigint
409
- /** The data domain used to create this vote */
418
+ /** The tick where a vote was intended */
419
+ tick: number
420
+ /** The domain used to create this vote */
410
421
  domainHash: Array<number>
411
- /** The data domain payment address used to create this vote */
422
+ /** The domain payment address used to create this vote */
412
423
  domainAddress: string
413
424
  /** The mainchain address where rewards will be sent */
414
425
  blockRewardsAddress: string
@@ -439,6 +450,23 @@ export const CHANNEL_HOLD_CLAWBACK_TICKS: number
439
450
  /** Minimum milligons that can be settled in a channel_hold */
440
451
  export const CHANNEL_HOLD_MINIMUM_SETTLEMENT: bigint
441
452
 
453
+ export interface ChannelHold {
454
+ id: string
455
+ fromAddress: string
456
+ toAddress: string
457
+ balanceChangeNumber: number
458
+ expirationTick: number
459
+ isClient: boolean
460
+ initialBalanceChangeJson: string
461
+ notaryId: number
462
+ holdAmount: bigint
463
+ delegatedSignerAddress?: string
464
+ domainHash?: Buffer
465
+ notarizationId?: number
466
+ missedClaimWindow: boolean
467
+ settledAmount: bigint
468
+ }
469
+
442
470
  export interface ChannelHoldCloseOptions {
443
471
  votesAddress?: string
444
472
  /** What's the minimum amount of tax we should wait for before voting on blocks */
@@ -464,10 +492,10 @@ export interface Domain {
464
492
  topLevel: DomainTopLevel
465
493
  }
466
494
 
467
- /** Cost to lease a data domain for 1 year */
495
+ /** Cost to lease a domain for 1 year */
468
496
  export const DOMAIN_LEASE_COST: bigint
469
497
 
470
- /** Minimum data domain name length */
498
+ /** Minimum domain name length */
471
499
  export const DOMAIN_MIN_NAME_LENGTH: number
472
500
 
473
501
  export interface DomainRegistration {
@@ -629,9 +657,9 @@ export enum TransactionType {
629
657
  }
630
658
 
631
659
  export interface VersionHost {
632
- /** Datastore id is a 2-50 char string that uniquely identifies a data domain. */
660
+ /** Datastore id is a 2-50 char string that uniquely identifies a domain. */
633
661
  datastoreId: string
634
- /** The host address where the data domain can be accessed. */
662
+ /** The host address where the domain can be accessed. */
635
663
  host: string
636
664
  }
637
665
 
package/index.js CHANGED
@@ -370,6 +370,7 @@ module.exports.BalanceSync = nativeBinding.BalanceSync
370
370
  module.exports.BalanceSyncResult = nativeBinding.BalanceSyncResult
371
371
  module.exports.BalanceTipResult = nativeBinding.BalanceTipResult
372
372
  module.exports.ChannelHold = nativeBinding.ChannelHold
373
+ module.exports.ChannelHoldResult = nativeBinding.ChannelHoldResult
373
374
  module.exports.DomainLease = nativeBinding.DomainLease
374
375
  module.exports.DomainRow = nativeBinding.DomainRow
375
376
  module.exports.DomainStore = nativeBinding.DomainStore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@argonprotocol/localchain",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "description": "A nodejs binding to the Argon Localchain",
5
5
  "bin": "cli.js",
6
6
  "publishConfig": {
@@ -40,11 +40,8 @@
40
40
  ]
41
41
  },
42
42
  "devDependencies": {
43
- "@argonprotocol/mainchain": "0.0.8",
43
+ "@argonprotocol/mainchain": "0.0.10",
44
44
  "@napi-rs/cli": "3.0.0-alpha.55",
45
- "@polkadot/util": "^13.0.2",
46
- "@polkadot/util-crypto": "^13.0.2",
47
- "@polkadot/wasm-crypto": "^7.3.2",
48
45
  "@types/http-proxy": "^1.17.14",
49
46
  "@types/jest": "^29.5.11",
50
47
  "@types/node": "^18.19.6",
@@ -64,10 +61,10 @@
64
61
  },
65
62
  "packageManager": "yarn@4.1.0",
66
63
  "optionalDependencies": {
67
- "@argonprotocol/localchain-darwin-x64": "0.0.8",
68
- "@argonprotocol/localchain-darwin-arm64": "0.0.8",
69
- "@argonprotocol/localchain-win32-x64-msvc": "0.0.8",
70
- "@argonprotocol/localchain-linux-x64-gnu": "0.0.8",
71
- "@argonprotocol/localchain-linux-arm64-gnu": "0.0.8"
64
+ "@argonprotocol/localchain-darwin-x64": "0.0.10",
65
+ "@argonprotocol/localchain-darwin-arm64": "0.0.10",
66
+ "@argonprotocol/localchain-win32-x64-msvc": "0.0.10",
67
+ "@argonprotocol/localchain-linux-x64-gnu": "0.0.10",
68
+ "@argonprotocol/localchain-linux-arm64-gnu": "0.0.10"
72
69
  }
73
70
  }