# Router/Factory

The Router contract oversees the full functionality of token pair registration and supports all the basic requirements of a front-end offering trading

## Code

Github Link: (Will be updated)

## Address

* Mainnet Router: EQAxC3GzQBgjlvW6CJAwgaHvarTfVxo8p7Be\_6RMSjsPki6s
* Mainnet Factory: EQDp3uMnOuXF2rurDd47BGtGKW88iSNraS8fuP0GElT6G\_39

## 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\_default\_content
  {% 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 %}
