diff --git a/guides/integrating-the-safe-core-sdk.md b/guides/integrating-the-safe-core-sdk.md index 59258d609..813d29add 100644 --- a/guides/integrating-the-safe-core-sdk.md +++ b/guides/integrating-the-safe-core-sdk.md @@ -207,14 +207,14 @@ Once we have the Safe transaction object we can share it with the other owners o - `safeAddress`: The Safe address. - `safeTransactionData`: The `data` object inside the Safe transaction object returned from the method `createTransaction`. -- `safeTxHash`: The Safe transaction hash, calculated by calling the method `getTransactionHash` from the Protocol Kit. +- `safeTxHash`: The Safe transaction hash, calculated by calling the method `getHash` from the Protocol Kit. - `senderAddress`: The Safe owner or delegate proposing the transaction. - `senderSignature`: The signature generated by signing the `safeTxHash` with the `senderAddress`. - `origin`: Optional string that allows to provide more information about the app proposing the transaction. ```js -const safeTxHash = await safeSdk.getTransactionHash(safeTransaction) -const senderSignature = await safeSdk.signTransactionHash(safeTxHash) +const safeTxHash = await safeSdk.getHash(safeTransaction) +const senderSignature = await safeSdk.signHash(safeTxHash) await safeService.proposeTransaction({ safeAddress, safeTransactionData: safeTransaction.data, @@ -288,13 +288,13 @@ type SafeMultisigTransactionResponse = { ## 7. Confirm/reject the transaction -The owners of the Safe can now sign the transaction obtained from the Safe Transaction Service by calling the method `signTransactionHash` from the Protocol Kit to generate the signature and by calling the method `confirmTransaction` from the Safe API Kit to add the signature to the service. +The owners of the Safe can now sign the transaction obtained from the Safe Transaction Service by calling the method `signHash` from the Protocol Kit to generate the signature and by calling the method `confirmTransaction` from the Safe API Kit to add the signature to the service. ```js // transaction: SafeMultisigTransactionResponse const hash = transaction.safeTxHash -let signature = await safeSdk.signTransactionHash(hash) +let signature = await safeSdk.signHash(hash) await safeService.confirmTransaction(hash, signature.data) ``` diff --git a/packages/api-kit/tests/endpoint/index.test.ts b/packages/api-kit/tests/endpoint/index.test.ts index 27b8c0e96..1b276107c 100644 --- a/packages/api-kit/tests/endpoint/index.test.ts +++ b/packages/api-kit/tests/endpoint/index.test.ts @@ -364,7 +364,7 @@ describe('Endpoint tests', () => { const signerAddress = await signer.getAddress() const safeSdk = await Safe.create({ ethAdapter, safeAddress }) const safeTransaction = await safeSdk.createTransaction({ safeTransactionData }) - const senderSignature = await safeSdk.signTransactionHash(safeTxHash) + const senderSignature = await safeSdk.signHash(safeTxHash) await chai .expect( safeApiKit.proposeTransaction({ @@ -407,7 +407,7 @@ describe('Endpoint tests', () => { const signerAddress = await signer.getAddress() const safeSdk = await Safe.create({ ethAdapter, safeAddress }) const safeTransaction = await safeSdk.createTransaction({ safeTransactionData }) - const senderSignature = await safeSdk.signTransactionHash(safeTxHash) + const senderSignature = await safeSdk.signHash(safeTxHash) await chai .expect( safeApiKit.proposeTransaction({ diff --git a/packages/onramp-kit/src/packs/monerium/SafeMoneriumClient.test.ts b/packages/onramp-kit/src/packs/monerium/SafeMoneriumClient.test.ts index c163e744b..f5bf27e4a 100644 --- a/packages/onramp-kit/src/packs/monerium/SafeMoneriumClient.test.ts +++ b/packages/onramp-kit/src/packs/monerium/SafeMoneriumClient.test.ts @@ -148,8 +148,8 @@ describe('SafeMoneriumClient', () => { data: txData }) - safeSdk.getTransactionHash = jest.fn().mockResolvedValueOnce('0xTransactionHash') - safeSdk.signTransactionHash = jest.fn().mockResolvedValueOnce('0xTransactionSignature') + safeSdk.getHash = jest.fn().mockResolvedValueOnce('0xTransactionHash') + safeSdk.signHash = jest.fn().mockResolvedValueOnce('0xTransactionSignature') jest.spyOn(SafeApiKit.prototype, 'getTransaction').mockResolvedValueOnce({ confirmationsRequired: 1, diff --git a/packages/onramp-kit/src/packs/monerium/SafeMoneriumClient.ts b/packages/onramp-kit/src/packs/monerium/SafeMoneriumClient.ts index 0d0eaf332..97d98823a 100644 --- a/packages/onramp-kit/src/packs/monerium/SafeMoneriumClient.ts +++ b/packages/onramp-kit/src/packs/monerium/SafeMoneriumClient.ts @@ -125,9 +125,9 @@ export class SafeMoneriumClient extends MoneriumClient { } }) - const safeTxHash = await this.#safeSdk.getTransactionHash(safeTransaction) + const safeTxHash = await this.#safeSdk.getHash(safeTransaction) - const senderSignature = await this.#safeSdk.signTransactionHash(safeTxHash) + const senderSignature = await this.#safeSdk.signHash(safeTxHash) const chainId = await this.#safeSdk.getChainId() diff --git a/packages/protocol-kit/README.md b/packages/protocol-kit/README.md index f4553426f..425c60e31 100644 --- a/packages/protocol-kit/README.md +++ b/packages/protocol-kit/README.md @@ -133,7 +133,7 @@ To connect `owner2` to the Safe we need to create a new instance of the class `E ```js const ethAdapterOwner2 = new EthersAdapter({ ethers, signerOrProvider: owner2 }) const safeSdk2 = await safeSdk.connect({ ethAdapter: ethAdapterOwner2, safeAddress }) -const txHash = await safeSdk2.getTransactionHash(safeTransaction) +const txHash = await safeSdk2.getHash(safeTransaction) const approveTxResponse = await safeSdk2.approveTransactionHash(txHash) await approveTxResponse.transactionResponse?.wait() ``` @@ -633,7 +633,7 @@ const safeTransaction1 = await safeSdk.createTransaction({ safeTransactionData } const safeTransaction2 = await copyTransaction(safeTransaction1) ``` -### getTransactionHash +### getHash Returns the transaction hash of a Safe transaction. @@ -642,10 +642,10 @@ const safeTransactionData: SafeTransactionDataPartial = { // ... } const safeTransaction = await safeSdk.createTransaction({ safeTransactionData }) -const txHash = await safeSdk.getTransactionHash(safeTransaction) +const txHash = await safeSdk.getHash(safeTransaction) ``` -### signTransactionHash +### signHash Signs a hash using the current owner account. @@ -654,8 +654,8 @@ const safeTransactionData: SafeTransactionDataPartial = { // ... } const safeTransaction = await safeSdk.createTransaction({ safeTransactionData }) -const txHash = await safeSdk.getTransactionHash(safeTransaction) -const signature = await safeSdk.signTransactionHash(txHash) +const txHash = await safeSdk.getHash(safeTransaction) +const signature = await safeSdk.signHash(txHash) ``` ### signTypedData @@ -701,7 +701,7 @@ const safeTransactionData: SafeTransactionDataPartial = { // ... } const safeTransaction = await safeSdk.createTransaction({ safeTransactionData }) -const txHash = await safeSdk.getTransactionHash(safeTransaction) +const txHash = await safeSdk.getHash(safeTransaction) const txResponse = await safeSdk.approveTransactionHash(txHash) await txResponse.transactionResponse?.wait() ``` @@ -743,7 +743,7 @@ const safeTransactionData: SafeTransactionDataPartial = { // ... } const safeTransaction = await safeSdk.createTransaction({ safeTransactionData }) -const txHash = await safeSdk.getTransactionHash(safeTransaction) +const txHash = await safeSdk.getHash(safeTransaction) const ownerAddresses = await safeSdk.getOwnersWhoApprovedTx(txHash) ``` diff --git a/packages/protocol-kit/src/Safe.ts b/packages/protocol-kit/src/Safe.ts index 845329ac9..2733bc1ed 100644 --- a/packages/protocol-kit/src/Safe.ts +++ b/packages/protocol-kit/src/Safe.ts @@ -14,6 +14,7 @@ import { MetaTransactionData, Transaction } from '@safe-global/safe-core-sdk-types' +import { soliditySha3, utf8ToHex } from 'web3-utils' import { PREDETERMINED_SALT_NONCE, encodeSetupCallData, @@ -492,11 +493,16 @@ class Safe { * @param safeTransaction - The Safe transaction * @returns The transaction hash of the Safe transaction */ - async getTransactionHash(safeTransaction: SafeTransaction): Promise { + async getHash(txOrMessage: SafeTransaction | string): Promise { if (!this.#contractManager.safeContract) { throw new Error('Safe is not deployed') } - const safeTransactionData = safeTransaction.data + + if (typeof txOrMessage === 'string') { + return soliditySha3(utf8ToHex(txOrMessage)) || '' + } + + const safeTransactionData = txOrMessage.data const txHash = await this.#contractManager.safeContract.getTransactionHash(safeTransactionData) return txHash } @@ -584,8 +590,8 @@ class Safe { if (!hasSafeFeature(SAFE_FEATURES.ETH_SIGN, safeVersion)) { throw new Error('eth_sign is only supported by Safes >= v1.1.0') } - const txHash = await this.getTransactionHash(transaction) - signature = await this.signTransactionHash(txHash) + const txHash = await this.getHash(transaction) + signature = await this.signHash(txHash) } const signedSafeTransaction = await this.createTransaction({ @@ -942,7 +948,7 @@ class Safe { const signedSafeTransaction = await this.copyTransaction(transaction) - const txHash = await this.getTransactionHash(signedSafeTransaction) + const txHash = await this.getHash(signedSafeTransaction) const ownersWhoApprovedTx = await this.getOwnersWhoApprovedTx(txHash) for (const owner of ownersWhoApprovedTx) { signedSafeTransaction.addSignature(generatePreValidatedSignature(owner)) @@ -989,7 +995,7 @@ class Safe { const signedSafeTransaction = await this.copyTransaction(transaction) - const txHash = await this.getTransactionHash(signedSafeTransaction) + const txHash = await this.getHash(signedSafeTransaction) const ownersWhoApprovedTx = await this.getOwnersWhoApprovedTx(txHash) for (const owner of ownersWhoApprovedTx) { signedSafeTransaction.addSignature(generatePreValidatedSignature(owner)) diff --git a/packages/protocol-kit/tests/e2e/eip1271.test.ts b/packages/protocol-kit/tests/e2e/eip1271.test.ts index d84b7c2d7..fbd721edf 100644 --- a/packages/protocol-kit/tests/e2e/eip1271.test.ts +++ b/packages/protocol-kit/tests/e2e/eip1271.test.ts @@ -11,8 +11,7 @@ import { getAccounts } from './utils/setupTestNetwork' import { waitSafeTxReceipt } from './utils/transactions' import { itif } from './utils/helpers' import { BigNumber, ethers } from 'ethers' -import { EthSafeSignature, buildSignature } from '@safe-global/protocol-kit/utils' -import { soliditySha3, utf8ToHex } from 'web3-utils' +import { buildSignature } from '@safe-global/protocol-kit/utils' chai.use(chaiAsPromised) @@ -28,10 +27,6 @@ export const calculateSafeMessageHash = ( ) } -const hashMessage = (message: string): string => { - return soliditySha3(utf8ToHex(message)) || '0x' -} - export const EIP712_SAFE_MESSAGE_TYPE = { // "SafeMessage(bytes message)" SafeMessage: [{ type: 'bytes', name: 'message' }] @@ -39,7 +34,7 @@ export const EIP712_SAFE_MESSAGE_TYPE = { const MESSAGE = 'I am the owner of this Safe account' -describe.only('EIP1271', () => { +describe('EIP1271', () => { describe('Using a 2/3 Safe in the context of the EIP1271', async () => { const setupTests = deployments.createFixture(async ({ deployments }) => { await deployments.fixture() @@ -113,7 +108,9 @@ describe.only('EIP1271', () => { customContractAbi: customContract.signMessageLibAbi }) - const txData = signMessageLibContract.encode('signMessage', [hashMessage(MESSAGE)]) + const messageHash = await safeSdk1.getHash(MESSAGE) + + const txData = signMessageLibContract.encode('signMessage', [messageHash]) const safeTransactionData: SafeTransactionDataPartial = { to: customContract.signMessageLibAddress, @@ -129,10 +126,10 @@ describe.only('EIP1271', () => { await waitSafeTxReceipt(execResponse) - const validatedResponse1 = await safeSdk1.isValidSignature(hashMessage(MESSAGE)) + const validatedResponse1 = await safeSdk1.isValidSignature(messageHash) chai.expect(validatedResponse1).to.be.true - const validatedResponse2 = await safeSdk1.isValidSignature(hashMessage(MESSAGE), '0x') + const validatedResponse2 = await safeSdk1.isValidSignature(messageHash, '0x') chai.expect(validatedResponse2).to.be.true } ) @@ -141,7 +138,7 @@ describe.only('EIP1271', () => { const { safeSdk1, safeSdk2 } = await setupTests() // Hash the message - const messageHash = hashMessage(MESSAGE) + const messageHash = await safeSdk1.getHash(MESSAGE) const safeMessageHash = await safeSdk1.getSafeMessageHash(messageHash) // Sign the Safe message hash with the owners @@ -173,7 +170,7 @@ describe.only('EIP1271', () => { const { safeSdk1, safeSdk2 } = await setupTests() // Hash the message - const messageHash = hashMessage(MESSAGE) + const messageHash = await safeSdk1.getHash(MESSAGE) const safeMessageHash = await safeSdk1.getSafeMessageHash(messageHash) // Sign the Safe message with the owners @@ -193,7 +190,7 @@ describe.only('EIP1271', () => { const { safeSdk1, safeSdk2, safeSdk3 } = await setupTests() // Hash the message - const messageHash = hashMessage(MESSAGE) + const messageHash = await safeSdk1.getHash(MESSAGE) const safeMessageHash = await safeSdk1.getSafeMessageHash(messageHash) // Sign the Safe message with the owners @@ -218,7 +215,7 @@ describe.only('EIP1271', () => { itif(safeVersionDeployed >= '1.3.0')('should revert when message is not signed', async () => { const { safeSdk1 } = await setupTests() - const response = await safeSdk1.isValidSignature(hashMessage(MESSAGE), '0x') + const response = await safeSdk1.isValidSignature(await safeSdk1.getHash(MESSAGE), '0x') chai.expect(response).to.be.false }) @@ -229,11 +226,12 @@ describe.only('EIP1271', () => { const { safe, safeSdk1 } = await setupTests() const chainId = await safeSdk1.getChainId() - const safeMessageHash = await safeSdk1.getSafeMessageHash(hashMessage(MESSAGE)) + const messageHash = await safeSdk1.getHash(MESSAGE) + const safeMessageHash = await safeSdk1.getSafeMessageHash(messageHash) chai .expect(safeMessageHash) - .to.be.eq(calculateSafeMessageHash(safe.address, hashMessage(MESSAGE), chainId)) + .to.be.eq(calculateSafeMessageHash(safe.address, messageHash, chainId)) } ) @@ -258,21 +256,15 @@ describe.only('EIP1271', () => { const tx = await safeSdk1.createTransaction({ safeTransactionData }) - const messageHash = await safeSdk1.getTransactionHash(tx) + const txHash = await safeSdk1.getHash(tx) - const signature1 = await safeSdk1.signHash(await safeSdk1.getSafeMessageHash(messageHash)) + const signature1 = await safeSdk1.signHash(await safeSdk1.getSafeMessageHash(txHash)) - const signature2 = await safeSdk3.signHash( - await safeSdk3.getSafeMessageHash(messageHash), - true - ) + const signature2 = await safeSdk3.signHash(await safeSdk3.getSafeMessageHash(txHash), true) console.log('OWNER 1: ', signature1.signer) console.log('OWNER 2: ', signature2.signer) - const isValidSignature = await safeSdk1.isValidSignature(messageHash, [ - signature1, - signature2 - ]) + const isValidSignature = await safeSdk1.isValidSignature(txHash, [signature1, signature2]) console.log('IS VALID SIGNATURE: ', isValidSignature) chai.expect(isValidSignature).to.be.true diff --git a/packages/protocol-kit/tests/e2e/execution.test.ts b/packages/protocol-kit/tests/e2e/execution.test.ts index e1acfe2f6..461946b9e 100644 --- a/packages/protocol-kit/tests/e2e/execution.test.ts +++ b/packages/protocol-kit/tests/e2e/execution.test.ts @@ -144,7 +144,7 @@ describe('Transactions execution', () => { } const tx = await safeSdk1.createTransaction({ safeTransactionData }) const signedTx = await safeSdk1.signTransaction(tx) - const txHash = await safeSdk2.getTransactionHash(tx) + const txHash = await safeSdk2.getHash(tx) const txResponse = await safeSdk2.approveTransactionHash(txHash) await waitSafeTxReceipt(txResponse) await chai @@ -321,7 +321,7 @@ describe('Transactions execution', () => { const tx = await safeSdk1.createTransaction({ safeTransactionData }) // Signature: on-chain - const txHash = await safeSdk1.getTransactionHash(tx) + const txHash = await safeSdk1.getHash(tx) const txResponse1 = await safeSdk1.approveTransactionHash(txHash) await waitSafeTxReceipt(txResponse1) @@ -376,7 +376,7 @@ describe('Transactions execution', () => { const tx = await safeSdk1.createTransaction({ safeTransactionData }) // Signature: on-chain - const txHash = await safeSdk1.getTransactionHash(tx) + const txHash = await safeSdk1.getHash(tx) const txResponse1 = await safeSdk1.approveTransactionHash(txHash) await waitSafeTxReceipt(txResponse1) @@ -437,7 +437,7 @@ describe('Transactions execution', () => { const tx = await safeSdk1.createTransaction({ safeTransactionData }) // Signature: on-chain - const txHash = await safeSdk1.getTransactionHash(tx) + const txHash = await safeSdk1.getHash(tx) const txResponse1 = await safeSdk1.approveTransactionHash(txHash) await waitSafeTxReceipt(txResponse1) @@ -504,7 +504,7 @@ describe('Transactions execution', () => { const tx = await safeSdk1.createTransaction({ safeTransactionData }) // Signature: on-chain - const txHash = await safeSdk1.getTransactionHash(tx) + const txHash = await safeSdk1.getHash(tx) const txResponse1 = await safeSdk1.approveTransactionHash(txHash) await waitSafeTxReceipt(txResponse1) @@ -557,7 +557,7 @@ describe('Transactions execution', () => { } const tx = await safeSdk1.createTransaction({ safeTransactionData }) const signedTx = await safeSdk1.signTransaction(tx) - const txHash = await safeSdk2.getTransactionHash(tx) + const txHash = await safeSdk2.getHash(tx) const txResponse1 = await safeSdk2.approveTransactionHash(txHash) await waitSafeTxReceipt(txResponse1) const txResponse2 = await safeSdk3.executeTransaction(signedTx) @@ -835,7 +835,7 @@ describe('Transactions execution', () => { ] const multiSendTx = await safeSdk1.createTransaction({ safeTransactionData }) const signedMultiSendTx = await safeSdk1.signTransaction(multiSendTx) - const txHash = await safeSdk2.getTransactionHash(multiSendTx) + const txHash = await safeSdk2.getHash(multiSendTx) const txResponse1 = await safeSdk2.approveTransactionHash(txHash) await waitSafeTxReceipt(txResponse1) const txResponse2 = await safeSdk3.executeTransaction(signedMultiSendTx) @@ -892,7 +892,7 @@ describe('Transactions execution', () => { ] const multiSendTx = await safeSdk1.createTransaction({ safeTransactionData }) const signedMultiSendTx = await safeSdk1.signTransaction(multiSendTx) - const txHash = await safeSdk2.getTransactionHash(multiSendTx) + const txHash = await safeSdk2.getHash(multiSendTx) const txResponse1 = await safeSdk2.approveTransactionHash(txHash) await waitSafeTxReceipt(txResponse1) const txResponse2 = await safeSdk3.executeTransaction(signedMultiSendTx) diff --git a/packages/protocol-kit/tests/e2e/offChainSignatures.test.ts b/packages/protocol-kit/tests/e2e/offChainSignatures.test.ts index c4d368f94..a34d9f7d3 100644 --- a/packages/protocol-kit/tests/e2e/offChainSignatures.test.ts +++ b/packages/protocol-kit/tests/e2e/offChainSignatures.test.ts @@ -38,7 +38,7 @@ describe('Off-chain signatures', () => { } }) - describe('signTransactionHash', async () => { + describe('signHash', async () => { it('should sign a transaction hash with the current signer if the Safe is not deployed', async () => { const { predictedSafe, accounts, contractNetworks } = await setupTests() const [account1] = accounts @@ -49,7 +49,7 @@ describe('Off-chain signatures', () => { contractNetworks }) const txHash = '0xcbf14050c5fcc9b71d4a3ab874cc728db101d19d4466d56fcdbb805117a28c64' - const signature = await safeSdk.signTransactionHash(txHash) + const signature = await safeSdk.signHash(txHash) chai.expect(signature.staticPart().length).to.be.eq(132) }) @@ -68,8 +68,8 @@ describe('Off-chain signatures', () => { data: '0x' } const tx = await safeSdk.createTransaction({ safeTransactionData }) - const txHash = await safeSdk.getTransactionHash(tx) - const signature = await safeSdk.signTransactionHash(txHash) + const txHash = await safeSdk.getHash(tx) + const signature = await safeSdk.signHash(txHash) chai.expect(signature.staticPart().length).to.be.eq(132) }) }) diff --git a/packages/protocol-kit/tests/e2e/onChainSignatures.test.ts b/packages/protocol-kit/tests/e2e/onChainSignatures.test.ts index 6eef8d655..e713b6f26 100644 --- a/packages/protocol-kit/tests/e2e/onChainSignatures.test.ts +++ b/packages/protocol-kit/tests/e2e/onChainSignatures.test.ts @@ -66,7 +66,7 @@ describe('On-chain signatures', () => { data: '0x' } const tx = await safeSdk1.createTransaction({ safeTransactionData }) - const hash = await safeSdk1.getTransactionHash(tx) + const hash = await safeSdk1.getHash(tx) await chai .expect(safeSdk1.approveTransactionHash(hash)) .to.be.rejectedWith('Transaction hashes can only be approved by Safe owners') @@ -87,7 +87,7 @@ describe('On-chain signatures', () => { data: '0x' } const tx = await safeSdk1.createTransaction({ safeTransactionData }) - const txHash = await safeSdk1.getTransactionHash(tx) + const txHash = await safeSdk1.getHash(tx) const txResponse = await safeSdk1.approveTransactionHash(txHash) await waitSafeTxReceipt(txResponse) chai.expect(await safe.approvedHashes(account1.address, txHash)).to.be.equal(1) @@ -108,7 +108,7 @@ describe('On-chain signatures', () => { data: '0x' } const tx = await safeSdk1.createTransaction({ safeTransactionData }) - const txHash = await safeSdk1.getTransactionHash(tx) + const txHash = await safeSdk1.getHash(tx) chai.expect(await safe.approvedHashes(account1.address, txHash)).to.be.equal(0) const txResponse1 = await safeSdk1.approveTransactionHash(txHash) await waitSafeTxReceipt(txResponse1) @@ -151,7 +151,7 @@ describe('On-chain signatures', () => { data: '0x' } const tx = await safeSdk1.createTransaction({ safeTransactionData }) - const txHash = await safeSdk1.getTransactionHash(tx) + const txHash = await safeSdk1.getHash(tx) const ownersWhoApproved0 = await safeSdk1.getOwnersWhoApprovedTx(txHash) chai.expect(ownersWhoApproved0.length).to.be.eq(0) const txResponse1 = await safeSdk1.approveTransactionHash(txHash) diff --git a/playground/api-kit/confirm-transaction.ts b/playground/api-kit/confirm-transaction.ts index e8d841c16..67dcc2f3a 100644 --- a/playground/api-kit/confirm-transaction.ts +++ b/playground/api-kit/confirm-transaction.ts @@ -52,7 +52,7 @@ async function main() { // const transactions = await service.getAllTransactions() const safeTxHash = transaction.transactionHash - const signature = await safe.signTransactionHash(safeTxHash) + const signature = await safe.signHash(safeTxHash) // Confirm the Safe transaction const signatureResponse = await service.confirmTransaction(safeTxHash, signature.data) diff --git a/playground/api-kit/propose-transaction.ts b/playground/api-kit/propose-transaction.ts index a195089c8..b4b7da42a 100644 --- a/playground/api-kit/propose-transaction.ts +++ b/playground/api-kit/propose-transaction.ts @@ -52,8 +52,8 @@ async function main() { const safeTransaction = await safe.createTransaction({ safeTransactionData }) const senderAddress = await signer.getAddress() - const safeTxHash = await safe.getTransactionHash(safeTransaction) - const signature = await safe.signTransactionHash(safeTxHash) + const safeTxHash = await safe.getHash(safeTransaction) + const signature = await safe.signHash(safeTxHash) // Propose transaction to the service await service.proposeTransaction({