diff --git a/sdk/apps/modal-example/package.json b/sdk/apps/modal-example/package.json index a596a5d2..31de131f 100644 --- a/sdk/apps/modal-example/package.json +++ b/sdk/apps/modal-example/package.json @@ -22,11 +22,11 @@ "@nightlylabs/nightly-connect-polkadot": "0.0.16", "@nightlylabs/nightly-connect-solana": "0.0.30", "@nightlylabs/nightly-connect-sui": "0.1.0", - "@nightlylabs/wallet-selector-aptos": "^0.1.14", + "@nightlylabs/wallet-selector-aptos": "^0.1.15", "@nightlylabs/wallet-selector-base": "^0.4.3", - "@nightlylabs/wallet-selector-polkadot": "0.2.8", - "@nightlylabs/wallet-selector-solana": "0.3.10", - "@nightlylabs/wallet-selector-sui": "0.4.1", + "@nightlylabs/wallet-selector-polkadot": "0.2.9", + "@nightlylabs/wallet-selector-solana": "0.3.11", + "@nightlylabs/wallet-selector-sui": "0.4.2", "@polkadot/api": "^10.10.1", "@polkadot/extension-inject": "^0.46.5", "@solana/web3.js": "^1.77.2", diff --git a/sdk/packages/selector-aptos/package.json b/sdk/packages/selector-aptos/package.json index 1d97396c..b2289092 100644 --- a/sdk/packages/selector-aptos/package.json +++ b/sdk/packages/selector-aptos/package.json @@ -1,6 +1,6 @@ { "name": "@nightlylabs/wallet-selector-aptos", - "version": "0.1.14", + "version": "0.1.15", "description": "", "type": "module", "exports": { diff --git a/sdk/packages/selector-aptos/src/adapter.ts b/sdk/packages/selector-aptos/src/adapter.ts index 21a9c8fa..a732bfbc 100644 --- a/sdk/packages/selector-aptos/src/adapter.ts +++ b/sdk/packages/selector-aptos/src/adapter.ts @@ -422,6 +422,26 @@ export class NightlyConnectAptosAdapter extends EventEmitter this._connected = true this._connecting = false this._connectionType = ConnectionType.Nightly + // we only run it to reassign deeplinks on eager connect mobile browser (not on qr connection) + if (isMobileBrowser()) { + const wallet = this.walletsList.find((w) => w.name === 'Nightly') + if (wallet?.mobile) { + // If we have a native deeplink, we should use it + if (wallet.mobile?.native !== null) { + this._app.connectDeeplink({ + walletName: wallet.name, + url: wallet.mobile.native + }) + } + // If we have a universal deeplink, we should use it + else if (wallet.mobile?.universal !== null) { + this._app.connectDeeplink({ + walletName: wallet.name, + url: wallet.mobile.universal + }) + } + } + } this.emit('connect', this._accountInfo) resolve( Promise.resolve({ diff --git a/sdk/packages/selector-polkadot/package.json b/sdk/packages/selector-polkadot/package.json index cf4a722e..c9f4c757 100644 --- a/sdk/packages/selector-polkadot/package.json +++ b/sdk/packages/selector-polkadot/package.json @@ -1,6 +1,6 @@ { "name": "@nightlylabs/wallet-selector-polkadot", - "version": "0.2.8", + "version": "0.2.9", "description": "", "type": "module", "exports": { diff --git a/sdk/packages/selector-polkadot/src/adapter.ts b/sdk/packages/selector-polkadot/src/adapter.ts index 89799a95..deb3db19 100644 --- a/sdk/packages/selector-polkadot/src/adapter.ts +++ b/sdk/packages/selector-polkadot/src/adapter.ts @@ -546,6 +546,26 @@ export class NightlyConnectAdapter this.setSelectedWallet({ isRemote: true }) this._connected = true this._connecting = false + // we only run it to reassign deeplinks on eager connect mobile browser (not on qr connection) + if (isMobileBrowser()) { + const wallet = this.walletsList.find((w) => w.name === 'Nightly') + if (wallet?.mobile) { + // If we have a native deeplink, we should use it + if (wallet.mobile?.native !== null) { + this._app.connectDeeplink({ + walletName: wallet.name, + url: wallet.mobile.native + }) + } + // If we have a universal deeplink, we should use it + else if (wallet.mobile?.universal !== null) { + this._app.connectDeeplink({ + walletName: wallet.name, + url: wallet.mobile.universal + }) + } + } + } this.emit('connect', await this.accounts.get()) resolve() return diff --git a/sdk/packages/selector-solana/package.json b/sdk/packages/selector-solana/package.json index effc137d..abd4f049 100644 --- a/sdk/packages/selector-solana/package.json +++ b/sdk/packages/selector-solana/package.json @@ -1,6 +1,6 @@ { "name": "@nightlylabs/wallet-selector-solana", - "version": "0.3.10", + "version": "0.3.11", "description": "", "type": "module", "exports": { diff --git a/sdk/packages/selector-solana/src/adapter.ts b/sdk/packages/selector-solana/src/adapter.ts index 84dcc903..80d0d9b7 100644 --- a/sdk/packages/selector-solana/src/adapter.ts +++ b/sdk/packages/selector-solana/src/adapter.ts @@ -566,6 +566,26 @@ export class NightlyConnectAdapter extends BaseMessageSignerWalletAdapter { this._connecting = false this._connectionType = ConnectionType.Nightly this.setSelectedWallet({ isRemote: true }) + // we only run it to reassign deeplinks on eager connect mobile browser (not on qr connection) + if (isMobileBrowser()) { + const wallet = this.walletsList.find((w) => w.name === 'Nightly') + if (wallet?.mobile) { + // If we have a native deeplink, we should use it + if (wallet.mobile?.native !== null) { + this._app.connectDeeplink({ + walletName: wallet.name, + url: wallet.mobile.native + }) + } + // If we have a universal deeplink, we should use it + else if (wallet.mobile?.universal !== null) { + this._app.connectDeeplink({ + walletName: wallet.name, + url: wallet.mobile.universal + }) + } + } + } this.emit('connect', this._publicKey) resolve() return diff --git a/sdk/packages/selector-sui/package.json b/sdk/packages/selector-sui/package.json index fa6d38f2..23c84367 100644 --- a/sdk/packages/selector-sui/package.json +++ b/sdk/packages/selector-sui/package.json @@ -1,6 +1,6 @@ { "name": "@nightlylabs/wallet-selector-sui", - "version": "0.4.1", + "version": "0.4.2", "description": "", "type": "module", "exports": { diff --git a/sdk/packages/selector-sui/src/adapter.ts b/sdk/packages/selector-sui/src/adapter.ts index 2dc5b9cb..b923d767 100644 --- a/sdk/packages/selector-sui/src/adapter.ts +++ b/sdk/packages/selector-sui/src/adapter.ts @@ -329,6 +329,26 @@ export class NightlyConnectSuiAdapter extends EventEmitter { this.connecting = false this._connectionType = ConnectionType.Nightly this.setSelectedWallet({ isRemote: true }) + // we only run it to reassign deeplinks on eager connect mobile browser (not on qr connection) + if (isMobileBrowser()) { + const wallet = this.walletsList.find((w) => w.name === 'Nightly') + if (wallet?.mobile) { + // If we have a native deeplink, we should use it + if (wallet.mobile?.native !== null) { + this._app.connectDeeplink({ + walletName: wallet.name, + url: wallet.mobile.native + }) + } + // If we have a universal deeplink, we should use it + else if (wallet.mobile?.universal !== null) { + this._app.connectDeeplink({ + walletName: wallet.name, + url: wallet.mobile.universal + }) + } + } + } this.emit('connect', this._accounts) resolve() return diff --git a/sdk/pnpm-lock.yaml b/sdk/pnpm-lock.yaml index eca189a1..4218f624 100644 --- a/sdk/pnpm-lock.yaml +++ b/sdk/pnpm-lock.yaml @@ -58,19 +58,19 @@ importers: specifier: 0.1.0 version: link:../../packages/sui '@nightlylabs/wallet-selector-aptos': - specifier: ^0.1.14 + specifier: ^0.1.15 version: link:../../packages/selector-aptos '@nightlylabs/wallet-selector-base': specifier: ^0.4.3 version: link:../../packages/selector-base '@nightlylabs/wallet-selector-polkadot': - specifier: 0.2.8 + specifier: 0.2.9 version: link:../../packages/selector-polkadot '@nightlylabs/wallet-selector-solana': - specifier: 0.3.10 + specifier: 0.3.11 version: link:../../packages/selector-solana '@nightlylabs/wallet-selector-sui': - specifier: 0.4.1 + specifier: 0.4.2 version: link:../../packages/selector-sui '@polkadot/api': specifier: ^10.10.1