-
Notifications
You must be signed in to change notification settings - Fork 52
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 internal transaction submission file #11
Conversation
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.
We should remove the dupe func docs in internal and have /api be source of truth?
export async function generateTransaction(args: GenerateFeePayerRawTransactionArgs): Promise<FeePayerTransaction>; | ||
export async function generateTransaction(args: GenerateMultiAgentRawTransactionArgs): Promise<MultiAgentTransaction>; | ||
export async function generateTransaction(args: GenerateRawTransactionArgs): Promise<AnyRawTransaction>; | ||
export async function buildTransaction(args: GenerateSingleSignerRawTransactionArgs): Promise<SingleSignerTransaction>; |
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.
Much better name!
@@ -180,12 +185,10 @@ export async function generateRawTransaction(args: { | |||
* When we call our `generateTransaction` function with the relevant type properties, |
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.
* When we call our `generateTransaction` function with the relevant type properties, | |
* When we call our `buildTransaction` function with the relevant type properties, |
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.
Agree with @heliuchuan on consolidating the docs to one section although we can do it later and I think you have a better idea of the intended structure here
lgtm, buildTransaction
is definitely a much better name!
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.
Can we fix the E2E transaction submission test I had to disable?
export async function generateTransaction( | ||
args: { aptosConfig: AptosConfig } & GenerateTransactionInput, | ||
): Promise<AnyRawTransaction> { | ||
const { aptosConfig, sender, data, options, secondarySignerAddresses, feePayerAddress } = args; | ||
const payload = await generateTransactionPayload(data); | ||
const rawTransaction = await buildTransaction({ |
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.
This is different than buildTransaction, or should it also be named buildTransaction?
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.
this is different. buildTransaction is a transaction_builder function, generateTransaction is a transaction_submission function
the whole e2e transaction submission tests will get changed |
Description
Just realized that previous PR was not completely full as we need to have those pure functions internally that handles the logic.
This PR conforms to the sdk design in a way that everything in
api/
folder is a user facing interface functions and those ininternal/
folder are responsible on the actual logic.more info https://github.com/aptos-labs/aptos-ts-sdk/pull/11/files#diff-a5a44d0986e0254ae62cd623aeaac609a288c9b2eabe5c741fd5b4a4f350a3ddR2
Test Plan
pnpm jest