> For the complete documentation index, see [llms.txt](https://docs.unizen.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.unizen.io/api-get-started/cross-chain-swap/send-transaction.md).

# Send transaction

#### Example <a href="#example.1" id="example.1"></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/cross 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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.unizen.io/api-get-started/cross-chain-swap/send-transaction.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
