Skip to content

Commit 7604f0f

Browse files
authored
Merge pull request #74 from cometh-hq/develop
Develop
2 parents 75c6d89 + e02f832 commit 7604f0f

File tree

3 files changed

+21
-29
lines changed

3 files changed

+21
-29
lines changed

packages/sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"name": "yoanslvy"
77
}
88
],
9-
"version": "1.0.7",
9+
"version": "1.0.8",
1010
"description": "SDK Cometh Connect 4337",
1111
"repository": "https://github.com/cometh-hq/connect-sdk-4337.git",
1212
"keywords": [

packages/sdk/src/core/accounts/safe/safeSigner/ecdsa/ecdsa.ts

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {
99
type TypedData,
1010
type TypedDataDefinition,
1111
encodePacked,
12-
hashTypedData,
13-
toBytes,
1412
} from "viem";
1513
import { toAccount } from "viem/accounts";
1614
import { signTypedData } from "viem/actions";
@@ -67,22 +65,16 @@ export async function safeECDSASigner<
6765
const account = toAccount({
6866
address: smartAccountAddress,
6967
async signMessage({ message }) {
70-
const messageHash = hashTypedData({
71-
domain: {
72-
chainId: client.chain?.id,
73-
verifyingContract: smartAccountAddress,
74-
},
75-
types: EIP712_SAFE_MESSAGE_TYPE,
76-
primaryType: "SafeMessage" as const,
77-
message: { message: generateSafeMessageMessage(message) },
78-
});
79-
8068
return adjustVInSignature(
81-
"eth_sign",
82-
await viemSigner.signMessage({
83-
message: {
84-
raw: toBytes(messageHash),
69+
"eth_signTypedData",
70+
await viemSigner.signTypedData({
71+
domain: {
72+
chainId: client.chain?.id,
73+
verifyingContract: smartAccountAddress,
8574
},
75+
types: EIP712_SAFE_MESSAGE_TYPE,
76+
primaryType: "SafeMessage" as const,
77+
message: { message: generateSafeMessageMessage(message) },
8678
})
8779
);
8880
},

packages/sdk/src/core/actions/accounts/safe/recovery/customRecoveryActions.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ export async function getDelayModuleAddress<
3939
TTransport extends Transport = Transport,
4040
TChain extends Chain | undefined = Chain | undefined,
4141
TAccount extends ComethSafeSmartAccount | undefined =
42-
| ComethSafeSmartAccount
43-
| undefined,
42+
| ComethSafeSmartAccount
43+
| undefined,
4444
>(
4545
client: Client<TTransport, TChain, TAccount>,
4646
args: Prettify<GetDelayModuleAddressParams>
@@ -75,8 +75,8 @@ export async function getGuardianAddress<
7575
TTransport extends Transport = Transport,
7676
TChain extends Chain | undefined = Chain | undefined,
7777
TAccount extends ComethSafeSmartAccount | undefined =
78-
| ComethSafeSmartAccount
79-
| undefined,
78+
| ComethSafeSmartAccount
79+
| undefined,
8080
>(
8181
client: Client<TTransport, TChain, TAccount>,
8282
args: Prettify<GetGuardianAddressParams>
@@ -117,8 +117,8 @@ export async function addGuardian<
117117
TTransport extends Transport = Transport,
118118
TChain extends Chain | undefined = Chain | undefined,
119119
TAccount extends ComethSafeSmartAccount | undefined =
120-
| ComethSafeSmartAccount
121-
| undefined,
120+
| ComethSafeSmartAccount
121+
| undefined,
122122
>(
123123
client: Client<TTransport, TChain, TAccount>,
124124
args: Prettify<AddGuardianParams>
@@ -184,8 +184,8 @@ export async function disableGuardian<
184184
TTransport extends Transport = Transport,
185185
TChain extends Chain | undefined = Chain | undefined,
186186
TAccount extends ComethSafeSmartAccount | undefined =
187-
| ComethSafeSmartAccount
188-
| undefined,
187+
| ComethSafeSmartAccount
188+
| undefined,
189189
>(
190190
client: Client<TTransport, TChain, TAccount>,
191191
args: Prettify<DisableGuardianParams>
@@ -262,7 +262,7 @@ export async function disableGuardian<
262262
sendTransaction,
263263
"sendTransaction"
264264
)({
265-
transactions: [disableGuardianTx],
265+
calls: [disableGuardianTx],
266266
} as unknown as SendTransactionParameters);
267267
}
268268

@@ -276,8 +276,8 @@ export async function setupCustomDelayModule<
276276
TTransport extends Transport = Transport,
277277
TChain extends Chain | undefined = Chain | undefined,
278278
TAccount extends ComethSafeSmartAccount | undefined =
279-
| ComethSafeSmartAccount
280-
| undefined,
279+
| ComethSafeSmartAccount
280+
| undefined,
281281
>(
282282
client: Client<TTransport, TChain, TAccount>,
283283
args: Prettify<SetupCustomDelayModuleParams>
@@ -372,7 +372,7 @@ export async function setupCustomDelayModule<
372372
sendTransaction,
373373
"sendTransaction"
374374
)({
375-
transactions: setUpDelayTx,
375+
calls: setUpDelayTx,
376376
} as unknown as SendTransactionParameters);
377377

378378
return hash;

0 commit comments

Comments
 (0)