@tonconnect/sdk 3.4.0-beta.2 → 3.4.0-beta.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.
package/lib/esm/index.mjs CHANGED
@@ -5467,7 +5467,7 @@ class TonConnect {
5467
5467
  }
5468
5468
  sendTransaction(transaction, optionsOrOnRequestSent) {
5469
5469
  return __awaiter(this, void 0, void 0, function* () {
5470
- var _a, _b, _c;
5470
+ var _a, _b, _c, _d;
5471
5471
  // TODO: remove deprecated method
5472
5472
  const options = {};
5473
5473
  if (typeof optionsOrOnRequestSent === 'function') {
@@ -5506,11 +5506,17 @@ class TonConnect {
5506
5506
  const from = transaction.from || this.account.address;
5507
5507
  const network = transaction.network || this.account.chain;
5508
5508
  if (((_b = this.wallet) === null || _b === void 0 ? void 0 : _b.account.chain) && network !== this.wallet.account.chain) {
5509
- throw new WalletWrongNetworkError('Wallet connected to a wrong network', {
5510
- cause: {
5511
- expectedChainId: (_c = this.wallet) === null || _c === void 0 ? void 0 : _c.account.chain,
5512
- actualChainId: network
5513
- }
5509
+ if (!isQaModeEnabled()) {
5510
+ throw new WalletWrongNetworkError('Wallet connected to a wrong network', {
5511
+ cause: {
5512
+ expectedChainId: (_c = this.wallet) === null || _c === void 0 ? void 0 : _c.account.chain,
5513
+ actualChainId: network
5514
+ }
5515
+ });
5516
+ }
5517
+ console.error('Wallet connected to a wrong network', {
5518
+ expectedChainId: (_d = this.wallet) === null || _d === void 0 ? void 0 : _d.account.chain,
5519
+ actualChainId: network
5514
5520
  });
5515
5521
  }
5516
5522
  const response = yield this.provider.sendRequest(sendTransactionParser.convertToRpcRequest(Object.assign(Object.assign({}, tx), { from,
@@ -5533,7 +5539,7 @@ class TonConnect {
5533
5539
  }
5534
5540
  signData(data, options) {
5535
5541
  return __awaiter(this, void 0, void 0, function* () {
5536
- var _a, _b, _c;
5542
+ var _a, _b, _c, _d;
5537
5543
  const abortController = createAbortController(options === null || options === void 0 ? void 0 : options.signal);
5538
5544
  if (abortController.signal.aborted) {
5539
5545
  throw new TonConnectError('data sending was aborted');
@@ -5556,11 +5562,17 @@ class TonConnect {
5556
5562
  const from = data.from || this.account.address;
5557
5563
  const network = data.network || this.account.chain;
5558
5564
  if (((_b = this.wallet) === null || _b === void 0 ? void 0 : _b.account.chain) && network !== this.wallet.account.chain) {
5559
- throw new WalletWrongNetworkError('Wallet connected to a wrong network', {
5560
- cause: {
5561
- expectedChainId: (_c = this.wallet) === null || _c === void 0 ? void 0 : _c.account.chain,
5562
- actualChainId: network
5563
- }
5565
+ if (!isQaModeEnabled()) {
5566
+ throw new WalletWrongNetworkError('Wallet connected to a wrong network', {
5567
+ cause: {
5568
+ expectedChainId: (_c = this.wallet) === null || _c === void 0 ? void 0 : _c.account.chain,
5569
+ actualChainId: network
5570
+ }
5571
+ });
5572
+ }
5573
+ console.error('Wallet connected to a wrong network', {
5574
+ expectedChainId: (_d = this.wallet) === null || _d === void 0 ? void 0 : _d.account.chain,
5575
+ actualChainId: network
5564
5576
  });
5565
5577
  }
5566
5578
  const response = yield this.provider.sendRequest(signDataParser.convertToRpcRequest(Object.assign(Object.assign(Object.assign({}, data), (data.type === 'cell' ? { cell: normalizeBase64(data.cell) } : {})), { from,