-
Notifications
You must be signed in to change notification settings - Fork 0
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
Use Safe SDK #15
Use Safe SDK #15
Conversation
src/alt-safe.ts
Outdated
// This should be part of the kit! | ||
export async function getSafeOpHash( | ||
provider: ethers.JsonRpcProvider, | ||
safeKit: Safe4337Pack, | ||
safeOp: EthSafeOperation, | ||
) { | ||
return calculateSafeUserOperationHash( | ||
safeOp.data, | ||
BigInt(await safeKit.getChainId()), | ||
// The safe isn't deployed so we have to fetch the fallback Handler on our own: | ||
// await safeKit.protocolKit.getFallbackHandler() | ||
await getSafeModuleAddress(provider), | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the content of safe-global/safe-core-sdk#888
src/alt-safe.ts
Outdated
import { calculateSafeUserOperationHash } from "@safe-global/relay-kit/dist/src/packs/safe-4337/utils"; | ||
import { ethers } from "ethers"; | ||
import { getDeployment } from "./safe"; | ||
import { getSafeModuleSetupDeployment } from "@safe-global/safe-modules-deployments"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also be part of the kit.
src/alt-safe.ts
Outdated
@@ -0,0 +1,94 @@ | |||
import SafeApiKit, { SafeInfoResponse } from "@safe-global/api-kit"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would love to have avoided this too... its a checky hack to determine if the safe the user wants to use exists already or not. This could be determined by the setup (i.e. seed) data.
Closing as "likely wont do" |
Attempting to simplify the manually implemented
safe.ts
in favour of relay-kit and (apparently also api-kit).There is a GIST here with some additional notes:
https://gist.github.com/bh2smith/27f177a627a0e8679847b857c4d40d66
The kit is not very user friendly and missing some features as of now.
Unfortunately, the signature appears to be invalid: I suspect its something to do with the way we "add signature".