@dynamic-labs/solana 4.48.2 → 4.50.1
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/CHANGELOG.md +27 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +12 -12
- package/src/index.cjs +2 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/injected/walletStandard/createSolanaSignerFromWalletStandard/createSolanaSignerFromWalletStandard.cjs +17 -7
- package/src/injected/walletStandard/createSolanaSignerFromWalletStandard/createSolanaSignerFromWalletStandard.js +17 -7
- package/src/phantomRedirect/PhantomRedirect/PhantomRedirect.cjs +200 -63
- package/src/phantomRedirect/PhantomRedirect/PhantomRedirect.d.ts +18 -2
- package/src/phantomRedirect/PhantomRedirect/PhantomRedirect.js +202 -65
- package/src/phantomRedirect/storage/storage.cjs +77 -4
- package/src/phantomRedirect/storage/storage.d.ts +10 -0
- package/src/phantomRedirect/storage/storage.js +77 -4
- package/src/phantomRedirect/types.d.ts +1 -1
- package/src/walletConnect/SolanaWalletConnectConnector/SolanaWalletConnectConnector.cjs +12 -11
- package/src/walletConnect/SolanaWalletConnectConnector/SolanaWalletConnectConnector.js +13 -12
|
@@ -230,7 +230,6 @@ class SolanaWalletConnectConnector extends solanaCore.SolanaWalletConnector {
|
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
setupWCEventListeners() {
|
|
233
|
-
logger.logger.debug('[SolanaWalletConnect] setupWCEventListeners');
|
|
234
233
|
SolanaWalletConnectConnector.sessionEventListeners.push((event) => this.handleSessionEvent(event));
|
|
235
234
|
}
|
|
236
235
|
endSession() {
|
|
@@ -248,14 +247,16 @@ class SolanaWalletConnectConnector extends solanaCore.SolanaWalletConnector {
|
|
|
248
247
|
});
|
|
249
248
|
}
|
|
250
249
|
displayUri(connectionOpts) {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
250
|
+
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
251
|
+
if (!this.connectionUri) {
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
logger.logger.debug('[SolanaWalletConnect] handleDisplayURI', this.connectionUri);
|
|
255
|
+
yield walletConnectorCore.performPlatformSpecificConnectionMethod(this.connectionUri, this.metadata.deepLinks, {
|
|
256
|
+
onDesktopUri: connectionOpts === null || connectionOpts === void 0 ? void 0 : connectionOpts.onDesktopUri,
|
|
257
|
+
onDisplayUri: connectionOpts === null || connectionOpts === void 0 ? void 0 : connectionOpts.onDisplayUri,
|
|
258
|
+
}, this.deepLinkPreference);
|
|
259
|
+
});
|
|
259
260
|
}
|
|
260
261
|
getAddress(opts) {
|
|
261
262
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -270,7 +271,7 @@ class SolanaWalletConnectConnector extends solanaCore.SolanaWalletConnector {
|
|
|
270
271
|
*/
|
|
271
272
|
if (this.connectionUri) {
|
|
272
273
|
logger.logger.debug('[SolanaWalletConnect] getAddress - connecting to WalletConnect with existing connection URI');
|
|
273
|
-
this.displayUri(opts);
|
|
274
|
+
yield this.displayUri(opts);
|
|
274
275
|
return;
|
|
275
276
|
}
|
|
276
277
|
logger.logger.logVerboseTroubleshootingMessage('[WalletConnectConnector] getAddress', {
|
|
@@ -309,7 +310,7 @@ class SolanaWalletConnectConnector extends solanaCore.SolanaWalletConnector {
|
|
|
309
310
|
});
|
|
310
311
|
logger.logger.debug('[SolanaWalletConnect] getAddress - connection URI', uri);
|
|
311
312
|
this.connectionUri = uri;
|
|
312
|
-
this.displayUri(opts);
|
|
313
|
+
yield this.displayUri(opts);
|
|
313
314
|
this.session = yield approval();
|
|
314
315
|
const activeAddress = this.getActiveAddress();
|
|
315
316
|
this.activeAccountEmitter.emit('activeAccountDidChange', activeAddress);
|
|
@@ -7,7 +7,7 @@ import EventEmitter from 'eventemitter3';
|
|
|
7
7
|
import { SolanaWalletConnector, SolanaUiTransaction, isVersionedTransaction, isTxAlreadySigned } from '@dynamic-labs/solana-core';
|
|
8
8
|
import { StorageService, DynamicError, filterDuplicates, isMobile, PlatformService, bufferToBase64 } from '@dynamic-labs/utils';
|
|
9
9
|
import { getSignClientSingleton } from '@dynamic-labs/wallet-connect';
|
|
10
|
-
import {
|
|
10
|
+
import { getDeepLink, performPlatformSpecificConnectionMethod, isSameAddress } from '@dynamic-labs/wallet-connector-core';
|
|
11
11
|
import { logger } from '../../utils/logger.js';
|
|
12
12
|
import { createSolanaSignerForWalletConnect } from './createSolanaSignerForWalletConnect/createSolanaSignerForWalletConnect.js';
|
|
13
13
|
|
|
@@ -221,7 +221,6 @@ class SolanaWalletConnectConnector extends SolanaWalletConnector {
|
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
setupWCEventListeners() {
|
|
224
|
-
logger.debug('[SolanaWalletConnect] setupWCEventListeners');
|
|
225
224
|
SolanaWalletConnectConnector.sessionEventListeners.push((event) => this.handleSessionEvent(event));
|
|
226
225
|
}
|
|
227
226
|
endSession() {
|
|
@@ -239,14 +238,16 @@ class SolanaWalletConnectConnector extends SolanaWalletConnector {
|
|
|
239
238
|
});
|
|
240
239
|
}
|
|
241
240
|
displayUri(connectionOpts) {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
241
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
242
|
+
if (!this.connectionUri) {
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
logger.debug('[SolanaWalletConnect] handleDisplayURI', this.connectionUri);
|
|
246
|
+
yield performPlatformSpecificConnectionMethod(this.connectionUri, this.metadata.deepLinks, {
|
|
247
|
+
onDesktopUri: connectionOpts === null || connectionOpts === void 0 ? void 0 : connectionOpts.onDesktopUri,
|
|
248
|
+
onDisplayUri: connectionOpts === null || connectionOpts === void 0 ? void 0 : connectionOpts.onDisplayUri,
|
|
249
|
+
}, this.deepLinkPreference);
|
|
250
|
+
});
|
|
250
251
|
}
|
|
251
252
|
getAddress(opts) {
|
|
252
253
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -261,7 +262,7 @@ class SolanaWalletConnectConnector extends SolanaWalletConnector {
|
|
|
261
262
|
*/
|
|
262
263
|
if (this.connectionUri) {
|
|
263
264
|
logger.debug('[SolanaWalletConnect] getAddress - connecting to WalletConnect with existing connection URI');
|
|
264
|
-
this.displayUri(opts);
|
|
265
|
+
yield this.displayUri(opts);
|
|
265
266
|
return;
|
|
266
267
|
}
|
|
267
268
|
logger.logVerboseTroubleshootingMessage('[WalletConnectConnector] getAddress', {
|
|
@@ -300,7 +301,7 @@ class SolanaWalletConnectConnector extends SolanaWalletConnector {
|
|
|
300
301
|
});
|
|
301
302
|
logger.debug('[SolanaWalletConnect] getAddress - connection URI', uri);
|
|
302
303
|
this.connectionUri = uri;
|
|
303
|
-
this.displayUri(opts);
|
|
304
|
+
yield this.displayUri(opts);
|
|
304
305
|
this.session = yield approval();
|
|
305
306
|
const activeAddress = this.getActiveAddress();
|
|
306
307
|
this.activeAccountEmitter.emit('activeAccountDidChange', activeAddress);
|