@typus/typus-sdk 1.8.31 → 1.8.32

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.
@@ -58,7 +58,7 @@ var parseFullTypusOracleData = function (data) {
58
58
  exports.parseFullTypusOracleData = parseFullTypusOracleData;
59
59
  function updateOracleWithSignatureTx(network, tx, oracleContract, tokenType) {
60
60
  return __awaiter(this, void 0, void 0, function () {
61
- var baseTokenType, oracleData, result, error_1, oracleAddress, pairBytes, priceBytes, twapBytes, timestampBytes, totalLength, messageBytes, offset, signatureHex, signatureBytes;
61
+ var baseTokenType, oracleData, result, error_1, oracleAddress, oracleIdBytes, pairBytes, priceBytes, twapBytes, timestampBytes, totalLength, messageBytes, offset, signatureHex, signatureBytes;
62
62
  return __generator(this, function (_a) {
63
63
  switch (_a.label) {
64
64
  case 0:
@@ -81,13 +81,16 @@ function updateOracleWithSignatureTx(network, tx, oracleContract, tokenType) {
81
81
  case 4:
82
82
  oracleAddress = constants_1.oracle[network][(0, token_1.typeArgToAsset)((0, utils_1.normalizeStructTag)(tokenType))];
83
83
  if (oracleData && oracleAddress) {
84
+ oracleIdBytes = (0, bcs_1.fromHex)(oracleAddress.startsWith('0x') ? oracleAddress.slice(2) : oracleAddress);
84
85
  pairBytes = new Uint8Array(Buffer.from(baseTokenType, "utf8"));
85
86
  priceBytes = bcs_1.bcs.u64().serialize(oracleData.signed.price).toBytes();
86
87
  twapBytes = bcs_1.bcs.u64().serialize(oracleData.signed.twap).toBytes();
87
88
  timestampBytes = bcs_1.bcs.u64().serialize(oracleData.signed.timestamp.toString()).toBytes();
88
- totalLength = pairBytes.length + priceBytes.length + twapBytes.length + timestampBytes.length;
89
+ totalLength = oracleIdBytes.length + pairBytes.length + priceBytes.length + twapBytes.length + timestampBytes.length;
89
90
  messageBytes = new Uint8Array(totalLength);
90
91
  offset = 0;
92
+ messageBytes.set(oracleIdBytes, offset);
93
+ offset += oracleIdBytes.length;
91
94
  messageBytes.set(pairBytes, offset);
92
95
  offset += pairBytes.length;
93
96
  messageBytes.set(priceBytes, offset);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typus/typus-sdk",
3
3
  "author": "Typus",
4
4
  "description": "typus sdk",
5
- "version": "1.8.31",
5
+ "version": "1.8.32",
6
6
  "dependencies": {
7
7
  "@mysten/bcs": "^1.6.1",
8
8
  "@mysten/kiosk": "^0.12.6",