---
title: Libs Integration
slug: libs-integration
docTags: 
createdAt: 2024-10-07T08:39:11.597Z
---

# Integration

::::Tabs
:::Tab{title="Tonpy (Python)"}
Tonpy has LiteClient only in dev version (tonpy-dev) at the moment

```python
from tonpy import *

test = LiteClient(host="...", port=...,
                    pubkey_hex="...", timeout=5)

test.get_masterchain_info_ext().last
```

[Learn more](https://github.com/disintar/tonpy)
:::

:::Tab{title="Pytoniq (Python)"}
```python
import requests
from pytoniq import LiteBalancer

config = requests.get('LINK_FROM_BOT').json()
provider = LiteBalancer.from_config(config=config, trust_level=2)

await provider.start_up()
result = await client.run_get_method(address='EQBvW8Z5huBkMJYdnfAEM5JqTNkuWX3diqYENkWsIL0XggGG', method='seqno', stack=[])
```

[Learn more](https://github.com/yungwine/pytoniq)
:::

:::Tab{title="Tonutils (Go)"}
```go
package main

import (
	"context"
	"fmt"
	"log"

	"github.com/xssnick/tonutils-go/address"
	"github.com/xssnick/tonutils-go/liteclient"
	"github.com/xssnick/tonutils-go/ton"
)

func main() {
	client := liteclient.NewConnectionPool()

	// connect to mainnet lite server
	err := client.AddConnection(context.Background(), "IP_FROM_BOT:PORT_FROM_BOT", "BASE64_KEY_FROM_BOT")
	if err != nil {
		log.Fatalln("connection err: ", err.Error())
		return
	}

	// initialize ton api lite connection wrapper
	api := ton.NewAPIClient(client)

	// we need fresh block info to run get methods
	b, err := api.CurrentMasterchainInfo(context.Background())
	if err != nil {
		log.Fatalln("get block err:", err.Error())
		return
	}

	/*
		We will run such method of contract
		cell mult(int a, int b) method_id {
		  return begin_cell().store_uint(a * b, 64).end_cell();
		}
	*/

	res, err := api.WaitForBlock(b.SeqNo).RunGetMethod(context.Background(), b,
		address.MustParseAddr("kQBL2_3lMiyywU17g-or8N7v9hDmPCpttzBPE2isF2GTziky"), "mult", 7, 7)
	if err != nil {
		log.Fatalln("run get method err:", err.Error())
		return
	}

	val, err := res.MustCell(0).BeginParse().LoadUInt(64)
	if err != nil {
		println("ERR", err.Error())
		return
	}

	fmt.Printf("parsed result: %d\n", val)
}
```

[Learn more](https://github.com/xssnick/tonutils-go)
:::
::::



