dkg 0.1.0b2__tar.gz → 0.1.0b4__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.
- {dkg-0.1.0b2 → dkg-0.1.0b4}/PKG-INFO +1 -1
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/asset.py +93 -37
- dkg-0.1.0b4/dkg/constants.py +73 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/data/interfaces/Assertion.json +26 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/data/interfaces/CommitManagerV1.json +26 -11
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/data/interfaces/CommitManagerV1U1.json +26 -11
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/data/interfaces/ContentAssetStorage.json +76 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/data/interfaces/HashingProxy.json +26 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/data/interfaces/Hub.json +2 -2
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/data/interfaces/Identity.json +26 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/data/interfaces/ParametersStorage.json +19 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/data/interfaces/Profile.json +26 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/data/interfaces/ProfileStorage.json +3 -3
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/data/interfaces/ProofManagerV1.json +28 -13
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/data/interfaces/ProofManagerV1U1.json +28 -13
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/data/interfaces/ScoringProxy.json +26 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/data/interfaces/ServiceAgreementStorageProxy.json +27 -12
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/data/interfaces/ServiceAgreementStorageV1.json +5 -5
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/data/interfaces/ServiceAgreementStorageV1U1.json +5 -5
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/data/interfaces/ServiceAgreementV1.json +28 -24
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/data/interfaces/ShardingTable.json +26 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/data/interfaces/Staking.json +26 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/data/interfaces/Token.json +60 -16
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/exceptions.py +16 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/network.py +2 -4
- dkg-0.1.0b4/dkg/providers/blockchain.py +286 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/providers/node_http.py +23 -23
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/types/__init__.py +1 -1
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/types/blockchain.py +5 -2
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/utils/ual.py +4 -1
- {dkg-0.1.0b2 → dkg-0.1.0b4}/pyproject.toml +1 -1
- dkg-0.1.0b2/dkg/constants.py +0 -45
- dkg-0.1.0b2/dkg/providers/blockchain.py +0 -181
- {dkg-0.1.0b2 → dkg-0.1.0b4}/LICENSE +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/README.md +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/__init__.py +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/assertion.py +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/data/interfaces/AssertionStorage.json +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/data/interfaces/ContentAsset.json +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/data/interfaces/IdentityStorage.json +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/data/interfaces/ShardingTableStorage.json +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/data/interfaces/StakingStorage.json +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/data/interfaces/UnfinalizedStateStorage.json +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/data/interfaces/WhitelistStorage.json +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/dataclasses.py +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/graph.py +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/main.py +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/manager.py +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/method.py +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/module.py +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/node.py +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/providers/__init__.py +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/types/dkg_node.py +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/types/encoding.py +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/types/evm.py +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/types/generics.py +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/types/network.py +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/types/rdf.py +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/utils/__init__.py +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/utils/blockchain_request.py +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/utils/decorators.py +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/utils/merkle.py +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/utils/metadata.py +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/utils/node_request.py +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/utils/rdf.py +0 -0
- {dkg-0.1.0b2 → dkg-0.1.0b4}/dkg/utils/string_transformations.py +0 -0
@@ -21,11 +21,10 @@ from typing import Literal, Type
|
|
21
21
|
|
22
22
|
from pyld import jsonld
|
23
23
|
from web3 import Web3
|
24
|
-
from web3.constants import HASH_ZERO
|
24
|
+
from web3.constants import ADDRESS_ZERO, HASH_ZERO
|
25
25
|
from web3.exceptions import ContractLogicError
|
26
26
|
|
27
|
-
from dkg.constants import (
|
28
|
-
DEFAULT_SCORE_FUNCTION_ID,
|
27
|
+
from dkg.constants import (DEFAULT_HASH_FUNCTION_ID, DEFAULT_SCORE_FUNCTION_ID,
|
29
28
|
PRIVATE_ASSERTION_PREDICATE,
|
30
29
|
PRIVATE_CURRENT_REPOSITORY,
|
31
30
|
PRIVATE_HISTORICAL_REPOSITORY)
|
@@ -54,6 +53,71 @@ class ContentAsset(Module):
|
|
54
53
|
def __init__(self, manager: DefaultRequestManager):
|
55
54
|
self.manager = manager
|
56
55
|
|
56
|
+
_owner = Method(BlockchainRequest.owner_of)
|
57
|
+
|
58
|
+
def is_valid_ual(self, ual: UAL) -> bool:
|
59
|
+
if not ual or not isinstance(ual, str):
|
60
|
+
raise ValueError("UAL must be a non-empty string.")
|
61
|
+
|
62
|
+
parts = ual.split("/")
|
63
|
+
if len(parts) != 3:
|
64
|
+
raise ValueError("UAL format is incorrect.")
|
65
|
+
|
66
|
+
prefixes = parts[0].split(":")
|
67
|
+
prefixes_number = len(prefixes)
|
68
|
+
if prefixes_number != 3 and prefixes_number != 4:
|
69
|
+
raise ValueError("Prefix format in UAL is incorrect.")
|
70
|
+
|
71
|
+
if prefixes[0] != "did":
|
72
|
+
raise ValueError(
|
73
|
+
f"Invalid DID prefix. Expected: 'did'. Received: '{prefixes[0]}'."
|
74
|
+
)
|
75
|
+
|
76
|
+
if prefixes[1] != "dkg":
|
77
|
+
raise ValueError(
|
78
|
+
f"Invalid DKG prefix. Expected: 'dkg'. Received: '{prefixes[1]}'."
|
79
|
+
)
|
80
|
+
|
81
|
+
if prefixes[2] != (
|
82
|
+
blockchain_name := (
|
83
|
+
self.manager.blockchain_provider.blockchain_id.split(":")[0]
|
84
|
+
)
|
85
|
+
):
|
86
|
+
raise ValueError(
|
87
|
+
"Invalid blockchain name in the UAL prefix. "
|
88
|
+
f"Expected: '{blockchain_name}'. Received: '${prefixes[2]}'."
|
89
|
+
)
|
90
|
+
|
91
|
+
if prefixes_number == 4:
|
92
|
+
chain_id = self.manager.blockchain_provider.blockchain_id.split(":")[1]
|
93
|
+
|
94
|
+
if int(prefixes[3]) != int(chain_id):
|
95
|
+
raise ValueError(
|
96
|
+
"Chain ID in UAL does not match the blockchain. "
|
97
|
+
f"Expected: '${chain_id}'. Received: '${prefixes[3]}'."
|
98
|
+
)
|
99
|
+
|
100
|
+
contract_address = self.manager.blockchain_provider.contracts[
|
101
|
+
"ContentAssetStorage"
|
102
|
+
].address
|
103
|
+
|
104
|
+
if parts[1].lower() != contract_address.lower():
|
105
|
+
raise ValueError(
|
106
|
+
"Contract address in UAL does not match. "
|
107
|
+
f"Expected: '${contract_address.lower()}'. "
|
108
|
+
f"Received: '${parts[1].lower()}'."
|
109
|
+
)
|
110
|
+
|
111
|
+
try:
|
112
|
+
owner = self._owner(int(parts[2]))
|
113
|
+
|
114
|
+
if not owner or owner == ADDRESS_ZERO:
|
115
|
+
raise ValueError("Token does not exist or has no owner.")
|
116
|
+
|
117
|
+
return True
|
118
|
+
except Exception as err:
|
119
|
+
raise ValueError(f"Error fetching asset owner: {err}")
|
120
|
+
|
57
121
|
_get_contract_address = Method(BlockchainRequest.get_contract_address)
|
58
122
|
_get_current_allowance = Method(BlockchainRequest.allowance)
|
59
123
|
|
@@ -70,9 +134,7 @@ class ContentAsset(Module):
|
|
70
134
|
_increase_allowance = Method(BlockchainRequest.increase_allowance)
|
71
135
|
_decrease_allowance = Method(BlockchainRequest.decrease_allowance)
|
72
136
|
|
73
|
-
def set_allowance(
|
74
|
-
self, token_amount: Wei, spender: Address | None = None
|
75
|
-
) -> Wei:
|
137
|
+
def set_allowance(self, token_amount: Wei, spender: Address | None = None) -> Wei:
|
76
138
|
if spender is None:
|
77
139
|
spender = self._get_contract_address("ServiceAgreementV1")
|
78
140
|
|
@@ -127,6 +189,7 @@ class ContentAsset(Module):
|
|
127
189
|
immutable: bool = False,
|
128
190
|
content_type: Literal["JSON-LD", "N-Quads"] = "JSON-LD",
|
129
191
|
) -> dict[str, HexStr | dict[str, str]]:
|
192
|
+
blockchain_id = self.manager.blockchain_provider.blockchain_id
|
130
193
|
assertions = format_content(content, content_type)
|
131
194
|
|
132
195
|
public_assertion_id = MerkleTree(
|
@@ -135,7 +198,6 @@ class ContentAsset(Module):
|
|
135
198
|
).root
|
136
199
|
public_assertion_metadata = generate_assertion_metadata(assertions["public"])
|
137
200
|
|
138
|
-
chain_name = BLOCKCHAINS[self._chain_id()]["name"]
|
139
201
|
content_asset_storage_address = self._get_asset_storage_address(
|
140
202
|
"ContentAssetStorage"
|
141
203
|
)
|
@@ -143,7 +205,7 @@ class ContentAsset(Module):
|
|
143
205
|
if token_amount is None:
|
144
206
|
token_amount = int(
|
145
207
|
self._get_bid_suggestion(
|
146
|
-
|
208
|
+
blockchain_id,
|
147
209
|
epochs_number,
|
148
210
|
public_assertion_metadata["size"],
|
149
211
|
content_asset_storage_address,
|
@@ -153,7 +215,7 @@ class ContentAsset(Module):
|
|
153
215
|
)
|
154
216
|
|
155
217
|
current_allowance = self.get_current_allowance()
|
156
|
-
if
|
218
|
+
if is_allowance_increased := current_allowance < token_amount:
|
157
219
|
self.increase_allowance(token_amount)
|
158
220
|
|
159
221
|
try:
|
@@ -183,7 +245,7 @@ class ContentAsset(Module):
|
|
183
245
|
|
184
246
|
assertions_list = [
|
185
247
|
{
|
186
|
-
"blockchain":
|
248
|
+
"blockchain": blockchain_id,
|
187
249
|
"contract": content_asset_storage_address,
|
188
250
|
"tokenId": token_id,
|
189
251
|
"assertionId": public_assertion_id,
|
@@ -195,7 +257,7 @@ class ContentAsset(Module):
|
|
195
257
|
if content.get("private", None):
|
196
258
|
assertions_list.append(
|
197
259
|
{
|
198
|
-
"blockchain":
|
260
|
+
"blockchain": blockchain_id,
|
199
261
|
"contract": content_asset_storage_address,
|
200
262
|
"tokenId": token_id,
|
201
263
|
"assertionId": MerkleTree(
|
@@ -213,7 +275,7 @@ class ContentAsset(Module):
|
|
213
275
|
operation_id = self._publish(
|
214
276
|
public_assertion_id,
|
215
277
|
assertions["public"],
|
216
|
-
|
278
|
+
blockchain_id,
|
217
279
|
content_asset_storage_address,
|
218
280
|
token_id,
|
219
281
|
DEFAULT_HASH_FUNCTION_ID,
|
@@ -221,7 +283,7 @@ class ContentAsset(Module):
|
|
221
283
|
operation_result = self.get_operation_result(operation_id, "publish")
|
222
284
|
|
223
285
|
return {
|
224
|
-
"UAL": format_ual(
|
286
|
+
"UAL": format_ual(blockchain_id, content_asset_storage_address, token_id),
|
225
287
|
"publicAssertionId": public_assertion_id,
|
226
288
|
"operation": {
|
227
289
|
"operationId": operation_id,
|
@@ -265,7 +327,8 @@ class ContentAsset(Module):
|
|
265
327
|
content_type: Literal["JSON-LD", "N-Quads"] = "JSON-LD",
|
266
328
|
) -> dict[str, HexStr | dict[str, str]]:
|
267
329
|
parsed_ual = parse_ual(ual)
|
268
|
-
content_asset_storage_address, token_id = (
|
330
|
+
blockchain_id, content_asset_storage_address, token_id = (
|
331
|
+
parsed_ual["blockchain"],
|
269
332
|
parsed_ual["contract_address"],
|
270
333
|
parsed_ual["token_id"],
|
271
334
|
)
|
@@ -278,8 +341,6 @@ class ContentAsset(Module):
|
|
278
341
|
).root
|
279
342
|
public_assertion_metadata = generate_assertion_metadata(assertions["public"])
|
280
343
|
|
281
|
-
chain_name = BLOCKCHAINS[self._chain_id()]["name"]
|
282
|
-
|
283
344
|
if token_amount is None:
|
284
345
|
agreement_id = self.get_agreement_id(
|
285
346
|
content_asset_storage_address, token_id
|
@@ -297,7 +358,7 @@ class ContentAsset(Module):
|
|
297
358
|
|
298
359
|
token_amount = int(
|
299
360
|
self._get_bid_suggestion(
|
300
|
-
|
361
|
+
blockchain_id,
|
301
362
|
epochs_left,
|
302
363
|
public_assertion_metadata["size"],
|
303
364
|
content_asset_storage_address,
|
@@ -306,11 +367,11 @@ class ContentAsset(Module):
|
|
306
367
|
)["bidSuggestion"]
|
307
368
|
)
|
308
369
|
|
309
|
-
token_amount -= agreement_data.
|
370
|
+
token_amount -= agreement_data.tokens[0]
|
310
371
|
token_amount = token_amount if token_amount > 0 else 0
|
311
372
|
|
312
373
|
current_allowance = self.get_current_allowance()
|
313
|
-
if
|
374
|
+
if is_allowance_increased := current_allowance < token_amount:
|
314
375
|
self.increase_allowance(token_amount)
|
315
376
|
|
316
377
|
try:
|
@@ -329,7 +390,7 @@ class ContentAsset(Module):
|
|
329
390
|
|
330
391
|
assertions_list = [
|
331
392
|
{
|
332
|
-
"blockchain":
|
393
|
+
"blockchain": blockchain_id,
|
333
394
|
"contract": content_asset_storage_address,
|
334
395
|
"tokenId": token_id,
|
335
396
|
"assertionId": public_assertion_id,
|
@@ -341,7 +402,7 @@ class ContentAsset(Module):
|
|
341
402
|
if content.get("private", None):
|
342
403
|
assertions_list.append(
|
343
404
|
{
|
344
|
-
"blockchain":
|
405
|
+
"blockchain": blockchain_id,
|
345
406
|
"contract": content_asset_storage_address,
|
346
407
|
"tokenId": token_id,
|
347
408
|
"assertionId": MerkleTree(
|
@@ -359,7 +420,7 @@ class ContentAsset(Module):
|
|
359
420
|
operation_id = self._update(
|
360
421
|
public_assertion_id,
|
361
422
|
assertions["public"],
|
362
|
-
|
423
|
+
blockchain_id,
|
363
424
|
content_asset_storage_address,
|
364
425
|
token_id,
|
365
426
|
DEFAULT_HASH_FUNCTION_ID,
|
@@ -367,7 +428,7 @@ class ContentAsset(Module):
|
|
367
428
|
operation_result = self.get_operation_result(operation_id, "update")
|
368
429
|
|
369
430
|
return {
|
370
|
-
"UAL": format_ual(
|
431
|
+
"UAL": format_ual(blockchain_id, content_asset_storage_address, token_id),
|
371
432
|
"publicAssertionId": public_assertion_id,
|
372
433
|
"operation": {
|
373
434
|
"operationId": operation_id,
|
@@ -638,14 +699,13 @@ class ContentAsset(Module):
|
|
638
699
|
token_amount: Wei | None = None,
|
639
700
|
) -> dict[str, UAL | dict[str, str]]:
|
640
701
|
parsed_ual = parse_ual(ual)
|
641
|
-
content_asset_storage_address, token_id = (
|
702
|
+
blockchain_id, content_asset_storage_address, token_id = (
|
703
|
+
parsed_ual["blockchain"],
|
642
704
|
parsed_ual["contract_address"],
|
643
705
|
parsed_ual["token_id"],
|
644
706
|
)
|
645
707
|
|
646
708
|
if token_amount is None:
|
647
|
-
chain_name = BLOCKCHAINS[self._chain_id()]["name"]
|
648
|
-
|
649
709
|
latest_finalized_state = self._get_latest_assertion_id(token_id)
|
650
710
|
latest_finalized_state_size = self._get_assertion_size(
|
651
711
|
latest_finalized_state
|
@@ -653,7 +713,7 @@ class ContentAsset(Module):
|
|
653
713
|
|
654
714
|
token_amount = int(
|
655
715
|
self._get_bid_suggestion(
|
656
|
-
|
716
|
+
blockchain_id,
|
657
717
|
additional_epochs,
|
658
718
|
latest_finalized_state_size,
|
659
719
|
content_asset_storage_address,
|
@@ -678,14 +738,13 @@ class ContentAsset(Module):
|
|
678
738
|
token_amount: Wei | None = None,
|
679
739
|
) -> dict[str, UAL | dict[str, str]]:
|
680
740
|
parsed_ual = parse_ual(ual)
|
681
|
-
content_asset_storage_address, token_id = (
|
741
|
+
blockchain_id, content_asset_storage_address, token_id = (
|
742
|
+
parsed_ual["blockchain"],
|
682
743
|
parsed_ual["contract_address"],
|
683
744
|
parsed_ual["token_id"],
|
684
745
|
)
|
685
746
|
|
686
747
|
if token_amount is None:
|
687
|
-
chain_name = BLOCKCHAINS[self._chain_id()]["name"]
|
688
|
-
|
689
748
|
agreement_id = self.get_agreement_id(
|
690
749
|
content_asset_storage_address, token_id
|
691
750
|
)
|
@@ -707,7 +766,7 @@ class ContentAsset(Module):
|
|
707
766
|
|
708
767
|
token_amount = int(
|
709
768
|
self._get_bid_suggestion(
|
710
|
-
|
769
|
+
blockchain_id,
|
711
770
|
epochs_left,
|
712
771
|
latest_finalized_state_size,
|
713
772
|
content_asset_storage_address,
|
@@ -738,14 +797,13 @@ class ContentAsset(Module):
|
|
738
797
|
token_amount: Wei | None = None,
|
739
798
|
) -> dict[str, UAL | dict[str, str]]:
|
740
799
|
parsed_ual = parse_ual(ual)
|
741
|
-
content_asset_storage_address, token_id = (
|
800
|
+
blockchain_id, content_asset_storage_address, token_id = (
|
801
|
+
parsed_ual["blockchain"],
|
742
802
|
parsed_ual["contract_address"],
|
743
803
|
parsed_ual["token_id"],
|
744
804
|
)
|
745
805
|
|
746
806
|
if token_amount is None:
|
747
|
-
chain_name = BLOCKCHAINS[self._chain_id()]["name"]
|
748
|
-
|
749
807
|
agreement_id = self.get_agreement_id(
|
750
808
|
content_asset_storage_address, token_id
|
751
809
|
)
|
@@ -765,7 +823,7 @@ class ContentAsset(Module):
|
|
765
823
|
|
766
824
|
token_amount = int(
|
767
825
|
self._get_bid_suggestion(
|
768
|
-
|
826
|
+
blockchain_id,
|
769
827
|
epochs_left,
|
770
828
|
unfinalized_state_size,
|
771
829
|
content_asset_storage_address,
|
@@ -788,8 +846,6 @@ class ContentAsset(Module):
|
|
788
846
|
"operation": {"status": "COMPLETED"},
|
789
847
|
}
|
790
848
|
|
791
|
-
_owner = Method(BlockchainRequest.owner_of)
|
792
|
-
|
793
849
|
def get_owner(self, ual: UAL) -> Address:
|
794
850
|
token_id = parse_ual(ual)["token_id"]
|
795
851
|
|
@@ -0,0 +1,73 @@
|
|
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
|
+
"development": {
|
24
|
+
"hardhat1:31337": {
|
25
|
+
"hub": "0x5FbDB2315678afecb367f032d93F642f64180aa3",
|
26
|
+
"rpc": "http://localhost:8545",
|
27
|
+
},
|
28
|
+
"hardhat2:31337": {
|
29
|
+
"hub": "0x5FbDB2315678afecb367f032d93F642f64180aa3",
|
30
|
+
"rpc": "http://localhost:9545",
|
31
|
+
},
|
32
|
+
"otp:2043": {
|
33
|
+
"hub": "0x7585a99C5C150a08f5CDeFD16465C6De8D41EbbD",
|
34
|
+
"rpc": "http://parachain-alphanet-02.origin-trail.network:9933",
|
35
|
+
},
|
36
|
+
},
|
37
|
+
"devnet": {
|
38
|
+
"otp:2160": {
|
39
|
+
"hub": "0x833048F6e6BEa78E0AAdedeCd2Dc2231dda443FB",
|
40
|
+
"rpc": "https://lofar-tm-rpc.origin-trail.network",
|
41
|
+
},
|
42
|
+
"gnosis:10200": {
|
43
|
+
"hub": "0xD2bA102A0b11944d00180eE8136208ccF87bC39A",
|
44
|
+
"rpc": "https://rpc.chiadochain.net",
|
45
|
+
"gas_price_oracle": "https://blockscout.chiadochain.net/api/v1/gas-price-oracle",
|
46
|
+
},
|
47
|
+
},
|
48
|
+
"testnet": {
|
49
|
+
"otp:20430": {
|
50
|
+
"hub": "0xBbfF7Ea6b2Addc1f38A0798329e12C08f03750A6",
|
51
|
+
"rpc": "https://lofar-testnet.origin-trail.network",
|
52
|
+
},
|
53
|
+
"gnosis:10200": {
|
54
|
+
"hub": "0xC06210312C9217A0EdF67453618F5eB96668679A",
|
55
|
+
"rpc": "https://rpc.chiadochain.net",
|
56
|
+
"gas_price_oracle": "https://blockscout.chiadochain.net/api/v1/gas-price-oracle",
|
57
|
+
},
|
58
|
+
},
|
59
|
+
"mainnet": {
|
60
|
+
"otp:2043": {
|
61
|
+
"hub": "0x5fA7916c48Fe6D5F1738d12Ad234b78c90B4cAdA",
|
62
|
+
"rpc": "https://astrosat-parachain-rpc.origin-trail.network",
|
63
|
+
},
|
64
|
+
},
|
65
|
+
}
|
66
|
+
|
67
|
+
DEFAULT_GAS_PRICE_GWEI = 100
|
68
|
+
|
69
|
+
DEFAULT_HASH_FUNCTION_ID = 1
|
70
|
+
DEFAULT_SCORE_FUNCTION_ID = 1
|
71
|
+
|
72
|
+
PRIVATE_HISTORICAL_REPOSITORY = "privateHistory"
|
73
|
+
PRIVATE_CURRENT_REPOSITORY = "privateCurrent"
|
@@ -115,6 +115,32 @@
|
|
115
115
|
"stateMutability": "pure",
|
116
116
|
"type": "function"
|
117
117
|
},
|
118
|
+
{
|
119
|
+
"inputs": [
|
120
|
+
{
|
121
|
+
"internalType": "bool",
|
122
|
+
"name": "_status",
|
123
|
+
"type": "bool"
|
124
|
+
}
|
125
|
+
],
|
126
|
+
"name": "setStatus",
|
127
|
+
"outputs": [],
|
128
|
+
"stateMutability": "nonpayable",
|
129
|
+
"type": "function"
|
130
|
+
},
|
131
|
+
{
|
132
|
+
"inputs": [],
|
133
|
+
"name": "status",
|
134
|
+
"outputs": [
|
135
|
+
{
|
136
|
+
"internalType": "bool",
|
137
|
+
"name": "",
|
138
|
+
"type": "bool"
|
139
|
+
}
|
140
|
+
],
|
141
|
+
"stateMutability": "view",
|
142
|
+
"type": "function"
|
143
|
+
},
|
118
144
|
{
|
119
145
|
"inputs": [],
|
120
146
|
"name": "version",
|
@@ -124,17 +124,6 @@
|
|
124
124
|
"name": "NodeNotInShardingTable",
|
125
125
|
"type": "error"
|
126
126
|
},
|
127
|
-
{
|
128
|
-
"inputs": [
|
129
|
-
{
|
130
|
-
"internalType": "address",
|
131
|
-
"name": "caller",
|
132
|
-
"type": "address"
|
133
|
-
}
|
134
|
-
],
|
135
|
-
"name": "OnlyHubOwnerFunction",
|
136
|
-
"type": "error"
|
137
|
-
},
|
138
127
|
{
|
139
128
|
"inputs": [
|
140
129
|
{
|
@@ -439,6 +428,19 @@
|
|
439
428
|
"stateMutability": "nonpayable",
|
440
429
|
"type": "function"
|
441
430
|
},
|
431
|
+
{
|
432
|
+
"inputs": [
|
433
|
+
{
|
434
|
+
"internalType": "bool",
|
435
|
+
"name": "_status",
|
436
|
+
"type": "bool"
|
437
|
+
}
|
438
|
+
],
|
439
|
+
"name": "setStatus",
|
440
|
+
"outputs": [],
|
441
|
+
"stateMutability": "nonpayable",
|
442
|
+
"type": "function"
|
443
|
+
},
|
442
444
|
{
|
443
445
|
"inputs": [],
|
444
446
|
"name": "shardingTableStorage",
|
@@ -478,6 +480,19 @@
|
|
478
480
|
"stateMutability": "view",
|
479
481
|
"type": "function"
|
480
482
|
},
|
483
|
+
{
|
484
|
+
"inputs": [],
|
485
|
+
"name": "status",
|
486
|
+
"outputs": [
|
487
|
+
{
|
488
|
+
"internalType": "bool",
|
489
|
+
"name": "",
|
490
|
+
"type": "bool"
|
491
|
+
}
|
492
|
+
],
|
493
|
+
"stateMutability": "view",
|
494
|
+
"type": "function"
|
495
|
+
},
|
481
496
|
{
|
482
497
|
"inputs": [
|
483
498
|
{
|
@@ -155,17 +155,6 @@
|
|
155
155
|
"name": "NodeNotInShardingTable",
|
156
156
|
"type": "error"
|
157
157
|
},
|
158
|
-
{
|
159
|
-
"inputs": [
|
160
|
-
{
|
161
|
-
"internalType": "address",
|
162
|
-
"name": "caller",
|
163
|
-
"type": "address"
|
164
|
-
}
|
165
|
-
],
|
166
|
-
"name": "OnlyHubOwnerFunction",
|
167
|
-
"type": "error"
|
168
|
-
},
|
169
158
|
{
|
170
159
|
"inputs": [
|
171
160
|
{
|
@@ -572,6 +561,19 @@
|
|
572
561
|
"stateMutability": "nonpayable",
|
573
562
|
"type": "function"
|
574
563
|
},
|
564
|
+
{
|
565
|
+
"inputs": [
|
566
|
+
{
|
567
|
+
"internalType": "bool",
|
568
|
+
"name": "_status",
|
569
|
+
"type": "bool"
|
570
|
+
}
|
571
|
+
],
|
572
|
+
"name": "setStatus",
|
573
|
+
"outputs": [],
|
574
|
+
"stateMutability": "nonpayable",
|
575
|
+
"type": "function"
|
576
|
+
},
|
575
577
|
{
|
576
578
|
"inputs": [],
|
577
579
|
"name": "shardingTableStorage",
|
@@ -611,6 +613,19 @@
|
|
611
613
|
"stateMutability": "view",
|
612
614
|
"type": "function"
|
613
615
|
},
|
616
|
+
{
|
617
|
+
"inputs": [],
|
618
|
+
"name": "status",
|
619
|
+
"outputs": [
|
620
|
+
{
|
621
|
+
"internalType": "bool",
|
622
|
+
"name": "",
|
623
|
+
"type": "bool"
|
624
|
+
}
|
625
|
+
],
|
626
|
+
"stateMutability": "view",
|
627
|
+
"type": "function"
|
628
|
+
},
|
614
629
|
{
|
615
630
|
"inputs": [
|
616
631
|
{
|
@@ -10,6 +10,11 @@
|
|
10
10
|
"stateMutability": "nonpayable",
|
11
11
|
"type": "constructor"
|
12
12
|
},
|
13
|
+
{
|
14
|
+
"inputs": [],
|
15
|
+
"name": "NoMintedAssets",
|
16
|
+
"type": "error"
|
17
|
+
},
|
13
18
|
{
|
14
19
|
"anonymous": false,
|
15
20
|
"inputs": [
|
@@ -60,6 +65,38 @@
|
|
60
65
|
"name": "ApprovalForAll",
|
61
66
|
"type": "event"
|
62
67
|
},
|
68
|
+
{
|
69
|
+
"anonymous": false,
|
70
|
+
"inputs": [
|
71
|
+
{
|
72
|
+
"indexed": false,
|
73
|
+
"internalType": "uint256",
|
74
|
+
"name": "_fromTokenId",
|
75
|
+
"type": "uint256"
|
76
|
+
},
|
77
|
+
{
|
78
|
+
"indexed": false,
|
79
|
+
"internalType": "uint256",
|
80
|
+
"name": "_toTokenId",
|
81
|
+
"type": "uint256"
|
82
|
+
}
|
83
|
+
],
|
84
|
+
"name": "BatchMetadataUpdate",
|
85
|
+
"type": "event"
|
86
|
+
},
|
87
|
+
{
|
88
|
+
"anonymous": false,
|
89
|
+
"inputs": [
|
90
|
+
{
|
91
|
+
"indexed": false,
|
92
|
+
"internalType": "uint256",
|
93
|
+
"name": "_tokenId",
|
94
|
+
"type": "uint256"
|
95
|
+
}
|
96
|
+
],
|
97
|
+
"name": "MetadataUpdate",
|
98
|
+
"type": "event"
|
99
|
+
},
|
63
100
|
{
|
64
101
|
"anonymous": false,
|
65
102
|
"inputs": [
|
@@ -438,6 +475,19 @@
|
|
438
475
|
"stateMutability": "view",
|
439
476
|
"type": "function"
|
440
477
|
},
|
478
|
+
{
|
479
|
+
"inputs": [],
|
480
|
+
"name": "lastTokenId",
|
481
|
+
"outputs": [
|
482
|
+
{
|
483
|
+
"internalType": "uint256",
|
484
|
+
"name": "",
|
485
|
+
"type": "uint256"
|
486
|
+
}
|
487
|
+
],
|
488
|
+
"stateMutability": "view",
|
489
|
+
"type": "function"
|
490
|
+
},
|
441
491
|
{
|
442
492
|
"inputs": [
|
443
493
|
{
|
@@ -598,6 +648,19 @@
|
|
598
648
|
"stateMutability": "nonpayable",
|
599
649
|
"type": "function"
|
600
650
|
},
|
651
|
+
{
|
652
|
+
"inputs": [
|
653
|
+
{
|
654
|
+
"internalType": "string",
|
655
|
+
"name": "baseURI",
|
656
|
+
"type": "string"
|
657
|
+
}
|
658
|
+
],
|
659
|
+
"name": "setBaseURI",
|
660
|
+
"outputs": [],
|
661
|
+
"stateMutability": "nonpayable",
|
662
|
+
"type": "function"
|
663
|
+
},
|
601
664
|
{
|
602
665
|
"inputs": [
|
603
666
|
{
|
@@ -648,6 +711,19 @@
|
|
648
711
|
"stateMutability": "view",
|
649
712
|
"type": "function"
|
650
713
|
},
|
714
|
+
{
|
715
|
+
"inputs": [],
|
716
|
+
"name": "tokenBaseURI",
|
717
|
+
"outputs": [
|
718
|
+
{
|
719
|
+
"internalType": "string",
|
720
|
+
"name": "",
|
721
|
+
"type": "string"
|
722
|
+
}
|
723
|
+
],
|
724
|
+
"stateMutability": "view",
|
725
|
+
"type": "function"
|
726
|
+
},
|
651
727
|
{
|
652
728
|
"inputs": [
|
653
729
|
{
|
@@ -211,6 +211,32 @@
|
|
211
211
|
"stateMutability": "nonpayable",
|
212
212
|
"type": "function"
|
213
213
|
},
|
214
|
+
{
|
215
|
+
"inputs": [
|
216
|
+
{
|
217
|
+
"internalType": "bool",
|
218
|
+
"name": "_status",
|
219
|
+
"type": "bool"
|
220
|
+
}
|
221
|
+
],
|
222
|
+
"name": "setStatus",
|
223
|
+
"outputs": [],
|
224
|
+
"stateMutability": "nonpayable",
|
225
|
+
"type": "function"
|
226
|
+
},
|
227
|
+
{
|
228
|
+
"inputs": [],
|
229
|
+
"name": "status",
|
230
|
+
"outputs": [
|
231
|
+
{
|
232
|
+
"internalType": "bool",
|
233
|
+
"name": "",
|
234
|
+
"type": "bool"
|
235
|
+
}
|
236
|
+
],
|
237
|
+
"stateMutability": "view",
|
238
|
+
"type": "function"
|
239
|
+
},
|
214
240
|
{
|
215
241
|
"inputs": [],
|
216
242
|
"name": "version",
|