"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from openrouter.components import createchargerequest as components_createchargerequest
from openrouter.types import BaseModel
from openrouter.utils import (
    FieldMetadata,
    HeaderMetadata,
    RequestMetadata,
    SecurityMetadata,
)
import pydantic
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class CreateCoinbaseChargeGlobalsTypedDict(TypedDict):
    http_referer: NotRequired[str]
    r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
    This is used to track API usage per application.

    """
    x_title: NotRequired[str]
    r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.

    """


class CreateCoinbaseChargeGlobals(BaseModel):
    http_referer: Annotated[
        Optional[str],
        pydantic.Field(alias="HTTP-Referer"),
        FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
    ] = None
    r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
    This is used to track API usage per application.

    """

    x_title: Annotated[
        Optional[str],
        pydantic.Field(alias="X-Title"),
        FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
    ] = None
    r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.

    """


class CreateCoinbaseChargeSecurityTypedDict(TypedDict):
    bearer: str


class CreateCoinbaseChargeSecurity(BaseModel):
    bearer: Annotated[
        str,
        FieldMetadata(
            security=SecurityMetadata(
                scheme=True,
                scheme_type="http",
                sub_type="bearer",
                field_name="Authorization",
            )
        ),
    ]


class CreateCoinbaseChargeRequestTypedDict(TypedDict):
    create_charge_request: components_createchargerequest.CreateChargeRequestTypedDict
    http_referer: NotRequired[str]
    r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
    This is used to track API usage per application.

    """
    x_title: NotRequired[str]
    r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.

    """


class CreateCoinbaseChargeRequest(BaseModel):
    create_charge_request: Annotated[
        components_createchargerequest.CreateChargeRequest,
        FieldMetadata(request=RequestMetadata(media_type="application/json")),
    ]

    http_referer: Annotated[
        Optional[str],
        pydantic.Field(alias="HTTP-Referer"),
        FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
    ] = None
    r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
    This is used to track API usage per application.

    """

    x_title: Annotated[
        Optional[str],
        pydantic.Field(alias="X-Title"),
        FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
    ] = None
    r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard.

    """


class CallDataTypedDict(TypedDict):
    deadline: str
    fee_amount: str
    id: str
    operator: str
    prefix: str
    recipient: str
    recipient_amount: str
    recipient_currency: str
    refund_destination: str
    signature: str


class CallData(BaseModel):
    deadline: str

    fee_amount: str

    id: str

    operator: str

    prefix: str

    recipient: str

    recipient_amount: str

    recipient_currency: str

    refund_destination: str

    signature: str


class MetadataTypedDict(TypedDict):
    chain_id: float
    contract_address: str
    sender: str


class Metadata(BaseModel):
    chain_id: float

    contract_address: str

    sender: str


class TransferIntentTypedDict(TypedDict):
    call_data: CallDataTypedDict
    metadata: MetadataTypedDict


class TransferIntent(BaseModel):
    call_data: CallData

    metadata: Metadata


class Web3DataTypedDict(TypedDict):
    transfer_intent: TransferIntentTypedDict


class Web3Data(BaseModel):
    transfer_intent: TransferIntent


class CreateCoinbaseChargeDataTypedDict(TypedDict):
    id: str
    created_at: str
    expires_at: str
    web3_data: Web3DataTypedDict


class CreateCoinbaseChargeData(BaseModel):
    id: str

    created_at: str

    expires_at: str

    web3_data: Web3Data


class CreateCoinbaseChargeResponseTypedDict(TypedDict):
    r"""Returns the calldata to fulfill the transaction"""

    data: CreateCoinbaseChargeDataTypedDict


class CreateCoinbaseChargeResponse(BaseModel):
    r"""Returns the calldata to fulfill the transaction"""

    data: CreateCoinbaseChargeData
