# Quick start

## Submitting Transaction Data

Using the UXLINK Account, you can invoke other contracts to execute custom business logic.

The process for initiating a transaction is as follows:

1. Submit Execute Data.
2. Redirect to the user password verification page, where the user enters their password. Upon successful verification, the transaction is sent to the blockchain.
3. After the transaction is executed, callback to replaceUrl and query the transaction result through the order query interface.

<figure><img src="https://1311464564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxmBTbbdo6uuUZP4oH4Qc%2Fuploads%2Fgit-blob-f88c22d81cf8acd107488ef892469c499da369b4%2Faa_transcantion.png?alt=media" alt=""><figcaption></figcaption></figure>

**1. Submitting an Order**

The interface for submitting an order is as follows: `POST /oneAccount/v1/sendExecuteData`

**Request Body:**

```js
{
  executeData: {
      to: "0x.....", // Address of the business contract to be called
      data: "...", // Encoded string containing the function name to be executed in the contract and the arguments passed to this function. Method for creating executeData will be provided below.
  },
}
```

**Response:**

```js
{
    orderId: "...", // ID of this transaction, which can be used to query the transaction result.
}
```

**1.1 Generating executeData**

Creating executeData requires the ABI of the corresponding business contract. As this file is too large to be conveniently passed through the interface, it needs to be generated by the project side. Here is a function for generating it:

```js
import { ethers } from "ethers";

const rpc = ""; // TODO: Modify the RPC link used here
const provider = new ethers.providers.JsonRpcProvider(rpc);

/**
 * @param contractAddress Contract address
 * @param contractABI ABI of the contract
 * @param executeFunctionName Name of the function to be executed
 * @param executeFunctionArgs Arguments to be passed to the function
 */
createExecuteData(contractAddress: string, contractABI: any[], executeFunctionName: string, executeFunctionArgs: any[]) {
  const contract = new ethers.Contract(contractAddress, contractABI, provider);
  return {
    to: contractAddress,
    data: contract.interface.encodeFunctionData(executeFunctionName, executeFunctionArgs),
  };
}
```

**2. Redirecting to the User Password Verification Page**

After obtaining the orderId, redirect to:

{% code overflow="wrap" %}

```
https://oneAccount.uxlink.io/confirmExecuteData?orderId=ORDER_ID&replaceUrl=YOUR_REDIRECT_URI
```

{% endcode %}

Upon the user entering the password on the verification page and successful validation by the server, the transaction data corresponding to this orderId will be submitted to the blockchain for execution of the relevant business logic.

**3. Querying Transaction Results**

Upon successful execution of the transaction after the user enters the password on the verification page, the page will redirect to replaceUrl with the orderId.

To query the execution result, use the transaction status query interface:

Interface: `/aaWallet/v1/getTransactionResult`

**Request Body:**

```js
{
    orderId: "...",
}
```

**Response:**

```js
// Success:
{
    orderId: "",
    transactionHash: "",
}

// Failure:
{
    orderId: "",
    error: "", // Error message
}
```
