|
6 | 6 | "time"
|
7 | 7 |
|
8 | 8 | "github.com/aptos-labs/aptos-go-sdk/api"
|
| 9 | + "github.com/aptos-labs/aptos-go-sdk/crypto" |
9 | 10 | "github.com/hasura/go-graphql-client"
|
10 | 11 | )
|
11 | 12 |
|
@@ -749,8 +750,48 @@ func (client *Client) SimulateTransaction(rawTxn *RawTransaction, sender Transac
|
749 | 750 | return client.nodeClient.SimulateTransaction(rawTxn, sender, options...)
|
750 | 751 | }
|
751 | 752 |
|
752 |
| -func (client *Client) SimulateMultiTransaction(rawTxnWithData *RawTransactionWithData, sender TransactionSigner, options ...any) (data []*api.UserTransaction, err error) { |
753 |
| - return client.nodeClient.SimulateMultiTransaction(rawTxnWithData, sender, options...) |
| 753 | +// SimulateMultiTransaction simulates a multi-transaction on the Aptos blockchain. |
| 754 | +// It takes a raw transaction with data, a transaction signer, and optional parameters. |
| 755 | +// It returns a slice of UserTransaction and an error if the simulation fails. |
| 756 | +// |
| 757 | +// Parameters: |
| 758 | +// - rawTxnWithData: A pointer to RawTransactionWithData containing the transaction details. |
| 759 | +// - sender: A TransactionSigner that signs the transaction. |
| 760 | +// - options: Optional parameters for the simulation. |
| 761 | +// |
| 762 | +// Returns: |
| 763 | +// - data: A slice of UserTransaction containing the simulated transaction results. |
| 764 | +// - err: An error if the simulation fails. |
| 765 | +// SimulateMultiTransaction simulates a multi-signature transaction without broadcasting it to the network. |
| 766 | +// This function takes a raw transaction with data, a sender transaction signer, and additional signers. |
| 767 | +// It returns the simulated user transactions or an error if the simulation fails. |
| 768 | +// |
| 769 | +// Parameters: |
| 770 | +// - rawTxnWithData: A pointer to the raw transaction data to be simulated. |
| 771 | +// - sender: The primary transaction signer. |
| 772 | +// - additionalSigners: A slice of additional signers' account authenticators. |
| 773 | +// - options: Additional options for the simulation. |
| 774 | +// |
| 775 | +// Returns: |
| 776 | +// - data: A slice of pointers to the simulated user transactions. |
| 777 | +// - err: An error if the simulation fails. |
| 778 | +func (client *Client) SimulateMultiTransaction(rawTxnWithData *RawTransactionWithData, sender TransactionSigner, additionalSigners []crypto.AccountAuthenticator, options ...any) (data []*api.UserTransaction, err error) { |
| 779 | + return client.nodeClient.SimulateMultiTransaction(rawTxnWithData, sender, additionalSigners , options...) |
| 780 | +} |
| 781 | + |
| 782 | +// SimulateTransactionWithSignedTxn simulates a transaction using a signed transaction. |
| 783 | +// This function sends the signed transaction to the node client for simulation and returns |
| 784 | +// the resulting user transactions and any error encountered during the simulation. |
| 785 | +// |
| 786 | +// Parameters: |
| 787 | +// - signedTxn: A pointer to the SignedTransaction struct representing the signed transaction to be simulated. |
| 788 | +// - options: Additional optional parameters that can be passed to the simulation. |
| 789 | +// |
| 790 | +// Returns: |
| 791 | +// - data: A slice of pointers to api.UserTransaction structs representing the simulated user transactions. |
| 792 | +// - err: An error object if an error occurred during the simulation, otherwise nil. |
| 793 | +func (client *Client) SimulateTransactionWithSignedTxn(signedTxn *SignedTransaction, options ...any) (data []*api.UserTransaction, err error) { |
| 794 | + return client.nodeClient.SimulateTransactionWithSignedTxn(signedTxn, options...) |
754 | 795 | }
|
755 | 796 |
|
756 | 797 | // GetChainId Retrieves the ChainId of the network
|
|
0 commit comments