poly-web3 0.0.3__py3-none-any.whl → 0.0.5__py3-none-any.whl

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.
@@ -1,63 +1,67 @@
1
- # -*- coding = utf-8 -*-
2
- # @Time: 2025-12-27 17:01:20
3
- # @Author: PinBar
4
- # @Site:
5
- # @File: example_redeem.py
6
- # @Software: PyCharm
7
- import os
8
-
9
- import dotenv
10
- from py_builder_relayer_client.client import RelayClient
11
- from py_builder_signing_sdk.config import BuilderConfig
12
- from py_builder_signing_sdk.sdk_types import BuilderApiKeyCreds
13
-
14
- from py_clob_client.client import ClobClient
15
-
16
- from poly_web3 import RELAYER_URL, PolyWeb3Service
17
-
18
- dotenv.load_dotenv()
19
-
20
- if __name__ == "__main__":
21
- host: str = "https://clob.polymarket.com"
22
- chain_id: int = 137 # No need to adjust this
23
- client = ClobClient(
24
- host,
25
- key=os.getenv("POLY_API_KEY"),
26
- chain_id=chain_id,
27
- signature_type=1,
28
- funder=os.getenv("POLYMARKET_PROXY_ADDRESS"),
29
- )
30
- creds = client.create_or_derive_api_creds()
31
- client.set_api_creds(creds)
32
- relayer_client = RelayClient(
33
- RELAYER_URL,
34
- chain_id,
35
- os.getenv("POLY_API_KEY"),
36
- BuilderConfig(
37
- local_builder_creds=BuilderApiKeyCreds(
38
- key=os.getenv("BUILDER_KEY"),
39
- secret=os.getenv("BUILDER_SECRET"),
40
- passphrase=os.getenv("BUILDER_PASSPHRASE"),
41
- )
42
- ),
43
- )
44
- condition_id = "0x38124532c68bf16aa5800433118463acdbf09152237b45bb9e11bd4b73e0d1c4"
45
- service = PolyWeb3Service(
46
- clob_client=client,
47
- relayer_client=relayer_client,
48
- rpc_url="https://polygon-bor.publicnode.com",
49
- )
50
- # Redeem by condition_id
51
- redeem = service.redeem(condition_id=condition_id)
52
- print(redeem)
53
-
54
- # Redeem all positions that are currently redeemable (returns list or None)
55
- redeem_all = service.redeem_all()
56
- print(redeem_all)
57
-
58
- # Optional - Query operations (可选操作,用于查询)
59
- # can_redeem = service.is_condition_resolved(condition_id)
60
- # redeem_balance = service.get_redeemable_index_and_balance(
61
- # condition_id, owner=client.builder.funder
62
- # )
63
- # print(can_redeem, redeem_balance)
1
+ # -*- coding = utf-8 -*-
2
+ # @Time: 2025-12-27 17:01:20
3
+ # @Author: PinBar
4
+ # @Site:
5
+ # @File: example_redeem.py
6
+ # @Software: PyCharm
7
+ import os
8
+
9
+ import dotenv
10
+ from py_builder_relayer_client.client import RelayClient
11
+ from py_builder_signing_sdk.config import BuilderConfig
12
+ from py_builder_signing_sdk.sdk_types import BuilderApiKeyCreds
13
+
14
+ from py_clob_client.client import ClobClient
15
+
16
+ from poly_web3 import RELAYER_URL, PolyWeb3Service
17
+
18
+ dotenv.load_dotenv()
19
+
20
+ if __name__ == "__main__":
21
+ host: str = "https://clob.polymarket.com"
22
+ chain_id: int = 137 # No need to adjust this
23
+ client = ClobClient(
24
+ host,
25
+ key=os.getenv("POLY_API_KEY"),
26
+ chain_id=chain_id,
27
+ signature_type=1,
28
+ funder=os.getenv("POLYMARKET_PROXY_ADDRESS"),
29
+ )
30
+ creds = client.create_or_derive_api_creds()
31
+ client.set_api_creds(creds)
32
+ relayer_client = RelayClient(
33
+ RELAYER_URL,
34
+ chain_id,
35
+ os.getenv("POLY_API_KEY"),
36
+ BuilderConfig(
37
+ local_builder_creds=BuilderApiKeyCreds(
38
+ key=os.getenv("BUILDER_KEY"),
39
+ secret=os.getenv("BUILDER_SECRET"),
40
+ passphrase=os.getenv("BUILDER_PASSPHRASE"),
41
+ )
42
+ ),
43
+ )
44
+ condition_id = "0x31fb435a9506d14f00b9de5e5e4491cf2223b6d40a2525d9afa8b620b61b50e2"
45
+ service = PolyWeb3Service(
46
+ clob_client=client,
47
+ relayer_client=relayer_client,
48
+ rpc_url="https://polygon-bor.publicnode.com",
49
+ )
50
+ # Redeem in batch
51
+ condition_ids = [
52
+ condition_id,
53
+ "0x31fb435a9506d14f00b9de5e5e4491cf2223b6d40a2525d9afa8b620b61b50e2",
54
+ ]
55
+ redeem_batch = service.redeem(condition_ids, batch_size=10)
56
+ print(redeem_batch)
57
+
58
+ # Redeem all positions that are currently redeemable (returns list or None)
59
+ redeem_all = service.redeem_all(batch_size=10)
60
+ print(redeem_all)
61
+
62
+ # Optional - Query operations (可选操作,用于查询)
63
+ # can_redeem = service.is_condition_resolved(condition_id)
64
+ # redeem_balance = service.get_redeemable_index_and_balance(
65
+ # condition_id, owner=client.builder.funder
66
+ # )
67
+ # print(can_redeem, redeem_balance)
poly_web3/__init__.py CHANGED
@@ -1,33 +1,33 @@
1
- # -*- coding = utf-8 -*-
2
- # @Time: 2025/12/19 15:24
3
- # @Author: PinBar
4
- # @Site:
5
- # @File: __init__.py.py
6
- # @Software: PyCharm
7
- from typing import Union
8
-
9
- from py_clob_client.client import ClobClient
10
- from py_builder_relayer_client.client import RelayClient
11
-
12
- from poly_web3.const import RELAYER_URL
13
- from poly_web3.web3_service.base import BaseWeb3Service
14
- from poly_web3.schema import WalletType
15
- from poly_web3.web3_service import SafeWeb3Service, EOAWeb3Service, ProxyWeb3Service
16
-
17
-
18
- def PolyWeb3Service(
19
- clob_client: ClobClient,
20
- relayer_client: RelayClient = None,
21
- rpc_url: str | None = None,
22
- ) -> Union[SafeWeb3Service, EOAWeb3Service, ProxyWeb3Service]: # noqa
23
- services = {
24
- WalletType.EOA: EOAWeb3Service,
25
- WalletType.PROXY: ProxyWeb3Service,
26
- WalletType.SAFE: SafeWeb3Service,
27
- }
28
-
29
- wallet_type = WalletType.get_with_code(clob_client.builder.sig_type)
30
- if service := services.get(wallet_type):
31
- return service(clob_client, relayer_client, rpc_url=rpc_url)
32
- else:
33
- raise Exception(f"Unknown wallet type: {wallet_type}")
1
+ # -*- coding = utf-8 -*-
2
+ # @Time: 2025/12/19 15:24
3
+ # @Author: PinBar
4
+ # @Site:
5
+ # @File: __init__.py.py
6
+ # @Software: PyCharm
7
+ from typing import Union
8
+
9
+ from py_clob_client.client import ClobClient
10
+ from py_builder_relayer_client.client import RelayClient
11
+
12
+ from poly_web3.const import RELAYER_URL
13
+ from poly_web3.web3_service.base import BaseWeb3Service
14
+ from poly_web3.schema import WalletType
15
+ from poly_web3.web3_service import SafeWeb3Service, EOAWeb3Service, ProxyWeb3Service
16
+
17
+
18
+ def PolyWeb3Service(
19
+ clob_client: ClobClient,
20
+ relayer_client: RelayClient = None,
21
+ rpc_url: str | None = None,
22
+ ) -> Union[SafeWeb3Service, EOAWeb3Service, ProxyWeb3Service]: # noqa
23
+ services = {
24
+ WalletType.EOA: EOAWeb3Service,
25
+ WalletType.PROXY: ProxyWeb3Service,
26
+ WalletType.SAFE: SafeWeb3Service,
27
+ }
28
+
29
+ wallet_type = WalletType.get_with_code(clob_client.builder.sig_type)
30
+ if service := services.get(wallet_type):
31
+ return service(clob_client, relayer_client, rpc_url=rpc_url)
32
+ else:
33
+ raise Exception(f"Unknown wallet type: {wallet_type}")
poly_web3/const.py CHANGED
@@ -1,171 +1,171 @@
1
- # -*- coding = utf-8 -*-
2
- # @Time: 2025/12/19 15:29
3
- # @Author: PinBar
4
- # @Site:
5
- # @File: const.py
6
- # @Software: PyCharm
7
- from web3 import Web3
8
-
9
- GET_NONCE = "/nonce"
10
- GET_RELAY_PAYLOAD = "/relay-payload"
11
- GET_TRANSACTION = "/transaction"
12
- GET_TRANSACTIONS = "/transactions"
13
- SUBMIT_TRANSACTION = "/submit"
14
- GET_DEPLOYED = "/deployed"
15
- RPC_URL = "https://polygon-bor.publicnode.com" # "https://polygon-rpc.com"
16
- RELAYER_URL = "https://relayer-v2.polymarket.com"
17
-
18
- STATE_NEW = ("STATE_NEW",)
19
- STATE_EXECUTED = "STATE_EXECUTED"
20
- STATE_MINED = "STATE_MINED"
21
- STATE_INVALID = "STATE_INVALID"
22
- STATE_CONFIRMED = "STATE_CONFIRMED"
23
- STATE_FAILED = "STATE_FAILED"
24
-
25
- # address
26
- CTF_ADDRESS = Web3.to_checksum_address("0x4d97dcd97ec945f40cf65f87097ace5ea0476045")
27
- USDC_POLYGON = Web3.to_checksum_address("0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174")
28
- NEG_RISK_ADAPTER_ADDRESS = Web3.to_checksum_address(
29
- "0xd91E80cF2E7be2e162c6513ceD06f1dD0dA35296"
30
- )
31
- ZERO_BYTES32 = "0x" + "00" * 32
32
- proxy_factory_address = Web3.to_checksum_address(
33
- "0xaB45c5A4B0c941a2F231C04C3f49182e1A254052"
34
- )
35
- SAFE_INIT_CODE_HASH = (
36
- "0x2bce2127ff07fb632d16c8347c4ebf501f4841168bed00d9e6ef715ddb6fcecf"
37
- )
38
- PROXY_INIT_CODE_HASH = (
39
- "0xd21df8dc65880a8606f09fe0ce3df9b8869287ab0b058be05aa9e8af6330a00b"
40
- )
41
-
42
- AMOY = {
43
- "ProxyContracts": {
44
- # Proxy factory unsupported on Amoy testnet
45
- "RelayHub": "",
46
- "ProxyFactory": "",
47
- },
48
- "SafeContracts": {
49
- "SafeFactory": "0xaacFeEa03eb1561C4e67d661e40682Bd20E3541b",
50
- "SafeMultisend": "0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761",
51
- },
52
- }
53
-
54
- POL = {
55
- "ProxyContracts": {
56
- "ProxyFactory": "0xaB45c5A4B0c941a2F231C04C3f49182e1A254052",
57
- "RelayHub": "0xD216153c06E857cD7f72665E0aF1d7D82172F494",
58
- },
59
- "SafeContracts": {
60
- "SafeFactory": "0xaacFeEa03eb1561C4e67d661e40682Bd20E3541b",
61
- "SafeMultisend": "0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761",
62
- },
63
- }
64
-
65
- # abi
66
- CTF_ABI_REDEEM = [
67
- {
68
- "name": "redeemPositions",
69
- "type": "function",
70
- "stateMutability": "nonpayable",
71
- "inputs": [
72
- {"name": "collateralToken", "type": "address"},
73
- {"name": "parentCollectionId", "type": "bytes32"},
74
- {"name": "conditionId", "type": "bytes32"},
75
- {"name": "indexSets", "type": "uint256[]"},
76
- ],
77
- "outputs": [],
78
- }
79
- ]
80
-
81
- NEG_RISK_ADAPTER_ABI_REDEEM = [
82
- {
83
- "name": "redeemPositions",
84
- "type": "function",
85
- "stateMutability": "nonpayable",
86
- "inputs": [
87
- {"name": "_conditionId", "type": "bytes32"},
88
- {"name": "_amounts", "type": "uint256[]"},
89
- ],
90
- "outputs": [],
91
- }
92
- ]
93
-
94
- proxy_wallet_factory_abi = [
95
- {
96
- "inputs": [
97
- {
98
- "components": [
99
- {"name": "typeCode", "type": "uint8"},
100
- {"name": "to", "type": "address"},
101
- {"name": "value", "type": "uint256"},
102
- {"name": "data", "type": "bytes"},
103
- ],
104
- "name": "calls",
105
- "type": "tuple[]",
106
- }
107
- ],
108
- "name": "proxy",
109
- "outputs": [{"name": "returnValues", "type": "bytes[]"}],
110
- "stateMutability": "payable",
111
- "type": "function",
112
- }
113
- ]
114
-
115
- CTF_ABI_PAYOUT = [
116
- {
117
- "name": "payoutDenominator",
118
- "type": "function",
119
- "stateMutability": "view",
120
- "inputs": [{"name": "conditionId", "type": "bytes32"}],
121
- "outputs": [{"type": "uint256"}],
122
- },
123
- {
124
- "name": "payoutNumerators",
125
- "type": "function",
126
- "stateMutability": "view",
127
- "inputs": [
128
- {"name": "conditionId", "type": "bytes32"},
129
- {"name": "index", "type": "uint256"},
130
- ],
131
- "outputs": [{"type": "uint256"}],
132
- },
133
- {
134
- "name": "getOutcomeSlotCount",
135
- "type": "function",
136
- "stateMutability": "view",
137
- "inputs": [{"name": "conditionId", "type": "bytes32"}],
138
- "outputs": [{"type": "uint256"}],
139
- },
140
- {
141
- "name": "getCollectionId",
142
- "type": "function",
143
- "stateMutability": "view",
144
- "inputs": [
145
- {"name": "parentCollectionId", "type": "bytes32"},
146
- {"name": "conditionId", "type": "bytes32"},
147
- {"name": "indexSet", "type": "uint256"},
148
- ],
149
- "outputs": [{"type": "bytes32"}],
150
- },
151
- {
152
- "name": "getPositionId",
153
- "type": "function",
154
- "stateMutability": "view",
155
- "inputs": [
156
- {"name": "collateralToken", "type": "address"},
157
- {"name": "collectionId", "type": "bytes32"},
158
- ],
159
- "outputs": [{"type": "uint256"}],
160
- },
161
- {
162
- "name": "balanceOf",
163
- "type": "function",
164
- "stateMutability": "view",
165
- "inputs": [
166
- {"name": "owner", "type": "address"},
167
- {"name": "id", "type": "uint256"},
168
- ],
169
- "outputs": [{"type": "uint256"}],
170
- },
171
- ]
1
+ # -*- coding = utf-8 -*-
2
+ # @Time: 2025/12/19 15:29
3
+ # @Author: PinBar
4
+ # @Site:
5
+ # @File: const.py
6
+ # @Software: PyCharm
7
+ from web3 import Web3
8
+
9
+ GET_NONCE = "/nonce"
10
+ GET_RELAY_PAYLOAD = "/relay-payload"
11
+ GET_TRANSACTION = "/transaction"
12
+ GET_TRANSACTIONS = "/transactions"
13
+ SUBMIT_TRANSACTION = "/submit"
14
+ GET_DEPLOYED = "/deployed"
15
+ RPC_URL = "https://polygon-bor.publicnode.com" # "https://polygon-rpc.com"
16
+ RELAYER_URL = "https://relayer-v2.polymarket.com"
17
+
18
+ STATE_NEW = ("STATE_NEW",)
19
+ STATE_EXECUTED = "STATE_EXECUTED"
20
+ STATE_MINED = "STATE_MINED"
21
+ STATE_INVALID = "STATE_INVALID"
22
+ STATE_CONFIRMED = "STATE_CONFIRMED"
23
+ STATE_FAILED = "STATE_FAILED"
24
+
25
+ # address
26
+ CTF_ADDRESS = Web3.to_checksum_address("0x4d97dcd97ec945f40cf65f87097ace5ea0476045")
27
+ USDC_POLYGON = Web3.to_checksum_address("0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174")
28
+ NEG_RISK_ADAPTER_ADDRESS = Web3.to_checksum_address(
29
+ "0xd91E80cF2E7be2e162c6513ceD06f1dD0dA35296"
30
+ )
31
+ ZERO_BYTES32 = "0x" + "00" * 32
32
+ proxy_factory_address = Web3.to_checksum_address(
33
+ "0xaB45c5A4B0c941a2F231C04C3f49182e1A254052"
34
+ )
35
+ SAFE_INIT_CODE_HASH = (
36
+ "0x2bce2127ff07fb632d16c8347c4ebf501f4841168bed00d9e6ef715ddb6fcecf"
37
+ )
38
+ PROXY_INIT_CODE_HASH = (
39
+ "0xd21df8dc65880a8606f09fe0ce3df9b8869287ab0b058be05aa9e8af6330a00b"
40
+ )
41
+
42
+ AMOY = {
43
+ "ProxyContracts": {
44
+ # Proxy factory unsupported on Amoy testnet
45
+ "RelayHub": "",
46
+ "ProxyFactory": "",
47
+ },
48
+ "SafeContracts": {
49
+ "SafeFactory": "0xaacFeEa03eb1561C4e67d661e40682Bd20E3541b",
50
+ "SafeMultisend": "0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761",
51
+ },
52
+ }
53
+
54
+ POL = {
55
+ "ProxyContracts": {
56
+ "ProxyFactory": "0xaB45c5A4B0c941a2F231C04C3f49182e1A254052",
57
+ "RelayHub": "0xD216153c06E857cD7f72665E0aF1d7D82172F494",
58
+ },
59
+ "SafeContracts": {
60
+ "SafeFactory": "0xaacFeEa03eb1561C4e67d661e40682Bd20E3541b",
61
+ "SafeMultisend": "0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761",
62
+ },
63
+ }
64
+
65
+ # abi
66
+ CTF_ABI_REDEEM = [
67
+ {
68
+ "name": "redeemPositions",
69
+ "type": "function",
70
+ "stateMutability": "nonpayable",
71
+ "inputs": [
72
+ {"name": "collateralToken", "type": "address"},
73
+ {"name": "parentCollectionId", "type": "bytes32"},
74
+ {"name": "conditionId", "type": "bytes32"},
75
+ {"name": "indexSets", "type": "uint256[]"},
76
+ ],
77
+ "outputs": [],
78
+ }
79
+ ]
80
+
81
+ NEG_RISK_ADAPTER_ABI_REDEEM = [
82
+ {
83
+ "name": "redeemPositions",
84
+ "type": "function",
85
+ "stateMutability": "nonpayable",
86
+ "inputs": [
87
+ {"name": "_conditionId", "type": "bytes32"},
88
+ {"name": "_amounts", "type": "uint256[]"},
89
+ ],
90
+ "outputs": [],
91
+ }
92
+ ]
93
+
94
+ proxy_wallet_factory_abi = [
95
+ {
96
+ "inputs": [
97
+ {
98
+ "components": [
99
+ {"name": "typeCode", "type": "uint8"},
100
+ {"name": "to", "type": "address"},
101
+ {"name": "value", "type": "uint256"},
102
+ {"name": "data", "type": "bytes"},
103
+ ],
104
+ "name": "calls",
105
+ "type": "tuple[]",
106
+ }
107
+ ],
108
+ "name": "proxy",
109
+ "outputs": [{"name": "returnValues", "type": "bytes[]"}],
110
+ "stateMutability": "payable",
111
+ "type": "function",
112
+ }
113
+ ]
114
+
115
+ CTF_ABI_PAYOUT = [
116
+ {
117
+ "name": "payoutDenominator",
118
+ "type": "function",
119
+ "stateMutability": "view",
120
+ "inputs": [{"name": "conditionId", "type": "bytes32"}],
121
+ "outputs": [{"type": "uint256"}],
122
+ },
123
+ {
124
+ "name": "payoutNumerators",
125
+ "type": "function",
126
+ "stateMutability": "view",
127
+ "inputs": [
128
+ {"name": "conditionId", "type": "bytes32"},
129
+ {"name": "index", "type": "uint256"},
130
+ ],
131
+ "outputs": [{"type": "uint256"}],
132
+ },
133
+ {
134
+ "name": "getOutcomeSlotCount",
135
+ "type": "function",
136
+ "stateMutability": "view",
137
+ "inputs": [{"name": "conditionId", "type": "bytes32"}],
138
+ "outputs": [{"type": "uint256"}],
139
+ },
140
+ {
141
+ "name": "getCollectionId",
142
+ "type": "function",
143
+ "stateMutability": "view",
144
+ "inputs": [
145
+ {"name": "parentCollectionId", "type": "bytes32"},
146
+ {"name": "conditionId", "type": "bytes32"},
147
+ {"name": "indexSet", "type": "uint256"},
148
+ ],
149
+ "outputs": [{"type": "bytes32"}],
150
+ },
151
+ {
152
+ "name": "getPositionId",
153
+ "type": "function",
154
+ "stateMutability": "view",
155
+ "inputs": [
156
+ {"name": "collateralToken", "type": "address"},
157
+ {"name": "collectionId", "type": "bytes32"},
158
+ ],
159
+ "outputs": [{"type": "uint256"}],
160
+ },
161
+ {
162
+ "name": "balanceOf",
163
+ "type": "function",
164
+ "stateMutability": "view",
165
+ "inputs": [
166
+ {"name": "owner", "type": "address"},
167
+ {"name": "id", "type": "uint256"},
168
+ ],
169
+ "outputs": [{"type": "uint256"}],
170
+ },
171
+ ]
poly_web3/log.py CHANGED
@@ -1,18 +1,48 @@
1
- # -*- coding = utf-8 -*-
2
- # @Time: 2026-01-13 14:40:20
3
- # @Author: PinBar
4
- # @Site:
5
- # @File: log.py
6
- # @Software: PyCharm
7
- import sys
8
- import logging
9
-
10
- logger = logging.getLogger("poly_web3")
11
- handler = logging.StreamHandler(sys.stdout)
12
- formatter = logging.Formatter(
13
- '%(asctime)s | %(levelname)s | %(name)s | %(filename)s:%(lineno)d %(message)s',
14
- datefmt='%Y-%m-%d %H:%M:%S'
15
- )
16
- handler.setFormatter(formatter)
17
- logger.addHandler(handler)
18
- logger.setLevel(logging.INFO)
1
+ # -*- coding = utf-8 -*-
2
+ # @Time: 2026-01-13 14:40:20
3
+ # @Author: PinBar
4
+ # @Site:
5
+ # @File: log.py
6
+ # @Software: PyCharm
7
+ import logging
8
+ import sys
9
+
10
+ LOGGER_NAME = "poly_web3"
11
+
12
+ logger = logging.getLogger(LOGGER_NAME)
13
+ logger.addHandler(logging.NullHandler())
14
+
15
+
16
+ def configure_logging(
17
+ level: int = logging.INFO,
18
+ stream=sys.stdout,
19
+ formatter: logging.Formatter | None = None,
20
+ ):
21
+ if formatter is None:
22
+ formatter = logging.Formatter(
23
+ "%(asctime)s | %(levelname)s | %(name)s | %(filename)s:%(lineno)d %(message)s",
24
+ datefmt="%Y-%m-%d %H:%M:%S",
25
+ )
26
+ handler = logging.StreamHandler(stream)
27
+ handler.setFormatter(formatter)
28
+ target = logging.getLogger(LOGGER_NAME)
29
+ for existing in list(target.handlers):
30
+ if isinstance(existing, logging.StreamHandler):
31
+ target.removeHandler(existing)
32
+ target.addHandler(handler)
33
+ target.setLevel(level)
34
+ return target
35
+
36
+
37
+ def _ensure_default_logging():
38
+ target = logging.getLogger(LOGGER_NAME)
39
+ if target.handlers and not all(
40
+ isinstance(h, logging.NullHandler) for h in target.handlers
41
+ ):
42
+ return
43
+ if logging.getLogger().handlers:
44
+ return
45
+ configure_logging()
46
+
47
+
48
+ _ensure_default_logging()
poly_web3/schema.py CHANGED
@@ -1,22 +1,22 @@
1
- # -*- coding = utf-8 -*-
2
- # @Time: 2025/12/19 15:31
3
- # @Author: PinBar
4
- # @Site:
5
- # @File: model.py
6
- # @Software: PyCharm
7
- from enum import Enum
8
-
9
-
10
- class WalletType(str, Enum):
11
- EOA = "EOA"
12
- SAFE = "SAFE"
13
- PROXY = "PROXY"
14
-
15
- @classmethod
16
- def get_with_code(cls, code: int):
17
- if code == 0:
18
- return cls.EOA
19
- elif code == 1:
20
- return cls.PROXY
21
- elif code == 2:
22
- return cls.SAFE
1
+ # -*- coding = utf-8 -*-
2
+ # @Time: 2025/12/19 15:31
3
+ # @Author: PinBar
4
+ # @Site:
5
+ # @File: model.py
6
+ # @Software: PyCharm
7
+ from enum import Enum
8
+
9
+
10
+ class WalletType(str, Enum):
11
+ EOA = "EOA"
12
+ SAFE = "SAFE"
13
+ PROXY = "PROXY"
14
+
15
+ @classmethod
16
+ def get_with_code(cls, code: int):
17
+ if code == 0:
18
+ return cls.EOA
19
+ elif code == 1:
20
+ return cls.PROXY
21
+ elif code == 2:
22
+ return cls.SAFE
@@ -1,6 +1,6 @@
1
- # -*- coding = utf-8 -*-
2
- # @Time: 2025/12/21 19:42
3
- # @Author: PinBar
4
- # @Site:
5
- # @File: __init__.py.py
6
- # @Software: PyCharm
1
+ # -*- coding = utf-8 -*-
2
+ # @Time: 2025/12/21 19:42
3
+ # @Author: PinBar
4
+ # @Site:
5
+ # @File: __init__.py.py
6
+ # @Software: PyCharm