@rosen-bridge/watcher-data-extractor 0.1.0-alpha-3 → 0.1.0-alpha-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.
- package/dist/actions/commitmentDB.js +1 -0
- package/dist/entities/CommitmentEntity.d.ts +1 -0
- package/dist/entities/CommitmentEntity.js +5 -0
- package/dist/extractor/EventTriggerExtractor.js +8 -10
- package/dist/extractor/commitmentExtractor.js +1 -0
- package/dist/extractor/permitExtractor.js +1 -1
- package/dist/interfaces/extractedCommitment.d.ts +1 -0
- package/dist/migrations/init.js +2 -1
- package/package.json +1 -1
|
@@ -17,6 +17,7 @@ let CommitmentEntity = class CommitmentEntity {
|
|
|
17
17
|
commitmentBoxId;
|
|
18
18
|
blockId;
|
|
19
19
|
height;
|
|
20
|
+
boxSerialized;
|
|
20
21
|
spendBlockHash;
|
|
21
22
|
spendBlockHeight;
|
|
22
23
|
};
|
|
@@ -52,6 +53,10 @@ __decorate([
|
|
|
52
53
|
Column(),
|
|
53
54
|
__metadata("design:type", Number)
|
|
54
55
|
], CommitmentEntity.prototype, "height", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
Column(),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], CommitmentEntity.prototype, "boxSerialized", void 0);
|
|
55
60
|
__decorate([
|
|
56
61
|
Column({ nullable: true }),
|
|
57
62
|
__metadata("design:type", String)
|
|
@@ -40,23 +40,21 @@ class EventTriggerExtractor extends AbstractExtractor {
|
|
|
40
40
|
R4Serialized.length >= 1 &&
|
|
41
41
|
R5Serialized.length >= 11 &&
|
|
42
42
|
output.ergo_tree().to_base16_bytes() === this.eventTriggerErgoTree) {
|
|
43
|
-
const WIDs = R4Serialized.map(byteArray =>
|
|
44
|
-
Buffer.from(byteArray).toString();
|
|
45
|
-
}).join(',');
|
|
43
|
+
const WIDs = R4Serialized.map(byteArray => Buffer.from(byteArray).toString("hex")).join(',');
|
|
46
44
|
boxes.push({
|
|
47
45
|
boxId: output.box_id().to_str(),
|
|
48
46
|
boxSerialized: Buffer.from(output.sigma_serialize_bytes()).toString("base64"),
|
|
49
47
|
toChain: Buffer.from(R5Serialized[2]).toString(),
|
|
50
48
|
toAddress: Buffer.from(R5Serialized[4]).toString(),
|
|
51
|
-
networkFee: Buffer.from(R5Serialized[7]).toString(),
|
|
52
|
-
bridgeFee: Buffer.from(R5Serialized[6]).toString(),
|
|
53
|
-
amount: Buffer.from(R5Serialized[5]).toString(),
|
|
54
|
-
sourceChainTokenId: Buffer.from(R5Serialized[8]).toString(),
|
|
55
|
-
targetChainTokenId: Buffer.from(R5Serialized[9]).toString(),
|
|
56
|
-
sourceTxId: Buffer.from(R5Serialized[0]).toString(),
|
|
49
|
+
networkFee: Buffer.from(R5Serialized[7]).toString("hex"),
|
|
50
|
+
bridgeFee: Buffer.from(R5Serialized[6]).toString("hex"),
|
|
51
|
+
amount: Buffer.from(R5Serialized[5]).toString("hex"),
|
|
52
|
+
sourceChainTokenId: Buffer.from(R5Serialized[8]).toString("hex"),
|
|
53
|
+
targetChainTokenId: Buffer.from(R5Serialized[9]).toString("hex"),
|
|
54
|
+
sourceTxId: Buffer.from(R5Serialized[0]).toString("hex"),
|
|
57
55
|
fromChain: Buffer.from(R5Serialized[1]).toString(),
|
|
58
56
|
fromAddress: Buffer.from(R5Serialized[3]).toString(),
|
|
59
|
-
sourceBlockId: Buffer.from(R5Serialized[10]).toString(),
|
|
57
|
+
sourceBlockId: Buffer.from(R5Serialized[10]).toString("hex"),
|
|
60
58
|
WIDs: WIDs,
|
|
61
59
|
});
|
|
62
60
|
}
|
|
@@ -41,7 +41,7 @@ class PermitExtractor extends AbstractExtractor {
|
|
|
41
41
|
boxes.push({
|
|
42
42
|
boxId: output.box_id().to_str(),
|
|
43
43
|
boxSerialized: Buffer.from(output.sigma_serialize_bytes()).toString("base64"),
|
|
44
|
-
WID: Buffer.from(R4Serialized[0]).toString()
|
|
44
|
+
WID: Buffer.from(R4Serialized[0]).toString('hex')
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
}
|
package/dist/migrations/init.js
CHANGED
|
@@ -4,7 +4,8 @@ export class initMigration1659787165000 {
|
|
|
4
4
|
await queryRunner.query(`CREATE TABLE "commitment_entity"
|
|
5
5
|
("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
|
6
6
|
"extractor" varchar NOT NULL,
|
|
7
|
-
"eventId" varchar NOT NULL,
|
|
7
|
+
"eventId" varchar NOT NULL,
|
|
8
|
+
"boxSerialized" varchar NOT NULL,
|
|
8
9
|
"commitment" varchar NOT NULL,
|
|
9
10
|
"WID" varchar NOT NULL,
|
|
10
11
|
"commitmentBoxId" varchar NOT NULL,
|