Skip to content

Commit

Permalink
prettier fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
SamWilsn committed Feb 29, 2024
1 parent 2304548 commit 94f9943
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,24 +242,33 @@ function main() {
}

if (typeof request.method !== "string") {
throw new TypeError("request 'method' not a string");
throw new TypeError(
"request 'method' not a string",
);
}

let params: unknown[] | object;
if ("params" in request) {
if (!request.params || typeof request.params !== "object") {
throw new Error("request 'params' not an array or object");
if (
!request.params ||
typeof request.params !== "object"
) {
throw new Error(
"request 'params' not an array or object",
);
}
params = request.params;
} else {
params = [];
}

try {
response.result = await blockchain.provider.request({
method: request.method,
params,
});
response.result = await blockchain.provider.request(
{
method: request.method,
params,
},
);
} catch (error: unknown) {
response.error = error;
}
Expand Down Expand Up @@ -315,14 +324,14 @@ function main() {
"switching from chain id",
walletChain,
"to",
chainId
chainId,
);

await unboundWallet.wallet.switchChain({ id: chainId });
// TODO: This likely will need a glue event.

throw new Error(
`want chain ${chainId} but got chain ${walletChain}`
`want chain ${chainId} but got chain ${walletChain}`,
);
},
});
Expand Down

0 comments on commit 94f9943

Please sign in to comment.