From 5a9eb5106e21b5570f0750ee00a447aa866d4eff Mon Sep 17 00:00:00 2001 From: Yoav Bar-Zeev Date: Thu, 5 Jan 2023 17:38:52 +0200 Subject: [PATCH 1/5] fix #10 - use typing aliases --- fireblocks_defi_sdk_py/tokenization/tokens/erc1155.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fireblocks_defi_sdk_py/tokenization/tokens/erc1155.py b/fireblocks_defi_sdk_py/tokenization/tokens/erc1155.py index d6bef8f..43dad24 100644 --- a/fireblocks_defi_sdk_py/tokenization/tokens/erc1155.py +++ b/fireblocks_defi_sdk_py/tokenization/tokens/erc1155.py @@ -1,3 +1,5 @@ +from typing import List + from . base_token import * from .. utils.helpers import ERC1155_ABI @@ -50,7 +52,7 @@ def safe_transfer_from(self, to_address: str, token_id: int, amount: int, from_a return self.submit_transaction(transaction, note) - def safe_batch_transfer_from(self, to_address: str, token_ids: list[int], values: list[int], from_address: str = "", + def safe_batch_transfer_from(self, to_address: str, token_ids: List[int], values: List[int], from_address: str = "", data: bytes = bytearray(), note: str = ""): """ Length of token_ids and values must match. Moreover, the value of each token (at position x at [values]) to be @@ -106,7 +108,7 @@ def balance_of(self, token_id: int, owner_address: str = "") -> int: owner_address = self.wallet_address return self.call_read_function("balanceOf", owner_address, token_id) - def balance_of_batch(self, id_list: list[int], owners_list=None) -> list[int]: + def balance_of_batch(self, id_list: List[int], owners_list=None) -> List[int]: """ :param owners_list: A list of addresses From ff04cb4826a3a4837a8e8773182885d61f926354 Mon Sep 17 00:00:00 2001 From: Yoav Bar-Zeev Date: Thu, 5 Jan 2023 17:47:52 +0200 Subject: [PATCH 2/5] fix #10 - extend python-package.yml workflow, move requirements to setup.py --- .github/workflows/python-package.yml | 13 ++++++++----- requirements.txt | 2 -- setup.py | 22 ++++++++++++---------- 3 files changed, 20 insertions(+), 17 deletions(-) delete mode 100644 requirements.txt diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 8d6e00a..2b5da7d 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -4,12 +4,14 @@ on: [push] jobs: build: - - runs-on: ubuntu-latest strategy: matrix: - python-version: [3.6, 3.7, 3.8, 3.9] - + python-version: [3.6, 3.7, 3.8, 3.9, 3.10, 3.11] + os: [macos-11, macos-12, windows-latest, ubuntu-18.04, ubuntu-20.04, ubuntu-22.04] + exclude: + - python-version: 3.6 + os: ubuntu-22.04 + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} @@ -20,13 +22,14 @@ jobs: run: | python -m pip install --upgrade pip pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Build package + run: pip install -e . # - name: Test with pytest # run: | # pytest diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 16764d6..0000000 --- a/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -fireblocks_sdk==1.12.0 -web3==5.26.0 diff --git a/setup.py b/setup.py index 46ec882..ccf3dd1 100644 --- a/setup.py +++ b/setup.py @@ -2,11 +2,13 @@ setup( name='fireblocks_defi_sdk', - packages=['fireblocks_defi_sdk_py', - 'fireblocks_defi_sdk_py.tokenization', - 'fireblocks_defi_sdk_py.tokenization.tokens', - 'fireblocks_defi_sdk_py.tokenization.utils', - 'fireblocks_defi_sdk_py.tokenization.examples'], + packages=[ + 'fireblocks_defi_sdk_py', + 'fireblocks_defi_sdk_py.tokenization', + 'fireblocks_defi_sdk_py.tokenization.tokens', + 'fireblocks_defi_sdk_py.tokenization.utils', + 'fireblocks_defi_sdk_py.tokenization.examples' + ], version='1.0.0', license='MIT', description='fireblocks_defi_sdk_py', @@ -17,10 +19,9 @@ url='https://github.com/fireblocks/fireblocks-defi-sdk-py', download_url='https://github.com/fireblocks/fireblocks-defi-sdk-py/archive/refs/tags/1.0.0.tar.gz', keywords=['FIREBLOCKS', 'DeFi', 'SDK', 'PYTHON'], - install_requires=[ - 'fireblocks_sdk', - 'web3', + 'fireblocks_sdk==1.12.0', + 'web3==5.26.0' ], classifiers=[ 'Development Status :: 3 - Alpha', @@ -31,6 +32,7 @@ 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - ], + 'Programming Language :: Python :: 3.10' + 'Programming Language :: Python :: 3.11' + ] ) From 4967a0edd2a1b667c22c1f1ec08ab5b43132f9bf Mon Sep 17 00:00:00 2001 From: Yoav Bar-Zeev Date: Thu, 5 Jan 2023 17:49:51 +0200 Subject: [PATCH 3/5] fix #10 - fix python 3.10 workflow --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 2b5da7d..41fdf66 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -6,7 +6,7 @@ jobs: build: strategy: matrix: - python-version: [3.6, 3.7, 3.8, 3.9, 3.10, 3.11] + python-version: [3.6, 3.7, 3.8, 3.9, '3.10', 3.11] os: [macos-11, macos-12, windows-latest, ubuntu-18.04, ubuntu-20.04, ubuntu-22.04] exclude: - python-version: 3.6 From a436dee77df145c78c883d799d406be53c67e84d Mon Sep 17 00:00:00 2001 From: Yoav Bar-Zeev Date: Mon, 9 Jan 2023 10:47:29 +0200 Subject: [PATCH 4/5] remove duplicated ARBITRUM property --- fireblocks_defi_sdk_py/chain.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fireblocks_defi_sdk_py/chain.py b/fireblocks_defi_sdk_py/chain.py index 64b984a..d630556 100644 --- a/fireblocks_defi_sdk_py/chain.py +++ b/fireblocks_defi_sdk_py/chain.py @@ -18,6 +18,7 @@ class Chain(Enum): SONGBIRD = "songbird" ARBITRUM = "arbitrum" ARBITRUM_RIN = "arbitrum_rin" + ARBITRUM_GOERLI = "arbitrum_goerli" FANTOM = "fantom" RSK = "rsk_smart_bitcoin" RSK_TEST = "rsk smart bitcoin testnet" @@ -27,5 +28,3 @@ class Chain(Enum): OPTIMISM_KOVAN = "optimistic ethereum kovan" RONIN = "ronin" RONIN_TEST = "ronin_test" - ARBITRUM = "arbitrum" - ARBITRUM_GOERLI = "arbitrum_goerli" From 638c596d70acbf57ce01a82072d2c7205d129f6c Mon Sep 17 00:00:00 2001 From: Yoav Bar-Zeev Date: Mon, 9 Jan 2023 17:21:22 +0200 Subject: [PATCH 5/5] update fireblocks_sdk dependency version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ccf3dd1..5e2049f 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ download_url='https://github.com/fireblocks/fireblocks-defi-sdk-py/archive/refs/tags/1.0.0.tar.gz', keywords=['FIREBLOCKS', 'DeFi', 'SDK', 'PYTHON'], install_requires=[ - 'fireblocks_sdk==1.12.0', + 'fireblocks_sdk==1.17.3', 'web3==5.26.0' ], classifiers=[