-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat: first/last valid on SendTransactionParams #292
base: main
Are you sure you want to change the base?
Conversation
@@ -194,6 +194,9 @@ export const sendTransaction = async function ( | |||
const { transaction, from, sendParams } = send | |||
const { skipSending, skipWaiting, fee, maxFee, suppressLog, maxRoundsToWaitForConfirmation, atc } = sendParams ?? {} | |||
|
|||
if (sendParams?.firstValid) transaction.firstRound = sendParams.firstValid |
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.
Should we also add it to sendAtomicTransactionComposer, from memory it's a different code path, but a bit hazy on it.
Also, we should add this to the legacyTransactionBridge in #287
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.
Well we can't really add it to sendAtomicTransactionComposer
because it's a transaction-specific field. Setting it on sendAtomicTransactionComposer
would basically force us to update ALL the transactions with the specified lv/fv which we might not want.
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.
Yeah, that makes sense, I think I'm just getting confused about the code paths
src/types/transaction.ts
Outdated
/** The first round this transaction will be valid */ | ||
firstValid?: number | ||
/** The last round this transaction will be valid */ | ||
lastValid?: number |
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.
Should we indicate these are optional and by default are populated based on getSuggestedParams?
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.
Yeah good point. Let me know what you think of 623edb0
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.
Looks good, noting most methods also allow you to pass in suggested params as an override to avoid the algod call, but maybe that detail doesn't matter
Proposed Changes
Simply adds first and last valid to SendTransactionParams