Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow signing on permissioned account #11612

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -635,21 +635,17 @@ export default class DeeplinkProtocolService {
scheme: string;
account: string; // account@chainid
}) {
let walletSelectedAddress = '';
let walletSelectedChainId = '';
let dappAccountChainId = '';
let dappAccountAddress = '';

if (!params.account?.includes('@')) {
DevLogger.log(
`DeeplinkProtocolService:: handleMessage invalid params.account format ${params.account}`,
);
} else {
const account = params.account.split('@');
walletSelectedAddress = this.getSelectedAddress();
walletSelectedChainId = this.getChainId();
dappAccountChainId = account[1];
dappAccountAddress = account[0];
}

DevLogger.log(
Expand Down Expand Up @@ -696,7 +692,6 @@ export default class DeeplinkProtocolService {
DevLogger.log('DeeplinkProtocolService:: parsed message:-', message);
data = message;

const isAccountChanged = dappAccountAddress !== walletSelectedAddress;
const isChainChanged = dappAccountChainId !== walletSelectedChainId;

const rpcMethod = data.method;
Expand Down Expand Up @@ -726,10 +721,8 @@ export default class DeeplinkProtocolService {

const isRpcMethodToSkip = checkForRpcMethodToSkip();

if (isAccountChanged || (!isRpcMethodToSkip && isChainChanged)) {
const dynamicErrorMessage = `The selected ${
isAccountChanged ? 'account' : 'chain'
} has changed. Please try again.`;
if (!isRpcMethodToSkip && isChainChanged) {
const dynamicErrorMessage = `The selected chain has changed. Please try again.`;

this.sendMessage(
{
Expand Down
Loading