web3/web3.js

Export all return types such as `Web3Account` or the signature type

Closed this issue · 0 comments

Hi, I’ve noticed that some types returned by methods aren’t exported as types, such as Web3Account or Signature (ReturnType<typeof account.sign>). This makes it more difficult to structure larger TypeScript codebases effectively. Please see the example below:

// this is not possible
import { Signature, Web3Account } from "web3"

function processSignature(signature: Signature) {
  // Do something with the signature
}

function prepareAndSignTransaction(account: Web3Account, to: Address) {
  // Prepare the transaction
}