mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-29 05:21:48 +00:00
fix forex load and add crypto load
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
from datetime import date, datetime
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import Field, PositiveFloat
|
||||
from pydantic import Field, NonNegativeFloat, PositiveFloat
|
||||
|
||||
from openbb_provider.metadata import DESCRIPTIONS
|
||||
from openbb_provider.model.abstract.data import Data, QueryParams
|
||||
@@ -57,4 +57,4 @@ class ForexEODData(Data):
|
||||
low: PositiveFloat
|
||||
close: PositiveFloat
|
||||
adj_close: Optional[PositiveFloat]
|
||||
volume: PositiveFloat
|
||||
volume: NonNegativeFloat
|
||||
|
||||
@@ -1,11 +1,23 @@
|
||||
from openbb_sdk_core.app.model.command_context import CommandContext
|
||||
from openbb_sdk_core.app.model.command_output import CommandOutput
|
||||
from openbb_sdk_core.app.model.results.empty import Empty
|
||||
from openbb_sdk_core.app.provider_interface import (
|
||||
ExtraParams,
|
||||
ProviderChoices,
|
||||
StandardParams,
|
||||
)
|
||||
from openbb_sdk_core.app.query import Query
|
||||
from openbb_sdk_core.app.router import Router
|
||||
|
||||
router = Router(prefix="")
|
||||
|
||||
|
||||
@router.command
|
||||
def load() -> CommandOutput[Empty]: # type: ignore
|
||||
@router.command(query="CryptoEOD")
|
||||
def load(
|
||||
cc: CommandContext,
|
||||
provider_choices: ProviderChoices,
|
||||
standard_params: StandardParams,
|
||||
extra_params: ExtraParams,
|
||||
) -> CommandOutput[Empty]: # type: ignore
|
||||
"""Crypto Intraday Price."""
|
||||
return CommandOutput(results=Empty())
|
||||
return CommandOutput(results=Query(**locals()).execute())
|
||||
|
||||
@@ -12,7 +12,7 @@ from openbb_sdk_core.app.router import Router
|
||||
router = Router(prefix="")
|
||||
|
||||
|
||||
@router.command(query="ForexPrice")
|
||||
@router.command(query="ForexEOD")
|
||||
def load(
|
||||
cc: CommandContext,
|
||||
provider_choices: ProviderChoices,
|
||||
|
||||
Reference in New Issue
Block a user