dkg 0.1.0b1__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.
Files changed (62) hide show
  1. dkg/__init__.py +3 -0
  2. dkg/asset.py +781 -0
  3. dkg/constants.py +39 -0
  4. dkg/data/interfaces/Assertion.json +131 -0
  5. dkg/data/interfaces/AssertionStorage.json +229 -0
  6. dkg/data/interfaces/CommitManagerV1.json +534 -0
  7. dkg/data/interfaces/CommitManagerV1U1.json +720 -0
  8. dkg/data/interfaces/ContentAsset.json +671 -0
  9. dkg/data/interfaces/ContentAssetStorage.json +706 -0
  10. dkg/data/interfaces/HashingProxy.json +227 -0
  11. dkg/data/interfaces/Hub.json +356 -0
  12. dkg/data/interfaces/Identity.json +193 -0
  13. dkg/data/interfaces/IdentityStorage.json +342 -0
  14. dkg/data/interfaces/ParametersStorage.json +468 -0
  15. dkg/data/interfaces/Profile.json +292 -0
  16. dkg/data/interfaces/ProfileStorage.json +596 -0
  17. dkg/data/interfaces/ProofManagerV1.json +525 -0
  18. dkg/data/interfaces/ProofManagerV1U1.json +546 -0
  19. dkg/data/interfaces/ScoringProxy.json +242 -0
  20. dkg/data/interfaces/ServiceAgreementStorageProxy.json +1299 -0
  21. dkg/data/interfaces/ServiceAgreementStorageV1.json +901 -0
  22. dkg/data/interfaces/ServiceAgreementStorageV1U1.json +1097 -0
  23. dkg/data/interfaces/ServiceAgreementV1.json +741 -0
  24. dkg/data/interfaces/ShardingTable.json +268 -0
  25. dkg/data/interfaces/ShardingTableStorage.json +317 -0
  26. dkg/data/interfaces/Staking.json +456 -0
  27. dkg/data/interfaces/StakingStorage.json +407 -0
  28. dkg/data/interfaces/Token.json +544 -0
  29. dkg/data/interfaces/UnfinalizedStateStorage.json +171 -0
  30. dkg/data/interfaces/WhitelistStorage.json +124 -0
  31. dkg/dataclasses.py +45 -0
  32. dkg/exceptions.py +161 -0
  33. dkg/graph.py +63 -0
  34. dkg/main.py +74 -0
  35. dkg/manager.py +64 -0
  36. dkg/method.py +131 -0
  37. dkg/module.py +63 -0
  38. dkg/node.py +54 -0
  39. dkg/providers/__init__.py +2 -0
  40. dkg/providers/blockchain.py +181 -0
  41. dkg/providers/node_http.py +62 -0
  42. dkg/types/__init__.py +8 -0
  43. dkg/types/blockchain.py +58 -0
  44. dkg/types/dkg_node.py +20 -0
  45. dkg/types/encoding.py +22 -0
  46. dkg/types/evm.py +25 -0
  47. dkg/types/generics.py +21 -0
  48. dkg/types/network.py +20 -0
  49. dkg/types/rdf.py +21 -0
  50. dkg/utils/__init__.py +0 -0
  51. dkg/utils/blockchain_request.py +159 -0
  52. dkg/utils/decorators.py +46 -0
  53. dkg/utils/merkle.py +173 -0
  54. dkg/utils/metadata.py +50 -0
  55. dkg/utils/node_request.py +197 -0
  56. dkg/utils/rdf.py +51 -0
  57. dkg/utils/string_transformations.py +22 -0
  58. dkg/utils/ual.py +41 -0
  59. dkg-0.1.0b1.dist-info/LICENSE +202 -0
  60. dkg-0.1.0b1.dist-info/METADATA +453 -0
  61. dkg-0.1.0b1.dist-info/RECORD +62 -0
  62. dkg-0.1.0b1.dist-info/WHEEL +4 -0
dkg/constants.py ADDED
@@ -0,0 +1,39 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one
2
+ # or more contributor license agreements. See the NOTICE file
3
+ # distributed with this work for additional information
4
+ # regarding copyright ownership. The ASF licenses this file
5
+ # to you under the Apache License, Version 2.0 (the
6
+ # "License"); you may not use this file except in compliance
7
+ # with the License. You may obtain a copy of the License at
8
+
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ PRIVATE_ASSERTION_PREDICATE = (
19
+ "https://ontology.origintrail.io/dkg/1.0#privateAssertionID"
20
+ )
21
+
22
+ BLOCKCHAINS = {
23
+ 2043: {
24
+ "name": "otp",
25
+ "hubAddress": "0x5fA7916c48Fe6D5F1738d12Ad234b78c90B4cAdA"
26
+ },
27
+ 2160: {
28
+ "name": "otp",
29
+ "hubAddress": "0x833048F6e6BEa78E0AAdedeCd2Dc2231dda443FB"
30
+ },
31
+ 20430: {
32
+ "name": "otp",
33
+ "hubAddress": "0xBbfF7Ea6b2Addc1f38A0798329e12C08f03750A6"
34
+ },
35
+ 31337: {
36
+ "name": "hardhat",
37
+ "hubAddress": "0x5FbDB2315678afecb367f032d93F642f64180aa3"
38
+ },
39
+ }
@@ -0,0 +1,131 @@
1
+ [
2
+ {
3
+ "inputs": [
4
+ {
5
+ "internalType": "address",
6
+ "name": "hubAddress",
7
+ "type": "address"
8
+ }
9
+ ],
10
+ "stateMutability": "nonpayable",
11
+ "type": "constructor"
12
+ },
13
+ {
14
+ "anonymous": false,
15
+ "inputs": [
16
+ {
17
+ "indexed": true,
18
+ "internalType": "bytes32",
19
+ "name": "assertionId",
20
+ "type": "bytes32"
21
+ },
22
+ {
23
+ "indexed": false,
24
+ "internalType": "uint128",
25
+ "name": "size",
26
+ "type": "uint128"
27
+ },
28
+ {
29
+ "indexed": false,
30
+ "internalType": "uint32",
31
+ "name": "triplesNumber",
32
+ "type": "uint32"
33
+ },
34
+ {
35
+ "indexed": false,
36
+ "internalType": "uint96",
37
+ "name": "chunksNumber",
38
+ "type": "uint96"
39
+ }
40
+ ],
41
+ "name": "AssertionCreated",
42
+ "type": "event"
43
+ },
44
+ {
45
+ "inputs": [],
46
+ "name": "assertionStorage",
47
+ "outputs": [
48
+ {
49
+ "internalType": "contract AssertionStorage",
50
+ "name": "",
51
+ "type": "address"
52
+ }
53
+ ],
54
+ "stateMutability": "view",
55
+ "type": "function"
56
+ },
57
+ {
58
+ "inputs": [
59
+ {
60
+ "internalType": "bytes32",
61
+ "name": "assertionId",
62
+ "type": "bytes32"
63
+ },
64
+ {
65
+ "internalType": "uint128",
66
+ "name": "size",
67
+ "type": "uint128"
68
+ },
69
+ {
70
+ "internalType": "uint32",
71
+ "name": "triplesNumber",
72
+ "type": "uint32"
73
+ },
74
+ {
75
+ "internalType": "uint96",
76
+ "name": "chunksNumber",
77
+ "type": "uint96"
78
+ }
79
+ ],
80
+ "name": "createAssertion",
81
+ "outputs": [],
82
+ "stateMutability": "nonpayable",
83
+ "type": "function"
84
+ },
85
+ {
86
+ "inputs": [],
87
+ "name": "hub",
88
+ "outputs": [
89
+ {
90
+ "internalType": "contract Hub",
91
+ "name": "",
92
+ "type": "address"
93
+ }
94
+ ],
95
+ "stateMutability": "view",
96
+ "type": "function"
97
+ },
98
+ {
99
+ "inputs": [],
100
+ "name": "initialize",
101
+ "outputs": [],
102
+ "stateMutability": "nonpayable",
103
+ "type": "function"
104
+ },
105
+ {
106
+ "inputs": [],
107
+ "name": "name",
108
+ "outputs": [
109
+ {
110
+ "internalType": "string",
111
+ "name": "",
112
+ "type": "string"
113
+ }
114
+ ],
115
+ "stateMutability": "pure",
116
+ "type": "function"
117
+ },
118
+ {
119
+ "inputs": [],
120
+ "name": "version",
121
+ "outputs": [
122
+ {
123
+ "internalType": "string",
124
+ "name": "",
125
+ "type": "string"
126
+ }
127
+ ],
128
+ "stateMutability": "pure",
129
+ "type": "function"
130
+ }
131
+ ]
@@ -0,0 +1,229 @@
1
+ [
2
+ {
3
+ "inputs": [
4
+ {
5
+ "internalType": "address",
6
+ "name": "hubAddress",
7
+ "type": "address"
8
+ }
9
+ ],
10
+ "stateMutability": "nonpayable",
11
+ "type": "constructor"
12
+ },
13
+ {
14
+ "inputs": [
15
+ {
16
+ "internalType": "bytes32",
17
+ "name": "assertionId",
18
+ "type": "bytes32"
19
+ }
20
+ ],
21
+ "name": "assertionExists",
22
+ "outputs": [
23
+ {
24
+ "internalType": "bool",
25
+ "name": "",
26
+ "type": "bool"
27
+ }
28
+ ],
29
+ "stateMutability": "view",
30
+ "type": "function"
31
+ },
32
+ {
33
+ "inputs": [
34
+ {
35
+ "internalType": "bytes32",
36
+ "name": "assertionId",
37
+ "type": "bytes32"
38
+ },
39
+ {
40
+ "internalType": "uint128",
41
+ "name": "size",
42
+ "type": "uint128"
43
+ },
44
+ {
45
+ "internalType": "uint32",
46
+ "name": "triplesNumber",
47
+ "type": "uint32"
48
+ },
49
+ {
50
+ "internalType": "uint96",
51
+ "name": "chunksNumber",
52
+ "type": "uint96"
53
+ }
54
+ ],
55
+ "name": "createAssertion",
56
+ "outputs": [],
57
+ "stateMutability": "nonpayable",
58
+ "type": "function"
59
+ },
60
+ {
61
+ "inputs": [
62
+ {
63
+ "internalType": "bytes32",
64
+ "name": "assertionId",
65
+ "type": "bytes32"
66
+ }
67
+ ],
68
+ "name": "deleteAssertion",
69
+ "outputs": [],
70
+ "stateMutability": "nonpayable",
71
+ "type": "function"
72
+ },
73
+ {
74
+ "inputs": [
75
+ {
76
+ "internalType": "bytes32",
77
+ "name": "assertionId",
78
+ "type": "bytes32"
79
+ }
80
+ ],
81
+ "name": "getAssertion",
82
+ "outputs": [
83
+ {
84
+ "components": [
85
+ {
86
+ "internalType": "uint256",
87
+ "name": "timestamp",
88
+ "type": "uint256"
89
+ },
90
+ {
91
+ "internalType": "uint128",
92
+ "name": "size",
93
+ "type": "uint128"
94
+ },
95
+ {
96
+ "internalType": "uint32",
97
+ "name": "triplesNumber",
98
+ "type": "uint32"
99
+ },
100
+ {
101
+ "internalType": "uint96",
102
+ "name": "chunksNumber",
103
+ "type": "uint96"
104
+ }
105
+ ],
106
+ "internalType": "struct AssertionStructs.Assertion",
107
+ "name": "",
108
+ "type": "tuple"
109
+ }
110
+ ],
111
+ "stateMutability": "view",
112
+ "type": "function"
113
+ },
114
+ {
115
+ "inputs": [
116
+ {
117
+ "internalType": "bytes32",
118
+ "name": "assertionId",
119
+ "type": "bytes32"
120
+ }
121
+ ],
122
+ "name": "getAssertionChunksNumber",
123
+ "outputs": [
124
+ {
125
+ "internalType": "uint96",
126
+ "name": "",
127
+ "type": "uint96"
128
+ }
129
+ ],
130
+ "stateMutability": "view",
131
+ "type": "function"
132
+ },
133
+ {
134
+ "inputs": [
135
+ {
136
+ "internalType": "bytes32",
137
+ "name": "assertionId",
138
+ "type": "bytes32"
139
+ }
140
+ ],
141
+ "name": "getAssertionSize",
142
+ "outputs": [
143
+ {
144
+ "internalType": "uint128",
145
+ "name": "",
146
+ "type": "uint128"
147
+ }
148
+ ],
149
+ "stateMutability": "view",
150
+ "type": "function"
151
+ },
152
+ {
153
+ "inputs": [
154
+ {
155
+ "internalType": "bytes32",
156
+ "name": "assertionId",
157
+ "type": "bytes32"
158
+ }
159
+ ],
160
+ "name": "getAssertionTimestamp",
161
+ "outputs": [
162
+ {
163
+ "internalType": "uint256",
164
+ "name": "",
165
+ "type": "uint256"
166
+ }
167
+ ],
168
+ "stateMutability": "view",
169
+ "type": "function"
170
+ },
171
+ {
172
+ "inputs": [
173
+ {
174
+ "internalType": "bytes32",
175
+ "name": "assertionId",
176
+ "type": "bytes32"
177
+ }
178
+ ],
179
+ "name": "getAssertionTriplesNumber",
180
+ "outputs": [
181
+ {
182
+ "internalType": "uint32",
183
+ "name": "",
184
+ "type": "uint32"
185
+ }
186
+ ],
187
+ "stateMutability": "view",
188
+ "type": "function"
189
+ },
190
+ {
191
+ "inputs": [],
192
+ "name": "hub",
193
+ "outputs": [
194
+ {
195
+ "internalType": "contract Hub",
196
+ "name": "",
197
+ "type": "address"
198
+ }
199
+ ],
200
+ "stateMutability": "view",
201
+ "type": "function"
202
+ },
203
+ {
204
+ "inputs": [],
205
+ "name": "name",
206
+ "outputs": [
207
+ {
208
+ "internalType": "string",
209
+ "name": "",
210
+ "type": "string"
211
+ }
212
+ ],
213
+ "stateMutability": "pure",
214
+ "type": "function"
215
+ },
216
+ {
217
+ "inputs": [],
218
+ "name": "version",
219
+ "outputs": [
220
+ {
221
+ "internalType": "string",
222
+ "name": "",
223
+ "type": "string"
224
+ }
225
+ ],
226
+ "stateMutability": "pure",
227
+ "type": "function"
228
+ }
229
+ ]