evernode-js-client 0.6.21-definition-1.7 → 0.6.21-definition-1.9
Sign up to get free protection for your applications and to get access to all the features.
package/index.js
CHANGED
@@ -9149,7 +9149,7 @@ module.exports = { mask, unmask };
|
|
9149
9149
|
|
9150
9150
|
|
9151
9151
|
try {
|
9152
|
-
module.exports = require(__nccwpck_require__.ab + "prebuilds/linux-x64/node.
|
9152
|
+
module.exports = require(__nccwpck_require__.ab + "prebuilds/linux-x64/node.napi1.node");
|
9153
9153
|
} catch (e) {
|
9154
9154
|
module.exports = __nccwpck_require__(2567);
|
9155
9155
|
}
|
@@ -33340,7 +33340,7 @@ module.exports = isValidUTF8;
|
|
33340
33340
|
|
33341
33341
|
|
33342
33342
|
try {
|
33343
|
-
module.exports = require(__nccwpck_require__.ab + "prebuilds/linux-x64/node.
|
33343
|
+
module.exports = require(__nccwpck_require__.ab + "prebuilds/linux-x64/node.napi.node");
|
33344
33344
|
} catch (e) {
|
33345
33345
|
module.exports = __nccwpck_require__(9372);
|
33346
33346
|
}
|
@@ -52626,8 +52626,8 @@ class BaseEvernodeClient {
|
|
52626
52626
|
|
52627
52627
|
if (validPrune) {
|
52628
52628
|
await this.xrplAcc.makePayment(this.config.registryAddress,
|
52629
|
-
XrplConstants.
|
52630
|
-
|
52629
|
+
XrplConstants.MIN_DROPS,
|
52630
|
+
null,
|
52631
52631
|
null,
|
52632
52632
|
null,
|
52633
52633
|
{
|
@@ -52846,8 +52846,8 @@ class BaseEvernodeClient {
|
|
52846
52846
|
async _withdraw(candidateId, options = {}) {
|
52847
52847
|
const candidateIdBuf = Buffer.from(candidateId, 'hex');
|
52848
52848
|
return await this.xrplAcc.makePayment(this.governorAddress,
|
52849
|
-
XrplConstants.
|
52850
|
-
|
52849
|
+
XrplConstants.MIN_DROPS,
|
52850
|
+
null,
|
52851
52851
|
null,
|
52852
52852
|
null,
|
52853
52853
|
{
|
@@ -52962,8 +52962,8 @@ class FoundationClient extends BaseEvernodeClient {
|
|
52962
52962
|
voteBuf.writeUInt8(vote, CANDIDATE_VOTE_VALUE_PARAM_OFFSET);
|
52963
52963
|
|
52964
52964
|
return await this.xrplAcc.makePayment(this.config.heartbeatAddress,
|
52965
|
-
XrplConstants.
|
52966
|
-
|
52965
|
+
XrplConstants.MIN_DROPS,
|
52966
|
+
null,
|
52967
52967
|
null,
|
52968
52968
|
null,
|
52969
52969
|
{
|
@@ -53031,8 +53031,8 @@ class FoundationClient extends BaseEvernodeClient {
|
|
53031
53031
|
modeBuf.writeUInt8(mode);
|
53032
53032
|
|
53033
53033
|
return await this.xrplAcc.makePayment(this.governorAddress,
|
53034
|
-
XrplConstants.
|
53035
|
-
|
53034
|
+
XrplConstants.MIN_DROPS,
|
53035
|
+
null,
|
53036
53036
|
null,
|
53037
53037
|
null,
|
53038
53038
|
{
|
@@ -53060,8 +53060,8 @@ class FoundationClient extends BaseEvernodeClient {
|
|
53060
53060
|
reputationBuf.writeUInt8(reputation, REPUTATION_VALUE_PARAM_OFFSET)
|
53061
53061
|
|
53062
53062
|
return await this.xrplAcc.makePayment(this.config.registryAddress,
|
53063
|
-
XrplConstants.
|
53064
|
-
|
53063
|
+
XrplConstants.MIN_DROPS,
|
53064
|
+
null,
|
53065
53065
|
null,
|
53066
53066
|
null,
|
53067
53067
|
{
|
@@ -53642,8 +53642,8 @@ class HostClient extends BaseEvernodeClient {
|
|
53642
53642
|
const regUriToken = await this.getRegistrationUriToken();
|
53643
53643
|
|
53644
53644
|
await this.xrplAcc.makePayment(this.config.registryAddress,
|
53645
|
-
XrplConstants.
|
53646
|
-
|
53645
|
+
XrplConstants.MIN_DROPS,
|
53646
|
+
null,
|
53647
53647
|
null,
|
53648
53648
|
null,
|
53649
53649
|
{
|
@@ -53703,8 +53703,8 @@ class HostClient extends BaseEvernodeClient {
|
|
53703
53703
|
}
|
53704
53704
|
|
53705
53705
|
return await this.xrplAcc.makePayment(this.config.registryAddress,
|
53706
|
-
XrplConstants.
|
53707
|
-
|
53706
|
+
XrplConstants.MIN_DROPS,
|
53707
|
+
null,
|
53708
53708
|
null,
|
53709
53709
|
null,
|
53710
53710
|
{
|
@@ -53734,8 +53734,8 @@ class HostClient extends BaseEvernodeClient {
|
|
53734
53734
|
|
53735
53735
|
try {
|
53736
53736
|
const res = await this.xrplAcc.makePayment(this.config.heartbeatAddress,
|
53737
|
-
XrplConstants.
|
53738
|
-
|
53737
|
+
XrplConstants.MIN_DROPS,
|
53738
|
+
null,
|
53739
53739
|
null,
|
53740
53740
|
null,
|
53741
53741
|
{
|
@@ -53798,8 +53798,8 @@ class HostClient extends BaseEvernodeClient {
|
|
53798
53798
|
}
|
53799
53799
|
|
53800
53800
|
return this.xrplAcc.makePayment(tenantAddress,
|
53801
|
-
XrplConstants.
|
53802
|
-
|
53801
|
+
XrplConstants.MIN_DROPS,
|
53802
|
+
null,
|
53803
53803
|
null,
|
53804
53804
|
[
|
53805
53805
|
{ type: EventTypes.ACQUIRE_SUCCESS, format: MemoFormats.BASE64, data: data }
|
@@ -53853,8 +53853,8 @@ class HostClient extends BaseEvernodeClient {
|
|
53853
53853
|
buf.writeUInt32BE(expiryMoment);
|
53854
53854
|
|
53855
53855
|
return this.xrplAcc.makePayment(tenantAddress,
|
53856
|
-
XrplConstants.
|
53857
|
-
|
53856
|
+
XrplConstants.MIN_DROPS,
|
53857
|
+
null,
|
53858
53858
|
null,
|
53859
53859
|
[
|
53860
53860
|
{ type: EventTypes.EXTEND_SUCCESS, format: MemoFormats.HEX, data: buf.toString('hex') }
|
@@ -53928,8 +53928,8 @@ class HostClient extends BaseEvernodeClient {
|
|
53928
53928
|
*/
|
53929
53929
|
async requestRebate(options = {}) {
|
53930
53930
|
return this.xrplAcc.makePayment(this.config.registryAddress,
|
53931
|
-
XrplConstants.
|
53932
|
-
|
53931
|
+
XrplConstants.MIN_DROPS,
|
53932
|
+
null,
|
53933
53933
|
null,
|
53934
53934
|
[
|
53935
53935
|
{ type: EventTypes.HOST_REBATE, format: "", data: "" }
|
@@ -53965,8 +53965,8 @@ class HostClient extends BaseEvernodeClient {
|
|
53965
53965
|
const regUriToken = await this.getRegistrationUriToken();
|
53966
53966
|
|
53967
53967
|
await this.xrplAcc.sellURIToken(regUriToken.index,
|
53968
|
-
XrplConstants.
|
53969
|
-
|
53968
|
+
XrplConstants.MIN_DROPS,
|
53969
|
+
null,
|
53970
53970
|
null,
|
53971
53971
|
this.config.registryAddress,
|
53972
53972
|
null,
|
@@ -54099,7 +54099,7 @@ class TenantClient extends BaseEvernodeClient {
|
|
54099
54099
|
async getLeaseHost(hostAddress) {
|
54100
54100
|
const host = new XrplAccount(hostAddress, null, { xrplApi: this.xrplApi });
|
54101
54101
|
// Find an owned URI token with matching Evernode host NFT prefix.
|
54102
|
-
const uriToken = (await host.getURITokens()).find(n => n.URI.startsWith(EvernodeConstants.TOKEN_PREFIX_HEX));
|
54102
|
+
const uriToken = (await host.getURITokens()).find(n => n.URI.startsWith(EvernodeConstants.TOKEN_PREFIX_HEX) && n.Issuer === this.config.registryAddress);
|
54103
54103
|
if (!uriToken)
|
54104
54104
|
throw { reason: ErrorReasons.HOST_INVALID, error: "Host is not registered." };
|
54105
54105
|
|
@@ -54407,7 +54407,7 @@ module.exports = {
|
|
54407
54407
|
/***/ 8262:
|
54408
54408
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
54409
54409
|
|
54410
|
-
const
|
54410
|
+
const definitions = __nccwpck_require__(4626);
|
54411
54411
|
|
54412
54412
|
const DefaultValues = {
|
54413
54413
|
xrplApi: null,
|
@@ -54431,8 +54431,6 @@ class Defaults {
|
|
54431
54431
|
* @param {string} network Network to choose the info.
|
54432
54432
|
*/
|
54433
54433
|
static useNetwork(network) {
|
54434
|
-
const definitions = __nccwpck_require__(4626);
|
54435
|
-
|
54436
54434
|
if (!definitions[network])
|
54437
54435
|
throw `Invalid network: ${network}`;
|
54438
54436
|
|
@@ -55083,7 +55081,6 @@ module.exports = {
|
|
55083
55081
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
55084
55082
|
|
55085
55083
|
const { EvernodeConstants, URITokenTypes } = __nccwpck_require__(9849);
|
55086
|
-
const { UtilHelpers } = __nccwpck_require__(6687);
|
55087
55084
|
const { TransactionHelper } = __nccwpck_require__(7071);
|
55088
55085
|
|
55089
55086
|
const NFT_PAGE_LEDGER_ENTRY_TYPE_HEX = '0050';
|
@@ -56771,12 +56768,12 @@ class XrplAccount {
|
|
56771
56768
|
return await this.#prepareSubmissionTransaction(signerListTx, options);
|
56772
56769
|
}
|
56773
56770
|
|
56774
|
-
async makePayment(toAddr, amount, currency, issuer = null, memos = null, options = {}) {
|
56771
|
+
async makePayment(toAddr, amount, currency = null, issuer = null, memos = null, options = {}) {
|
56775
56772
|
const preparedTxn = await this.prepareMakePayment(toAddr, amount, currency, issuer, memos, options);
|
56776
56773
|
return await this.signAndSubmit(preparedTxn);
|
56777
56774
|
}
|
56778
56775
|
|
56779
|
-
async prepareMakePayment(toAddr, amount, currency, issuer = null, memos = null, options = {}) {
|
56776
|
+
async prepareMakePayment(toAddr, amount, currency = null, issuer = null, memos = null, options = {}) {
|
56780
56777
|
|
56781
56778
|
const amountObj = makeAmountObject(amount, currency, issuer);
|
56782
56779
|
|
@@ -57309,13 +57306,11 @@ class XrplAccount {
|
|
57309
57306
|
}
|
57310
57307
|
}
|
57311
57308
|
|
57312
|
-
function makeAmountObject(amount, currency, issuer) {
|
57309
|
+
function makeAmountObject(amount, currency = null, issuer = null) {
|
57313
57310
|
if (typeof amount !== 'string')
|
57314
57311
|
throw "Amount must be a string.";
|
57315
|
-
if (currency !== XrplConstants.XRP && !issuer)
|
57316
|
-
throw "Non-XRP currency must have an issuer.";
|
57317
57312
|
|
57318
|
-
const amountObj =
|
57313
|
+
const amountObj = !issuer ? amount : {
|
57319
57314
|
currency: currency,
|
57320
57315
|
issuer: issuer,
|
57321
57316
|
value: amount
|
@@ -57940,7 +57935,9 @@ const XrplApiEvents = {
|
|
57940
57935
|
const XrplConstants = {
|
57941
57936
|
MAX_LEDGER_OFFSET: 10,
|
57942
57937
|
XRP: 'XRP',
|
57943
|
-
|
57938
|
+
XAH: 'XAH',
|
57939
|
+
MIN_XRP_AMOUNT: '1', // drops - deprecated
|
57940
|
+
MIN_DROPS: '1'
|
57944
57941
|
}
|
57945
57942
|
|
57946
57943
|
const XrplTransactionTypes = {
|
package/package.json
CHANGED
Binary file
|
Binary file
|