evernode-js-client 0.6.26 → 0.6.28

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +10 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -53369,7 +53369,7 @@ class HostClient extends BaseEvernodeClient {
53369
53369
  this.xrplAcc.getDomain()]);
53370
53370
 
53371
53371
  let accountSetFields = {};
53372
- accountSetFields = (!flags.lsfDefaultRipple) ? { ...accountSetFields, Flags: { asfDefaultRipple: true } } : accountSetFields;
53372
+ accountSetFields = (flags.lsfDefaultRipple) ? { ...accountSetFields, Flags: { asfDefaultRipple: false } } : accountSetFields;
53373
53373
  accountSetFields = (!msgKey) ? { ...accountSetFields, MessageKey: this.accKeyPair.publicKey } : accountSetFields;
53374
53374
 
53375
53375
  domain = domain.toLowerCase();
@@ -53632,15 +53632,22 @@ class HostClient extends BaseEvernodeClient {
53632
53632
 
53633
53633
  /**
53634
53634
  * Deregister a host from the Evernode network.
53635
+ * @param {string} error [Optional] Error.
53635
53636
  * @param {*} options [Optional] transaction options.
53636
53637
  * @returns Boolean whether host is registered or not.
53637
53638
  */
53638
- async deregister(options = {}) {
53639
+ async deregister(error = null, options = {}) {
53639
53640
 
53640
53641
  if (!(await this.isRegistered()))
53641
53642
  throw "Host not registered."
53642
53643
 
53643
53644
  const regUriToken = await this.getRegistrationUriToken();
53645
+ const paramBuf = Buffer.alloc(33, 0);
53646
+ Buffer.from(regUriToken.index, "hex").copy(paramBuf, 0);
53647
+ if (error) {
53648
+ // <token_id(32)><error(1)>
53649
+ paramBuf.writeUInt8(1, 32);
53650
+ }
53644
53651
 
53645
53652
  await this.xrplAcc.makePayment(this.config.registryAddress,
53646
53653
  XrplConstants.MIN_DROPS,
@@ -53650,7 +53657,7 @@ class HostClient extends BaseEvernodeClient {
53650
53657
  {
53651
53658
  hookParams: [
53652
53659
  { name: HookParamKeys.PARAM_EVENT_TYPE_KEY, value: EventTypes.HOST_DEREG },
53653
- { name: HookParamKeys.PARAM_EVENT_DATA1_KEY, value: regUriToken.index }
53660
+ { name: HookParamKeys.PARAM_EVENT_DATA1_KEY, value: paramBuf.toString('hex').toUpperCase() }
53654
53661
  ],
53655
53662
  ...options.transactionOptions
53656
53663
  });
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.26",
9
+ "version": "0.6.28",
10
10
  "dependencies": {
11
11
  "elliptic": "6.5.4",
12
12
  "libsodium-wrappers": "0.7.10",