# 路由器（Router）

路由器合約監督令牌對註冊的全部功能，並支持前端產品交易的所有基本要求。

## Code

Github鏈接：（待更新）

## Address

* 主網：EQAxC3GzQBgjlvW6CJAwgaHvarTfVxo8p7Be\_6RMSjsPki6s

## Read-Only Functions

{% tabs %}
{% tab title="Read-Only Functions" %}
**get\_address\_data**

```
(slice, slice, slice, slice, slice, slice) get_address_data() method_id
```

* slice admin\_address
* slice pool\_creator\_address
* slice governance\_jetton\_address
* slice mining\_rate\_admin\_address
* slice lp\_policy\_admin\_address
* slice next\_admin\_address

**get\_mining\_data**

```
(int, int, int, int, int, int) get_mining_data()
```

* int total\_mining\_amount
* int total\_mining\_rate
* int mining\_amount\_per\_sec
* int half\_life
* int total\_reward

**get\_lp\_data**

```
(int, cell, cell) get_lp_data() method_id
```

* int pool\_count
* cell ( dict ) jetton\_pair\_to\_lp
* cell ( dict ) lp\_to\_jetton\_pair

**get\_jetton\_pair\_to\_lp\_address**

```
(slice, int) get_jetton_pair_to_lp_address(slice jettonA_address, slice jettonB_address) method_id
```

* slice lp\_address
* int exist

**get\_code\_data**

```
(cell, cell, cell) get_code_data() method_id
```

* cell lp\_minter\_code
* cell lp\_wallet\_code
* cell mega\_wallet\_code

**get\_lp\_default\_content\_data**

```
(cell) get_lp_default_content_data() method_id
```

* cell lp\_de
  {% endtab %}

{% tab title="State-Changing Functions" %}

#### How to build transaction

* Swap

```typescript
await sendInternalMessageWithWallet({
    walletContract,
    secretKey,
    to: userJettonWalletAddress,
    value: toNano(0.4),
    body: beginCell()
        .storeUint(0xf8a7ea5, 32)
        .storeUint(queryId, 64)
        .storeCoins(fromAmount)
        .storeAddress(routerAddress)
        .storeAddress(responseAddress)
        .storeDict(beginCell().endCell())
        .storeCoins(toNano(0.3))
        .storeDict(beginCell()
            .storeAddress(fromJettonAddress)
            .storeAddress(toJettonAddress)
            .storeCoins(minAmount)
        .endCell())
    .endCell()
});
```

{% endtab %}
{% endtabs %}


---

# 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.megaton.fi/zh-tw/developers/he-yue/lu-you-qi-router.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.
