-
Notifications
You must be signed in to change notification settings - Fork 363
Add gas estimation endpoint from gateway SDK #2725
Conversation
CLA Assistant Lite All Contributors have signed the CLA. |
@@ -162,7 +162,7 @@ export const ReviewConfirm = ({ | |||
origin: app.id, | |||
navigateToTransactionsTab: false, | |||
txNonce: txParameters.safeNonce, | |||
safeTxGas: txParameters.safeTxGas ? txParameters.safeTxGas : undefined, | |||
safeTxGas: txParameters.safeTxGas, |
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.
Previously we were casting to Number here. This value can only be string
or undefined
so no need for ternary check here, if value is already undefined we can safely return the value
ESLint Summary View Full Report
Report generated by eslint-plus-action |
E2E Tests Passed |
Use fetchSafesByOwner from client-gateway
const url = `${getTxServiceUrl()}/owners/${ownerAddress}/safes` | ||
const res = await axios.get<{ safes: string[] }>(url) | ||
return res.data.safes | ||
return getOwnedSafes(getClientGatewayUrl(), getNetworkId().toString(), checksumAddress(ownerAddress)).then( |
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.
Oh, thanks! This was a heavy request!
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.
🎉
E2E Tests Passed |
E2E Tests Passed |
I tried in rinkeby and I had no issues, with safes with 2 owners and 1 owner needed. The safeTxGas estimation looked fine, I was able to execute tx with the default estimation just fine I tried in Polygon and it worked a bit, but it seems the network is slow today so some tx didn't even trigger signatures. I'll try that one later, but the tx I was able to execute worked just fine |
Polygon is still a bit slow on how it is working, but the tx I signed the safeTxGas was estimated properly. |
What it solves
Resolves safe-global/safe-gateway-typescript-sdk#14
How this PR fixes it
Uses new function in the gateway SDK in order to estimate safeTxGas
Bonus
It also uses the function to fetch owned safes through the client gateway instead transaction service
How to test