@bithomp/xrpl-api 3.2.8 → 3.2.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/ledger/account_lines.d.ts +1 -1
- package/lib/ledger/account_lines.js +11 -2
- package/lib/ledger/currency.d.ts +1 -0
- package/lib/ledger/currency.js +4 -2
- package/lib/ledger/transaction.js +6 -0
- package/lib/models/book_offers.d.ts +3 -3
- package/lib/models/book_offers.js +1 -1
- package/lib/parse/ledger/amount.d.ts +2 -2
- package/lib/parse/ledger/amount.js +1 -0
- package/lib/parse/ledger/asset.d.ts +1 -1
- package/lib/parse/ledger/asset.js +1 -0
- package/lib/parse/ledger/destination.d.ts +2 -0
- package/lib/parse/ledger/destination.js +12 -0
- package/lib/parse/ledger/gateway-balances.js +4 -4
- package/lib/parse/ledger/ledger.js +12 -8
- package/lib/parse/ledger/regular-key.d.ts +2 -0
- package/lib/parse/ledger/regular-key.js +14 -0
- package/lib/parse/ledger/signers.d.ts +2 -0
- package/lib/parse/ledger/signers.js +12 -0
- package/lib/parse/ledger/source.d.ts +3 -0
- package/lib/parse/ledger/source.js +28 -0
- package/lib/parse/outcome/amm_changes.js +4 -2
- package/lib/parse/outcome/balance_changes.d.ts +2 -1
- package/lib/parse/outcome/balance_changes.js +5 -3
- package/lib/parse/outcome/locked_balance_changes.d.ts +2 -1
- package/lib/parse/outcome/locked_balance_changes.js +2 -1
- package/lib/parse/outcome.js +3 -2
- package/lib/parse/specification/account-delete.js +8 -11
- package/lib/parse/specification/amm-bid.js +6 -6
- package/lib/parse/specification/amm-clawback.js +6 -5
- package/lib/parse/specification/amm-create.js +6 -6
- package/lib/parse/specification/amm-delete.js +6 -6
- package/lib/parse/specification/amm-deposit.js +6 -6
- package/lib/parse/specification/amm-vote.js +6 -6
- package/lib/parse/specification/amm-withdraw.js +6 -6
- package/lib/parse/specification/check-cancel.js +6 -0
- package/lib/parse/specification/check-cash.js +6 -0
- package/lib/parse/specification/check-create.js +8 -11
- package/lib/parse/specification/clawback.js +6 -6
- package/lib/parse/specification/deposit-preauth.js +6 -0
- package/lib/parse/specification/did-delete.js +6 -6
- package/lib/parse/specification/did-set.js +6 -6
- package/lib/parse/specification/escrow-cancel.js +6 -5
- package/lib/parse/specification/escrow-create.js +8 -10
- package/lib/parse/specification/escrow-finish.js +6 -5
- package/lib/parse/specification/fee-update.js +2 -0
- package/lib/parse/specification/genesis-mint.js +2 -0
- package/lib/parse/specification/import.js +6 -5
- package/lib/parse/specification/invoke.js +8 -10
- package/lib/parse/specification/mptoken-authorize.js +6 -6
- package/lib/parse/specification/mptoken-issuance-create.js +6 -6
- package/lib/parse/specification/mptoken-issuance-destroy.js +6 -6
- package/lib/parse/specification/mptoken-issuance-set.js +6 -6
- package/lib/parse/specification/nftoken-accept-offer.js +6 -5
- package/lib/parse/specification/nftoken-burn.js +6 -5
- package/lib/parse/specification/nftoken-cancel-offer.js +6 -5
- package/lib/parse/specification/nftoken-create-offer.js +8 -10
- package/lib/parse/specification/nftoken-mint.js +8 -10
- package/lib/parse/specification/offer-cancel.js +8 -5
- package/lib/parse/specification/offer-create.js +8 -5
- package/lib/parse/specification/oracle-delete.js +6 -6
- package/lib/parse/specification/oracle-set.js +6 -6
- package/lib/parse/specification/payment-channel-claim.js +9 -3
- package/lib/parse/specification/payment-channel-create.js +10 -13
- package/lib/parse/specification/payment-channel-fund.js +8 -2
- package/lib/parse/specification/payment.js +8 -15
- package/lib/parse/specification/remit.js +8 -11
- package/lib/parse/specification/settings.js +6 -0
- package/lib/parse/specification/ticket-create.js +6 -0
- package/lib/parse/specification/trustline.js +6 -0
- package/lib/parse/specification/unl-report.js +2 -7
- package/lib/parse/specification/unrecognized.js +6 -6
- package/lib/parse/specification/uritoken-burn.js +6 -0
- package/lib/parse/specification/uritoken-buy.js +6 -0
- package/lib/parse/specification/uritoken-cancel-sell-offer.js +6 -0
- package/lib/parse/specification/uritoken-create-sell-offer.js +8 -10
- package/lib/parse/specification/uritoken-mint.js +8 -10
- package/lib/parse/utils.d.ts +2 -2
- package/lib/parse/utils.js +3 -0
- package/lib/types/account.d.ts +5 -2
- package/lib/types/adjustments.d.ts +4 -4
- package/lib/types/amounts.d.ts +1 -1
- package/lib/types/escrows.d.ts +0 -5
- package/lib/types/gateway_balances.d.ts +3 -3
- package/lib/types/import.d.ts +0 -2
- package/lib/types/invoke.d.ts +2 -3
- package/lib/types/ledger.d.ts +1 -0
- package/lib/types/outcome.d.ts +1 -0
- package/lib/types/payments.d.ts +2 -2
- package/lib/types/remits.d.ts +0 -3
- package/lib/types/signers.d.ts +16 -0
- package/lib/types/specification.d.ts +4 -1
- package/lib/types/unl_reports.d.ts +0 -2
- package/lib/v1/transaction/payment.js +14 -2
- package/package.json +1 -1
|
@@ -36,16 +36,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
const assert = __importStar(require("assert"));
|
|
37
37
|
const common_1 = require("../../common");
|
|
38
38
|
const memos_1 = require("../ledger/memos");
|
|
39
|
-
const
|
|
39
|
+
const signers_1 = require("../ledger/signers");
|
|
40
|
+
const regular_key_1 = require("../ledger/regular-key");
|
|
41
|
+
const source_1 = require("../ledger/source");
|
|
40
42
|
const oracle_changes_1 = require("../outcome/oracle_changes");
|
|
41
43
|
function parseDidSet(tx) {
|
|
42
44
|
assert.ok(tx.TransactionType === "OracleSet");
|
|
43
|
-
const source = (0, common_1.removeUndefined)({
|
|
44
|
-
address: (0, account_1.parseAccount)(tx.Account),
|
|
45
|
-
tag: tx.SourceTag,
|
|
46
|
-
});
|
|
47
45
|
return (0, common_1.removeUndefined)({
|
|
48
|
-
|
|
46
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
47
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
48
|
+
source: (0, source_1.parseSource)(tx),
|
|
49
49
|
oracleDocumentID: tx.OracleDocumentID,
|
|
50
50
|
provider: tx.Provider,
|
|
51
51
|
uri: tx.URI,
|
|
@@ -39,15 +39,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
const assert = __importStar(require("assert"));
|
|
40
40
|
const xrpl_1 = require("xrpl");
|
|
41
41
|
const common_1 = require("../../common");
|
|
42
|
-
const
|
|
42
|
+
const amount_1 = __importDefault(require("../ledger/amount"));
|
|
43
43
|
const emit_details_1 = require("../ledger/emit_details");
|
|
44
44
|
const memos_1 = require("../ledger/memos");
|
|
45
|
+
const signers_1 = require("../ledger/signers");
|
|
46
|
+
const regular_key_1 = require("../ledger/regular-key");
|
|
47
|
+
const source_1 = require("../ledger/source");
|
|
45
48
|
function parsePaymentChannelClaim(tx) {
|
|
46
49
|
assert.ok(tx.TransactionType === "PaymentChannelClaim");
|
|
47
50
|
return (0, common_1.removeUndefined)({
|
|
51
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
52
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
53
|
+
source: (0, source_1.parseSource)(tx),
|
|
48
54
|
channel: tx.Channel,
|
|
49
|
-
balance: (0,
|
|
50
|
-
amount: (0,
|
|
55
|
+
balance: (0, amount_1.default)(tx.Balance),
|
|
56
|
+
amount: (0, amount_1.default)(tx.Amount),
|
|
51
57
|
signature: tx.Signature,
|
|
52
58
|
publicKey: tx.PublicKey,
|
|
53
59
|
renew: Boolean(tx.Flags & xrpl_1.PaymentChannelClaimFlags.tfRenew) || undefined,
|
|
@@ -39,24 +39,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
const assert = __importStar(require("assert"));
|
|
40
40
|
const common_1 = require("../../common");
|
|
41
41
|
const utils_1 = require("../utils");
|
|
42
|
-
const
|
|
42
|
+
const amount_1 = __importDefault(require("../ledger/amount"));
|
|
43
43
|
const emit_details_1 = require("../ledger/emit_details");
|
|
44
44
|
const memos_1 = require("../ledger/memos");
|
|
45
|
-
const
|
|
45
|
+
const signers_1 = require("../ledger/signers");
|
|
46
|
+
const regular_key_1 = require("../ledger/regular-key");
|
|
47
|
+
const source_1 = require("../ledger/source");
|
|
48
|
+
const destination_1 = require("../ledger/destination");
|
|
46
49
|
function parsePaymentChannelCreate(tx) {
|
|
47
50
|
assert.ok(tx.TransactionType === "PaymentChannelCreate");
|
|
48
|
-
const source = {
|
|
49
|
-
address: (0, account_1.parseAccount)(tx.Account),
|
|
50
|
-
tag: tx.SourceTag,
|
|
51
|
-
};
|
|
52
|
-
const destination = {
|
|
53
|
-
address: tx.Destination,
|
|
54
|
-
tag: tx.DestinationTag,
|
|
55
|
-
};
|
|
56
51
|
return (0, common_1.removeUndefined)({
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
52
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
53
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
54
|
+
source: (0, source_1.parseSource)(tx),
|
|
55
|
+
destination: (0, destination_1.parseDestination)(tx),
|
|
56
|
+
amount: (0, amount_1.default)(tx.Amount),
|
|
60
57
|
settleDelay: tx.SettleDelay,
|
|
61
58
|
publicKey: tx.PublicKey,
|
|
62
59
|
cancelAfter: tx.CancelAfter && (0, utils_1.parseTimestamp)(tx.CancelAfter),
|
|
@@ -39,14 +39,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
const assert = __importStar(require("assert"));
|
|
40
40
|
const common_1 = require("../../common");
|
|
41
41
|
const utils_1 = require("../utils");
|
|
42
|
-
const
|
|
42
|
+
const amount_1 = __importDefault(require("../ledger/amount"));
|
|
43
43
|
const emit_details_1 = require("../ledger/emit_details");
|
|
44
44
|
const memos_1 = require("../ledger/memos");
|
|
45
|
+
const signers_1 = require("../ledger/signers");
|
|
46
|
+
const regular_key_1 = require("../ledger/regular-key");
|
|
47
|
+
const source_1 = require("../ledger/source");
|
|
45
48
|
function parsePaymentChannelFund(tx) {
|
|
46
49
|
assert.ok(tx.TransactionType === "PaymentChannelFund");
|
|
47
50
|
return (0, common_1.removeUndefined)({
|
|
51
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
52
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
53
|
+
source: (0, source_1.parseSource)(tx),
|
|
48
54
|
channel: tx.Channel,
|
|
49
|
-
amount: (0,
|
|
55
|
+
amount: (0, amount_1.default)(tx.Amount),
|
|
50
56
|
expiration: tx.Expiration && (0, utils_1.parseTimestamp)(tx.Expiration),
|
|
51
57
|
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
52
58
|
memos: (0, memos_1.parseMemos)(tx),
|
|
@@ -32,17 +32,17 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
36
|
const assert = __importStar(require("assert"));
|
|
40
37
|
const xrpl_1 = require("xrpl");
|
|
41
38
|
const utils_1 = require("../utils");
|
|
42
39
|
const common_1 = require("../../common");
|
|
43
|
-
const amount_1 = __importDefault(require("../ledger/amount"));
|
|
44
40
|
const emit_details_1 = require("../ledger/emit_details");
|
|
45
41
|
const memos_1 = require("../ledger/memos");
|
|
42
|
+
const signers_1 = require("../ledger/signers");
|
|
43
|
+
const regular_key_1 = require("../ledger/regular-key");
|
|
44
|
+
const source_1 = require("../ledger/source");
|
|
45
|
+
const destination_1 = require("../ledger/destination");
|
|
46
46
|
function isNoDirectRipple(tx) {
|
|
47
47
|
return (tx.Flags & xrpl_1.PaymentFlags.tfNoRippleDirect) !== 0;
|
|
48
48
|
}
|
|
@@ -51,18 +51,11 @@ function isQualityLimited(tx) {
|
|
|
51
51
|
}
|
|
52
52
|
function parsePayment(tx) {
|
|
53
53
|
assert.ok(tx.TransactionType === "Payment");
|
|
54
|
-
const source = {
|
|
55
|
-
address: tx.Account,
|
|
56
|
-
maxAmount: (0, utils_1.removeGenericCounterparty)((0, amount_1.default)(tx.SendMax || tx.DeliverMax || tx.Amount), tx.Account),
|
|
57
|
-
tag: tx.SourceTag,
|
|
58
|
-
};
|
|
59
|
-
const destination = {
|
|
60
|
-
address: tx.Destination,
|
|
61
|
-
tag: tx.DestinationTag,
|
|
62
|
-
};
|
|
63
54
|
return (0, common_1.removeUndefined)({
|
|
64
|
-
source: (0,
|
|
65
|
-
destination: (0,
|
|
55
|
+
source: (0, source_1.parseSourceWithAmount)(tx),
|
|
56
|
+
destination: (0, destination_1.parseDestination)(tx),
|
|
57
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
58
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
66
59
|
invoiceID: tx.InvoiceID,
|
|
67
60
|
paths: tx.Paths ? JSON.stringify(tx.Paths) : undefined,
|
|
68
61
|
allowPartialPayment: (0, utils_1.isPartialPayment)(tx) || undefined,
|
|
@@ -40,7 +40,10 @@ const assert = __importStar(require("assert"));
|
|
|
40
40
|
const common_1 = require("../../common");
|
|
41
41
|
const emit_details_1 = require("../ledger/emit_details");
|
|
42
42
|
const memos_1 = require("../ledger/memos");
|
|
43
|
-
const
|
|
43
|
+
const signers_1 = require("../ledger/signers");
|
|
44
|
+
const regular_key_1 = require("../ledger/regular-key");
|
|
45
|
+
const source_1 = require("../ledger/source");
|
|
46
|
+
const destination_1 = require("../ledger/destination");
|
|
44
47
|
const uritoken_flags_1 = __importDefault(require("../ledger/uritoken-flags"));
|
|
45
48
|
function parseAmounts(amounts) {
|
|
46
49
|
if (!amounts) {
|
|
@@ -69,17 +72,11 @@ function parseMintURIToken(mintURIToken) {
|
|
|
69
72
|
}
|
|
70
73
|
function parseRemit(tx) {
|
|
71
74
|
assert.ok(tx.TransactionType === "Remit");
|
|
72
|
-
const source = {
|
|
73
|
-
address: (0, account_1.parseAccount)(tx.Account),
|
|
74
|
-
tag: tx.SourceTag,
|
|
75
|
-
};
|
|
76
|
-
const destination = {
|
|
77
|
-
address: tx.Destination,
|
|
78
|
-
tag: tx.DestinationTag,
|
|
79
|
-
};
|
|
80
75
|
return (0, common_1.removeUndefined)({
|
|
81
|
-
|
|
82
|
-
|
|
76
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
77
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
78
|
+
source: (0, source_1.parseSource)(tx),
|
|
79
|
+
destination: (0, destination_1.parseDestination)(tx),
|
|
83
80
|
amounts: parseAmounts(tx.Amounts),
|
|
84
81
|
uritokenIDs: tx.URITokenIDs,
|
|
85
82
|
uritokenMint: parseMintURIToken(tx.MintURIToken),
|
|
@@ -43,6 +43,9 @@ const common_1 = require("../../common");
|
|
|
43
43
|
const fields_1 = __importDefault(require("../ledger/fields"));
|
|
44
44
|
const emit_details_1 = require("../ledger/emit_details");
|
|
45
45
|
const memos_1 = require("../ledger/memos");
|
|
46
|
+
const signers_1 = require("../ledger/signers");
|
|
47
|
+
const regular_key_1 = require("../ledger/regular-key");
|
|
48
|
+
const source_1 = require("../ledger/source");
|
|
46
49
|
function getAccountRootModifiedNode(tx) {
|
|
47
50
|
const modifiedNodes = tx.meta.AffectedNodes.filter((node) => node.ModifiedNode?.LedgerEntryType === "AccountRoot");
|
|
48
51
|
assert.ok(modifiedNodes.length === 1);
|
|
@@ -84,6 +87,9 @@ function parseSettings(tx) {
|
|
|
84
87
|
const txType = tx.TransactionType;
|
|
85
88
|
assert.ok(txType === "AccountSet" || txType === "SetRegularKey" || txType === "SignerListSet");
|
|
86
89
|
const baseSettings = (0, common_1.removeUndefined)({
|
|
90
|
+
source: (0, source_1.parseSource)(tx),
|
|
91
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
92
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
87
93
|
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
88
94
|
memos: (0, memos_1.parseMemos)(tx),
|
|
89
95
|
});
|
|
@@ -37,9 +37,15 @@ const assert = __importStar(require("assert"));
|
|
|
37
37
|
const common_1 = require("../../common");
|
|
38
38
|
const emit_details_1 = require("../ledger/emit_details");
|
|
39
39
|
const memos_1 = require("../ledger/memos");
|
|
40
|
+
const signers_1 = require("../ledger/signers");
|
|
41
|
+
const regular_key_1 = require("../ledger/regular-key");
|
|
42
|
+
const source_1 = require("../ledger/source");
|
|
40
43
|
function parseTicketCreate(tx) {
|
|
41
44
|
assert.ok(tx.TransactionType === "TicketCreate");
|
|
42
45
|
return (0, common_1.removeUndefined)({
|
|
46
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
47
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
48
|
+
source: (0, source_1.parseSource)(tx),
|
|
43
49
|
ticketCount: tx.TicketCount,
|
|
44
50
|
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
45
51
|
memos: (0, memos_1.parseMemos)(tx),
|
|
@@ -39,6 +39,9 @@ const utils_1 = require("../utils");
|
|
|
39
39
|
const common_1 = require("../../common");
|
|
40
40
|
const emit_details_1 = require("../ledger/emit_details");
|
|
41
41
|
const memos_1 = require("../ledger/memos");
|
|
42
|
+
const signers_1 = require("../ledger/signers");
|
|
43
|
+
const regular_key_1 = require("../ledger/regular-key");
|
|
44
|
+
const source_1 = require("../ledger/source");
|
|
42
45
|
function parseFlag(flagsValue, trueValue, falseValue) {
|
|
43
46
|
if (flagsValue & trueValue) {
|
|
44
47
|
return true;
|
|
@@ -51,6 +54,9 @@ function parseFlag(flagsValue, trueValue, falseValue) {
|
|
|
51
54
|
function parseTrustline(tx) {
|
|
52
55
|
assert.ok(tx.TransactionType === "TrustSet");
|
|
53
56
|
return (0, common_1.removeUndefined)({
|
|
57
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
58
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
59
|
+
source: (0, source_1.parseSource)(tx),
|
|
54
60
|
limit: tx.LimitAmount.value,
|
|
55
61
|
currency: tx.LimitAmount.currency,
|
|
56
62
|
counterparty: tx.LimitAmount.issuer,
|
|
@@ -35,21 +35,16 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
const assert = __importStar(require("assert"));
|
|
37
37
|
const common_1 = require("../../common");
|
|
38
|
-
const
|
|
38
|
+
const source_1 = require("../ledger/source");
|
|
39
39
|
const memos_1 = require("../ledger/memos");
|
|
40
|
-
const account_1 = require("../ledger/account");
|
|
41
40
|
function parseUNLReport(tx) {
|
|
42
41
|
assert.ok(tx.TransactionType === "UNLReport");
|
|
43
|
-
const source = {
|
|
44
|
-
address: (0, account_1.parseAccount)(tx.Account),
|
|
45
|
-
};
|
|
46
42
|
const activeValidator = tx.ActiveValidator?.PublicKey;
|
|
47
43
|
const importVLKey = tx.ImportVLKey?.PublicKey;
|
|
48
44
|
return (0, common_1.removeUndefined)({
|
|
49
|
-
source: (0,
|
|
45
|
+
source: (0, source_1.parseSource)(tx),
|
|
50
46
|
activeValidator,
|
|
51
47
|
importVLKey,
|
|
52
|
-
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
53
48
|
memos: (0, memos_1.parseMemos)(tx),
|
|
54
49
|
});
|
|
55
50
|
}
|
|
@@ -3,16 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const common_1 = require("../../common");
|
|
4
4
|
const emit_details_1 = require("../ledger/emit_details");
|
|
5
5
|
const memos_1 = require("../ledger/memos");
|
|
6
|
-
const
|
|
6
|
+
const signers_1 = require("../ledger/signers");
|
|
7
|
+
const regular_key_1 = require("../ledger/regular-key");
|
|
8
|
+
const source_1 = require("../ledger/source");
|
|
7
9
|
function unrecognizedParser(tx) {
|
|
8
|
-
const source = (0, common_1.removeUndefined)({
|
|
9
|
-
address: (0, account_1.parseAccount)(tx.Account),
|
|
10
|
-
tag: tx.SourceTag,
|
|
11
|
-
});
|
|
12
10
|
return (0, common_1.removeUndefined)({
|
|
13
11
|
UNAVAILABLE: "Unrecognized transaction type.",
|
|
14
12
|
SEE_RAW_TRANSACTION: "Since this type is unrecognized, `rawTransaction` is may included in this response.",
|
|
15
|
-
source:
|
|
13
|
+
source: (0, source_1.parseSource)(tx),
|
|
14
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
15
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
16
16
|
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
17
17
|
memos: (0, memos_1.parseMemos)(tx),
|
|
18
18
|
});
|
|
@@ -37,10 +37,16 @@ const assert = __importStar(require("assert"));
|
|
|
37
37
|
const common_1 = require("../../common");
|
|
38
38
|
const emit_details_1 = require("../ledger/emit_details");
|
|
39
39
|
const memos_1 = require("../ledger/memos");
|
|
40
|
+
const signers_1 = require("../ledger/signers");
|
|
41
|
+
const regular_key_1 = require("../ledger/regular-key");
|
|
42
|
+
const source_1 = require("../ledger/source");
|
|
40
43
|
function parseNFTokenBurn(tx) {
|
|
41
44
|
assert.ok(tx.TransactionType === "URITokenBurn");
|
|
42
45
|
return (0, common_1.removeUndefined)({
|
|
43
46
|
uritokenID: tx.URITokenID,
|
|
47
|
+
source: (0, source_1.parseSource)(tx),
|
|
48
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
49
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
44
50
|
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
45
51
|
memos: (0, memos_1.parseMemos)(tx),
|
|
46
52
|
});
|
|
@@ -37,11 +37,17 @@ const assert = __importStar(require("assert"));
|
|
|
37
37
|
const common_1 = require("../../common");
|
|
38
38
|
const emit_details_1 = require("../ledger/emit_details");
|
|
39
39
|
const memos_1 = require("../ledger/memos");
|
|
40
|
+
const signers_1 = require("../ledger/signers");
|
|
41
|
+
const regular_key_1 = require("../ledger/regular-key");
|
|
42
|
+
const source_1 = require("../ledger/source");
|
|
40
43
|
function parseNFTokenBurn(tx) {
|
|
41
44
|
assert.ok(tx.TransactionType === "URITokenBuy");
|
|
42
45
|
return (0, common_1.removeUndefined)({
|
|
43
46
|
uritokenID: tx.URITokenID,
|
|
44
47
|
amount: tx.Amount,
|
|
48
|
+
source: (0, source_1.parseSource)(tx),
|
|
49
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
50
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
45
51
|
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
46
52
|
memos: (0, memos_1.parseMemos)(tx),
|
|
47
53
|
});
|
|
@@ -37,10 +37,16 @@ const assert = __importStar(require("assert"));
|
|
|
37
37
|
const common_1 = require("../../common");
|
|
38
38
|
const emit_details_1 = require("../ledger/emit_details");
|
|
39
39
|
const memos_1 = require("../ledger/memos");
|
|
40
|
+
const signers_1 = require("../ledger/signers");
|
|
41
|
+
const regular_key_1 = require("../ledger/regular-key");
|
|
42
|
+
const source_1 = require("../ledger/source");
|
|
40
43
|
function parseNFTokenBurn(tx) {
|
|
41
44
|
assert.ok(tx.TransactionType === "URITokenCancelSellOffer");
|
|
42
45
|
return (0, common_1.removeUndefined)({
|
|
43
46
|
uritokenID: tx.URITokenID,
|
|
47
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
48
|
+
source: (0, source_1.parseSource)(tx),
|
|
49
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
44
50
|
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
45
51
|
memos: (0, memos_1.parseMemos)(tx),
|
|
46
52
|
});
|
|
@@ -37,21 +37,19 @@ const assert = __importStar(require("assert"));
|
|
|
37
37
|
const common_1 = require("../../common");
|
|
38
38
|
const emit_details_1 = require("../ledger/emit_details");
|
|
39
39
|
const memos_1 = require("../ledger/memos");
|
|
40
|
-
const
|
|
40
|
+
const signers_1 = require("../ledger/signers");
|
|
41
|
+
const regular_key_1 = require("../ledger/regular-key");
|
|
42
|
+
const source_1 = require("../ledger/source");
|
|
43
|
+
const destination_1 = require("../ledger/destination");
|
|
41
44
|
function parseNFTokenBurn(tx) {
|
|
42
45
|
assert.ok(tx.TransactionType === "URITokenCreateSellOffer");
|
|
43
|
-
const source = (0, common_1.removeUndefined)({
|
|
44
|
-
address: (0, account_1.parseAccount)(tx.Account),
|
|
45
|
-
tag: tx.SourceTag,
|
|
46
|
-
});
|
|
47
|
-
const destination = (0, common_1.removeUndefined)({
|
|
48
|
-
address: tx.Destination,
|
|
49
|
-
});
|
|
50
46
|
return (0, common_1.removeUndefined)({
|
|
51
47
|
uritokenID: tx.URITokenID,
|
|
52
48
|
amount: tx.Amount,
|
|
53
|
-
source:
|
|
54
|
-
destination:
|
|
49
|
+
source: (0, source_1.parseSource)(tx),
|
|
50
|
+
destination: (0, destination_1.parseDestination)(tx),
|
|
51
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
52
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
55
53
|
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
56
54
|
memos: (0, memos_1.parseMemos)(tx),
|
|
57
55
|
});
|
|
@@ -41,23 +41,21 @@ const common_1 = require("../../common");
|
|
|
41
41
|
const uritoken_flags_1 = __importDefault(require("../ledger/uritoken-flags"));
|
|
42
42
|
const emit_details_1 = require("../ledger/emit_details");
|
|
43
43
|
const memos_1 = require("../ledger/memos");
|
|
44
|
-
const
|
|
44
|
+
const signers_1 = require("../ledger/signers");
|
|
45
|
+
const regular_key_1 = require("../ledger/regular-key");
|
|
46
|
+
const source_1 = require("../ledger/source");
|
|
47
|
+
const destination_1 = require("../ledger/destination");
|
|
45
48
|
function parseNFTokenMint(tx) {
|
|
46
49
|
assert.ok(tx.TransactionType === "URITokenMint");
|
|
47
|
-
const source = (0, common_1.removeUndefined)({
|
|
48
|
-
address: (0, account_1.parseAccount)(tx.Account),
|
|
49
|
-
tag: tx.SourceTag,
|
|
50
|
-
});
|
|
51
|
-
const destination = (0, common_1.removeUndefined)({
|
|
52
|
-
address: tx.Destination,
|
|
53
|
-
});
|
|
54
50
|
return (0, common_1.removeUndefined)({
|
|
55
51
|
uri: tx.URI,
|
|
56
52
|
flags: (0, uritoken_flags_1.default)(tx.Flags),
|
|
57
53
|
digest: tx.Digest,
|
|
58
54
|
amount: tx.Amount,
|
|
59
|
-
source:
|
|
60
|
-
destination:
|
|
55
|
+
source: (0, source_1.parseSource)(tx),
|
|
56
|
+
destination: (0, destination_1.parseDestination)(tx),
|
|
57
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
58
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
61
59
|
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
62
60
|
memos: (0, memos_1.parseMemos)(tx),
|
|
63
61
|
});
|
package/lib/parse/utils.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { TransactionMetadata } from "xrpl";
|
|
2
|
-
import { FormattedIssuedCurrencyAmount, FormattedIssuedMPTAmount } from "../types";
|
|
2
|
+
import { IssuedCurrencyAmount, FormattedIssuedCurrencyAmount, FormattedIssuedMPTAmount } from "../types";
|
|
3
3
|
declare function adjustQualityForXRP(quality: string, takerGetsCurrency: string, takerPaysCurrency: string): string;
|
|
4
4
|
declare function parseQuality(quality?: number | null): number | undefined;
|
|
5
5
|
declare function parseTimestamp(rippleTime?: number | null): string | undefined;
|
|
6
6
|
declare function isPartialPayment(tx: any): boolean;
|
|
7
|
-
declare function removeGenericCounterparty(amount: FormattedIssuedCurrencyAmount | FormattedIssuedMPTAmount, address: string): FormattedIssuedCurrencyAmount | FormattedIssuedMPTAmount;
|
|
7
|
+
declare function removeGenericCounterparty(amount: IssuedCurrencyAmount | FormattedIssuedCurrencyAmount | FormattedIssuedMPTAmount, address: string): FormattedIssuedCurrencyAmount | FormattedIssuedMPTAmount;
|
|
8
8
|
declare function normalizeNodes(metadata: TransactionMetadata): any[];
|
|
9
9
|
declare function hexToString(hex: string | undefined): string | undefined;
|
|
10
10
|
declare function stringToHex(value: string | undefined): string | undefined;
|
package/lib/parse/utils.js
CHANGED
|
@@ -45,6 +45,9 @@ function removeGenericCounterparty(amount, address) {
|
|
|
45
45
|
if ("counterparty" in amount) {
|
|
46
46
|
return amount.counterparty === address ? lodash_1.default.omit(amount, "counterparty") : amount;
|
|
47
47
|
}
|
|
48
|
+
if ("issuer" in amount) {
|
|
49
|
+
return amount.issuer === address ? lodash_1.default.omit(amount, "issuer") : amount;
|
|
50
|
+
}
|
|
48
51
|
return amount;
|
|
49
52
|
}
|
|
50
53
|
function normalizeNode(affectedNode) {
|
package/lib/types/account.d.ts
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { FormattedBaseSpecification } from "./specification";
|
|
2
|
-
import { FormattedIssuedCurrencyAmount, FormattedIssuedMPTAmount } from "./amounts";
|
|
2
|
+
import { IssuedCurrencyAmount, FormattedIssuedCurrencyAmount, FormattedIssuedMPTAmount } from "./amounts";
|
|
3
3
|
export type FormattedAccountDeleteSpecification = {
|
|
4
4
|
source?: FormattedSourceAddress;
|
|
5
5
|
destination?: FormattedDestinationAddress;
|
|
6
6
|
} & FormattedBaseSpecification;
|
|
7
7
|
export type FormattedSourceAddress = {
|
|
8
8
|
address: string;
|
|
9
|
-
maxAmount?: FormattedIssuedCurrencyAmount | FormattedIssuedMPTAmount;
|
|
9
|
+
maxAmount?: IssuedCurrencyAmount | FormattedIssuedCurrencyAmount | FormattedIssuedMPTAmount;
|
|
10
10
|
tag?: number;
|
|
11
11
|
};
|
|
12
12
|
export type FormattedDestinationAddress = {
|
|
13
13
|
address: string;
|
|
14
14
|
tag?: number;
|
|
15
15
|
};
|
|
16
|
+
export type FormattedSignerRegularKey = {
|
|
17
|
+
address: string;
|
|
18
|
+
};
|
|
16
19
|
export type FormattedAccountInfoData = {
|
|
17
20
|
sequence: number;
|
|
18
21
|
xrpBalance: string;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { FormattedIssuedCurrencyAmount } from "./amounts";
|
|
1
|
+
import { IssuedCurrencyAmount, FormattedIssuedCurrencyAmount } from "./amounts";
|
|
2
2
|
export type Adjustment = {
|
|
3
3
|
address: string;
|
|
4
|
-
amount: FormattedIssuedCurrencyAmount;
|
|
4
|
+
amount: IssuedCurrencyAmount | FormattedIssuedCurrencyAmount;
|
|
5
5
|
tag?: number;
|
|
6
6
|
};
|
|
7
7
|
export type MaxAdjustment = {
|
|
8
8
|
address: string;
|
|
9
|
-
maxAmount: FormattedIssuedCurrencyAmount;
|
|
9
|
+
maxAmount: IssuedCurrencyAmount | FormattedIssuedCurrencyAmount;
|
|
10
10
|
tag?: number;
|
|
11
11
|
};
|
|
12
12
|
export type MinAdjustment = {
|
|
13
13
|
address: string;
|
|
14
|
-
minAmount: FormattedIssuedCurrencyAmount;
|
|
14
|
+
minAmount: IssuedCurrencyAmount | FormattedIssuedCurrencyAmount;
|
|
15
15
|
tag?: number;
|
|
16
16
|
};
|
package/lib/types/amounts.d.ts
CHANGED
|
@@ -17,4 +17,4 @@ export interface FormattedIssuedMPTAmount {
|
|
|
17
17
|
value: string;
|
|
18
18
|
}
|
|
19
19
|
export type Amount = IssuedCurrencyAmount | FormattedIssuedMPTAmount | string;
|
|
20
|
-
export type FormattedAmount = FormattedIssuedCurrencyAmount | FormattedIssuedMPTAmount | string;
|
|
20
|
+
export type FormattedAmount = IssuedCurrency | FormattedIssuedCurrencyAmount | FormattedIssuedMPTAmount | string;
|
package/lib/types/escrows.d.ts
CHANGED
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
import { FormattedBaseSpecification } from "./specification";
|
|
2
2
|
import { Amount } from "./amounts";
|
|
3
|
-
import { FormattedSourceAddress, FormattedDestinationAddress } from "./account";
|
|
4
3
|
export type FormattedEscrowCancelSpecification = {
|
|
5
|
-
source: FormattedSourceAddress;
|
|
6
4
|
owner: string;
|
|
7
5
|
escrowSequence: number;
|
|
8
6
|
} & FormattedBaseSpecification;
|
|
9
7
|
export type FormattedEscrowCreateSpecification = {
|
|
10
8
|
amount?: Amount;
|
|
11
|
-
source: FormattedSourceAddress;
|
|
12
|
-
destination: FormattedDestinationAddress;
|
|
13
9
|
condition: string;
|
|
14
10
|
allowCancelAfter?: string;
|
|
15
11
|
allowExecuteAfter?: string;
|
|
16
12
|
} & FormattedBaseSpecification;
|
|
17
13
|
export type FormattedEscrowFinishSpecification = {
|
|
18
|
-
source: FormattedSourceAddress;
|
|
19
14
|
owner: string;
|
|
20
15
|
escrowSequence: number;
|
|
21
16
|
condition?: string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { FormattedIssuedCurrency } from "./amounts";
|
|
1
|
+
import { IssuedCurrency, FormattedIssuedCurrency } from "./amounts";
|
|
2
2
|
type FormattedGatewayBalanceObligations = {
|
|
3
3
|
currency: string;
|
|
4
4
|
value: string;
|
|
5
5
|
};
|
|
6
6
|
export type FormattedGatewayBalances = {
|
|
7
|
-
balances?: FormattedIssuedCurrency[];
|
|
8
|
-
assets?: FormattedIssuedCurrency[];
|
|
7
|
+
balances?: IssuedCurrency[] | FormattedIssuedCurrency[];
|
|
8
|
+
assets?: IssuedCurrency[] | FormattedIssuedCurrency[];
|
|
9
9
|
obligations?: FormattedGatewayBalanceObligations[];
|
|
10
10
|
};
|
|
11
11
|
export {};
|
package/lib/types/import.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { FormattedBaseSpecification } from "./specification";
|
|
2
|
-
import { FormattedSourceAddress } from "./account";
|
|
3
2
|
import { FormattedSpecification } from "../parse/transaction";
|
|
4
3
|
import { Outcome } from "./outcome";
|
|
5
4
|
export type FormattedImportBlobSpecification = {
|
|
@@ -18,6 +17,5 @@ export type FormattedImportBlobSpecification = {
|
|
|
18
17
|
};
|
|
19
18
|
};
|
|
20
19
|
export type FormattedImportSpecification = {
|
|
21
|
-
source: FormattedSourceAddress;
|
|
22
20
|
blob: FormattedImportBlobSpecification | string;
|
|
23
21
|
} & FormattedBaseSpecification;
|
package/lib/types/invoke.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FormattedBaseSpecification } from "./specification";
|
|
2
|
-
import {
|
|
2
|
+
import { FormattedDestinationAddress } from "./account";
|
|
3
3
|
export type FormattedInvokeSpecification = {
|
|
4
|
-
|
|
5
|
-
destination: FormattedDestinationAddress;
|
|
4
|
+
destination?: FormattedDestinationAddress;
|
|
6
5
|
} & FormattedBaseSpecification;
|
package/lib/types/ledger.d.ts
CHANGED
package/lib/types/outcome.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { LockedBalanceChanges } from "../parse/outcome/locked_balance_changes";
|
|
|
3
3
|
import { BalanceChanges } from "../parse/outcome/balance_changes";
|
|
4
4
|
export type Outcome = {
|
|
5
5
|
result?: string;
|
|
6
|
+
ledgerIndex?: number;
|
|
6
7
|
ledgerVersion?: number;
|
|
7
8
|
indexInLedger?: number;
|
|
8
9
|
fee?: string;
|
package/lib/types/payments.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FormattedBaseSpecification } from "./specification";
|
|
2
2
|
import { FormattedSourceAddress, FormattedDestinationAddress } from "./account";
|
|
3
3
|
export type FormattedPaymentSpecification = {
|
|
4
|
-
source
|
|
5
|
-
destination
|
|
4
|
+
source?: FormattedSourceAddress;
|
|
5
|
+
destination?: FormattedDestinationAddress;
|
|
6
6
|
invoiceID?: string;
|
|
7
7
|
paths?: string;
|
|
8
8
|
allowPartialPayment?: boolean;
|
package/lib/types/remits.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { FormattedBaseSpecification } from "./specification";
|
|
2
|
-
import { FormattedDestinationAddress, FormattedSourceAddress } from "./account";
|
|
3
2
|
import { Amount } from "./amounts";
|
|
4
3
|
import { URITokenFlagsKeysInterface } from "./uritokens";
|
|
5
4
|
export type FormattedRemitsSpecification = {
|
|
6
|
-
source: FormattedSourceAddress;
|
|
7
|
-
destination: FormattedDestinationAddress;
|
|
8
5
|
amounts?: Amount[];
|
|
9
6
|
uritokenIDs?: string[];
|
|
10
7
|
uritokenMint?: {
|
package/lib/types/signers.d.ts
CHANGED
|
@@ -4,3 +4,19 @@ export interface SignerEntry {
|
|
|
4
4
|
SignerWeight: number;
|
|
5
5
|
};
|
|
6
6
|
}
|
|
7
|
+
export interface FormattedSigner {
|
|
8
|
+
address: string;
|
|
9
|
+
weight: number;
|
|
10
|
+
}
|
|
11
|
+
export interface TransactionSigner {
|
|
12
|
+
Signer: {
|
|
13
|
+
SigningPubKey: string;
|
|
14
|
+
TxnSignature: string;
|
|
15
|
+
Account?: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface FormattedTransactionSigner {
|
|
19
|
+
address: string;
|
|
20
|
+
signingPubKey?: string;
|
|
21
|
+
txnSignature?: string;
|
|
22
|
+
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { FormattedSourceAddress } from "./account";
|
|
1
|
+
import { FormattedSourceAddress, FormattedSignerRegularKey } from "./account";
|
|
2
2
|
import { FormattedEmitDetails } from "./emit_details";
|
|
3
3
|
import { FormattedMemo } from "./memos";
|
|
4
|
+
import { FormattedTransactionSigner } from "./signers";
|
|
4
5
|
export type FormattedBaseSpecification = {
|
|
5
6
|
source?: FormattedSourceAddress;
|
|
7
|
+
signers?: FormattedTransactionSigner[];
|
|
8
|
+
signer?: FormattedSignerRegularKey;
|
|
6
9
|
emittedDetails?: FormattedEmitDetails;
|
|
7
10
|
memos?: FormattedMemo[];
|
|
8
11
|
};
|