Skip to content

Transaction API #75

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

Merged
merged 6 commits into from
Jun 15, 2023
Merged

Transaction API #75

merged 6 commits into from
Jun 15, 2023

Conversation

0xFirekeeper
Copy link
Member

Transactoooooooooooooor

Copy link
Member

@joaquim-verges joaquim-verges left a comment

Choose a reason for hiding this comment

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

excited for this!

return this;
}

public Transaction SetGas(string gas)
Copy link
Member

Choose a reason for hiding this comment

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

is this gas limit or gas price? should be explicit

var gasPrice = await GetGasPrice();
var gasCost = gasLimit * gasPrice;

return new GasCosts { ether = gasPrice.ToString().ToEth(18, false), wei = gasCost };
Copy link
Member

Choose a reason for hiding this comment

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

niiice

return new GasCosts { ether = gasPrice.ToString().ToEth(18, false), wei = gasCost };
}

public async Task<Transaction> EstimateAndSetGasAsync()
Copy link
Member

Choose a reason for hiding this comment

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

when do I use this?

Copy link
Member Author

@0xFirekeeper 0xFirekeeper Jun 15, 2023

Choose a reason for hiding this comment

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

If you manually change something like data/args or to generally do another estimation step. Might introduce a min limit default 100k in this function too? I'll also use it for my typed transactions later.

return this;
}

public async Task<string> Send(bool? gasless = null)
Copy link
Member

Choose a reason for hiding this comment

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

very nice

req.uploadHandler = (UploadHandler)new UploadHandlerRaw(bodyRaw);
req.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer();
req.SetRequestHeader("Content-Type", "application/json");
await req.SendWebRequest();
Copy link
Member

Choose a reason for hiding this comment

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

the gasless code is re-used with the transaction manager no? might be useful to consolidate

Copy link
Member Author

Choose a reason for hiding this comment

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

Will likely be moving the execution steps from TransactionManager to Transaction later, also contains some differences atm.

@0xFirekeeper
Copy link
Member Author

@joaquim-verges would appreciate another review while I do the WebGL side <3

@0xFirekeeper 0xFirekeeper marked this pull request as ready for review June 15, 2023 19:26
@0xFirekeeper 0xFirekeeper merged commit faf6b5d into main Jun 15, 2023
@0xFirekeeper 0xFirekeeper deleted the firekeeper/transactions branch June 15, 2023 19:42
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