@airgap/serializer 0.13.7-beta.19 → 0.13.7-beta.21
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/airgap-coinlib-serializer.min.js +13 -10
- package/package.json +1 -1
|
@@ -209348,7 +209348,10 @@ var TezosSaplingProtocol = /** @class */ (function (_super) {
|
|
|
209348
209348
|
_this.contract = _this.options.config.contractAddress
|
|
209349
209349
|
? new TezosContract_1.TezosContract(_this.options.config.contractAddress, _this.options.network)
|
|
209350
209350
|
: undefined;
|
|
209351
|
-
_this.injectorClient =
|
|
209351
|
+
_this.injectorClient =
|
|
209352
|
+
_this.options.config.injectorUrl && _this.options.config.contractAddress
|
|
209353
|
+
? new TezosSaplingInjectorClient_1.TezosSaplingInjectorClient(_this.options.config.injectorUrl, _this.options.config.contractAddress)
|
|
209354
|
+
: undefined;
|
|
209352
209355
|
_this.state = new TezosSaplingState_1.TezosSaplingState(_this.options.config.merkleTreeHeight);
|
|
209353
209356
|
_this.encoder = new TezosSaplingEncoder_1.TezosSaplingEncoder();
|
|
209354
209357
|
_this.forger = new TezosSaplingForger_1.TezosSaplingForger(_this.cryptoClient, _this.state, _this.encoder, _this.options.config.externalProvider);
|
|
@@ -209470,16 +209473,12 @@ var TezosSaplingProtocol = /** @class */ (function (_super) {
|
|
|
209470
209473
|
};
|
|
209471
209474
|
TezosSaplingProtocol.prototype.setContractAddress = function (address, configuration) {
|
|
209472
209475
|
return __awaiter(this, void 0, void 0, function () {
|
|
209473
|
-
var injectorUrl;
|
|
209474
209476
|
return __generator(this, function (_a) {
|
|
209475
209477
|
this.options.config.contractAddress = address;
|
|
209476
209478
|
this.nodeClient = new TezosSaplingNodeClient_1.TezosSaplingNodeClient(this.options.network.rpcUrl, address);
|
|
209477
209479
|
this.contract = new TezosContract_1.TezosContract(address, this.options.network);
|
|
209478
|
-
injectorUrl = configuration === null || configuration === void 0 ? void 0 : configuration.injectorUrl;
|
|
209479
|
-
|
|
209480
|
-
this.options.config.injectorUrl = injectorUrl;
|
|
209481
|
-
this.injectorClient = new TezosSaplingInjectorClient_1.TezosSaplingInjectorClient(injectorUrl);
|
|
209482
|
-
}
|
|
209480
|
+
this.options.config.injectorUrl = configuration === null || configuration === void 0 ? void 0 : configuration.injectorUrl;
|
|
209481
|
+
this.injectorClient = new TezosSaplingInjectorClient_1.TezosSaplingInjectorClient(configuration === null || configuration === void 0 ? void 0 : configuration.injectorUrl, address);
|
|
209483
209482
|
return [2 /*return*/];
|
|
209484
209483
|
});
|
|
209485
209484
|
});
|
|
@@ -210270,7 +210269,7 @@ var TezosSaplingProtocol = /** @class */ (function (_super) {
|
|
|
210270
210269
|
switch (_a.label) {
|
|
210271
210270
|
case 0:
|
|
210272
210271
|
if (!this.injectorClient) {
|
|
210273
|
-
throw new errors_1.PropertyUndefinedError(coinlib_error_1.Domain.TEZOS, "Can't broadcast a sapling transaction, an injector service URL has not be set.");
|
|
210272
|
+
throw new errors_1.PropertyUndefinedError(coinlib_error_1.Domain.TEZOS, "Can't broadcast a sapling transaction, an injector service URL or contract address has not be set.");
|
|
210274
210273
|
}
|
|
210275
210274
|
_a.label = 1;
|
|
210276
210275
|
case 1:
|
|
@@ -210645,15 +210644,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
210645
210644
|
exports.TezosSaplingInjectorClient = void 0;
|
|
210646
210645
|
var axios_0_19_0_1 = __importDefault(require("@airgap/coinlib-core/dependencies/src/axios-0.19.0"));
|
|
210647
210646
|
var TezosSaplingInjectorClient = /** @class */ (function () {
|
|
210648
|
-
function TezosSaplingInjectorClient(url) {
|
|
210647
|
+
function TezosSaplingInjectorClient(url, contractAddress) {
|
|
210649
210648
|
this.url = url;
|
|
210649
|
+
this.contractAddress = contractAddress;
|
|
210650
210650
|
}
|
|
210651
210651
|
TezosSaplingInjectorClient.prototype.injectTransaction = function (transaction) {
|
|
210652
210652
|
return __awaiter(this, void 0, void 0, function () {
|
|
210653
210653
|
var response;
|
|
210654
210654
|
return __generator(this, function (_a) {
|
|
210655
210655
|
switch (_a.label) {
|
|
210656
|
-
case 0: return [4 /*yield*/, axios_0_19_0_1.default.post(this.url + "/
|
|
210656
|
+
case 0: return [4 /*yield*/, axios_0_19_0_1.default.post(this.url + "/sapling_transaction", {
|
|
210657
|
+
transaction: transaction,
|
|
210658
|
+
contractAddress: this.contractAddress
|
|
210659
|
+
})];
|
|
210657
210660
|
case 1:
|
|
210658
210661
|
response = _a.sent();
|
|
210659
210662
|
return [2 /*return*/, response.data.hash];
|