-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
943ae13
commit 4ccb08f
Showing
5 changed files
with
36 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from clients.rpc import RpcClient | ||
|
||
|
||
class Service: | ||
def __init__(self, client: RpcClient, name: str): | ||
assert name is not "" | ||
self.rpc_client = client | ||
self.name = name | ||
|
||
def rpc_request(self, method: str, params=None): | ||
full_method_name = f"{self.name}_{method}" | ||
return self.rpc_client.rpc_request(full_method_name, params) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from clients.rpc import RpcClient | ||
from clients.services.service import Service | ||
|
||
|
||
class WalletService(Service): | ||
def __init__(self, client: RpcClient): | ||
super().__init__(client, "wallet") | ||
|
||
def get_balances_at_by_chain(self, chains: list, addresses: list, tokens: list): | ||
params = [chains, addresses, tokens] | ||
return self.rpc_request("getBalancesByChain", params) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters