dkg 1.1.1__tar.gz → 1.1.2__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-1.1.1 → dkg-1.1.2}/PKG-INFO +1 -1
- {dkg-1.1.1 → dkg-1.1.2}/dkg/constants.py +8 -9
- {dkg-1.1.1 → dkg-1.1.2}/dkg/data/interfaces/ParanetIncentivesPoolFactory.json +5 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/data/interfaces/ParanetNeurowebIncentivesPool.json +51 -20
- {dkg-1.1.1 → dkg-1.1.2}/dkg/dataclasses.py +3 -2
- {dkg-1.1.1 → dkg-1.1.2}/dkg/paranet.py +78 -20
- {dkg-1.1.1 → dkg-1.1.2}/dkg/providers/node_http.py +11 -2
- {dkg-1.1.1 → dkg-1.1.2}/dkg/utils/blockchain_request.py +2 -1
- {dkg-1.1.1 → dkg-1.1.2}/pyproject.toml +1 -1
- {dkg-1.1.1 → dkg-1.1.2}/LICENSE +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/NOTICE +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/README.md +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/__init__.py +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/assertion.py +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/asset.py +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/data/interfaces/AssertionStorage.json +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/data/interfaces/ContentAsset.json +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/data/interfaces/ContentAssetStorage.json +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/data/interfaces/Hub.json +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/data/interfaces/Paranet.json +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/data/interfaces/ParanetKnowledgeMinersRegistry.json +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/data/interfaces/ParanetsRegistry.json +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/data/interfaces/ServiceAgreementStorageProxy.json +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/data/interfaces/Token.json +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/data/interfaces/UnfinalizedStateStorage.json +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/exceptions.py +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/graph.py +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/main.py +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/manager.py +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/method.py +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/module.py +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/network.py +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/node.py +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/providers/__init__.py +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/providers/blockchain.py +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/types/__init__.py +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/types/blockchain.py +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/types/dkg_node.py +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/types/encoding.py +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/types/evm.py +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/types/general.py +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/types/generics.py +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/types/network.py +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/types/rdf.py +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/utils/__init__.py +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/utils/decorators.py +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/utils/merkle.py +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/utils/metadata.py +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/utils/node_request.py +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/utils/rdf.py +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/utils/string_transformations.py +0 -0
- {dkg-1.1.1 → dkg-1.1.2}/dkg/utils/ual.py +0 -0
{dkg-1.1.1 → dkg-1.1.2}/PKG-INFO
RENAMED
@@ -21,11 +21,11 @@ PRIVATE_ASSERTION_PREDICATE = (
|
|
21
21
|
|
22
22
|
BLOCKCHAINS = {
|
23
23
|
"development": {
|
24
|
-
"hardhat1:31337":
|
24
|
+
"hardhat1:31337": {
|
25
25
|
"hub": "0x5FbDB2315678afecb367f032d93F642f64180aa3",
|
26
26
|
"rpc": "http://localhost:8545",
|
27
27
|
},
|
28
|
-
"hardhat2:31337":
|
28
|
+
"hardhat2:31337": {
|
29
29
|
"hub": "0x5FbDB2315678afecb367f032d93F642f64180aa3",
|
30
30
|
"rpc": "http://localhost:9545",
|
31
31
|
},
|
@@ -43,7 +43,7 @@ BLOCKCHAINS = {
|
|
43
43
|
"base:84532": {
|
44
44
|
"hub": "0x6C861Cb69300C34DfeF674F7C00E734e840C29C0",
|
45
45
|
"rpc": "https://sepolia.base.org",
|
46
|
-
}
|
46
|
+
},
|
47
47
|
},
|
48
48
|
"testnet": {
|
49
49
|
"otp:20430": {
|
@@ -58,7 +58,7 @@ BLOCKCHAINS = {
|
|
58
58
|
"base:84532": {
|
59
59
|
"hub": "0x144eDa5cbf8926327cb2cceef168A121F0E4A299",
|
60
60
|
"rpc": "https://sepolia.base.org",
|
61
|
-
}
|
61
|
+
},
|
62
62
|
},
|
63
63
|
"mainnet": {
|
64
64
|
"otp:2043": {
|
@@ -88,11 +88,7 @@ DEFAULT_GAS_PRICE_GWEI = {
|
|
88
88
|
|
89
89
|
DEFAULT_HASH_FUNCTION_ID = 1
|
90
90
|
DEFAULT_PROXIMITY_SCORE_FUNCTIONS_PAIR_IDS = {
|
91
|
-
"development": {
|
92
|
-
"hardhat1:31337": 2,
|
93
|
-
"hardhat2:31337": 2,
|
94
|
-
"otp:2043": 2
|
95
|
-
},
|
91
|
+
"development": {"hardhat1:31337": 2, "hardhat2:31337": 2, "otp:2043": 2},
|
96
92
|
"devnet": {
|
97
93
|
"otp:2160": 2,
|
98
94
|
"gnosis:10200": 2,
|
@@ -112,3 +108,6 @@ DEFAULT_PROXIMITY_SCORE_FUNCTIONS_PAIR_IDS = {
|
|
112
108
|
|
113
109
|
PRIVATE_HISTORICAL_REPOSITORY = "privateHistory"
|
114
110
|
PRIVATE_CURRENT_REPOSITORY = "privateCurrent"
|
111
|
+
|
112
|
+
NEUROWEB_BLOCKCHAIN_PREFIX = "otp"
|
113
|
+
INCENTIVE_POOL_NAME = "ParanetNeurowebIncentivesPool"
|
@@ -6,6 +6,11 @@
|
|
6
6
|
"name": "hubAddress",
|
7
7
|
"type": "address"
|
8
8
|
},
|
9
|
+
{
|
10
|
+
"internalType": "address",
|
11
|
+
"name": "rewardTokenAddress",
|
12
|
+
"type": "address"
|
13
|
+
},
|
9
14
|
{
|
10
15
|
"internalType": "address",
|
11
16
|
"name": "paranetsRegistryAddress",
|
@@ -81,19 +86,19 @@
|
|
81
86
|
"anonymous": false,
|
82
87
|
"inputs": [
|
83
88
|
{
|
84
|
-
"indexed":
|
85
|
-
"internalType": "
|
86
|
-
"name": "
|
87
|
-
"type": "
|
89
|
+
"indexed": true,
|
90
|
+
"internalType": "address",
|
91
|
+
"name": "sender",
|
92
|
+
"type": "address"
|
88
93
|
},
|
89
94
|
{
|
90
95
|
"indexed": false,
|
91
96
|
"internalType": "uint256",
|
92
|
-
"name": "
|
97
|
+
"name": "amount",
|
93
98
|
"type": "uint256"
|
94
99
|
}
|
95
100
|
],
|
96
|
-
"name": "
|
101
|
+
"name": "NativeNeuroRewardDeposit",
|
97
102
|
"type": "event"
|
98
103
|
},
|
99
104
|
{
|
@@ -110,34 +115,34 @@
|
|
110
115
|
"internalType": "uint256",
|
111
116
|
"name": "newMultiplier",
|
112
117
|
"type": "uint256"
|
113
|
-
},
|
114
|
-
{
|
115
|
-
"indexed": false,
|
116
|
-
"internalType": "uint256",
|
117
|
-
"name": "timestamp",
|
118
|
-
"type": "uint256"
|
119
118
|
}
|
120
119
|
],
|
121
|
-
"name": "
|
120
|
+
"name": "NeuroEmissionMultiplierUpdateFinalized",
|
122
121
|
"type": "event"
|
123
122
|
},
|
124
123
|
{
|
125
124
|
"anonymous": false,
|
126
125
|
"inputs": [
|
127
126
|
{
|
128
|
-
"indexed":
|
129
|
-
"internalType": "
|
130
|
-
"name": "
|
131
|
-
"type": "
|
127
|
+
"indexed": false,
|
128
|
+
"internalType": "uint256",
|
129
|
+
"name": "oldMultiplier",
|
130
|
+
"type": "uint256"
|
132
131
|
},
|
133
132
|
{
|
134
133
|
"indexed": false,
|
135
134
|
"internalType": "uint256",
|
136
|
-
"name": "
|
135
|
+
"name": "newMultiplier",
|
136
|
+
"type": "uint256"
|
137
|
+
},
|
138
|
+
{
|
139
|
+
"indexed": false,
|
140
|
+
"internalType": "uint256",
|
141
|
+
"name": "timestamp",
|
137
142
|
"type": "uint256"
|
138
143
|
}
|
139
144
|
],
|
140
|
-
"name": "
|
145
|
+
"name": "NeuroEmissionMultiplierUpdateInitiated",
|
141
146
|
"type": "event"
|
142
147
|
},
|
143
148
|
{
|
@@ -213,7 +218,7 @@
|
|
213
218
|
}
|
214
219
|
],
|
215
220
|
"internalType": "struct ParanetStructs.ParanetIncentivizationProposalVoterInput[]",
|
216
|
-
"name": "
|
221
|
+
"name": "newVoters",
|
217
222
|
"type": "tuple[]"
|
218
223
|
}
|
219
224
|
],
|
@@ -715,6 +720,19 @@
|
|
715
720
|
"stateMutability": "view",
|
716
721
|
"type": "function"
|
717
722
|
},
|
723
|
+
{
|
724
|
+
"inputs": [],
|
725
|
+
"name": "isNativeNeuro",
|
726
|
+
"outputs": [
|
727
|
+
{
|
728
|
+
"internalType": "bool",
|
729
|
+
"name": "",
|
730
|
+
"type": "bool"
|
731
|
+
}
|
732
|
+
],
|
733
|
+
"stateMutability": "view",
|
734
|
+
"type": "function"
|
735
|
+
},
|
718
736
|
{
|
719
737
|
"inputs": [
|
720
738
|
{
|
@@ -924,6 +942,19 @@
|
|
924
942
|
"stateMutability": "nonpayable",
|
925
943
|
"type": "function"
|
926
944
|
},
|
945
|
+
{
|
946
|
+
"inputs": [],
|
947
|
+
"name": "token",
|
948
|
+
"outputs": [
|
949
|
+
{
|
950
|
+
"internalType": "contract IERC20",
|
951
|
+
"name": "",
|
952
|
+
"type": "address"
|
953
|
+
}
|
954
|
+
],
|
955
|
+
"stateMutability": "view",
|
956
|
+
"type": "function"
|
957
|
+
},
|
927
958
|
{
|
928
959
|
"inputs": [],
|
929
960
|
"name": "totalMinersClaimedNeuro",
|
@@ -55,8 +55,9 @@ class KnowledgeAssetContentVisibility(AutoStrEnumUpperCase):
|
|
55
55
|
PRIVATE = auto()
|
56
56
|
|
57
57
|
|
58
|
-
class ParanetIncentivizationType(
|
59
|
-
NEUROWEB =
|
58
|
+
class ParanetIncentivizationType(Enum):
|
59
|
+
NEUROWEB = "Neuroweb"
|
60
|
+
NEUROWEB_ERC20 = "NeurowebERC20"
|
60
61
|
|
61
62
|
|
62
63
|
@dataclass
|
@@ -28,6 +28,7 @@ from dkg.module import Module
|
|
28
28
|
from dkg.types import Address, UAL, HexStr
|
29
29
|
from dkg.utils.blockchain_request import BlockchainRequest
|
30
30
|
from dkg.utils.ual import parse_ual
|
31
|
+
from dkg.constants import NEUROWEB_BLOCKCHAIN_PREFIX, INCENTIVE_POOL_NAME
|
31
32
|
|
32
33
|
|
33
34
|
class Paranet(Module):
|
@@ -37,10 +38,15 @@ class Paranet(Module):
|
|
37
38
|
operator_percentage: float
|
38
39
|
voters_percentage: float
|
39
40
|
|
40
|
-
def to_contract_args(self) -> dict:
|
41
|
+
def to_contract_args(self, incentive_type: ParanetIncentivizationType | None) -> dict:
|
41
42
|
return {
|
42
43
|
"tracToNeuroEmissionMultiplier": int(
|
43
|
-
self.neuro_emission_multiplier
|
44
|
+
self.neuro_emission_multiplier
|
45
|
+
* (
|
46
|
+
10**12
|
47
|
+
if incentive_type == ParanetIncentivizationType.NEUROWEB
|
48
|
+
else 10**18
|
49
|
+
)
|
44
50
|
),
|
45
51
|
"paranetOperatorRewardPercentage": int(self.operator_percentage * 100),
|
46
52
|
"paranetIncentivizationProposalVotersRewardPercentage": int(
|
@@ -52,6 +58,7 @@ class Paranet(Module):
|
|
52
58
|
self.manager = manager
|
53
59
|
self.incentives_pools_deployment_functions = {
|
54
60
|
ParanetIncentivizationType.NEUROWEB: self._deploy_neuro_incentives_pool,
|
61
|
+
ParanetIncentivizationType.NEUROWEB_ERC20: self._deploy_neuro_incentives_pool,
|
55
62
|
}
|
56
63
|
|
57
64
|
_register_paranet = Method(BlockchainRequest.register_paranet)
|
@@ -91,7 +98,7 @@ class Paranet(Module):
|
|
91
98
|
self,
|
92
99
|
ual: UAL,
|
93
100
|
incentives_pool_parameters: NeuroWebIncentivesPoolParams,
|
94
|
-
incentives_type: ParanetIncentivizationType =
|
101
|
+
incentives_type: ParanetIncentivizationType | None = None,
|
95
102
|
) -> dict[str, str | HexStr | TxReceipt]:
|
96
103
|
deploy_incentives_pool_fn = self.incentives_pools_deployment_functions.get(
|
97
104
|
incentives_type,
|
@@ -111,9 +118,10 @@ class Paranet(Module):
|
|
111
118
|
)
|
112
119
|
|
113
120
|
receipt: TxReceipt = deploy_incentives_pool_fn(
|
121
|
+
incentives_type == ParanetIncentivizationType.NEUROWEB,
|
114
122
|
knowledge_asset_storage,
|
115
123
|
knowledge_asset_token_id,
|
116
|
-
**incentives_pool_parameters.to_contract_args(),
|
124
|
+
**incentives_pool_parameters.to_contract_args(incentives_type),
|
117
125
|
)
|
118
126
|
|
119
127
|
events = self.manager.blockchain_provider.decode_logs_event(
|
@@ -137,9 +145,7 @@ class Paranet(Module):
|
|
137
145
|
_get_incentives_pool_address = Method(BlockchainRequest.get_incentives_pool_address)
|
138
146
|
|
139
147
|
def get_incentives_pool_address(
|
140
|
-
self,
|
141
|
-
ual: UAL,
|
142
|
-
incentives_type: ParanetIncentivizationType = ParanetIncentivizationType.NEUROWEB,
|
148
|
+
self, ual: UAL, incentives_type: ParanetIncentivizationType | None = None
|
143
149
|
) -> Address:
|
144
150
|
parsed_ual = parse_ual(ual)
|
145
151
|
knowledge_asset_storage, knowledge_asset_token_id = (
|
@@ -259,8 +265,14 @@ class Paranet(Module):
|
|
259
265
|
self,
|
260
266
|
ual: UAL,
|
261
267
|
address: Address | None = None,
|
262
|
-
incentives_type: ParanetIncentivizationType =
|
268
|
+
incentives_type: ParanetIncentivizationType | None = None,
|
263
269
|
) -> bool:
|
270
|
+
incentives_type = incentives_type or (
|
271
|
+
ParanetIncentivizationType.NEUROWEB.value
|
272
|
+
if NEUROWEB_BLOCKCHAIN_PREFIX in ual
|
273
|
+
else ParanetIncentivizationType.NEUROWEB_ERC20.value
|
274
|
+
)
|
275
|
+
|
264
276
|
return self._is_proposal_voter(
|
265
277
|
contract=self._get_incentives_pool_contract(ual, incentives_type),
|
266
278
|
addr=address or self.manager.blockchain_provider.account.address,
|
@@ -273,8 +285,14 @@ class Paranet(Module):
|
|
273
285
|
def calculate_claimable_miner_reward_amount(
|
274
286
|
self,
|
275
287
|
ual: UAL,
|
276
|
-
incentives_type: ParanetIncentivizationType =
|
288
|
+
incentives_type: ParanetIncentivizationType | None = None,
|
277
289
|
) -> int:
|
290
|
+
incentives_type = incentives_type or (
|
291
|
+
ParanetIncentivizationType.NEUROWEB.value
|
292
|
+
if NEUROWEB_BLOCKCHAIN_PREFIX in ual
|
293
|
+
else ParanetIncentivizationType.NEUROWEB_ERC20.value
|
294
|
+
)
|
295
|
+
|
278
296
|
return self._get_claimable_knowledge_miner_reward_amount(
|
279
297
|
contract=self._get_incentives_pool_contract(ual, incentives_type)
|
280
298
|
)
|
@@ -286,8 +304,14 @@ class Paranet(Module):
|
|
286
304
|
def calculate_all_claimable_miner_rewards_amount(
|
287
305
|
self,
|
288
306
|
ual: UAL,
|
289
|
-
incentives_type: ParanetIncentivizationType =
|
307
|
+
incentives_type: ParanetIncentivizationType | None = None,
|
290
308
|
) -> int:
|
309
|
+
incentives_type = incentives_type or (
|
310
|
+
ParanetIncentivizationType.NEUROWEB.value
|
311
|
+
if NEUROWEB_BLOCKCHAIN_PREFIX in ual
|
312
|
+
else ParanetIncentivizationType.NEUROWEB_ERC20.value
|
313
|
+
)
|
314
|
+
|
291
315
|
return self._get_claimable_all_knowledge_miners_reward_amount(
|
292
316
|
contract=self._get_incentives_pool_contract(ual, incentives_type)
|
293
317
|
)
|
@@ -299,8 +323,14 @@ class Paranet(Module):
|
|
299
323
|
def claim_miner_reward(
|
300
324
|
self,
|
301
325
|
ual: UAL,
|
302
|
-
incentives_type:
|
326
|
+
incentives_type: None,
|
303
327
|
) -> dict[str, str | HexStr | TxReceipt]:
|
328
|
+
incentives_type = incentives_type or (
|
329
|
+
ParanetIncentivizationType.NEUROWEB.value
|
330
|
+
if NEUROWEB_BLOCKCHAIN_PREFIX in ual
|
331
|
+
else ParanetIncentivizationType.NEUROWEB_ERC20.value
|
332
|
+
)
|
333
|
+
|
304
334
|
receipt: TxReceipt = self._claim_knowledge_miner_reward(
|
305
335
|
contract=self._get_incentives_pool_contract(ual, incentives_type)
|
306
336
|
)
|
@@ -329,8 +359,14 @@ class Paranet(Module):
|
|
329
359
|
def calculate_claimable_operator_reward_amount(
|
330
360
|
self,
|
331
361
|
ual: UAL,
|
332
|
-
incentives_type: ParanetIncentivizationType =
|
362
|
+
incentives_type: ParanetIncentivizationType | None = None,
|
333
363
|
) -> int:
|
364
|
+
incentives_type = incentives_type or (
|
365
|
+
ParanetIncentivizationType.NEUROWEB.value
|
366
|
+
if NEUROWEB_BLOCKCHAIN_PREFIX in ual
|
367
|
+
else ParanetIncentivizationType.NEUROWEB_ERC20.value
|
368
|
+
)
|
369
|
+
|
334
370
|
return self._get_claimable_paranet_operator_reward_amount(
|
335
371
|
contract=self._get_incentives_pool_contract(ual, incentives_type)
|
336
372
|
)
|
@@ -342,8 +378,14 @@ class Paranet(Module):
|
|
342
378
|
def claim_operator_reward(
|
343
379
|
self,
|
344
380
|
ual: UAL,
|
345
|
-
incentives_type: ParanetIncentivizationType =
|
381
|
+
incentives_type: ParanetIncentivizationType | None = None,
|
346
382
|
) -> dict[str, str | HexStr | TxReceipt]:
|
383
|
+
incentives_type = incentives_type or (
|
384
|
+
ParanetIncentivizationType.NEUROWEB.value
|
385
|
+
if NEUROWEB_BLOCKCHAIN_PREFIX in ual
|
386
|
+
else ParanetIncentivizationType.NEUROWEB_ERC20.value
|
387
|
+
)
|
388
|
+
|
347
389
|
receipt: TxReceipt = self._claim_paranet_operator_reward(
|
348
390
|
contract=self._get_incentives_pool_contract(ual, incentives_type)
|
349
391
|
)
|
@@ -372,8 +414,14 @@ class Paranet(Module):
|
|
372
414
|
def calculate_claimable_voter_reward_amount(
|
373
415
|
self,
|
374
416
|
ual: UAL,
|
375
|
-
incentives_type: ParanetIncentivizationType =
|
417
|
+
incentives_type: ParanetIncentivizationType | None = None,
|
376
418
|
) -> int:
|
419
|
+
incentives_type = incentives_type or (
|
420
|
+
ParanetIncentivizationType.NEUROWEB.value
|
421
|
+
if NEUROWEB_BLOCKCHAIN_PREFIX in ual
|
422
|
+
else ParanetIncentivizationType.NEUROWEB_ERC20.value
|
423
|
+
)
|
424
|
+
|
377
425
|
return self._get_claimable_proposal_voter_reward_amount(
|
378
426
|
contract=self._get_incentives_pool_contract(ual, incentives_type)
|
379
427
|
)
|
@@ -385,8 +433,14 @@ class Paranet(Module):
|
|
385
433
|
def calculate_all_claimable_voters_reward_amount(
|
386
434
|
self,
|
387
435
|
ual: UAL,
|
388
|
-
incentives_type: ParanetIncentivizationType =
|
436
|
+
incentives_type: ParanetIncentivizationType | None = None,
|
389
437
|
) -> int:
|
438
|
+
incentives_type = incentives_type or (
|
439
|
+
ParanetIncentivizationType.NEUROWEB.value
|
440
|
+
if NEUROWEB_BLOCKCHAIN_PREFIX in ual
|
441
|
+
else ParanetIncentivizationType.NEUROWEB_ERC20.value
|
442
|
+
)
|
443
|
+
|
390
444
|
return self._get_claimable_all_proposal_voters_reward_amount(
|
391
445
|
contract=self._get_incentives_pool_contract(ual, incentives_type)
|
392
446
|
)
|
@@ -398,8 +452,14 @@ class Paranet(Module):
|
|
398
452
|
def claim_voter_reward(
|
399
453
|
self,
|
400
454
|
ual: UAL,
|
401
|
-
incentives_type: ParanetIncentivizationType =
|
455
|
+
incentives_type: ParanetIncentivizationType | None = None,
|
402
456
|
) -> dict[str, str | HexStr | TxReceipt]:
|
457
|
+
incentives_type = incentives_type or (
|
458
|
+
ParanetIncentivizationType.NEUROWEB.value
|
459
|
+
if NEUROWEB_BLOCKCHAIN_PREFIX in ual
|
460
|
+
else ParanetIncentivizationType.NEUROWEB_ERC20.value
|
461
|
+
)
|
462
|
+
|
403
463
|
receipt: TxReceipt = self._claim_incentivization_proposal_voter_reward(
|
404
464
|
contract=self._get_incentives_pool_contract(ual, incentives_type)
|
405
465
|
)
|
@@ -457,11 +517,9 @@ class Paranet(Module):
|
|
457
517
|
}
|
458
518
|
|
459
519
|
def _get_incentives_pool_contract(
|
460
|
-
self,
|
461
|
-
ual: UAL,
|
462
|
-
incentives_type: ParanetIncentivizationType = ParanetIncentivizationType.NEUROWEB,
|
520
|
+
self, ual: UAL, incentives_type: ParanetIncentivizationType
|
463
521
|
) -> str | dict[str, str]:
|
464
|
-
incentives_pool_name =
|
522
|
+
incentives_pool_name = INCENTIVE_POOL_NAME
|
465
523
|
is_incentives_pool_cached = (
|
466
524
|
incentives_pool_name in self.manager.blockchain_provider.contracts.keys()
|
467
525
|
)
|
@@ -25,9 +25,18 @@ from requests.exceptions import HTTPError, ConnectionError, Timeout, RequestExce
|
|
25
25
|
|
26
26
|
|
27
27
|
class NodeHTTPProvider:
|
28
|
-
def __init__(
|
28
|
+
def __init__(
|
29
|
+
self,
|
30
|
+
endpoint_uri: URI | str,
|
31
|
+
auth_token: str | None = None,
|
32
|
+
api_version: str = "v0",
|
33
|
+
):
|
29
34
|
self.endpoint_uri = URI(endpoint_uri)
|
30
35
|
self.auth_token = auth_token
|
36
|
+
self.api_version = api_version
|
37
|
+
|
38
|
+
def get_full_url(self, path: str) -> str:
|
39
|
+
return f"{self.endpoint_uri}/{self.api_version}/{path}"
|
31
40
|
|
32
41
|
def make_request(
|
33
42
|
self,
|
@@ -36,7 +45,7 @@ class NodeHTTPProvider:
|
|
36
45
|
params: dict[str, Any] = {},
|
37
46
|
data: dict[str, Any] = {},
|
38
47
|
) -> NodeResponseDict:
|
39
|
-
url =
|
48
|
+
url = self.get_full_url(path)
|
40
49
|
headers = (
|
41
50
|
{"Authorization": f"Bearer {self.auth_token}"} if self.auth_token else {}
|
42
51
|
)
|
@@ -70,7 +70,7 @@ class BlockchainRequest:
|
|
70
70
|
allowance = ContractCall(
|
71
71
|
contract="Token",
|
72
72
|
function="allowance",
|
73
|
-
args={"owner": Address, "spender": Address}
|
73
|
+
args={"owner": Address, "spender": Address},
|
74
74
|
)
|
75
75
|
increase_allowance = ContractTransaction(
|
76
76
|
contract="Token",
|
@@ -225,6 +225,7 @@ class BlockchainRequest:
|
|
225
225
|
contract="ParanetIncentivesPoolFactory",
|
226
226
|
function="deployNeuroIncentivesPool",
|
227
227
|
args={
|
228
|
+
"isNativeReward": bool,
|
228
229
|
"paranetKAStorageContract": Address,
|
229
230
|
"paranetKATokenId": int,
|
230
231
|
"tracToNeuroEmissionMultiplier": float,
|
{dkg-1.1.1 → dkg-1.1.2}/LICENSE
RENAMED
File without changes
|
{dkg-1.1.1 → dkg-1.1.2}/NOTICE
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|