@tonconnect/sdk 0.0.14 → 0.0.16

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/README.md CHANGED
@@ -33,9 +33,9 @@ connector.onStatusChange(
33
33
  TonConnect is build to support different wallets. You can fetch all supported wallets list and show a custom wallet selection dialog for user
34
34
 
35
35
  ```ts
36
- const { allWalletsList, injectedWalletsList, remoteConnectionWalletsList } = await connector.walletsList.getWalletsConfig();
36
+ const walletsList = await connector.getWallets();
37
37
 
38
- /* allWalletsList is
38
+ /* walletsList is
39
39
  {
40
40
  name: string;
41
41
  imageUrl: string;
@@ -44,38 +44,12 @@ const { allWalletsList, injectedWalletsList, remoteConnectionWalletsList } = awa
44
44
  universalLinkBase?: string;
45
45
  bridgeUrl?: string;
46
46
  jsBridgeKey?: string;
47
- }[]
48
-
49
- injectedWalletsList is (all injected to the page available wallets)
50
- {
51
- name: string;
52
- imageUrl: string;
53
- tondns?: string;
54
- aboutUrl: string;
55
- jsBridgeKey: string;
56
- }[]
57
-
58
- remoteConnectionWalletsList is (all wallets available via http bridge (QR code))
59
- {
60
- name: string;
61
- imageUrl: string;
62
- tondns?: string;
63
- aboutUrl: string;
64
- universalLinkBase: string;
65
- bridgeUrl: string;
47
+ injected?: boolean; // true if this wallet is injected to the webpage
48
+ embedded?: boolean; // true if dapp is opened inside this wallet's browser
66
49
  }[]
67
50
  */
68
51
  ```
69
52
 
70
- ### Check if your app is opened inside some wallet's browser
71
-
72
- If your app is opened inside some wallet's browser you shouldn't show a wallet selection dialog. Just connect dapp to the host-wallet when 'connect' button is clicked
73
-
74
- ```ts
75
- const walletConnectionSourceOrNull = await connector.inWhichWalletBrowser();
76
- ```
77
-
78
-
79
53
  ## Initialize a wallet connection when user clicks to 'connect' button in your app
80
54
  ### Initialize a remote wallet connection via universal link
81
55
 
@@ -1,4 +1,4 @@
1
1
  export type { Account } from './account';
2
2
  export type { Wallet } from './wallet';
3
3
  export type { WalletConnectionSource } from './wallet-connection-source';
4
- export type { WalletConfig, JSBridgeWalletConfig, HTTPBridgeWalletConfig } from './wallet-config';
4
+ export { WalletInfo, WalletInfoInjected, WalletInfoRemote, isWalletInfoInjected } from './wallet-info';
@@ -1,2 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isWalletInfoInjected = void 0;
4
+ var wallet_info_1 = require("./wallet-info");
5
+ Object.defineProperty(exports, "isWalletInfoInjected", { enumerable: true, get: function () { return wallet_info_1.isWalletInfoInjected; } });
@@ -1,6 +1,6 @@
1
1
  export declare type WalletConnectionSource = WalletConnectionSourceHTTP | WalletConnectionSourceJS;
2
2
  export interface WalletConnectionSourceHTTP {
3
- universalLinkBase: string;
3
+ universalLink: string;
4
4
  bridgeUrl: string;
5
5
  }
6
6
  export interface WalletConnectionSourceJS {
@@ -0,0 +1,31 @@
1
+ export interface WalletInfoBase {
2
+ name: string;
3
+ imageUrl: string;
4
+ tondns?: string;
5
+ aboutUrl: string;
6
+ }
7
+ export interface WalletInfoRemote extends WalletInfoBase {
8
+ universalLink: string;
9
+ bridgeUrl: string;
10
+ }
11
+ export interface WalletInfoInjected extends WalletInfoBase {
12
+ jsBridgeKey: string;
13
+ injected: boolean;
14
+ embedded: boolean;
15
+ }
16
+ export declare type WalletInfo = WalletInfoRemote | WalletInfoInjected | (WalletInfoRemote & WalletInfoInjected);
17
+ export interface WalletInfoDTOBase {
18
+ name: string;
19
+ image: string;
20
+ tondns?: string;
21
+ about_url: string;
22
+ }
23
+ export interface WalletInfoRemoteDTO extends WalletInfoDTOBase {
24
+ universal_url: string;
25
+ bridge_url: string;
26
+ }
27
+ export interface WalletInfoInjectedDTO extends WalletInfoDTOBase {
28
+ js_bridge_key: string;
29
+ }
30
+ export declare type WalletInfoDTO = WalletInfoRemoteDTO | WalletInfoInjectedDTO | (WalletInfoRemoteDTO & WalletInfoInjectedDTO);
31
+ export declare function isWalletInfoInjected(value: WalletInfo): value is WalletInfoInjected;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isWalletInfoInjected = void 0;
4
+ function isWalletInfoInjected(value) {
5
+ return 'jsBridgeKey' in value;
6
+ }
7
+ exports.isWalletInfoInjected = isWalletInfoInjected;
@@ -5,6 +5,6 @@ export interface Wallet {
5
5
  provider: 'http' | 'injected';
6
6
  account: Account;
7
7
  connectItems?: {
8
- tonProof?: TonProofItemReply['signature'];
8
+ tonProof?: TonProofItemReply['proof'];
9
9
  };
10
10
  }
@@ -7,7 +7,6 @@ var ton_connect_error_1 = require("../../errors/ton-connect.error");
7
7
  var bridge_gateway_1 = require("./bridge-gateway");
8
8
  var bridge_connection_storage_1 = require("../../storage/bridge-connection-storage");
9
9
  var protocol = tslib_1.__importStar(require("../../resources/protocol.json"));
10
- var url_1 = require("../../utils/url");
11
10
  var BridgeProvider = /** @class */ (function () {
12
11
  function BridgeProvider(storage, walletConnectionSource) {
13
12
  this.storage = storage;
@@ -175,8 +174,7 @@ var BridgeProvider = /** @class */ (function () {
175
174
  });
176
175
  };
177
176
  BridgeProvider.prototype.generateUniversalLink = function (message) {
178
- var urlString = (0, url_1.addPathToUrl)(this.walletConnectionSource.universalLinkBase, this.universalLinkPath);
179
- var url = new URL(urlString);
177
+ var url = new URL(this.walletConnectionSource.universalLink);
180
178
  url.searchParams.append('v', protocol.version.toString());
181
179
  url.searchParams.append('id', this.session.sessionCrypto.sessionId);
182
180
  url.searchParams.append('r', protocol_1.Base64.encode(JSON.stringify(message), true));
@@ -18,6 +18,7 @@ export declare class InjectedProvider<T extends string = string> implements Inte
18
18
  restoreConnection(): Promise<void>;
19
19
  closeConnection(): void;
20
20
  disconnect(): Promise<void>;
21
+ private closeAllListeners;
21
22
  listen(eventsCallback: (e: WalletEvent) => void): () => void;
22
23
  sendRequest<T extends RpcMethod>(request: WithoutId<AppRequest<T>>): Promise<WithoutId<WalletResponse<T>>>;
23
24
  private makeSubscriptions;
@@ -96,17 +96,21 @@ var InjectedProvider = /** @class */ (function () {
96
96
  });
97
97
  };
98
98
  InjectedProvider.prototype.closeConnection = function () {
99
- var _a;
100
- this.listenSubscriptions = false;
101
- this.listeners = [];
102
- (_a = this.unsubscribeCallback) === null || _a === void 0 ? void 0 : _a.call(this);
99
+ if (this.listenSubscriptions) {
100
+ this.injectedWallet.disconnect();
101
+ }
102
+ this.closeAllListeners();
103
103
  };
104
104
  InjectedProvider.prototype.disconnect = function () {
105
+ this.closeAllListeners();
106
+ this.injectedWallet.disconnect();
107
+ return Promise.resolve();
108
+ };
109
+ InjectedProvider.prototype.closeAllListeners = function () {
105
110
  var _a;
106
111
  this.listenSubscriptions = false;
107
112
  this.listeners = [];
108
113
  (_a = this.unsubscribeCallback) === null || _a === void 0 ? void 0 : _a.call(this);
109
- return Promise.resolve();
110
114
  };
111
115
  InjectedProvider.prototype.listen = function (eventsCallback) {
112
116
  var _this = this;
@@ -7,4 +7,5 @@ export interface InjectedWalletApi {
7
7
  restoreConnection(): Promise<ConnectEvent>;
8
8
  send<T extends RpcMethod>(message: AppRequest<T>): Promise<WalletResponse<T>>;
9
9
  listen(callback: (event: WalletEvent) => void): () => void;
10
+ disconnect(): void;
10
11
  }
@@ -1,14 +1,12 @@
1
1
  import { TonConnectError } from "./errors/ton-connect.error";
2
- import { Account, DappMetadata, Wallet, WalletConnectionSource } from "./models";
2
+ import { Account, DappMetadata, Wallet, WalletConnectionSource, WalletInfo } from "./models";
3
3
  import { SendTransactionRequest, SendTransactionResponse } from "./models/methods";
4
4
  import { ConnectAdditionalRequest } from "./models/methods/connect/connect-additional-request";
5
- import { JSBridgeWalletConfig } from "./models/wallet/wallet-config";
6
5
  import { WalletConnectionSourceJS } from "./models/wallet/wallet-connection-source";
7
6
  import { IStorage } from "./storage/models/storage.interface";
8
7
  import { ITonConnect } from "./ton-connect.interface";
9
- import { WalletsListManager } from "./wallets-list-manager";
10
8
  export declare class TonConnect implements ITonConnect {
11
- walletsList: WalletsListManager;
9
+ private readonly walletsList;
12
10
  private readonly dappSettings;
13
11
  private readonly bridgeConnectionStorage;
14
12
  private _wallet;
@@ -33,9 +31,9 @@ export declare class TonConnect implements ITonConnect {
33
31
  storage?: IStorage;
34
32
  });
35
33
  /**
36
- * Indicates if the injected wallet is available.
34
+ * Returns available wallets list.
37
35
  */
38
- inWhichWalletBrowser(): Promise<JSBridgeWalletConfig | null>;
36
+ getWallets(): Promise<WalletInfo[]>;
39
37
  /**
40
38
  * Allows to subscribe to connection status changes and handle connection errors.
41
39
  * @param callback will be called after connections status changes with actual wallet or null.
@@ -2,7 +2,7 @@ import { TonConnectError } from "./errors";
2
2
  import { Account, WalletConnectionSource, Wallet } from "./models";
3
3
  import { SendTransactionRequest, SendTransactionResponse } from "./models/methods";
4
4
  import { ConnectAdditionalRequest } from "./models/methods/connect/connect-additional-request";
5
- import { JSBridgeWalletConfig, WalletConfig } from "./models/wallet/wallet-config";
5
+ import { WalletInfo } from "./models/wallet/wallet-info";
6
6
  import { WalletConnectionSourceJS } from "./models/wallet/wallet-connection-source";
7
7
  export interface ITonConnect {
8
8
  /**
@@ -18,16 +18,9 @@ export interface ITonConnect {
18
18
  */
19
19
  wallet: Wallet | null;
20
20
  /**
21
- * Allows to get information about supported wallets
21
+ * Returns available wallets list.
22
22
  */
23
- walletsList: {
24
- getWalletsList: () => Promise<WalletConfig[]>;
25
- getInjectedWalletsList: () => Promise<JSBridgeWalletConfig[]>;
26
- };
27
- /**
28
- * If app is opened in some wallet's browser returns that wallet config. Else returns null;
29
- */
30
- inWhichWalletBrowser(): Promise<JSBridgeWalletConfig | null>;
23
+ getWallets(): Promise<WalletInfo[]>;
31
24
  /**
32
25
  * Allows to subscribe to connection status changes and handle connection errors.
33
26
  * @param callback will be called after connections status changes with actual wallet or null.
@@ -65,26 +65,10 @@ var TonConnect = /** @class */ (function () {
65
65
  configurable: true
66
66
  });
67
67
  /**
68
- * Indicates if the injected wallet is available.
68
+ * Returns available wallets list.
69
69
  */
70
- TonConnect.prototype.inWhichWalletBrowser = function () {
71
- return tslib_1.__awaiter(this, void 0, void 0, function () {
72
- var injectedWalletsList;
73
- return tslib_1.__generator(this, function (_a) {
74
- switch (_a.label) {
75
- case 0: return [4 /*yield*/, this.walletsList.getInjectedWalletsList()];
76
- case 1:
77
- injectedWalletsList = _a.sent();
78
- if (injectedWalletsList.length !== 1) {
79
- return [2 /*return*/, null];
80
- }
81
- if (!injected_provider_1.InjectedProvider.isInsideWalletBrowser(injectedWalletsList[0].jsBridgeKey)) {
82
- return [2 /*return*/, null];
83
- }
84
- return [2 /*return*/, injectedWalletsList[0]];
85
- }
86
- });
87
- });
70
+ TonConnect.prototype.getWallets = function () {
71
+ return this.walletsList.getWallets();
88
72
  };
89
73
  /**
90
74
  * Allows to subscribe to connection status changes and handle connection errors.
@@ -119,15 +103,15 @@ var TonConnect = /** @class */ (function () {
119
103
  */
120
104
  TonConnect.prototype.restoreConnection = function () {
121
105
  return tslib_1.__awaiter(this, void 0, void 0, function () {
122
- var _a, bridgeConnectionType, injectedWalletsList, _b, _c, _d, _e;
106
+ var _a, bridgeConnectionType, embeddedWallet, _b, _c, _d, _e;
123
107
  return tslib_1.__generator(this, function (_f) {
124
108
  switch (_f.label) {
125
109
  case 0: return [4 /*yield*/, Promise.all([
126
110
  this.bridgeConnectionStorage.storedConnectionType(),
127
- this.walletsList.getInjectedWalletsList()
111
+ this.walletsList.getEmbeddedWallet()
128
112
  ])];
129
113
  case 1:
130
- _a = _f.sent(), bridgeConnectionType = _a[0], injectedWalletsList = _a[1];
114
+ _a = _f.sent(), bridgeConnectionType = _a[0], embeddedWallet = _a[1];
131
115
  _b = bridgeConnectionType;
132
116
  switch (_b) {
133
117
  case 'http': return [3 /*break*/, 2];
@@ -147,12 +131,10 @@ var TonConnect = /** @class */ (function () {
147
131
  _d.provider = _f.sent();
148
132
  return [3 /*break*/, 9];
149
133
  case 6:
150
- if (!(injectedWalletsList.length === 1)) return [3 /*break*/, 8];
151
- // DApp probably opened in the wallet's browser. Should try smart auto connect
134
+ if (!embeddedWallet) return [3 /*break*/, 8];
152
135
  _e = this;
153
- return [4 /*yield*/, this.createProvider(injectedWalletsList[0])];
136
+ return [4 /*yield*/, this.createProvider(embeddedWallet)];
154
137
  case 7:
155
- // DApp probably opened in the wallet's browser. Should try smart auto connect
156
138
  _e.provider = _f.sent();
157
139
  return [3 /*break*/, 9];
158
140
  case 8: return [2 /*return*/];
@@ -246,7 +228,7 @@ var TonConnect = /** @class */ (function () {
246
228
  };
247
229
  if (tonProofItem) {
248
230
  wallet.connectItems = {
249
- tonProof: tonProofItem.signature
231
+ tonProof: tonProofItem.proof
250
232
  };
251
233
  }
252
234
  this.wallet = wallet;
@@ -1,17 +1,10 @@
1
- import { HTTPBridgeWalletConfig, JSBridgeWalletConfig, WalletConfig } from "./models/wallet/wallet-config";
1
+ import { WalletInfoInjected, WalletInfo } from "./models/wallet/wallet-info";
2
2
  export declare class WalletsListManager {
3
3
  private walletsListCache;
4
4
  private readonly walletsListSource;
5
- getWalletsList(): Promise<WalletConfig[]>;
6
- getInjectedWalletsList(): Promise<JSBridgeWalletConfig[]>;
7
- getRemoteConnectionWalletsList(): Promise<HTTPBridgeWalletConfig[]>;
8
- getWalletsConfig(): Promise<{
9
- allWalletsList: WalletConfig[];
10
- injectedWalletsList: JSBridgeWalletConfig[];
11
- remoteConnectionWalletsList: HTTPBridgeWalletConfig[];
12
- }>;
5
+ getWallets(): Promise<WalletInfo[]>;
6
+ getEmbeddedWallet(): Promise<WalletInfoInjected | null>;
7
+ private fetchWalletsList;
13
8
  private walletConfigDTOListToWalletConfigList;
14
9
  private isCorrectWalletConfigDTO;
15
- private isInjectedWallet;
16
- private isRemoteConnectionWallet;
17
10
  }
@@ -3,87 +3,65 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WalletsListManager = void 0;
4
4
  var tslib_1 = require("tslib");
5
5
  var fetch_wallets_error_1 = require("./errors/wallets-manager/fetch-wallets.error");
6
+ var wallet_info_1 = require("./models/wallet/wallet-info");
6
7
  var injected_provider_1 = require("./provider/injected/injected-provider");
7
8
  var WalletsListManager = /** @class */ (function () {
8
9
  function WalletsListManager() {
9
10
  this.walletsListCache = null;
10
11
  this.walletsListSource = 'https://raw.githubusercontent.com/ton-connect/wallets-list/main/wallets.json';
11
12
  }
12
- WalletsListManager.prototype.getWalletsList = function () {
13
+ WalletsListManager.prototype.getWallets = function () {
13
14
  return tslib_1.__awaiter(this, void 0, void 0, function () {
14
- var walletsResponse, walletsList, e_1;
15
15
  var _this = this;
16
16
  return tslib_1.__generator(this, function (_a) {
17
- switch (_a.label) {
18
- case 0:
19
- if (this.walletsListCache) {
20
- return [2 /*return*/, this.walletsListCache];
21
- }
22
- _a.label = 1;
23
- case 1:
24
- _a.trys.push([1, 4, , 5]);
25
- return [4 /*yield*/, fetch(this.walletsListSource)];
26
- case 2:
27
- walletsResponse = _a.sent();
28
- return [4 /*yield*/, walletsResponse.json()];
29
- case 3:
30
- walletsList = _a.sent();
31
- if (!Array.isArray(walletsList) ||
32
- !walletsList.every(function (wallet) { return _this.isCorrectWalletConfigDTO(wallet); })) {
33
- throw new fetch_wallets_error_1.FetchWalletsError('Wrong wallets list format');
34
- }
35
- this.walletsListCache = this.walletConfigDTOListToWalletConfigList(walletsList);
36
- return [2 /*return*/, this.walletsListCache];
37
- case 4:
38
- e_1 = _a.sent();
39
- throw new fetch_wallets_error_1.FetchWalletsError(e_1);
40
- case 5: return [2 /*return*/];
17
+ if (!this.walletsListCache) {
18
+ this.walletsListCache = this.fetchWalletsList();
19
+ this.walletsListCache.catch(function () { return (_this.walletsListCache = null); });
41
20
  }
21
+ return [2 /*return*/, this.walletsListCache];
42
22
  });
43
23
  });
44
24
  };
45
- WalletsListManager.prototype.getInjectedWalletsList = function () {
25
+ WalletsListManager.prototype.getEmbeddedWallet = function () {
46
26
  return tslib_1.__awaiter(this, void 0, void 0, function () {
47
- var walletsList;
27
+ var walletsList, injectedWallets;
48
28
  return tslib_1.__generator(this, function (_a) {
49
29
  switch (_a.label) {
50
- case 0: return [4 /*yield*/, this.getWalletsList()];
30
+ case 0: return [4 /*yield*/, this.getWallets()];
51
31
  case 1:
52
- walletsList = (_a.sent()).filter(this.isInjectedWallet);
53
- return [2 /*return*/, walletsList.filter(function (wallet) { return injected_provider_1.InjectedProvider.isWalletInjected(wallet.jsBridgeKey); })];
32
+ walletsList = _a.sent();
33
+ injectedWallets = walletsList.filter(wallet_info_1.isWalletInfoInjected);
34
+ if (injectedWallets.length !== 1) {
35
+ return [2 /*return*/, null];
36
+ }
37
+ return [2 /*return*/, injectedWallets[0]];
54
38
  }
55
39
  });
56
40
  });
57
41
  };
58
- WalletsListManager.prototype.getRemoteConnectionWalletsList = function () {
42
+ WalletsListManager.prototype.fetchWalletsList = function () {
59
43
  return tslib_1.__awaiter(this, void 0, void 0, function () {
44
+ var walletsResponse, walletsList, e_1;
45
+ var _this = this;
60
46
  return tslib_1.__generator(this, function (_a) {
61
47
  switch (_a.label) {
62
- case 0: return [4 /*yield*/, this.getWalletsList()];
63
- case 1: return [2 /*return*/, (_a.sent()).filter(this.isRemoteConnectionWallet)];
64
- }
65
- });
66
- });
67
- };
68
- WalletsListManager.prototype.getWalletsConfig = function () {
69
- return tslib_1.__awaiter(this, void 0, void 0, function () {
70
- var allWalletsList, _a, injectedWalletsList, remoteConnectionWalletsList;
71
- return tslib_1.__generator(this, function (_b) {
72
- switch (_b.label) {
73
- case 0: return [4 /*yield*/, this.getWalletsList()];
48
+ case 0:
49
+ _a.trys.push([0, 3, , 4]);
50
+ return [4 /*yield*/, fetch(this.walletsListSource)];
74
51
  case 1:
75
- allWalletsList = _b.sent();
76
- return [4 /*yield*/, Promise.all([
77
- this.getInjectedWalletsList(),
78
- this.getRemoteConnectionWalletsList()
79
- ])];
52
+ walletsResponse = _a.sent();
53
+ return [4 /*yield*/, walletsResponse.json()];
80
54
  case 2:
81
- _a = _b.sent(), injectedWalletsList = _a[0], remoteConnectionWalletsList = _a[1];
82
- return [2 /*return*/, {
83
- allWalletsList: allWalletsList,
84
- injectedWalletsList: injectedWalletsList,
85
- remoteConnectionWalletsList: remoteConnectionWalletsList
86
- }];
55
+ walletsList = _a.sent();
56
+ if (!Array.isArray(walletsList) ||
57
+ !walletsList.every(function (wallet) { return _this.isCorrectWalletConfigDTO(wallet); })) {
58
+ throw new fetch_wallets_error_1.FetchWalletsError('Wrong wallets list format');
59
+ }
60
+ return [2 /*return*/, this.walletConfigDTOListToWalletConfigList(walletsList)];
61
+ case 3:
62
+ e_1 = _a.sent();
63
+ throw new fetch_wallets_error_1.FetchWalletsError(e_1);
64
+ case 4: return [2 /*return*/];
87
65
  }
88
66
  });
89
67
  });
@@ -98,11 +76,15 @@ var WalletsListManager = /** @class */ (function () {
98
76
  };
99
77
  if ('bridge_url' in walletConfigDTO) {
100
78
  walletConfig.bridgeUrl = walletConfigDTO.bridge_url;
101
- walletConfig.universalLinkBase =
102
- walletConfigDTO.universal_url;
79
+ walletConfig.universalLink = walletConfigDTO.universal_url;
103
80
  }
104
81
  if ('js_bridge_key' in walletConfigDTO) {
105
- walletConfig.jsBridgeKey = walletConfigDTO.js_bridge_key;
82
+ var jsBridgeKey = walletConfigDTO.js_bridge_key;
83
+ walletConfig.jsBridgeKey = jsBridgeKey;
84
+ walletConfig.injected =
85
+ injected_provider_1.InjectedProvider.isWalletInjected(jsBridgeKey);
86
+ walletConfig.embedded =
87
+ injected_provider_1.InjectedProvider.isInsideWalletBrowser(jsBridgeKey);
106
88
  }
107
89
  return walletConfig;
108
90
  });
@@ -120,16 +102,7 @@ var WalletsListManager = /** @class */ (function () {
120
102
  var containsUniversalUrl = 'universal_url' in value;
121
103
  var containsHttpBridge = 'bridge_url' in value;
122
104
  var containsJsBridge = 'js_bridge_key' in value;
123
- if (!(containsHttpBridge && containsUniversalUrl) && !containsJsBridge) {
124
- return false;
125
- }
126
- return true;
127
- };
128
- WalletsListManager.prototype.isInjectedWallet = function (wallet) {
129
- return 'jsBridgeKey' in wallet;
130
- };
131
- WalletsListManager.prototype.isRemoteConnectionWallet = function (wallet) {
132
- return 'bridgeUrl' in wallet;
105
+ return (containsHttpBridge && containsUniversalUrl) || containsJsBridge;
133
106
  };
134
107
  return WalletsListManager;
135
108
  }());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tonconnect/sdk",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "scripts": {
5
5
  "build": "npx rimraf lib && ttsc",
6
6
  "build:production": "npx rimraf lib && ttsc --sourceMap false"
@@ -26,7 +26,7 @@
26
26
  "dependencies": {
27
27
  "deepmerge": "^4.2.2",
28
28
  "tweetnacl": "^1.0.3",
29
- "@tonconnect/protocol": "^0.0.6"
29
+ "@tonconnect/protocol": "^0.0.8"
30
30
  },
31
31
  "files": [
32
32
  "lib"
@@ -1,28 +0,0 @@
1
- export interface WalletConfigBase {
2
- name: string;
3
- imageUrl: string;
4
- tondns?: string;
5
- aboutUrl: string;
6
- }
7
- export interface HTTPBridgeWalletConfig extends WalletConfigBase {
8
- universalLinkBase: string;
9
- bridgeUrl: string;
10
- }
11
- export interface JSBridgeWalletConfig extends WalletConfigBase {
12
- jsBridgeKey: string;
13
- }
14
- export declare type WalletConfig = HTTPBridgeWalletConfig | JSBridgeWalletConfig | (HTTPBridgeWalletConfig & JSBridgeWalletConfig);
15
- export interface WalletConfigDTOBase {
16
- name: string;
17
- image: string;
18
- tondns?: string;
19
- about_url: string;
20
- }
21
- export interface HTTPBridgeWalletConfigDTO extends WalletConfigDTOBase {
22
- universal_url: string;
23
- bridge_url: string;
24
- }
25
- export interface JSBridgeWalletConfigDTO extends WalletConfigDTOBase {
26
- js_bridge_key: string;
27
- }
28
- export declare type WalletConfigDTO = HTTPBridgeWalletConfigDTO | JSBridgeWalletConfigDTO | (HTTPBridgeWalletConfigDTO & JSBridgeWalletConfigDTO);
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });