diff --git a/sdk/packages/modal/src/components/nightly-selector/nightly-selector.ts b/sdk/packages/modal/src/components/nightly-selector/nightly-selector.ts index b69fdc42..89830bae 100644 --- a/sdk/packages/modal/src/components/nightly-selector/nightly-selector.ts +++ b/sdk/packages/modal/src/components/nightly-selector/nightly-selector.ts @@ -76,6 +76,17 @@ export class NightlySelector extends LitElement { @state() isMobile = false + get qrCode() { + return ( + 'nc:' + + this.sessionId + + '?network=' + + this.chainName.replace(/\s/g, '') + + '&relay=' + + this.relay + ) + } + // media queries mobileQuery = window.matchMedia('(max-width: 640px)') diff --git a/sdk/packages/selector-base/src/modal.ts b/sdk/packages/selector-base/src/modal.ts index 636fce3a..44daf443 100644 --- a/sdk/packages/selector-base/src/modal.ts +++ b/sdk/packages/selector-base/src/modal.ts @@ -35,6 +35,10 @@ export class NightlyConnectSelectorModal { return this._walletsList } + get qrCode() { + return this._modal?.qrCode + } + set walletsList(list: IWalletListItem[]) { const filtered = list.filter((w) => isMobileBrowser() ? w.walletType !== 'extension' : w.walletType !== 'mobile' diff --git a/sdk/packages/selector-polkadot/src/adapter.ts b/sdk/packages/selector-polkadot/src/adapter.ts index 72fdf76b..6f84fa96 100644 --- a/sdk/packages/selector-polkadot/src/adapter.ts +++ b/sdk/packages/selector-polkadot/src/adapter.ts @@ -116,6 +116,14 @@ export class NightlyConnectAdapter implements Injected { } } + get sessionId() { + return this._app?.sessionId + } + + get qrCode() { + if (this._modal) return this._modal.qrCode + } + public static initApp = async ( appInitData: AppSelectorInitialize ): Promise<[AppPolkadot, WalletMetadata[]]> => {