Skip to content

Commit 88b5670

Browse files
committed
details
1 parent 21f3eb7 commit 88b5670

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

packages/hypergraph/src/connect/smart-account.ts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { randomBytes } from '@noble/hashes/utils';
33
import {
44
OWNABLE_VALIDATOR_ADDRESS,
55
RHINESTONE_ATTESTER_ADDRESS,
6-
SMART_SESSIONS_ADDRESS,
76
type Session,
87
SmartSessionMode,
98
encodeSmartSessionSignature,
@@ -163,7 +162,8 @@ export {
163162
};
164163

165164
export type SmartSessionClient = {
166-
sendTransaction: <const calls extends readonly unknown[]>({ calls }: { calls: calls }) => Promise<string>;
165+
sendUserOperation: <const calls extends readonly unknown[]>({ calls }: { calls: calls }) => Promise<string>;
166+
waitForUserOperationReceipt: ({ hash }: { hash: Hex }) => Promise<WaitForUserOperationReceiptReturnType>;
167167
signMessage: ({ message }: { message: SignableMessage }) => Promise<Hex>;
168168
};
169169

@@ -775,28 +775,28 @@ export const getSmartSessionClient = async ({
775775
apiKey,
776776
});
777777

778-
const sessionDetails = {
779-
mode: SmartSessionMode.USE,
780-
permissionId,
781-
signature: getOwnableValidatorMockSignature({
782-
threshold: 1,
783-
}),
784-
};
785778
const smartSessions = getSmartSessionsValidator({});
786779
const publicClient = createPublicClient({
787780
transport: http(rpcUrl),
788781
chain,
789782
});
790783

791784
return {
792-
sendTransaction: async <const calls extends readonly unknown[]>({ calls }: { calls: calls }) => {
785+
sendUserOperation: async <const calls extends readonly unknown[]>({ calls }: { calls: calls }) => {
793786
if (!smartAccountClient.account) {
794787
throw new Error('Invalid smart account');
795788
}
796789
const account = getAccount({
797790
address: smartAccountClient.account.address,
798791
type: 'safe',
799792
});
793+
const sessionDetails = {
794+
mode: SmartSessionMode.USE,
795+
permissionId,
796+
signature: getOwnableValidatorMockSignature({
797+
threshold: 1,
798+
}),
799+
};
800800
const nonce = await getAccountNonce(publicClient, {
801801
address: smartAccountClient.account.address,
802802
entryPointAddress: entryPoint07Address,
@@ -830,5 +830,8 @@ export const getSmartSessionClient = async ({
830830
signMessage: async ({ message }: { message: SignableMessage }) => {
831831
return sessionKeyAccount.signMessage({ message });
832832
},
833+
waitForUserOperationReceipt: async ({ hash }: { hash: Hex }) => {
834+
return smartAccountClient.waitForUserOperationReceipt({ hash });
835+
},
833836
};
834837
};

0 commit comments

Comments
 (0)