ton-connect 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ton_connect-0.0.1/LICENSE +21 -0
- ton_connect-0.0.1/PKG-INFO +87 -0
- ton_connect-0.0.1/README.md +56 -0
- ton_connect-0.0.1/pyproject.toml +150 -0
- ton_connect-0.0.1/setup.cfg +4 -0
- ton_connect-0.0.1/ton_connect/__init__.py +28 -0
- ton_connect-0.0.1/ton_connect/__meta__.py +8 -0
- ton_connect-0.0.1/ton_connect/cli.py +22 -0
- ton_connect-0.0.1/ton_connect/connector.py +650 -0
- ton_connect-0.0.1/ton_connect/exceptions.py +194 -0
- ton_connect-0.0.1/ton_connect/models/__init__.py +159 -0
- ton_connect-0.0.1/ton_connect/models/_types.py +209 -0
- ton_connect-0.0.1/ton_connect/models/account.py +21 -0
- ton_connect-0.0.1/ton_connect/models/app.py +67 -0
- ton_connect-0.0.1/ton_connect/models/connection.py +59 -0
- ton_connect-0.0.1/ton_connect/models/device.py +28 -0
- ton_connect-0.0.1/ton_connect/models/dto.py +47 -0
- ton_connect-0.0.1/ton_connect/models/feature.py +32 -0
- ton_connect-0.0.1/ton_connect/models/message.py +48 -0
- ton_connect-0.0.1/ton_connect/models/payload.py +127 -0
- ton_connect-0.0.1/ton_connect/models/proof.py +23 -0
- ton_connect-0.0.1/ton_connect/models/request.py +128 -0
- ton_connect-0.0.1/ton_connect/models/response.py +218 -0
- ton_connect-0.0.1/ton_connect/models/session.py +112 -0
- ton_connect-0.0.1/ton_connect/models/wallet.py +59 -0
- ton_connect-0.0.1/ton_connect/provider/__init__.py +4 -0
- ton_connect-0.0.1/ton_connect/provider/gateway.py +347 -0
- ton_connect-0.0.1/ton_connect/provider/provider.py +391 -0
- ton_connect-0.0.1/ton_connect/provider/source/__init__.py +11 -0
- ton_connect-0.0.1/ton_connect/provider/source/decoder.py +61 -0
- ton_connect-0.0.1/ton_connect/provider/source/message.py +47 -0
- ton_connect-0.0.1/ton_connect/provider/source/source.py +153 -0
- ton_connect-0.0.1/ton_connect/provider/source/state.py +12 -0
- ton_connect-0.0.1/ton_connect/provider/storage.py +142 -0
- ton_connect-0.0.1/ton_connect/py.typed +0 -0
- ton_connect-0.0.1/ton_connect/storage/__init__.py +9 -0
- ton_connect-0.0.1/ton_connect/storage/file.py +56 -0
- ton_connect-0.0.1/ton_connect/storage/memory.py +28 -0
- ton_connect-0.0.1/ton_connect/storage/protocol.py +24 -0
- ton_connect-0.0.1/ton_connect/tonconnect.py +252 -0
- ton_connect-0.0.1/ton_connect/utils/__init__.py +41 -0
- ton_connect-0.0.1/ton_connect/utils/link.py +185 -0
- ton_connect-0.0.1/ton_connect/utils/signing.py +476 -0
- ton_connect-0.0.1/ton_connect/utils/validation.py +146 -0
- ton_connect-0.0.1/ton_connect/utils/wallets_loader.py +184 -0
- ton_connect-0.0.1/ton_connect.egg-info/PKG-INFO +87 -0
- ton_connect-0.0.1/ton_connect.egg-info/SOURCES.txt +49 -0
- ton_connect-0.0.1/ton_connect.egg-info/dependency_links.txt +1 -0
- ton_connect-0.0.1/ton_connect.egg-info/entry_points.txt +2 -0
- ton_connect-0.0.1/ton_connect.egg-info/requires.txt +4 -0
- ton_connect-0.0.1/ton_connect.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ness
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ton-connect
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Python SDK for TON Connect — wallets, transactions, signing, and verification.
|
|
5
|
+
Author: nessshon
|
|
6
|
+
Maintainer: nessshon
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/nessshon/ton-connect/
|
|
9
|
+
Project-URL: Examples, https://github.com/nessshon/ton-connect/tree/main/examples/
|
|
10
|
+
Keywords: AsyncIO,SDK,TON,TON blockchain,Ton Connect,The Open Network,blockchain
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Framework :: AsyncIO
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
23
|
+
Requires-Python: <3.15,>=3.10
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: aiohttp>=3.7.0
|
|
27
|
+
Requires-Dist: pydantic<3.0,>=2.0
|
|
28
|
+
Requires-Dist: PyNaCl>=1.5.0
|
|
29
|
+
Requires-Dist: ton-core>=0.3.0
|
|
30
|
+
Dynamic: license-file
|
|
31
|
+
|
|
32
|
+
# 📦 TON Connect
|
|
33
|
+
|
|
34
|
+
[](https://ton.org)
|
|
35
|
+

|
|
36
|
+
[](https://pypi.python.org/pypi/ton-connect)
|
|
37
|
+
[](LICENSE)
|
|
38
|
+
[](https://tonviewer.com/UQCZq3_Vd21-4y4m7Wc-ej9NFOhh_qvdfAkAYAOHoQ__Ness)
|
|
39
|
+
|
|
40
|
+

|
|
41
|
+
|
|
42
|
+

|
|
43
|
+

|
|
44
|
+

|
|
45
|
+
|
|
46
|
+
### Python SDK for [TON Connect](https://github.com/ton-connect)
|
|
47
|
+
|
|
48
|
+
Wallet connections, transactions, data signing, and proof verification for TON.
|
|
49
|
+
|
|
50
|
+
**Features**
|
|
51
|
+
|
|
52
|
+
- **Wallet Connection** — connect and manage wallet sessions
|
|
53
|
+
- **Send Transaction** — sign, send, and handle errors
|
|
54
|
+
- **Sign Data** — text, binary, and cell payloads
|
|
55
|
+
- **TON Proof** — wallet ownership verification
|
|
56
|
+
- **Storage** — file, memory, or custom backend
|
|
57
|
+
|
|
58
|
+
> Support this project — TON: `donate.ness.ton`
|
|
59
|
+
> `UQCZq3_Vd21-4y4m7Wc-ej9NFOhh_qvdfAkAYAOHoQ__Ness`
|
|
60
|
+
|
|
61
|
+
## Installation
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
pip install ton-connect
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Examples
|
|
68
|
+
|
|
69
|
+
**Connect Wallet**
|
|
70
|
+
|
|
71
|
+
- [Simple Connect](examples/connect_wallet/ton_addr.py)
|
|
72
|
+
- [Connect with TON Proof](examples/connect_wallet/ton_proof.py)
|
|
73
|
+
- [Import Connection](examples/import_connection.py)
|
|
74
|
+
|
|
75
|
+
**Send Request**
|
|
76
|
+
|
|
77
|
+
- [Send Transaction](examples/send_request/transaction.py)
|
|
78
|
+
- [Sign Data](examples/send_request/sign_data.py)
|
|
79
|
+
|
|
80
|
+
**Verification**
|
|
81
|
+
|
|
82
|
+
- [Check TON Proof](examples/check_ton_proof.py)
|
|
83
|
+
- [Check Sign Data](examples/check_sign_data.py)
|
|
84
|
+
|
|
85
|
+
## License
|
|
86
|
+
|
|
87
|
+
This repository is distributed under the [MIT License](LICENSE).
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# 📦 TON Connect
|
|
2
|
+
|
|
3
|
+
[](https://ton.org)
|
|
4
|
+

|
|
5
|
+
[](https://pypi.python.org/pypi/ton-connect)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](https://tonviewer.com/UQCZq3_Vd21-4y4m7Wc-ej9NFOhh_qvdfAkAYAOHoQ__Ness)
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+

|
|
12
|
+

|
|
13
|
+

|
|
14
|
+
|
|
15
|
+
### Python SDK for [TON Connect](https://github.com/ton-connect)
|
|
16
|
+
|
|
17
|
+
Wallet connections, transactions, data signing, and proof verification for TON.
|
|
18
|
+
|
|
19
|
+
**Features**
|
|
20
|
+
|
|
21
|
+
- **Wallet Connection** — connect and manage wallet sessions
|
|
22
|
+
- **Send Transaction** — sign, send, and handle errors
|
|
23
|
+
- **Sign Data** — text, binary, and cell payloads
|
|
24
|
+
- **TON Proof** — wallet ownership verification
|
|
25
|
+
- **Storage** — file, memory, or custom backend
|
|
26
|
+
|
|
27
|
+
> Support this project — TON: `donate.ness.ton`
|
|
28
|
+
> `UQCZq3_Vd21-4y4m7Wc-ej9NFOhh_qvdfAkAYAOHoQ__Ness`
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pip install ton-connect
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Examples
|
|
37
|
+
|
|
38
|
+
**Connect Wallet**
|
|
39
|
+
|
|
40
|
+
- [Simple Connect](examples/connect_wallet/ton_addr.py)
|
|
41
|
+
- [Connect with TON Proof](examples/connect_wallet/ton_proof.py)
|
|
42
|
+
- [Import Connection](examples/import_connection.py)
|
|
43
|
+
|
|
44
|
+
**Send Request**
|
|
45
|
+
|
|
46
|
+
- [Send Transaction](examples/send_request/transaction.py)
|
|
47
|
+
- [Sign Data](examples/send_request/sign_data.py)
|
|
48
|
+
|
|
49
|
+
**Verification**
|
|
50
|
+
|
|
51
|
+
- [Check TON Proof](examples/check_ton_proof.py)
|
|
52
|
+
- [Check Sign Data](examples/check_sign_data.py)
|
|
53
|
+
|
|
54
|
+
## License
|
|
55
|
+
|
|
56
|
+
This repository is distributed under the [MIT License](LICENSE).
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=80"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "ton-connect"
|
|
7
|
+
description = "Python SDK for TON Connect — wallets, transactions, signing, and verification."
|
|
8
|
+
requires-python = ">=3.10,<3.15"
|
|
9
|
+
authors = [
|
|
10
|
+
{ name = "nessshon" },
|
|
11
|
+
]
|
|
12
|
+
maintainers = [
|
|
13
|
+
{ name = "nessshon" },
|
|
14
|
+
]
|
|
15
|
+
dependencies = [
|
|
16
|
+
"aiohttp>=3.7.0",
|
|
17
|
+
"pydantic>=2.0,<3.0",
|
|
18
|
+
"PyNaCl>=1.5.0",
|
|
19
|
+
"ton-core>=0.3.0",
|
|
20
|
+
]
|
|
21
|
+
keywords = [
|
|
22
|
+
"AsyncIO",
|
|
23
|
+
"SDK",
|
|
24
|
+
"TON",
|
|
25
|
+
"TON blockchain",
|
|
26
|
+
"Ton Connect",
|
|
27
|
+
"The Open Network",
|
|
28
|
+
"blockchain",
|
|
29
|
+
]
|
|
30
|
+
classifiers = [
|
|
31
|
+
"Development Status :: 4 - Beta",
|
|
32
|
+
"Environment :: Console",
|
|
33
|
+
"Framework :: AsyncIO",
|
|
34
|
+
"Intended Audience :: Developers",
|
|
35
|
+
"Intended Audience :: Financial and Insurance Industry",
|
|
36
|
+
"Operating System :: OS Independent",
|
|
37
|
+
"Programming Language :: Python :: 3.10",
|
|
38
|
+
"Programming Language :: Python :: 3.11",
|
|
39
|
+
"Programming Language :: Python :: 3.12",
|
|
40
|
+
"Programming Language :: Python :: 3.13",
|
|
41
|
+
"Programming Language :: Python :: 3.14",
|
|
42
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
43
|
+
]
|
|
44
|
+
dynamic = ["version"]
|
|
45
|
+
readme = "README.md"
|
|
46
|
+
license = "MIT"
|
|
47
|
+
|
|
48
|
+
[project.scripts]
|
|
49
|
+
ton-connect = "ton_connect.cli:main"
|
|
50
|
+
|
|
51
|
+
[project.urls]
|
|
52
|
+
Homepage = "https://github.com/nessshon/ton-connect/"
|
|
53
|
+
Examples = "https://github.com/nessshon/ton-connect/tree/main/examples/"
|
|
54
|
+
|
|
55
|
+
[tool.setuptools.packages.find]
|
|
56
|
+
include = ["ton_connect", "ton_connect.*"]
|
|
57
|
+
|
|
58
|
+
[tool.setuptools.package-data]
|
|
59
|
+
ton_connect = ["py.typed"]
|
|
60
|
+
|
|
61
|
+
[tool.setuptools.dynamic]
|
|
62
|
+
version = { attr = "ton_connect.__meta__.__version__" }
|
|
63
|
+
|
|
64
|
+
[tool.ruff]
|
|
65
|
+
target-version = "py310"
|
|
66
|
+
line-length = 120
|
|
67
|
+
|
|
68
|
+
[tool.ruff.lint]
|
|
69
|
+
select = [
|
|
70
|
+
# pydocstyle
|
|
71
|
+
"D",
|
|
72
|
+
# pycodestyle
|
|
73
|
+
"E",
|
|
74
|
+
"W",
|
|
75
|
+
# pyflakes
|
|
76
|
+
"F",
|
|
77
|
+
# isort
|
|
78
|
+
"I",
|
|
79
|
+
# flake8-bugbear
|
|
80
|
+
"B",
|
|
81
|
+
# flake8-comprehensions
|
|
82
|
+
"C4",
|
|
83
|
+
# pyupgrade
|
|
84
|
+
"UP",
|
|
85
|
+
# flake8-simplify
|
|
86
|
+
"SIM",
|
|
87
|
+
# type-checking imports
|
|
88
|
+
"TCH",
|
|
89
|
+
# perflint
|
|
90
|
+
"PERF",
|
|
91
|
+
# flake8-debugger
|
|
92
|
+
"T10",
|
|
93
|
+
# flake8-print
|
|
94
|
+
"T20",
|
|
95
|
+
# flake8-pie
|
|
96
|
+
"PIE",
|
|
97
|
+
# pylint errors
|
|
98
|
+
"PLE",
|
|
99
|
+
# flake8-return
|
|
100
|
+
"RET",
|
|
101
|
+
# ruff-specific
|
|
102
|
+
"RUF",
|
|
103
|
+
]
|
|
104
|
+
ignore = [
|
|
105
|
+
# line too long
|
|
106
|
+
"E501",
|
|
107
|
+
# docstring in public module
|
|
108
|
+
"D100",
|
|
109
|
+
# docstring in public package
|
|
110
|
+
"D104",
|
|
111
|
+
# docstring in magic method
|
|
112
|
+
"D105",
|
|
113
|
+
# docstring in __init__
|
|
114
|
+
"D107",
|
|
115
|
+
# blank line before class docstring (conflicts D211)
|
|
116
|
+
"D203",
|
|
117
|
+
# multi-line summary second line (conflicts D212)
|
|
118
|
+
"D213",
|
|
119
|
+
# first word capitalization (false positive for proper nouns like dApp)
|
|
120
|
+
"D403",
|
|
121
|
+
# type-checking import (false positive for Pydantic models)
|
|
122
|
+
"TC001",
|
|
123
|
+
"TC002",
|
|
124
|
+
]
|
|
125
|
+
|
|
126
|
+
[tool.ruff.lint.per-file-ignores]
|
|
127
|
+
"__init__.py" = ["F401"]
|
|
128
|
+
"examples/*" = ["D", "T20", "RUF059"]
|
|
129
|
+
|
|
130
|
+
[tool.ruff.lint.isort]
|
|
131
|
+
known-first-party = ["ton_connect"]
|
|
132
|
+
|
|
133
|
+
[tool.ruff.format]
|
|
134
|
+
quote-style = "double"
|
|
135
|
+
|
|
136
|
+
[tool.mypy]
|
|
137
|
+
plugins = ["pydantic.mypy"]
|
|
138
|
+
python_version = "3.10"
|
|
139
|
+
strict = true
|
|
140
|
+
pretty = true
|
|
141
|
+
show_error_codes = true
|
|
142
|
+
show_error_context = true
|
|
143
|
+
namespace_packages = true
|
|
144
|
+
follow_imports_for_stubs = true
|
|
145
|
+
warn_unreachable = true
|
|
146
|
+
enable_error_code = [
|
|
147
|
+
"ignore-without-code",
|
|
148
|
+
"redundant-cast",
|
|
149
|
+
"truthy-bool",
|
|
150
|
+
]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from .connector import Connector, Event
|
|
2
|
+
from .storage import (
|
|
3
|
+
FileStorage,
|
|
4
|
+
MemoryStorage,
|
|
5
|
+
StorageProtocol,
|
|
6
|
+
)
|
|
7
|
+
from .tonconnect import TonConnect
|
|
8
|
+
from .utils import (
|
|
9
|
+
AppWalletsLoader,
|
|
10
|
+
VerifySignData,
|
|
11
|
+
VerifyTonProof,
|
|
12
|
+
create_ton_proof_payload,
|
|
13
|
+
verify_ton_proof_payload,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
__all__ = [
|
|
17
|
+
"AppWalletsLoader",
|
|
18
|
+
"Connector",
|
|
19
|
+
"Event",
|
|
20
|
+
"FileStorage",
|
|
21
|
+
"MemoryStorage",
|
|
22
|
+
"StorageProtocol",
|
|
23
|
+
"TonConnect",
|
|
24
|
+
"VerifySignData",
|
|
25
|
+
"VerifyTonProof",
|
|
26
|
+
"create_ton_proof_payload",
|
|
27
|
+
"verify_ton_proof_payload",
|
|
28
|
+
]
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Copyright (c) 2026 Shon Ness
|
|
2
|
+
#
|
|
3
|
+
# This source code is licensed under the MIT License found in the
|
|
4
|
+
# LICENSE file in the root directory of this source tree.
|
|
5
|
+
|
|
6
|
+
__version__ = "0.0.1"
|
|
7
|
+
__author__ = "nessshon"
|
|
8
|
+
__url__ = "https://github.com/nessshon/ton-connect"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
|
|
3
|
+
from .__meta__ import __version__
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def main() -> None:
|
|
7
|
+
"""CLI entry-point."""
|
|
8
|
+
parser = argparse.ArgumentParser(
|
|
9
|
+
prog="ton-connect",
|
|
10
|
+
description="TON Connect CLI.",
|
|
11
|
+
)
|
|
12
|
+
parser.add_argument(
|
|
13
|
+
"-v",
|
|
14
|
+
"--version",
|
|
15
|
+
action="version",
|
|
16
|
+
version=f"ton-connect {__version__}",
|
|
17
|
+
)
|
|
18
|
+
parser.parse_args()
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
if __name__ == "__main__":
|
|
22
|
+
main()
|