aptos-labs / aptos-wallet-adapter

A monorepo modular wallet adapter for Aptos applications
https://aptos-labs.github.io/aptos-wallet-adapter/
Apache License 2.0
86 stars 91 forks source link

Wallet adapter fails to use fullnode url at `submitTransaction` #392

Open JackyWYX opened 1 month ago

JackyWYX commented 1 month ago

Description

Code

During submitTransaction, a new AptosConfig is created, but the new config does not include the optional fullnode field in the config data structure, which will lead to fullnode config does not take effect when submitting transaction.

  async submitTransaction(
    transaction: InputSubmitTransactionData
  ): Promise<PendingTransactionResponse> {
    ...
      const aptosConfig = new AptosConfig({
        network: convertNetwork(this.network),
      });
      ...

Proposed solution

Add optional fullnode url and other optional settings from AptosConfig when creating the new AptosConfig at submitTransaction

0xmaayan commented 1 month ago

Hi @JackyWYX , thanks for reporting.

The adapter logic is - first check the wallet supports submitTransaction, if it does it would use the network set on the wallet.

But when a wallet doesnt support that feature, then the adapter assumes only Aptos networks. I think adding optional fullnode (and some other configs like indexerurl, etc) to the adapter APIs makes sense - we would need it on the Provider level and on AdapterCore for some APIs - submitTransaction, signTransaction , signAndSubmitTransaction

zhshy11 commented 1 month ago

Hi @JackyWYX , thanks for reporting.

The adapter logic is - first check the wallet supports submitTransaction, if it does it would use the network set on the wallet.

But when a wallet doesnt support that feature, then the adapter assumes only Aptos networks. I think adding optional fullnode (and some other configs like indexerurl, etc) to the adapter APIs makes sense - we would need it on the Provider level and on AdapterCore for some APIs - submitTransaction, signTransaction , signAndSubmitTransaction

Hello, do you have a time schedule?

0xmaayan commented 1 month ago

Hi @JackyWYX , thanks for reporting. The adapter logic is - first check the wallet supports submitTransaction, if it does it would use the network set on the wallet. But when a wallet doesnt support that feature, then the adapter assumes only Aptos networks. I think adding optional fullnode (and some other configs like indexerurl, etc) to the adapter APIs makes sense - we would need it on the Provider level and on AdapterCore for some APIs - submitTransaction, signTransaction , signAndSubmitTransaction

Hello, do you have a time schedule?

could probably only start working on it mid-late September - are you open to submit a PR for that?