@bithomp/xrpl-api 3.2.9 → 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/transaction.js +6 -0
- package/lib/parse/ledger/destination.d.ts +2 -0
- package/lib/parse/ledger/destination.js +12 -0
- 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/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 +6 -0
- package/lib/parse/specification/payment-channel-create.js +8 -11
- package/lib/parse/specification/payment-channel-fund.js +6 -0
- 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/types/account.d.ts +5 -2
- package/lib/types/escrows.d.ts +0 -5
- package/lib/types/import.d.ts +0 -2
- package/lib/types/invoke.d.ts +2 -3
- 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/package.json +2 -2
|
@@ -245,6 +245,9 @@ async function getAccountPaymentParams(account, connection) {
|
|
|
245
245
|
if (fee > FEE_LIMIT) {
|
|
246
246
|
fee = FEE_LIMIT;
|
|
247
247
|
}
|
|
248
|
+
if (!fee) {
|
|
249
|
+
throw new Error("Fee is not defined");
|
|
250
|
+
}
|
|
248
251
|
resolve((0, common_1.xrpToDrops)(fee.toString()));
|
|
249
252
|
});
|
|
250
253
|
const sequencePromise = new Promise(async (resolve, rejects) => {
|
|
@@ -310,6 +313,9 @@ async function getTxSubmitParams(account, tx, definitions, connection, skip) {
|
|
|
310
313
|
if (fee > FEE_LIMIT) {
|
|
311
314
|
fee = FEE_LIMIT;
|
|
312
315
|
}
|
|
316
|
+
if (!fee) {
|
|
317
|
+
throw new Error("Fee is not defined");
|
|
318
|
+
}
|
|
313
319
|
resolve((0, common_1.xrpToDrops)(fee.toString()));
|
|
314
320
|
}
|
|
315
321
|
catch (e) {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseDestination = parseDestination;
|
|
4
|
+
const common_1 = require("../../common");
|
|
5
|
+
function parseDestination(tx) {
|
|
6
|
+
if (tx && tx.Destination) {
|
|
7
|
+
return (0, common_1.removeUndefined)({
|
|
8
|
+
address: tx.Destination,
|
|
9
|
+
tag: tx.DestinationTag,
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseSignerRegularKey = parseSignerRegularKey;
|
|
4
|
+
const ripple_keypairs_1 = require("ripple-keypairs");
|
|
5
|
+
function parseSignerRegularKey(tx) {
|
|
6
|
+
if (tx && tx.SigningPubKey && !tx.Signers) {
|
|
7
|
+
const signedBy = (0, ripple_keypairs_1.deriveAddress)(tx.SigningPubKey);
|
|
8
|
+
if (signedBy !== tx.Account) {
|
|
9
|
+
return {
|
|
10
|
+
address: signedBy,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseSigners = parseSigners;
|
|
4
|
+
function parseSigners(tx) {
|
|
5
|
+
if (tx && tx.Signers) {
|
|
6
|
+
return tx.Signers.map((signer) => {
|
|
7
|
+
return {
|
|
8
|
+
address: signer.Signer.Account,
|
|
9
|
+
};
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.parseSourceWithAmount = parseSourceWithAmount;
|
|
7
|
+
exports.parseSource = parseSource;
|
|
8
|
+
const common_1 = require("../../common");
|
|
9
|
+
const amount_1 = __importDefault(require("./amount"));
|
|
10
|
+
const account_1 = require("./account");
|
|
11
|
+
const utils_1 = require("../utils");
|
|
12
|
+
function parseSourceWithAmount(tx) {
|
|
13
|
+
if (tx && (tx.Account || tx.Account === "")) {
|
|
14
|
+
return (0, common_1.removeUndefined)({
|
|
15
|
+
address: (0, account_1.parseAccount)(tx.Account),
|
|
16
|
+
maxAmount: (0, utils_1.removeGenericCounterparty)((0, amount_1.default)(tx.SendMax || tx.DeliverMax || tx.Amount), tx.Account),
|
|
17
|
+
tag: tx.SourceTag,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function parseSource(tx) {
|
|
22
|
+
if (tx && (tx.Account || tx.Account === "")) {
|
|
23
|
+
return (0, common_1.removeUndefined)({
|
|
24
|
+
address: (0, account_1.parseAccount)(tx.Account),
|
|
25
|
+
tag: tx.SourceTag,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -37,20 +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
|
|
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 parseAccountDelete(tx) {
|
|
42
45
|
assert.ok(tx.TransactionType === "AccountDelete");
|
|
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
|
-
tag: tx.DestinationTag,
|
|
50
|
-
});
|
|
51
46
|
return (0, common_1.removeUndefined)({
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
48
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
49
|
+
source: (0, source_1.parseSource)(tx),
|
|
50
|
+
destination: (0, destination_1.parseDestination)(tx),
|
|
54
51
|
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
55
52
|
memos: (0, memos_1.parseMemos)(tx),
|
|
56
53
|
});
|
|
@@ -42,15 +42,15 @@ const amount_1 = __importDefault(require("../ledger/amount"));
|
|
|
42
42
|
const asset_1 = __importDefault(require("../ledger/asset"));
|
|
43
43
|
const auth_accounts_1 = __importDefault(require("../ledger/auth-accounts"));
|
|
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");
|
|
46
48
|
function parseAmmBid(tx) {
|
|
47
49
|
assert.ok(tx.TransactionType === "AMMBid");
|
|
48
|
-
const source = (0, common_1.removeUndefined)({
|
|
49
|
-
address: (0, account_1.parseAccount)(tx.Account),
|
|
50
|
-
tag: tx.SourceTag,
|
|
51
|
-
});
|
|
52
50
|
return (0, common_1.removeUndefined)({
|
|
53
|
-
|
|
51
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
52
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
53
|
+
source: (0, source_1.parseSource)(tx),
|
|
54
54
|
asset: (0, asset_1.default)(tx.Asset),
|
|
55
55
|
asset2: (0, asset_1.default)(tx.Asset2),
|
|
56
56
|
bidMin: tx.BidMin ? (0, amount_1.default)(tx.BidMin) : undefined,
|
|
@@ -42,15 +42,16 @@ const amount_1 = __importDefault(require("../ledger/amount"));
|
|
|
42
42
|
const asset_1 = __importDefault(require("../ledger/asset"));
|
|
43
43
|
const memos_1 = require("../ledger/memos");
|
|
44
44
|
const account_1 = require("../ledger/account");
|
|
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
|
const amm_clawback_flags_1 = __importDefault(require("../ledger/amm-clawback-flags"));
|
|
46
49
|
function parseAmmClawback(tx) {
|
|
47
50
|
assert.ok(tx.TransactionType === "AMMClawback");
|
|
48
|
-
const source = (0, common_1.removeUndefined)({
|
|
49
|
-
address: (0, account_1.parseAccount)(tx.Account),
|
|
50
|
-
tag: tx.SourceTag,
|
|
51
|
-
});
|
|
52
51
|
return (0, common_1.removeUndefined)({
|
|
53
|
-
|
|
52
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
53
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
54
|
+
source: (0, source_1.parseSource)(tx),
|
|
54
55
|
asset: (0, asset_1.default)(tx.Asset),
|
|
55
56
|
asset2: (0, asset_1.default)(tx.Asset2),
|
|
56
57
|
amount: tx.Amount ? (0, amount_1.default)(tx.Amount) : undefined,
|
|
@@ -40,15 +40,15 @@ const assert = __importStar(require("assert"));
|
|
|
40
40
|
const common_1 = require("../../common");
|
|
41
41
|
const amount_1 = __importDefault(require("../ledger/amount"));
|
|
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");
|
|
44
46
|
function parseAmmCreate(tx) {
|
|
45
47
|
assert.ok(tx.TransactionType === "AMMCreate");
|
|
46
|
-
const source = (0, common_1.removeUndefined)({
|
|
47
|
-
address: (0, account_1.parseAccount)(tx.Account),
|
|
48
|
-
tag: tx.SourceTag,
|
|
49
|
-
});
|
|
50
48
|
return (0, common_1.removeUndefined)({
|
|
51
|
-
|
|
49
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
50
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
51
|
+
source: (0, source_1.parseSource)(tx),
|
|
52
52
|
amount: (0, amount_1.default)(tx.Amount),
|
|
53
53
|
amount2: (0, amount_1.default)(tx.Amount2),
|
|
54
54
|
tradingFee: tx.TradingFee,
|
|
@@ -40,15 +40,15 @@ const assert = __importStar(require("assert"));
|
|
|
40
40
|
const common_1 = require("../../common");
|
|
41
41
|
const asset_1 = __importDefault(require("../ledger/asset"));
|
|
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");
|
|
44
46
|
function parseAmmDelete(tx) {
|
|
45
47
|
assert.ok(tx.TransactionType === "AMMDelete");
|
|
46
|
-
const source = (0, common_1.removeUndefined)({
|
|
47
|
-
address: (0, account_1.parseAccount)(tx.Account),
|
|
48
|
-
tag: tx.SourceTag,
|
|
49
|
-
});
|
|
50
48
|
return (0, common_1.removeUndefined)({
|
|
51
|
-
|
|
49
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
50
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
51
|
+
source: (0, source_1.parseSource)(tx),
|
|
52
52
|
asset: (0, asset_1.default)(tx.Asset),
|
|
53
53
|
asset2: (0, asset_1.default)(tx.Asset2),
|
|
54
54
|
memos: (0, memos_1.parseMemos)(tx),
|
|
@@ -41,16 +41,16 @@ const common_1 = require("../../common");
|
|
|
41
41
|
const amount_1 = __importDefault(require("../ledger/amount"));
|
|
42
42
|
const asset_1 = __importDefault(require("../ledger/asset"));
|
|
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");
|
|
45
47
|
const amm_deposit_flags_1 = __importDefault(require("../ledger/amm-deposit-flags"));
|
|
46
48
|
function parseAmmDeposit(tx) {
|
|
47
49
|
assert.ok(tx.TransactionType === "AMMDeposit");
|
|
48
|
-
const source = (0, common_1.removeUndefined)({
|
|
49
|
-
address: (0, account_1.parseAccount)(tx.Account),
|
|
50
|
-
tag: tx.SourceTag,
|
|
51
|
-
});
|
|
52
50
|
return (0, common_1.removeUndefined)({
|
|
53
|
-
|
|
51
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
52
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
53
|
+
source: (0, source_1.parseSource)(tx),
|
|
54
54
|
asset: (0, asset_1.default)(tx.Asset),
|
|
55
55
|
asset2: (0, asset_1.default)(tx.Asset2),
|
|
56
56
|
amount: tx.Amount ? (0, amount_1.default)(tx.Amount) : undefined,
|
|
@@ -40,15 +40,15 @@ const assert = __importStar(require("assert"));
|
|
|
40
40
|
const common_1 = require("../../common");
|
|
41
41
|
const asset_1 = __importDefault(require("../ledger/asset"));
|
|
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");
|
|
44
46
|
function parseAmmVote(tx) {
|
|
45
47
|
assert.ok(tx.TransactionType === "AMMVote");
|
|
46
|
-
const source = (0, common_1.removeUndefined)({
|
|
47
|
-
address: (0, account_1.parseAccount)(tx.Account),
|
|
48
|
-
tag: tx.SourceTag,
|
|
49
|
-
});
|
|
50
48
|
return (0, common_1.removeUndefined)({
|
|
51
|
-
|
|
49
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
50
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
51
|
+
source: (0, source_1.parseSource)(tx),
|
|
52
52
|
asset: (0, asset_1.default)(tx.Asset),
|
|
53
53
|
asset2: (0, asset_1.default)(tx.Asset2),
|
|
54
54
|
tradingFee: tx.TradingFee,
|
|
@@ -41,16 +41,16 @@ const common_1 = require("../../common");
|
|
|
41
41
|
const amount_1 = __importDefault(require("../ledger/amount"));
|
|
42
42
|
const asset_1 = __importDefault(require("../ledger/asset"));
|
|
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");
|
|
45
47
|
const amm_withdraw_flags_1 = __importDefault(require("../ledger/amm-withdraw-flags"));
|
|
46
48
|
function parseAmmDeposit(tx) {
|
|
47
49
|
assert.ok(tx.TransactionType === "AMMWithdraw");
|
|
48
|
-
const source = (0, common_1.removeUndefined)({
|
|
49
|
-
address: (0, account_1.parseAccount)(tx.Account),
|
|
50
|
-
tag: tx.SourceTag,
|
|
51
|
-
});
|
|
52
50
|
return (0, common_1.removeUndefined)({
|
|
53
|
-
|
|
51
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
52
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
53
|
+
source: (0, source_1.parseSource)(tx),
|
|
54
54
|
asset: (0, asset_1.default)(tx.Asset),
|
|
55
55
|
asset2: (0, asset_1.default)(tx.Asset2),
|
|
56
56
|
amount: tx.Amount ? (0, amount_1.default)(tx.Amount) : undefined,
|
|
@@ -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 parseCheckCancel(tx) {
|
|
41
44
|
assert.ok(tx.TransactionType === "CheckCancel");
|
|
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
|
checkID: tx.CheckID,
|
|
44
50
|
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
45
51
|
memos: (0, memos_1.parseMemos)(tx),
|
|
@@ -41,9 +41,15 @@ const common_1 = require("../../common");
|
|
|
41
41
|
const amount_1 = __importDefault(require("../ledger/amount"));
|
|
42
42
|
const emit_details_1 = require("../ledger/emit_details");
|
|
43
43
|
const memos_1 = require("../ledger/memos");
|
|
44
|
+
const signers_1 = require("../ledger/signers");
|
|
45
|
+
const regular_key_1 = require("../ledger/regular-key");
|
|
46
|
+
const source_1 = require("../ledger/source");
|
|
44
47
|
function parseCheckCash(tx) {
|
|
45
48
|
assert.ok(tx.TransactionType === "CheckCash");
|
|
46
49
|
return (0, common_1.removeUndefined)({
|
|
50
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
51
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
52
|
+
source: (0, source_1.parseSource)(tx),
|
|
47
53
|
checkID: tx.CheckID,
|
|
48
54
|
amount: tx.Amount && (0, amount_1.default)(tx.Amount),
|
|
49
55
|
deliverMin: tx.DeliverMin && (0, amount_1.default)(tx.DeliverMin),
|
|
@@ -42,20 +42,17 @@ const utils_1 = require("../utils");
|
|
|
42
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 parseCheckCreate(tx) {
|
|
47
50
|
assert.ok(tx.TransactionType === "CheckCreate");
|
|
48
|
-
const source = (0, common_1.removeUndefined)({
|
|
49
|
-
address: (0, account_1.parseAccount)(tx.Account),
|
|
50
|
-
tag: tx.SourceTag,
|
|
51
|
-
});
|
|
52
|
-
const destination = (0, common_1.removeUndefined)({
|
|
53
|
-
address: tx.Destination,
|
|
54
|
-
tag: tx.DestinationTag,
|
|
55
|
-
});
|
|
56
51
|
return (0, common_1.removeUndefined)({
|
|
57
|
-
|
|
58
|
-
|
|
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),
|
|
59
56
|
sendMax: (0, amount_1.default)(tx.SendMax),
|
|
60
57
|
expiration: tx.Expiration && (0, utils_1.parseTimestamp)(tx.Expiration),
|
|
61
58
|
invoiceID: tx.InvoiceID,
|
|
@@ -41,15 +41,15 @@ const common_1 = require("../../common");
|
|
|
41
41
|
const amount_1 = __importDefault(require("../ledger/amount"));
|
|
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");
|
|
45
47
|
function parseClawback(tx) {
|
|
46
48
|
assert.ok(tx.TransactionType === "Clawback");
|
|
47
|
-
const source = (0, common_1.removeUndefined)({
|
|
48
|
-
address: (0, account_1.parseAccount)(tx.Account),
|
|
49
|
-
tag: tx.SourceTag,
|
|
50
|
-
});
|
|
51
49
|
return (0, common_1.removeUndefined)({
|
|
52
|
-
|
|
50
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
51
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
52
|
+
source: (0, source_1.parseSource)(tx),
|
|
53
53
|
amount: tx.Amount ? (0, amount_1.default)(tx.Amount) : undefined,
|
|
54
54
|
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
55
55
|
memos: (0, memos_1.parseMemos)(tx),
|
|
@@ -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 parseDepositPreauth(tx) {
|
|
41
44
|
assert.ok(tx.TransactionType === "DepositPreauth");
|
|
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
|
authorize: tx.Authorize,
|
|
44
50
|
unauthorize: tx.Unauthorize,
|
|
45
51
|
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
@@ -37,15 +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
|
|
40
|
+
const signers_1 = require("../ledger/signers");
|
|
41
|
+
const regular_key_1 = require("../ledger/regular-key");
|
|
42
|
+
const source_1 = require("../ledger/source");
|
|
41
43
|
function parseDidDelete(tx) {
|
|
42
44
|
assert.ok(tx.TransactionType === "DIDDelete");
|
|
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
|
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
50
50
|
memos: (0, memos_1.parseMemos)(tx),
|
|
51
51
|
});
|
|
@@ -37,15 +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
|
|
40
|
+
const signers_1 = require("../ledger/signers");
|
|
41
|
+
const regular_key_1 = require("../ledger/regular-key");
|
|
42
|
+
const source_1 = require("../ledger/source");
|
|
41
43
|
function parseDidSet(tx) {
|
|
42
44
|
assert.ok(tx.TransactionType === "DIDSet");
|
|
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
|
uri: tx.URI,
|
|
50
50
|
data: tx.Data,
|
|
51
51
|
didDocument: tx.DIDDocument,
|
|
@@ -37,14 +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 parseEscrowCancel(tx) {
|
|
41
44
|
assert.ok(tx.TransactionType === "EscrowCancel");
|
|
42
|
-
const source = {
|
|
43
|
-
address: tx.Account,
|
|
44
|
-
tag: tx.SourceTag,
|
|
45
|
-
};
|
|
46
45
|
return (0, common_1.removeUndefined)({
|
|
47
|
-
|
|
46
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
47
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
48
|
+
source: (0, source_1.parseSource)(tx),
|
|
48
49
|
owner: tx.Owner,
|
|
49
50
|
escrowSequence: tx.OfferSequence,
|
|
50
51
|
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
@@ -38,20 +38,18 @@ const common_1 = require("../../common");
|
|
|
38
38
|
const utils_1 = require("../utils");
|
|
39
39
|
const emit_details_1 = require("../ledger/emit_details");
|
|
40
40
|
const memos_1 = require("../ledger/memos");
|
|
41
|
+
const signers_1 = require("../ledger/signers");
|
|
42
|
+
const regular_key_1 = require("../ledger/regular-key");
|
|
43
|
+
const source_1 = require("../ledger/source");
|
|
44
|
+
const destination_1 = require("../ledger/destination");
|
|
41
45
|
function parseEscrowCreation(tx) {
|
|
42
46
|
assert.ok(tx.TransactionType === "EscrowCreate");
|
|
43
|
-
const source = {
|
|
44
|
-
address: tx.Account,
|
|
45
|
-
tag: tx.SourceTag,
|
|
46
|
-
};
|
|
47
|
-
const destination = {
|
|
48
|
-
address: tx.Destination,
|
|
49
|
-
tag: tx.DestinationTag,
|
|
50
|
-
};
|
|
51
47
|
return (0, common_1.removeUndefined)({
|
|
48
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
49
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
50
|
+
source: (0, source_1.parseSource)(tx),
|
|
51
|
+
destination: (0, destination_1.parseDestination)(tx),
|
|
52
52
|
amount: tx.Amount,
|
|
53
|
-
source: (0, common_1.removeUndefined)(source),
|
|
54
|
-
destination: (0, common_1.removeUndefined)(destination),
|
|
55
53
|
condition: tx.Condition,
|
|
56
54
|
allowCancelAfter: (0, utils_1.parseTimestamp)(tx.CancelAfter),
|
|
57
55
|
allowExecuteAfter: (0, utils_1.parseTimestamp)(tx.FinishAfter),
|
|
@@ -37,14 +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 parseEscrowFinish(tx) {
|
|
41
44
|
assert.ok(tx.TransactionType === "EscrowFinish");
|
|
42
|
-
const source = {
|
|
43
|
-
address: tx.Account,
|
|
44
|
-
tag: tx.SourceTag,
|
|
45
|
-
};
|
|
46
45
|
return (0, common_1.removeUndefined)({
|
|
47
|
-
|
|
46
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
47
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
48
|
+
source: (0, source_1.parseSource)(tx),
|
|
48
49
|
owner: tx.Owner,
|
|
49
50
|
escrowSequence: tx.OfferSequence,
|
|
50
51
|
condition: tx.Condition,
|
|
@@ -7,9 +7,11 @@ const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
|
7
7
|
const common_1 = require("../../common");
|
|
8
8
|
const emit_details_1 = require("../ledger/emit_details");
|
|
9
9
|
const memos_1 = require("../ledger/memos");
|
|
10
|
+
const source_1 = require("../ledger/source");
|
|
10
11
|
function parseFeeUpdate(tx) {
|
|
11
12
|
const baseFeeDrops = new bignumber_js_1.default(tx.BaseFee, 16).toString();
|
|
12
13
|
return {
|
|
14
|
+
source: (0, source_1.parseSource)(tx),
|
|
13
15
|
baseFeeXRP: (0, common_1.dropsToXrp)(baseFeeDrops),
|
|
14
16
|
referenceFeeUnits: tx.ReferenceFeeUnits,
|
|
15
17
|
reserveBaseXRP: (0, common_1.dropsToXrp)(tx.ReserveBase),
|
|
@@ -37,10 +37,12 @@ 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 source_1 = require("../ledger/source");
|
|
40
41
|
const genesis_mints_1 = require("../ledger/genesis-mints");
|
|
41
42
|
function parseGenesisMint(tx) {
|
|
42
43
|
assert.ok(tx.TransactionType === "GenesisMint");
|
|
43
44
|
return (0, common_1.removeUndefined)({
|
|
45
|
+
source: (0, source_1.parseSource)(tx),
|
|
44
46
|
genesisMints: (0, genesis_mints_1.parseGenesisMints)(tx),
|
|
45
47
|
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
46
48
|
memos: (0, memos_1.parseMemos)(tx),
|
|
@@ -38,15 +38,16 @@ const common_1 = require("../../common");
|
|
|
38
38
|
const emit_details_1 = require("../ledger/emit_details");
|
|
39
39
|
const memos_1 = require("../ledger/memos");
|
|
40
40
|
const import_1 = require("../ledger/import");
|
|
41
|
+
const signers_1 = require("../ledger/signers");
|
|
42
|
+
const regular_key_1 = require("../ledger/regular-key");
|
|
43
|
+
const source_1 = require("../ledger/source");
|
|
41
44
|
function parseImport(tx) {
|
|
42
45
|
assert.ok(tx.TransactionType === "Import");
|
|
43
|
-
const source = {
|
|
44
|
-
address: tx.Account,
|
|
45
|
-
tag: tx.SourceTag,
|
|
46
|
-
};
|
|
47
46
|
return (0, common_1.removeUndefined)({
|
|
48
47
|
blob: (0, import_1.parseImportBlob)(tx.Blob),
|
|
49
|
-
|
|
48
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
49
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
50
|
+
source: (0, source_1.parseSource)(tx),
|
|
50
51
|
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
51
52
|
memos: (0, memos_1.parseMemos)(tx),
|
|
52
53
|
});
|
|
@@ -34,21 +34,19 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
const assert = __importStar(require("assert"));
|
|
37
|
-
const common_1 = require("../../common");
|
|
38
37
|
const emit_details_1 = require("../ledger/emit_details");
|
|
39
38
|
const memos_1 = require("../ledger/memos");
|
|
39
|
+
const signers_1 = require("../ledger/signers");
|
|
40
|
+
const regular_key_1 = require("../ledger/regular-key");
|
|
41
|
+
const source_1 = require("../ledger/source");
|
|
42
|
+
const destination_1 = require("../ledger/destination");
|
|
40
43
|
function parseInvoke(tx) {
|
|
41
44
|
assert.ok(tx.TransactionType === "Invoke");
|
|
42
|
-
const source = {
|
|
43
|
-
address: tx.Account,
|
|
44
|
-
tag: tx.SourceTag,
|
|
45
|
-
};
|
|
46
|
-
const destination = {
|
|
47
|
-
address: tx.Destination,
|
|
48
|
-
};
|
|
49
45
|
return {
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
47
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
48
|
+
source: (0, source_1.parseSource)(tx),
|
|
49
|
+
destination: (0, destination_1.parseDestination)(tx),
|
|
52
50
|
emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
|
|
53
51
|
memos: (0, memos_1.parseMemos)(tx),
|
|
54
52
|
};
|
|
@@ -40,15 +40,15 @@ const assert = __importStar(require("assert"));
|
|
|
40
40
|
const common_1 = require("../../common");
|
|
41
41
|
const memos_1 = require("../ledger/memos");
|
|
42
42
|
const mptoken_authorize_flags_1 = __importDefault(require("../ledger/mptoken-authorize-flags"));
|
|
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");
|
|
44
46
|
function parseMPTokenAuthorize(tx) {
|
|
45
47
|
assert.ok(tx.TransactionType === "MPTokenAuthorize");
|
|
46
|
-
const source = (0, common_1.removeUndefined)({
|
|
47
|
-
address: (0, account_1.parseAccount)(tx.Account),
|
|
48
|
-
tag: tx.SourceTag,
|
|
49
|
-
});
|
|
50
48
|
return (0, common_1.removeUndefined)({
|
|
51
|
-
|
|
49
|
+
signers: (0, signers_1.parseSigners)(tx),
|
|
50
|
+
signer: (0, regular_key_1.parseSignerRegularKey)(tx),
|
|
51
|
+
source: (0, source_1.parseSource)(tx),
|
|
52
52
|
flags: (0, mptoken_authorize_flags_1.default)(tx.Flags),
|
|
53
53
|
holder: tx.Holder,
|
|
54
54
|
mptIssuanceID: tx.MPTokenIssuanceID,
|