@bithomp/xrpl-api 2.6.3 → 2.6.4
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.
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseImportBlob = void 0;
|
|
4
4
|
const ripple_binary_codec_1 = require("ripple-binary-codec");
|
|
5
|
+
;
|
|
6
|
+
const ripple_hashes_1 = require("ripple-hashes");
|
|
5
7
|
const vl_1 = require("../../models/vl");
|
|
8
|
+
const transaction_1 = require("../../models/transaction");
|
|
6
9
|
function parseImportBlob(blob) {
|
|
7
10
|
try {
|
|
8
11
|
const decodedBlob = JSON.parse(Buffer.from(blob, "hex").toString("utf8"));
|
|
@@ -12,6 +15,9 @@ function parseImportBlob(blob) {
|
|
|
12
15
|
data[key] = (0, ripple_binary_codec_1.decode)(data[key]);
|
|
13
16
|
}
|
|
14
17
|
}
|
|
18
|
+
const tx = (0, ripple_binary_codec_1.decode)(decodedBlob.transaction.blob);
|
|
19
|
+
const meta = (0, ripple_binary_codec_1.decode)(decodedBlob.transaction.meta);
|
|
20
|
+
const parsedTX = (0, transaction_1.getAccountTxDetails)({ tx: tx, meta: meta, validated: true }, false);
|
|
15
21
|
return {
|
|
16
22
|
ledger: decodedBlob.ledger,
|
|
17
23
|
validation: {
|
|
@@ -19,9 +25,12 @@ function parseImportBlob(blob) {
|
|
|
19
25
|
unl: (0, vl_1.parseVL)(decodedBlob.validation.unl),
|
|
20
26
|
},
|
|
21
27
|
transaction: {
|
|
28
|
+
id: (0, ripple_hashes_1.computeBinaryTransactionHash)(decodedBlob.transaction.blob),
|
|
22
29
|
tx: (0, ripple_binary_codec_1.decode)(decodedBlob.transaction.blob),
|
|
23
30
|
meta: (0, ripple_binary_codec_1.decode)(decodedBlob.transaction.meta),
|
|
24
31
|
proof: decodedBlob.transaction.proof,
|
|
32
|
+
specification: parsedTX.specification,
|
|
33
|
+
outcome: parsedTX.outcome,
|
|
25
34
|
},
|
|
26
35
|
};
|
|
27
36
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { FormattedBaseSpecification } from "./specification";
|
|
2
2
|
import { FormattedSourceAddress } from "./account";
|
|
3
|
+
import { FormattedSpecification } from "../../../../parse/transaction";
|
|
4
|
+
import { Outcome } from "../../../../v1/transaction/types";
|
|
3
5
|
export type FormattedImportBlobSpecification = {
|
|
4
6
|
ledger: number;
|
|
5
7
|
validation: {
|
|
@@ -7,9 +9,12 @@ export type FormattedImportBlobSpecification = {
|
|
|
7
9
|
unl: any;
|
|
8
10
|
};
|
|
9
11
|
transaction: {
|
|
12
|
+
id: string;
|
|
10
13
|
tx: any;
|
|
11
14
|
meta: any;
|
|
12
15
|
proof: any;
|
|
16
|
+
specification: FormattedSpecification;
|
|
17
|
+
outcome?: Outcome;
|
|
13
18
|
};
|
|
14
19
|
};
|
|
15
20
|
export type FormattedImportSpecification = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bithomp/xrpl-api",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.4",
|
|
4
4
|
"description": "A Bithomp JavaScript/TypeScript library for interacting with the XRP Ledger",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
|
|
39
39
|
"lint": "tslint -p tsconfig.json",
|
|
40
40
|
"prepare": "npm run build",
|
|
41
|
-
"prepublishOnly": "npm test && npm run lint",
|
|
41
|
+
"-prepublishOnly": "npm test && npm run lint",
|
|
42
42
|
"preversion": "npm run lint",
|
|
43
43
|
"version": "npm run format && git add -A src",
|
|
44
44
|
"postversion": "git push && git push --tags"
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
"lodash": "^4.17.21",
|
|
55
55
|
"ripple-address-codec": "^4.3.1",
|
|
56
56
|
"ripple-binary-codec": "^1.10.0",
|
|
57
|
+
"ripple-hashes": "^0.3.4",
|
|
57
58
|
"xrpl": "^2.13.0"
|
|
58
59
|
},
|
|
59
60
|
"devDependencies": {
|