# Send transaction in evm chains

#### Example <a href="#example" id="example"></a>

```typescript
library.getSigner().sendTransaction({ from: account, to: contractAddress, data: data, gasPrice: userGasPrice?.value, // optional gasLimit: estimateGas, // optional value: nativeValue });
```

#### Parameters <a href="#parameters" id="parameters"></a>

With data from /quote/single API (contractAddress, data, nativeValue, estimateGas)

* `library`: [ethers.providers.Web3Provider](https://docs.ethers.org/v4/cookbook-providers.html#metamask)
* `account`: the address of the wallet sending the transaction
* `data`: the transaction data to be sent
* `contractAddress`: the address of the contract to which the transaction is being sent
* `userGasPrice` (optional): the gas price set by the user
* `estimateGas` (optional): the estimated amount of gas needed for the transaction
* `currencyInIsNative`: a boolean value that indicates whether the currency being used is native to the blockchain or not
* `nativeValue`: the value of the native currency being sent with the transaction

#### Return Value <a href="#return-value" id="return-value"></a>

This function returns a promise that resolves to a transaction hash. The format data can be found here: [Signers](https://docs.ethers.org/v5/api/signer/#Signer-sendTransaction)

**ContractAddress**

When you are preparing to send a transaction, it is essential to reference the correct version of the smart contract. This version is specified within the `transactionData` of the swap endpoint. Alternatively, if you have the `disableEstimate` parameter set to false, you would refer to the quote endpoint instead. Once you have identified the correct version, you can obtain the associated address by referring to our npm package that contains all our smart contract addresses.

The `transactionData` will also provide a field known as `contractAddress`. This field reflects the same address where the transaction must be directed. However, for enhanced security and to minimize potential risks, we strongly advise retrieving the contract address through our npm package instead of solely relying on the address provided in the `transactionData`. This recommendation is made to safeguard against any inadvertent security vulnerabilities that could arise from using incorrect or outdated address information.
