├── setup.cfg ├── test-requirements.txt ├── requirements.txt ├── examples ├── config.json.tmp ├── environment.yml ├── dataframe.py └── data │ └── sextortion_addresses.json ├── tox.ini ├── graphsense ├── api │ ├── __init__.py │ ├── tokens_api.py │ ├── rates_api.py │ └── general_api.py ├── model │ ├── __init__.py │ ├── token_values.py │ ├── tag_cloud_entry.py │ ├── taxonomy.py │ ├── rate.py │ └── labeled_item_ref.py ├── __init__.py ├── apis │ └── __init__.py ├── models │ └── __init__.py └── exceptions.py ├── templates ├── test-requirements.mustache ├── __init__package.mustache ├── setup.mustache ├── README.mustache ├── api_doc_example.mustache ├── README_common.mustache └── api_doc.mustache ├── docs ├── TokenValues.md ├── Actors.md ├── Height.md ├── TagCloudEntry.md ├── Taxonomy.md ├── Values.md ├── Links.md ├── Rate.md ├── LabeledItemRef.md ├── TxRef.md ├── AddressTagAllOf.md ├── Rates.md ├── TxValues.md ├── AddressTxs.md ├── EntityAddresses.md ├── SearchResultLabels.md ├── AddressTags.md ├── TokenConfigs.md ├── NeighborAddresses.md ├── NeighborEntities.md ├── LabeledItemRefs.md ├── Stats.md ├── TxsAccount.md ├── SearchResultLeaf.md ├── TxValue.md ├── TxSummary.md ├── UserReportedTag.md ├── Concept.md ├── SearchResultByCurrency.md ├── Block.md ├── SearchResult.md ├── SearchResultLevel6.md ├── SearchResultLevel1.md ├── SearchResultLevel2.md ├── SearchResultLevel3.md ├── SearchResultLevel4.md ├── SearchResultLevel5.md ├── BlockAtDate.md ├── NeighborEntity.md ├── NeighborAddress.md ├── LinkUtxo.md ├── AddressTxUtxo.md ├── TagSummary.md ├── CurrencyStats.md ├── LabelSummary.md ├── Actor.md ├── TokenConfig.md ├── TxUtxo.md ├── ActorContext.md ├── ExternalConversions.md ├── Address.md ├── TxAccount.md ├── Entity.md ├── AddressTx.md ├── Link.md ├── Tag.md ├── AddressTag.md ├── Tx.md ├── TokensApi.md ├── RatesApi.md ├── GeneralApi.md ├── BulkApi.md └── BlocksApi.md ├── .github └── workflows │ ├── release.yaml │ └── pypi-publish.yaml ├── Makefile ├── test_examples.py ├── CHANGELOG.md ├── LICENSE ├── .openapi-generator-ignore ├── .gitignore └── setup.py /setup.cfg: -------------------------------------------------------------------------------- 1 | [flake8] 2 | max-line-length=99 3 | -------------------------------------------------------------------------------- /test-requirements.txt: -------------------------------------------------------------------------------- 1 | pytest-cov>=2.8.1 2 | pypandoc>=1.14 3 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | python_dateutil >= 2.5.3 2 | setuptools >= 21.0.0 3 | urllib3 >= 1.25.3 4 | -------------------------------------------------------------------------------- /examples/config.json.tmp: -------------------------------------------------------------------------------- 1 | {"graphsense": { 2 | "host": "https://api.ikna.io/", 3 | "api_key": "PASTE YOUR API KEY"} 4 | } 5 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | envlist = py3 3 | 4 | [testenv] 5 | deps=-r{toxinidir}/requirements.txt 6 | -r{toxinidir}/test-requirements.txt 7 | 8 | commands= 9 | pytest --cov=graphsense 10 | -------------------------------------------------------------------------------- /graphsense/api/__init__.py: -------------------------------------------------------------------------------- 1 | # do not import all apis into this module because that uses a lot of memory and stack frames 2 | # if you need the ability to import all apis from one package, import them with 3 | # from graphsense.apis import AddressesApi 4 | -------------------------------------------------------------------------------- /examples/environment.yml: -------------------------------------------------------------------------------- 1 | name: graphsense-python 2 | channels: 3 | - conda-forge 4 | - anaconda 5 | dependencies: 6 | - pip 7 | - jupyter 8 | - numpy 9 | - pandas 10 | - networkx 11 | - seaborn 12 | - matplotlib 13 | - pip: 14 | - git+https://github.com/graphsense/graphsense-python.git -------------------------------------------------------------------------------- /templates/test-requirements.mustache: -------------------------------------------------------------------------------- 1 | {{#useNose}} 2 | coverage>=4.0.3 3 | nose>=1.3.7 4 | pluggy>=0.3.1 5 | py>=1.4.31 6 | randomize>=0.13 7 | {{/useNose}} 8 | {{^useNose}} 9 | pytest-cov>=2.8.1 10 | {{/useNose}} 11 | {{#hasHttpSignatureMethods}} 12 | pycryptodome>=3.9.0 13 | {{/hasHttpSignatureMethods}} 14 | pypandoc>=1.14 15 | -------------------------------------------------------------------------------- /graphsense/model/__init__.py: -------------------------------------------------------------------------------- 1 | # we can not import model classes here because that would create a circular 2 | # reference which would not work in python2 3 | # do not import all models into this module because that uses a lot of memory and stack frames 4 | # if you need the ability to import all models from one package, import them with 5 | # from {{packageName}.models import ModelA, ModelB 6 | -------------------------------------------------------------------------------- /docs/TokenValues.md: -------------------------------------------------------------------------------- 1 | # TokenValues 2 | 3 | Per token value-flow 4 | 5 | ## Properties 6 | Name | Type | Description | Notes 7 | ------------ | ------------- | ------------- | ------------- 8 | **any string name** | [**Values**](Values.md) | any string name can be used but the value must be the correct type | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/Actors.md: -------------------------------------------------------------------------------- 1 | # Actors 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **value** | [**[Actor]**](Actor.md) | | 8 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/Height.md: -------------------------------------------------------------------------------- 1 | # Height 2 | 3 | Height 4 | 5 | ## Properties 6 | Name | Type | Description | Notes 7 | ------------ | ------------- | ------------- | ------------- 8 | **value** | **int** | Height | 9 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/TagCloudEntry.md: -------------------------------------------------------------------------------- 1 | # TagCloudEntry 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **cnt** | **int** | | 8 | **weighted** | **float** | | 9 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/Taxonomy.md: -------------------------------------------------------------------------------- 1 | # Taxonomy 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **taxonomy** | **str** | Taxonomy | 8 | **uri** | **str** | URI | 9 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/Values.md: -------------------------------------------------------------------------------- 1 | # Values 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **fiat_values** | [**[Rate]**](Rate.md) | | 8 | **value** | **int** | | 9 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/Links.md: -------------------------------------------------------------------------------- 1 | # Links 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **links** | [**[Link]**](Link.md) | | 8 | **next_page** | **str** | | [optional] 9 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/Rate.md: -------------------------------------------------------------------------------- 1 | # Rate 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **code** | **str** | iso currency code | 8 | **value** | **float** | exchange rate | 9 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/LabeledItemRef.md: -------------------------------------------------------------------------------- 1 | # LabeledItemRef 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **id** | **str** | identifier of the item | 8 | **label** | **str** | Label | 9 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/TxRef.md: -------------------------------------------------------------------------------- 1 | # TxRef 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **input_index** | **int** | | 8 | **output_index** | **int** | | 9 | **tx_hash** | **str** | | 10 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/AddressTagAllOf.md: -------------------------------------------------------------------------------- 1 | # AddressTagAllOf 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **address** | **str** | Address | 8 | **entity** | **int** | Entity id | [optional] 9 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/Rates.md: -------------------------------------------------------------------------------- 1 | # Rates 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **height** | [**Height**](Height.md) | | [optional] 8 | **rates** | [**[Rate]**](Rate.md) | | [optional] 9 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/TxValues.md: -------------------------------------------------------------------------------- 1 | # TxValues 2 | 3 | Transaction inputs/outputs 4 | 5 | ## Properties 6 | Name | Type | Description | Notes 7 | ------------ | ------------- | ------------- | ------------- 8 | **value** | [**[TxValue]**](TxValue.md) | Transaction inputs/outputs | 9 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/AddressTxs.md: -------------------------------------------------------------------------------- 1 | # AddressTxs 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **address_txs** | [**[AddressTx]**](AddressTx.md) | | 8 | **next_page** | **str** | | [optional] 9 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/EntityAddresses.md: -------------------------------------------------------------------------------- 1 | # EntityAddresses 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **addresses** | [**[Address]**](Address.md) | | 8 | **next_page** | **str** | | [optional] 9 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/SearchResultLabels.md: -------------------------------------------------------------------------------- 1 | # SearchResultLabels 2 | 3 | The list of matching labels 4 | 5 | ## Properties 6 | Name | Type | Description | Notes 7 | ------------ | ------------- | ------------- | ------------- 8 | **value** | **[str]** | The list of matching labels | 9 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/AddressTags.md: -------------------------------------------------------------------------------- 1 | # AddressTags 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **address_tags** | [**[AddressTag]**](AddressTag.md) | | 8 | **next_page** | **str** | | [optional] 9 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/TokenConfigs.md: -------------------------------------------------------------------------------- 1 | # TokenConfigs 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **token_configs** | [**[TokenConfig]**](TokenConfig.md) | list of supported tokens and their parameters | 8 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/NeighborAddresses.md: -------------------------------------------------------------------------------- 1 | # NeighborAddresses 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **neighbors** | [**[NeighborAddress]**](NeighborAddress.md) | | 8 | **next_page** | **str** | | [optional] 9 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/NeighborEntities.md: -------------------------------------------------------------------------------- 1 | # NeighborEntities 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **neighbors** | [**[NeighborEntity]**](NeighborEntity.md) | | 8 | **next_page** | **str** | | [optional] 9 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/LabeledItemRefs.md: -------------------------------------------------------------------------------- 1 | # LabeledItemRefs 2 | 3 | The list of matching actors 4 | 5 | ## Properties 6 | Name | Type | Description | Notes 7 | ------------ | ------------- | ------------- | ------------- 8 | **value** | [**[LabeledItemRef]**](LabeledItemRef.md) | The list of matching actors | 9 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/Stats.md: -------------------------------------------------------------------------------- 1 | # Stats 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currencies** | [**[CurrencyStats]**](CurrencyStats.md) | | 8 | **version** | **str** | | 9 | **request_timestamp** | **str** | | 10 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/TxsAccount.md: -------------------------------------------------------------------------------- 1 | # TxsAccount 2 | 3 | A list of account model transactions 4 | 5 | ## Properties 6 | Name | Type | Description | Notes 7 | ------------ | ------------- | ------------- | ------------- 8 | **value** | [**[TxAccount]**](TxAccount.md) | A list of account model transactions | 9 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/SearchResultLeaf.md: -------------------------------------------------------------------------------- 1 | # SearchResultLeaf 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **neighbor** | [**NeighborEntity**](NeighborEntity.md) | | 8 | **matching_addresses** | [**[Address]**](Address.md) | | 9 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/TxValue.md: -------------------------------------------------------------------------------- 1 | # TxValue 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **address** | **[str]** | | 8 | **value** | [**Values**](Values.md) | | 9 | **index** | **int** | Optional index for the inputs and outputs | [optional] 10 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/TxSummary.md: -------------------------------------------------------------------------------- 1 | # TxSummary 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **height** | [**Height**](Height.md) | | 8 | **timestamp** | **int** | Timestamp in posix seconds format | 9 | **tx_hash** | **str** | Transaction hash | 10 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/UserReportedTag.md: -------------------------------------------------------------------------------- 1 | # UserReportedTag 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **address** | **str** | | 8 | **network** | **str** | | 9 | **label** | **str** | | 10 | **actor** | **str** | | 11 | **description** | **str** | | 12 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 13 | 14 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/Concept.md: -------------------------------------------------------------------------------- 1 | # Concept 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **label** | **str** | Label | 8 | **taxonomy** | **str** | Taxonomy | 9 | **uri** | **str** | URI | 10 | **description** | **str** | Description | 11 | **id** | **str** | ID | 12 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 13 | 14 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/SearchResultByCurrency.md: -------------------------------------------------------------------------------- 1 | # SearchResultByCurrency 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency** | **str** | crypto currency code | 8 | **addresses** | **[str]** | The list of found addresses | 9 | **txs** | **[str]** | The list of found transaction ids | 10 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/Block.md: -------------------------------------------------------------------------------- 1 | # Block 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **block_hash** | **str** | | 8 | **currency** | **str** | crypto currency code | 9 | **height** | [**Height**](Height.md) | | 10 | **no_txs** | **int** | | 11 | **timestamp** | **int** | Timestamp in posix seconds format | 12 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 13 | 14 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/SearchResult.md: -------------------------------------------------------------------------------- 1 | # SearchResult 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currencies** | [**[SearchResultByCurrency]**](SearchResultByCurrency.md) | | 8 | **labels** | [**SearchResultLabels**](SearchResultLabels.md) | | 9 | **actors** | [**LabeledItemRefs**](LabeledItemRefs.md) | | [optional] 10 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/SearchResultLevel6.md: -------------------------------------------------------------------------------- 1 | # SearchResultLevel6 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **neighbor** | [**NeighborEntity**](NeighborEntity.md) | | 8 | **matching_addresses** | [**[Address]**](Address.md) | | 9 | **paths** | [**[SearchResultLeaf]**](SearchResultLeaf.md) | Branches to matching entities | 10 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/SearchResultLevel1.md: -------------------------------------------------------------------------------- 1 | # SearchResultLevel1 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **neighbor** | [**NeighborEntity**](NeighborEntity.md) | | 8 | **matching_addresses** | [**[Address]**](Address.md) | | 9 | **paths** | [**[SearchResultLevel2]**](SearchResultLevel2.md) | Branches to matching entities | 10 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/SearchResultLevel2.md: -------------------------------------------------------------------------------- 1 | # SearchResultLevel2 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **neighbor** | [**NeighborEntity**](NeighborEntity.md) | | 8 | **matching_addresses** | [**[Address]**](Address.md) | | 9 | **paths** | [**[SearchResultLevel3]**](SearchResultLevel3.md) | Branches to matching entities | 10 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/SearchResultLevel3.md: -------------------------------------------------------------------------------- 1 | # SearchResultLevel3 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **neighbor** | [**NeighborEntity**](NeighborEntity.md) | | 8 | **matching_addresses** | [**[Address]**](Address.md) | | 9 | **paths** | [**[SearchResultLevel4]**](SearchResultLevel4.md) | Branches to matching entities | 10 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/SearchResultLevel4.md: -------------------------------------------------------------------------------- 1 | # SearchResultLevel4 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **neighbor** | [**NeighborEntity**](NeighborEntity.md) | | 8 | **matching_addresses** | [**[Address]**](Address.md) | | 9 | **paths** | [**[SearchResultLevel5]**](SearchResultLevel5.md) | Branches to matching entities | 10 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/SearchResultLevel5.md: -------------------------------------------------------------------------------- 1 | # SearchResultLevel5 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **neighbor** | [**NeighborEntity**](NeighborEntity.md) | | 8 | **matching_addresses** | [**[Address]**](Address.md) | | 9 | **paths** | [**[SearchResultLevel6]**](SearchResultLevel6.md) | Branches to matching entities | 10 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 11 | 12 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/BlockAtDate.md: -------------------------------------------------------------------------------- 1 | # BlockAtDate 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **before_block** | [**Height**](Height.md) | | [optional] 8 | **before_timestamp** | **int** | Timestamp in posix seconds format | [optional] 9 | **after_block** | [**Height**](Height.md) | | [optional] 10 | **after_timestamp** | **int** | Timestamp in posix seconds format | [optional] 11 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 12 | 13 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/NeighborEntity.md: -------------------------------------------------------------------------------- 1 | # NeighborEntity 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **value** | [**Values**](Values.md) | | 8 | **no_txs** | **int** | number of transactions | 9 | **entity** | [**Entity**](Entity.md) | | 10 | **labels** | **[str]** | The neighbor's tag labels | [optional] 11 | **token_values** | [**TokenValues**](TokenValues.md) | | [optional] 12 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 13 | 14 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/NeighborAddress.md: -------------------------------------------------------------------------------- 1 | # NeighborAddress 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **value** | [**Values**](Values.md) | | 8 | **no_txs** | **int** | number of transactions | 9 | **address** | [**Address**](Address.md) | | 10 | **labels** | **[str]** | The neighbor's tag labels | [optional] 11 | **token_values** | [**TokenValues**](TokenValues.md) | | [optional] 12 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 13 | 14 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/LinkUtxo.md: -------------------------------------------------------------------------------- 1 | # LinkUtxo 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **tx_hash** | **str** | Transaction hash | 8 | **currency** | **str** | crypto currency code | 9 | **height** | [**Height**](Height.md) | | 10 | **timestamp** | **int** | Timestamp in posix seconds format | 11 | **input_value** | [**Values**](Values.md) | | 12 | **output_value** | [**Values**](Values.md) | | 13 | **tx_type** | **str** | | defaults to "utxo" 14 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 15 | 16 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/AddressTxUtxo.md: -------------------------------------------------------------------------------- 1 | # AddressTxUtxo 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **tx_hash** | **str** | Transaction hash | 8 | **currency** | **str** | crypto currency code | 9 | **coinbase** | **bool** | Coinbase transaction flag | 10 | **height** | [**Height**](Height.md) | | 11 | **timestamp** | **int** | Timestamp in posix seconds format | 12 | **value** | [**Values**](Values.md) | | 13 | **tx_type** | **str** | | defaults to "utxo" 14 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 15 | 16 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/TagSummary.md: -------------------------------------------------------------------------------- 1 | # TagSummary 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **broad_category** | **str** | | 8 | **tag_count** | **int** | | 9 | **label_summary** | [**{str: (LabelSummary,)}**](LabelSummary.md) | | 10 | **concept_tag_cloud** | [**{str: (TagCloudEntry,)}**](TagCloudEntry.md) | | 11 | **tag_count_indirect** | **int** | | [optional] 12 | **best_actor** | **str** | | [optional] 13 | **best_label** | **str** | | [optional] 14 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 15 | 16 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/CurrencyStats.md: -------------------------------------------------------------------------------- 1 | # CurrencyStats 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **name** | **str** | | 8 | **no_blocks** | **int** | | 9 | **no_address_relations** | **int** | | 10 | **no_addresses** | **int** | | 11 | **no_entities** | **int** | | 12 | **no_txs** | **int** | number of transactions | 13 | **no_labels** | **int** | | 14 | **no_tagged_addresses** | **int** | | 15 | **timestamp** | **int** | Timestamp in posix seconds format | 16 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 17 | 18 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 19 | 20 | 21 | -------------------------------------------------------------------------------- /templates/__init__package.mustache: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | 3 | {{>partial_header}} 4 | 5 | __version__ = "{{appVersion}}" 6 | 7 | # import ApiClient 8 | from {{packageName}}.api_client import ApiClient 9 | 10 | # import Configuration 11 | from {{packageName}}.configuration import Configuration 12 | {{#hasHttpSignatureMethods}} 13 | from {{packageName}}.signing import HttpSigningConfiguration 14 | {{/hasHttpSignatureMethods}} 15 | 16 | # import exceptions 17 | from {{packageName}}.exceptions import OpenApiException 18 | from {{packageName}}.exceptions import ApiAttributeError 19 | from {{packageName}}.exceptions import ApiTypeError 20 | from {{packageName}}.exceptions import ApiValueError 21 | from {{packageName}}.exceptions import ApiKeyError 22 | from {{packageName}}.exceptions import ApiException 23 | {{#recursionLimit}} 24 | 25 | __import__('sys').setrecursionlimit({{{.}}}) 26 | {{/recursionLimit}} 27 | -------------------------------------------------------------------------------- /.github/workflows/release.yaml: -------------------------------------------------------------------------------- 1 | name: Create release 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | tags: 7 | - v[0-9]+.[0-9]+.[0-9]+ 8 | 9 | permissions: 10 | contents: write 11 | 12 | jobs: 13 | release: 14 | name: Release pushed tag 15 | runs-on: ubuntu-latest 16 | steps: 17 | - name: Checkout repository 18 | uses: actions/checkout@v3 19 | - name: Filter CHANGELOG 20 | run: | 21 | sed '1,/## \[/d;/## \[/Q' CHANGELOG.md > CHANGELOG_LATEST.md 22 | - name: Create release 23 | env: 24 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 25 | tag: ${{ github.ref_name }} 26 | run: | 27 | gh release create "${{ github.ref_name }}" \ 28 | --repo="$GITHUB_REPOSITORY" \ 29 | --title="${GITHUB_REPOSITORY#*/} ${tag#v}" \ 30 | -F CHANGELOG_LATEST.md \ 31 | --generate-notes 32 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | -include .env 2 | 3 | generate-openapi-client: 4 | @echo "Downloading openapi.json..." 5 | curl -s "$(GS_REST_SERVICE_URL)/openapi.json" -o openapi.json.tmp 6 | @echo "Modifying server URL to production..." 7 | jq '.servers[0].url = "https://api.ikna.io"' openapi.json.tmp > openapi.json.modified 8 | @echo "Generating client..." 9 | docker run --rm \ 10 | -v "${PWD}:/build:Z" \ 11 | -v "${PWD}/templates:/templates:Z" \ 12 | openapitools/openapi-generator-cli:v5.2.1 \ 13 | generate -i /build/openapi.json.modified \ 14 | -g python \ 15 | -t /templates \ 16 | -o /build \ 17 | --additional-properties=packageName=graphsense \ 18 | --additional-properties=projectName=graphsense-python 19 | @echo "Cleaning up temporary files..." 20 | rm -f openapi.json.tmp openapi.json.modified 21 | 22 | run-examples: 23 | API_KEY=$(API_KEY) python test_examples.py 24 | 25 | .PHONY: generate-openapi-client run-examples 26 | -------------------------------------------------------------------------------- /docs/LabelSummary.md: -------------------------------------------------------------------------------- 1 | # LabelSummary 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **label** | **str** | | 8 | **count** | **int** | | 9 | **confidence** | **float** | | 10 | **relevance** | **float** | | 11 | **creators** | **[str]** | | 12 | **sources** | **[str]** | | 13 | **concepts** | **[str]** | | 14 | **lastmod** | **int** | | 15 | **inherited_from** | **str** | if the tag was inherited from cluster | [optional] if omitted the server will use the default value of "cluster" 16 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 17 | 18 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/Actor.md: -------------------------------------------------------------------------------- 1 | # Actor 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **id** | **str** | Id of the actor | 8 | **label** | **str** | Label | 9 | **uri** | **str** | URI | 10 | **categories** | [**[LabeledItemRef]**](LabeledItemRef.md) | A list actor categories | 11 | **jurisdictions** | [**[LabeledItemRef]**](LabeledItemRef.md) | A list jurisdictions | 12 | **nr_tags** | **int** | number of address tags of the actor | [optional] 13 | **context** | [**ActorContext**](ActorContext.md) | | [optional] 14 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 15 | 16 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 17 | 18 | 19 | -------------------------------------------------------------------------------- /graphsense/__init__.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | 3 | """ 4 | GraphSense API 5 | 6 | GraphSense API provides programmatic access to various ledgers' addresses, entities, blocks, transactions and tags for automated and highly efficient forensics tasks. # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.13.3 9 | Contact: contact@ikna.io 10 | Generated by: https://openapi-generator.tech 11 | """ 12 | 13 | 14 | __version__ = "1.13.3" 15 | 16 | # import ApiClient 17 | from graphsense.api_client import ApiClient 18 | 19 | # import Configuration 20 | from graphsense.configuration import Configuration 21 | 22 | # import exceptions 23 | from graphsense.exceptions import OpenApiException 24 | from graphsense.exceptions import ApiAttributeError 25 | from graphsense.exceptions import ApiTypeError 26 | from graphsense.exceptions import ApiValueError 27 | from graphsense.exceptions import ApiKeyError 28 | from graphsense.exceptions import ApiException 29 | -------------------------------------------------------------------------------- /graphsense/apis/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # flake8: noqa 3 | 4 | # Import all APIs into this package. 5 | # If you have many APIs here with many many models used in each API this may 6 | # raise a `RecursionError`. 7 | # In order to avoid this, import only the API that you directly need like: 8 | # 9 | # from .api.addresses_api import AddressesApi 10 | # 11 | # or import this package, but before doing it, use: 12 | # 13 | # import sys 14 | # sys.setrecursionlimit(n) 15 | 16 | # Import APIs into API package: 17 | from graphsense.api.addresses_api import AddressesApi 18 | from graphsense.api.blocks_api import BlocksApi 19 | from graphsense.api.bulk_api import BulkApi 20 | from graphsense.api.entities_api import EntitiesApi 21 | from graphsense.api.general_api import GeneralApi 22 | from graphsense.api.rates_api import RatesApi 23 | from graphsense.api.tags_api import TagsApi 24 | from graphsense.api.tokens_api import TokensApi 25 | from graphsense.api.txs_api import TxsApi 26 | -------------------------------------------------------------------------------- /test_examples.py: -------------------------------------------------------------------------------- 1 | import pypandoc 2 | import json 3 | import os 4 | import glob 5 | from io import StringIO 6 | from contextlib import redirect_stdout 7 | 8 | pattern = "*Api" 9 | api_key = os.environ.get('API_KEY') 10 | replace = os.environ.get('REPLACE_API_URL') 11 | 12 | for fil in glob.glob("./docs/"+pattern+".md"): 13 | print(fil) 14 | data = pypandoc.convert_file(fil, 'json') 15 | 16 | for block in json.loads(data)['blocks']: 17 | if block['t'] != 'CodeBlock': 18 | continue 19 | code = block['c'][1].replace('YOUR_API_KEY', api_key) 20 | if replace: 21 | url = replace.split('>') 22 | code = code.replace(url[0], url[1]) 23 | f = StringIO() 24 | try: 25 | with redirect_stdout(f): 26 | exec(code) 27 | output = f.getvalue() 28 | if 'Exception' in output: 29 | print(output) 30 | 31 | except Exception as e: 32 | print(code.replace(api_key, "XXX")) 33 | raise e 34 | -------------------------------------------------------------------------------- /docs/TokenConfig.md: -------------------------------------------------------------------------------- 1 | # TokenConfig 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **ticker** | **str** | ticker symbol of the currency e.g. USDT | 8 | **decimals** | **int** | the number of digits after the comma. Values are always delivered as integers. This value can be used to set the decimal point at the right place. | 9 | **peg_currency** | **str** | is set if token is a stablecoin. It holds the thicker symbol of the currency the tokens is pegged to. | [optional] 10 | **contract_address** | **str** | the contract address of the token on the blockchain. This is only set for tokens that are not native to the blockchain. | [optional] 11 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 12 | 13 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | Please see the [changelog of GraphSense OpenAPI](https://github.com/graphsense/graphsense-openapi/blob/master/CHANGELOG.md) for changes related to the API. 4 | 5 | 6 | ## [25.08.0/1.13.0] - 2025-08-05 7 | 8 | ### Added 9 | - added new conversion endpoint: Input is a transaction output are swaps or similar currency conversion transactions that can be resolved by the backend 10 | - api to let the community to report annotation tags. 11 | - TagSummary has new field tag count indirect 12 | - TokenConfig now exposes the contract_address (needed for Quicklock tooling) 13 | 14 | ### Added 15 | - added tag_type field in tag endpoints, make entity id in tags optional 16 | 17 | ## [25.01.1/1.9.1] - 2025-01-20 18 | 19 | ### Changed 20 | - Update to REST version 24.01.0 21 | ### Added 22 | - added tag_type field in tag endpoints, make entity id in tags optional 23 | 24 | ## [24.11.1/1.8.1] - 2024-11-27 25 | 26 | ### Added 27 | - Update to REST version 24.11.1. 28 | 29 | ## [24.01.0/1.4.1] - 2024-01-25 30 | 31 | ### Added 32 | - Added instructions and templates for generating the library using openapi-generator. 33 | -------------------------------------------------------------------------------- /docs/TxUtxo.md: -------------------------------------------------------------------------------- 1 | # TxUtxo 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency** | **str** | crypto currency code | 8 | **tx_hash** | **str** | Transaction hash | 9 | **coinbase** | **bool** | Coinbase transaction flag | 10 | **height** | [**Height**](Height.md) | | 11 | **no_inputs** | **int** | number of input addresses | 12 | **no_outputs** | **int** | number of output addresses | 13 | **timestamp** | **int** | Timestamp in posix seconds format | 14 | **total_input** | [**Values**](Values.md) | | 15 | **total_output** | [**Values**](Values.md) | | 16 | **tx_type** | **str** | | defaults to "utxo" 17 | **inputs** | [**TxValues**](TxValues.md) | | [optional] 18 | **outputs** | [**TxValues**](TxValues.md) | | [optional] 19 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 20 | 21 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 22 | 23 | 24 | -------------------------------------------------------------------------------- /docs/ActorContext.md: -------------------------------------------------------------------------------- 1 | # ActorContext 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **uris** | **[str]** | list of additonal uris identifying the actor | 8 | **images** | **[str]** | list of uris to logos of the actor | 9 | **refs** | **[str]** | list of uris to further information of the actors | 10 | **coingecko_ids** | **[str]** | list of references to coingecko exchanges or coins | 11 | **defilama_ids** | **[str]** | list of references to defilama | 12 | **twitter_handle** | **str** | semi-colon separated list of twitter handles used by the actor | [optional] 13 | **github_organisation** | **str** | semi-colon separated list of github organisations used by the actor | [optional] 14 | **legal_name** | **str** | Name of the legal entity registerd by the actor. | [optional] 15 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 16 | 17 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 18 | 19 | 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Iknaio Cryptoasset Analytics GmbH 4 | Copyright (c) AIT Austrian Institute of Technology 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | 24 | -------------------------------------------------------------------------------- /.openapi-generator-ignore: -------------------------------------------------------------------------------- 1 | # OpenAPI Generator Ignore 2 | # Generated by openapi-generator https://github.com/openapitools/openapi-generator 3 | 4 | # Use this file to prevent files from being overwritten by the generator. 5 | # The patterns follow closely to .gitignore or .dockerignore. 6 | 7 | # As an example, the C# client generator defines ApiClient.cs. 8 | # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: 9 | #ApiClient.cs 10 | 11 | # You can match any string of characters against a directory, file or extension with a single asterisk (*): 12 | #foo/*/qux 13 | # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux 14 | 15 | # You can recursively match patterns against a directory, file or extension with a double asterisk (**): 16 | #foo/**/qux 17 | # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux 18 | 19 | # You can also negate patterns with an exclamation (!). 20 | # For example, you can ignore all files in a docs folder with the file extension .md: 21 | #docs/*.md 22 | # Then explicitly reverse the ignore rule for a single file: 23 | #!docs/README.md 24 | 25 | docs/BulkApi.md 26 | .travis.yml 27 | .gitlab-ci.yml 28 | test/* 29 | git_push.sh 30 | .gitignore 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | 27 | # PyInstaller 28 | # Usually these files are written by a python script from a template 29 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 30 | *.manifest 31 | *.spec 32 | 33 | # Installer logs 34 | pip-log.txt 35 | pip-delete-this-directory.txt 36 | 37 | # Unit test / coverage reports 38 | htmlcov/ 39 | .tox/ 40 | .coverage 41 | .coverage.* 42 | .cache 43 | nosetests.xml 44 | coverage.xml 45 | *,cover 46 | .hypothesis/ 47 | venv/ 48 | .venv/ 49 | venv-gpython/ 50 | .python-version 51 | .pytest_cache 52 | 53 | # Translations 54 | *.mo 55 | *.pot 56 | 57 | # Django stuff: 58 | *.log 59 | 60 | # Sphinx documentation 61 | docs/_build/ 62 | 63 | # PyBuilder 64 | target/ 65 | 66 | #Ipython Notebook 67 | .ipynb_checkpoints 68 | 69 | #ctags 70 | ./tags 71 | 72 | #openapi 73 | .openapi-generator 74 | 75 | #credentials 76 | examples/config.json 77 | 78 | .env -------------------------------------------------------------------------------- /docs/ExternalConversions.md: -------------------------------------------------------------------------------- 1 | # ExternalConversions 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **conversion_type** | **str** | | 8 | **from_address** | **str** | Provider of the input assets of the external conversion | 9 | **to_address** | **str** | Receiver of the output assets of the external conversion | 10 | **from_asset** | **str** | Asset converted from | 11 | **to_asset** | **str** | Asset converted to | 12 | **from_amount** | **str** | Amount of asset converted from | 13 | **to_amount** | **str** | Amount of asset converted to | 14 | **from_asset_transfer** | **str** | Initial asset transfer starting the conversion process | 15 | **to_asset_transfer** | **str** | Output asset transfer ending the conversion process | 16 | **from_network** | **str** | Network where the initial payment took place | 17 | **to_network** | **str** | Network where the concluding payment took place | 18 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 19 | 20 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 21 | 22 | 23 | -------------------------------------------------------------------------------- /.github/workflows/pypi-publish.yaml: -------------------------------------------------------------------------------- 1 | # This workflow will upload a Python Package using Twine when a release is created 2 | # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries 3 | 4 | # This workflow uses actions that are not certified by GitHub. 5 | # They are provided by a third-party and are governed by 6 | # separate terms of service, privacy policy, and support 7 | # documentation. 8 | 9 | name: Upload Python Package 10 | 11 | on: 12 | workflow_dispatch: 13 | push: 14 | tags: 15 | - v[0-9].[0-9]+.[0-9]+ 16 | # on: 17 | # release: 18 | # types: [published] 19 | 20 | permissions: 21 | contents: read 22 | 23 | jobs: 24 | deploy: 25 | 26 | runs-on: ubuntu-latest 27 | 28 | steps: 29 | - uses: actions/checkout@v3 30 | - name: Set up Python 31 | uses: actions/setup-python@v3 32 | with: 33 | python-version: '3.x' 34 | - name: Install dependencies 35 | run: | 36 | python -m pip install --upgrade pip 37 | pip install build 38 | - name: Build package 39 | run: python -m build 40 | - name: Publish package 41 | uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 42 | with: 43 | user: __token__ 44 | password: ${{ secrets.PYPI_API_TOKEN }} 45 | -------------------------------------------------------------------------------- /docs/Address.md: -------------------------------------------------------------------------------- 1 | # Address 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency** | **str** | crypto currency code | 8 | **address** | **str** | Address | 9 | **entity** | **int** | Entity id | 10 | **balance** | [**Values**](Values.md) | | 11 | **first_tx** | [**TxSummary**](TxSummary.md) | | 12 | **last_tx** | [**TxSummary**](TxSummary.md) | | 13 | **in_degree** | **int** | | 14 | **out_degree** | **int** | | 15 | **no_incoming_txs** | **int** | | 16 | **no_outgoing_txs** | **int** | | 17 | **total_received** | [**Values**](Values.md) | | 18 | **total_spent** | [**Values**](Values.md) | | 19 | **status** | **str** | | 20 | **token_balances** | [**TokenValues**](TokenValues.md) | | [optional] 21 | **total_tokens_received** | [**TokenValues**](TokenValues.md) | | [optional] 22 | **total_tokens_spent** | [**TokenValues**](TokenValues.md) | | [optional] 23 | **actors** | [**LabeledItemRefs**](LabeledItemRefs.md) | | [optional] 24 | **is_contract** | **bool** | | [optional] 25 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 26 | 27 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 28 | 29 | 30 | -------------------------------------------------------------------------------- /docs/TxAccount.md: -------------------------------------------------------------------------------- 1 | # TxAccount 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **identifier** | **str** | uniquely identifies a transaction or a sub transaction like a token transaction or trace. | 8 | **currency** | **str** | crypto currency code | 9 | **network** | **str** | crypto currency code | 10 | **tx_hash** | **str** | Transaction hash | 11 | **height** | [**Height**](Height.md) | | 12 | **timestamp** | **int** | Timestamp in posix seconds format | 13 | **value** | [**Values**](Values.md) | | 14 | **from_address** | **str** | Address | 15 | **to_address** | **str** | Address | 16 | **tx_type** | **str** | | defaults to "account" 17 | **token_tx_id** | **int** | identifies a specific token transaction within a tx_hash, (deprecated) use identifier instead in encapsulates all information that uniquely identifies the transaction | [optional] 18 | **contract_creation** | **bool** | Indicates if this transaction created a new contract. Recipient address is the address of the new contract. | [optional] 19 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 20 | 21 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 22 | 23 | 24 | -------------------------------------------------------------------------------- /examples/dataframe.py: -------------------------------------------------------------------------------- 1 | import graphsense 2 | from graphsense.api import bulk_api 3 | from pprint import pprint 4 | import pandas as pd 5 | import json 6 | 7 | with open('./config.json') as config_file: 8 | config = json.load(config_file) 9 | configuration = graphsense.Configuration(host=config['graphsense']['host']) 10 | configuration.api_key['api_key'] = config['graphsense']['api_key'] 11 | 12 | data = { 13 | 'address': [ 14 | '1H7j2YeKwdatfmTmE6vUMotMNrnLA1JbyS', 15 | '19db74byS65R9FRhud3X34wKkSd9ZzQ1fX' 16 | ] 17 | } 18 | address_df = pd.DataFrame.from_dict(data) 19 | 20 | with graphsense.ApiClient(configuration) as api_client: 21 | api_instance = bulk_api.BulkApi(api_client) 22 | 23 | CURRENCY = "btc" 24 | operation = "get_address_entity" 25 | body = {'address': address_df['address'].to_list()} 26 | 27 | try: 28 | # Read data into pandas dataframe. 29 | # Use _preload_content=False to stream 30 | # raw response data right into a dataframe. 31 | df_resp = pd.read_csv( 32 | api_instance.bulk_csv(CURRENCY, 33 | operation, 34 | body=body, 35 | num_pages=1, 36 | _preload_content=False)) 37 | pprint(df_resp) 38 | except graphsense.ApiException as e: 39 | print("Exception when calling BulkApi->bulk_csv: %s\n" % e) 40 | -------------------------------------------------------------------------------- /docs/Entity.md: -------------------------------------------------------------------------------- 1 | # Entity 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **currency** | **str** | crypto currency code | 8 | **entity** | **int** | Entity id | 9 | **root_address** | **str** | Address | 10 | **balance** | [**Values**](Values.md) | | 11 | **first_tx** | [**TxSummary**](TxSummary.md) | | 12 | **last_tx** | [**TxSummary**](TxSummary.md) | | 13 | **in_degree** | **int** | | 14 | **out_degree** | **int** | | 15 | **no_addresses** | **int** | number of contained addresses | 16 | **no_incoming_txs** | **int** | | 17 | **no_outgoing_txs** | **int** | | 18 | **total_received** | [**Values**](Values.md) | | 19 | **total_spent** | [**Values**](Values.md) | | 20 | **no_address_tags** | **int** | number of address tags | 21 | **token_balances** | [**TokenValues**](TokenValues.md) | | [optional] 22 | **total_tokens_received** | [**TokenValues**](TokenValues.md) | | [optional] 23 | **total_tokens_spent** | [**TokenValues**](TokenValues.md) | | [optional] 24 | **actors** | [**LabeledItemRefs**](LabeledItemRefs.md) | | [optional] 25 | **best_address_tag** | [**AddressTag**](AddressTag.md) | | [optional] 26 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 27 | 28 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/AddressTx.md: -------------------------------------------------------------------------------- 1 | # AddressTx 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **tx_type** | **str** | | defaults to "account" 8 | **token_tx_id** | **int** | identifies a specific token transaction within a tx_hash, (deprecated) use identifier instead in encapsulates all information that uniquely identifies the transaction | [optional] 9 | **contract_creation** | **bool** | Indicates if this transaction created a new contract. Recipient address is the address of the new contract. | [optional] 10 | **tx_hash** | **str** | Transaction hash | [optional] 11 | **currency** | **str** | crypto currency code | [optional] 12 | **coinbase** | **bool** | Coinbase transaction flag | [optional] 13 | **height** | [**Height**](Height.md) | | [optional] 14 | **timestamp** | **int** | Timestamp in posix seconds format | [optional] 15 | **value** | [**Values**](Values.md) | | [optional] 16 | **identifier** | **str** | uniquely identifies a transaction or a sub transaction like a token transaction or trace. | [optional] 17 | **network** | **str** | crypto currency code | [optional] 18 | **from_address** | **str** | Address | [optional] 19 | **to_address** | **str** | Address | [optional] 20 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 21 | 22 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 23 | 24 | 25 | -------------------------------------------------------------------------------- /docs/Link.md: -------------------------------------------------------------------------------- 1 | # Link 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **tx_type** | **str** | | defaults to "account" 8 | **token_tx_id** | **int** | identifies a specific token transaction within a tx_hash, (deprecated) use identifier instead in encapsulates all information that uniquely identifies the transaction | [optional] 9 | **contract_creation** | **bool** | Indicates if this transaction created a new contract. Recipient address is the address of the new contract. | [optional] 10 | **tx_hash** | **str** | Transaction hash | [optional] 11 | **currency** | **str** | crypto currency code | [optional] 12 | **height** | [**Height**](Height.md) | | [optional] 13 | **timestamp** | **int** | Timestamp in posix seconds format | [optional] 14 | **input_value** | [**Values**](Values.md) | | [optional] 15 | **output_value** | [**Values**](Values.md) | | [optional] 16 | **identifier** | **str** | uniquely identifies a transaction or a sub transaction like a token transaction or trace. | [optional] 17 | **network** | **str** | crypto currency code | [optional] 18 | **value** | [**Values**](Values.md) | | [optional] 19 | **from_address** | **str** | Address | [optional] 20 | **to_address** | **str** | Address | [optional] 21 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 22 | 23 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 24 | 25 | 26 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | """ 2 | GraphSense API 3 | 4 | GraphSense API provides programmatic access to various ledgers' addresses, entities, blocks, transactions and tags for automated and highly efficient forensics tasks. # noqa: E501 5 | 6 | The version of the OpenAPI document: 1.13.3 7 | Contact: contact@ikna.io 8 | Generated by: https://openapi-generator.tech 9 | """ 10 | 11 | 12 | from setuptools import setup, find_packages # noqa: H301 13 | 14 | NAME = "graphsense-python" 15 | VERSION = "1.13.3" 16 | # To install the library, run the following 17 | # 18 | # python setup.py install 19 | # 20 | # prerequisite: setuptools 21 | # http://pypi.python.org/pypi/setuptools 22 | 23 | project_urls = { 24 | 'Source': 'https://github.com/graphsense/graphsense-python', 25 | 'Changelog': 'https://github.com/graphsense/blob/master/CHANGELOG.md', 26 | 'Tracker': 'https://github.com/graphsense/graphsense-python/issues', 27 | } 28 | 29 | REQUIRES = [ 30 | "urllib3 >= 1.25.3", 31 | "python-dateutil", 32 | ] 33 | 34 | with open("README.md", 'r') as f: 35 | long_description = f.read() 36 | 37 | setup( 38 | name=NAME, 39 | version=VERSION, 40 | description="GraphSense API", 41 | author="Iknaio Cryptoasset Analytics GmbH", 42 | author_email="contact@ikna.io", 43 | url="https://graphsense.github.io/", 44 | project_urls=project_urls, 45 | keywords=["OpenAPI", "OpenAPI-Generator", "GraphSense API"], 46 | python_requires=">=3.6", 47 | install_requires=REQUIRES, 48 | packages=find_packages(exclude=["test", "tests"]), 49 | include_package_data=True, 50 | long_description=long_description, 51 | long_description_content_type = "text/markdown; charset=UTF-8; variant=GFM" 52 | ) 53 | -------------------------------------------------------------------------------- /docs/Tag.md: -------------------------------------------------------------------------------- 1 | # Tag 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **label** | **str** | Label | 8 | **tagpack_title** | **str** | Tagpack title | 9 | **tagpack_is_public** | **bool** | whether the address is public | 10 | **tagpack_creator** | **str** | Tagpack creator | 11 | **is_cluster_definer** | **bool** | whether the address tag applies to the entity level | 12 | **tag_type** | **str** | kind of tag e.g. Mention; representing a mention of an address, or Actor; representing an actor saying something about the actor behind the address. | 13 | **currency** | **str** | crypto currency code | 14 | **category** | **str** | Category | [optional] 15 | **concepts** | **[str]** | A list additional concepts/categories | [optional] 16 | **actor** | **str** | id of the actor that controlls the address | [optional] 17 | **abuse** | **str** | Abuses | [optional] 18 | **tagpack_uri** | **str** | Tagpack URI | [optional] 19 | **source** | **str** | Source | [optional] 20 | **lastmod** | **int** | Last modified | [optional] 21 | **confidence** | **str** | Confidence name | [optional] 22 | **confidence_level** | **int** | Confidence level | [optional] 23 | **inherited_from** | **str** | if the tag was inherited from cluster | [optional] if omitted the server will use the default value of "cluster" 24 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 25 | 26 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/AddressTag.md: -------------------------------------------------------------------------------- 1 | # AddressTag 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **label** | **str** | Label | 8 | **tagpack_title** | **str** | Tagpack title | 9 | **tagpack_is_public** | **bool** | whether the address is public | 10 | **tagpack_creator** | **str** | Tagpack creator | 11 | **is_cluster_definer** | **bool** | whether the address tag applies to the entity level | 12 | **tag_type** | **str** | kind of tag e.g. Mention; representing a mention of an address, or Actor; representing an actor saying something about the actor behind the address. | 13 | **currency** | **str** | crypto currency code | 14 | **address** | **str** | Address | 15 | **category** | **str** | Category | [optional] 16 | **concepts** | **[str]** | A list additional concepts/categories | [optional] 17 | **actor** | **str** | id of the actor that controlls the address | [optional] 18 | **abuse** | **str** | Abuses | [optional] 19 | **tagpack_uri** | **str** | Tagpack URI | [optional] 20 | **source** | **str** | Source | [optional] 21 | **lastmod** | **int** | Last modified | [optional] 22 | **confidence** | **str** | Confidence name | [optional] 23 | **confidence_level** | **int** | Confidence level | [optional] 24 | **inherited_from** | **str** | if the tag was inherited from cluster | [optional] if omitted the server will use the default value of "cluster" 25 | **entity** | **int** | Entity id | [optional] 26 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 27 | 28 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 29 | 30 | 31 | -------------------------------------------------------------------------------- /templates/setup.mustache: -------------------------------------------------------------------------------- 1 | {{>partial_header}} 2 | 3 | from setuptools import setup, find_packages # noqa: H301 4 | 5 | NAME = "{{{projectName}}}" 6 | VERSION = "{{{version}}}" 7 | {{#apiInfo}} 8 | {{#apis}} 9 | {{#-last}} 10 | # To install the library, run the following 11 | # 12 | # python setup.py install 13 | # 14 | # prerequisite: setuptools 15 | # http://pypi.python.org/pypi/setuptools 16 | 17 | project_urls = { 18 | 'Source': 'https://github.com/graphsense/graphsense-python', 19 | 'Changelog': 'https://github.com/graphsense/blob/master/CHANGELOG.md', 20 | 'Tracker': 'https://github.com/graphsense/graphsense-python/issues', 21 | } 22 | 23 | REQUIRES = [ 24 | "urllib3 >= 1.25.3", 25 | "python-dateutil", 26 | {{#asyncio}} 27 | "aiohttp >= 3.0.0", 28 | {{/asyncio}} 29 | {{#tornado}} 30 | "tornado>=4.2,<5", 31 | {{/tornado}} 32 | {{#hasHttpSignatureMethods}} 33 | "pem>=19.3.0", 34 | "pycryptodome>=3.9.0", 35 | {{/hasHttpSignatureMethods}} 36 | ] 37 | 38 | with open("README.md", 'r') as f: 39 | long_description = f.read() 40 | 41 | setup( 42 | name=NAME, 43 | version=VERSION, 44 | description="{{appName}}", 45 | author="{{#infoName}}{{infoName}}{{/infoName}}{{^infoName}}OpenAPI Generator community{{/infoName}}", 46 | author_email="{{#infoEmail}}{{infoEmail}}{{/infoEmail}}{{^infoEmail}}team@openapitools.org{{/infoEmail}}", 47 | url="https://graphsense.github.io/", 48 | project_urls=project_urls, 49 | keywords=["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"], 50 | python_requires=">=3.6", 51 | install_requires=REQUIRES, 52 | packages=find_packages(exclude=["test", "tests"]), 53 | include_package_data=True, 54 | {{#licenseInfo}}license="{{licenseInfo}}", 55 | {{/licenseInfo}}long_description=long_description, 56 | long_description_content_type = "text/markdown; charset=UTF-8; variant=GFM" 57 | ) 58 | {{/-last}} 59 | {{/apis}} 60 | {{/apiInfo}} 61 | -------------------------------------------------------------------------------- /templates/README.mustache: -------------------------------------------------------------------------------- 1 | # {{{projectName}}} 2 | {{#appDescriptionWithNewLines}} 3 | {{{appDescriptionWithNewLines}}} 4 | {{/appDescriptionWithNewLines}} 5 | 6 | This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: 7 | 8 | - API version: {{appVersion}} 9 | - Package version: {{appVersion}} 10 | {{^hideGenerationTimestamp}} 11 | - Build date: {{generatedDate}} 12 | {{/hideGenerationTimestamp}} 13 | - Build package: {{generatorClass}} 14 | {{#infoUrl}} 15 | For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) 16 | {{/infoUrl}} 17 | 18 | ## Requirements. 19 | 20 | Python >= 3.6 21 | 22 | ## Installation & Usage 23 | ### pip install 24 | 25 | If the python package is hosted on a repository, you can install directly using: 26 | 27 | ```sh 28 | pip install git+https://github.com/graphsense/graphsense-python.git 29 | ``` 30 | (you may need to run `pip` with root permission: `sudo pip install git+https://github.com/graphsense/graphsense-python.git`) 31 | 32 | Then import the package: 33 | ```python 34 | import {{{packageName}}} 35 | ``` 36 | 37 | ### Setuptools 38 | 39 | Install via [Setuptools](http://pypi.python.org/pypi/setuptools). 40 | 41 | ```sh 42 | python setup.py install --user 43 | ``` 44 | (or `sudo python setup.py install` to install the package for all users) 45 | 46 | Then import the package: 47 | ```python 48 | import {{{packageName}}} 49 | ``` 50 | 51 | ## Getting Started 52 | 53 | Please follow the [installation procedure](#installation--usage) and then run the following: 54 | 55 | {{> README_common }} 56 | 57 | ## Generation from OpenAPI specification 58 | 59 | This python package has been generated from [Graphsense's OpenAPI specification]({{basePath}}) hosted by [Iknaio Cryptoasset Analytics GmbH](https://ikna.io) using this command: 60 | 61 | ``` 62 | make GS_REST_SERVICE_URL="{{basePath}}" generate-openapi-client 63 | ``` 64 | 65 | -------------------------------------------------------------------------------- /docs/Tx.md: -------------------------------------------------------------------------------- 1 | # Tx 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **tx_type** | **str** | | defaults to "account" 8 | **inputs** | [**TxValues**](TxValues.md) | | [optional] 9 | **outputs** | [**TxValues**](TxValues.md) | | [optional] 10 | **token_tx_id** | **int** | identifies a specific token transaction within a tx_hash, (deprecated) use identifier instead in encapsulates all information that uniquely identifies the transaction | [optional] 11 | **contract_creation** | **bool** | Indicates if this transaction created a new contract. Recipient address is the address of the new contract. | [optional] 12 | **currency** | **str** | crypto currency code | [optional] 13 | **tx_hash** | **str** | Transaction hash | [optional] 14 | **coinbase** | **bool** | Coinbase transaction flag | [optional] 15 | **height** | [**Height**](Height.md) | | [optional] 16 | **no_inputs** | **int** | number of input addresses | [optional] 17 | **no_outputs** | **int** | number of output addresses | [optional] 18 | **timestamp** | **int** | Timestamp in posix seconds format | [optional] 19 | **total_input** | [**Values**](Values.md) | | [optional] 20 | **total_output** | [**Values**](Values.md) | | [optional] 21 | **identifier** | **str** | uniquely identifies a transaction or a sub transaction like a token transaction or trace. | [optional] 22 | **network** | **str** | crypto currency code | [optional] 23 | **value** | [**Values**](Values.md) | | [optional] 24 | **from_address** | **str** | Address | [optional] 25 | **to_address** | **str** | Address | [optional] 26 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 27 | 28 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 29 | 30 | 31 | -------------------------------------------------------------------------------- /templates/api_doc_example.mustache: -------------------------------------------------------------------------------- 1 | ```python 2 | import time 3 | from dateutil.parser import parse as dateutil_parser 4 | import {{{packageName}}} 5 | from {{apiPackage}} import {{classVarName}} 6 | {{#imports}} 7 | {{{.}}} 8 | {{/imports}} 9 | from pprint import pprint 10 | {{> python_doc_auth_partial}} 11 | # Enter a context with an instance of the API client 12 | {{#hasAuthMethods}} 13 | with {{{packageName}}}.ApiClient(configuration) as api_client: 14 | {{/hasAuthMethods}} 15 | {{^hasAuthMethods}} 16 | with {{{packageName}}}.ApiClient() as api_client: 17 | {{/hasAuthMethods}} 18 | # Create an instance of the API class 19 | api_instance = {{classVarName}}.{{{classname}}}(api_client) 20 | {{#requiredParams}} 21 | {{^defaultValue}} 22 | {{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}} 23 | {{/defaultValue}} 24 | {{/requiredParams}} 25 | {{#optionalParams}} 26 | {{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/defaultValue}} 27 | {{/optionalParams}} 28 | {{#requiredParams}} 29 | {{#-last}} 30 | 31 | # example passing only required values which don't have defaults set 32 | try: 33 | {{#summary}} 34 | # {{{.}}} 35 | {{/summary}} 36 | {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#requiredParams}}{{^defaultValue}}{{paramName}}{{^-last}}, {{/-last}}{{/defaultValue}}{{/requiredParams}}) 37 | {{#returnType}} 38 | pprint(api_response) 39 | {{/returnType}} 40 | except {{{packageName}}}.ApiException as e: 41 | print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) 42 | {{/-last}} 43 | {{/requiredParams}} 44 | {{#optionalParams}} 45 | {{#-last}} 46 | 47 | # example passing only required values which don't have defaults set 48 | # and optional values 49 | try: 50 | {{#summary}} 51 | # {{{.}}} 52 | {{/summary}} 53 | {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#requiredParams}}{{^defaultValue}}{{paramName}}, {{/defaultValue}}{{/requiredParams}}{{#optionalParams}}{{paramName}}={{paramName}}{{^-last}}, {{/-last}}{{/optionalParams}}) 54 | {{#returnType}} 55 | pprint(api_response) 56 | {{/returnType}} 57 | except {{{packageName}}}.ApiException as e: 58 | print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) 59 | {{/-last}} 60 | {{/optionalParams}} 61 | {{^requiredParams}} 62 | {{^optionalParams}} 63 | 64 | # example, this endpoint has no required or optional parameters 65 | try: 66 | {{#summary}} 67 | # {{{.}}} 68 | {{/summary}} 69 | {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}() 70 | {{#returnType}} 71 | pprint(api_response) 72 | {{/returnType}} 73 | except {{{packageName}}}.ApiException as e: 74 | print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) 75 | {{/optionalParams}} 76 | {{/requiredParams}} 77 | ``` 78 | -------------------------------------------------------------------------------- /graphsense/models/__init__.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | 3 | # import all models into this package 4 | # if you have many models here with many references from one model to another this may 5 | # raise a RecursionError 6 | # to avoid this, import only the models that you directly need like: 7 | # from from graphsense.model.pet import Pet 8 | # or import this package, but before doing it, use: 9 | # import sys 10 | # sys.setrecursionlimit(n) 11 | 12 | from graphsense.model.actor import Actor 13 | from graphsense.model.actor_context import ActorContext 14 | from graphsense.model.actors import Actors 15 | from graphsense.model.address import Address 16 | from graphsense.model.address_tag import AddressTag 17 | from graphsense.model.address_tag_all_of import AddressTagAllOf 18 | from graphsense.model.address_tags import AddressTags 19 | from graphsense.model.address_tx import AddressTx 20 | from graphsense.model.address_tx_utxo import AddressTxUtxo 21 | from graphsense.model.address_txs import AddressTxs 22 | from graphsense.model.block import Block 23 | from graphsense.model.block_at_date import BlockAtDate 24 | from graphsense.model.concept import Concept 25 | from graphsense.model.currency_stats import CurrencyStats 26 | from graphsense.model.entity import Entity 27 | from graphsense.model.entity_addresses import EntityAddresses 28 | from graphsense.model.external_conversions import ExternalConversions 29 | from graphsense.model.height import Height 30 | from graphsense.model.label_summary import LabelSummary 31 | from graphsense.model.labeled_item_ref import LabeledItemRef 32 | from graphsense.model.labeled_item_refs import LabeledItemRefs 33 | from graphsense.model.link import Link 34 | from graphsense.model.link_utxo import LinkUtxo 35 | from graphsense.model.links import Links 36 | from graphsense.model.neighbor_address import NeighborAddress 37 | from graphsense.model.neighbor_addresses import NeighborAddresses 38 | from graphsense.model.neighbor_entities import NeighborEntities 39 | from graphsense.model.neighbor_entity import NeighborEntity 40 | from graphsense.model.rate import Rate 41 | from graphsense.model.rates import Rates 42 | from graphsense.model.search_result import SearchResult 43 | from graphsense.model.search_result_by_currency import SearchResultByCurrency 44 | from graphsense.model.search_result_labels import SearchResultLabels 45 | from graphsense.model.search_result_leaf import SearchResultLeaf 46 | from graphsense.model.search_result_level1 import SearchResultLevel1 47 | from graphsense.model.search_result_level2 import SearchResultLevel2 48 | from graphsense.model.search_result_level3 import SearchResultLevel3 49 | from graphsense.model.search_result_level4 import SearchResultLevel4 50 | from graphsense.model.search_result_level5 import SearchResultLevel5 51 | from graphsense.model.search_result_level6 import SearchResultLevel6 52 | from graphsense.model.stats import Stats 53 | from graphsense.model.tag import Tag 54 | from graphsense.model.tag_cloud_entry import TagCloudEntry 55 | from graphsense.model.tag_summary import TagSummary 56 | from graphsense.model.taxonomy import Taxonomy 57 | from graphsense.model.token_config import TokenConfig 58 | from graphsense.model.token_configs import TokenConfigs 59 | from graphsense.model.token_values import TokenValues 60 | from graphsense.model.tx import Tx 61 | from graphsense.model.tx_account import TxAccount 62 | from graphsense.model.tx_ref import TxRef 63 | from graphsense.model.tx_summary import TxSummary 64 | from graphsense.model.tx_utxo import TxUtxo 65 | from graphsense.model.tx_value import TxValue 66 | from graphsense.model.tx_values import TxValues 67 | from graphsense.model.txs_account import TxsAccount 68 | from graphsense.model.user_reported_tag import UserReportedTag 69 | from graphsense.model.values import Values 70 | -------------------------------------------------------------------------------- /docs/TokensApi.md: -------------------------------------------------------------------------------- 1 | # graphsense.TokensApi 2 | 3 | All URIs are relative to *https://api.ikna.io* 4 | 5 | Method | HTTP request | Description 6 | ------------- | ------------- | ------------- 7 | [**list_supported_tokens**](TokensApi.md#list_supported_tokens) | **GET** /{currency}/supported_tokens | Returns a list of supported token (sub)currencies 8 | 9 | 10 | # **list_supported_tokens** 11 | > TokenConfigs list_supported_tokens(currency) 12 | 13 | Returns a list of supported token (sub)currencies 14 | 15 | ### Example 16 | 17 | * Api Key Authentication (api_key): 18 | ```python 19 | import time 20 | from dateutil.parser import parse as dateutil_parser 21 | import graphsense 22 | from graphsense.api import tokens_api 23 | from graphsense.model.token_configs import TokenConfigs 24 | from pprint import pprint 25 | # Defining the host is optional and defaults to https://api.ikna.io 26 | # See configuration.py for a list of all supported configuration parameters. 27 | configuration = graphsense.Configuration( 28 | host = "https://api.ikna.io" 29 | ) 30 | 31 | # The client must configure the authentication and authorization parameters 32 | # in accordance with the API server security policy. 33 | # Examples for each auth method are provided below, use the example that 34 | # satisfies your auth use case. 35 | 36 | # Configure API key authorization: api_key 37 | configuration.api_key['api_key'] = 'YOUR_API_KEY' 38 | 39 | # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 40 | # configuration.api_key_prefix['api_key'] = 'Bearer' 41 | 42 | # Enter a context with an instance of the API client 43 | with graphsense.ApiClient(configuration) as api_client: 44 | # Create an instance of the API class 45 | api_instance = tokens_api.TokensApi(api_client) 46 | currency = "btc" # str | The cryptocurrency code (e.g., btc) 47 | 48 | # example passing only required values which don't have defaults set 49 | try: 50 | # Returns a list of supported token (sub)currencies 51 | api_response = api_instance.list_supported_tokens(currency) 52 | pprint(api_response) 53 | except graphsense.ApiException as e: 54 | print("Exception when calling TokensApi->list_supported_tokens: %s\n" % e) 55 | ``` 56 | 57 | 58 | ### Parameters 59 | 60 | Name | Type | Description | Notes 61 | ------------- | ------------- | ------------- | ------------- 62 | **currency** | **str**| The cryptocurrency code (e.g., btc) | 63 | **_preload_content** | **bool** | If False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. | [optional] default is True. 64 | **async_req** | **bool** | Execute request asynchronously | [optional] default is False. 65 | 66 | ### Return type 67 | 68 | [**TokenConfigs**](TokenConfigs.md) 69 | 70 | **Notes:** 71 | 72 | * If `async_req` parameter is True, the request will be called asynchronously. The method will return the request thread. If parameter `async_req` is False or missing, then the method will return the response directly. 73 | 74 | * If the HTTP response code is `429 Too Many Requests` due to rate limit policies, the underlying `urllib3` HTTP client will automatically stall the request as long as advised by the `Retry-After` header. 75 | 76 | ### Authorization 77 | 78 | [api_key](../README.md#api_key) 79 | 80 | ### HTTP request headers 81 | 82 | - **Content-Type**: Not defined 83 | - **Accept**: application/json 84 | 85 | 86 | ### HTTP response details 87 | | Status code | Description | Response headers | 88 | |-------------|-------------|------------------| 89 | **200** | OK | - | 90 | 91 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) 92 | 93 | -------------------------------------------------------------------------------- /docs/RatesApi.md: -------------------------------------------------------------------------------- 1 | # graphsense.RatesApi 2 | 3 | All URIs are relative to *https://api.ikna.io* 4 | 5 | Method | HTTP request | Description 6 | ------------- | ------------- | ------------- 7 | [**get_exchange_rates**](RatesApi.md#get_exchange_rates) | **GET** /{currency}/rates/{height} | Returns exchange rate for a given height 8 | 9 | 10 | # **get_exchange_rates** 11 | > Rates get_exchange_rates(currency, height) 12 | 13 | Returns exchange rate for a given height 14 | 15 | ### Example 16 | 17 | * Api Key Authentication (api_key): 18 | ```python 19 | import time 20 | from dateutil.parser import parse as dateutil_parser 21 | import graphsense 22 | from graphsense.api import rates_api 23 | from graphsense.model.rates import Rates 24 | from graphsense.model.height import Height 25 | from pprint import pprint 26 | # Defining the host is optional and defaults to https://api.ikna.io 27 | # See configuration.py for a list of all supported configuration parameters. 28 | configuration = graphsense.Configuration( 29 | host = "https://api.ikna.io" 30 | ) 31 | 32 | # The client must configure the authentication and authorization parameters 33 | # in accordance with the API server security policy. 34 | # Examples for each auth method are provided below, use the example that 35 | # satisfies your auth use case. 36 | 37 | # Configure API key authorization: api_key 38 | configuration.api_key['api_key'] = 'YOUR_API_KEY' 39 | 40 | # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 41 | # configuration.api_key_prefix['api_key'] = 'Bearer' 42 | 43 | # Enter a context with an instance of the API client 44 | with graphsense.ApiClient(configuration) as api_client: 45 | # Create an instance of the API class 46 | api_instance = rates_api.RatesApi(api_client) 47 | currency = "btc" # str | The cryptocurrency code (e.g., btc) 48 | height = Height(1) # Height | The block height 49 | 50 | # example passing only required values which don't have defaults set 51 | try: 52 | # Returns exchange rate for a given height 53 | api_response = api_instance.get_exchange_rates(currency, height) 54 | pprint(api_response) 55 | except graphsense.ApiException as e: 56 | print("Exception when calling RatesApi->get_exchange_rates: %s\n" % e) 57 | ``` 58 | 59 | 60 | ### Parameters 61 | 62 | Name | Type | Description | Notes 63 | ------------- | ------------- | ------------- | ------------- 64 | **currency** | **str**| The cryptocurrency code (e.g., btc) | 65 | **height** | **Height**| The block height | 66 | **_preload_content** | **bool** | If False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. | [optional] default is True. 67 | **async_req** | **bool** | Execute request asynchronously | [optional] default is False. 68 | 69 | ### Return type 70 | 71 | [**Rates**](Rates.md) 72 | 73 | **Notes:** 74 | 75 | * If `async_req` parameter is True, the request will be called asynchronously. The method will return the request thread. If parameter `async_req` is False or missing, then the method will return the response directly. 76 | 77 | * If the HTTP response code is `429 Too Many Requests` due to rate limit policies, the underlying `urllib3` HTTP client will automatically stall the request as long as advised by the `Retry-After` header. 78 | 79 | ### Authorization 80 | 81 | [api_key](../README.md#api_key) 82 | 83 | ### HTTP request headers 84 | 85 | - **Content-Type**: Not defined 86 | - **Accept**: application/json 87 | 88 | 89 | ### HTTP response details 90 | | Status code | Description | Response headers | 91 | |-------------|-------------|------------------| 92 | **200** | OK | - | 93 | 94 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) 95 | 96 | -------------------------------------------------------------------------------- /templates/README_common.mustache: -------------------------------------------------------------------------------- 1 | ```python 2 | {{#apiInfo}}{{#apis}}{{#-last}}{{#hasHttpSignatureMethods}}import datetime{{/hasHttpSignatureMethods}}{{/-last}}{{/apis}}{{/apiInfo}} 3 | import time 4 | import {{{packageName}}} 5 | from pprint import pprint 6 | {{#apiInfo}} 7 | {{#apis}} 8 | {{#-first}} 9 | from {{apiPackage}} import {{classVarName}} 10 | {{#imports}} 11 | {{{import}}} 12 | {{/imports}} 13 | {{#operations}} 14 | {{#operation}} 15 | {{#-first}} 16 | {{> python_doc_auth_partial}} 17 | 18 | # Enter a context with an instance of the API client 19 | with {{{packageName}}}.ApiClient(configuration) as api_client: 20 | # Create an instance of the API class 21 | api_instance = {{classVarName}}.{{{classname}}}(api_client) 22 | {{#allParams}} 23 | {{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} 24 | {{/allParams}} 25 | 26 | try: 27 | {{#summary}} # {{{.}}} 28 | {{/summary}} {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}} 29 | pprint(api_response){{/returnType}} 30 | except {{{packageName}}}.ApiException as e: 31 | print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) 32 | {{/-first}} 33 | {{/operation}} 34 | {{/operations}} 35 | {{/-first}} 36 | {{/apis}} 37 | {{/apiInfo}} 38 | ``` 39 | 40 | ## Documentation for API Endpoints 41 | 42 | All URIs are relative to *{{basePath}}* 43 | 44 | Class | Method | HTTP request | Description 45 | ------------ | ------------- | ------------- | ------------- 46 | {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} 47 | {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} 48 | 49 | ## Documentation For Models 50 | 51 | {{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) 52 | {{/model}}{{/models}} 53 | 54 | ## Documentation For Authorization 55 | 56 | {{^authMethods}} 57 | All endpoints do not require authorization. 58 | {{/authMethods}} 59 | {{#authMethods}} 60 | {{#last}} Authentication schemes defined for the API:{{/last}} 61 | ## {{{name}}} 62 | 63 | {{#isApiKey}} 64 | - **Type**: API key 65 | - **API key parameter name**: {{{keyParamName}}} 66 | - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} 67 | {{/isApiKey}} 68 | {{#isBasic}} 69 | {{#isBasicBasic}} 70 | - **Type**: HTTP basic authentication 71 | {{/isBasicBasic}} 72 | {{#isBasicBearer}} 73 | - **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} 74 | {{/isBasicBearer}} 75 | {{#isHttpSignature}} 76 | - **Type**: HTTP signature authentication 77 | {{/isHttpSignature}} 78 | {{/isBasic}} 79 | {{#isOAuth}} 80 | - **Type**: OAuth 81 | - **Flow**: {{{flow}}} 82 | - **Authorization URL**: {{{authorizationUrl}}} 83 | - **Scopes**: {{^scopes}}N/A{{/scopes}} 84 | {{#scopes}} - **{{{scope}}}**: {{{description}}} 85 | {{/scopes}} 86 | {{/isOAuth}} 87 | 88 | {{/authMethods}} 89 | 90 | ## Examples 91 | 92 | In `./examples` you can find example Python scripts and [Jupyter](https://jupyter.org/) notebooks demonstrating how to use the GraphSense Python API. Please Follow these setup instructions to run them: 93 | 94 | Setup a Python environment with [Anaconda](https://www.anaconda.com/products/distribution): 95 | 96 | conda env create -f environment.yml 97 | conda activate graphsense-python 98 | 99 | Copy the config temp file and enter your Iknaio API key 100 | 101 | cp config.json.tmp config.json 102 | vi config.json 103 | 104 | Run the jupyter notebooks 105 | 106 | jupyter notebook 107 | 108 | -------------------------------------------------------------------------------- /templates/api_doc.mustache: -------------------------------------------------------------------------------- 1 | # {{packageName}}.{{classname}}{{#description}} 2 | {{description}}{{/description}} 3 | 4 | All URIs are relative to *{{basePath}}* 5 | 6 | Method | HTTP request | Description 7 | ------------- | ------------- | ------------- 8 | {{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} 9 | {{/operation}}{{/operations}} 10 | 11 | {{#operations}} 12 | {{#operation}} 13 | # **{{{operationId}}}** 14 | > {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}({{#requiredParams}}{{^defaultValue}}{{paramName}}{{^-last}}, {{/-last}}{{/defaultValue}}{{/requiredParams}}) 15 | 16 | {{{summary}}}{{#notes}} 17 | 18 | {{{notes}}}{{/notes}} 19 | 20 | ### Example 21 | 22 | {{#hasAuthMethods}} 23 | {{#authMethods}} 24 | {{#isBasic}} 25 | {{#isBasicBasic}} 26 | * Basic Authentication ({{name}}): 27 | {{/isBasicBasic}} 28 | {{#isBasicBearer}} 29 | * Bearer{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} Authentication ({{name}}): 30 | {{/isBasicBearer}} 31 | {{/isBasic}} 32 | {{#isApiKey}} 33 | * Api Key Authentication ({{name}}): 34 | {{/isApiKey }} 35 | {{#isOAuth}} 36 | * OAuth Authentication ({{name}}): 37 | {{/isOAuth }} 38 | {{/authMethods}} 39 | {{/hasAuthMethods}} 40 | {{> api_doc_example }} 41 | 42 | ### Parameters 43 | {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} 44 | Name | Type | Description | Notes 45 | ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} 46 | {{#requiredParams}}{{^defaultValue}} **{{paramName}}** | {{^baseType}}**{{dataType}}**{{/baseType}}{{#baseType}}[**{{dataType}}**]({{baseType}}.md){{/baseType}}| {{description}} | 47 | {{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}} **{{paramName}}** | {{^baseType}}**{{dataType}}**{{/baseType}}{{#baseType}}[**{{dataType}}**]({{baseType}}.md){{/baseType}}| {{description}} | defaults to {{{.}}} 48 | {{/defaultValue}}{{/requiredParams}}{{#optionalParams}} **{{paramName}}** | {{^baseType}}**{{dataType}}**{{/baseType}}{{#baseType}}[**{{dataType}}**]({{baseType}}.md){{/baseType}}| {{description}} | [optional]{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}} 49 | {{/optionalParams}} 50 | **_preload_content** | **bool** | If False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. | [optional] default is True. 51 | **async_req** | **bool** | Execute request asynchronously | [optional] default is False. 52 | 53 | ### Return type 54 | 55 | {{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}} 56 | 57 | **Notes:** 58 | 59 | * If `async_req` parameter is True, the request will be called asynchronously. The method will return the request thread. If parameter `async_req` is False or missing, then the method will return the response directly. 60 | 61 | * If the HTTP response code is `429 Too Many Requests` due to rate limit policies, the underlying `urllib3` HTTP client will automatically stall the request as long as advised by the `Retry-After` header. 62 | 63 | ### Authorization 64 | 65 | {{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}} 66 | 67 | ### HTTP request headers 68 | 69 | - **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} 70 | - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} 71 | 72 | {{#responses.0}} 73 | 74 | ### HTTP response details 75 | | Status code | Description | Response headers | 76 | |-------------|-------------|------------------| 77 | {{#responses}} 78 | **{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}} | 79 | {{/responses}} 80 | {{/responses.0}} 81 | 82 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) 83 | 84 | {{/operation}} 85 | {{/operations}} 86 | -------------------------------------------------------------------------------- /graphsense/exceptions.py: -------------------------------------------------------------------------------- 1 | """ 2 | GraphSense API 3 | 4 | GraphSense API provides programmatic access to various ledgers' addresses, entities, blocks, transactions and tags for automated and highly efficient forensics tasks. # noqa: E501 5 | 6 | The version of the OpenAPI document: 1.13.3 7 | Contact: contact@ikna.io 8 | Generated by: https://openapi-generator.tech 9 | """ 10 | 11 | 12 | 13 | class OpenApiException(Exception): 14 | """The base exception class for all OpenAPIExceptions""" 15 | 16 | 17 | class ApiTypeError(OpenApiException, TypeError): 18 | def __init__(self, msg, path_to_item=None, valid_classes=None, 19 | key_type=None): 20 | """ Raises an exception for TypeErrors 21 | 22 | Args: 23 | msg (str): the exception message 24 | 25 | Keyword Args: 26 | path_to_item (list): a list of keys an indices to get to the 27 | current_item 28 | None if unset 29 | valid_classes (tuple): the primitive classes that current item 30 | should be an instance of 31 | None if unset 32 | key_type (bool): False if our value is a value in a dict 33 | True if it is a key in a dict 34 | False if our item is an item in a list 35 | None if unset 36 | """ 37 | self.path_to_item = path_to_item 38 | self.valid_classes = valid_classes 39 | self.key_type = key_type 40 | full_msg = msg 41 | if path_to_item: 42 | full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) 43 | super(ApiTypeError, self).__init__(full_msg) 44 | 45 | 46 | class ApiValueError(OpenApiException, ValueError): 47 | def __init__(self, msg, path_to_item=None): 48 | """ 49 | Args: 50 | msg (str): the exception message 51 | 52 | Keyword Args: 53 | path_to_item (list) the path to the exception in the 54 | received_data dict. None if unset 55 | """ 56 | 57 | self.path_to_item = path_to_item 58 | full_msg = msg 59 | if path_to_item: 60 | full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) 61 | super(ApiValueError, self).__init__(full_msg) 62 | 63 | 64 | class ApiAttributeError(OpenApiException, AttributeError): 65 | def __init__(self, msg, path_to_item=None): 66 | """ 67 | Raised when an attribute reference or assignment fails. 68 | 69 | Args: 70 | msg (str): the exception message 71 | 72 | Keyword Args: 73 | path_to_item (None/list) the path to the exception in the 74 | received_data dict 75 | """ 76 | self.path_to_item = path_to_item 77 | full_msg = msg 78 | if path_to_item: 79 | full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) 80 | super(ApiAttributeError, self).__init__(full_msg) 81 | 82 | 83 | class ApiKeyError(OpenApiException, KeyError): 84 | def __init__(self, msg, path_to_item=None): 85 | """ 86 | Args: 87 | msg (str): the exception message 88 | 89 | Keyword Args: 90 | path_to_item (None/list) the path to the exception in the 91 | received_data dict 92 | """ 93 | self.path_to_item = path_to_item 94 | full_msg = msg 95 | if path_to_item: 96 | full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) 97 | super(ApiKeyError, self).__init__(full_msg) 98 | 99 | 100 | class ApiException(OpenApiException): 101 | 102 | def __init__(self, status=None, reason=None, http_resp=None): 103 | if http_resp: 104 | self.status = http_resp.status 105 | self.reason = http_resp.reason 106 | self.body = http_resp.data 107 | self.headers = http_resp.getheaders() 108 | else: 109 | self.status = status 110 | self.reason = reason 111 | self.body = None 112 | self.headers = None 113 | 114 | def __str__(self): 115 | """Custom error messages for exception""" 116 | error_message = "({0})\n"\ 117 | "Reason: {1}\n".format(self.status, self.reason) 118 | if self.headers: 119 | error_message += "HTTP response headers: {0}\n".format( 120 | self.headers) 121 | 122 | if self.body: 123 | error_message += "HTTP response body: {0}\n".format(self.body) 124 | 125 | return error_message 126 | 127 | 128 | class NotFoundException(ApiException): 129 | 130 | def __init__(self, status=None, reason=None, http_resp=None): 131 | super(NotFoundException, self).__init__(status, reason, http_resp) 132 | 133 | 134 | class UnauthorizedException(ApiException): 135 | 136 | def __init__(self, status=None, reason=None, http_resp=None): 137 | super(UnauthorizedException, self).__init__(status, reason, http_resp) 138 | 139 | 140 | class ForbiddenException(ApiException): 141 | 142 | def __init__(self, status=None, reason=None, http_resp=None): 143 | super(ForbiddenException, self).__init__(status, reason, http_resp) 144 | 145 | 146 | class ServiceException(ApiException): 147 | 148 | def __init__(self, status=None, reason=None, http_resp=None): 149 | super(ServiceException, self).__init__(status, reason, http_resp) 150 | 151 | 152 | def render_path(path_to_item): 153 | """Returns a string representation of a path""" 154 | result = "" 155 | for pth in path_to_item: 156 | if isinstance(pth, int): 157 | result += "[{0}]".format(pth) 158 | else: 159 | result += "['{0}']".format(pth) 160 | return result 161 | -------------------------------------------------------------------------------- /graphsense/api/tokens_api.py: -------------------------------------------------------------------------------- 1 | """ 2 | GraphSense API 3 | 4 | GraphSense API provides programmatic access to various ledgers' addresses, entities, blocks, transactions and tags for automated and highly efficient forensics tasks. # noqa: E501 5 | 6 | The version of the OpenAPI document: 1.13.3 7 | Contact: contact@ikna.io 8 | Generated by: https://openapi-generator.tech 9 | """ 10 | 11 | 12 | import re # noqa: F401 13 | import sys # noqa: F401 14 | 15 | from graphsense.api_client import ApiClient, Endpoint as _Endpoint 16 | from graphsense.model_utils import ( # noqa: F401 17 | check_allowed_values, 18 | check_validations, 19 | date, 20 | datetime, 21 | file_type, 22 | none_type, 23 | validate_and_convert_types 24 | ) 25 | from graphsense.model.token_configs import TokenConfigs 26 | 27 | 28 | class TokensApi(object): 29 | """NOTE: This class is auto generated by OpenAPI Generator 30 | Ref: https://openapi-generator.tech 31 | 32 | Do not edit the class manually. 33 | """ 34 | 35 | def __init__(self, api_client=None): 36 | if api_client is None: 37 | api_client = ApiClient() 38 | self.api_client = api_client 39 | 40 | def __list_supported_tokens( 41 | self, 42 | currency, 43 | **kwargs 44 | ): 45 | """Returns a list of supported token (sub)currencies # noqa: E501 46 | 47 | This method makes a synchronous HTTP request by default. To make an 48 | asynchronous HTTP request, please pass async_req=True 49 | 50 | >>> thread = api.list_supported_tokens(currency, async_req=True) 51 | >>> result = thread.get() 52 | 53 | Args: 54 | currency (str): The cryptocurrency code (e.g., btc) 55 | 56 | Keyword Args: 57 | _return_http_data_only (bool): response data without head status 58 | code and headers. Default is True. 59 | _preload_content (bool): if False, the urllib3.HTTPResponse object 60 | will be returned without reading/decoding response data. 61 | Default is True. 62 | _request_timeout (int/float/tuple): timeout setting for this request. If 63 | one number provided, it will be total request timeout. It can also 64 | be a pair (tuple) of (connection, read) timeouts. 65 | Default is None. 66 | _check_input_type (bool): specifies if type checking 67 | should be done one the data sent to the server. 68 | Default is True. 69 | _check_return_type (bool): specifies if type checking 70 | should be done one the data received from the server. 71 | Default is True. 72 | _host_index (int/None): specifies the index of the server 73 | that we want to use. 74 | Default is read from the configuration. 75 | async_req (bool): execute request asynchronously 76 | 77 | Returns: 78 | TokenConfigs 79 | If the method is called asynchronously, returns the request 80 | thread. 81 | """ 82 | kwargs['async_req'] = kwargs.get( 83 | 'async_req', False 84 | ) 85 | kwargs['_return_http_data_only'] = kwargs.get( 86 | '_return_http_data_only', True 87 | ) 88 | kwargs['_preload_content'] = kwargs.get( 89 | '_preload_content', True 90 | ) 91 | kwargs['_request_timeout'] = kwargs.get( 92 | '_request_timeout', None 93 | ) 94 | kwargs['_check_input_type'] = kwargs.get( 95 | '_check_input_type', True 96 | ) 97 | kwargs['_check_return_type'] = kwargs.get( 98 | '_check_return_type', True 99 | ) 100 | kwargs['_host_index'] = kwargs.get('_host_index') 101 | kwargs['currency'] = \ 102 | currency 103 | return self.call_with_http_info(**kwargs) 104 | 105 | self.list_supported_tokens = _Endpoint( 106 | settings={ 107 | 'response_type': (TokenConfigs,), 108 | 'auth': [ 109 | 'api_key' 110 | ], 111 | 'endpoint_path': '/{currency}/supported_tokens', 112 | 'operation_id': 'list_supported_tokens', 113 | 'http_method': 'GET', 114 | 'servers': None, 115 | }, 116 | params_map={ 117 | 'all': [ 118 | 'currency', 119 | ], 120 | 'required': [ 121 | 'currency', 122 | ], 123 | 'nullable': [ 124 | ], 125 | 'enum': [ 126 | ], 127 | 'validation': [ 128 | ] 129 | }, 130 | root_map={ 131 | 'validations': { 132 | }, 133 | 'allowed_values': { 134 | }, 135 | 'openapi_types': { 136 | 'currency': 137 | (str,), 138 | }, 139 | 'attribute_map': { 140 | 'currency': 'currency', 141 | }, 142 | 'location_map': { 143 | 'currency': 'path', 144 | }, 145 | 'collection_format_map': { 146 | } 147 | }, 148 | headers_map={ 149 | 'accept': [ 150 | 'application/json' 151 | ], 152 | 'content_type': [], 153 | }, 154 | api_client=api_client, 155 | callable=__list_supported_tokens 156 | ) 157 | -------------------------------------------------------------------------------- /graphsense/api/rates_api.py: -------------------------------------------------------------------------------- 1 | """ 2 | GraphSense API 3 | 4 | GraphSense API provides programmatic access to various ledgers' addresses, entities, blocks, transactions and tags for automated and highly efficient forensics tasks. # noqa: E501 5 | 6 | The version of the OpenAPI document: 1.13.3 7 | Contact: contact@ikna.io 8 | Generated by: https://openapi-generator.tech 9 | """ 10 | 11 | 12 | import re # noqa: F401 13 | import sys # noqa: F401 14 | 15 | from graphsense.api_client import ApiClient, Endpoint as _Endpoint 16 | from graphsense.model_utils import ( # noqa: F401 17 | check_allowed_values, 18 | check_validations, 19 | date, 20 | datetime, 21 | file_type, 22 | none_type, 23 | validate_and_convert_types 24 | ) 25 | from graphsense.model.height import Height 26 | from graphsense.model.rates import Rates 27 | 28 | 29 | class RatesApi(object): 30 | """NOTE: This class is auto generated by OpenAPI Generator 31 | Ref: https://openapi-generator.tech 32 | 33 | Do not edit the class manually. 34 | """ 35 | 36 | def __init__(self, api_client=None): 37 | if api_client is None: 38 | api_client = ApiClient() 39 | self.api_client = api_client 40 | 41 | def __get_exchange_rates( 42 | self, 43 | currency, 44 | height, 45 | **kwargs 46 | ): 47 | """Returns exchange rate for a given height # noqa: E501 48 | 49 | This method makes a synchronous HTTP request by default. To make an 50 | asynchronous HTTP request, please pass async_req=True 51 | 52 | >>> thread = api.get_exchange_rates(currency, height, async_req=True) 53 | >>> result = thread.get() 54 | 55 | Args: 56 | currency (str): The cryptocurrency code (e.g., btc) 57 | height (Height): The block height 58 | 59 | Keyword Args: 60 | _return_http_data_only (bool): response data without head status 61 | code and headers. Default is True. 62 | _preload_content (bool): if False, the urllib3.HTTPResponse object 63 | will be returned without reading/decoding response data. 64 | Default is True. 65 | _request_timeout (int/float/tuple): timeout setting for this request. If 66 | one number provided, it will be total request timeout. It can also 67 | be a pair (tuple) of (connection, read) timeouts. 68 | Default is None. 69 | _check_input_type (bool): specifies if type checking 70 | should be done one the data sent to the server. 71 | Default is True. 72 | _check_return_type (bool): specifies if type checking 73 | should be done one the data received from the server. 74 | Default is True. 75 | _host_index (int/None): specifies the index of the server 76 | that we want to use. 77 | Default is read from the configuration. 78 | async_req (bool): execute request asynchronously 79 | 80 | Returns: 81 | Rates 82 | If the method is called asynchronously, returns the request 83 | thread. 84 | """ 85 | kwargs['async_req'] = kwargs.get( 86 | 'async_req', False 87 | ) 88 | kwargs['_return_http_data_only'] = kwargs.get( 89 | '_return_http_data_only', True 90 | ) 91 | kwargs['_preload_content'] = kwargs.get( 92 | '_preload_content', True 93 | ) 94 | kwargs['_request_timeout'] = kwargs.get( 95 | '_request_timeout', None 96 | ) 97 | kwargs['_check_input_type'] = kwargs.get( 98 | '_check_input_type', True 99 | ) 100 | kwargs['_check_return_type'] = kwargs.get( 101 | '_check_return_type', True 102 | ) 103 | kwargs['_host_index'] = kwargs.get('_host_index') 104 | kwargs['currency'] = \ 105 | currency 106 | kwargs['height'] = \ 107 | height 108 | return self.call_with_http_info(**kwargs) 109 | 110 | self.get_exchange_rates = _Endpoint( 111 | settings={ 112 | 'response_type': (Rates,), 113 | 'auth': [ 114 | 'api_key' 115 | ], 116 | 'endpoint_path': '/{currency}/rates/{height}', 117 | 'operation_id': 'get_exchange_rates', 118 | 'http_method': 'GET', 119 | 'servers': None, 120 | }, 121 | params_map={ 122 | 'all': [ 123 | 'currency', 124 | 'height', 125 | ], 126 | 'required': [ 127 | 'currency', 128 | 'height', 129 | ], 130 | 'nullable': [ 131 | ], 132 | 'enum': [ 133 | ], 134 | 'validation': [ 135 | ] 136 | }, 137 | root_map={ 138 | 'validations': { 139 | }, 140 | 'allowed_values': { 141 | }, 142 | 'openapi_types': { 143 | 'currency': 144 | (str,), 145 | 'height': 146 | (Height,), 147 | }, 148 | 'attribute_map': { 149 | 'currency': 'currency', 150 | 'height': 'height', 151 | }, 152 | 'location_map': { 153 | 'currency': 'path', 154 | 'height': 'path', 155 | }, 156 | 'collection_format_map': { 157 | } 158 | }, 159 | headers_map={ 160 | 'accept': [ 161 | 'application/json' 162 | ], 163 | 'content_type': [], 164 | }, 165 | api_client=api_client, 166 | callable=__get_exchange_rates 167 | ) 168 | -------------------------------------------------------------------------------- /docs/GeneralApi.md: -------------------------------------------------------------------------------- 1 | # graphsense.GeneralApi 2 | 3 | All URIs are relative to *https://api.ikna.io* 4 | 5 | Method | HTTP request | Description 6 | ------------- | ------------- | ------------- 7 | [**get_statistics**](GeneralApi.md#get_statistics) | **GET** /stats | Get statistics of supported currencies 8 | [**search**](GeneralApi.md#search) | **GET** /search | Returns matching addresses, transactions and labels 9 | 10 | 11 | # **get_statistics** 12 | > Stats get_statistics() 13 | 14 | Get statistics of supported currencies 15 | 16 | ### Example 17 | 18 | ```python 19 | import time 20 | from dateutil.parser import parse as dateutil_parser 21 | import graphsense 22 | from graphsense.api import general_api 23 | from graphsense.model.stats import Stats 24 | from pprint import pprint 25 | # Defining the host is optional and defaults to https://api.ikna.io 26 | # See configuration.py for a list of all supported configuration parameters. 27 | configuration = graphsense.Configuration( 28 | host = "https://api.ikna.io" 29 | ) 30 | 31 | 32 | # Enter a context with an instance of the API client 33 | with graphsense.ApiClient() as api_client: 34 | # Create an instance of the API class 35 | api_instance = general_api.GeneralApi(api_client) 36 | 37 | # example, this endpoint has no required or optional parameters 38 | try: 39 | # Get statistics of supported currencies 40 | api_response = api_instance.get_statistics() 41 | pprint(api_response) 42 | except graphsense.ApiException as e: 43 | print("Exception when calling GeneralApi->get_statistics: %s\n" % e) 44 | ``` 45 | 46 | 47 | ### Parameters 48 | This endpoint does not need any parameter. 49 | **_preload_content** | **bool** | If False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. | [optional] default is True. 50 | **async_req** | **bool** | Execute request asynchronously | [optional] default is False. 51 | 52 | ### Return type 53 | 54 | [**Stats**](Stats.md) 55 | 56 | **Notes:** 57 | 58 | * If `async_req` parameter is True, the request will be called asynchronously. The method will return the request thread. If parameter `async_req` is False or missing, then the method will return the response directly. 59 | 60 | * If the HTTP response code is `429 Too Many Requests` due to rate limit policies, the underlying `urllib3` HTTP client will automatically stall the request as long as advised by the `Retry-After` header. 61 | 62 | ### Authorization 63 | 64 | No authorization required 65 | 66 | ### HTTP request headers 67 | 68 | - **Content-Type**: Not defined 69 | - **Accept**: application/json 70 | 71 | 72 | ### HTTP response details 73 | | Status code | Description | Response headers | 74 | |-------------|-------------|------------------| 75 | **200** | OK | - | 76 | 77 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) 78 | 79 | # **search** 80 | > SearchResult search(q) 81 | 82 | Returns matching addresses, transactions and labels 83 | 84 | ### Example 85 | 86 | * Api Key Authentication (api_key): 87 | ```python 88 | import time 89 | from dateutil.parser import parse as dateutil_parser 90 | import graphsense 91 | from graphsense.api import general_api 92 | from graphsense.model.search_result import SearchResult 93 | from pprint import pprint 94 | # Defining the host is optional and defaults to https://api.ikna.io 95 | # See configuration.py for a list of all supported configuration parameters. 96 | configuration = graphsense.Configuration( 97 | host = "https://api.ikna.io" 98 | ) 99 | 100 | # The client must configure the authentication and authorization parameters 101 | # in accordance with the API server security policy. 102 | # Examples for each auth method are provided below, use the example that 103 | # satisfies your auth use case. 104 | 105 | # Configure API key authorization: api_key 106 | configuration.api_key['api_key'] = 'YOUR_API_KEY' 107 | 108 | # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 109 | # configuration.api_key_prefix['api_key'] = 'Bearer' 110 | 111 | # Enter a context with an instance of the API client 112 | with graphsense.ApiClient(configuration) as api_client: 113 | # Create an instance of the API class 114 | api_instance = general_api.GeneralApi(api_client) 115 | q = "foo" # str | It can be (the beginning of) an address, a transaction or a label 116 | currency = "btc" # str | The cryptocurrency (e.g., btc) (optional) 117 | limit = 10 # int | Maximum number of search results (optional) if omitted the server will use the default value of 10 118 | 119 | # example passing only required values which don't have defaults set 120 | try: 121 | # Returns matching addresses, transactions and labels 122 | api_response = api_instance.search(q) 123 | pprint(api_response) 124 | except graphsense.ApiException as e: 125 | print("Exception when calling GeneralApi->search: %s\n" % e) 126 | 127 | # example passing only required values which don't have defaults set 128 | # and optional values 129 | try: 130 | # Returns matching addresses, transactions and labels 131 | api_response = api_instance.search(q, currency=currency, limit=limit) 132 | pprint(api_response) 133 | except graphsense.ApiException as e: 134 | print("Exception when calling GeneralApi->search: %s\n" % e) 135 | ``` 136 | 137 | 138 | ### Parameters 139 | 140 | Name | Type | Description | Notes 141 | ------------- | ------------- | ------------- | ------------- 142 | **q** | **str**| It can be (the beginning of) an address, a transaction or a label | 143 | **currency** | **str**| The cryptocurrency (e.g., btc) | [optional] 144 | **limit** | **int**| Maximum number of search results | [optional] if omitted the server will use the default value of 10 145 | **_preload_content** | **bool** | If False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. | [optional] default is True. 146 | **async_req** | **bool** | Execute request asynchronously | [optional] default is False. 147 | 148 | ### Return type 149 | 150 | [**SearchResult**](SearchResult.md) 151 | 152 | **Notes:** 153 | 154 | * If `async_req` parameter is True, the request will be called asynchronously. The method will return the request thread. If parameter `async_req` is False or missing, then the method will return the response directly. 155 | 156 | * If the HTTP response code is `429 Too Many Requests` due to rate limit policies, the underlying `urllib3` HTTP client will automatically stall the request as long as advised by the `Retry-After` header. 157 | 158 | ### Authorization 159 | 160 | [api_key](../README.md#api_key) 161 | 162 | ### HTTP request headers 163 | 164 | - **Content-Type**: Not defined 165 | - **Accept**: application/json 166 | 167 | 168 | ### HTTP response details 169 | | Status code | Description | Response headers | 170 | |-------------|-------------|------------------| 171 | **200** | OK | - | 172 | 173 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) 174 | 175 | -------------------------------------------------------------------------------- /docs/BulkApi.md: -------------------------------------------------------------------------------- 1 | # graphsense.BulkApi 2 | 3 | Method | HTTP request | Description 4 | ------------- | ------------- | ------------- 5 | [**bulk_csv**](BulkApi.md#bulk_csv) | **POST** /{currency}/bulk.csv/{operation} | Get data as CSV in bulk 6 | [**bulk_json**](BulkApi.md#bulk_json) | **POST** /{currency}/bulk.json/{operation} | Get data as JSON in bulk 7 | 8 | 9 | # **bulk_csv** 10 | > str bulk_csv(currency, api, operation, body) 11 | 12 | Get data as CSV in bulk 13 | 14 | ### Example 15 | 16 | * Api Key Authentication (api_key): 17 | ```python 18 | import graphsense 19 | from graphsense.api import bulk_api 20 | from pprint import pprint 21 | import pandas 22 | # Defining the host is optional and defaults to https://api.ikna.io 23 | # See configuration.py for a list of all supported configuration parameters. 24 | configuration = graphsense.Configuration( 25 | host = "https://api.ikna.io" 26 | ) 27 | 28 | # The client must configure the authentication and authorization parameters 29 | # in accordance with the API server security policy. 30 | # Examples for each auth method are provided below, use the example that 31 | # satisfies your auth use case. 32 | 33 | # Configure API key authorization: api_key 34 | configuration.api_key['api_key'] = 'YOUR_API_KEY' 35 | 36 | # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 37 | # configuration.api_key_prefix['api_key'] = 'Bearer' 38 | 39 | # Enter a context with an instance of the API client 40 | with graphsense.ApiClient(configuration) as api_client: 41 | # Create an instance of the API class 42 | api_instance = bulk_api.BulkApi(api_client) 43 | currency = "btc" # str | The cryptocurrency (e.g., btc) 44 | operation = "get_block" # str | The operation to execute in bulk 45 | body = {"height": [1, 2, 3]} 46 | 47 | # example passing only required values which don't have defaults set 48 | try: 49 | # Get data as CSV in bulk 50 | api_response = api_instance.bulk_csv(currency, operation, body=body, num_pages=1) 51 | pprint(api_response) 52 | except graphsense.ApiException as e: 53 | print("Exception when calling BulkApi->bulk_csv: %s\n" % e) 54 | 55 | # It is also possible to read CSV data directly into a dataframe: 56 | 57 | dataframe = \ 58 | pandas.read_csv( 59 | api_instance.bulk_csv(currency, 60 | operation, 61 | body=body, 62 | num_pages=1, 63 | _preload_content=False # set to False to omit decoding 64 | )) 65 | pprint(dataframe) 66 | ``` 67 | 68 | 69 | ### Parameters 70 | 71 | Name | Type | Description | Notes 72 | ------------- | ------------- | ------------- | ------------- 73 | **currency** | **str**| The cryptocurrency (e.g., btc) | 74 | **operation** | **str**| The operation to execute in bulk | 75 | **body** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}**| Map of the operation's parameter names to (arrays of) values | 76 | **num_pages** | **int**| Number of pages to be retrieved per bulked request | 77 | **_preload_content** | **bool** | If False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. | [optional] default is True. 78 | **async_req** | **bool** | Execute request asynchronously | [optional] default is False. 79 | 80 | ### Return type 81 | 82 | **str** 83 | 84 | **Notes:** 85 | 86 | * If `async_req` parameter is True, the request will be called asynchronously. The method will return the request thread. If parameter `async_req` is False or missing, then the method will return the response directly. 87 | 88 | * If the HTTP response code is `429 Too Many Requests` due to rate limit policies, the underlying `urllib3` HTTP client will automatically stall the request as long as advised by the `Retry-After` header. 89 | 90 | ### Authorization 91 | 92 | [api_key](../README.md#api_key) 93 | 94 | ### HTTP request headers 95 | 96 | - **Content-Type**: application/json 97 | - **Accept**: text/csv 98 | 99 | 100 | ### HTTP response details 101 | | Status code | Description | Response headers | 102 | |-------------|-------------|------------------| 103 | **200** | OK | - | 104 | 105 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) 106 | 107 | # **bulk_json** 108 | > [{str: (bool, date, datetime, dict, float, int, list, str, none_type)}] bulk_json(currency, api, operation, body) 109 | 110 | Get data as JSON in bulk 111 | 112 | ### Example 113 | 114 | * Api Key Authentication (api_key): 115 | ```python 116 | import graphsense 117 | from graphsense.api import bulk_api 118 | from pprint import pprint 119 | # Defining the host is optional and defaults to https://api.ikna.io 120 | # See configuration.py for a list of all supported configuration parameters. 121 | configuration = graphsense.Configuration( 122 | host = "https://api.ikna.io" 123 | ) 124 | 125 | # The client must configure the authentication and authorization parameters 126 | # in accordance with the API server security policy. 127 | # Examples for each auth method are provided below, use the example that 128 | # satisfies your auth use case. 129 | 130 | # Configure API key authorization: api_key 131 | configuration.api_key['api_key'] = 'YOUR_API_KEY' 132 | 133 | # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 134 | # configuration.api_key_prefix['api_key'] = 'Bearer' 135 | 136 | # Enter a context with an instance of the API client 137 | with graphsense.ApiClient(configuration) as api_client: 138 | # Create an instance of the API class 139 | api_instance = bulk_api.BulkApi(api_client) 140 | currency = "btc" # str | The cryptocurrency (e.g., btc) 141 | operation = "get_block" # str | The operation to execute in bulk 142 | body = {"height": [1, 2, 3]} 143 | 144 | # example passing only required values which don't have defaults set 145 | try: 146 | # Get data as JSON in bulk 147 | api_response = api_instance.bulk_json(currency, operation, 1, body) 148 | pprint(api_response) 149 | except graphsense.ApiException as e: 150 | print("Exception when calling BulkApi->bulk_json: %s\n" % e) 151 | ``` 152 | 153 | 154 | ### Parameters 155 | 156 | Name | Type | Description | Notes 157 | ------------- | ------------- | ------------- | ------------- 158 | **currency** | **str**| The cryptocurrency (e.g., btc) | 159 | **operation** | **str**| The operation to execute in bulk | 160 | **body** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}**| Map of the operation's parameter names to (arrays of) values | 161 | **num_pages** | **int**| Number of pages to be retrieved per bulked request | 162 | **_preload_content** | **bool** | If False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. | [optional] default is True. 163 | **async_req** | **bool** | Execute request asynchronously | [optional] default is False. 164 | 165 | ### Return type 166 | 167 | **[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}]** 168 | 169 | **Notes:** 170 | 171 | * If `async_req` parameter is True, the request will be called asynchronously. The method will return the request thread. If parameter `async_req` is False or missing, then the method will return the response directly. 172 | 173 | * If the HTTP response code is `429 Too Many Requests` due to rate limit policies, the underlying `urllib3` HTTP client will automatically stall the request as long as advised by the `Retry-After` header. 174 | 175 | ### Authorization 176 | 177 | [api_key](../README.md#api_key) 178 | 179 | ### HTTP request headers 180 | 181 | - **Content-Type**: application/json 182 | - **Accept**: application/json 183 | 184 | 185 | ### HTTP response details 186 | | Status code | Description | Response headers | 187 | |-------------|-------------|------------------| 188 | **200** | OK | - | 189 | 190 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) 191 | 192 | -------------------------------------------------------------------------------- /examples/data/sextortion_addresses.json: -------------------------------------------------------------------------------- 1 | [ 2 | "1JwRp2J8bQcoG8XTUbxQZaEj9QB4RB6zEa", 3 | "1EZS92K4xJbymDLwG4F7PNF5idPE62e9XY", 4 | "16B4HuSAJ4WRdCq7dzA5b4ASh6QQ7ytZWB", 5 | "1EdX5vtBiHGmkqbJc7VRSuVMx9Kpgh53Tp", 6 | "3Ch7RPfwkJ3wHhiBfA4CNc8SagGdjbZwVs", 7 | "19GqTJDhu7A1qg7rnK3KS7tmCkCTMTz6xD", 8 | "1NMRCQMfhfVyAyuEubdfneE2H458Njog3v", 9 | "16XhmM7nPvR15eFdmVJs4QWcWpnYVS6FTv", 10 | "1EyXwmxKd74HeyqbZbmXJsNxmfpiPeAF3F", 11 | "1NPy1TBRyk6vMeGG3e5GaJWxYa9HbsNtDm", 12 | "15ZHnf1MPn6ybb8yUeAoCQ1AJtiKhg3NrP", 13 | "14VbGhtysr6wrNs7EhdKiS2NoMmMDBM8cn", 14 | "1ZWFbUTUEQw7VMCzWu1SzfPm9HaiqP6rX", 15 | "1BzkoGfrLtL59ZGjhKfvBwy47DEb6oba5f", 16 | "18eBGkYam1wjz1S77jz3VmADuYYFzhA3vB", 17 | "115i2xierq98FX3iWmj7yXog4bwQx3ACVg", 18 | "19p63VSjmRLPNP34ASWPEixUDYhvGQxTFK", 19 | "1BMEMw3Zw9NUTUiCUkJ93YNh88yrP7x3i4", 20 | "1GjZSJnpU4AfTS8vmre6rx7eQgeMUq8VYr", 21 | "16e6KPCPGy5RNAmsBFKKChe91PcjgLDN6o", 22 | "1PywiFKqQePnG6UqXdwKmvPZfJYAzowEDj", 23 | "13xLLPyFQXYMFggCTfJsL1LpYt1VhnfH8n", 24 | "1Jh1miFmhTmGQvn6Zejaqg85viD4k1vVjG", 25 | "1N7LjoXByqiTuHB2V8zmRRJ3YkBkougEZQ", 26 | "1AjgBp2S3GuD9pyySTZWgqsBpixDNosbDU", 27 | "1HVvzYDtecSwzn4yN7yjSqmy9vaBdUYHTV", 28 | "17ZLAibXo3yqHazH8cvvFZPawtM23bup2F", 29 | "3714n9rV3ijxRLe9Gu5UhXtizosnmLwTdn", 30 | "1Hw9ZhK8gryz9WNwvuXDKvrfHuknuYvfEj", 31 | "1ARGYc7nKo6QgBjqsoBFXUaJgAJC7CpBVU", 32 | "15o3nsrxKKJ5JK4w1WL5YpucWRauyWDGaF", 33 | "1Pau7aAFNZ5rvogxMnfP37zDAzoeipCqPP", 34 | "13bVw6ijN7NoHmsDbKtot6udu6su19B4tf", 35 | "1KeCBKUgQDyyMpaXhfpRi2qUvyrjcsT44o", 36 | "1e8o68StxCFLr6wdwKBrBqMQZc1VbFVMk", 37 | "1MbdGY1LVr6gEjyN3Rok5HQDQcjWbYmLds", 38 | "17ZERSZgd6GgtzdBrjZUKp82yVNVAGzq4M", 39 | "1DrCbXWfTqJbaiak2wjGUQiEo1WBzCBnof", 40 | "14gC9qX9PuitKB4nGNKa8mAxzBaC4UMdSq", 41 | "1FrsdbSmgh6jbRWbtZ3dWcohKoXz9UpPf2", 42 | "1JGnxrXhyTRKGwX29oNYdNYJby9UpUqvVf", 43 | "3Ke69oPecfzdhAhYUMCCbMSxsRuegg4m57", 44 | "1Pypmve5Q2ZP5wNgjGAChQ3vorAy5y4gcC", 45 | "1EkAVVDg8Rbwwa7j9DbvHQ7VmQ4FkBdEGT", 46 | "3DvxwiT25cxTycMDQqxyXhyzqnL5uZdavY", 47 | "16LBDius3vg6ufFvnc7PGXfiTZgphuZgr5", 48 | "12L7czMjP1P9Sd35of8jRsbgVcLmy22LQ2", 49 | "1DuDhqSWdmRxJjaRRSpa9wRH7yf9ncgw56", 50 | "1Lg61xNCT3YJQkzJsftrjhxQPsaZtzRx2y", 51 | "1BncH5WxBSYJ6mmcJC9bCRxQ6Z1evvtRxk", 52 | "1PjxMdF22GCcTKSTaky7ema3F5V4kjRxam", 53 | "1J5SXcupgaq2tUas5S7wVtf7evJp6YC3LJ", 54 | "13NGDY5sbiKkWN597BZ2AVsf7GUMewoRhV", 55 | "1MzHUdbH5LuaTntJTKTDpDL9vVQqAga2q8", 56 | "1PWrLfVSRra89P6hxxrMoYcDGQ7Af1dNdD", 57 | "14FWQ7WSHNFqLzQJvVRcuWyzNK3gu93yad", 58 | "1GdegtNpYcvoCPsMmyiSkZARDdAmYuXGXU", 59 | "35H5cWjj61Tk8grVxtQsH3z5D6R6hNxRVA", 60 | "18YDAf11psBJSavARQCwysE7E89zSEMfGG", 61 | "1JRCbCH9E3iLhSXPTqtkgfAsJNT2xD74C5", 62 | "1B1Vov1LTLGLcVG3ycPQhQLe81V67FZpMZ", 63 | "18Pt4B7Rz7Wf491FGQHPsfDeKRqnkyrMo6", 64 | "17xWa327xRku1y2far9aaxsz46GrdaxjND", 65 | "1Fd5wVoG3at4Setv8QMsXjLhS56FEQ19eH", 66 | "1AuXbXYsB6HQLpiEhFr2EYp3DDioJDv46H", 67 | "1DVU5Q2HQ4srFNSSaWBrVNMtL4pvBkfP5w", 68 | "1JgjcCi7sWmr3L7YXKaTAW2qoQdKztcSeu", 69 | "16FTEMtNaCEWzFRpkkBMqpuh18cbwU4KzM", 70 | "1BfxXVTtt6Mw39ZgEsHQshSrjnRAycCkmx", 71 | "12EMAbSboa1nvg518vcjvogSL4aDwaUCv9", 72 | "1CVkdrL8G1NjaTKw2JPXBiW86QgenJvhb8", 73 | "1PySaTv351ess2WFYRqVynNTmopzWcTzMY", 74 | "12VA3fnjCkJBYwgxffD138xXqFNYTWwV5w", 75 | "18wQ7Hem6eb4NLjgNsAxHgQKA5NJueHQYr", 76 | "1MfLPJxzyDZr33WK79BKzAqsuvFnzi9TK1", 77 | "11wQFVQ65DdfzWXqup3JdY7prFazMbXjc", 78 | "1HEmuDSTCH4PXCvwk6XNtXJiWnDg5GkJrP", 79 | "1QHEbZG8NQT6vYCC8pyHvteNcmJ78B3ak3", 80 | "1PWkGaj53fhxJH4mmB5iF6MuF4MysKDKuu", 81 | "1PcFYw7PQKUnj6RxqVwZ4TFuwWUPTyECKQ", 82 | "1KuUfck3gAcyABNG12MpJTZyraemMn45oF", 83 | "1FPYyLEY9Ra28xNTMy6ReGLhaR91fQ5ZZa", 84 | "1NkQMBosJTeN1zs1T4X3QM5BLFX24YPKys", 85 | "1NFnCeW8MBpqNJf9pdT7Qk8fpUgYJAZ1bh", 86 | "1UKR6XVqWCfS7jLDjijxKapU3UX6U3Nh6", 87 | "1G93wR2LDzd2euJ92ePbMGzZ2zpyDRWU4G", 88 | "321mn7uyfzoct3A7Rh7yuaF7XCYf3EmMzM", 89 | "1HRnCZDJ1coQG31Rni6xNyAoQwzfhndLt1", 90 | "1GL9JtXPRTPetxgiJ8UcgrEECp12spD4tt", 91 | "14bXUoPwruptLamUfKTuMW39Qy1q4ohX9w", 92 | "1122NYbAT2KkZDZ5TFvGy4D2Ut7eYfx4en", 93 | "17viZFKw1Xn8WQcpC6GwLqjzLTcE7qBJ93", 94 | "14XMwrqXdhz6YnShUuW37dTrKmpMFbJDHL", 95 | "1LwibmKAKu4kt4SvRLYdUP3aW7vL3Y78zL", 96 | "32rHze4Pe7p959C1xtDwzSuQJEGBXNVteR", 97 | "14mRSeeUCejfx323upnicNGDsiKv3sx4yW", 98 | "1PwENLsmQ2Z6b4EJfXDeeXKBj9v878uHRf", 99 | "1EBMu3FdAXiEK52JkStPd99f5a7RNuJB7A", 100 | "1GEhuEajkFXVe7vhtZqy1hRLdCaguhWBC2", 101 | "1HqUfvPooEY3fQPsuM4dRzq5uzTQjDoYpt", 102 | "1BSAHXc58m2DQGuzVaKXD15xeDrE4xYZna", 103 | "1ccop4dsYnPhumwgfULoGc3pAoTfDJjXS", 104 | "19EDGUoy7F1z4QjTpr67E7b6gn4uvefYJL", 105 | "1G1qFoadiDxa7zTvppSMJhJi63tNUL3cy7", 106 | "12anqVXhCjaZwLFredPKemVDan8wK7VQmt", 107 | "1D2NtiTeH381PbbdpemDKaYx3LScd9kfQ4", 108 | "1GQGhuojxxM5B13JoJhRsFh9Js9LT7XRYy", 109 | "3QC1HbLXcqL7Uj4znrLmc8PmgvUHVRAcLG", 110 | "14fDLVg9xQqpkrV3sQMPhvPFKqFpsLChUC", 111 | "16XDF4FzjLKPN92Vj6wxpLMCYPq2WssaHB", 112 | "1HBcDA2smi82YofmZr6DqyNfMb14RNBrLf", 113 | "1MnD2wsfzuz7WQXVqFwtGdAhQm4M7HPYCV", 114 | "1LK8rRhBTekN3Uxh8ib83FfmvMsX6EQnqL", 115 | "1JfcsTLZ2DcYvaAADE3Q7mcbme5kBccNtK", 116 | "1JTtwbvmM7ymByxPYCByVYCwasjH49J3Vj", 117 | "1FVuyuSN41aa3JN9sn8qkuD2PmaMEMHHnc", 118 | "1E5XMWQtyYnCY4LkLnjMtqBMQNnC1KS3m3", 119 | "1DwFLh8ChA1b1hhyW4DdoE9aQXEpUTZesB", 120 | "1LTtPpCBNeUYsF8Jt7pHSmYRvkATuzeXFU", 121 | "1YnYAxprVrTo1WzPPzMo86ste5Ssp4xsy", 122 | "16xXHkPvKb72cwqYmH1ZfBMaW5K3hFP6My", 123 | "1F6etz1UPY2Ci93ytrG5JXu4EovsUtuXCB", 124 | "196FGBPW7JzPNCNjRZLtvpn3s6Ugppgdt1", 125 | "185b8stEtQ4HTMbEX6tYRsy3ZG8qCy6oNx", 126 | "13H6Nszz1xP6Xn5tDKAUVWpm97vLfcNMVi", 127 | "17C8ZcK526319nwNU6hQ2jXNXc3ru78hKh", 128 | "15Vnk4P2ubtb5UJpU6VGSvATNp9sxjAPfy", 129 | "18QJdD5yWJyjeAapaSZEPoCQE84ncxwLAq", 130 | "1NgihVnUzPVbxJpWqci91UhMw1ACAiUoTw", 131 | "3JRKMDfhiMudTsjUxn4zzDhkpxnke4eGD4", 132 | "1AyRZviUxoBaCU1pJM5m7C1V2LdhPYiRcB", 133 | "1JcMavbj2ptD8xCMx8vqM7qLXPgMDGn58R", 134 | "17YKd1iJBxu616JEVo15PsXvk1mnQyEFVt", 135 | "19i2Zn4QMg5y9gDTRfLyPXaw2zY3ikPzqg", 136 | "1QFNFoWpvmxLywMFcaHT3QmwvnKHpWWgyF", 137 | "1ECRwZMLYqkFRcAujZmtWRnoojGHStfJZx", 138 | "1Q23GNAvmszFSR1AcK6u8gpFBjp1HpZqmm", 139 | "1F4nawRTZ1eDLAM4JmeV17i8nxZvmhPJph", 140 | "17aJNqdHX2GatX9fKGKUpkWBWEd9fpt7YF", 141 | "398Qz1Autx6HJbJwvejXVhw4mXAmBW2KsW", 142 | "1A7nmeXMjFd8unyg9hopifwBRpWu5MpqQw", 143 | "3P5yeiyWLciKi28yY22LdRntJucSuedTq4", 144 | "14dEvzyftZjrTjXaX5XXHo65C1rdsqCw1s", 145 | "1M3uh3QNTxVsK1MqR4cBdqajojUixCiwwq", 146 | "1CA74qzKno94zf3xFNvQ8TKR5sBpc6bimm", 147 | "33BqVgZedUZDC7svJCzj2e4yLEeVeqv6nM", 148 | "1EFBBqVxZ4H71TJXJDD7KNPpWMs35kTdVw", 149 | "1KGjDZ7RFV39r2q1JeSpZAF5L3fnpuenmT", 150 | "1DaFGaFRN3Fm8VodCERJ8F9DF7KBsewa1y", 151 | "1EGap2ZeR8pf9hfJ2KrSAQ1eYCPBcxJrqo", 152 | "1GGhxKFqxvgdB6Qnqx9xhY9ZkpwMJ6mkR1", 153 | "1FUU9x4SdBGETn2mNuoeZqzosGkjQLzEn5", 154 | "139XY4ZjWYqHMJvGCySuzXq7o6tGccKKrJ", 155 | "1FtrfX5z7CWB45P1d6bzPz7JMptp3WyaiM", 156 | "16jeoRDmhMAzzmnf1nr2eKftcHB6qGhCxU", 157 | "1PwmbaLCUBdBas9YevrmHkDoLwTWbxk97M", 158 | "1PfbxCJkGNTZC7yFtHHhtPnZyiwQEUqAmu", 159 | "182PJESsEWbuJ8PEgfM58p64jbok3i1gNU", 160 | "1QCoDAaqBXpkuDyR7M4uUdq2Rctpisp2Q7", 161 | "1EGMpZV7AnKKpNK9C1ziPMaQqNc9zVT4C", 162 | "1L47wHe7FXWQ6pfPTbnykdX44FxQGstFeS", 163 | "1C5ZC3ggaSHpPwzN6NCiaftqvcY1BPb4DY", 164 | "1FHPbKHcSx9CaXJzDpLoXG733ipQ77UNx9", 165 | "15FsDaUnH9YfHQ1W5n36iPJnhtU8Km2cax", 166 | "1Pdf1QMXH7e9957vhMskAFKQNi79eoa9Rm", 167 | "13DAd45ARMJW6th1cBuY1FwB9beVSzW77R", 168 | "17C34w7vtuj8fG8CZLDeLLa3AYJFEWM8Li", 169 | "1971pHPgLaTmuYtoH4BsGSfFMZaAjotium", 170 | "12m9psxbsR19YFNCyRtb8NcvMSLMDkMWK3", 171 | "1Lmk4eUXcmtVU6YQvaPJ4yihu4fEcKtkby", 172 | "17XHRucfd4kx3W5ty7ySLGiKHqmPUUdpus", 173 | "1DzM9y4fRgWqpZZCsvf5Rx4HupbE5Q5r4y", 174 | "1EcBg6WyjGtRxTxtfCQfEZTAtPwaVVa2wZ", 175 | "192CdbpYmpQhbpSZy5J9qyNE3YCxPpxdxv", 176 | "1LQBgAcogRPjk7LD7BJnC8VFmbpNb3kFEg", 177 | "1L7bVdwCCT98E1V8W8dN2s6F9Ryi5GnzdA", 178 | "14JLSAk9TKR6hVFswC6oRPoeAcydSecLFX", 179 | "19D67Tgb3neJiTHd8pZDEBYmUn2qSjxEeB", 180 | "16yJ7MQWTFNjsSvAJJMkjPpnJbAsGLYhW7", 181 | "1LKZ9Ji4m44mHgheazhSima54CCxZhT8Kn", 182 | "17zmnmqEUCesNz6UgXGbRk7fKnu8iq1q2J", 183 | "1FgfdebSqbXRciP2DXKJyqPSffX3Sx57RF", 184 | "1AUBQF2HNBKjS2KzDuz5Zu3sM8x5z47eH4", 185 | "19kjHnoEdtytyGHuNxEw83fkFtW5ERoQVh", 186 | "1BCGDtVZPqBMZWm5FdFe1RVgCGku17LZgb", 187 | "1L1vd6X1rRaBvTRYvTTD5M1c6hVnU9q3pp", 188 | "1J6mAeTBuBcTzzq3iFYq1ehavuhCbBrHuo", 189 | "1P55eXM8gxmwjSbqEpBWLBBvJQ7C1BmRH3", 190 | "1MuQXHNBcAbYyMvMsvHfnXdymeuoLAK14Z", 191 | "12ziVv4aQkZTA1gj86Y9uYQByG4CcdVcTA", 192 | "1CMQMKmvT4hz2k2ijyxVxN7fHS62K7uQ7z", 193 | "1PZp1Za8sDDYX4g2ztTpbqGa9eQao4zaQb", 194 | "1BPUUNghhuwQjDDvFd3TnJz2ato5dyDLr8", 195 | "3Jy5Ag9WYya7XD7aVwmRnpcrkehqnFhp5G", 196 | "18vVjgfyC6sbLEEJvYHTXoWeuupZDtqyNs", 197 | "1Q7e6U29yaeKtDVZGpRr33z2B7qpA1Rpbh", 198 | "18LhvTGJJueu2kQWVtoNFyoJwDS8S6Sqmo", 199 | "1HmfBw9qkqYbKzJFd1LJrdR5D3UWJe1vAN", 200 | "1CPqrZhxjNf28Ub3dzKUAdCUEFeWrN1apk", 201 | "17b1VPxMsea5u6eLQ8d5w5RkaG7hmtYvBP", 202 | "1GF8J1XRaiX2oHM7SQo9VAFAtWZcRgMncg", 203 | "1N2XZZDW5ofnyok6HawSaqzjBVFH5LNr74", 204 | "19ZfkZjtkU4DihmKE1yCyspqzanbGi8w58", 205 | "1FCGhC7ncVgfepxzaAzq8Qdq2ypjvfYHhF", 206 | "1BARBfTXdwaRenZjcG8t2LAsbQm6abfw13", 207 | "3GLxb6uz9gRZWjyCibf8RHfNMUE7sDQQeU", 208 | "1HkKgPbcMyfhrdPsbufTFczzVnhyT5snB3", 209 | "1BswBQiQrUMk3efFdTFZfnsgodB7xjrcGc", 210 | "1CuxwfoLpromv379gynSCjqy1ExbXDWhca", 211 | "1GR7rJfntdcbfhKT1s33RDby4z5ex1ou4Z", 212 | "142e8SgyTLnkvwkDkNNon9jMtKY4UDvQqr", 213 | "1AaSQ56Uzp6p5rU3hsPU8UNLZ5w6EVoyCK", 214 | "12Mr26cq6CnMFyG93ig6tNNR1wRDTpr1Jk", 215 | "1Aq77aob4mxfgfuD7Cs12GN2gv82kBJmYW", 216 | "1FF2wjexfHHiiuWwaA6dSEeA4WzAb4ezjU", 217 | "1HWnuWz77oXgbZLVBfB9fQAAgLCJJS7m7T", 218 | "1KJyocSnXRAM1y9Njqnp2eLK7TNwAwMhtk", 219 | "1Abx4ytuJ2Mb5HtuCpbUuUuJ1q8cdrXXYT", 220 | "17vzpL7n29egdeJF1hvUE4tKV81MqsW4wF", 221 | "1HBJE5XBsM8CK3gLQtzx8ofceKpp4mwPYU", 222 | "1KzMDhZLokkNd1kcxs2mgwXm97pVvnfRBC", 223 | "1CnQxRTP5WeGmwaSriYdefDEHyjWpY7tjw", 224 | "1HQ7wGdA5G9qUtM8jyDt5obDv1x3vEvjCy", 225 | "1A4ffsLWPYC8n7Dq4s4aiY5mzG4szuHx3M", 226 | "1PL9ewB1y3iC7EyuePDoPxJjwC4CgAvWTo", 227 | "144CDUeBhcwoEUmA2B1cL5p5PqZrhJWCCt", 228 | "1D1DZAac5chXcvULdRAk8nbxB5HWWbffwc", 229 | "1PH5CYMeD4ZLTZ2ZYnGLFmQRjnptyLNqcf", 230 | "1A6fQU7wLzwXdvR2nsS4YtbEBKyNim82pq", 231 | "1ANnnhQY6CVyLNBu9AkWzpiZaLPwE678cU", 232 | "17UrRFJn3xs4acGTd76rhDphJvMpwZuAwY", 233 | "15ECSN9MEkhqQiGeSZafFMH1R4jgJ9S668", 234 | "1FG7huiM8Jq8JdpULfvVDCHThZqVeKB96q", 235 | "1cGgSTTGBFbpjNXtXcWXYipALEDj8xSEC", 236 | "3FHGDPm2zTp7Po2LbCqxPYHQUrY1C8iedo", 237 | "19jST1xp4sT4u6qJwRE1ZNvNpiY43zikwq", 238 | "1MKRCZzAAfg9Az9nD7ojZy1tdonwAar2XU", 239 | "1LEJuBuc8bt6quD3TCGeX8o1EQ29qLErCc", 240 | "19rvCcYfSwPUSvJJKNyTyRFi5vxt6zaqJC", 241 | "12PUa2SHjWAUEpZZUxQNvxa7epab7g2Ksb", 242 | "1BC1pvPUQF9QHg73ha4AEAhaoEvg6HmTbS", 243 | "13QKq8RsvbJnLRbi5ZcVX1ziYW83tqvp1q", 244 | "1DiEqE5R1Ktu7QCLUuJN31PNtpoBU41x2E", 245 | "1NWybUp8ZJXKyDg2DR5MaePspforMPYbM3", 246 | "1KR7dmKjUjKsg7rLr32ikD3Gpyj7Aj2x4r" 247 | ] -------------------------------------------------------------------------------- /graphsense/api/general_api.py: -------------------------------------------------------------------------------- 1 | """ 2 | GraphSense API 3 | 4 | GraphSense API provides programmatic access to various ledgers' addresses, entities, blocks, transactions and tags for automated and highly efficient forensics tasks. # noqa: E501 5 | 6 | The version of the OpenAPI document: 1.13.3 7 | Contact: contact@ikna.io 8 | Generated by: https://openapi-generator.tech 9 | """ 10 | 11 | 12 | import re # noqa: F401 13 | import sys # noqa: F401 14 | 15 | from graphsense.api_client import ApiClient, Endpoint as _Endpoint 16 | from graphsense.model_utils import ( # noqa: F401 17 | check_allowed_values, 18 | check_validations, 19 | date, 20 | datetime, 21 | file_type, 22 | none_type, 23 | validate_and_convert_types 24 | ) 25 | from graphsense.model.search_result import SearchResult 26 | from graphsense.model.stats import Stats 27 | 28 | 29 | class GeneralApi(object): 30 | """NOTE: This class is auto generated by OpenAPI Generator 31 | Ref: https://openapi-generator.tech 32 | 33 | Do not edit the class manually. 34 | """ 35 | 36 | def __init__(self, api_client=None): 37 | if api_client is None: 38 | api_client = ApiClient() 39 | self.api_client = api_client 40 | 41 | def __get_statistics( 42 | self, 43 | **kwargs 44 | ): 45 | """Get statistics of supported currencies # noqa: E501 46 | 47 | This method makes a synchronous HTTP request by default. To make an 48 | asynchronous HTTP request, please pass async_req=True 49 | 50 | >>> thread = api.get_statistics(async_req=True) 51 | >>> result = thread.get() 52 | 53 | 54 | Keyword Args: 55 | _return_http_data_only (bool): response data without head status 56 | code and headers. Default is True. 57 | _preload_content (bool): if False, the urllib3.HTTPResponse object 58 | will be returned without reading/decoding response data. 59 | Default is True. 60 | _request_timeout (int/float/tuple): timeout setting for this request. If 61 | one number provided, it will be total request timeout. It can also 62 | be a pair (tuple) of (connection, read) timeouts. 63 | Default is None. 64 | _check_input_type (bool): specifies if type checking 65 | should be done one the data sent to the server. 66 | Default is True. 67 | _check_return_type (bool): specifies if type checking 68 | should be done one the data received from the server. 69 | Default is True. 70 | _host_index (int/None): specifies the index of the server 71 | that we want to use. 72 | Default is read from the configuration. 73 | async_req (bool): execute request asynchronously 74 | 75 | Returns: 76 | Stats 77 | If the method is called asynchronously, returns the request 78 | thread. 79 | """ 80 | kwargs['async_req'] = kwargs.get( 81 | 'async_req', False 82 | ) 83 | kwargs['_return_http_data_only'] = kwargs.get( 84 | '_return_http_data_only', True 85 | ) 86 | kwargs['_preload_content'] = kwargs.get( 87 | '_preload_content', True 88 | ) 89 | kwargs['_request_timeout'] = kwargs.get( 90 | '_request_timeout', None 91 | ) 92 | kwargs['_check_input_type'] = kwargs.get( 93 | '_check_input_type', True 94 | ) 95 | kwargs['_check_return_type'] = kwargs.get( 96 | '_check_return_type', True 97 | ) 98 | kwargs['_host_index'] = kwargs.get('_host_index') 99 | return self.call_with_http_info(**kwargs) 100 | 101 | self.get_statistics = _Endpoint( 102 | settings={ 103 | 'response_type': (Stats,), 104 | 'auth': [], 105 | 'endpoint_path': '/stats', 106 | 'operation_id': 'get_statistics', 107 | 'http_method': 'GET', 108 | 'servers': None, 109 | }, 110 | params_map={ 111 | 'all': [ 112 | ], 113 | 'required': [], 114 | 'nullable': [ 115 | ], 116 | 'enum': [ 117 | ], 118 | 'validation': [ 119 | ] 120 | }, 121 | root_map={ 122 | 'validations': { 123 | }, 124 | 'allowed_values': { 125 | }, 126 | 'openapi_types': { 127 | }, 128 | 'attribute_map': { 129 | }, 130 | 'location_map': { 131 | }, 132 | 'collection_format_map': { 133 | } 134 | }, 135 | headers_map={ 136 | 'accept': [ 137 | 'application/json' 138 | ], 139 | 'content_type': [], 140 | }, 141 | api_client=api_client, 142 | callable=__get_statistics 143 | ) 144 | 145 | def __search( 146 | self, 147 | q, 148 | **kwargs 149 | ): 150 | """Returns matching addresses, transactions and labels # noqa: E501 151 | 152 | This method makes a synchronous HTTP request by default. To make an 153 | asynchronous HTTP request, please pass async_req=True 154 | 155 | >>> thread = api.search(q, async_req=True) 156 | >>> result = thread.get() 157 | 158 | Args: 159 | q (str): It can be (the beginning of) an address, a transaction or a label 160 | 161 | Keyword Args: 162 | currency (str): The cryptocurrency (e.g., btc). [optional] 163 | limit (int): Maximum number of search results. [optional] if omitted the server will use the default value of 10 164 | _return_http_data_only (bool): response data without head status 165 | code and headers. Default is True. 166 | _preload_content (bool): if False, the urllib3.HTTPResponse object 167 | will be returned without reading/decoding response data. 168 | Default is True. 169 | _request_timeout (int/float/tuple): timeout setting for this request. If 170 | one number provided, it will be total request timeout. It can also 171 | be a pair (tuple) of (connection, read) timeouts. 172 | Default is None. 173 | _check_input_type (bool): specifies if type checking 174 | should be done one the data sent to the server. 175 | Default is True. 176 | _check_return_type (bool): specifies if type checking 177 | should be done one the data received from the server. 178 | Default is True. 179 | _host_index (int/None): specifies the index of the server 180 | that we want to use. 181 | Default is read from the configuration. 182 | async_req (bool): execute request asynchronously 183 | 184 | Returns: 185 | SearchResult 186 | If the method is called asynchronously, returns the request 187 | thread. 188 | """ 189 | kwargs['async_req'] = kwargs.get( 190 | 'async_req', False 191 | ) 192 | kwargs['_return_http_data_only'] = kwargs.get( 193 | '_return_http_data_only', True 194 | ) 195 | kwargs['_preload_content'] = kwargs.get( 196 | '_preload_content', True 197 | ) 198 | kwargs['_request_timeout'] = kwargs.get( 199 | '_request_timeout', None 200 | ) 201 | kwargs['_check_input_type'] = kwargs.get( 202 | '_check_input_type', True 203 | ) 204 | kwargs['_check_return_type'] = kwargs.get( 205 | '_check_return_type', True 206 | ) 207 | kwargs['_host_index'] = kwargs.get('_host_index') 208 | kwargs['q'] = \ 209 | q 210 | return self.call_with_http_info(**kwargs) 211 | 212 | self.search = _Endpoint( 213 | settings={ 214 | 'response_type': (SearchResult,), 215 | 'auth': [ 216 | 'api_key' 217 | ], 218 | 'endpoint_path': '/search', 219 | 'operation_id': 'search', 220 | 'http_method': 'GET', 221 | 'servers': None, 222 | }, 223 | params_map={ 224 | 'all': [ 225 | 'q', 226 | 'currency', 227 | 'limit', 228 | ], 229 | 'required': [ 230 | 'q', 231 | ], 232 | 'nullable': [ 233 | ], 234 | 'enum': [ 235 | ], 236 | 'validation': [ 237 | 'q', 238 | 'limit', 239 | ] 240 | }, 241 | root_map={ 242 | 'validations': { 243 | ('q',): { 244 | 245 | 'min_length': 2, 246 | }, 247 | ('limit',): { 248 | 249 | 'inclusive_maximum': 100, 250 | }, 251 | }, 252 | 'allowed_values': { 253 | }, 254 | 'openapi_types': { 255 | 'q': 256 | (str,), 257 | 'currency': 258 | (str,), 259 | 'limit': 260 | (int,), 261 | }, 262 | 'attribute_map': { 263 | 'q': 'q', 264 | 'currency': 'currency', 265 | 'limit': 'limit', 266 | }, 267 | 'location_map': { 268 | 'q': 'query', 269 | 'currency': 'query', 270 | 'limit': 'query', 271 | }, 272 | 'collection_format_map': { 273 | } 274 | }, 275 | headers_map={ 276 | 'accept': [ 277 | 'application/json' 278 | ], 279 | 'content_type': [], 280 | }, 281 | api_client=api_client, 282 | callable=__search 283 | ) 284 | -------------------------------------------------------------------------------- /docs/BlocksApi.md: -------------------------------------------------------------------------------- 1 | # graphsense.BlocksApi 2 | 3 | All URIs are relative to *https://api.ikna.io* 4 | 5 | Method | HTTP request | Description 6 | ------------- | ------------- | ------------- 7 | [**get_block**](BlocksApi.md#get_block) | **GET** /{currency}/blocks/{height} | Get a block by its height 8 | [**get_block_by_date**](BlocksApi.md#get_block_by_date) | **GET** /{currency}/block_by_date/{date} | Get the closest blocks given a timestamp 9 | [**list_block_txs**](BlocksApi.md#list_block_txs) | **GET** /{currency}/blocks/{height}/txs | Get block transactions 10 | 11 | 12 | # **get_block** 13 | > Block get_block(currency, height) 14 | 15 | Get a block by its height 16 | 17 | ### Example 18 | 19 | * Api Key Authentication (api_key): 20 | ```python 21 | import time 22 | from dateutil.parser import parse as dateutil_parser 23 | import graphsense 24 | from graphsense.api import blocks_api 25 | from graphsense.model.block import Block 26 | from graphsense.model.height import Height 27 | from pprint import pprint 28 | # Defining the host is optional and defaults to https://api.ikna.io 29 | # See configuration.py for a list of all supported configuration parameters. 30 | configuration = graphsense.Configuration( 31 | host = "https://api.ikna.io" 32 | ) 33 | 34 | # The client must configure the authentication and authorization parameters 35 | # in accordance with the API server security policy. 36 | # Examples for each auth method are provided below, use the example that 37 | # satisfies your auth use case. 38 | 39 | # Configure API key authorization: api_key 40 | configuration.api_key['api_key'] = 'YOUR_API_KEY' 41 | 42 | # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 43 | # configuration.api_key_prefix['api_key'] = 'Bearer' 44 | 45 | # Enter a context with an instance of the API client 46 | with graphsense.ApiClient(configuration) as api_client: 47 | # Create an instance of the API class 48 | api_instance = blocks_api.BlocksApi(api_client) 49 | currency = "btc" # str | The cryptocurrency code (e.g., btc) 50 | height = Height(1) # Height | The block height 51 | 52 | # example passing only required values which don't have defaults set 53 | try: 54 | # Get a block by its height 55 | api_response = api_instance.get_block(currency, height) 56 | pprint(api_response) 57 | except graphsense.ApiException as e: 58 | print("Exception when calling BlocksApi->get_block: %s\n" % e) 59 | ``` 60 | 61 | 62 | ### Parameters 63 | 64 | Name | Type | Description | Notes 65 | ------------- | ------------- | ------------- | ------------- 66 | **currency** | **str**| The cryptocurrency code (e.g., btc) | 67 | **height** | **Height**| The block height | 68 | **_preload_content** | **bool** | If False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. | [optional] default is True. 69 | **async_req** | **bool** | Execute request asynchronously | [optional] default is False. 70 | 71 | ### Return type 72 | 73 | [**Block**](Block.md) 74 | 75 | **Notes:** 76 | 77 | * If `async_req` parameter is True, the request will be called asynchronously. The method will return the request thread. If parameter `async_req` is False or missing, then the method will return the response directly. 78 | 79 | * If the HTTP response code is `429 Too Many Requests` due to rate limit policies, the underlying `urllib3` HTTP client will automatically stall the request as long as advised by the `Retry-After` header. 80 | 81 | ### Authorization 82 | 83 | [api_key](../README.md#api_key) 84 | 85 | ### HTTP request headers 86 | 87 | - **Content-Type**: Not defined 88 | - **Accept**: application/json 89 | 90 | 91 | ### HTTP response details 92 | | Status code | Description | Response headers | 93 | |-------------|-------------|------------------| 94 | **200** | OK | - | 95 | 96 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) 97 | 98 | # **get_block_by_date** 99 | > BlockAtDate get_block_by_date(currency, date) 100 | 101 | Get the closest blocks given a timestamp 102 | 103 | ### Example 104 | 105 | * Api Key Authentication (api_key): 106 | ```python 107 | import time 108 | from dateutil.parser import parse as dateutil_parser 109 | import graphsense 110 | from graphsense.api import blocks_api 111 | from graphsense.model.block_at_date import BlockAtDate 112 | from pprint import pprint 113 | # Defining the host is optional and defaults to https://api.ikna.io 114 | # See configuration.py for a list of all supported configuration parameters. 115 | configuration = graphsense.Configuration( 116 | host = "https://api.ikna.io" 117 | ) 118 | 119 | # The client must configure the authentication and authorization parameters 120 | # in accordance with the API server security policy. 121 | # Examples for each auth method are provided below, use the example that 122 | # satisfies your auth use case. 123 | 124 | # Configure API key authorization: api_key 125 | configuration.api_key['api_key'] = 'YOUR_API_KEY' 126 | 127 | # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 128 | # configuration.api_key_prefix['api_key'] = 'Bearer' 129 | 130 | # Enter a context with an instance of the API client 131 | with graphsense.ApiClient(configuration) as api_client: 132 | # Create an instance of the API class 133 | api_instance = blocks_api.BlocksApi(api_client) 134 | currency = "btc" # str | The cryptocurrency code (e.g., btc) 135 | date = dateutil_parser('2017-07-21T17:32:28Z') # datetime | The time of the block 136 | 137 | # example passing only required values which don't have defaults set 138 | try: 139 | # Get the closest blocks given a timestamp 140 | api_response = api_instance.get_block_by_date(currency, date) 141 | pprint(api_response) 142 | except graphsense.ApiException as e: 143 | print("Exception when calling BlocksApi->get_block_by_date: %s\n" % e) 144 | ``` 145 | 146 | 147 | ### Parameters 148 | 149 | Name | Type | Description | Notes 150 | ------------- | ------------- | ------------- | ------------- 151 | **currency** | **str**| The cryptocurrency code (e.g., btc) | 152 | **date** | **datetime**| The time of the block | 153 | **_preload_content** | **bool** | If False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. | [optional] default is True. 154 | **async_req** | **bool** | Execute request asynchronously | [optional] default is False. 155 | 156 | ### Return type 157 | 158 | [**BlockAtDate**](BlockAtDate.md) 159 | 160 | **Notes:** 161 | 162 | * If `async_req` parameter is True, the request will be called asynchronously. The method will return the request thread. If parameter `async_req` is False or missing, then the method will return the response directly. 163 | 164 | * If the HTTP response code is `429 Too Many Requests` due to rate limit policies, the underlying `urllib3` HTTP client will automatically stall the request as long as advised by the `Retry-After` header. 165 | 166 | ### Authorization 167 | 168 | [api_key](../README.md#api_key) 169 | 170 | ### HTTP request headers 171 | 172 | - **Content-Type**: Not defined 173 | - **Accept**: application/json 174 | 175 | 176 | ### HTTP response details 177 | | Status code | Description | Response headers | 178 | |-------------|-------------|------------------| 179 | **200** | OK | - | 180 | 181 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) 182 | 183 | # **list_block_txs** 184 | > [Tx] list_block_txs(currency, height) 185 | 186 | Get block transactions 187 | 188 | ### Example 189 | 190 | * Api Key Authentication (api_key): 191 | ```python 192 | import time 193 | from dateutil.parser import parse as dateutil_parser 194 | import graphsense 195 | from graphsense.api import blocks_api 196 | from graphsense.model.tx import Tx 197 | from graphsense.model.height import Height 198 | from pprint import pprint 199 | # Defining the host is optional and defaults to https://api.ikna.io 200 | # See configuration.py for a list of all supported configuration parameters. 201 | configuration = graphsense.Configuration( 202 | host = "https://api.ikna.io" 203 | ) 204 | 205 | # The client must configure the authentication and authorization parameters 206 | # in accordance with the API server security policy. 207 | # Examples for each auth method are provided below, use the example that 208 | # satisfies your auth use case. 209 | 210 | # Configure API key authorization: api_key 211 | configuration.api_key['api_key'] = 'YOUR_API_KEY' 212 | 213 | # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 214 | # configuration.api_key_prefix['api_key'] = 'Bearer' 215 | 216 | # Enter a context with an instance of the API client 217 | with graphsense.ApiClient(configuration) as api_client: 218 | # Create an instance of the API class 219 | api_instance = blocks_api.BlocksApi(api_client) 220 | currency = "btc" # str | The cryptocurrency code (e.g., btc) 221 | height = Height(1) # Height | The block height 222 | 223 | # example passing only required values which don't have defaults set 224 | try: 225 | # Get block transactions 226 | api_response = api_instance.list_block_txs(currency, height) 227 | pprint(api_response) 228 | except graphsense.ApiException as e: 229 | print("Exception when calling BlocksApi->list_block_txs: %s\n" % e) 230 | ``` 231 | 232 | 233 | ### Parameters 234 | 235 | Name | Type | Description | Notes 236 | ------------- | ------------- | ------------- | ------------- 237 | **currency** | **str**| The cryptocurrency code (e.g., btc) | 238 | **height** | **Height**| The block height | 239 | **_preload_content** | **bool** | If False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. | [optional] default is True. 240 | **async_req** | **bool** | Execute request asynchronously | [optional] default is False. 241 | 242 | ### Return type 243 | 244 | [**[Tx]**](Tx.md) 245 | 246 | **Notes:** 247 | 248 | * If `async_req` parameter is True, the request will be called asynchronously. The method will return the request thread. If parameter `async_req` is False or missing, then the method will return the response directly. 249 | 250 | * If the HTTP response code is `429 Too Many Requests` due to rate limit policies, the underlying `urllib3` HTTP client will automatically stall the request as long as advised by the `Retry-After` header. 251 | 252 | ### Authorization 253 | 254 | [api_key](../README.md#api_key) 255 | 256 | ### HTTP request headers 257 | 258 | - **Content-Type**: Not defined 259 | - **Accept**: application/json 260 | 261 | 262 | ### HTTP response details 263 | | Status code | Description | Response headers | 264 | |-------------|-------------|------------------| 265 | **200** | OK | - | 266 | 267 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) 268 | 269 | -------------------------------------------------------------------------------- /graphsense/model/token_values.py: -------------------------------------------------------------------------------- 1 | """ 2 | GraphSense API 3 | 4 | GraphSense API provides programmatic access to various ledgers' addresses, entities, blocks, transactions and tags for automated and highly efficient forensics tasks. # noqa: E501 5 | 6 | The version of the OpenAPI document: 1.13.3 7 | Contact: contact@ikna.io 8 | Generated by: https://openapi-generator.tech 9 | """ 10 | 11 | 12 | import re # noqa: F401 13 | import sys # noqa: F401 14 | 15 | from graphsense.model_utils import ( # noqa: F401 16 | ApiTypeError, 17 | ModelComposed, 18 | ModelNormal, 19 | ModelSimple, 20 | cached_property, 21 | change_keys_js_to_python, 22 | convert_js_args_to_python_args, 23 | date, 24 | datetime, 25 | file_type, 26 | none_type, 27 | validate_get_composed_info, 28 | ) 29 | from ..model_utils import OpenApiModel 30 | from graphsense.exceptions import ApiAttributeError 31 | 32 | 33 | def lazy_import(): 34 | from graphsense.model.values import Values 35 | globals()['Values'] = Values 36 | 37 | 38 | class TokenValues(ModelNormal): 39 | """NOTE: This class is auto generated by OpenAPI Generator. 40 | Ref: https://openapi-generator.tech 41 | 42 | Do not edit the class manually. 43 | 44 | Attributes: 45 | allowed_values (dict): The key is the tuple path to the attribute 46 | and the for var_name this is (var_name,). The value is a dict 47 | with a capitalized key describing the allowed value and an allowed 48 | value. These dicts store the allowed enum values. 49 | attribute_map (dict): The key is attribute name 50 | and the value is json key in definition. 51 | discriminator_value_class_map (dict): A dict to go from the discriminator 52 | variable value to the discriminator class name. 53 | validations (dict): The key is the tuple path to the attribute 54 | and the for var_name this is (var_name,). The value is a dict 55 | that stores validations for max_length, min_length, max_items, 56 | min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, 57 | inclusive_minimum, and regex. 58 | additional_properties_type (tuple): A tuple of classes accepted 59 | as additional properties values. 60 | """ 61 | 62 | allowed_values = { 63 | } 64 | 65 | validations = { 66 | } 67 | 68 | @cached_property 69 | def additional_properties_type(): 70 | """ 71 | This must be a method because a model may have properties that are 72 | of type self, this must run after the class is loaded 73 | """ 74 | lazy_import() 75 | return (Values,) # noqa: E501 76 | 77 | _nullable = False 78 | 79 | @cached_property 80 | def openapi_types(): 81 | """ 82 | This must be a method because a model may have properties that are 83 | of type self, this must run after the class is loaded 84 | 85 | Returns 86 | openapi_types (dict): The key is attribute name 87 | and the value is attribute type. 88 | """ 89 | lazy_import() 90 | return { 91 | } 92 | 93 | @cached_property 94 | def discriminator(): 95 | return None 96 | 97 | 98 | attribute_map = { 99 | } 100 | 101 | read_only_vars = { 102 | } 103 | 104 | _composed_schemas = {} 105 | 106 | @classmethod 107 | @convert_js_args_to_python_args 108 | def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 109 | """TokenValues - a model defined in OpenAPI 110 | 111 | Keyword Args: 112 | _check_type (bool): if True, values for parameters in openapi_types 113 | will be type checked and a TypeError will be 114 | raised if the wrong type is input. 115 | Defaults to True 116 | _path_to_item (tuple/list): This is a list of keys or values to 117 | drill down to the model in received_data 118 | when deserializing a response 119 | _spec_property_naming (bool): True if the variable names in the input data 120 | are serialized names, as specified in the OpenAPI document. 121 | False if the variable names in the input data 122 | are pythonic names, e.g. snake case (default) 123 | _configuration (Configuration): the instance to use when 124 | deserializing a file_type parameter. 125 | If passed, type conversion is attempted 126 | If omitted no type conversion is done. 127 | _visited_composed_classes (tuple): This stores a tuple of 128 | classes that we have traveled through so that 129 | if we see that class again we will not use its 130 | discriminator again. 131 | When traveling through a discriminator, the 132 | composed schema that is 133 | is traveled through is added to this set. 134 | For example if Animal has a discriminator 135 | petType and we pass in "Dog", and the class Dog 136 | allOf includes Animal, we move through Animal 137 | once using the discriminator, and pick Dog. 138 | Then in Dog, we will make an instance of the 139 | Animal class but this time we won't travel 140 | through its discriminator because we passed in 141 | _visited_composed_classes = (Animal,) 142 | """ 143 | 144 | _check_type = kwargs.pop('_check_type', True) 145 | _spec_property_naming = kwargs.pop('_spec_property_naming', False) 146 | _path_to_item = kwargs.pop('_path_to_item', ()) 147 | _configuration = kwargs.pop('_configuration', None) 148 | _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) 149 | 150 | self = super(OpenApiModel, cls).__new__(cls) 151 | 152 | if args: 153 | raise ApiTypeError( 154 | "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( 155 | args, 156 | self.__class__.__name__, 157 | ), 158 | path_to_item=_path_to_item, 159 | valid_classes=(self.__class__,), 160 | ) 161 | 162 | self._data_store = {} 163 | self._check_type = _check_type 164 | self._spec_property_naming = _spec_property_naming 165 | self._path_to_item = _path_to_item 166 | self._configuration = _configuration 167 | self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 168 | 169 | for var_name, var_value in kwargs.items(): 170 | if var_name not in self.attribute_map and \ 171 | self._configuration is not None and \ 172 | self._configuration.discard_unknown_keys and \ 173 | self.additional_properties_type is None: 174 | # discard variable. 175 | continue 176 | setattr(self, var_name, var_value) 177 | return self 178 | 179 | required_properties = set([ 180 | '_data_store', 181 | '_check_type', 182 | '_spec_property_naming', 183 | '_path_to_item', 184 | '_configuration', 185 | '_visited_composed_classes', 186 | ]) 187 | 188 | @convert_js_args_to_python_args 189 | def __init__(self, *args, **kwargs): # noqa: E501 190 | """TokenValues - a model defined in OpenAPI 191 | 192 | Keyword Args: 193 | _check_type (bool): if True, values for parameters in openapi_types 194 | will be type checked and a TypeError will be 195 | raised if the wrong type is input. 196 | Defaults to True 197 | _path_to_item (tuple/list): This is a list of keys or values to 198 | drill down to the model in received_data 199 | when deserializing a response 200 | _spec_property_naming (bool): True if the variable names in the input data 201 | are serialized names, as specified in the OpenAPI document. 202 | False if the variable names in the input data 203 | are pythonic names, e.g. snake case (default) 204 | _configuration (Configuration): the instance to use when 205 | deserializing a file_type parameter. 206 | If passed, type conversion is attempted 207 | If omitted no type conversion is done. 208 | _visited_composed_classes (tuple): This stores a tuple of 209 | classes that we have traveled through so that 210 | if we see that class again we will not use its 211 | discriminator again. 212 | When traveling through a discriminator, the 213 | composed schema that is 214 | is traveled through is added to this set. 215 | For example if Animal has a discriminator 216 | petType and we pass in "Dog", and the class Dog 217 | allOf includes Animal, we move through Animal 218 | once using the discriminator, and pick Dog. 219 | Then in Dog, we will make an instance of the 220 | Animal class but this time we won't travel 221 | through its discriminator because we passed in 222 | _visited_composed_classes = (Animal,) 223 | """ 224 | 225 | _check_type = kwargs.pop('_check_type', True) 226 | _spec_property_naming = kwargs.pop('_spec_property_naming', False) 227 | _path_to_item = kwargs.pop('_path_to_item', ()) 228 | _configuration = kwargs.pop('_configuration', None) 229 | _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) 230 | 231 | if args: 232 | raise ApiTypeError( 233 | "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( 234 | args, 235 | self.__class__.__name__, 236 | ), 237 | path_to_item=_path_to_item, 238 | valid_classes=(self.__class__,), 239 | ) 240 | 241 | self._data_store = {} 242 | self._check_type = _check_type 243 | self._spec_property_naming = _spec_property_naming 244 | self._path_to_item = _path_to_item 245 | self._configuration = _configuration 246 | self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 247 | 248 | for var_name, var_value in kwargs.items(): 249 | if var_name not in self.attribute_map and \ 250 | self._configuration is not None and \ 251 | self._configuration.discard_unknown_keys and \ 252 | self.additional_properties_type is None: 253 | # discard variable. 254 | continue 255 | setattr(self, var_name, var_value) 256 | if var_name in self.read_only_vars: 257 | raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 258 | f"class with read only attributes.") 259 | -------------------------------------------------------------------------------- /graphsense/model/tag_cloud_entry.py: -------------------------------------------------------------------------------- 1 | """ 2 | GraphSense API 3 | 4 | GraphSense API provides programmatic access to various ledgers' addresses, entities, blocks, transactions and tags for automated and highly efficient forensics tasks. # noqa: E501 5 | 6 | The version of the OpenAPI document: 1.13.3 7 | Contact: contact@ikna.io 8 | Generated by: https://openapi-generator.tech 9 | """ 10 | 11 | 12 | import re # noqa: F401 13 | import sys # noqa: F401 14 | 15 | from graphsense.model_utils import ( # noqa: F401 16 | ApiTypeError, 17 | ModelComposed, 18 | ModelNormal, 19 | ModelSimple, 20 | cached_property, 21 | change_keys_js_to_python, 22 | convert_js_args_to_python_args, 23 | date, 24 | datetime, 25 | file_type, 26 | none_type, 27 | validate_get_composed_info, 28 | ) 29 | from ..model_utils import OpenApiModel 30 | from graphsense.exceptions import ApiAttributeError 31 | 32 | 33 | 34 | class TagCloudEntry(ModelNormal): 35 | """NOTE: This class is auto generated by OpenAPI Generator. 36 | Ref: https://openapi-generator.tech 37 | 38 | Do not edit the class manually. 39 | 40 | Attributes: 41 | allowed_values (dict): The key is the tuple path to the attribute 42 | and the for var_name this is (var_name,). The value is a dict 43 | with a capitalized key describing the allowed value and an allowed 44 | value. These dicts store the allowed enum values. 45 | attribute_map (dict): The key is attribute name 46 | and the value is json key in definition. 47 | discriminator_value_class_map (dict): A dict to go from the discriminator 48 | variable value to the discriminator class name. 49 | validations (dict): The key is the tuple path to the attribute 50 | and the for var_name this is (var_name,). The value is a dict 51 | that stores validations for max_length, min_length, max_items, 52 | min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, 53 | inclusive_minimum, and regex. 54 | additional_properties_type (tuple): A tuple of classes accepted 55 | as additional properties values. 56 | """ 57 | 58 | allowed_values = { 59 | } 60 | 61 | validations = { 62 | } 63 | 64 | @cached_property 65 | def additional_properties_type(): 66 | """ 67 | This must be a method because a model may have properties that are 68 | of type self, this must run after the class is loaded 69 | """ 70 | return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 71 | 72 | _nullable = False 73 | 74 | @cached_property 75 | def openapi_types(): 76 | """ 77 | This must be a method because a model may have properties that are 78 | of type self, this must run after the class is loaded 79 | 80 | Returns 81 | openapi_types (dict): The key is attribute name 82 | and the value is attribute type. 83 | """ 84 | return { 85 | 'cnt': (int,), # noqa: E501 86 | 'weighted': (float,), # noqa: E501 87 | } 88 | 89 | @cached_property 90 | def discriminator(): 91 | return None 92 | 93 | 94 | attribute_map = { 95 | 'cnt': 'cnt', # noqa: E501 96 | 'weighted': 'weighted', # noqa: E501 97 | } 98 | 99 | read_only_vars = { 100 | } 101 | 102 | _composed_schemas = {} 103 | 104 | @classmethod 105 | @convert_js_args_to_python_args 106 | def _from_openapi_data(cls, cnt, weighted, *args, **kwargs): # noqa: E501 107 | """TagCloudEntry - a model defined in OpenAPI 108 | 109 | Args: 110 | cnt (int): 111 | weighted (float): 112 | 113 | Keyword Args: 114 | _check_type (bool): if True, values for parameters in openapi_types 115 | will be type checked and a TypeError will be 116 | raised if the wrong type is input. 117 | Defaults to True 118 | _path_to_item (tuple/list): This is a list of keys or values to 119 | drill down to the model in received_data 120 | when deserializing a response 121 | _spec_property_naming (bool): True if the variable names in the input data 122 | are serialized names, as specified in the OpenAPI document. 123 | False if the variable names in the input data 124 | are pythonic names, e.g. snake case (default) 125 | _configuration (Configuration): the instance to use when 126 | deserializing a file_type parameter. 127 | If passed, type conversion is attempted 128 | If omitted no type conversion is done. 129 | _visited_composed_classes (tuple): This stores a tuple of 130 | classes that we have traveled through so that 131 | if we see that class again we will not use its 132 | discriminator again. 133 | When traveling through a discriminator, the 134 | composed schema that is 135 | is traveled through is added to this set. 136 | For example if Animal has a discriminator 137 | petType and we pass in "Dog", and the class Dog 138 | allOf includes Animal, we move through Animal 139 | once using the discriminator, and pick Dog. 140 | Then in Dog, we will make an instance of the 141 | Animal class but this time we won't travel 142 | through its discriminator because we passed in 143 | _visited_composed_classes = (Animal,) 144 | """ 145 | 146 | _check_type = kwargs.pop('_check_type', True) 147 | _spec_property_naming = kwargs.pop('_spec_property_naming', False) 148 | _path_to_item = kwargs.pop('_path_to_item', ()) 149 | _configuration = kwargs.pop('_configuration', None) 150 | _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) 151 | 152 | self = super(OpenApiModel, cls).__new__(cls) 153 | 154 | if args: 155 | raise ApiTypeError( 156 | "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( 157 | args, 158 | self.__class__.__name__, 159 | ), 160 | path_to_item=_path_to_item, 161 | valid_classes=(self.__class__,), 162 | ) 163 | 164 | self._data_store = {} 165 | self._check_type = _check_type 166 | self._spec_property_naming = _spec_property_naming 167 | self._path_to_item = _path_to_item 168 | self._configuration = _configuration 169 | self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 170 | 171 | self.cnt = cnt 172 | self.weighted = weighted 173 | for var_name, var_value in kwargs.items(): 174 | if var_name not in self.attribute_map and \ 175 | self._configuration is not None and \ 176 | self._configuration.discard_unknown_keys and \ 177 | self.additional_properties_type is None: 178 | # discard variable. 179 | continue 180 | setattr(self, var_name, var_value) 181 | return self 182 | 183 | required_properties = set([ 184 | '_data_store', 185 | '_check_type', 186 | '_spec_property_naming', 187 | '_path_to_item', 188 | '_configuration', 189 | '_visited_composed_classes', 190 | ]) 191 | 192 | @convert_js_args_to_python_args 193 | def __init__(self, cnt, weighted, *args, **kwargs): # noqa: E501 194 | """TagCloudEntry - a model defined in OpenAPI 195 | 196 | Args: 197 | cnt (int): 198 | weighted (float): 199 | 200 | Keyword Args: 201 | _check_type (bool): if True, values for parameters in openapi_types 202 | will be type checked and a TypeError will be 203 | raised if the wrong type is input. 204 | Defaults to True 205 | _path_to_item (tuple/list): This is a list of keys or values to 206 | drill down to the model in received_data 207 | when deserializing a response 208 | _spec_property_naming (bool): True if the variable names in the input data 209 | are serialized names, as specified in the OpenAPI document. 210 | False if the variable names in the input data 211 | are pythonic names, e.g. snake case (default) 212 | _configuration (Configuration): the instance to use when 213 | deserializing a file_type parameter. 214 | If passed, type conversion is attempted 215 | If omitted no type conversion is done. 216 | _visited_composed_classes (tuple): This stores a tuple of 217 | classes that we have traveled through so that 218 | if we see that class again we will not use its 219 | discriminator again. 220 | When traveling through a discriminator, the 221 | composed schema that is 222 | is traveled through is added to this set. 223 | For example if Animal has a discriminator 224 | petType and we pass in "Dog", and the class Dog 225 | allOf includes Animal, we move through Animal 226 | once using the discriminator, and pick Dog. 227 | Then in Dog, we will make an instance of the 228 | Animal class but this time we won't travel 229 | through its discriminator because we passed in 230 | _visited_composed_classes = (Animal,) 231 | """ 232 | 233 | _check_type = kwargs.pop('_check_type', True) 234 | _spec_property_naming = kwargs.pop('_spec_property_naming', False) 235 | _path_to_item = kwargs.pop('_path_to_item', ()) 236 | _configuration = kwargs.pop('_configuration', None) 237 | _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) 238 | 239 | if args: 240 | raise ApiTypeError( 241 | "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( 242 | args, 243 | self.__class__.__name__, 244 | ), 245 | path_to_item=_path_to_item, 246 | valid_classes=(self.__class__,), 247 | ) 248 | 249 | self._data_store = {} 250 | self._check_type = _check_type 251 | self._spec_property_naming = _spec_property_naming 252 | self._path_to_item = _path_to_item 253 | self._configuration = _configuration 254 | self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 255 | 256 | self.cnt = cnt 257 | self.weighted = weighted 258 | for var_name, var_value in kwargs.items(): 259 | if var_name not in self.attribute_map and \ 260 | self._configuration is not None and \ 261 | self._configuration.discard_unknown_keys and \ 262 | self.additional_properties_type is None: 263 | # discard variable. 264 | continue 265 | setattr(self, var_name, var_value) 266 | if var_name in self.read_only_vars: 267 | raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 268 | f"class with read only attributes.") 269 | -------------------------------------------------------------------------------- /graphsense/model/taxonomy.py: -------------------------------------------------------------------------------- 1 | """ 2 | GraphSense API 3 | 4 | GraphSense API provides programmatic access to various ledgers' addresses, entities, blocks, transactions and tags for automated and highly efficient forensics tasks. # noqa: E501 5 | 6 | The version of the OpenAPI document: 1.13.3 7 | Contact: contact@ikna.io 8 | Generated by: https://openapi-generator.tech 9 | """ 10 | 11 | 12 | import re # noqa: F401 13 | import sys # noqa: F401 14 | 15 | from graphsense.model_utils import ( # noqa: F401 16 | ApiTypeError, 17 | ModelComposed, 18 | ModelNormal, 19 | ModelSimple, 20 | cached_property, 21 | change_keys_js_to_python, 22 | convert_js_args_to_python_args, 23 | date, 24 | datetime, 25 | file_type, 26 | none_type, 27 | validate_get_composed_info, 28 | ) 29 | from ..model_utils import OpenApiModel 30 | from graphsense.exceptions import ApiAttributeError 31 | 32 | 33 | 34 | class Taxonomy(ModelNormal): 35 | """NOTE: This class is auto generated by OpenAPI Generator. 36 | Ref: https://openapi-generator.tech 37 | 38 | Do not edit the class manually. 39 | 40 | Attributes: 41 | allowed_values (dict): The key is the tuple path to the attribute 42 | and the for var_name this is (var_name,). The value is a dict 43 | with a capitalized key describing the allowed value and an allowed 44 | value. These dicts store the allowed enum values. 45 | attribute_map (dict): The key is attribute name 46 | and the value is json key in definition. 47 | discriminator_value_class_map (dict): A dict to go from the discriminator 48 | variable value to the discriminator class name. 49 | validations (dict): The key is the tuple path to the attribute 50 | and the for var_name this is (var_name,). The value is a dict 51 | that stores validations for max_length, min_length, max_items, 52 | min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, 53 | inclusive_minimum, and regex. 54 | additional_properties_type (tuple): A tuple of classes accepted 55 | as additional properties values. 56 | """ 57 | 58 | allowed_values = { 59 | } 60 | 61 | validations = { 62 | } 63 | 64 | @cached_property 65 | def additional_properties_type(): 66 | """ 67 | This must be a method because a model may have properties that are 68 | of type self, this must run after the class is loaded 69 | """ 70 | return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 71 | 72 | _nullable = False 73 | 74 | @cached_property 75 | def openapi_types(): 76 | """ 77 | This must be a method because a model may have properties that are 78 | of type self, this must run after the class is loaded 79 | 80 | Returns 81 | openapi_types (dict): The key is attribute name 82 | and the value is attribute type. 83 | """ 84 | return { 85 | 'taxonomy': (str,), # noqa: E501 86 | 'uri': (str,), # noqa: E501 87 | } 88 | 89 | @cached_property 90 | def discriminator(): 91 | return None 92 | 93 | 94 | attribute_map = { 95 | 'taxonomy': 'taxonomy', # noqa: E501 96 | 'uri': 'uri', # noqa: E501 97 | } 98 | 99 | read_only_vars = { 100 | } 101 | 102 | _composed_schemas = {} 103 | 104 | @classmethod 105 | @convert_js_args_to_python_args 106 | def _from_openapi_data(cls, taxonomy, uri, *args, **kwargs): # noqa: E501 107 | """Taxonomy - a model defined in OpenAPI 108 | 109 | Args: 110 | taxonomy (str): Taxonomy 111 | uri (str): URI 112 | 113 | Keyword Args: 114 | _check_type (bool): if True, values for parameters in openapi_types 115 | will be type checked and a TypeError will be 116 | raised if the wrong type is input. 117 | Defaults to True 118 | _path_to_item (tuple/list): This is a list of keys or values to 119 | drill down to the model in received_data 120 | when deserializing a response 121 | _spec_property_naming (bool): True if the variable names in the input data 122 | are serialized names, as specified in the OpenAPI document. 123 | False if the variable names in the input data 124 | are pythonic names, e.g. snake case (default) 125 | _configuration (Configuration): the instance to use when 126 | deserializing a file_type parameter. 127 | If passed, type conversion is attempted 128 | If omitted no type conversion is done. 129 | _visited_composed_classes (tuple): This stores a tuple of 130 | classes that we have traveled through so that 131 | if we see that class again we will not use its 132 | discriminator again. 133 | When traveling through a discriminator, the 134 | composed schema that is 135 | is traveled through is added to this set. 136 | For example if Animal has a discriminator 137 | petType and we pass in "Dog", and the class Dog 138 | allOf includes Animal, we move through Animal 139 | once using the discriminator, and pick Dog. 140 | Then in Dog, we will make an instance of the 141 | Animal class but this time we won't travel 142 | through its discriminator because we passed in 143 | _visited_composed_classes = (Animal,) 144 | """ 145 | 146 | _check_type = kwargs.pop('_check_type', True) 147 | _spec_property_naming = kwargs.pop('_spec_property_naming', False) 148 | _path_to_item = kwargs.pop('_path_to_item', ()) 149 | _configuration = kwargs.pop('_configuration', None) 150 | _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) 151 | 152 | self = super(OpenApiModel, cls).__new__(cls) 153 | 154 | if args: 155 | raise ApiTypeError( 156 | "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( 157 | args, 158 | self.__class__.__name__, 159 | ), 160 | path_to_item=_path_to_item, 161 | valid_classes=(self.__class__,), 162 | ) 163 | 164 | self._data_store = {} 165 | self._check_type = _check_type 166 | self._spec_property_naming = _spec_property_naming 167 | self._path_to_item = _path_to_item 168 | self._configuration = _configuration 169 | self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 170 | 171 | self.taxonomy = taxonomy 172 | self.uri = uri 173 | for var_name, var_value in kwargs.items(): 174 | if var_name not in self.attribute_map and \ 175 | self._configuration is not None and \ 176 | self._configuration.discard_unknown_keys and \ 177 | self.additional_properties_type is None: 178 | # discard variable. 179 | continue 180 | setattr(self, var_name, var_value) 181 | return self 182 | 183 | required_properties = set([ 184 | '_data_store', 185 | '_check_type', 186 | '_spec_property_naming', 187 | '_path_to_item', 188 | '_configuration', 189 | '_visited_composed_classes', 190 | ]) 191 | 192 | @convert_js_args_to_python_args 193 | def __init__(self, taxonomy, uri, *args, **kwargs): # noqa: E501 194 | """Taxonomy - a model defined in OpenAPI 195 | 196 | Args: 197 | taxonomy (str): Taxonomy 198 | uri (str): URI 199 | 200 | Keyword Args: 201 | _check_type (bool): if True, values for parameters in openapi_types 202 | will be type checked and a TypeError will be 203 | raised if the wrong type is input. 204 | Defaults to True 205 | _path_to_item (tuple/list): This is a list of keys or values to 206 | drill down to the model in received_data 207 | when deserializing a response 208 | _spec_property_naming (bool): True if the variable names in the input data 209 | are serialized names, as specified in the OpenAPI document. 210 | False if the variable names in the input data 211 | are pythonic names, e.g. snake case (default) 212 | _configuration (Configuration): the instance to use when 213 | deserializing a file_type parameter. 214 | If passed, type conversion is attempted 215 | If omitted no type conversion is done. 216 | _visited_composed_classes (tuple): This stores a tuple of 217 | classes that we have traveled through so that 218 | if we see that class again we will not use its 219 | discriminator again. 220 | When traveling through a discriminator, the 221 | composed schema that is 222 | is traveled through is added to this set. 223 | For example if Animal has a discriminator 224 | petType and we pass in "Dog", and the class Dog 225 | allOf includes Animal, we move through Animal 226 | once using the discriminator, and pick Dog. 227 | Then in Dog, we will make an instance of the 228 | Animal class but this time we won't travel 229 | through its discriminator because we passed in 230 | _visited_composed_classes = (Animal,) 231 | """ 232 | 233 | _check_type = kwargs.pop('_check_type', True) 234 | _spec_property_naming = kwargs.pop('_spec_property_naming', False) 235 | _path_to_item = kwargs.pop('_path_to_item', ()) 236 | _configuration = kwargs.pop('_configuration', None) 237 | _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) 238 | 239 | if args: 240 | raise ApiTypeError( 241 | "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( 242 | args, 243 | self.__class__.__name__, 244 | ), 245 | path_to_item=_path_to_item, 246 | valid_classes=(self.__class__,), 247 | ) 248 | 249 | self._data_store = {} 250 | self._check_type = _check_type 251 | self._spec_property_naming = _spec_property_naming 252 | self._path_to_item = _path_to_item 253 | self._configuration = _configuration 254 | self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 255 | 256 | self.taxonomy = taxonomy 257 | self.uri = uri 258 | for var_name, var_value in kwargs.items(): 259 | if var_name not in self.attribute_map and \ 260 | self._configuration is not None and \ 261 | self._configuration.discard_unknown_keys and \ 262 | self.additional_properties_type is None: 263 | # discard variable. 264 | continue 265 | setattr(self, var_name, var_value) 266 | if var_name in self.read_only_vars: 267 | raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 268 | f"class with read only attributes.") 269 | -------------------------------------------------------------------------------- /graphsense/model/rate.py: -------------------------------------------------------------------------------- 1 | """ 2 | GraphSense API 3 | 4 | GraphSense API provides programmatic access to various ledgers' addresses, entities, blocks, transactions and tags for automated and highly efficient forensics tasks. # noqa: E501 5 | 6 | The version of the OpenAPI document: 1.13.3 7 | Contact: contact@ikna.io 8 | Generated by: https://openapi-generator.tech 9 | """ 10 | 11 | 12 | import re # noqa: F401 13 | import sys # noqa: F401 14 | 15 | from graphsense.model_utils import ( # noqa: F401 16 | ApiTypeError, 17 | ModelComposed, 18 | ModelNormal, 19 | ModelSimple, 20 | cached_property, 21 | change_keys_js_to_python, 22 | convert_js_args_to_python_args, 23 | date, 24 | datetime, 25 | file_type, 26 | none_type, 27 | validate_get_composed_info, 28 | ) 29 | from ..model_utils import OpenApiModel 30 | from graphsense.exceptions import ApiAttributeError 31 | 32 | 33 | 34 | class Rate(ModelNormal): 35 | """NOTE: This class is auto generated by OpenAPI Generator. 36 | Ref: https://openapi-generator.tech 37 | 38 | Do not edit the class manually. 39 | 40 | Attributes: 41 | allowed_values (dict): The key is the tuple path to the attribute 42 | and the for var_name this is (var_name,). The value is a dict 43 | with a capitalized key describing the allowed value and an allowed 44 | value. These dicts store the allowed enum values. 45 | attribute_map (dict): The key is attribute name 46 | and the value is json key in definition. 47 | discriminator_value_class_map (dict): A dict to go from the discriminator 48 | variable value to the discriminator class name. 49 | validations (dict): The key is the tuple path to the attribute 50 | and the for var_name this is (var_name,). The value is a dict 51 | that stores validations for max_length, min_length, max_items, 52 | min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, 53 | inclusive_minimum, and regex. 54 | additional_properties_type (tuple): A tuple of classes accepted 55 | as additional properties values. 56 | """ 57 | 58 | allowed_values = { 59 | } 60 | 61 | validations = { 62 | } 63 | 64 | @cached_property 65 | def additional_properties_type(): 66 | """ 67 | This must be a method because a model may have properties that are 68 | of type self, this must run after the class is loaded 69 | """ 70 | return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 71 | 72 | _nullable = False 73 | 74 | @cached_property 75 | def openapi_types(): 76 | """ 77 | This must be a method because a model may have properties that are 78 | of type self, this must run after the class is loaded 79 | 80 | Returns 81 | openapi_types (dict): The key is attribute name 82 | and the value is attribute type. 83 | """ 84 | return { 85 | 'code': (str,), # noqa: E501 86 | 'value': (float,), # noqa: E501 87 | } 88 | 89 | @cached_property 90 | def discriminator(): 91 | return None 92 | 93 | 94 | attribute_map = { 95 | 'code': 'code', # noqa: E501 96 | 'value': 'value', # noqa: E501 97 | } 98 | 99 | read_only_vars = { 100 | } 101 | 102 | _composed_schemas = {} 103 | 104 | @classmethod 105 | @convert_js_args_to_python_args 106 | def _from_openapi_data(cls, code, value, *args, **kwargs): # noqa: E501 107 | """Rate - a model defined in OpenAPI 108 | 109 | Args: 110 | code (str): iso currency code 111 | value (float): exchange rate 112 | 113 | Keyword Args: 114 | _check_type (bool): if True, values for parameters in openapi_types 115 | will be type checked and a TypeError will be 116 | raised if the wrong type is input. 117 | Defaults to True 118 | _path_to_item (tuple/list): This is a list of keys or values to 119 | drill down to the model in received_data 120 | when deserializing a response 121 | _spec_property_naming (bool): True if the variable names in the input data 122 | are serialized names, as specified in the OpenAPI document. 123 | False if the variable names in the input data 124 | are pythonic names, e.g. snake case (default) 125 | _configuration (Configuration): the instance to use when 126 | deserializing a file_type parameter. 127 | If passed, type conversion is attempted 128 | If omitted no type conversion is done. 129 | _visited_composed_classes (tuple): This stores a tuple of 130 | classes that we have traveled through so that 131 | if we see that class again we will not use its 132 | discriminator again. 133 | When traveling through a discriminator, the 134 | composed schema that is 135 | is traveled through is added to this set. 136 | For example if Animal has a discriminator 137 | petType and we pass in "Dog", and the class Dog 138 | allOf includes Animal, we move through Animal 139 | once using the discriminator, and pick Dog. 140 | Then in Dog, we will make an instance of the 141 | Animal class but this time we won't travel 142 | through its discriminator because we passed in 143 | _visited_composed_classes = (Animal,) 144 | """ 145 | 146 | _check_type = kwargs.pop('_check_type', True) 147 | _spec_property_naming = kwargs.pop('_spec_property_naming', False) 148 | _path_to_item = kwargs.pop('_path_to_item', ()) 149 | _configuration = kwargs.pop('_configuration', None) 150 | _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) 151 | 152 | self = super(OpenApiModel, cls).__new__(cls) 153 | 154 | if args: 155 | raise ApiTypeError( 156 | "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( 157 | args, 158 | self.__class__.__name__, 159 | ), 160 | path_to_item=_path_to_item, 161 | valid_classes=(self.__class__,), 162 | ) 163 | 164 | self._data_store = {} 165 | self._check_type = _check_type 166 | self._spec_property_naming = _spec_property_naming 167 | self._path_to_item = _path_to_item 168 | self._configuration = _configuration 169 | self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 170 | 171 | self.code = code 172 | self.value = value 173 | for var_name, var_value in kwargs.items(): 174 | if var_name not in self.attribute_map and \ 175 | self._configuration is not None and \ 176 | self._configuration.discard_unknown_keys and \ 177 | self.additional_properties_type is None: 178 | # discard variable. 179 | continue 180 | setattr(self, var_name, var_value) 181 | return self 182 | 183 | required_properties = set([ 184 | '_data_store', 185 | '_check_type', 186 | '_spec_property_naming', 187 | '_path_to_item', 188 | '_configuration', 189 | '_visited_composed_classes', 190 | ]) 191 | 192 | @convert_js_args_to_python_args 193 | def __init__(self, code, value, *args, **kwargs): # noqa: E501 194 | """Rate - a model defined in OpenAPI 195 | 196 | Args: 197 | code (str): iso currency code 198 | value (float): exchange rate 199 | 200 | Keyword Args: 201 | _check_type (bool): if True, values for parameters in openapi_types 202 | will be type checked and a TypeError will be 203 | raised if the wrong type is input. 204 | Defaults to True 205 | _path_to_item (tuple/list): This is a list of keys or values to 206 | drill down to the model in received_data 207 | when deserializing a response 208 | _spec_property_naming (bool): True if the variable names in the input data 209 | are serialized names, as specified in the OpenAPI document. 210 | False if the variable names in the input data 211 | are pythonic names, e.g. snake case (default) 212 | _configuration (Configuration): the instance to use when 213 | deserializing a file_type parameter. 214 | If passed, type conversion is attempted 215 | If omitted no type conversion is done. 216 | _visited_composed_classes (tuple): This stores a tuple of 217 | classes that we have traveled through so that 218 | if we see that class again we will not use its 219 | discriminator again. 220 | When traveling through a discriminator, the 221 | composed schema that is 222 | is traveled through is added to this set. 223 | For example if Animal has a discriminator 224 | petType and we pass in "Dog", and the class Dog 225 | allOf includes Animal, we move through Animal 226 | once using the discriminator, and pick Dog. 227 | Then in Dog, we will make an instance of the 228 | Animal class but this time we won't travel 229 | through its discriminator because we passed in 230 | _visited_composed_classes = (Animal,) 231 | """ 232 | 233 | _check_type = kwargs.pop('_check_type', True) 234 | _spec_property_naming = kwargs.pop('_spec_property_naming', False) 235 | _path_to_item = kwargs.pop('_path_to_item', ()) 236 | _configuration = kwargs.pop('_configuration', None) 237 | _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) 238 | 239 | if args: 240 | raise ApiTypeError( 241 | "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( 242 | args, 243 | self.__class__.__name__, 244 | ), 245 | path_to_item=_path_to_item, 246 | valid_classes=(self.__class__,), 247 | ) 248 | 249 | self._data_store = {} 250 | self._check_type = _check_type 251 | self._spec_property_naming = _spec_property_naming 252 | self._path_to_item = _path_to_item 253 | self._configuration = _configuration 254 | self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 255 | 256 | self.code = code 257 | self.value = value 258 | for var_name, var_value in kwargs.items(): 259 | if var_name not in self.attribute_map and \ 260 | self._configuration is not None and \ 261 | self._configuration.discard_unknown_keys and \ 262 | self.additional_properties_type is None: 263 | # discard variable. 264 | continue 265 | setattr(self, var_name, var_value) 266 | if var_name in self.read_only_vars: 267 | raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 268 | f"class with read only attributes.") 269 | -------------------------------------------------------------------------------- /graphsense/model/labeled_item_ref.py: -------------------------------------------------------------------------------- 1 | """ 2 | GraphSense API 3 | 4 | GraphSense API provides programmatic access to various ledgers' addresses, entities, blocks, transactions and tags for automated and highly efficient forensics tasks. # noqa: E501 5 | 6 | The version of the OpenAPI document: 1.13.3 7 | Contact: contact@ikna.io 8 | Generated by: https://openapi-generator.tech 9 | """ 10 | 11 | 12 | import re # noqa: F401 13 | import sys # noqa: F401 14 | 15 | from graphsense.model_utils import ( # noqa: F401 16 | ApiTypeError, 17 | ModelComposed, 18 | ModelNormal, 19 | ModelSimple, 20 | cached_property, 21 | change_keys_js_to_python, 22 | convert_js_args_to_python_args, 23 | date, 24 | datetime, 25 | file_type, 26 | none_type, 27 | validate_get_composed_info, 28 | ) 29 | from ..model_utils import OpenApiModel 30 | from graphsense.exceptions import ApiAttributeError 31 | 32 | 33 | 34 | class LabeledItemRef(ModelNormal): 35 | """NOTE: This class is auto generated by OpenAPI Generator. 36 | Ref: https://openapi-generator.tech 37 | 38 | Do not edit the class manually. 39 | 40 | Attributes: 41 | allowed_values (dict): The key is the tuple path to the attribute 42 | and the for var_name this is (var_name,). The value is a dict 43 | with a capitalized key describing the allowed value and an allowed 44 | value. These dicts store the allowed enum values. 45 | attribute_map (dict): The key is attribute name 46 | and the value is json key in definition. 47 | discriminator_value_class_map (dict): A dict to go from the discriminator 48 | variable value to the discriminator class name. 49 | validations (dict): The key is the tuple path to the attribute 50 | and the for var_name this is (var_name,). The value is a dict 51 | that stores validations for max_length, min_length, max_items, 52 | min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, 53 | inclusive_minimum, and regex. 54 | additional_properties_type (tuple): A tuple of classes accepted 55 | as additional properties values. 56 | """ 57 | 58 | allowed_values = { 59 | } 60 | 61 | validations = { 62 | } 63 | 64 | @cached_property 65 | def additional_properties_type(): 66 | """ 67 | This must be a method because a model may have properties that are 68 | of type self, this must run after the class is loaded 69 | """ 70 | return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 71 | 72 | _nullable = False 73 | 74 | @cached_property 75 | def openapi_types(): 76 | """ 77 | This must be a method because a model may have properties that are 78 | of type self, this must run after the class is loaded 79 | 80 | Returns 81 | openapi_types (dict): The key is attribute name 82 | and the value is attribute type. 83 | """ 84 | return { 85 | 'id': (str,), # noqa: E501 86 | 'label': (str,), # noqa: E501 87 | } 88 | 89 | @cached_property 90 | def discriminator(): 91 | return None 92 | 93 | 94 | attribute_map = { 95 | 'id': 'id', # noqa: E501 96 | 'label': 'label', # noqa: E501 97 | } 98 | 99 | read_only_vars = { 100 | } 101 | 102 | _composed_schemas = {} 103 | 104 | @classmethod 105 | @convert_js_args_to_python_args 106 | def _from_openapi_data(cls, id, label, *args, **kwargs): # noqa: E501 107 | """LabeledItemRef - a model defined in OpenAPI 108 | 109 | Args: 110 | id (str): identifier of the item 111 | label (str): Label 112 | 113 | Keyword Args: 114 | _check_type (bool): if True, values for parameters in openapi_types 115 | will be type checked and a TypeError will be 116 | raised if the wrong type is input. 117 | Defaults to True 118 | _path_to_item (tuple/list): This is a list of keys or values to 119 | drill down to the model in received_data 120 | when deserializing a response 121 | _spec_property_naming (bool): True if the variable names in the input data 122 | are serialized names, as specified in the OpenAPI document. 123 | False if the variable names in the input data 124 | are pythonic names, e.g. snake case (default) 125 | _configuration (Configuration): the instance to use when 126 | deserializing a file_type parameter. 127 | If passed, type conversion is attempted 128 | If omitted no type conversion is done. 129 | _visited_composed_classes (tuple): This stores a tuple of 130 | classes that we have traveled through so that 131 | if we see that class again we will not use its 132 | discriminator again. 133 | When traveling through a discriminator, the 134 | composed schema that is 135 | is traveled through is added to this set. 136 | For example if Animal has a discriminator 137 | petType and we pass in "Dog", and the class Dog 138 | allOf includes Animal, we move through Animal 139 | once using the discriminator, and pick Dog. 140 | Then in Dog, we will make an instance of the 141 | Animal class but this time we won't travel 142 | through its discriminator because we passed in 143 | _visited_composed_classes = (Animal,) 144 | """ 145 | 146 | _check_type = kwargs.pop('_check_type', True) 147 | _spec_property_naming = kwargs.pop('_spec_property_naming', False) 148 | _path_to_item = kwargs.pop('_path_to_item', ()) 149 | _configuration = kwargs.pop('_configuration', None) 150 | _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) 151 | 152 | self = super(OpenApiModel, cls).__new__(cls) 153 | 154 | if args: 155 | raise ApiTypeError( 156 | "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( 157 | args, 158 | self.__class__.__name__, 159 | ), 160 | path_to_item=_path_to_item, 161 | valid_classes=(self.__class__,), 162 | ) 163 | 164 | self._data_store = {} 165 | self._check_type = _check_type 166 | self._spec_property_naming = _spec_property_naming 167 | self._path_to_item = _path_to_item 168 | self._configuration = _configuration 169 | self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 170 | 171 | self.id = id 172 | self.label = label 173 | for var_name, var_value in kwargs.items(): 174 | if var_name not in self.attribute_map and \ 175 | self._configuration is not None and \ 176 | self._configuration.discard_unknown_keys and \ 177 | self.additional_properties_type is None: 178 | # discard variable. 179 | continue 180 | setattr(self, var_name, var_value) 181 | return self 182 | 183 | required_properties = set([ 184 | '_data_store', 185 | '_check_type', 186 | '_spec_property_naming', 187 | '_path_to_item', 188 | '_configuration', 189 | '_visited_composed_classes', 190 | ]) 191 | 192 | @convert_js_args_to_python_args 193 | def __init__(self, id, label, *args, **kwargs): # noqa: E501 194 | """LabeledItemRef - a model defined in OpenAPI 195 | 196 | Args: 197 | id (str): identifier of the item 198 | label (str): Label 199 | 200 | Keyword Args: 201 | _check_type (bool): if True, values for parameters in openapi_types 202 | will be type checked and a TypeError will be 203 | raised if the wrong type is input. 204 | Defaults to True 205 | _path_to_item (tuple/list): This is a list of keys or values to 206 | drill down to the model in received_data 207 | when deserializing a response 208 | _spec_property_naming (bool): True if the variable names in the input data 209 | are serialized names, as specified in the OpenAPI document. 210 | False if the variable names in the input data 211 | are pythonic names, e.g. snake case (default) 212 | _configuration (Configuration): the instance to use when 213 | deserializing a file_type parameter. 214 | If passed, type conversion is attempted 215 | If omitted no type conversion is done. 216 | _visited_composed_classes (tuple): This stores a tuple of 217 | classes that we have traveled through so that 218 | if we see that class again we will not use its 219 | discriminator again. 220 | When traveling through a discriminator, the 221 | composed schema that is 222 | is traveled through is added to this set. 223 | For example if Animal has a discriminator 224 | petType and we pass in "Dog", and the class Dog 225 | allOf includes Animal, we move through Animal 226 | once using the discriminator, and pick Dog. 227 | Then in Dog, we will make an instance of the 228 | Animal class but this time we won't travel 229 | through its discriminator because we passed in 230 | _visited_composed_classes = (Animal,) 231 | """ 232 | 233 | _check_type = kwargs.pop('_check_type', True) 234 | _spec_property_naming = kwargs.pop('_spec_property_naming', False) 235 | _path_to_item = kwargs.pop('_path_to_item', ()) 236 | _configuration = kwargs.pop('_configuration', None) 237 | _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) 238 | 239 | if args: 240 | raise ApiTypeError( 241 | "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( 242 | args, 243 | self.__class__.__name__, 244 | ), 245 | path_to_item=_path_to_item, 246 | valid_classes=(self.__class__,), 247 | ) 248 | 249 | self._data_store = {} 250 | self._check_type = _check_type 251 | self._spec_property_naming = _spec_property_naming 252 | self._path_to_item = _path_to_item 253 | self._configuration = _configuration 254 | self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 255 | 256 | self.id = id 257 | self.label = label 258 | for var_name, var_value in kwargs.items(): 259 | if var_name not in self.attribute_map and \ 260 | self._configuration is not None and \ 261 | self._configuration.discard_unknown_keys and \ 262 | self.additional_properties_type is None: 263 | # discard variable. 264 | continue 265 | setattr(self, var_name, var_value) 266 | if var_name in self.read_only_vars: 267 | raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 268 | f"class with read only attributes.") 269 | --------------------------------------------------------------------------------