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

Added getAccounts suppressUnauthorized param #116

Merged
merged 15 commits into from
Apr 27, 2022
Merged
7 changes: 5 additions & 2 deletions src/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ interface TypedMessageParams extends MessageParams {
}

interface WalletMiddlewareOptions {
getAccounts: (req: JsonRpcRequest<unknown>) => Promise<string[]>;
getAccounts: (
req: JsonRpcRequest<unknown>,
suppressUnauthorized?: boolean,
shanejonas marked this conversation as resolved.
Show resolved Hide resolved
) => Promise<string[]>;
processDecryptMessage?: (
msgParams: MessageParams,
req: JsonRpcRequest<unknown>,
Expand Down Expand Up @@ -379,7 +382,7 @@ export function createWalletMiddleware({
): Promise<string> {
if (typeof address === 'string' && address.length > 0) {
// ensure address is included in provided accounts
rekmarks marked this conversation as resolved.
Show resolved Hide resolved
const accounts: string[] = await getAccounts(req);
const accounts: string[] = await getAccounts(req, false);
shanejonas marked this conversation as resolved.
Show resolved Hide resolved
const normalizedAccounts: string[] = accounts.map((_address) =>
_address.toLowerCase(),
);
Expand Down