@airgap/serializer 0.13.7-beta.14 → 0.13.7-beta.15

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.
@@ -208302,6 +208302,24 @@ var TezosIndexerClient = /** @class */ (function () {
208302
208302
  });
208303
208303
  });
208304
208304
  };
208305
+ TezosIndexerClient.prototype.getContractCodeHash = function (contractAddress) {
208306
+ return __awaiter(this, void 0, void 0, function () {
208307
+ var url, result;
208308
+ return __generator(this, function (_a) {
208309
+ switch (_a.label) {
208310
+ case 0:
208311
+ url = this.url("/contracts/" + contractAddress);
208312
+ return [4 /*yield*/, axios_0_19_0_1.default.get(url)];
208313
+ case 1:
208314
+ result = (_a.sent()).data;
208315
+ return [2 /*return*/, {
208316
+ typeHash: result.typeHash.toString(),
208317
+ codeHash: result.codeHash.toString()
208318
+ }];
208319
+ }
208320
+ });
208321
+ });
208322
+ };
208305
208323
  TezosIndexerClient.prototype.getContractBigMaps = function (contractAddress, limit, offset) {
208306
208324
  return __awaiter(this, void 0, void 0, function () {
208307
208325
  var url, result;
@@ -210459,6 +210477,23 @@ var TezosShieldedTezProtocol = /** @class */ (function (_super) {
210459
210477
  if (options === void 0) { options = new TezosSaplingProtocolOptions_1.TezosSaplingProtocolOptions(); }
210460
210478
  return _super.call(this, options) || this;
210461
210479
  }
210480
+ TezosShieldedTezProtocol.prototype.isContractValid = function (address) {
210481
+ return __awaiter(this, void 0, void 0, function () {
210482
+ var _a, typeHash, codeHash;
210483
+ return __generator(this, function (_b) {
210484
+ switch (_b.label) {
210485
+ case 0:
210486
+ if (!address.startsWith('KT1')) {
210487
+ return [2 /*return*/, false];
210488
+ }
210489
+ return [4 /*yield*/, this.options.network.extras.indexerClient.getContractCodeHash(address)];
210490
+ case 1:
210491
+ _a = _b.sent(), typeHash = _a.typeHash, codeHash = _a.codeHash;
210492
+ return [2 /*return*/, typeHash === TezosShieldedTezProtocol.typeHash && codeHash === TezosShieldedTezProtocol.codeHash];
210493
+ }
210494
+ });
210495
+ });
210496
+ };
210462
210497
  TezosShieldedTezProtocol.prototype.prepareContractCalls = function (transactions) {
210463
210498
  return __awaiter(this, void 0, void 0, function () {
210464
210499
  var balances, callAmount, contractCall;
@@ -210500,6 +210535,8 @@ var TezosShieldedTezProtocol = /** @class */ (function (_super) {
210500
210535
  });
210501
210536
  });
210502
210537
  };
210538
+ TezosShieldedTezProtocol.typeHash = '1724054251';
210539
+ TezosShieldedTezProtocol.codeHash = '522589455';
210503
210540
  return TezosShieldedTezProtocol;
210504
210541
  }(TezosSaplingProtocol_1.TezosSaplingProtocol));
210505
210542
  exports.TezosShieldedTezProtocol = TezosShieldedTezProtocol;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@airgap/serializer",
3
- "version": "0.13.7-beta.14",
3
+ "version": "0.13.7-beta.15",
4
4
  "description": "The @airgap/serializer provides serializers used in AirGap applications.",
5
5
  "keywords": [
6
6
  "airgap",