-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
33d5472
commit c54384f
Showing
20 changed files
with
899 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Pull Request Template | ||
|
||
## Description | ||
Please include a summary of the change and which issue is fixed. Include the context and motivations behind your changes. | ||
|
||
## Type of change | ||
- [ ] Bug fix (non-breaking change which fixes an issue) | ||
- [ ] New feature (non-breaking change which adds functionality) | ||
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) | ||
- [ ] This change requires a documentation update | ||
|
||
## Checklist: | ||
Before you submit the pull request, please review the following checklist: | ||
- [ ] I have performed a self-review of my own code. | ||
- [ ] I have commented my code, particularly in hard-to-understand areas. | ||
- [ ] I have made corresponding changes to the documentation. | ||
- [ ] My changes generate no new warnings. | ||
- [ ] I have added tests that prove my fix is effective or that my feature works. | ||
- [ ] New and existing unit tests pass locally with my changes. | ||
- [ ] Any dependent changes have been merged and published in downstream modules. | ||
|
||
## Linked Issues | ||
Mention the issues that are addressed by this PR. You can use the `#` symbol to link an issue. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: upload | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
upload: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: install dependencies | ||
run: python3 -m pip install --user --upgrade poetry | ||
- name: build | ||
run: poetry build | ||
- name: release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"printWidth": 120 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,7 @@ | ||
MIT License | ||
Copyright 2024 Crypto.com | ||
|
||
Copyright (c) 2024 Crypto.com | ||
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
This project is powered by OpenAI (www.openai.com). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
[tool.poetry] | ||
name = "developer-platform-client-py" | ||
version = "1.0.2-beta" | ||
description = "A python client to interact with @cryptocom/developer-platform-service" | ||
authors = ["Ric Arcifa <[email protected]>"] | ||
license = "MIT" | ||
keywords = ["agent", "blockchain", "crypto.com", "AI", "CDC"] | ||
readme = "README.md" | ||
homepage = "https://github.com/crypto-com/developer-platform-client-py" | ||
repository = "https://github.com/crypto-com/developer-platform-client-py" | ||
documentation = "https://github.com/crypto-com/developer-platform-client-py" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.8.1" | ||
requests = "^2.32.3" | ||
|
||
[tool.poetry.dev-dependencies] | ||
pytest = "^8.3.3" | ||
flake8 = "^7.1.1" | ||
black = "^24.8.0" | ||
isort = "^5.13.2" | ||
|
||
[build-system] | ||
requires = ["poetry-core>=1.0.0"] | ||
build-backend = "poetry.core.masonry.api" | ||
|
||
[tool.black] | ||
line-length = 88 | ||
target-version = ['py39'] | ||
include = '\.pyi?$' | ||
exclude = ''' | ||
( | ||
/( | ||
\.eggs | ||
| \.git | ||
| \.tox | ||
| \.venv | ||
| build | ||
| dist | ||
)/ | ||
) | ||
''' | ||
|
||
[tool.isort] | ||
profile = "black" | ||
|
||
[tool.poetry.scripts] | ||
cdc-ai-agent-client = "developer-platform-client-py.cli:main" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from .block import Block | ||
from .client import Client | ||
from .contract import Contract | ||
from .interfaces.chain_interfaces import CronosEvm, CronosZkEvm | ||
from .token import Token | ||
from .transaction import Transaction | ||
from .wallet import Wallet | ||
|
||
__all__ = [ | ||
"Client", | ||
"Contract", | ||
"Wallet", | ||
"Block", | ||
"Transaction", | ||
"Token", | ||
"CronosEvm", | ||
"CronosZkEvm", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from .client import Client | ||
from .integrations.api_interfaces import ApiResponse | ||
from .integrations.block_api import get_block_by_tag | ||
|
||
|
||
class Block: | ||
""" | ||
Block class for fetching block data. | ||
""" | ||
_client: Client | ||
|
||
@classmethod | ||
def init(cls, client: Client) -> None: | ||
""" | ||
Initialize the Block class with a Client instance. | ||
:param client: An instance of the Client class. | ||
""" | ||
cls._client = client | ||
|
||
@classmethod | ||
def get_by_tag(cls, tag: str, tx_detail: str = "false") -> ApiResponse: | ||
""" | ||
Get block data by tag. | ||
:param tag: Integer of a block number in hex, or the string "earliest", "latest" or "pending", as in https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block | ||
:param tx_detail: If true it returns the full transaction objects, if false only the hashes of the transactions. | ||
:return: The block data. | ||
""" | ||
return get_block_by_tag( | ||
cls._client.get_chain_id(), | ||
cls._client.get_api_key(), | ||
tag, | ||
tx_detail | ||
) |
Oops, something went wrong.