evernode-js-client 0.6.38 → 0.6.39

Sign up to get free protection for your applications and to get access to all the features.
Binary file
package/index.js CHANGED
@@ -9189,7 +9189,7 @@ module.exports = { mask, unmask };
9189
9189
 
9190
9190
 
9191
9191
  try {
9192
- module.exports = require(__nccwpck_require__.ab + "prebuilds/linux-x64/node.napi1.node");
9192
+ module.exports = require(__nccwpck_require__.ab + "prebuilds/linux-x64/node.napi.node");
9193
9193
  } catch (e) {
9194
9194
  module.exports = __nccwpck_require__(2567);
9195
9195
  }
@@ -38321,7 +38321,7 @@ module.exports = isValidUTF8;
38321
38321
 
38322
38322
 
38323
38323
  try {
38324
- module.exports = require(__nccwpck_require__.ab + "prebuilds/linux-x64/node.napi.node");
38324
+ module.exports = require(__nccwpck_require__.ab + "prebuilds/linux-x64/node.napi1.node");
38325
38325
  } catch (e) {
38326
38326
  module.exports = __nccwpck_require__(9372);
38327
38327
  }
@@ -59603,8 +59603,6 @@ const DUD_HOST_CANDID_ADDRESS_OFFSET = 12;
59603
59603
  const REPUTATION_HOST_ADDRESS_PARAM_OFFSET = 0;
59604
59604
  const REPUTATION_VALUE_PARAM_OFFSET = 20;
59605
59605
 
59606
- const MAX_HOOK_PARAM_SIZE = 128;
59607
-
59608
59606
  class BaseEvernodeClient {
59609
59607
 
59610
59608
  #watchEvents;
@@ -59832,8 +59830,7 @@ class BaseEvernodeClient {
59832
59830
  let eventData;
59833
59831
  if (tx.HookParameters.length) {
59834
59832
  eventType = tx.HookParameters.find(p => p.name === HookParamKeys.PARAM_EVENT_TYPE_KEY)?.value;
59835
- eventData = tx.HookParameters.find(p => p.name === HookParamKeys.PARAM_EVENT_DATA1_KEY)?.value ?? '';
59836
- eventData += tx.HookParameters.find(p => p.name === HookParamKeys.PARAM_EVENT_DATA2_KEY)?.value ?? '';
59833
+ eventData = tx.HookParameters.find(p => p.name === HookParamKeys.PARAM_EVENT_DATA_KEY)?.value ?? '';
59837
59834
  }
59838
59835
  if (tx.TransactionType === 'URITokenBuy' && eventType === EventTypes.ACQUIRE_LEASE && tx.Memos.length &&
59839
59836
  tx.Memos[0].type === EventTypes.ACQUIRE_LEASE && tx.Memos[0].format === MemoFormats.BASE64 && tx.Memos[0].data) {
@@ -60326,7 +60323,7 @@ class BaseEvernodeClient {
60326
60323
  {
60327
60324
  hookParams: [
60328
60325
  { name: HookParamKeys.PARAM_EVENT_TYPE_KEY, value: EventTypes.DEAD_HOST_PRUNE },
60329
- { name: HookParamKeys.PARAM_EVENT_DATA1_KEY, value: paramData.toString('hex') }
60326
+ { name: HookParamKeys.PARAM_EVENT_DATA_KEY, value: paramData.toString('hex') }
60330
60327
  ]
60331
60328
  });
60332
60329
  } else
@@ -60522,8 +60519,7 @@ class BaseEvernodeClient {
60522
60519
  {
60523
60520
  hookParams: [
60524
60521
  { name: HookParamKeys.PARAM_EVENT_TYPE_KEY, value: EventTypes.CANDIDATE_PROPOSE },
60525
- { name: HookParamKeys.PARAM_EVENT_DATA1_KEY, value: paramBuf.slice(0, MAX_HOOK_PARAM_SIZE).toString('hex').toUpperCase() },
60526
- { name: HookParamKeys.PARAM_EVENT_DATA2_KEY, value: paramBuf.slice(MAX_HOOK_PARAM_SIZE).toString('hex').toUpperCase() }
60522
+ { name: HookParamKeys.PARAM_EVENT_DATA_KEY, value: paramBuf.toString('hex').toUpperCase() }
60527
60523
  ],
60528
60524
  ...options.transactionOptions
60529
60525
  });
@@ -60547,7 +60543,7 @@ class BaseEvernodeClient {
60547
60543
  {
60548
60544
  hookParams: [
60549
60545
  { name: HookParamKeys.PARAM_EVENT_TYPE_KEY, value: EventTypes.CANDIDATE_WITHDRAW },
60550
- { name: HookParamKeys.PARAM_EVENT_DATA1_KEY, value: candidateIdBuf.toString('hex').toUpperCase() }
60546
+ { name: HookParamKeys.PARAM_EVENT_DATA_KEY, value: candidateIdBuf.toString('hex').toUpperCase() }
60551
60547
  ],
60552
60548
  ...options.transactionOptions
60553
60549
  });
@@ -60573,7 +60569,7 @@ class BaseEvernodeClient {
60573
60569
  {
60574
60570
  hookParams: [
60575
60571
  { name: HookParamKeys.PARAM_EVENT_TYPE_KEY, value: EventTypes.DUD_HOST_REPORT },
60576
- { name: HookParamKeys.PARAM_EVENT_DATA1_KEY, value: candidateId }
60572
+ { name: HookParamKeys.PARAM_EVENT_DATA_KEY, value: candidateId }
60577
60573
  ],
60578
60574
  ...options.transactionOptions
60579
60575
  });
@@ -60663,7 +60659,7 @@ class FoundationClient extends BaseEvernodeClient {
60663
60659
  {
60664
60660
  hookParams: [
60665
60661
  { name: HookParamKeys.PARAM_EVENT_TYPE_KEY, value: EventTypes.CANDIDATE_VOTE },
60666
- { name: HookParamKeys.PARAM_EVENT_DATA1_KEY, value: voteBuf.toString('hex').toUpperCase() }
60662
+ { name: HookParamKeys.PARAM_EVENT_DATA_KEY, value: voteBuf.toString('hex').toUpperCase() }
60667
60663
  ],
60668
60664
  ...options.transactionOptions
60669
60665
  });
@@ -60732,7 +60728,7 @@ class FoundationClient extends BaseEvernodeClient {
60732
60728
  {
60733
60729
  hookParams: [
60734
60730
  { name: HookParamKeys.PARAM_EVENT_TYPE_KEY, value: EventTypes.GOVERNANCE_MODE_CHANGE },
60735
- { name: HookParamKeys.PARAM_EVENT_DATA1_KEY, value: modeBuf.toString('hex').toUpperCase() }
60731
+ { name: HookParamKeys.PARAM_EVENT_DATA_KEY, value: modeBuf.toString('hex').toUpperCase() }
60736
60732
  ],
60737
60733
  ...options.transactionOptions
60738
60734
  });
@@ -60761,7 +60757,7 @@ class FoundationClient extends BaseEvernodeClient {
60761
60757
  {
60762
60758
  hookParams: [
60763
60759
  { name: HookParamKeys.PARAM_EVENT_TYPE_KEY, value: EventTypes.HOST_UPDATE_REPUTATION },
60764
- { name: HookParamKeys.PARAM_EVENT_DATA1_KEY, value: reputationBuf.toString('hex').toUpperCase() }
60760
+ { name: HookParamKeys.PARAM_EVENT_DATA_KEY, value: reputationBuf.toString('hex').toUpperCase() }
60765
60761
  ],
60766
60762
  ...options.transactionOptions
60767
60763
  });
@@ -60972,7 +60968,8 @@ const HOST_CPU_COUNT_PARAM_OFFSET = 58;
60972
60968
  const HOST_CPU_SPEED_PARAM_OFFSET = 60;
60973
60969
  const HOST_DESCRIPTION_PARAM_OFFSET = 62;
60974
60970
  const HOST_EMAIL_ADDRESS_PARAM_OFFSET = 88;
60975
- const HOST_REG_PARAM_SIZE = 128;
60971
+ const HOST_LEASE_AMOUNT_PARAM_OFFSET = 128;
60972
+ const HOST_REG_PARAM_SIZE = 136;
60976
60973
 
60977
60974
  const HOST_UPDATE_TOKEN_ID_PARAM_OFFSET = 0;
60978
60975
  const HOST_UPDATE_COUNTRY_CODE_PARAM_OFFSET = 32;
@@ -60984,7 +60981,8 @@ const HOST_UPDATE_ACT_INS_COUNT_PARAM_OFFSET = 50;
60984
60981
  const HOST_UPDATE_DESCRIPTION_PARAM_OFFSET = 54;
60985
60982
  const HOST_UPDATE_VERSION_PARAM_OFFSET = 80;
60986
60983
  const HOST_UPDATE_EMAIL_ADDRESS_PARAM_OFFSET = 83;
60987
- const HOST_UPDATE_PARAM_SIZE = 123;
60984
+ const HOST_UPDATE_LEASE_AMOUNT_PARAM_OFFSET = 123;
60985
+ const HOST_UPDATE_PARAM_SIZE = 131;
60988
60986
 
60989
60987
  const VOTE_VALIDATION_ERR = "VOTE_VALIDATION_ERR";
60990
60988
 
@@ -61067,7 +61065,7 @@ class HostClient extends BaseEvernodeClient {
61067
61065
  async #submitWithRetry(callback, options = {}) {
61068
61066
  let attempt = 0;
61069
61067
  let feeUplift = 0;
61070
- const maxAttempts = (options?.maxRetryAttempts || 1);
61068
+ const maxAttempts = (options?.maxRetryAttempts || 10);
61071
61069
  let submissionRef = options.submissionRef || {};
61072
61070
  while (attempt <= maxAttempts) {
61073
61071
  attempt++;
@@ -61352,10 +61350,11 @@ class HostClient extends BaseEvernodeClient {
61352
61350
  * @param {number} cpuSpeed CPU MHz.
61353
61351
  * @param {string} description Description about the host.
61354
61352
  * @param {string} emailAddress Email address of the host.
61353
+ * @param {number} leaseAmount Lease fee of the host.
61355
61354
  * @param {*} options [Optional] transaction options.
61356
61355
  * @returns Transaction result.
61357
61356
  */
61358
- async register(countryCode, cpuMicroSec, ramMb, diskMb, totalInstanceCount, cpuModel, cpuCount, cpuSpeed, description, emailAddress, options = {}) {
61357
+ async register(countryCode, cpuMicroSec, ramMb, diskMb, totalInstanceCount, cpuModel, cpuCount, cpuSpeed, description, emailAddress, leaseAmount, options = {}) {
61359
61358
  if (!/^([A-Z]{2})$/.test(countryCode))
61360
61359
  throw "countryCode should consist of 2 uppercase alphabetical characters";
61361
61360
  else if (!cpuMicroSec || isNaN(cpuMicroSec) || cpuMicroSec % 1 != 0 || cpuMicroSec < 0)
@@ -61365,13 +61364,15 @@ class HostClient extends BaseEvernodeClient {
61365
61364
  else if (!diskMb || isNaN(diskMb) || diskMb % 1 != 0 || diskMb < 0)
61366
61365
  throw "diskMb should be a positive integer";
61367
61366
  else if (!totalInstanceCount || isNaN(totalInstanceCount) || totalInstanceCount % 1 != 0 || totalInstanceCount < 0)
61368
- throw "totalInstanceCount should be a positive intiger";
61367
+ throw "totalInstanceCount should be a positive integer";
61369
61368
  else if (!cpuCount || isNaN(cpuCount) || cpuCount % 1 != 0 || cpuCount < 0)
61370
61369
  throw "CPU count should be a positive integer";
61371
61370
  else if (!cpuSpeed || isNaN(cpuSpeed) || cpuSpeed % 1 != 0 || cpuSpeed < 0)
61372
61371
  throw "CPU speed should be a positive integer";
61373
61372
  else if (!cpuModel)
61374
61373
  throw "cpu model cannot be empty";
61374
+ else if (!leaseAmount || isNaN(leaseAmount) || diskMb < 0)
61375
+ throw "leaseAmount should be a positive float";
61375
61376
 
61376
61377
  // Need to use control characters inside this regex to match ascii characters.
61377
61378
  // Here we allow all the characters in ascii range except ";" for the description.
@@ -61420,7 +61421,7 @@ class HostClient extends BaseEvernodeClient {
61420
61421
  console.log("No initiated transfers were found.");
61421
61422
  }
61422
61423
 
61423
- // <country_code(2)><cpu_microsec(4)><ram_mb(4)><disk_mb(4)><no_of_total_instances(4)><cpu_model(40)><cpu_count(2)><cpu_speed(2)><description(26)><email_address(40)>
61424
+ // <country_code(2)><cpu_microsec(4)><ram_mb(4)><disk_mb(4)><no_of_total_instances(4)><cpu_model(40)><cpu_count(2)><cpu_speed(2)><description(26)><email_address(40)><host_lease_amount(8,xfl)>
61424
61425
  const paramBuf = Buffer.alloc(HOST_REG_PARAM_SIZE, 0);
61425
61426
  Buffer.from(countryCode.substr(0, 2), "utf-8").copy(paramBuf, HOST_COUNTRY_CODE_PARAM_OFFSET);
61426
61427
  paramBuf.writeUInt32LE(cpuMicroSec, HOST_CPU_MICROSEC_PARAM_OFFSET);
@@ -61432,6 +61433,7 @@ class HostClient extends BaseEvernodeClient {
61432
61433
  paramBuf.writeUInt16LE(cpuSpeed, HOST_CPU_SPEED_PARAM_OFFSET);
61433
61434
  Buffer.from(description.substr(0, 26), "utf-8").copy(paramBuf, HOST_DESCRIPTION_PARAM_OFFSET);
61434
61435
  Buffer.from(emailAddress.substr(0, 40), "utf-8").copy(paramBuf, HOST_EMAIL_ADDRESS_PARAM_OFFSET);
61436
+ paramBuf.writeBigInt64LE(XflHelpers.getXfl(leaseAmount.toString()), HOST_LEASE_AMOUNT_PARAM_OFFSET);
61435
61437
 
61436
61438
  const tx = await this.#submitWithRetry(async (feeUplift, submissionRef) => {
61437
61439
  return await this.xrplAcc.makePayment(this.config.registryAddress,
@@ -61442,7 +61444,7 @@ class HostClient extends BaseEvernodeClient {
61442
61444
  {
61443
61445
  hookParams: [
61444
61446
  { name: HookParamKeys.PARAM_EVENT_TYPE_KEY, value: EventTypes.HOST_REG },
61445
- { name: HookParamKeys.PARAM_EVENT_DATA1_KEY, value: paramBuf.toString('hex').toUpperCase() }
61447
+ { name: HookParamKeys.PARAM_EVENT_DATA_KEY, value: paramBuf.toString('hex').toUpperCase() }
61446
61448
  ],
61447
61449
  maxLedgerIndex: this.#getMaxLedgerSequence(),
61448
61450
  feeUplift: feeUplift, submissionRef: submissionRef,
@@ -61520,7 +61522,7 @@ class HostClient extends BaseEvernodeClient {
61520
61522
  {
61521
61523
  hookParams: [
61522
61524
  { name: HookParamKeys.PARAM_EVENT_TYPE_KEY, value: EventTypes.HOST_DEREG },
61523
- { name: HookParamKeys.PARAM_EVENT_DATA1_KEY, value: paramBuf.toString('hex').toUpperCase() }
61525
+ { name: HookParamKeys.PARAM_EVENT_DATA_KEY, value: paramBuf.toString('hex').toUpperCase() }
61524
61526
  ],
61525
61527
  maxLedgerIndex: this.#getMaxLedgerSequence(),
61526
61528
  feeUplift: feeUplift, submissionRef: submissionRef,
@@ -61543,10 +61545,11 @@ class HostClient extends BaseEvernodeClient {
61543
61545
  * @param {number} diskMb Disk size in mega bytes.
61544
61546
  * @param {string} description Description about the host.
61545
61547
  * @param {string} emailAddress Email address of the host.
61548
+ * @param {number} leaseAmount Lease fee of the host.
61546
61549
  * @param {*} options [Optional] transaction options.
61547
61550
  * @returns Transaction result.
61548
61551
  */
61549
- async updateRegInfo(activeInstanceCount = null, version = null, totalInstanceCount = null, tokenID = null, countryCode = null, cpuMicroSec = null, ramMb = null, diskMb = null, description = null, emailAddress = null, options = {}) {
61552
+ async updateRegInfo(activeInstanceCount = null, version = null, totalInstanceCount = null, tokenID = null, countryCode = null, cpuMicroSec = null, ramMb = null, diskMb = null, description = null, emailAddress = null, leaseAmount = null, options = {}) {
61550
61553
  // <token_id(32)><country_code(2)><cpu_microsec(4)><ram_mb(4)><disk_mb(4)><total_instance_count(4)><active_instances(4)><description(26)><version(3)><email(40)>
61551
61554
  const paramBuf = Buffer.alloc(HOST_UPDATE_PARAM_SIZE, 0);
61552
61555
  if (tokenID)
@@ -61575,6 +61578,8 @@ class HostClient extends BaseEvernodeClient {
61575
61578
  paramBuf.writeUInt8(components[1], HOST_UPDATE_VERSION_PARAM_OFFSET + 1);
61576
61579
  paramBuf.writeUInt8(components[2], HOST_UPDATE_VERSION_PARAM_OFFSET + 2);
61577
61580
  }
61581
+ if (leaseAmount)
61582
+ paramBuf.writeBigInt64LE(XflHelpers.getXfl(leaseAmount.toString()), HOST_UPDATE_LEASE_AMOUNT_PARAM_OFFSET);
61578
61583
 
61579
61584
  return await this.#submitWithRetry(async (feeUplift, submissionRef) => {
61580
61585
  return await this.xrplAcc.makePayment(this.config.registryAddress,
@@ -61585,7 +61590,7 @@ class HostClient extends BaseEvernodeClient {
61585
61590
  {
61586
61591
  hookParams: [
61587
61592
  { name: HookParamKeys.PARAM_EVENT_TYPE_KEY, value: EventTypes.HOST_UPDATE_INFO },
61588
- { name: HookParamKeys.PARAM_EVENT_DATA1_KEY, value: paramBuf.toString('hex') }
61593
+ { name: HookParamKeys.PARAM_EVENT_DATA_KEY, value: paramBuf.toString('hex') }
61589
61594
  ],
61590
61595
  maxLedgerIndex: this.#getMaxLedgerSequence(),
61591
61596
  feeUplift: feeUplift, submissionRef: submissionRef,
@@ -61626,7 +61631,7 @@ class HostClient extends BaseEvernodeClient {
61626
61631
  {
61627
61632
  hookParams: [
61628
61633
  { name: HookParamKeys.PARAM_EVENT_TYPE_KEY, value: EventTypes.HEARTBEAT },
61629
- ...(data ? [{ name: HookParamKeys.PARAM_EVENT_DATA1_KEY, value: data }] : [])
61634
+ ...(data ? [{ name: HookParamKeys.PARAM_EVENT_DATA_KEY, value: data }] : [])
61630
61635
  ],
61631
61636
  maxLedgerIndex: this.#getMaxLedgerSequence(),
61632
61637
  ...options.transactionOptions,
@@ -61694,7 +61699,7 @@ class HostClient extends BaseEvernodeClient {
61694
61699
  {
61695
61700
  hookParams: [
61696
61701
  { name: HookParamKeys.PARAM_EVENT_TYPE_KEY, value: EventTypes.ACQUIRE_SUCCESS },
61697
- { name: HookParamKeys.PARAM_EVENT_DATA1_KEY, value: txHash }
61702
+ { name: HookParamKeys.PARAM_EVENT_DATA_KEY, value: txHash }
61698
61703
  ],
61699
61704
  maxLedgerIndex: this.#getMaxLedgerSequence(),
61700
61705
  ...options.transactionOptions,
@@ -61723,7 +61728,7 @@ class HostClient extends BaseEvernodeClient {
61723
61728
  {
61724
61729
  hookParams: [
61725
61730
  { name: HookParamKeys.PARAM_EVENT_TYPE_KEY, value: EventTypes.ACQUIRE_ERROR },
61726
- { name: HookParamKeys.PARAM_EVENT_DATA1_KEY, value: txHash }
61731
+ { name: HookParamKeys.PARAM_EVENT_DATA_KEY, value: txHash }
61727
61732
  ],
61728
61733
  maxLedgerIndex: this.#getMaxLedgerSequence(),
61729
61734
  ...options.transactionOptions,
@@ -61753,7 +61758,7 @@ class HostClient extends BaseEvernodeClient {
61753
61758
  {
61754
61759
  hookParams: [
61755
61760
  { name: HookParamKeys.PARAM_EVENT_TYPE_KEY, value: EventTypes.EXTEND_SUCCESS },
61756
- { name: HookParamKeys.PARAM_EVENT_DATA1_KEY, value: txHash }
61761
+ { name: HookParamKeys.PARAM_EVENT_DATA_KEY, value: txHash }
61757
61762
  ],
61758
61763
  maxLedgerIndex: this.#getMaxLedgerSequence(),
61759
61764
  ...options.transactionOptions,
@@ -61783,7 +61788,7 @@ class HostClient extends BaseEvernodeClient {
61783
61788
  {
61784
61789
  hookParams: [
61785
61790
  { name: HookParamKeys.PARAM_EVENT_TYPE_KEY, value: EventTypes.EXTEND_ERROR },
61786
- { name: HookParamKeys.PARAM_EVENT_DATA1_KEY, value: txHash }
61791
+ { name: HookParamKeys.PARAM_EVENT_DATA_KEY, value: txHash }
61787
61792
  ],
61788
61793
  maxLedgerIndex: this.#getMaxLedgerSequence(),
61789
61794
  ...options.transactionOptions,
@@ -61810,7 +61815,7 @@ class HostClient extends BaseEvernodeClient {
61810
61815
  {
61811
61816
  hookParams: [
61812
61817
  { name: HookParamKeys.PARAM_EVENT_TYPE_KEY, value: EventTypes.REFUND },
61813
- { name: HookParamKeys.PARAM_EVENT_DATA1_KEY, value: txHash }
61818
+ { name: HookParamKeys.PARAM_EVENT_DATA_KEY, value: txHash }
61814
61819
  ],
61815
61820
  maxLedgerIndex: this.#getMaxLedgerSequence(),
61816
61821
  ...options.transactionOptions,
@@ -61873,7 +61878,7 @@ class HostClient extends BaseEvernodeClient {
61873
61878
  {
61874
61879
  hookParams: [
61875
61880
  { name: HookParamKeys.PARAM_EVENT_TYPE_KEY, value: EventTypes.HOST_TRANSFER },
61876
- { name: HookParamKeys.PARAM_EVENT_DATA1_KEY, value: paramData.toString('hex') }
61881
+ { name: HookParamKeys.PARAM_EVENT_DATA_KEY, value: paramData.toString('hex') }
61877
61882
  ],
61878
61883
  maxLedgerIndex: this.#getMaxLedgerSequence(),
61879
61884
  feeUplift: feeUplift, submissionRef: submissionRef,
@@ -62212,7 +62217,7 @@ class TenantClient extends BaseEvernodeClient {
62212
62217
  {
62213
62218
  hookParams: [
62214
62219
  { name: HookParamKeys.PARAM_EVENT_TYPE_KEY, value: EventTypes.EXTEND_LEASE },
62215
- { name: HookParamKeys.PARAM_EVENT_DATA1_KEY, value: tokenID }
62220
+ { name: HookParamKeys.PARAM_EVENT_DATA_KEY, value: tokenID }
62216
62221
  ],
62217
62222
  ...options.transactionOptions
62218
62223
  });
@@ -62943,8 +62948,7 @@ const HookStateKeys = {
62943
62948
  const HookParamKeys = {
62944
62949
  PARAM_STATE_HOOK_KEY: "4556520100000000000000000000000000000000000000000000000000000001",
62945
62950
  PARAM_EVENT_TYPE_KEY: "4556520100000000000000000000000000000000000000000000000000000002",
62946
- PARAM_EVENT_DATA1_KEY: "4556520100000000000000000000000000000000000000000000000000000003",
62947
- PARAM_EVENT_DATA2_KEY: "4556520100000000000000000000000000000000000000000000000000000004",
62951
+ PARAM_EVENT_DATA_KEY: "4556520100000000000000000000000000000000000000000000000000000003",
62948
62952
  }
62949
62953
 
62950
62954
  const EvernodeEvents = {
@@ -63187,6 +63191,7 @@ const SAVED_MOMENT_OFFSET = 1;
63187
63191
  const PREV_MOMENT_ACTIVE_HOST_COUNT_OFFSET = 5;
63188
63192
  const CUR_MOMENT_ACTIVE_HOST_COUNT_OFFSET = 9;
63189
63193
  const EPOCH_POOL_OFFSET = 13;
63194
+ const HOST_MAX_LEASE_AMOUNT_OFFSET = 21;
63190
63195
 
63191
63196
  const EPOCH_COUNT_OFFSET = 0;
63192
63197
  const FIRST_EPOCH_REWARD_QUOTA_OFFSET = 1;
@@ -63194,6 +63199,7 @@ const EPOCH_REWARD_AMOUNT_OFFSET = 5;
63194
63199
  const REWARD_START_MOMENT_OFFSET = 9;
63195
63200
  const ACCUMULATED_REWARD_FREQUENCY_OFFSET = 13;
63196
63201
  const HOST_REPUTATION_THRESHOLD_OFFSET = 15;
63202
+ const HOST_MIN_INSTANCE_COUNT_OFFSET = 16;
63197
63203
 
63198
63204
  const TRANSIT_IDX_OFFSET = 0;
63199
63205
  const TRANSIT_MOMENT_SIZE_OFFSET = 8;
@@ -63241,6 +63247,7 @@ const HOST_SUPPORT_VOTE_FLAG_OFFSET = 124;
63241
63247
  const HOST_REPUTATION_OFFSET = 125;
63242
63248
  const HOST_FLAGS_OFFSET = 126;
63243
63249
  const HOST_TRANSFER_TIMESTAMP_OFFSET = 127;
63250
+ const HOST_LEASE_AMOUNT_OFFSET = 135;
63244
63251
 
63245
63252
  const HOST_ADDRESS_OFFSET = 0;
63246
63253
  const HOST_CPU_MODEL_NAME_OFFSET = 20;
@@ -63355,6 +63362,10 @@ class StateHelpers {
63355
63362
  if (stateDataBuf.length > HOST_TRANSFER_TIMESTAMP_OFFSET) {
63356
63363
  data.transferTimestamp = Number(stateDataBuf.readBigUInt64LE(HOST_TRANSFER_TIMESTAMP_OFFSET));
63357
63364
  }
63365
+ if (stateDataBuf.length > HOST_LEASE_AMOUNT_OFFSET) {
63366
+ data.leaseAmount = XflHelpers.toString(stateDataBuf.readBigInt64LE(HOST_LEASE_AMOUNT_OFFSET));
63367
+
63368
+ }
63358
63369
  return data;
63359
63370
  }
63360
63371
 
@@ -63552,6 +63563,8 @@ class StateHelpers {
63552
63563
  };
63553
63564
  if (stateData.length > HOST_REPUTATION_THRESHOLD_OFFSET)
63554
63565
  value.hostReputationThreshold = stateData.readUInt8(HOST_REPUTATION_THRESHOLD_OFFSET);
63566
+ if (stateData.length > HOST_MIN_INSTANCE_COUNT_OFFSET)
63567
+ value.hostMinInstanceCount = stateData.readUInt32LE(HOST_MIN_INSTANCE_COUNT_OFFSET);
63555
63568
  return {
63556
63569
  type: this.StateTypes.CONFIGURATION,
63557
63570
  key: hexKey,
@@ -63567,7 +63580,8 @@ class StateHelpers {
63567
63580
  savedMoment: stateData.readUInt32LE(SAVED_MOMENT_OFFSET),
63568
63581
  prevMomentActiveHostCount: stateData.readUInt32LE(PREV_MOMENT_ACTIVE_HOST_COUNT_OFFSET),
63569
63582
  curMomentActiveHostCount: stateData.readUInt32LE(CUR_MOMENT_ACTIVE_HOST_COUNT_OFFSET),
63570
- epochPool: XflHelpers.toString(stateData.readBigInt64LE(EPOCH_POOL_OFFSET))
63583
+ epochPool: XflHelpers.toString(stateData.readBigInt64LE(EPOCH_POOL_OFFSET)),
63584
+ hostMaxLeaseAmount: XflHelpers.toString(stateData.readBigInt64LE(HOST_MAX_LEASE_AMOUNT_OFFSET))
63571
63585
  }
63572
63586
  }
63573
63587
  }
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  ],
7
7
  "homepage": "https://github.com/HotPocketDev/evernode-js-client",
8
8
  "license": "SEE LICENSE IN https://raw.githubusercontent.com/EvernodeXRPL/evernode-resources/main/license/evernode-license.pdf",
9
- "version": "0.6.38",
9
+ "version": "0.6.39",
10
10
  "dependencies": {
11
11
  "elliptic": "6.5.4",
12
12
  "libsodium-wrappers": "0.7.10",
Binary file
Binary file