@bithomp/xrpl-api 3.0.8 → 3.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.
- package/lib/base58.d.ts +0 -1
- package/lib/base58.js +2 -3
- package/lib/client.js +6 -6
- package/lib/common/utils.js +9 -10
- package/lib/connection.d.ts +0 -1
- package/lib/faucet.js +5 -5
- package/lib/ledger/account_info.js +3 -4
- package/lib/ledger/account_lines.js +1 -2
- package/lib/ledger/account_namespace.js +1 -2
- package/lib/ledger/account_nfts.js +4 -5
- package/lib/ledger/account_objects.js +5 -6
- package/lib/ledger/account_offers.js +2 -3
- package/lib/ledger/account_tx.js +2 -3
- package/lib/ledger/amm_info.js +2 -3
- package/lib/ledger/book_offers.js +2 -3
- package/lib/ledger/currency.js +1 -2
- package/lib/ledger/fee.js +1 -2
- package/lib/ledger/gateway_balances.js +2 -3
- package/lib/ledger/ledger.js +2 -3
- package/lib/ledger/ledger_entry.js +4 -4
- package/lib/ledger/manifest.js +1 -2
- package/lib/ledger/nft_info.js +1 -2
- package/lib/ledger/server_definitions.js +1 -2
- package/lib/ledger/server_info.js +1 -2
- package/lib/ledger/transaction.js +6 -7
- package/lib/ledger/vl-v2.js +2 -3
- package/lib/ledger/vl.js +3 -4
- package/lib/models/account_info.js +5 -5
- package/lib/models/account_nfts.js +4 -5
- package/lib/models/account_object.js +3 -4
- package/lib/models/book_offers.js +1 -2
- package/lib/models/ledger.js +5 -5
- package/lib/models/manifest.d.ts +0 -1
- package/lib/models/manifest.js +3 -4
- package/lib/models/transaction.js +10 -11
- package/lib/models/vl.js +4 -5
- package/lib/parse/ledger/account-order.js +1 -2
- package/lib/parse/ledger/account.js +1 -2
- package/lib/parse/ledger/emit_details.js +1 -2
- package/lib/parse/ledger/flags.js +1 -2
- package/lib/parse/ledger/genesis-mints.d.ts +2 -0
- package/lib/parse/ledger/genesis-mints.js +17 -0
- package/lib/parse/ledger/import.js +1 -2
- package/lib/parse/ledger/ledger.js +1 -2
- package/lib/parse/ledger/memos.js +2 -3
- package/lib/parse/ledger/orderbook-order.js +1 -2
- package/lib/parse/outcome/affected_objects.js +1 -2
- package/lib/parse/outcome/amm_changes.js +1 -2
- package/lib/parse/outcome/balance_changes.js +2 -3
- package/lib/parse/outcome/channel_changes.js +1 -2
- package/lib/parse/outcome/emitted_txns.js +1 -2
- package/lib/parse/outcome/escrow_changes.js +1 -2
- package/lib/parse/outcome/hooks_executions.js +1 -2
- package/lib/parse/outcome/locked_balance_changes.js +2 -3
- package/lib/parse/outcome/nftoken_changes.js +1 -2
- package/lib/parse/outcome/nftoken_offer_changes.js +1 -2
- package/lib/parse/outcome/orderbook_changes.js +1 -2
- package/lib/parse/outcome/orderbook_quality.js +1 -2
- package/lib/parse/outcome/unl_report_changes.js +1 -2
- package/lib/parse/outcome/uritoken_changes.js +1 -2
- package/lib/parse/outcome/uritoken_sell_offer_changes.js +1 -2
- package/lib/parse/outcome.js +1 -2
- package/lib/parse/specification/account-delete.js +2 -0
- package/lib/parse/specification/amendment.js +27 -0
- package/lib/parse/specification/amm-bid.js +3 -1
- package/lib/parse/specification/amm-create.js +3 -1
- package/lib/parse/specification/amm-delete.js +3 -1
- package/lib/parse/specification/amm-deposit.js +3 -1
- package/lib/parse/specification/amm-vote.js +3 -1
- package/lib/parse/specification/amm-withdraw.js +3 -1
- package/lib/parse/specification/check-cancel.js +3 -1
- package/lib/parse/specification/check-cash.js +3 -1
- package/lib/parse/specification/check-create.js +3 -1
- package/lib/parse/specification/clawback.js +3 -1
- package/lib/parse/specification/deposit-preauth.js +3 -1
- package/lib/parse/specification/escrow-cancel.js +2 -0
- package/lib/parse/specification/escrow-create.js +2 -0
- package/lib/parse/specification/escrow-finish.js +2 -0
- package/lib/parse/specification/fee-update.js +3 -1
- package/lib/parse/specification/genesis-mint.d.ts +3 -0
- package/lib/parse/specification/genesis-mint.js +39 -0
- package/lib/parse/specification/import.js +2 -0
- package/lib/parse/specification/invoke.js +2 -0
- package/lib/parse/specification/nftoken-accept-offer.js +2 -0
- package/lib/parse/specification/nftoken-burn.js +2 -0
- package/lib/parse/specification/nftoken-cancel-offer.js +2 -0
- package/lib/parse/specification/nftoken-create-offer.js +2 -0
- package/lib/parse/specification/nftoken-mint.js +2 -0
- package/lib/parse/specification/offer-cancel.js +3 -1
- package/lib/parse/specification/offer-create.js +3 -1
- package/lib/parse/specification/payment-channel-claim.js +3 -1
- package/lib/parse/specification/payment-channel-create.js +3 -1
- package/lib/parse/specification/payment-channel-fund.js +3 -1
- package/lib/parse/specification/payment.js +3 -1
- package/lib/parse/specification/remit.js +2 -0
- package/lib/parse/specification/settings.js +2 -0
- package/lib/parse/specification/ticket-create.js +3 -1
- package/lib/parse/specification/trustline.js +3 -1
- package/lib/parse/specification/unl-report.js +2 -0
- package/lib/parse/specification/uritoken-burn.js +2 -0
- package/lib/parse/specification/uritoken-buy.js +2 -0
- package/lib/parse/specification/uritoken-cancel-sell-offer.js +2 -0
- package/lib/parse/specification/uritoken-create-sell-offer.js +2 -0
- package/lib/parse/specification/uritoken-mint.js +2 -3
- package/lib/parse/transaction.d.ts +2 -1
- package/lib/parse/transaction.js +5 -3
- package/lib/parse/utils.d.ts +0 -1
- package/lib/parse/utils.js +12 -13
- package/lib/types/genesis_mint.d.ts +9 -0
- package/lib/types/genesis_mint.js +2 -0
- package/lib/types/specification.d.ts +2 -0
- package/lib/v1/transaction/payment.js +1 -2
- package/lib/v1/utils.js +2 -3
- package/lib/validator.d.ts +0 -1
- package/lib/validator.js +5 -6
- package/lib/wallet.d.ts +0 -1
- package/lib/wallet.js +9 -9
- package/package.json +8 -8
|
@@ -28,6 +28,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
const assert = __importStar(require("assert"));
|
|
30
30
|
const common_1 = require("../../common");
|
|
31
|
+
const emit_details_1 = require("../ledger/emit_details");
|
|
31
32
|
const memos_1 = require("../ledger/memos");
|
|
32
33
|
const nftoken_offer_flags_1 = __importDefault(require("../ledger/nftoken-offer-flags"));
|
|
33
34
|
const ledger_1 = require("../../models/ledger");
|
|
@@ -53,6 +54,7 @@ function parseNFTokenCreateOffer(tx) {
|
|
|
53
54
|
destination: Object.keys(destination).length > 0 ? destination : undefined,
|
|
54
55
|
expiration,
|
|
55
56
|
flags: (0, nftoken_offer_flags_1.default)(tx.Flags),
|
|
57
|
+
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
56
58
|
memos: (0, memos_1.parseMemos)(tx),
|
|
57
59
|
});
|
|
58
60
|
}
|
|
@@ -28,6 +28,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
const assert = __importStar(require("assert"));
|
|
30
30
|
const common_1 = require("../../common");
|
|
31
|
+
const emit_details_1 = require("../ledger/emit_details");
|
|
31
32
|
const memos_1 = require("../ledger/memos");
|
|
32
33
|
const nftoken_flags_1 = __importDefault(require("../ledger/nftoken-flags"));
|
|
33
34
|
function parseNFTokenMint(tx) {
|
|
@@ -38,6 +39,7 @@ function parseNFTokenMint(tx) {
|
|
|
38
39
|
transferFee: tx.TransferFee,
|
|
39
40
|
uri: tx.URI,
|
|
40
41
|
flags: (0, nftoken_flags_1.default)(tx.Flags),
|
|
42
|
+
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
41
43
|
memos: (0, memos_1.parseMemos)(tx),
|
|
42
44
|
});
|
|
43
45
|
}
|
|
@@ -24,12 +24,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
const assert = __importStar(require("assert"));
|
|
27
|
+
const emit_details_1 = require("../ledger/emit_details");
|
|
27
28
|
const memos_1 = require("../ledger/memos");
|
|
28
29
|
function parseOfferCancel(tx) {
|
|
29
30
|
assert.ok(tx.TransactionType === "OfferCancel");
|
|
30
31
|
return {
|
|
31
|
-
memos: (0, memos_1.parseMemos)(tx),
|
|
32
32
|
orderSequence: tx.OfferSequence,
|
|
33
|
+
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
34
|
+
memos: (0, memos_1.parseMemos)(tx),
|
|
33
35
|
};
|
|
34
36
|
}
|
|
35
37
|
exports.default = parseOfferCancel;
|
|
@@ -30,6 +30,7 @@ const assert = __importStar(require("assert"));
|
|
|
30
30
|
const xrpl_1 = require("xrpl");
|
|
31
31
|
const utils_1 = require("../utils");
|
|
32
32
|
const amount_1 = __importDefault(require("../ledger/amount"));
|
|
33
|
+
const emit_details_1 = require("../ledger/emit_details");
|
|
33
34
|
const memos_1 = require("../ledger/memos");
|
|
34
35
|
const common_1 = require("../../common");
|
|
35
36
|
function parseOfferCreate(tx) {
|
|
@@ -40,7 +41,6 @@ function parseOfferCreate(tx) {
|
|
|
40
41
|
const quantity = direction === "buy" ? takerPaysAmount : takerGetsAmount;
|
|
41
42
|
const totalPrice = direction === "buy" ? takerGetsAmount : takerPaysAmount;
|
|
42
43
|
return (0, common_1.removeUndefined)({
|
|
43
|
-
memos: (0, memos_1.parseMemos)(tx),
|
|
44
44
|
direction: direction,
|
|
45
45
|
quantity: quantity,
|
|
46
46
|
totalPrice: totalPrice,
|
|
@@ -48,6 +48,8 @@ function parseOfferCreate(tx) {
|
|
|
48
48
|
immediateOrCancel: (tx.Flags & xrpl_1.OfferCreateFlags.tfImmediateOrCancel) !== 0 || undefined,
|
|
49
49
|
fillOrKill: (tx.Flags & xrpl_1.OfferCreateFlags.tfFillOrKill) !== 0 || undefined,
|
|
50
50
|
expirationTime: (0, utils_1.parseTimestamp)(tx.Expiration),
|
|
51
|
+
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
52
|
+
memos: (0, memos_1.parseMemos)(tx),
|
|
51
53
|
});
|
|
52
54
|
}
|
|
53
55
|
exports.default = parseOfferCreate;
|
|
@@ -30,11 +30,11 @@ const assert = __importStar(require("assert"));
|
|
|
30
30
|
const xrpl_1 = require("xrpl");
|
|
31
31
|
const common_1 = require("../../common");
|
|
32
32
|
const ripple_amount_1 = __importDefault(require("../ledger/ripple-amount"));
|
|
33
|
+
const emit_details_1 = require("../ledger/emit_details");
|
|
33
34
|
const memos_1 = require("../ledger/memos");
|
|
34
35
|
function parsePaymentChannelClaim(tx) {
|
|
35
36
|
assert.ok(tx.TransactionType === "PaymentChannelClaim");
|
|
36
37
|
return (0, common_1.removeUndefined)({
|
|
37
|
-
memos: (0, memos_1.parseMemos)(tx),
|
|
38
38
|
channel: tx.Channel,
|
|
39
39
|
balance: (0, ripple_amount_1.default)(tx.Balance),
|
|
40
40
|
amount: (0, ripple_amount_1.default)(tx.Amount),
|
|
@@ -42,6 +42,8 @@ function parsePaymentChannelClaim(tx) {
|
|
|
42
42
|
publicKey: tx.PublicKey,
|
|
43
43
|
renew: Boolean(tx.Flags & xrpl_1.PaymentChannelClaimFlags.tfRenew) || undefined,
|
|
44
44
|
close: Boolean(tx.Flags & xrpl_1.PaymentChannelClaimFlags.tfClose) || undefined,
|
|
45
|
+
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
46
|
+
memos: (0, memos_1.parseMemos)(tx),
|
|
45
47
|
});
|
|
46
48
|
}
|
|
47
49
|
exports.default = parsePaymentChannelClaim;
|
|
@@ -30,6 +30,7 @@ const assert = __importStar(require("assert"));
|
|
|
30
30
|
const common_1 = require("../../common");
|
|
31
31
|
const utils_1 = require("../utils");
|
|
32
32
|
const ripple_amount_1 = __importDefault(require("../ledger/ripple-amount"));
|
|
33
|
+
const emit_details_1 = require("../ledger/emit_details");
|
|
33
34
|
const memos_1 = require("../ledger/memos");
|
|
34
35
|
const account_1 = require("../ledger/account");
|
|
35
36
|
function parsePaymentChannelCreate(tx) {
|
|
@@ -45,11 +46,12 @@ function parsePaymentChannelCreate(tx) {
|
|
|
45
46
|
return (0, common_1.removeUndefined)({
|
|
46
47
|
source: (0, common_1.removeUndefined)(source),
|
|
47
48
|
destination: (0, common_1.removeUndefined)(destination),
|
|
48
|
-
memos: (0, memos_1.parseMemos)(tx),
|
|
49
49
|
amount: (0, ripple_amount_1.default)(tx.Amount),
|
|
50
50
|
settleDelay: tx.SettleDelay,
|
|
51
51
|
publicKey: tx.PublicKey,
|
|
52
52
|
cancelAfter: tx.CancelAfter && (0, utils_1.parseTimestamp)(tx.CancelAfter),
|
|
53
|
+
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
54
|
+
memos: (0, memos_1.parseMemos)(tx),
|
|
53
55
|
});
|
|
54
56
|
}
|
|
55
57
|
exports.default = parsePaymentChannelCreate;
|
|
@@ -30,14 +30,16 @@ const assert = __importStar(require("assert"));
|
|
|
30
30
|
const common_1 = require("../../common");
|
|
31
31
|
const utils_1 = require("../utils");
|
|
32
32
|
const ripple_amount_1 = __importDefault(require("../ledger/ripple-amount"));
|
|
33
|
+
const emit_details_1 = require("../ledger/emit_details");
|
|
33
34
|
const memos_1 = require("../ledger/memos");
|
|
34
35
|
function parsePaymentChannelFund(tx) {
|
|
35
36
|
assert.ok(tx.TransactionType === "PaymentChannelFund");
|
|
36
37
|
return (0, common_1.removeUndefined)({
|
|
37
|
-
memos: (0, memos_1.parseMemos)(tx),
|
|
38
38
|
channel: tx.Channel,
|
|
39
39
|
amount: (0, ripple_amount_1.default)(tx.Amount),
|
|
40
40
|
expiration: tx.Expiration && (0, utils_1.parseTimestamp)(tx.Expiration),
|
|
41
|
+
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
42
|
+
memos: (0, memos_1.parseMemos)(tx),
|
|
41
43
|
});
|
|
42
44
|
}
|
|
43
45
|
exports.default = parsePaymentChannelFund;
|
|
@@ -31,6 +31,7 @@ const xrpl_1 = require("xrpl");
|
|
|
31
31
|
const utils_1 = require("../utils");
|
|
32
32
|
const common_1 = require("../../common");
|
|
33
33
|
const amount_1 = __importDefault(require("../ledger/amount"));
|
|
34
|
+
const emit_details_1 = require("../ledger/emit_details");
|
|
34
35
|
const memos_1 = require("../ledger/memos");
|
|
35
36
|
function isNoDirectRipple(tx) {
|
|
36
37
|
return (tx.Flags & xrpl_1.PaymentFlags.tfNoRippleDirect) !== 0;
|
|
@@ -52,12 +53,13 @@ function parsePayment(tx) {
|
|
|
52
53
|
return (0, common_1.removeUndefined)({
|
|
53
54
|
source: (0, common_1.removeUndefined)(source),
|
|
54
55
|
destination: (0, common_1.removeUndefined)(destination),
|
|
55
|
-
memos: (0, memos_1.parseMemos)(tx),
|
|
56
56
|
invoiceID: tx.InvoiceID,
|
|
57
57
|
paths: tx.Paths ? JSON.stringify(tx.Paths) : undefined,
|
|
58
58
|
allowPartialPayment: (0, utils_1.isPartialPayment)(tx) || undefined,
|
|
59
59
|
noDirectRipple: isNoDirectRipple(tx) || undefined,
|
|
60
60
|
limitQuality: isQualityLimited(tx) || undefined,
|
|
61
|
+
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
62
|
+
memos: (0, memos_1.parseMemos)(tx),
|
|
61
63
|
});
|
|
62
64
|
}
|
|
63
65
|
exports.default = parsePayment;
|
|
@@ -28,6 +28,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
const assert = __importStar(require("assert"));
|
|
30
30
|
const common_1 = require("../../common");
|
|
31
|
+
const emit_details_1 = require("../ledger/emit_details");
|
|
31
32
|
const memos_1 = require("../ledger/memos");
|
|
32
33
|
const account_1 = require("../ledger/account");
|
|
33
34
|
const uritoken_flags_1 = __importDefault(require("../ledger/uritoken-flags"));
|
|
@@ -75,6 +76,7 @@ function parseRemit(tx) {
|
|
|
75
76
|
blob: tx.Blob,
|
|
76
77
|
inform: tx.Inform,
|
|
77
78
|
invoiceID: tx.InvoiceID,
|
|
79
|
+
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
78
80
|
memos: (0, memos_1.parseMemos)(tx),
|
|
79
81
|
});
|
|
80
82
|
}
|
|
@@ -31,6 +31,7 @@ const assert = __importStar(require("assert"));
|
|
|
31
31
|
const account_info_1 = require("../../models/account_info");
|
|
32
32
|
const common_1 = require("../../common");
|
|
33
33
|
const fields_1 = __importDefault(require("../ledger/fields"));
|
|
34
|
+
const emit_details_1 = require("../ledger/emit_details");
|
|
34
35
|
const memos_1 = require("../ledger/memos");
|
|
35
36
|
function getAccountRootModifiedNode(tx) {
|
|
36
37
|
const modifiedNodes = tx.meta.AffectedNodes.filter((node) => node.ModifiedNode?.LedgerEntryType === "AccountRoot");
|
|
@@ -73,6 +74,7 @@ function parseSettings(tx) {
|
|
|
73
74
|
const txType = tx.TransactionType;
|
|
74
75
|
assert.ok(txType === "AccountSet" || txType === "SetRegularKey" || txType === "SignerListSet");
|
|
75
76
|
const baseSettings = (0, common_1.removeUndefined)({
|
|
77
|
+
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
76
78
|
memos: (0, memos_1.parseMemos)(tx),
|
|
77
79
|
});
|
|
78
80
|
return Object.assign(baseSettings, parseSettingsFlags(tx), (0, fields_1.default)(tx));
|
|
@@ -25,12 +25,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
const assert = __importStar(require("assert"));
|
|
27
27
|
const common_1 = require("../../common");
|
|
28
|
+
const emit_details_1 = require("../ledger/emit_details");
|
|
28
29
|
const memos_1 = require("../ledger/memos");
|
|
29
30
|
function parseTicketCreate(tx) {
|
|
30
31
|
assert.ok(tx.TransactionType === "TicketCreate");
|
|
31
32
|
return (0, common_1.removeUndefined)({
|
|
32
|
-
memos: (0, memos_1.parseMemos)(tx),
|
|
33
33
|
ticketCount: tx.TicketCount,
|
|
34
|
+
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
35
|
+
memos: (0, memos_1.parseMemos)(tx),
|
|
34
36
|
});
|
|
35
37
|
}
|
|
36
38
|
exports.default = parseTicketCreate;
|
|
@@ -27,6 +27,7 @@ const assert = __importStar(require("assert"));
|
|
|
27
27
|
const xrpl_1 = require("xrpl");
|
|
28
28
|
const utils_1 = require("../utils");
|
|
29
29
|
const common_1 = require("../../common");
|
|
30
|
+
const emit_details_1 = require("../ledger/emit_details");
|
|
30
31
|
const memos_1 = require("../ledger/memos");
|
|
31
32
|
function parseFlag(flagsValue, trueValue, falseValue) {
|
|
32
33
|
if (flagsValue & trueValue) {
|
|
@@ -43,12 +44,13 @@ function parseTrustline(tx) {
|
|
|
43
44
|
limit: tx.LimitAmount.value,
|
|
44
45
|
currency: tx.LimitAmount.currency,
|
|
45
46
|
counterparty: tx.LimitAmount.issuer,
|
|
46
|
-
memos: (0, memos_1.parseMemos)(tx),
|
|
47
47
|
qualityIn: (0, utils_1.parseQuality)(tx.QualityIn),
|
|
48
48
|
qualityOut: (0, utils_1.parseQuality)(tx.QualityOut),
|
|
49
49
|
ripplingDisabled: parseFlag(tx.Flags, xrpl_1.TrustSetFlags.tfSetNoRipple, xrpl_1.TrustSetFlags.tfClearNoRipple),
|
|
50
50
|
frozen: parseFlag(tx.Flags, xrpl_1.TrustSetFlags.tfSetFreeze, xrpl_1.TrustSetFlags.tfClearFreeze),
|
|
51
51
|
authorized: parseFlag(tx.Flags, xrpl_1.TrustSetFlags.tfSetfAuth, 0),
|
|
52
|
+
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
53
|
+
memos: (0, memos_1.parseMemos)(tx),
|
|
52
54
|
});
|
|
53
55
|
}
|
|
54
56
|
exports.default = parseTrustline;
|
|
@@ -25,6 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
const assert = __importStar(require("assert"));
|
|
27
27
|
const common_1 = require("../../common");
|
|
28
|
+
const emit_details_1 = require("../ledger/emit_details");
|
|
28
29
|
const memos_1 = require("../ledger/memos");
|
|
29
30
|
const account_1 = require("../ledger/account");
|
|
30
31
|
function parseUNLReport(tx) {
|
|
@@ -38,6 +39,7 @@ function parseUNLReport(tx) {
|
|
|
38
39
|
source: (0, common_1.removeUndefined)(source),
|
|
39
40
|
activeValidator,
|
|
40
41
|
importVLKey,
|
|
42
|
+
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
41
43
|
memos: (0, memos_1.parseMemos)(tx),
|
|
42
44
|
});
|
|
43
45
|
}
|
|
@@ -25,11 +25,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
const assert = __importStar(require("assert"));
|
|
27
27
|
const common_1 = require("../../common");
|
|
28
|
+
const emit_details_1 = require("../ledger/emit_details");
|
|
28
29
|
const memos_1 = require("../ledger/memos");
|
|
29
30
|
function parseNFTokenBurn(tx) {
|
|
30
31
|
assert.ok(tx.TransactionType === "URITokenBurn");
|
|
31
32
|
return (0, common_1.removeUndefined)({
|
|
32
33
|
uritokenID: tx.URITokenID,
|
|
34
|
+
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
33
35
|
memos: (0, memos_1.parseMemos)(tx),
|
|
34
36
|
});
|
|
35
37
|
}
|
|
@@ -25,12 +25,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
const assert = __importStar(require("assert"));
|
|
27
27
|
const common_1 = require("../../common");
|
|
28
|
+
const emit_details_1 = require("../ledger/emit_details");
|
|
28
29
|
const memos_1 = require("../ledger/memos");
|
|
29
30
|
function parseNFTokenBurn(tx) {
|
|
30
31
|
assert.ok(tx.TransactionType === "URITokenBuy");
|
|
31
32
|
return (0, common_1.removeUndefined)({
|
|
32
33
|
uritokenID: tx.URITokenID,
|
|
33
34
|
amount: tx.Amount,
|
|
35
|
+
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
34
36
|
memos: (0, memos_1.parseMemos)(tx),
|
|
35
37
|
});
|
|
36
38
|
}
|
|
@@ -25,11 +25,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
const assert = __importStar(require("assert"));
|
|
27
27
|
const common_1 = require("../../common");
|
|
28
|
+
const emit_details_1 = require("../ledger/emit_details");
|
|
28
29
|
const memos_1 = require("../ledger/memos");
|
|
29
30
|
function parseNFTokenBurn(tx) {
|
|
30
31
|
assert.ok(tx.TransactionType === "URITokenCancelSellOffer");
|
|
31
32
|
return (0, common_1.removeUndefined)({
|
|
32
33
|
uritokenID: tx.URITokenID,
|
|
34
|
+
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
33
35
|
memos: (0, memos_1.parseMemos)(tx),
|
|
34
36
|
});
|
|
35
37
|
}
|
|
@@ -25,6 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
const assert = __importStar(require("assert"));
|
|
27
27
|
const common_1 = require("../../common");
|
|
28
|
+
const emit_details_1 = require("../ledger/emit_details");
|
|
28
29
|
const memos_1 = require("../ledger/memos");
|
|
29
30
|
const account_1 = require("../ledger/account");
|
|
30
31
|
function parseNFTokenBurn(tx) {
|
|
@@ -41,6 +42,7 @@ function parseNFTokenBurn(tx) {
|
|
|
41
42
|
amount: tx.Amount,
|
|
42
43
|
source: Object.keys(source).length > 0 ? source : undefined,
|
|
43
44
|
destination: Object.keys(destination).length > 0 ? destination : undefined,
|
|
45
|
+
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
44
46
|
memos: (0, memos_1.parseMemos)(tx),
|
|
45
47
|
});
|
|
46
48
|
}
|
|
@@ -28,13 +28,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
const assert = __importStar(require("assert"));
|
|
30
30
|
const common_1 = require("../../common");
|
|
31
|
-
const memos_1 = require("../ledger/memos");
|
|
32
31
|
const uritoken_flags_1 = __importDefault(require("../ledger/uritoken-flags"));
|
|
33
32
|
const emit_details_1 = require("../ledger/emit_details");
|
|
33
|
+
const memos_1 = require("../ledger/memos");
|
|
34
34
|
const account_1 = require("../ledger/account");
|
|
35
35
|
function parseNFTokenMint(tx) {
|
|
36
36
|
assert.ok(tx.TransactionType === "URITokenMint");
|
|
37
|
-
const emittedDetails = (0, emit_details_1.parseEmittedDetails)(tx);
|
|
38
37
|
const source = (0, common_1.removeUndefined)({
|
|
39
38
|
address: (0, account_1.parseAccount)(tx.Account),
|
|
40
39
|
tag: tx.SourceTag,
|
|
@@ -49,7 +48,7 @@ function parseNFTokenMint(tx) {
|
|
|
49
48
|
amount: tx.Amount,
|
|
50
49
|
source: Object.keys(source).length > 0 ? source : undefined,
|
|
51
50
|
destination: Object.keys(destination).length > 0 ? destination : undefined,
|
|
52
|
-
emittedDetails,
|
|
51
|
+
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
53
52
|
memos: (0, memos_1.parseMemos)(tx),
|
|
54
53
|
});
|
|
55
54
|
}
|
|
@@ -18,10 +18,11 @@ import { FormattedUNLReportSpecification } from "../types/unl_reports";
|
|
|
18
18
|
import { FormattedRemitsSpecification } from "../types/remits";
|
|
19
19
|
import { FormattedClawbackSpecification } from "../types/clawback";
|
|
20
20
|
import { FormattedAmmBidSpecification, FormattedAmmCreateSpecification, FormattedAmmDeleteSpecification, FormattedAmmDepositSpecification, FormattedAmmWithdrawSpecification, FormattedAmmVoteSpecification } from "../types/amm";
|
|
21
|
+
import { FormattedGenesisMintSpecification } from "../types/genesis_mint";
|
|
21
22
|
import { FormattedAmendmentSpecification } from "../types/amendments";
|
|
22
23
|
import { FormattedFeeUpdateSpecification } from "../types/fees";
|
|
23
24
|
declare function parseTransactionType(type: string): string;
|
|
24
|
-
export type FormattedSpecification = FormattedSettingsSpecification | FormattedAccountDeleteSpecification | FormattedCheckCancelSpecification | FormattedCheckCashSpecification | FormattedCheckCreateSpecification | FormattedDepositPreauthSpecification | FormattedEscrowCancelSpecification | FormattedEscrowCreateSpecification | FormattedEscrowFinishSpecification | FormattedOfferCancelSpecification | FormattedOfferCreateSpecification | FormattedPaymentSpecification | FormattedPaymentChannelClaimSpecification | FormattedPaymentChannelCreateSpecification | FormattedPaymentChannelFundSpecification | FormattedTicketCreateSpecification | FormattedTrustlineSpecification | FormattedNFTokenBurnSpecification | FormattedNFTokenMintSpecification | FormattedNFTokenCancelOfferSpecification | FormattedNFTokenCreateOfferSpecification | FormattedNFTokenAcceptOfferSpecification | FormattedURITokenBurnSpecification | FormattedURITokenBuySpecification | FormattedURITokenCreateSellOfferSpecification | FormattedURITokenCancelSellOfferSpecification | FormattedURITokenMintSpecification | FormattedImportSpecification | FormattedInvokeSpecification | FormattedUNLReportSpecification | FormattedRemitsSpecification | FormattedClawbackSpecification | FormattedAmmBidSpecification | FormattedAmmCreateSpecification | FormattedAmmDeleteSpecification | FormattedAmmDepositSpecification | FormattedAmmWithdrawSpecification | FormattedAmmVoteSpecification | FormattedAmendmentSpecification | FormattedFeeUpdateSpecification;
|
|
25
|
+
export type FormattedSpecification = FormattedSettingsSpecification | FormattedAccountDeleteSpecification | FormattedCheckCancelSpecification | FormattedCheckCashSpecification | FormattedCheckCreateSpecification | FormattedDepositPreauthSpecification | FormattedEscrowCancelSpecification | FormattedEscrowCreateSpecification | FormattedEscrowFinishSpecification | FormattedOfferCancelSpecification | FormattedOfferCreateSpecification | FormattedPaymentSpecification | FormattedPaymentChannelClaimSpecification | FormattedPaymentChannelCreateSpecification | FormattedPaymentChannelFundSpecification | FormattedTicketCreateSpecification | FormattedTrustlineSpecification | FormattedNFTokenBurnSpecification | FormattedNFTokenMintSpecification | FormattedNFTokenCancelOfferSpecification | FormattedNFTokenCreateOfferSpecification | FormattedNFTokenAcceptOfferSpecification | FormattedURITokenBurnSpecification | FormattedURITokenBuySpecification | FormattedURITokenCreateSellOfferSpecification | FormattedURITokenCancelSellOfferSpecification | FormattedURITokenMintSpecification | FormattedImportSpecification | FormattedInvokeSpecification | FormattedUNLReportSpecification | FormattedRemitsSpecification | FormattedClawbackSpecification | FormattedAmmBidSpecification | FormattedAmmCreateSpecification | FormattedAmmDeleteSpecification | FormattedAmmDepositSpecification | FormattedAmmWithdrawSpecification | FormattedAmmVoteSpecification | FormattedGenesisMintSpecification | FormattedAmendmentSpecification | FormattedFeeUpdateSpecification;
|
|
25
26
|
export interface FormattedTransaction {
|
|
26
27
|
type: string;
|
|
27
28
|
address: string;
|
package/lib/parse/transaction.js
CHANGED
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.parseTransactionType = parseTransactionType;
|
|
7
|
+
exports.parseTransaction = parseTransaction;
|
|
7
8
|
const common_1 = require("../common");
|
|
8
9
|
const account_1 = require("./ledger/account");
|
|
9
10
|
const outcome_1 = require("./outcome");
|
|
@@ -45,6 +46,7 @@ const amm_delete_1 = __importDefault(require("./specification/amm-delete"));
|
|
|
45
46
|
const amm_deposit_1 = __importDefault(require("./specification/amm-deposit"));
|
|
46
47
|
const amm_withdraw_1 = __importDefault(require("./specification/amm-withdraw"));
|
|
47
48
|
const amm_vote_1 = __importDefault(require("./specification/amm-vote"));
|
|
49
|
+
const genesis_mint_1 = __importDefault(require("./specification/genesis-mint"));
|
|
48
50
|
const amendment_1 = __importDefault(require("./specification/amendment"));
|
|
49
51
|
const fee_update_1 = __importDefault(require("./specification/fee-update"));
|
|
50
52
|
const transactionTypeToType = {
|
|
@@ -88,13 +90,13 @@ const transactionTypeToType = {
|
|
|
88
90
|
AMMDeposit: "ammDeposit",
|
|
89
91
|
AMMWithdraw: "ammWithdraw",
|
|
90
92
|
AMMVote: "ammVote",
|
|
93
|
+
GenesisMint: "genesisMint",
|
|
91
94
|
EnableAmendment: "amendment",
|
|
92
95
|
SetFee: "feeUpdate",
|
|
93
96
|
};
|
|
94
97
|
function parseTransactionType(type) {
|
|
95
98
|
return transactionTypeToType[type] || type;
|
|
96
99
|
}
|
|
97
|
-
exports.parseTransactionType = parseTransactionType;
|
|
98
100
|
const parserTypeFunc = {
|
|
99
101
|
settings: settings_1.default,
|
|
100
102
|
accountDelete: account_delete_1.default,
|
|
@@ -134,6 +136,7 @@ const parserTypeFunc = {
|
|
|
134
136
|
ammDeposit: amm_deposit_1.default,
|
|
135
137
|
ammWithdraw: amm_withdraw_1.default,
|
|
136
138
|
ammVote: amm_vote_1.default,
|
|
139
|
+
genesisMint: genesis_mint_1.default,
|
|
137
140
|
amendment: amendment_1.default,
|
|
138
141
|
feeUpdate: fee_update_1.default,
|
|
139
142
|
};
|
|
@@ -162,4 +165,3 @@ function parseTransaction(tx, includeRawTransaction, nativeCurrency, definitions
|
|
|
162
165
|
rawTransaction: includeRawTransaction ? JSON.stringify(tx) : undefined,
|
|
163
166
|
});
|
|
164
167
|
}
|
|
165
|
-
exports.parseTransaction = parseTransaction;
|
package/lib/parse/utils.d.ts
CHANGED
package/lib/parse/utils.js
CHANGED
|
@@ -3,7 +3,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.parseQuality = parseQuality;
|
|
7
|
+
exports.parseTimestamp = parseTimestamp;
|
|
8
|
+
exports.adjustQualityForXRP = adjustQualityForXRP;
|
|
9
|
+
exports.isPartialPayment = isPartialPayment;
|
|
10
|
+
exports.removeGenericCounterparty = removeGenericCounterparty;
|
|
11
|
+
exports.normalizeNodes = normalizeNodes;
|
|
12
|
+
exports.hexToString = hexToString;
|
|
13
|
+
exports.stringToHex = stringToHex;
|
|
14
|
+
exports.bytesToHex = bytesToHex;
|
|
15
|
+
exports.hexToBytes = hexToBytes;
|
|
16
|
+
exports.parseUint32 = parseUint32;
|
|
17
|
+
exports.parseUint64 = parseUint64;
|
|
7
18
|
const lodash_1 = __importDefault(require("lodash"));
|
|
8
19
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
9
20
|
const xrpl_1 = require("xrpl");
|
|
@@ -15,29 +26,24 @@ function adjustQualityForXRP(quality, takerGetsCurrency, takerPaysCurrency) {
|
|
|
15
26
|
const shift = numeratorShift - denominatorShift;
|
|
16
27
|
return shift === 0 ? quality : new bignumber_js_1.default(quality).shiftedBy(shift).toString();
|
|
17
28
|
}
|
|
18
|
-
exports.adjustQualityForXRP = adjustQualityForXRP;
|
|
19
29
|
function parseQuality(quality) {
|
|
20
30
|
if (typeof quality !== "number") {
|
|
21
31
|
return undefined;
|
|
22
32
|
}
|
|
23
33
|
return new bignumber_js_1.default(quality).shiftedBy(-9).toNumber();
|
|
24
34
|
}
|
|
25
|
-
exports.parseQuality = parseQuality;
|
|
26
35
|
function parseTimestamp(rippleTime) {
|
|
27
36
|
if (typeof rippleTime !== "number") {
|
|
28
37
|
return undefined;
|
|
29
38
|
}
|
|
30
39
|
return (0, models_1.ledgerTimeToISO8601)(rippleTime);
|
|
31
40
|
}
|
|
32
|
-
exports.parseTimestamp = parseTimestamp;
|
|
33
41
|
function isPartialPayment(tx) {
|
|
34
42
|
return (tx.Flags & xrpl_1.PaymentFlags.tfPartialPayment) !== 0;
|
|
35
43
|
}
|
|
36
|
-
exports.isPartialPayment = isPartialPayment;
|
|
37
44
|
function removeGenericCounterparty(amount, address) {
|
|
38
45
|
return amount.counterparty === address ? lodash_1.default.omit(amount, "counterparty") : amount;
|
|
39
46
|
}
|
|
40
|
-
exports.removeGenericCounterparty = removeGenericCounterparty;
|
|
41
47
|
function normalizeNode(affectedNode) {
|
|
42
48
|
const diffType = Object.keys(affectedNode)[0];
|
|
43
49
|
const node = affectedNode[diffType];
|
|
@@ -56,19 +62,15 @@ function normalizeNodes(metadata) {
|
|
|
56
62
|
}
|
|
57
63
|
return metadata.AffectedNodes.map(normalizeNode);
|
|
58
64
|
}
|
|
59
|
-
exports.normalizeNodes = normalizeNodes;
|
|
60
65
|
function hexToString(hex) {
|
|
61
66
|
return hex ? Buffer.from(hex, "hex").toString("utf-8") : undefined;
|
|
62
67
|
}
|
|
63
|
-
exports.hexToString = hexToString;
|
|
64
68
|
function stringToHex(value) {
|
|
65
69
|
return value ? Buffer.from(value, "utf8").toString("hex").toUpperCase() : undefined;
|
|
66
70
|
}
|
|
67
|
-
exports.stringToHex = stringToHex;
|
|
68
71
|
function bytesToHex(value) {
|
|
69
72
|
return Buffer.from(value).toString("hex").toUpperCase();
|
|
70
73
|
}
|
|
71
|
-
exports.bytesToHex = bytesToHex;
|
|
72
74
|
function hexToBytes(value) {
|
|
73
75
|
if (value.length % 2 !== 0) {
|
|
74
76
|
throw new Error("Invalid hex string length");
|
|
@@ -81,11 +83,9 @@ function hexToBytes(value) {
|
|
|
81
83
|
}
|
|
82
84
|
return Uint8Array.from(Buffer.from(value, "hex"));
|
|
83
85
|
}
|
|
84
|
-
exports.hexToBytes = hexToBytes;
|
|
85
86
|
function parseUint32(buf, cur) {
|
|
86
87
|
return ((BigInt(buf[cur]) << 24n) + (BigInt(buf[cur + 1]) << 16n) + (BigInt(buf[cur + 2]) << 8n) + BigInt(buf[cur + 3]) + "");
|
|
87
88
|
}
|
|
88
|
-
exports.parseUint32 = parseUint32;
|
|
89
89
|
function parseUint64(buf, cur) {
|
|
90
90
|
return ((BigInt(buf[cur]) << 56n) +
|
|
91
91
|
(BigInt(buf[cur + 1]) << 48n) +
|
|
@@ -97,4 +97,3 @@ function parseUint64(buf, cur) {
|
|
|
97
97
|
BigInt(buf[cur + 7]) +
|
|
98
98
|
"");
|
|
99
99
|
}
|
|
100
|
-
exports.parseUint64 = parseUint64;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FormattedAmount } from "./amounts";
|
|
2
|
+
import { FormattedBaseSpecification } from "./specification";
|
|
3
|
+
export type FormattedGenesisMint = {
|
|
4
|
+
amount: FormattedAmount;
|
|
5
|
+
destination: string;
|
|
6
|
+
};
|
|
7
|
+
export type FormattedGenesisMintSpecification = {
|
|
8
|
+
genesisMints?: FormattedGenesisMint[];
|
|
9
|
+
} & FormattedBaseSpecification;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { FormattedSourceAddress } from "./account";
|
|
2
|
+
import { FormattedEmitDetails } from "./emit_details";
|
|
2
3
|
import { FormattedMemo } from "./memos";
|
|
3
4
|
export type FormattedBaseSpecification = {
|
|
4
5
|
source?: FormattedSourceAddress;
|
|
6
|
+
emittedDetails?: FormattedEmitDetails;
|
|
5
7
|
memos?: FormattedMemo[];
|
|
6
8
|
};
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createPaymentTransaction =
|
|
6
|
+
exports.createPaymentTransaction = createPaymentTransaction;
|
|
7
7
|
const lodash_1 = __importDefault(require("lodash"));
|
|
8
8
|
const xrpl_1 = require("xrpl");
|
|
9
9
|
const common_1 = require("../../common");
|
|
@@ -128,4 +128,3 @@ function createPaymentTransaction(address, paymentArgument) {
|
|
|
128
128
|
}
|
|
129
129
|
return txJSON;
|
|
130
130
|
}
|
|
131
|
-
exports.createPaymentTransaction = createPaymentTransaction;
|
package/lib/v1/utils.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.toRippledAmount = toRippledAmount;
|
|
4
|
+
exports.getClassicAccountAndTag = getClassicAccountAndTag;
|
|
4
5
|
const ripple_address_codec_1 = require("ripple-address-codec");
|
|
5
6
|
const common_1 = require("../common");
|
|
6
7
|
const client_1 = require("../client");
|
|
@@ -20,7 +21,6 @@ function toRippledAmount(amount) {
|
|
|
20
21
|
value: amount.value,
|
|
21
22
|
};
|
|
22
23
|
}
|
|
23
|
-
exports.toRippledAmount = toRippledAmount;
|
|
24
24
|
function getClassicAccountAndTag(Account, expectedTag) {
|
|
25
25
|
if ((0, ripple_address_codec_1.isValidXAddress)(Account)) {
|
|
26
26
|
const classic = (0, ripple_address_codec_1.xAddressToClassicAddress)(Account);
|
|
@@ -39,4 +39,3 @@ function getClassicAccountAndTag(Account, expectedTag) {
|
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
exports.getClassicAccountAndTag = getClassicAccountAndTag;
|
package/lib/validator.d.ts
CHANGED
package/lib/validator.js
CHANGED
|
@@ -26,7 +26,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
29
|
+
exports.classicAddressFromValidatorPK = classicAddressFromValidatorPK;
|
|
30
|
+
exports.generateSecrets = generateSecrets;
|
|
31
|
+
exports.sign = sign;
|
|
32
|
+
exports.verify = verify;
|
|
33
|
+
exports.verify2 = verify2;
|
|
30
34
|
const assert = __importStar(require("assert"));
|
|
31
35
|
const ripple_address_codec_1 = require("ripple-address-codec");
|
|
32
36
|
const Crypto = __importStar(require("crypto"));
|
|
@@ -61,7 +65,6 @@ function classicAddressFromValidatorPK(pk) {
|
|
|
61
65
|
const address = Base58.encode(dataToEncode);
|
|
62
66
|
return address;
|
|
63
67
|
}
|
|
64
|
-
exports.classicAddressFromValidatorPK = classicAddressFromValidatorPK;
|
|
65
68
|
function generateSecrets() {
|
|
66
69
|
const keypair = Crypto.generateKeyPairSync("ed25519", {
|
|
67
70
|
privateKeyEncoding: { format: "der", type: "pkcs8" },
|
|
@@ -81,7 +84,6 @@ function generateSecrets() {
|
|
|
81
84
|
PublicKey,
|
|
82
85
|
};
|
|
83
86
|
}
|
|
84
|
-
exports.generateSecrets = generateSecrets;
|
|
85
87
|
function sign(message, secret) {
|
|
86
88
|
if (typeof message === "string") {
|
|
87
89
|
message = Buffer.from(message, "utf8");
|
|
@@ -94,7 +96,6 @@ function sign(message, secret) {
|
|
|
94
96
|
}
|
|
95
97
|
return rippleKeypairs.sign(message.toString("hex"), secret).toUpperCase();
|
|
96
98
|
}
|
|
97
|
-
exports.sign = sign;
|
|
98
99
|
function verify(message, signature, publicKey) {
|
|
99
100
|
if (typeof message === "string") {
|
|
100
101
|
message = Buffer.from(message, "utf8");
|
|
@@ -110,7 +111,6 @@ function verify(message, signature, publicKey) {
|
|
|
110
111
|
}
|
|
111
112
|
return false;
|
|
112
113
|
}
|
|
113
|
-
exports.verify = verify;
|
|
114
114
|
function verify2(message, signature, publicKey) {
|
|
115
115
|
if (publicKey.slice(0, 1) === VALIDATOR_NODE_PUBLIC_KEY_PREFIX) {
|
|
116
116
|
const publicKeyBuffer = (0, ripple_address_codec_1.decodeNodePublic)(publicKey);
|
|
@@ -131,4 +131,3 @@ function verify2(message, signature, publicKey) {
|
|
|
131
131
|
}
|
|
132
132
|
return false;
|
|
133
133
|
}
|
|
134
|
-
exports.verify2 = verify2;
|
package/lib/wallet.d.ts
CHANGED