Skip to content

Commit

Permalink
fix: automatic api update (#59)
Browse files Browse the repository at this point in the history
Co-authored-by: ErnoW <[email protected]>
  • Loading branch information
github-actions[bot] and ErnoW authored Jul 26, 2024
1 parent ecb84e2 commit dbb086f
Show file tree
Hide file tree
Showing 46 changed files with 1,521 additions and 105 deletions.
8 changes: 6 additions & 2 deletions docs/evm_api/token.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ api_key = "YOUR_API_KEY"
params = {
"chain": "eth",
"include": "",
"max_token_inactivity": 1.2,
}
body = {
"tokens": [{'token_address': '0xdac17f958d2ee523a2206206994597c13d831ec7'}, {'token_address': '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'}, {'token_address': '0xae7ab96520de3a18e5e111b5eaab095312d7fe84', 'exchange': 'uniswapv2', 'to_block': '16314545'}, {'token_address': '0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0'}],
Expand All @@ -52,6 +53,7 @@ print(result)
|------|------|-------------|----------|---------|---------|
| chain | enum[str]: <br/>- "eth"<br/>- "0x1"<br/>- "sepolia"<br/>- "0xaa36a7"<br/>- "polygon"<br/>- "0x89"<br/>- "bsc"<br/>- "0x38"<br/>- "bsc testnet"<br/>- "0x61"<br/>- "avalanche"<br/>- "0xa86a"<br/>- "fantom"<br/>- "0xfa"<br/>- "palm"<br/>- "0x2a15c308d"<br/>- "cronos"<br/>- "0x19"<br/>- "arbitrum"<br/>- "0xa4b1"<br/>- "chiliz"<br/>- "0x15b38"<br/>- "chiliz testnet"<br/>- "0x15b32"<br/>- "gnosis"<br/>- "0x64"<br/>- "gnosis testnet"<br/>- "0x27d8"<br/>- "base"<br/>- "0x2105"<br/>- "base sepolia"<br/>- "0x14a34"<br/>- "optimism"<br/>- "0xa"<br/>- "holesky"<br/>- "0x4268"<br/>- "polygon amoy"<br/>- "0x13882"<br/>- "linea"<br/>- "0xe708"<br/>- "moonbeam"<br/>- "0x504"<br/>- "moonriver"<br/>- "0x505"<br/>- "moonbase"<br/>- "0x507"<br/>- "linea sepolia"<br/>- "0xe705" | The chain to query | | "eth" | "eth" |
| include | enum[str]: <br/>- "percent_change" | If the result should contain the 24hr percent change | | "" | "" |
| max_token_inactivity | float | Exclude tokens inactive for more than the given amount of days | | | 1.2 |


### Body
Expand Down Expand Up @@ -235,6 +237,7 @@ params = {
"exchange": "",
"to_block": 0,
"include": "",
"max_token_inactivity": 1.2,
}

result = evm_api.token.get_token_price(
Expand All @@ -255,6 +258,7 @@ print(result)
| exchange | str | The factory name or address of the token exchange | | | "" |
| to_block | int | The block number from which the token price should be checked | | | 0 |
| include | enum[str]: <br/>- "percent_change" | If the result should contain the 24hr percent change | | "" | "" |
| max_token_inactivity | float | Exclude tokens inactive for more than the given amount of days | | | 1.2 |



Expand Down Expand Up @@ -377,8 +381,8 @@ print(result)
| Name | Type | Description | Required | Default | Example |
|------|------|-------------|----------|---------|---------|
| address | str | The ERC20 token address. | Yes | | "" |
| days | str | Timeframe in days for which profitability is calculated, can be 'all', '7d' or '30d' | | | "" |
| chain | enum[str]: <br/>- "eth"<br/>- "mainnet"<br/>- "0x1"<br/>- "matic"<br/>- "0x89"<br/>- "polygon"<br/>- "bsc"<br/>- "binance"<br/>- "0x38"<br/>- "fantom"<br/>- "ftm"<br/>- "0xfa"<br/>- "arbitrum"<br/>- "0xa4b1"<br/>- "optimism"<br/>- "0xa"<br/>- "pulsechain"<br/>- "0x171"<br/>- "base"<br/>- "0x2105" | The chain to query | | | "eth" |
| days | str | Timeframe in days for which profitability is calculated, Options include 'all', '7', '30', '60', '90' default is 'all'. | | | "" |
| chain | enum[str]: <br/>- "eth"<br/>- "mainnet"<br/>- "0x1"<br/>- "matic"<br/>- "0x89"<br/>- "polygon"<br/>- "bsc"<br/>- "binance"<br/>- "0x38"<br/>- "fantom"<br/>- "ftm"<br/>- "0xfa"<br/>- "arbitrum"<br/>- "0xa4b1"<br/>- "optimism"<br/>- "0xa"<br/>- "pulsechain"<br/>- "0x171"<br/>- "base"<br/>- "0x2105"<br/>- "linea"<br/>- "0xe708" | The chain to query | | | "eth" |



Expand Down
12 changes: 7 additions & 5 deletions docs/evm_api/wallets.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ print(result)
| Name | Type | Description | Required | Default | Example |
|------|------|-------------|----------|---------|---------|
| address | str | Wallet address | Yes | | "" |
| protocol | enum[str]: <br/>- "uniswap-v2"<br/>- "uniswap-v3"<br/>- "pancakeswap-v2"<br/>- "pancakeswap-v3"<br/>- "quickswap-v2"<br/>- "sushiswap-v2"<br/>- "aave-v2"<br/>- "aave-v3"<br/>- "fraxswap-v1"<br/>- "fraxswap-v2"<br/>- "lido"<br/>- "makerdao"<br/>- "eigenlayer" | The protocol to query | Yes | "uniswap-v3" | "uniswap-v3" |
| protocol | enum[str]: <br/>- "uniswap-v2"<br/>- "uniswap-v3"<br/>- "pancakeswap-v2"<br/>- "pancakeswap-v3"<br/>- "quickswap-v2"<br/>- "sushiswap-v2"<br/>- "aave-v2"<br/>- "aave-v3"<br/>- "fraxswap-v1"<br/>- "fraxswap-v2"<br/>- "lido"<br/>- "makerdao"<br/>- "eigenlayer"<br/>- "pendle"<br/>- "etherfi"<br/>- "rocketpool"<br/>- "sparkfi" | The protocol to query | Yes | "uniswap-v3" | "uniswap-v3" |
| chain | enum[str]: <br/>- "eth"<br/>- "0x1"<br/>- "sepolia"<br/>- "0xaa36a7"<br/>- "polygon"<br/>- "0x89"<br/>- "bsc"<br/>- "0x38"<br/>- "bsc testnet"<br/>- "0x61"<br/>- "avalanche"<br/>- "0xa86a"<br/>- "fantom"<br/>- "0xfa"<br/>- "palm"<br/>- "0x2a15c308d"<br/>- "cronos"<br/>- "0x19"<br/>- "arbitrum"<br/>- "0xa4b1"<br/>- "chiliz"<br/>- "0x15b38"<br/>- "chiliz testnet"<br/>- "0x15b32"<br/>- "gnosis"<br/>- "0x64"<br/>- "gnosis testnet"<br/>- "0x27d8"<br/>- "base"<br/>- "0x2105"<br/>- "base sepolia"<br/>- "0x14a34"<br/>- "optimism"<br/>- "0xa"<br/>- "holesky"<br/>- "0x4268"<br/>- "polygon amoy"<br/>- "0x13882"<br/>- "linea"<br/>- "0xe708"<br/>- "moonbeam"<br/>- "0x504"<br/>- "moonriver"<br/>- "0x505"<br/>- "moonbase"<br/>- "0x507"<br/>- "linea sepolia"<br/>- "0xe705" | The chain to query | | "eth" | "eth" |


Expand Down Expand Up @@ -182,7 +182,6 @@ params = {
"to_date": "",
"include_internal_transactions": True,
"include_input_data": True,
"include_logs_data": True,
"nft_metadata": True,
"cursor": "",
"order": "DESC",
Expand Down Expand Up @@ -210,7 +209,6 @@ print(result)
| to_date | str | Get the transactions up to this date (format in seconds or datestring accepted by momentjs)<br/>* Provide the param 'to_block' or 'to_date'<br/>* If 'to_date' and 'to_block' are provided, 'to_block' will be used.<br/> | | | "" |
| include_internal_transactions | bool | If the result should contain the internal transactions. | | | True |
| include_input_data | bool | Set the input data from the result | | False | True |
| include_logs_data | bool | Set the logs data from the result | | False | True |
| nft_metadata | bool | If the result should contain the nft metadata. | | | True |
| cursor | str | The cursor returned in the previous response (used for getting the next page). | | | "" |
| order | enum[str]: <br/>- "ASC"<br/>- "DESC" | The order of the result, in ascending (ASC) or descending (DESC) | | "DESC" | "DESC" |
Expand All @@ -236,6 +234,7 @@ params = {
"chains": [],
"exclude_spam": True,
"exclude_unverified_contracts": True,
"max_token_inactivity": 1.2,
}

result = evm_api.wallets.get_wallet_net_worth(
Expand All @@ -255,6 +254,7 @@ print(result)
| chains | List of enum[str]: <br/>- "eth"<br/>- "0x1"<br/>- "sepolia"<br/>- "0xaa36a7"<br/>- "polygon"<br/>- "0x89"<br/>- "bsc"<br/>- "0x38"<br/>- "bsc testnet"<br/>- "0x61"<br/>- "avalanche"<br/>- "0xa86a"<br/>- "fantom"<br/>- "0xfa"<br/>- "palm"<br/>- "0x2a15c308d"<br/>- "cronos"<br/>- "0x19"<br/>- "arbitrum"<br/>- "0xa4b1"<br/>- "chiliz"<br/>- "0x15b38"<br/>- "chiliz testnet"<br/>- "0x15b32"<br/>- "gnosis"<br/>- "0x64"<br/>- "gnosis testnet"<br/>- "0x27d8"<br/>- "base"<br/>- "0x2105"<br/>- "base sepolia"<br/>- "0x14a34"<br/>- "optimism"<br/>- "0xa"<br/>- "holesky"<br/>- "0x4268"<br/>- "polygon amoy"<br/>- "0x13882"<br/>- "linea"<br/>- "0xe708"<br/>- "moonbeam"<br/>- "0x504"<br/>- "moonriver"<br/>- "0x505"<br/>- "moonbase"<br/>- "0x507"<br/>- "linea sepolia"<br/>- "0xe705" | The chains to query | | | [] |
| exclude_spam | bool | Exclude spam tokens from the result | | False | True |
| exclude_unverified_contracts | bool | Exclude unverified contracts from the result | | False | True |
| max_token_inactivity | float | Exclude tokens inactive for more than the given amount of days | | | 1.2 |



Expand Down Expand Up @@ -293,7 +293,7 @@ print(result)
|------|------|-------------|----------|---------|---------|
| address | str | The wallet address for which profitability is to be retrieved. | Yes | | "" |
| days | str | Timeframe in days for which profitability is calculated, Options include 'all', '7', '30', '60', '90' default is 'all'. | | | "" |
| chain | enum[str]: <br/>- "eth"<br/>- "mainnet"<br/>- "0x1"<br/>- "matic"<br/>- "0x89"<br/>- "polygon"<br/>- "bsc"<br/>- "binance"<br/>- "0x38"<br/>- "fantom"<br/>- "ftm"<br/>- "0xfa"<br/>- "arbitrum"<br/>- "0xa4b1"<br/>- "optimism"<br/>- "0xa"<br/>- "pulsechain"<br/>- "0x171"<br/>- "base"<br/>- "0x2105" | The chain to query | | | "eth" |
| chain | enum[str]: <br/>- "eth"<br/>- "mainnet"<br/>- "0x1"<br/>- "matic"<br/>- "0x89"<br/>- "polygon"<br/>- "bsc"<br/>- "binance"<br/>- "0x38"<br/>- "fantom"<br/>- "ftm"<br/>- "0xfa"<br/>- "arbitrum"<br/>- "0xa4b1"<br/>- "optimism"<br/>- "0xa"<br/>- "pulsechain"<br/>- "0x171"<br/>- "base"<br/>- "0x2105"<br/>- "linea"<br/>- "0xe708" | The chain to query | | | "eth" |
| token_addresses | List of str | The token addresses list to filter the result with | | | [] |


Expand Down Expand Up @@ -332,7 +332,7 @@ print(result)
|------|------|-------------|----------|---------|---------|
| address | str | The wallet address for which profitability summary is to be retrieved. | Yes | | "" |
| days | str | Timeframe in days for the profitability summary. Options include 'all', '7', '30', '60', '90' default is 'all'. | | | "" |
| chain | enum[str]: <br/>- "eth"<br/>- "mainnet"<br/>- "0x1"<br/>- "matic"<br/>- "0x89"<br/>- "polygon"<br/>- "bsc"<br/>- "binance"<br/>- "0x38"<br/>- "fantom"<br/>- "ftm"<br/>- "0xfa"<br/>- "arbitrum"<br/>- "0xa4b1"<br/>- "optimism"<br/>- "0xa"<br/>- "pulsechain"<br/>- "0x171"<br/>- "base"<br/>- "0x2105" | The chain to query | | | "eth" |
| chain | enum[str]: <br/>- "eth"<br/>- "mainnet"<br/>- "0x1"<br/>- "matic"<br/>- "0x89"<br/>- "polygon"<br/>- "bsc"<br/>- "binance"<br/>- "0x38"<br/>- "fantom"<br/>- "ftm"<br/>- "0xfa"<br/>- "arbitrum"<br/>- "0xa4b1"<br/>- "optimism"<br/>- "0xa"<br/>- "pulsechain"<br/>- "0x171"<br/>- "base"<br/>- "0x2105"<br/>- "linea"<br/>- "0xe708" | The chain to query | | | "eth" |



Expand Down Expand Up @@ -395,6 +395,7 @@ params = {
"cursor": "",
"limit": 0,
"exclude_native": True,
"max_token_inactivity": 1.2,
}

result = evm_api.wallets.get_wallet_token_balances_price(
Expand All @@ -419,6 +420,7 @@ print(result)
| cursor | str | The cursor returned in the previous response (used for getting the next page). | | | "" |
| limit | int | The desired page size of the result. | | | 0 |
| exclude_native | bool | Exclude native balance from the result | | False | True |
| max_token_inactivity | float | Exclude tokens inactive for more than the given amount of days | | | 1.2 |



Expand Down
44 changes: 42 additions & 2 deletions src/openapi_evm_api/model/block_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ class properties:
block_timestamp = schemas.StrSchema
block_number = schemas.StrSchema
block_hash = schemas.StrSchema
from_address_entity = schemas.StrSchema
from_address_entity_logo = schemas.StrSchema


class from_address_label(
Expand All @@ -84,6 +86,8 @@ def __new__(
*args,
_configuration=_configuration,
)
to_address_entity = schemas.StrSchema
to_address_entity_logo = schemas.StrSchema


class to_address(
Expand Down Expand Up @@ -231,7 +235,11 @@ def __getitem__(self, i: int) -> 'InternalTransaction':
"block_timestamp": block_timestamp,
"block_number": block_number,
"block_hash": block_hash,
"from_address_entity": from_address_entity,
"from_address_entity_logo": from_address_entity_logo,
"from_address_label": from_address_label,
"to_address_entity": to_address_entity,
"to_address_entity_logo": to_address_entity_logo,
"to_address": to_address,
"to_address_label": to_address_label,
"gas": gas,
Expand Down Expand Up @@ -294,9 +302,21 @@ def __getitem__(self, name: typing_extensions.Literal["block_number"]) -> MetaOa
@typing.overload
def __getitem__(self, name: typing_extensions.Literal["block_hash"]) -> MetaOapg.properties.block_hash: ...

@typing.overload
def __getitem__(self, name: typing_extensions.Literal["from_address_entity"]) -> MetaOapg.properties.from_address_entity: ...

@typing.overload
def __getitem__(self, name: typing_extensions.Literal["from_address_entity_logo"]) -> MetaOapg.properties.from_address_entity_logo: ...

@typing.overload
def __getitem__(self, name: typing_extensions.Literal["from_address_label"]) -> MetaOapg.properties.from_address_label: ...

@typing.overload
def __getitem__(self, name: typing_extensions.Literal["to_address_entity"]) -> MetaOapg.properties.to_address_entity: ...

@typing.overload
def __getitem__(self, name: typing_extensions.Literal["to_address_entity_logo"]) -> MetaOapg.properties.to_address_entity_logo: ...

@typing.overload
def __getitem__(self, name: typing_extensions.Literal["to_address"]) -> MetaOapg.properties.to_address: ...

Expand All @@ -321,7 +341,7 @@ def __getitem__(self, name: typing_extensions.Literal["internal_transactions"])
@typing.overload
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...

def __getitem__(self, name: typing.Union[typing_extensions.Literal["hash", "nonce", "transaction_index", "from_address", "value", "gas_price", "input", "receipt_cumulative_gas_used", "receipt_gas_used", "receipt_status", "block_timestamp", "block_number", "block_hash", "from_address_label", "to_address", "to_address_label", "gas", "receipt_contract_address", "receipt_root", "logs", "internal_transactions", ], str]):
def __getitem__(self, name: typing.Union[typing_extensions.Literal["hash", "nonce", "transaction_index", "from_address", "value", "gas_price", "input", "receipt_cumulative_gas_used", "receipt_gas_used", "receipt_status", "block_timestamp", "block_number", "block_hash", "from_address_entity", "from_address_entity_logo", "from_address_label", "to_address_entity", "to_address_entity_logo", "to_address", "to_address_label", "gas", "receipt_contract_address", "receipt_root", "logs", "internal_transactions", ], str]):
# dict_instance[name] accessor
return super().__getitem__(name)

Expand Down Expand Up @@ -365,9 +385,21 @@ def get_item_oapg(self, name: typing_extensions.Literal["block_number"]) -> Meta
@typing.overload
def get_item_oapg(self, name: typing_extensions.Literal["block_hash"]) -> MetaOapg.properties.block_hash: ...

@typing.overload
def get_item_oapg(self, name: typing_extensions.Literal["from_address_entity"]) -> typing.Union[MetaOapg.properties.from_address_entity, schemas.Unset]: ...

@typing.overload
def get_item_oapg(self, name: typing_extensions.Literal["from_address_entity_logo"]) -> typing.Union[MetaOapg.properties.from_address_entity_logo, schemas.Unset]: ...

@typing.overload
def get_item_oapg(self, name: typing_extensions.Literal["from_address_label"]) -> typing.Union[MetaOapg.properties.from_address_label, schemas.Unset]: ...

@typing.overload
def get_item_oapg(self, name: typing_extensions.Literal["to_address_entity"]) -> typing.Union[MetaOapg.properties.to_address_entity, schemas.Unset]: ...

@typing.overload
def get_item_oapg(self, name: typing_extensions.Literal["to_address_entity_logo"]) -> typing.Union[MetaOapg.properties.to_address_entity_logo, schemas.Unset]: ...

@typing.overload
def get_item_oapg(self, name: typing_extensions.Literal["to_address"]) -> typing.Union[MetaOapg.properties.to_address, schemas.Unset]: ...

Expand All @@ -392,7 +424,7 @@ def get_item_oapg(self, name: typing_extensions.Literal["internal_transactions"]
@typing.overload
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...

def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["hash", "nonce", "transaction_index", "from_address", "value", "gas_price", "input", "receipt_cumulative_gas_used", "receipt_gas_used", "receipt_status", "block_timestamp", "block_number", "block_hash", "from_address_label", "to_address", "to_address_label", "gas", "receipt_contract_address", "receipt_root", "logs", "internal_transactions", ], str]):
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["hash", "nonce", "transaction_index", "from_address", "value", "gas_price", "input", "receipt_cumulative_gas_used", "receipt_gas_used", "receipt_status", "block_timestamp", "block_number", "block_hash", "from_address_entity", "from_address_entity_logo", "from_address_label", "to_address_entity", "to_address_entity_logo", "to_address", "to_address_label", "gas", "receipt_contract_address", "receipt_root", "logs", "internal_transactions", ], str]):
return super().get_item_oapg(name)


Expand All @@ -412,7 +444,11 @@ def __new__(
from_address: typing.Union[MetaOapg.properties.from_address, str, ],
value: typing.Union[MetaOapg.properties.value, str, ],
hash: typing.Union[MetaOapg.properties.hash, str, ],
from_address_entity: typing.Union[MetaOapg.properties.from_address_entity, str, schemas.Unset] = schemas.unset,
from_address_entity_logo: typing.Union[MetaOapg.properties.from_address_entity_logo, str, schemas.Unset] = schemas.unset,
from_address_label: typing.Union[MetaOapg.properties.from_address_label, None, str, schemas.Unset] = schemas.unset,
to_address_entity: typing.Union[MetaOapg.properties.to_address_entity, str, schemas.Unset] = schemas.unset,
to_address_entity_logo: typing.Union[MetaOapg.properties.to_address_entity_logo, str, schemas.Unset] = schemas.unset,
to_address: typing.Union[MetaOapg.properties.to_address, None, str, schemas.Unset] = schemas.unset,
to_address_label: typing.Union[MetaOapg.properties.to_address_label, None, str, schemas.Unset] = schemas.unset,
gas: typing.Union[MetaOapg.properties.gas, str, schemas.Unset] = schemas.unset,
Expand All @@ -439,7 +475,11 @@ def __new__(
from_address=from_address,
value=value,
hash=hash,
from_address_entity=from_address_entity,
from_address_entity_logo=from_address_entity_logo,
from_address_label=from_address_label,
to_address_entity=to_address_entity,
to_address_entity_logo=to_address_entity_logo,
to_address=to_address,
to_address_label=to_address_label,
gas=gas,
Expand Down
Loading

0 comments on commit dbb086f

Please sign in to comment.