polyplace-client 0.1.0__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.
@@ -0,0 +1,49 @@
1
+ """polyplace-client: Python SDK and CLI for interacting with Polyplace."""
2
+
3
+ from polyplace_client.client import (
4
+ Balances,
5
+ CellState,
6
+ FaucetInfo,
7
+ GridParams,
8
+ PolyplaceClient,
9
+ connect,
10
+ make_faucet_contract,
11
+ make_grid_contract,
12
+ make_token_contract,
13
+ )
14
+ from polyplace_client.contracts import (
15
+ INITIAL_SUPPLY,
16
+ PLACE_FAUCET_ABI,
17
+ PLACE_FAUCET_BYTECODE,
18
+ PLACE_GRID_ABI,
19
+ PLACE_GRID_BYTECODE,
20
+ PLACE_TOKEN_ABI,
21
+ PLACE_TOKEN_BYTECODE,
22
+ )
23
+ from polyplace_client.errors import PolyplaceError
24
+ from polyplace_client.networks import Network, load_network
25
+
26
+ __version__ = "0.1.0"
27
+
28
+ __all__ = [
29
+ "__version__",
30
+ "INITIAL_SUPPLY",
31
+ "PLACE_TOKEN_ABI",
32
+ "PLACE_FAUCET_ABI",
33
+ "PLACE_GRID_ABI",
34
+ "PLACE_TOKEN_BYTECODE",
35
+ "PLACE_FAUCET_BYTECODE",
36
+ "PLACE_GRID_BYTECODE",
37
+ "Balances",
38
+ "CellState",
39
+ "FaucetInfo",
40
+ "GridParams",
41
+ "Network",
42
+ "PolyplaceClient",
43
+ "PolyplaceError",
44
+ "connect",
45
+ "load_network",
46
+ "make_token_contract",
47
+ "make_faucet_contract",
48
+ "make_grid_contract",
49
+ ]
@@ -0,0 +1,291 @@
1
+ {
2
+ "abi": [
3
+ {
4
+ "type": "constructor",
5
+ "inputs": [
6
+ {
7
+ "name": "token_",
8
+ "type": "address",
9
+ "internalType": "address"
10
+ },
11
+ {
12
+ "name": "claimAmount_",
13
+ "type": "uint256",
14
+ "internalType": "uint256"
15
+ },
16
+ {
17
+ "name": "cooldown_",
18
+ "type": "uint256",
19
+ "internalType": "uint256"
20
+ },
21
+ {
22
+ "name": "owner_",
23
+ "type": "address",
24
+ "internalType": "address"
25
+ }
26
+ ],
27
+ "stateMutability": "nonpayable"
28
+ },
29
+ {
30
+ "type": "function",
31
+ "name": "TOKEN",
32
+ "inputs": [],
33
+ "outputs": [
34
+ {
35
+ "name": "",
36
+ "type": "address",
37
+ "internalType": "contract IERC20"
38
+ }
39
+ ],
40
+ "stateMutability": "view"
41
+ },
42
+ {
43
+ "type": "function",
44
+ "name": "claim",
45
+ "inputs": [],
46
+ "outputs": [],
47
+ "stateMutability": "nonpayable"
48
+ },
49
+ {
50
+ "type": "function",
51
+ "name": "claimAmount",
52
+ "inputs": [],
53
+ "outputs": [
54
+ {
55
+ "name": "",
56
+ "type": "uint256",
57
+ "internalType": "uint256"
58
+ }
59
+ ],
60
+ "stateMutability": "view"
61
+ },
62
+ {
63
+ "type": "function",
64
+ "name": "cooldown",
65
+ "inputs": [],
66
+ "outputs": [
67
+ {
68
+ "name": "",
69
+ "type": "uint256",
70
+ "internalType": "uint256"
71
+ }
72
+ ],
73
+ "stateMutability": "view"
74
+ },
75
+ {
76
+ "type": "function",
77
+ "name": "lastClaimed",
78
+ "inputs": [
79
+ {
80
+ "name": "",
81
+ "type": "address",
82
+ "internalType": "address"
83
+ }
84
+ ],
85
+ "outputs": [
86
+ {
87
+ "name": "",
88
+ "type": "uint256",
89
+ "internalType": "uint256"
90
+ }
91
+ ],
92
+ "stateMutability": "view"
93
+ },
94
+ {
95
+ "type": "function",
96
+ "name": "owner",
97
+ "inputs": [],
98
+ "outputs": [
99
+ {
100
+ "name": "",
101
+ "type": "address",
102
+ "internalType": "address"
103
+ }
104
+ ],
105
+ "stateMutability": "view"
106
+ },
107
+ {
108
+ "type": "function",
109
+ "name": "renounceOwnership",
110
+ "inputs": [],
111
+ "outputs": [],
112
+ "stateMutability": "nonpayable"
113
+ },
114
+ {
115
+ "type": "function",
116
+ "name": "setClaimAmount",
117
+ "inputs": [
118
+ {
119
+ "name": "newAmount",
120
+ "type": "uint256",
121
+ "internalType": "uint256"
122
+ }
123
+ ],
124
+ "outputs": [],
125
+ "stateMutability": "nonpayable"
126
+ },
127
+ {
128
+ "type": "function",
129
+ "name": "setCooldown",
130
+ "inputs": [
131
+ {
132
+ "name": "newCooldown",
133
+ "type": "uint256",
134
+ "internalType": "uint256"
135
+ }
136
+ ],
137
+ "outputs": [],
138
+ "stateMutability": "nonpayable"
139
+ },
140
+ {
141
+ "type": "function",
142
+ "name": "transferOwnership",
143
+ "inputs": [
144
+ {
145
+ "name": "newOwner",
146
+ "type": "address",
147
+ "internalType": "address"
148
+ }
149
+ ],
150
+ "outputs": [],
151
+ "stateMutability": "nonpayable"
152
+ },
153
+ {
154
+ "type": "event",
155
+ "name": "ClaimAmountUpdated",
156
+ "inputs": [
157
+ {
158
+ "name": "oldAmount",
159
+ "type": "uint256",
160
+ "indexed": false,
161
+ "internalType": "uint256"
162
+ },
163
+ {
164
+ "name": "newAmount",
165
+ "type": "uint256",
166
+ "indexed": false,
167
+ "internalType": "uint256"
168
+ }
169
+ ],
170
+ "anonymous": false
171
+ },
172
+ {
173
+ "type": "event",
174
+ "name": "Claimed",
175
+ "inputs": [
176
+ {
177
+ "name": "claimant",
178
+ "type": "address",
179
+ "indexed": true,
180
+ "internalType": "address"
181
+ },
182
+ {
183
+ "name": "amount",
184
+ "type": "uint256",
185
+ "indexed": false,
186
+ "internalType": "uint256"
187
+ }
188
+ ],
189
+ "anonymous": false
190
+ },
191
+ {
192
+ "type": "event",
193
+ "name": "CooldownUpdated",
194
+ "inputs": [
195
+ {
196
+ "name": "oldCooldown",
197
+ "type": "uint256",
198
+ "indexed": false,
199
+ "internalType": "uint256"
200
+ },
201
+ {
202
+ "name": "newCooldown",
203
+ "type": "uint256",
204
+ "indexed": false,
205
+ "internalType": "uint256"
206
+ }
207
+ ],
208
+ "anonymous": false
209
+ },
210
+ {
211
+ "type": "event",
212
+ "name": "OwnershipTransferred",
213
+ "inputs": [
214
+ {
215
+ "name": "previousOwner",
216
+ "type": "address",
217
+ "indexed": true,
218
+ "internalType": "address"
219
+ },
220
+ {
221
+ "name": "newOwner",
222
+ "type": "address",
223
+ "indexed": true,
224
+ "internalType": "address"
225
+ }
226
+ ],
227
+ "anonymous": false
228
+ },
229
+ {
230
+ "type": "error",
231
+ "name": "CooldownNotElapsed",
232
+ "inputs": [
233
+ {
234
+ "name": "availableAt",
235
+ "type": "uint256",
236
+ "internalType": "uint256"
237
+ }
238
+ ]
239
+ },
240
+ {
241
+ "type": "error",
242
+ "name": "InsufficientFaucetBalance",
243
+ "inputs": [
244
+ {
245
+ "name": "available",
246
+ "type": "uint256",
247
+ "internalType": "uint256"
248
+ },
249
+ {
250
+ "name": "required",
251
+ "type": "uint256",
252
+ "internalType": "uint256"
253
+ }
254
+ ]
255
+ },
256
+ {
257
+ "type": "error",
258
+ "name": "OwnableInvalidOwner",
259
+ "inputs": [
260
+ {
261
+ "name": "owner",
262
+ "type": "address",
263
+ "internalType": "address"
264
+ }
265
+ ]
266
+ },
267
+ {
268
+ "type": "error",
269
+ "name": "OwnableUnauthorizedAccount",
270
+ "inputs": [
271
+ {
272
+ "name": "account",
273
+ "type": "address",
274
+ "internalType": "address"
275
+ }
276
+ ]
277
+ },
278
+ {
279
+ "type": "error",
280
+ "name": "SafeERC20FailedOperation",
281
+ "inputs": [
282
+ {
283
+ "name": "token",
284
+ "type": "address",
285
+ "internalType": "address"
286
+ }
287
+ ]
288
+ }
289
+ ],
290
+ "bytecode": "0x60a060405234801561000f575f5ffd5b50604051610d9a380380610d9a8339818101604052810190610031919061024f565b805f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036100a2575f6040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161009991906102c2565b60405180910390fd5b6100b1816100fd60201b60201c565b508373ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250508260018190555081600281905550505050506102db565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6101eb826101c2565b9050919050565b6101fb816101e1565b8114610205575f5ffd5b50565b5f81519050610216816101f2565b92915050565b5f819050919050565b61022e8161021c565b8114610238575f5ffd5b50565b5f8151905061024981610225565b92915050565b5f5f5f5f60808587031215610267576102666101be565b5b5f61027487828801610208565b94505060206102858782880161023b565b93505060406102968782880161023b565b92505060606102a787828801610208565b91505092959194509250565b6102bc816101e1565b82525050565b5f6020820190506102d55f8301846102b3565b92915050565b608051610a996103015f395f81816102a1015281816103cf01526104ce0152610a995ff3fe608060405234801561000f575f5ffd5b506004361061009c575f3560e01c806382bfefc81161006457806382bfefc81461011e578063830953ab1461013c5780638da5cb5b1461015a578063b1c7ef0c14610178578063f2fde38b146101945761009c565b8063013eba92146100a05780634e71d92d146100d05780634fc3f41a146100da578063715018a6146100f6578063787a08a614610100575b5f5ffd5b6100ba60048036038101906100b59190610850565b6101b0565b6040516100c79190610893565b60405180910390f35b6100d86101c5565b005b6100f460048036038101906100ef91906108d6565b610466565b005b6100fe6104b3565b005b6101086104c6565b6040516101159190610893565b60405180910390f35b6101266104cc565b604051610133919061095c565b60405180910390f35b6101446104f0565b6040516101519190610893565b60405180910390f35b6101626104f6565b60405161016f9190610984565b60405180910390f35b610192600480360381019061018d91906108d6565b61051d565b005b6101ae60048036038101906101a99190610850565b61056a565b005b6003602052805f5260405f205f915090505481565b5f60035f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20541461029e575f60025460035f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205461025591906109ca565b90508042101561029c57806040517fe3c9f0550000000000000000000000000000000000000000000000000000000081526004016102939190610893565b60405180910390fd5b505b5f7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016102f89190610984565b602060405180830381865afa158015610313573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103379190610a11565b905060015481101561038457806001546040517fcdeba29400000000000000000000000000000000000000000000000000000000815260040161037b929190610a3c565b60405180910390fd5b4260035f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550610413336001547f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166105ee9092919063ffffffff16565b3373ffffffffffffffffffffffffffffffffffffffff167fd8138f8a3f377c5259ca548e70e4c2de94f129f5a11036a15b69513cba2b426a60015460405161045b9190610893565b60405180910390a250565b61046e610641565b7f5953b565c074c2cce1866b4e69c9efc4908556bb6fca70f735907c94d9405515600254826040516104a1929190610a3c565b60405180910390a18060028190555050565b6104bb610641565b6104c45f6106c8565b565b60025481565b7f000000000000000000000000000000000000000000000000000000000000000081565b60015481565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610525610641565b7fc22e16deec6f587d0a1aad7275c1621e6c24431fea14dd71e8f3243e9fbc5ca360015482604051610558929190610a3c565b60405180910390a18060018190555050565b610572610641565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036105e2575f6040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016105d99190610984565b60405180910390fd5b6105eb816106c8565b50565b6105fb8383836001610789565b61063c57826040517f5274afe70000000000000000000000000000000000000000000000000000000081526004016106339190610984565b60405180910390fd5b505050565b6106496107eb565b73ffffffffffffffffffffffffffffffffffffffff166106676104f6565b73ffffffffffffffffffffffffffffffffffffffff16146106c65761068a6107eb565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016106bd9190610984565b60405180910390fd5b565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f5f63a9059cbb60e01b9050604051815f525f1960601c86166004528460245260205f60445f5f8b5af1925060015f511483166107dd5783831516156107d1573d5f823e3d81fd5b5f873b113d1516831692505b806040525050949350505050565b5f33905090565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61081f826107f6565b9050919050565b61082f81610815565b8114610839575f5ffd5b50565b5f8135905061084a81610826565b92915050565b5f60208284031215610865576108646107f2565b5b5f6108728482850161083c565b91505092915050565b5f819050919050565b61088d8161087b565b82525050565b5f6020820190506108a65f830184610884565b92915050565b6108b58161087b565b81146108bf575f5ffd5b50565b5f813590506108d0816108ac565b92915050565b5f602082840312156108eb576108ea6107f2565b5b5f6108f8848285016108c2565b91505092915050565b5f819050919050565b5f61092461091f61091a846107f6565b610901565b6107f6565b9050919050565b5f6109358261090a565b9050919050565b5f6109468261092b565b9050919050565b6109568161093c565b82525050565b5f60208201905061096f5f83018461094d565b92915050565b61097e81610815565b82525050565b5f6020820190506109975f830184610975565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6109d48261087b565b91506109df8361087b565b92508282019050808211156109f7576109f661099d565b5b92915050565b5f81519050610a0b816108ac565b92915050565b5f60208284031215610a2657610a256107f2565b5b5f610a33848285016109fd565b91505092915050565b5f604082019050610a4f5f830185610884565b610a5c6020830184610884565b939250505056fea26469706673582212200c049104ec959db8e0d9805d63a8cb3baf2dd0336a7d1c9277c0ed4edf59614764736f6c63430008210033"
291
+ }