@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.
@@ -20,6 +20,7 @@ class CommitmentEntityAction {
20
20
  row.extractor = extractorId;
21
21
  row.blockId = block.hash;
22
22
  row.height = block.height;
23
+ row.boxSerialized = commitment.boxSerialized;
23
24
  return row;
24
25
  });
25
26
  let success = true;
@@ -7,6 +7,7 @@ declare class CommitmentEntity {
7
7
  commitmentBoxId: string;
8
8
  blockId: string;
9
9
  height: number;
10
+ boxSerialized: string;
10
11
  spendBlockHash: string;
11
12
  spendBlockHeight?: number;
12
13
  }
@@ -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
  }
@@ -50,6 +50,7 @@ class CommitmentExtractor extends AbstractExtractor {
50
50
  commitment: eventDigest,
51
51
  eventId: requestId,
52
52
  commitmentBoxId: output.box_id().to_str(),
53
+ boxSerialized: Buffer.from(output.sigma_serialize_bytes()).toString("base64")
53
54
  });
54
55
  }
55
56
  }
@@ -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
  }
@@ -3,5 +3,6 @@ interface extractedCommitment {
3
3
  commitment: string;
4
4
  eventId: string;
5
5
  commitmentBoxId: string;
6
+ boxSerialized: string;
6
7
  }
7
8
  export { extractedCommitment };
@@ -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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rosen-bridge/watcher-data-extractor",
3
- "version": "0.1.0-alpha-3",
3
+ "version": "0.1.0-alpha-4",
4
4
  "description": "Extractor for rosen specific boxes on ergo blockchain",
5
5
  "author": "Sahand Zoufan",
6
6
  "license": "GPL-3.0",