# 获取已签名交易

## 选项 1：使用钱包私钥自行编写函数生成签名交易。&#x20;

在第一步之后，您将获得一个`estimate_trx` ，这是购买订单的成本。然后，您将使用`transactionBuilder` 创建一个转账交易，转账金额等于`estimate_trx` ，从买方地址转移到Tronsave市场的资金中：

```javascript
const dataSendTrx = await tronWeb.transactionBuilder.sendTrx('TRONSAVE_FUND_ADDRESS', estimate_trx, 'BUYER_ADDRESS') 
const signed_tx = await tronWeb.trx.sign(dataSendTrx, 'PRIVATE_KEY');
```

{% hint style="info" %} <mark style="color:blue;">`BUYER_ADDRESS`</mark> 是买方的公共地址。&#x20;

<mark style="color:blue;">`PRIVATE_KEY`</mark> 是买方的私钥。&#x20;

<mark style="color:blue;">`TRONSAVE_FUND_ADDRESS`</mark> 是我们在主网上的 Tronsave 基金地址。&#x20;
{% endhint %}

我们的 Tronsave 基金地址是 (<mark style="color:blue;">`TRONSAVE_FUND_ADDRESS`</mark> ):&#x20;

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

```java
TWZEhq5JuUVvGtutNgnRBATbF8BnHGyn4S
```

{% endtab %}

{% tab title="Nile (For testing)" %}
⚠️ *该资金地址仅用于 TRON Nile 测试网测试用途。*

```
TATT1UzHRikft98bRFqApFTsaSw73ycfoS
```

{% endtab %}
{% endtabs %}

## 选项 2：使用Tronsave的Get Signed Transaction API自动生成签名交易。

### [Buy API (Postman) ](https://www.postman.com/tronsave/tronsave/request/9katmpn/2-tronwebsigntx)

<mark style="color:orange;">`POST`</mark>` ``https://api.tronsave.io/v0/signed-tx`

速率限制 (Rate limit): 每1秒15个请求。

**Request params**

<table><thead><tr><th width="174.33333333333331">域</th><th width="83">地点</th><th width="102">类型</th><th width="79">必需</th><th>描述</th></tr></thead><tbody><tr><td>address</td><td>body</td><td>string</td><td>true</td><td>买方的公共地址</td></tr><tr><td>private_key</td><td>body</td><td>string</td><td>false</td><td>买方的私钥</td></tr><tr><td>estimate_trx</td><td>body</td><td>number</td><td>false</td><td>支付的TRX金额以SUN计算。（<a href="/pages/vF28bHwazVtLPVbbA2nq">第1步中的estimate_trx</a>）</td></tr></tbody></table>

**Request params example**

```java
{ 
"address": "TM6ZeEgpefyGWeMLuzSbfqTGkPv8Z65432", 
"private_key": "{{yourprivateKey}}", 
"estimate_trx": 13500000 //from Step1 
}
```

&#x20;**Responses**

```java
"visible": false,
            "txID": "446eed36e31249b98b201db2e81a3825b185f1a3d8b2fea348b24fc021e58e0d",
            "raw_data": {
                "contract": [
                {
                    "parameter": {
                    "value": {
                        "amount": 13500000,
                        "owner_address": "417a0d868d1418c9038584af1252f85d486502eec0",
                        "to_address": "41055756f33f419278d9ea059bd2b21120e6add748"
                    },
                    "type_url": "type.googleapis.com/protocol.TransferContract"
                    },
                    "type": "TransferContract"
                }
                ],
                "ref_block_bytes": "0713",
                "ref_block_hash": "6c5f7686f4176139",
                "expiration": 1691465106000,
                "timestamp": 1691465046758
            },
            "raw_data_hex": "0a02071322086c5f7686f417613940d084b5999d315a68080112640a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412330a15417a0d868d1418c9038584af1252f85d486502eec0121541055756f33f419278d9ea059bd2b21120e6add74818e0fcb70670e6b5b1999d31",
            "signature": ["xxxxxxxxx"]
            }
        }
```


---

# 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.tronsave.io/chinese/developer/rest-api-v0/buy-on-rest-api/use-signed-transaction/get-signed-transaction.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.
