diff --git a/fireblocks_defi_sdk_py/chain.py b/fireblocks_defi_sdk_py/chain.py index e1790c7..d630556 100644 --- a/fireblocks_defi_sdk_py/chain.py +++ b/fireblocks_defi_sdk_py/chain.py @@ -28,5 +28,3 @@ class Chain(Enum): OPTIMISM_KOVAN = "optimistic ethereum kovan" RONIN = "ronin" RONIN_TEST = "ronin_test" - ARBITRUM = "arbitrum" - ARBITRUM_GOERLI = "arbitrum_goerli" diff --git a/fireblocks_defi_sdk_py/examples/basic_example.py b/fireblocks_defi_sdk_py/examples/basic_example.py index e1825b6..5902947 100644 --- a/fireblocks_defi_sdk_py/examples/basic_example.py +++ b/fireblocks_defi_sdk_py/examples/basic_example.py @@ -10,7 +10,7 @@ w3 = Web3(Web3.EthereumTesterProvider()) print(w3.isConnected()) CHAIN = Chain.ROPSTEN -CONTRACT_ADDRESS = Web3.toChecksumAddress("0xcbe74e21b070a979b9d6426b11e876d4cb618daf") +CONTRACT_ADDRESS = Web3.to_checksum_address("0xcbe74e21b070a979b9d6426b11e876d4cb618daf") EIP20_ABI = json.loads('[{"constant":false,"inputs":[{"name":"_greeting","type":"string"}],"name":"greet","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getGreeting","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"}]') GREETING = "Hello web3" diff --git a/fireblocks_defi_sdk_py/examples/requirements.txt b/fireblocks_defi_sdk_py/examples/requirements.txt index 2ba6d37..2e73637 100644 --- a/fireblocks_defi_sdk_py/examples/requirements.txt +++ b/fireblocks_defi_sdk_py/examples/requirements.txt @@ -1,3 +1,3 @@ -fireblocks-defi-sdk==1.0.2 +fireblocks-defi-sdk==1.1.0 eth-tester==0.8.0b3 py-evm==0.6.1a2 diff --git a/fireblocks_defi_sdk_py/examples/uniswap_example.py b/fireblocks_defi_sdk_py/examples/uniswap_example.py index 6d6e79c..5463b3e 100644 --- a/fireblocks_defi_sdk_py/examples/uniswap_example.py +++ b/fireblocks_defi_sdk_py/examples/uniswap_example.py @@ -35,7 +35,7 @@ def approve_withdrawal_input_token(): external_wallet_address=erc20_input_token_proxy_addr, chain=CHAIN) input_token_abi = json.loads(erc20_input_token_abi) - contract = w3.eth.contract(address=Web3.toChecksumAddress(erc20_input_token_addr), abi=input_token_abi) + contract = w3.eth.contract(address=Web3.to_checksum_address(erc20_input_token_addr), abi=input_token_abi) approve_tx = contract.functions.approve(uniswap_router_addr, 999999999).buildTransaction() tx_res = w3bridge.send_transaction(approve_tx, note="contract call approve") print(tx_res) @@ -48,13 +48,13 @@ def call_uniswap_action(): external_wallet_address=uniswap_router_addr, chain=CHAIN) uniswap_abi = json.loads(uniswap_router_abi) - contract = w3.eth.contract(address=Web3.toChecksumAddress(uniswap_router_addr), abi=uniswap_abi) + contract = w3.eth.contract(address=Web3.to_checksum_address(uniswap_router_addr), abi=uniswap_abi) deadline = (datetime.now() + timedelta(seconds=180)).timestamp() deadline = int(deadline) uniswap_call_tx = contract.functions.swapTokensForExactTokens(1000000000000, 100000000000, - [Web3.toChecksumAddress(erc20_input_token_proxy_addr), - Web3.toChecksumAddress(output_token_addr)], - Web3.toChecksumAddress(addr_to_get_output_tokens), + [Web3.to_checksum_address(erc20_input_token_proxy_addr), + Web3.to_checksum_address(output_token_addr)], + Web3.to_checksum_address(addr_to_get_output_tokens), deadline).buildTransaction() tx_res = w3bridge.send_transaction(uniswap_call_tx, note="Uniswap contract call") print(tx_res) diff --git a/fireblocks_defi_sdk_py/tokenization/examples/custom_token_example.py b/fireblocks_defi_sdk_py/tokenization/examples/custom_token_example.py index d303419..a7db6c4 100644 --- a/fireblocks_defi_sdk_py/tokenization/examples/custom_token_example.py +++ b/fireblocks_defi_sdk_py/tokenization/examples/custom_token_example.py @@ -14,25 +14,25 @@ FILE_PATH, MODE = "some/path/to/my/contract", "r" if __name__ == "__main__": - # We start by building a bridge to the Ropsten network, including initiating a CustomToken object which will + # We start by building a bridge to the Goerli network, including initiating a CustomToken object which will # represent our custom contract. In order to initiate a CustomToken, we will need a contract ABI. This can be read # from another file, passed as a variable declared locally, or fetched from EtherScan using fetch_abi(address). We # will use the first. - ropsten_bridge = Web3Bridge(SDK, VAULT_ID, CONTRACT_ADDRESS, Chain.ROPSTEN, WHITELISTED_CONTRACT_UUID) + goerli_bridge = Web3Bridge(SDK, VAULT_ID, Chain.GOERLI, CONTRACT_ADDRESS, WHITELISTED_CONTRACT_UUID) with open(FILE_PATH, MODE) as file: contract_abi = file.read() - custom_contract_bridge = CustomToken(ropsten_bridge, contract_abi) + custom_contract_bridge = CustomToken(goerli_bridge, contract_abi) # Let's assume our ABI holds a transferOwnership write function, and a contractOwner function (returning a boolean). # We will first validate we own the contract and then transfer it to another vault in our account. - checked_address = custom_contract_bridge.web_provider.toChecksumAddress(custom_contract_bridge.wallet_address) + checked_address = custom_contract_bridge.web_provider.to_checksum_address(custom_contract_bridge.wallet_address) if custom_contract_bridge.call_read_function("contractOwner", checked_address): # We will initiate another bridge, as we will need the wallet address, and we will later on transfer it back. - secondary_ropsten_bridge = Web3Bridge(SDK, SECONDARY_VAULT_ID, CONTRACT_ADDRESS, Chain.ROPSTEN, - WHITELISTED_CONTRACT_UUID) - secondary_contract_bridge = CustomToken(secondary_ropsten_bridge, contract_abi) + secondary_goerli_brdige = Web3Bridge(SDK, SECONDARY_VAULT_ID, Chain.GOERLI, CONTRACT_ADDRESS, + WHITELISTED_CONTRACT_UUID) + secondary_contract_bridge = CustomToken(secondary_goerli_brdige, contract_abi) building_params = {"from": checked_address} - secondary_address = secondary_contract_bridge.web_provider.toChecksumAddress( + secondary_address = secondary_contract_bridge.web_provider.to_checksum_address( secondary_contract_bridge.wallet_address) transfer_ownership_raw_transaction = custom_contract_bridge. \ call_write_function("transferOwnership", @@ -40,7 +40,7 @@ building_params=building_params) transfer_ownership_transaction = custom_contract_bridge.submit_transaction(transfer_ownership_raw_transaction) - if ropsten_bridge.check_tx_is_completed(transfer_ownership_transaction['id']) == TRANSACTION_STATUS_COMPLETED: + if goerli_bridge.check_tx_is_completed(transfer_ownership_transaction['id']) == TRANSACTION_STATUS_COMPLETED: print("Successfully transferred ownership from first wallet to the second one.") # We will now transfer the ownership back to our original wallet. building_params['from'] = secondary_address @@ -49,7 +49,7 @@ checked_address, building_params=building_params) ownership_transaction = secondary_contract_bridge.submit_transaction(ownership_raw_transaction, "Returning") - if secondary_ropsten_bridge.check_tx_is_completed(ownership_transaction['id']) == \ + if secondary_goerli_brdige.check_tx_is_completed(ownership_transaction['id']) == \ TRANSACTION_STATUS_COMPLETED: print("Successfully transferred ownership from second wallet to the first one.") else: diff --git a/fireblocks_defi_sdk_py/tokenization/examples/erc20_example.py b/fireblocks_defi_sdk_py/tokenization/examples/erc20_example.py index 700e199..eddff8f 100644 --- a/fireblocks_defi_sdk_py/tokenization/examples/erc20_example.py +++ b/fireblocks_defi_sdk_py/tokenization/examples/erc20_example.py @@ -13,13 +13,13 @@ TOKEN_AMOUNT = 10 if __name__ == "__main__": - # We start by building a bridge to the Ropsten network, including initiating a CustomToken object which will + # We start by building a bridge to the Goerli network, including initiating a CustomToken object which will # represent our ERC20 contract. In order to initiate a CustomToken, we will need a contract ABI. This can be read # from another file, passed as a variable declared locally, or fetched from EtherScan using fetch_abi(address). We # will use the latter. - ropsten_bridge = Web3Bridge(SDK, VAULT_ID, CONTRACT_ADDRESS, Chain.ROPSTEN) + goerli_bridge = Web3Bridge(SDK, VAULT_ID, Chain.GOERLI, CONTRACT_ADDRESS) contract_abi = fetch_abi(CONTRACT_ADDRESS) - erc20_contract_bridge = CustomToken(ropsten_bridge, contract_abi) + erc20_contract_bridge = CustomToken(goerli_bridge, contract_abi) # We build functions through passing the function name exactly as it appears on the ABI, following by its arguments. # It's important to differentiate between a read (view) and write function. We will demonstrate both. @@ -31,7 +31,7 @@ # We will mint a token (function receives address & amount) to our own address and then send it to another address. # We will also have to add the sender under the building_params in the following format: - checked_address = erc20_contract_bridge.web_provider.toChecksumAddress(erc20_contract_bridge.wallet_address) + checked_address = erc20_contract_bridge.web_provider.to_checksum_address(erc20_contract_bridge.wallet_address) # Web3 only accepts checkedSum addresses. building_params = {"from": checked_address} mint_raw_transaction = erc20_contract_bridge.call_write_function("mint", checked_address, @@ -39,7 +39,7 @@ building_params=building_params) # We will now submit the transaction to Fireblocks. mint_transaction = erc20_contract_bridge.submit_transaction(mint_raw_transaction) - if ropsten_bridge.check_tx_is_completed(mint_transaction['id']) == TRANSACTION_STATUS_COMPLETED: + if goerli_bridge.check_tx_is_completed(mint_transaction['id']) == TRANSACTION_STATUS_COMPLETED: print(f"Successfully minted {TOKEN_AMOUNT} to {erc20_contract_bridge.wallet_address}") transfer_raw_transaction = erc20_contract_bridge.call_write_function("transferFrom", checked_address, @@ -47,7 +47,7 @@ building_params=building_params) transfer_transaction = erc20_contract_bridge.submit_transaction(transfer_raw_transaction, "Transferring 10 minted tokens.") - if ropsten_bridge.check_tx_is_completed(transfer_transaction['id']): + if goerli_bridge.check_tx_is_completed(transfer_transaction['id']): print( f"Successfully transferred {TOKEN_AMOUNT} from {erc20_contract_bridge.wallet_address} to " f"{RECEIVER_ADDRESS}") diff --git a/fireblocks_defi_sdk_py/tokenization/examples/multi_token_example.py b/fireblocks_defi_sdk_py/tokenization/examples/multi_token_example.py index 27cf5b4..260914d 100644 --- a/fireblocks_defi_sdk_py/tokenization/examples/multi_token_example.py +++ b/fireblocks_defi_sdk_py/tokenization/examples/multi_token_example.py @@ -14,9 +14,9 @@ TOKEN_IDS = [1, 2] if __name__ == "__main__": - # We start by building a bridge to the Kovan network, including initiating a ERC1155 object. - kovan_bridge = Web3Bridge(SDK, VAULT_ID, CONTRACT, Chain.KOVAN) - multi_token_contract_bridge = ERC1155(kovan_bridge) + # We start by building a bridge to the Goerli network, including initiating a ERC1155 object. + goerli_bridge = Web3Bridge(SDK, VAULT_ID, Chain.GOERLI, CONTRACT) + multi_token_contract_bridge = ERC1155(goerli_bridge) # ERC1155 implements all the basic capabilities mentioned in ERC721: # https://ethereum.org/en/developers/docs/standards/tokens/erc-1155/ @@ -31,7 +31,7 @@ transfer_tokens = multi_token_contract_bridge.safe_batch_transfer_from(RECEIVER_ADDRESSES, TOKEN_IDS, tokens_balance, note="Transfer to another vault.") - transfer_result = kovan_bridge.check_tx_is_completed(transfer_tokens['id']) + transfer_result = goerli_bridge.check_tx_is_completed(transfer_tokens['id']) if transfer_result == TRANSACTION_STATUS_COMPLETED: print(f"{RECEIVER_ADDRESSES} now owns {tokens_balance} of tokens: {TOKEN_IDS}") diff --git a/fireblocks_defi_sdk_py/tokenization/examples/nft_example.py b/fireblocks_defi_sdk_py/tokenization/examples/nft_example.py index 925303e..1d453b9 100644 --- a/fireblocks_defi_sdk_py/tokenization/examples/nft_example.py +++ b/fireblocks_defi_sdk_py/tokenization/examples/nft_example.py @@ -13,9 +13,9 @@ TOKEN_ID = 1 if __name__ == "__main__": - # We start by building a bridge to the Ropsten network, including initiating a ERC721 object. - ropsten_bridge = Web3Bridge(SDK, VAULT_ID, CONTRACT_ADDRESS, Chain.ROPSTEN) - nft_contract_bridge = ERC721(ropsten_bridge) + # We start by building a bridge to the Goerli network, including initiating a ERC721 object. + goerli_bridge = Web3Bridge(SDK, VAULT_ID, Chain.GOERLI, CONTRACT_ADDRESS) + nft_contract_bridge = ERC721(goerli_bridge) # ERC721 implements all the basic capabilities mentioned in ERC721: # https://ethereum.org/en/developers/docs/standards/tokens/erc-721/ @@ -40,7 +40,7 @@ receiver_initial_balance = nft_contract_bridge.balance_of(RECEIVER_ADDRESS) # safe_transfer_from returns a dictionary with a status and id. transaction = nft_contract_bridge.safe_transfer_from(RECEIVER_ADDRESS, TOKEN_ID) - transaction_result = ropsten_bridge.check_tx_is_completed(transaction['id']) + transaction_result = goerli_bridge.check_tx_is_completed(transaction['id']) if transaction_result == TRANSACTION_STATUS_COMPLETED: # After the transaction has been completed we check whether the balance of the receiver has been updated diff --git a/fireblocks_defi_sdk_py/tokenization/tokens/base_token.py b/fireblocks_defi_sdk_py/tokenization/tokens/base_token.py index c68a91a..e44161a 100644 --- a/fireblocks_defi_sdk_py/tokenization/tokens/base_token.py +++ b/fireblocks_defi_sdk_py/tokenization/tokens/base_token.py @@ -17,7 +17,7 @@ def __init__(self, web3_bridge: Web3Bridge): self.web_provider = web3_bridge.web_provider self.abi = None self.contract: contract = self.web_provider.eth.contract( - address=self.web_provider.toChecksumAddress(self.web3_bridge.external_wallet_address) + address=self.web_provider.to_checksum_address(self.web3_bridge.external_wallet_address) ) def __str__(self): @@ -42,11 +42,11 @@ def call_write_function(self, abi_function: str, *args, building_params: dict = """ if not building_params: building_params = {} - return self.contract.get_function_by_name(abi_function)(*args).buildTransaction(building_params) + return self.contract.get_function_by_name(abi_function)(*args).build_transaction(building_params) def submit_transaction(self, transaction: dict, note: str = "") -> dict: """ - Takes a ready transaction after being built (using web3 buildTransaction()) and transmits it to Fireblocks. + Takes a ready transaction after being built (using web3 build_transaction()) and transmits it to Fireblocks. :param note: :param transaction: :return: diff --git a/fireblocks_defi_sdk_py/tokenization/tokens/custom_token.py b/fireblocks_defi_sdk_py/tokenization/tokens/custom_token.py index 2a08cf0..3b9bc6b 100644 --- a/fireblocks_defi_sdk_py/tokenization/tokens/custom_token.py +++ b/fireblocks_defi_sdk_py/tokenization/tokens/custom_token.py @@ -6,6 +6,6 @@ def __init__(self, web3_bridge: Web3Bridge, custom_abi: str): super().__init__(web3_bridge) self.abi = custom_abi self.contract = self.web_provider.eth.contract( - address=self.web_provider.toChecksumAddress(self.web3_bridge.external_wallet_address), + address=self.web_provider.to_checksum_address(self.web3_bridge.external_wallet_address), abi=self.abi ) diff --git a/fireblocks_defi_sdk_py/tokenization/tokens/erc1155.py b/fireblocks_defi_sdk_py/tokenization/tokens/erc1155.py index 43dad24..d8b46d6 100644 --- a/fireblocks_defi_sdk_py/tokenization/tokens/erc1155.py +++ b/fireblocks_defi_sdk_py/tokenization/tokens/erc1155.py @@ -9,7 +9,7 @@ def __init__(self, web3_bridge: Web3Bridge): super().__init__(web3_bridge) self.abi = ERC1155_ABI self.contract: contract = self.web_provider.eth.contract( - address=self.web_provider.toChecksumAddress(self.web3_bridge.external_wallet_address), + address=self.web_provider.to_checksum_address(self.web3_bridge.external_wallet_address), abi=self.abi ) @@ -22,7 +22,7 @@ def set_approval_for_all(self, operator_address: str, is_approved: bool, note: s :param note: (Optional) Add a note to the transaction. :return: None """ - checked_op_adr = self.web_provider.toChecksumAddress(operator_address) + checked_op_adr = self.web_provider.to_checksum_address(operator_address) return self.submit_transaction(self.call_write_function("setApprovalForAll", checked_op_adr, is_approved), note) def safe_transfer_from(self, to_address: str, token_id: int, amount: int, from_address: str = "", @@ -38,9 +38,9 @@ def safe_transfer_from(self, to_address: str, token_id: int, amount: int, from_a """ if not from_address: from_address = self.wallet_address - address_dict = {"from": self.web_provider.toChecksumAddress(from_address)} - checked_from_adr = self.web_provider.toChecksumAddress(from_address) - checked_to_adr = self.web_provider.toChecksumAddress(to_address) + address_dict = {"from": self.web_provider.to_checksum_address(from_address)} + checked_from_adr = self.web_provider.to_checksum_address(from_address) + checked_to_adr = self.web_provider.to_checksum_address(to_address) transaction = self.contract.functions.safeTransferFrom( checked_from_adr, @@ -48,7 +48,7 @@ def safe_transfer_from(self, to_address: str, token_id: int, amount: int, from_a token_id, amount, data - ).buildTransaction(address_dict) + ).build_transaction(address_dict) return self.submit_transaction(transaction, note) @@ -71,9 +71,9 @@ def safe_batch_transfer_from(self, to_address: str, token_ids: List[int], values """ if not from_address: from_address = self.wallet_address - address_dict = {"from": self.web_provider.toChecksumAddress(from_address)} - checked_from_adr = self.web_provider.toChecksumAddress(from_address) - checked_to_adr = self.web_provider.toChecksumAddress(to_address) + address_dict = {"from": self.web_provider.to_checksum_address(from_address)} + checked_from_adr = self.web_provider.to_checksum_address(from_address) + checked_to_adr = self.web_provider.to_checksum_address(to_address) if len(token_ids) != len(values): raise ValueError("Length of token_ids and values must match!") @@ -83,7 +83,7 @@ def safe_batch_transfer_from(self, to_address: str, token_ids: List[int], values token_ids, values, data - ).buildTransaction(address_dict) + ).build_transaction(address_dict) return self.submit_transaction(transaction, note) @@ -117,7 +117,7 @@ def balance_of_batch(self, id_list: List[int], owners_list=None) -> List[int]: """ if not owners_list: owners_list = [self.wallet_address] * len(id_list) - checked_addresses = [self.web_provider.toChecksumAddress(address) for address in owners_list] + checked_addresses = [self.web_provider.to_checksum_address(address) for address in owners_list] return self.call_read_function("balanceOfBatch", checked_addresses, id_list) def is_approved_for_all(self, operator_address: str, owner_address: str = "") -> bool: @@ -129,8 +129,8 @@ def is_approved_for_all(self, operator_address: str, owner_address: str = "") -> """ if not owner_address: owner_address = self.wallet_address - owner_checked_address = self.web_provider.toChecksumAddress(owner_address) - operator_checked_address = self.web_provider.toChecksumAddress(operator_address) + owner_checked_address = self.web_provider.to_checksum_address(owner_address) + operator_checked_address = self.web_provider.to_checksum_address(operator_address) return self.call_read_function("isApprovedForAll", owner_checked_address, operator_checked_address) def uri(self, token_id: int) -> str: diff --git a/fireblocks_defi_sdk_py/tokenization/tokens/erc721.py b/fireblocks_defi_sdk_py/tokenization/tokens/erc721.py index d904186..a58619f 100644 --- a/fireblocks_defi_sdk_py/tokenization/tokens/erc721.py +++ b/fireblocks_defi_sdk_py/tokenization/tokens/erc721.py @@ -7,7 +7,7 @@ def __init__(self, web3_bridge: Web3Bridge): super().__init__(web3_bridge) self.abi = ERC721_ABI self.contract: contract = self.web_provider.eth.contract( - address=self.web_provider.toChecksumAddress(self.web3_bridge.external_wallet_address), + address=self.web_provider.to_checksum_address(self.web3_bridge.external_wallet_address), abi=self.abi ) @@ -21,10 +21,10 @@ def approve(self, to_address: str, token_id: int, approver_address: str = "", no :param note: (Optional) Add a note to the transaction. :return: None """ - checked_app_adr = self.web_provider.toChecksumAddress(to_address) + checked_app_adr = self.web_provider.to_checksum_address(to_address) if not approver_address: approver_address = self.wallet_address - address_dict = {"from": self.web_provider.toChecksumAddress(approver_address)} + address_dict = {"from": self.web_provider.to_checksum_address(approver_address)} return self.submit_transaction(self.call_write_function("approve", checked_app_adr, token_id, building_params=address_dict), note) @@ -41,23 +41,23 @@ def safe_transfer_from(self, to_address: str, token_id: int, from_address: str = """ if not from_address: from_address = self.wallet_address - address_dict = {"from": self.web_provider.toChecksumAddress(from_address)} - checked_from_adr = self.web_provider.toChecksumAddress(from_address) - checked_to_adr = self.web_provider.toChecksumAddress(to_address) + address_dict = {"from": self.web_provider.to_checksum_address(from_address)} + checked_from_adr = self.web_provider.to_checksum_address(from_address) + checked_to_adr = self.web_provider.to_checksum_address(to_address) if data: transaction = self.contract.functions.safeTransferFrom( checked_from_adr, checked_to_adr, token_id, data - ).buildTransaction(address_dict) + ).build_transaction(address_dict) else: transaction = self.contract.functions.safeTransferFrom( checked_from_adr, checked_to_adr, token_id - ).buildTransaction(address_dict) + ).build_transaction(address_dict) return self.submit_transaction(transaction, note) @@ -73,9 +73,9 @@ def transfer_from(self, to_address: str, token_id: int, from_address: str = "", """ if not from_address: from_address = self.wallet_address - address_dict = {"from": self.web_provider.toChecksumAddress(from_address)} - checked_from_adr = self.web_provider.toChecksumAddress(from_address) - checked_to_adr = self.web_provider.toChecksumAddress(to_address) + address_dict = {"from": self.web_provider.to_checksum_address(from_address)} + checked_from_adr = self.web_provider.to_checksum_address(from_address) + checked_to_adr = self.web_provider.to_checksum_address(to_address) return self.submit_transaction(self.call_write_function("transferFrom", checked_from_adr, checked_to_adr, @@ -90,7 +90,7 @@ def set_approval_for_all(self, operator_address: str, is_approved: bool, note: s :param note: (Optional) Add a note to the transaction. :return: None """ - checked_op_adr = self.web_provider.toChecksumAddress(operator_address) + checked_op_adr = self.web_provider.to_checksum_address(operator_address) return self.submit_transaction(self.call_write_function("setApprovalForAll", checked_op_adr, is_approved), note) # Views @@ -118,8 +118,8 @@ def is_approved_for_all(self, owner_address: str, operator_address: str) -> bool :param operator_address: Address of the meant to be operator. :return: True whether operator is approved, False otherwise """ - owner_checked_address = self.web_provider.toChecksumAddress(owner_address) - operator_checked_address = self.web_provider.toChecksumAddress(operator_address) + owner_checked_address = self.web_provider.to_checksum_address(owner_address) + operator_checked_address = self.web_provider.to_checksum_address(operator_address) return self.call_read_function("isApprovedForAll", owner_checked_address, operator_checked_address) def balance_of(self, owner_address: str = "") -> int: @@ -130,7 +130,7 @@ def balance_of(self, owner_address: str = "") -> int: """ if not owner_address: owner_address = self.wallet_address - owner_checked_address = self.web_provider.toChecksumAddress(owner_address) + owner_checked_address = self.web_provider.to_checksum_address(owner_address) return self.call_read_function("balanceOf", owner_checked_address) def owner_of(self, token_id: int) -> str: diff --git a/fireblocks_defi_sdk_py/web3_bridge.py b/fireblocks_defi_sdk_py/web3_bridge.py index ddd20f6..91562a7 100644 --- a/fireblocks_defi_sdk_py/web3_bridge.py +++ b/fireblocks_defi_sdk_py/web3_bridge.py @@ -35,7 +35,6 @@ Chain.OPTIMISM: ('ETH-OPT', "https://rpc.ankr.com/optimism"), Chain.OPTIMISM_KOVAN: ('ETH-OPT_KOV', "https://optimism-kovan.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161"), Chain.RONIN: ('RON', "https://api.roninchain.com/rpc"), - Chain.ARBITRUM: ('ETH-AETH', "https://rpc.ankr.com/arbitrum"), Chain.ARBITRUM_GOERLI: ('ETH-AETH_RIN', "https://goerli-rollup.arbitrum.io/rpc") } @@ -63,7 +62,7 @@ def __init__(self, fb_api_client: FireblocksSDK, def send_transaction(self, transaction: dict, note="") -> dict: """ - Takes a ready transaction after being built (using web3 buildTransaction()) and transmits it to Fireblocks. + Takes a ready transaction after being built (using web3 build_transaction()) and transmits it to Fireblocks. :param transaction: A transaction object (dict) to submit to the blockchain. :param note: (Optional) A note to submit with the transaction. :return: diff --git a/setup.py b/setup.py index 1a4919c..f0ac84d 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ 'fireblocks_defi_sdk_py.tokenization.utils', 'fireblocks_defi_sdk_py.tokenization.examples' ], - version='1.0.2', + version='1.1.0', license='MIT', description='fireblocks_defi_sdk_py', long_description="""Fireblocks python SDK""", @@ -20,8 +20,8 @@ download_url='https://github.com/fireblocks/fireblocks-defi-sdk-py/archive/refs/tags/1.0.2.tar.gz', keywords=['FIREBLOCKS', 'DeFi', 'SDK', 'PYTHON'], install_requires=[ - 'fireblocks_sdk==1.17.3', - 'web3==5.26.0' + 'fireblocks_sdk==1.19.0', + 'web3==6.2.0' ], classifiers=[ 'Development Status :: 3 - Alpha',