feat: add wallets balance
This commit is contained in:
@@ -4,6 +4,7 @@ from src.application.commands import (
|
||||
GetOrganizationCommand,
|
||||
GetOrganizationMnemonicCommand,
|
||||
GetOrganizationSecretKeysCommand,
|
||||
GetOrganizationWalletBalancesCommand,
|
||||
ListOrganizationWalletsCommand,
|
||||
)
|
||||
from src.application.domain.dto import AuthContext
|
||||
@@ -12,18 +13,21 @@ from src.presentation.dependencies.commands import (
|
||||
get_get_organization_command,
|
||||
get_get_organization_mnemonic_command,
|
||||
get_get_organization_secret_keys_command,
|
||||
get_get_organization_wallet_balances_command,
|
||||
get_list_organization_wallets_command,
|
||||
)
|
||||
from src.presentation.schemas.organization import (
|
||||
MnemonicResponse,
|
||||
OrganizationResponse,
|
||||
SecretKeyResponse,
|
||||
WalletBalancesResponse,
|
||||
WalletResponse,
|
||||
)
|
||||
from src.presentation.serializers.organization import (
|
||||
mnemonic_to_response,
|
||||
organization_to_response,
|
||||
secret_key_to_response,
|
||||
wallet_balances_to_response,
|
||||
wallet_to_response,
|
||||
)
|
||||
|
||||
@@ -48,6 +52,15 @@ async def list_organization_wallets(
|
||||
return [wallet_to_response(w) for w in wallets]
|
||||
|
||||
|
||||
@organizations_router.get('/wallets/balances', response_model=WalletBalancesResponse)
|
||||
async def get_organization_wallet_balances(
|
||||
auth: AuthContext = Depends(require_access_token),
|
||||
command: GetOrganizationWalletBalancesCommand = Depends(get_get_organization_wallet_balances_command),
|
||||
):
|
||||
balances = await command(auth.user_id)
|
||||
return wallet_balances_to_response(balances)
|
||||
|
||||
|
||||
@organizations_router.get('/wallets/mnemonic', response_model=MnemonicResponse)
|
||||
async def get_organization_mnemonic(
|
||||
auth: AuthContext = Depends(require_access_token),
|
||||
|
||||
Reference in New Issue
Block a user