# Submitting a contract transaction request

To use this method, you must provide the transaction data. Here's an example: \
(we are approving 0.1 BUSD)

```javascript
const spenderAddress = "0x78867BbEeF44f2326bF8DDd1941a4439382EF2A7";
const contractAddress = "0x78867BbEeF44f2326bF8DDd1941a4439382EF2A7";
const abi = [
  {
    inputs: [
      { internalType: "address", name: "spender", type: "address" },
      { internalType: "uint256", name: "amount", type: "uint256" },
    ],
    name: "approve",
    outputs: [{ internalType: "bool", name: "", type: "bool" }],
    stateMutability: "nonpayable",
    type: "function",
  },
];
const contract = new ethers.Contract(contractAddress, abi);
const DATA = contract.interface.encodeFunctionData("approve", [
  spenderAddress,
  "100000000000000000",
]);
```

{% hint style="info" %}
We utilize the ethers library to encode the data. You can learn more about it by referring to the following link: <https://docs.ethers.org/v5/api/utils/abi/interface/>
{% endhint %}

### Usage in your script

{% tabs %}
{% tab title="JavaScript" %}

```javascript
const sendContractTransaction = await alturaGuard.sendContractTransaction(CONTRACT_ADDRESS,CHAIN_ID,DATA);
```

{% endtab %}

{% tab title="TypeScript" %}

```typescript
const sendContractTransaction:any = await alturaGuard.sendContractTransaction(CONTRACT_ADDRESS,CHAIN_ID,DATA);
```

{% endtab %}
{% endtabs %}

### **Parameters**

<table><thead><tr><th width="218.33333333333331">Parameter</th><th width="99">Type</th><th width="109">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>CONTRACT_ADDRESS</code></td><td><strong>String</strong></td><td><strong>Yes</strong></td><td>The contract address you want to call</td></tr><tr><td><code>CHAIN_ID</code></td><td><strong>Number</strong></td><td><strong>Yes</strong></td><td>EVM Chain Indentifier</td></tr><tr><td><code>DATA</code></td><td><strong>String</strong></td><td><strong>Yes</strong></td><td>Transaction Data</td></tr></tbody></table>


---

# Agent Instructions: 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:

```
GET https://docs.altura.com/altura-documentation/js-sdk-reference/altura-guard-ii/transaction-requests/submitting-a-contract-transaction-request.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
