aptos-labs / aptos-ts-sdk

An SDK for accessing the Aptos blockchain data, submitting transactions, and more!
https://aptos-labs.github.io/aptos-ts-sdk/
Apache License 2.0
67 stars 37 forks source link

Add the `NoAccountAuthenticator` variant #467

Open junkil-park opened 1 month ago

junkil-park commented 1 month ago

Description

This PR updates the TypeScript SDK to support the simulation enhancement AIP: https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-92.md.

Key Changes:

Simulation API Update: Allows users to simulate transactions without providing public keys by updating simulateTransaction to accept PublicKey | null instead of PublicKey. If null is provided, NoAccountAuthenticator is used as an authenticator. This new authenticator variant is supported by the Aptos VM as per this PR.

Multisig V2 Example Update: The multisig v2 example (multisig_v2.ts) is updated to reflect the change in the multisig transaction simulation behavior. To pre-check the multisig payload before creation, an entry function payload simulation with the multisig account as the sender and 0x0 as the fee payer is used.

Test Plan

This PR includes the following test scenarios:

Related Links

N.A.

junkil-park commented 1 month ago

left initial comments. can we gat a PR description on what we are changing/adding here and why?

Added!

junkil-park commented 1 month ago

Did a first round

  • Please fix the linting errors - can run pnpm lint on the sdk root folder

Some are unavoidable, so I added eslint-disable-next-line for those cases.

  • When we have a property publicKey?:PublicKey it means the publicKey is of type PublicKey or undefined - please use this syntax

Done accordingly.

  • Please update CHANGELOG

Updated.

  • Also, tests are failing

They passed locally. It requires a custom localnet. Probably, this PR should wait until the aptos-core is ready for the new simulation enhancement feature?