Skip to content

Commit 61f9bbc

Browse files
committed
feat(sdk): add eagerDeployment option to smart wallets
1 parent 81685ff commit 61f9bbc

File tree

7 files changed

+911
-640
lines changed

7 files changed

+911
-640
lines changed

.changeset/polite-trains-kick.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
"thirdweb": minor
3+
---
4+
5+
Feature: Adds eagerDeployment option for smart accounts that need EIP-1271 signatures.
6+
7+
When setting `eagerDeployment` to `true`, smart accounts will use the legacy behavior of deploying prior to signing a message or typed data.
8+
9+
```ts
10+
const wallet = smartWallet({
11+
chain,
12+
gasless: true,
13+
eagerDeployment: true,
14+
});
15+
```

packages/thirdweb/src/auth/verify-hash.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,7 @@ export async function verifyHash({
129129
try {
130130
const result = await eth_call(rpcRequest, verificationData);
131131
return hexToBool(result);
132-
} catch (err) {
133-
console.error("Error verifying ERC-6492 signature", err);
132+
} catch {
134133
// Some chains do not support the eth_call simulation and will fail, so we fall back to regular EIP1271 validation
135134
const validEip1271 = await verifyEip1271Signature({
136135
hash,
@@ -154,7 +153,7 @@ export async function verifyHash({
154153
}
155154

156155
const EIP_1271_MAGIC_VALUE = "0x1626ba7e";
157-
async function verifyEip1271Signature({
156+
export async function verifyEip1271Signature({
158157
hash,
159158
signature,
160159
contract,
@@ -163,10 +162,14 @@ async function verifyEip1271Signature({
163162
signature: Hex;
164163
contract: ThirdwebContract;
165164
}): Promise<boolean> {
166-
const result = await isValidSignature({
167-
hash,
168-
signature,
169-
contract,
170-
});
171-
return result === EIP_1271_MAGIC_VALUE;
165+
try {
166+
const result = await isValidSignature({
167+
hash,
168+
signature,
169+
contract,
170+
});
171+
return result === EIP_1271_MAGIC_VALUE;
172+
} catch {
173+
return false;
174+
}
172175
}

0 commit comments

Comments
 (0)