> For the complete documentation index, see [llms.txt](https://docs.catfee.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.catfee.io/en/seamless-energy/api-integration.md).

# API Integration

Integrate CatFee Seamless Energy by changing only the TRON transaction broadcast node domain.

Integrating Seamless Energy is simple: **replace the original TRON broadcast node domain with your CatFee Seamless Energy node domain.**

The transaction signature, API path, request method, and request body do not need to change.

## At a glance

Suppose the original broadcast endpoint is:

```http
https://api.trongrid.io/wallet/broadcasttransaction
```

After integration, change it to:

```http
https://{NodeSlug}.catfee.vip/wallet/broadcasttransaction
```

Only replace the node domain at the beginning:

```diff
- https://api.trongrid.io
+ https://{NodeSlug}.catfee.vip
```

Keep the broadcast path unchanged:

```
/wallet/broadcasttransaction
```

{% hint style="info" %}
If your system lets you configure the broadcast node separately, replace only the broadcast node domain. Balance, block, and transaction queries can continue using the original node.
{% endhint %}

## Integration steps

1. Apply for a Seamless Energy node in the CatFee User Center.
2. Obtain your dedicated node domain, such as `https://{NodeSlug}.catfee.vip`.
3. Replace the broadcast node domain used for signed transactions with this domain.
4. Verify the integration with a small transaction.

The Seamless Energy node will then automatically prepare ENERGY or BANDWIDTH according to the transaction's requirements before broadcasting the original transaction to the TRON network.

## HTTP integration

### JSON transaction

```http
POST https://{NodeSlug}.catfee.vip/wallet/broadcasttransaction
```

### Hex transaction

```http
POST https://{NodeSlug}.catfee.vip/wallet/broadcasthex
```

Keep the API path and request body in the original TRON format.

## Request example

```bash
curl -X POST "https://{NodeSlug}.catfee.vip/wallet/broadcasttransaction" \
  -H "Content-Type: application/json" \
  -H "CF-NODE-KEY: {AccessKey}" \
  -d '{
    "raw_data_hex": "...",
    "signature": ["..."]
  }'
```

When using API KEY authentication, add this request header:

```http
CF-NODE-KEY: {AccessKey}
```

This header is not required when using bound address authentication or no authentication.

## gRPC integration

The gRPC integration is just as simple: **replace the original TRON gRPC service address with the Seamless Energy node address**. Keep the existing Protobuf definitions, transaction signing, and broadcast method unchanged.

{% hint style="warning" %}
The standard Seamless Energy gRPC API node at `{NodeSlug}.catfee.vip:443` can only be called over SSL/TLS. The TronLink mobile app uses the dedicated plaintext gRPC node at `{NodeSlug}.catfee.pro:50051`; see [Wallet Integration](/en/seamless-energy/wallet-integration.md).
{% endhint %}

```
Server: {NodeSlug}.catfee.vip
Port: 443
SSL/TLS: enabled
Broadcast method: /protocol.Wallet/BroadcastTransaction
```

Example configuration:

```yaml
target: "{NodeSlug}.catfee.vip:443"
tls: true
method: "/protocol.Wallet/BroadcastTransaction"
```

When using API KEY authentication, add this gRPC metadata:

```
CF-NODE-KEY: {AccessKey}
```

This metadata is not required when using bound address authentication or no authentication.

Only the service address changes:

```diff
- Original TRON gRPC service address
+ {NodeSlug}.catfee.vip:443
```

Your existing Stub, signed transaction object, and `BroadcastTransaction` call can continue to be used.

## Before and after integration

| Item                  | Before                     | After                                      |
| --------------------- | -------------------------- | ------------------------------------------ |
| Node domain           | Original TRON node domain  | `{NodeSlug}.catfee.vip`                    |
| gRPC service address  | Original TRON gRPC address | `{NodeSlug}.catfee.vip:443`                |
| HTTP broadcast path   | Unchanged                  | Unchanged                                  |
| gRPC broadcast method | Unchanged                  | Unchanged                                  |
| Request body          | Unchanged                  | Unchanged                                  |
| Transaction signing   | Performed locally          | Performed locally                          |
| Resource preparation  | Handled by your system     | Energy or Bandwidth prepared automatically |

## Important notes

* Transactions sent to the Seamless Energy node must already be signed.
* CatFee does not need and will not obtain your private key or mnemonic phrase.
* Do not modify addresses, amounts, signatures, or contract parameters in the original transaction.
* Verify the integration with a small transaction before switching production traffic.

For exception handling, see the [FAQ](/en/seamless-energy/faq.md).
