@airgap/serializer 0.13.7-beta.20 → 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.
|
@@ -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);
|
|
@@ -209475,7 +209478,7 @@ var TezosSaplingProtocol = /** @class */ (function (_super) {
|
|
|
209475
209478
|
this.nodeClient = new TezosSaplingNodeClient_1.TezosSaplingNodeClient(this.options.network.rpcUrl, address);
|
|
209476
209479
|
this.contract = new TezosContract_1.TezosContract(address, this.options.network);
|
|
209477
209480
|
this.options.config.injectorUrl = configuration === null || configuration === void 0 ? void 0 : configuration.injectorUrl;
|
|
209478
|
-
this.injectorClient = new TezosSaplingInjectorClient_1.TezosSaplingInjectorClient(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);
|
|
209479
209482
|
return [2 /*return*/];
|
|
209480
209483
|
});
|
|
209481
209484
|
});
|
|
@@ -210266,7 +210269,7 @@ var TezosSaplingProtocol = /** @class */ (function (_super) {
|
|
|
210266
210269
|
switch (_a.label) {
|
|
210267
210270
|
case 0:
|
|
210268
210271
|
if (!this.injectorClient) {
|
|
210269
|
-
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.");
|
|
210270
210273
|
}
|
|
210271
210274
|
_a.label = 1;
|
|
210272
210275
|
case 1:
|
|
@@ -210641,15 +210644,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
210641
210644
|
exports.TezosSaplingInjectorClient = void 0;
|
|
210642
210645
|
var axios_0_19_0_1 = __importDefault(require("@airgap/coinlib-core/dependencies/src/axios-0.19.0"));
|
|
210643
210646
|
var TezosSaplingInjectorClient = /** @class */ (function () {
|
|
210644
|
-
function TezosSaplingInjectorClient(url) {
|
|
210647
|
+
function TezosSaplingInjectorClient(url, contractAddress) {
|
|
210645
210648
|
this.url = url;
|
|
210649
|
+
this.contractAddress = contractAddress;
|
|
210646
210650
|
}
|
|
210647
210651
|
TezosSaplingInjectorClient.prototype.injectTransaction = function (transaction) {
|
|
210648
210652
|
return __awaiter(this, void 0, void 0, function () {
|
|
210649
210653
|
var response;
|
|
210650
210654
|
return __generator(this, function (_a) {
|
|
210651
210655
|
switch (_a.label) {
|
|
210652
|
-
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
|
+
})];
|
|
210653
210660
|
case 1:
|
|
210654
210661
|
response = _a.sent();
|
|
210655
210662
|
return [2 /*return*/, response.data.hash];
|