Skip to content

Commit

Permalink
add call connect in signMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
Pawel-Szydlo committed Sep 15, 2023
1 parent e0fe654 commit 6856a35
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/nightly/src/lib/injected-nightly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface NightlyAccount {
}
export interface NearNightly {
account: NightlyAccount;
connected: boolean;
isConnected: boolean;
signMessage: (params: SignMessageParams) => Promise<SignedMessage>;
signTransaction: (
transaction: NearTransaction
Expand Down
4 changes: 4 additions & 0 deletions packages/nightly/src/lib/nightly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ const Nightly: WalletBehaviourFactory<InjectedWallet> = async ({
state,
});

if (_state.wallet.isConnected) {
await _state.wallet.connect();
}

const signature = await _state.wallet.signMessage({
message,
nonce,
Expand Down

0 comments on commit 6856a35

Please sign in to comment.