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