olas-operate-middleware 0.10.20__tar.gz → 0.11.0__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.
Files changed (100) hide show
  1. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/PKG-INFO +3 -1
  2. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/bridge/bridge_manager.py +10 -12
  3. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/bridge/providers/native_bridge_provider.py +1 -1
  4. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/bridge/providers/provider.py +21 -34
  5. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/cli.py +438 -108
  6. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/constants.py +20 -0
  7. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/ledger/__init__.py +55 -5
  8. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/ledger/profiles.py +79 -11
  9. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/operate_types.py +205 -2
  10. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/quickstart/run_service.py +1 -1
  11. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/services/agent_runner.py +5 -3
  12. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/services/deployment_runner.py +3 -0
  13. olas_operate_middleware-0.11.0/operate/services/funding_manager.py +904 -0
  14. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/services/manage.py +165 -306
  15. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/services/protocol.py +392 -140
  16. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/services/service.py +81 -5
  17. olas_operate_middleware-0.11.0/operate/settings.py +70 -0
  18. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/utils/gnosis.py +79 -24
  19. olas_operate_middleware-0.11.0/operate/utils/single_instance.py +226 -0
  20. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/wallet/master.py +214 -177
  21. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/wallet/wallet_recovery_manager.py +5 -5
  22. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/pyproject.toml +3 -1
  23. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/LICENSE +0 -0
  24. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/README.md +0 -0
  25. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/__init__.py +0 -0
  26. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/account/__init__.py +0 -0
  27. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/account/user.py +0 -0
  28. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/bridge/providers/lifi_provider.py +0 -0
  29. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/bridge/providers/relay_provider.py +0 -0
  30. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/README.md +0 -0
  31. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/__init__.py +0 -0
  32. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/__init__.py +0 -0
  33. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/dual_staking_token/__init__.py +0 -0
  34. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/dual_staking_token/build/DualStakingToken.json +0 -0
  35. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/dual_staking_token/contract.py +0 -0
  36. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/dual_staking_token/contract.yaml +0 -0
  37. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/foreign_omnibridge/__init__.py +0 -0
  38. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/foreign_omnibridge/build/ForeignOmnibridge.json +0 -0
  39. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/foreign_omnibridge/contract.py +0 -0
  40. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/foreign_omnibridge/contract.yaml +0 -0
  41. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/home_omnibridge/__init__.py +0 -0
  42. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/home_omnibridge/build/HomeOmnibridge.json +0 -0
  43. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/home_omnibridge/contract.py +0 -0
  44. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/home_omnibridge/contract.yaml +0 -0
  45. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/l1_standard_bridge/__init__.py +0 -0
  46. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/l1_standard_bridge/build/L1StandardBridge.json +0 -0
  47. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/l1_standard_bridge/contract.py +0 -0
  48. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/l1_standard_bridge/contract.yaml +0 -0
  49. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/l2_standard_bridge/__init__.py +0 -0
  50. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/l2_standard_bridge/build/L2StandardBridge.json +0 -0
  51. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/l2_standard_bridge/contract.py +0 -0
  52. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/l2_standard_bridge/contract.yaml +0 -0
  53. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/mech_activity/__init__.py +0 -0
  54. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/mech_activity/build/MechActivity.json +0 -0
  55. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/mech_activity/contract.py +0 -0
  56. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/mech_activity/contract.yaml +0 -0
  57. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/optimism_mintable_erc20/__init__.py +0 -0
  58. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/optimism_mintable_erc20/build/OptimismMintableERC20.json +0 -0
  59. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/optimism_mintable_erc20/contract.py +0 -0
  60. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/optimism_mintable_erc20/contract.yaml +0 -0
  61. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/recovery_module/__init__.py +0 -0
  62. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/recovery_module/build/RecoveryModule.json +0 -0
  63. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/recovery_module/contract.py +0 -0
  64. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/recovery_module/contract.yaml +0 -0
  65. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/requester_activity_checker/__init__.py +0 -0
  66. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/requester_activity_checker/build/RequesterActivityChecker.json +0 -0
  67. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/requester_activity_checker/contract.py +0 -0
  68. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/requester_activity_checker/contract.yaml +0 -0
  69. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/staking_token/__init__.py +0 -0
  70. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/staking_token/build/StakingToken.json +0 -0
  71. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/staking_token/contract.py +0 -0
  72. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/staking_token/contract.yaml +0 -0
  73. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/uniswap_v2_erc20/__init__.py +0 -0
  74. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/uniswap_v2_erc20/build/IUniswapV2ERC20.json +0 -0
  75. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/uniswap_v2_erc20/contract.py +0 -0
  76. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/uniswap_v2_erc20/contract.yaml +0 -0
  77. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/uniswap_v2_erc20/tests/__init__.py +0 -0
  78. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/data/contracts/uniswap_v2_erc20/tests/test_contract.py +0 -0
  79. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/keys.py +0 -0
  80. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/migration.py +0 -0
  81. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/operate_http/__init__.py +0 -0
  82. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/operate_http/exceptions.py +0 -0
  83. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/pearl.py +0 -0
  84. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/quickstart/analyse_logs.py +0 -0
  85. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/quickstart/claim_staking_rewards.py +0 -0
  86. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/quickstart/reset_configs.py +0 -0
  87. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/quickstart/reset_password.py +0 -0
  88. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/quickstart/reset_staking.py +0 -0
  89. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/quickstart/stop_service.py +0 -0
  90. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/quickstart/terminate_on_chain_service.py +0 -0
  91. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/quickstart/utils.py +0 -0
  92. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/resource.py +0 -0
  93. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/services/__init__.py +0 -0
  94. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/services/health_checker.py +0 -0
  95. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/services/utils/__init__.py +0 -0
  96. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/services/utils/mech.py +0 -0
  97. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/services/utils/tendermint.py +0 -0
  98. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/utils/__init__.py +0 -0
  99. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/utils/ssl.py +0 -0
  100. {olas_operate_middleware-0.10.20 → olas_operate_middleware-0.11.0}/operate/wallet/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: olas-operate-middleware
3
- Version: 0.10.20
3
+ Version: 0.11.0
4
4
  Summary:
5
5
  License-File: LICENSE
6
6
  Author: David Vilela
@@ -30,6 +30,7 @@ Requires-Dist: halo (==0.0.31)
30
30
  Requires-Dist: hexbytes (==0.3.1)
31
31
  Requires-Dist: ipfshttpclient (==0.8.0a2)
32
32
  Requires-Dist: jsonschema (==4.3.3)
33
+ Requires-Dist: multiaddr (==0.0.9)
33
34
  Requires-Dist: multidict (==6.0.5)
34
35
  Requires-Dist: open-aea-cli-ipfs (==1.65.0)
35
36
  Requires-Dist: open-aea-ledger-cosmos (==1.65.0)
@@ -38,6 +39,7 @@ Requires-Dist: open-aea-ledger-ethereum-flashbots (==1.65.0)
38
39
  Requires-Dist: open-autonomy (>=0.20.2,<0.21.0)
39
40
  Requires-Dist: psutil (>=5.9.8,<6.0.0)
40
41
  Requires-Dist: pyinstaller (>=6.8.0,<7.0.0)
42
+ Requires-Dist: requests-mock (>=1.12.1,<2.0.0)
41
43
  Requires-Dist: requests-toolbelt (==1.0.0)
42
44
  Requires-Dist: starlette (==0.37.2)
43
45
  Requires-Dist: twikit (==2.2.0)
@@ -42,10 +42,9 @@ from operate.bridge.providers.provider import Provider, ProviderRequest
42
42
  from operate.bridge.providers.relay_provider import RelayProvider
43
43
  from operate.constants import ZERO_ADDRESS
44
44
  from operate.ledger.profiles import USDC
45
- from operate.operate_types import Chain
45
+ from operate.operate_types import Chain, ChainAmounts
46
46
  from operate.resource import LocalResource
47
47
  from operate.services.manage import get_assets_balances
48
- from operate.utils import merge_sum_dicts, subtract_dicts
49
48
  from operate.wallet.master import MasterWalletManager
50
49
 
51
50
 
@@ -187,13 +186,13 @@ class BridgeManager:
187
186
  path: Path,
188
187
  wallet_manager: MasterWalletManager,
189
188
  logger: logging.Logger,
190
- quote_validity_period: int = DEFAULT_BUNDLE_VALIDITY_PERIOD,
189
+ bundle_validity_period: int = DEFAULT_BUNDLE_VALIDITY_PERIOD,
191
190
  ) -> None:
192
191
  """Initialize bridge manager."""
193
192
  self.path = path
194
193
  self.wallet_manager = wallet_manager
195
194
  self.logger = logger
196
- self.quote_validity_period = quote_validity_period
195
+ self.bundle_validity_period = bundle_validity_period
197
196
  self.path.mkdir(exist_ok=True)
198
197
  (self.path / EXECUTED_BUNDLES_PATH).mkdir(exist_ok=True)
199
198
  self.data: BridgeManagerData = cast(
@@ -251,7 +250,7 @@ class BridgeManager:
251
250
  self.logger.info("[BRIDGE MANAGER] Force bundle update.")
252
251
  self.quote_bundle(bundle)
253
252
  self._store_data()
254
- elif now > bundle.timestamp + self.quote_validity_period:
253
+ elif now > bundle.timestamp + self.bundle_validity_period:
255
254
  self.logger.info("[BRIDGE MANAGER] Bundle expired.")
256
255
  self.quote_bundle(bundle)
257
256
  self._store_data()
@@ -335,7 +334,7 @@ class BridgeManager:
335
334
 
336
335
  bundle = self._get_updated_bundle(requests_params, force_update)
337
336
 
338
- balances = {}
337
+ balances = ChainAmounts()
339
338
  for chain in bundle.get_from_chains():
340
339
  ledger_api = self.wallet_manager.load(chain.ledger_type).ledger_api(chain)
341
340
  balances[chain.value] = get_assets_balances(
@@ -346,9 +345,8 @@ class BridgeManager:
346
345
 
347
346
  bridge_total_requirements = self.bridge_total_requirements(bundle)
348
347
 
349
- bridge_refill_requirements = cast(
350
- t.Dict[str, t.Dict[str, t.Dict[str, int]]],
351
- subtract_dicts(bridge_total_requirements, balances),
348
+ bridge_refill_requirements = ChainAmounts.shortfalls(
349
+ bridge_total_requirements, balances
352
350
  )
353
351
 
354
352
  is_refill_required = any(
@@ -364,7 +362,7 @@ class BridgeManager:
364
362
  "balances": balances,
365
363
  "bridge_refill_requirements": bridge_refill_requirements,
366
364
  "bridge_total_requirements": bridge_total_requirements,
367
- "expiration_timestamp": bundle.timestamp + self.quote_validity_period,
365
+ "expiration_timestamp": bundle.timestamp + self.bundle_validity_period,
368
366
  "is_refill_required": is_refill_required,
369
367
  }
370
368
  )
@@ -441,14 +439,14 @@ class BridgeManager:
441
439
  "bridge_request_status": provider_request_status,
442
440
  }
443
441
 
444
- def bridge_total_requirements(self, bundle: ProviderRequestBundle) -> t.Dict:
442
+ def bridge_total_requirements(self, bundle: ProviderRequestBundle) -> ChainAmounts:
445
443
  """Sum bridge requirements."""
446
444
  requirements = []
447
445
  for provider_request in bundle.provider_requests:
448
446
  provider = self._providers[provider_request.provider_id]
449
447
  requirements.append(provider.requirements(provider_request))
450
448
 
451
- return merge_sum_dicts(*requirements)
449
+ return ChainAmounts.add(*requirements)
452
450
 
453
451
  def quote_bundle(self, bundle: ProviderRequestBundle) -> None:
454
452
  """Update the bundle with the quotes."""
@@ -97,7 +97,7 @@ class BridgeContractAdaptor(ABC):
97
97
  if from_token == ZERO_ADDRESS and to_token == ZERO_ADDRESS:
98
98
  return True
99
99
 
100
- for token_map in ERC20_TOKENS:
100
+ for token_map in ERC20_TOKENS.values():
101
101
  if (
102
102
  Chain(from_chain) in token_map
103
103
  and Chain(to_chain) in token_map
@@ -32,7 +32,6 @@ from dataclasses import dataclass
32
32
  from aea.crypto.base import LedgerApi
33
33
  from autonomy.chain.tx import TxSettler
34
34
  from web3 import Web3
35
- from web3.middleware import geth_poa_middleware
36
35
 
37
36
  from operate.constants import (
38
37
  ON_CHAIN_INTERACT_RETRIES,
@@ -40,8 +39,8 @@ from operate.constants import (
40
39
  ON_CHAIN_INTERACT_TIMEOUT,
41
40
  ZERO_ADDRESS,
42
41
  )
43
- from operate.ledger import update_tx_with_gas_pricing
44
- from operate.operate_types import Chain
42
+ from operate.ledger import get_default_ledger_api, update_tx_with_gas_pricing
43
+ from operate.operate_types import Chain, ChainAmounts
45
44
  from operate.resource import LocalResource
46
45
  from operate.wallet.master import MasterWalletManager
47
46
 
@@ -218,28 +217,12 @@ class Provider(ABC):
218
217
  def _from_ledger_api(self, provider_request: ProviderRequest) -> LedgerApi:
219
218
  """Get the from ledger api."""
220
219
  from_chain = provider_request.params["from"]["chain"]
221
- chain = Chain(from_chain)
222
- wallet = self.wallet_manager.load(chain.ledger_type)
223
- ledger_api = wallet.ledger_api(chain)
224
-
225
- # TODO: Backport to open aea/autonomy
226
- if chain == Chain.OPTIMISM:
227
- ledger_api.api.middleware_onion.inject(geth_poa_middleware, layer=0)
228
-
229
- return ledger_api
220
+ return get_default_ledger_api(Chain(from_chain))
230
221
 
231
222
  def _to_ledger_api(self, provider_request: ProviderRequest) -> LedgerApi:
232
223
  """Get the from ledger api."""
233
- from_chain = provider_request.params["to"]["chain"]
234
- chain = Chain(from_chain)
235
- wallet = self.wallet_manager.load(chain.ledger_type)
236
- ledger_api = wallet.ledger_api(chain)
237
-
238
- # TODO: Backport to open aea/autonomy
239
- if chain == Chain.OPTIMISM:
240
- ledger_api.api.middleware_onion.inject(geth_poa_middleware, layer=0)
241
-
242
- return ledger_api
224
+ to_chain = provider_request.params["to"]["chain"]
225
+ return get_default_ledger_api(Chain(to_chain))
243
226
 
244
227
  @abstractmethod
245
228
  def quote(self, provider_request: ProviderRequest) -> None:
@@ -253,7 +236,7 @@ class Provider(ABC):
253
236
  """Get the sorted list of transactions to execute the quote."""
254
237
  raise NotImplementedError()
255
238
 
256
- def requirements(self, provider_request: ProviderRequest) -> t.Dict:
239
+ def requirements(self, provider_request: ProviderRequest) -> ChainAmounts:
257
240
  """Gets the requirements to execute the quote, with updated gas estimation."""
258
241
  self.logger.info(f"[PROVIDER] Requirements for request {provider_request.id}.")
259
242
 
@@ -267,14 +250,16 @@ class Provider(ABC):
267
250
  txs = self._get_txs(provider_request)
268
251
 
269
252
  if not txs:
270
- return {
271
- from_chain: {
272
- from_address: {
273
- ZERO_ADDRESS: 0,
274
- from_token: 0,
253
+ return ChainAmounts(
254
+ {
255
+ from_chain: {
256
+ from_address: {
257
+ ZERO_ADDRESS: 0,
258
+ from_token: 0,
259
+ }
275
260
  }
276
261
  }
277
- }
262
+ )
278
263
 
279
264
  total_native = 0
280
265
  total_gas_fees = 0
@@ -312,13 +297,15 @@ class Provider(ABC):
312
297
  f"[PROVIDER] Total gas fees for request {provider_request.id}: {total_gas_fees} native units."
313
298
  )
314
299
 
315
- result = {
316
- from_chain: {
317
- from_address: {
318
- ZERO_ADDRESS: total_native,
300
+ result = ChainAmounts(
301
+ {
302
+ from_chain: {
303
+ from_address: {
304
+ ZERO_ADDRESS: total_native,
305
+ }
319
306
  }
320
307
  }
321
- }
308
+ )
322
309
 
323
310
  if from_token != ZERO_ADDRESS:
324
311
  result[from_chain][from_address][from_token] = total_token