Skip to content
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

Add method for estimateGas #43

Merged
merged 1 commit into from
Jan 25, 2022
Merged

Add method for estimateGas #43

merged 1 commit into from
Jan 25, 2022

Conversation

meppsilon
Copy link
Contributor

No description provided.

@meppsilon meppsilon requested a review from a team as a code owner January 24, 2022 23:09
@@ -470,6 +473,29 @@ export default class SmartTransactionsController extends BaseController<
return data;
}

async estimateGas(unsignedTransaction: UnsignedTransaction): Promise<Fees> {
Copy link
Contributor Author

@meppsilon meppsilon Jan 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The request payload has the same shape as the /get_fees endpoint so the logic is almost identical to getFees method. The main difference is the state property of the result: response result is stored in estimatedGas instead of fees.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return value should be Promise<EstimatedGas>

@dan437 dan437 merged commit b6e75fd into main Jan 25, 2022
@dan437 dan437 deleted the estimate-gas branch January 25, 2022 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants