Skip to content

Commit

Permalink
update to 2.4.4 and remove python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffwalmsley committed Oct 17, 2024
1 parent d219b7b commit d12ab8d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
16 changes: 9 additions & 7 deletions chianft/util/mint.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from chia.consensus.default_constants import DEFAULT_CONSTANTS
from chia.rpc.full_node_rpc_client import FullNodeRpcClient
from chia.rpc.wallet_request_types import NFTMintBulkResponse
from chia.rpc.wallet_rpc_client import WalletRpcClient
from chia.types.blockchain_format.coin import Coin
from chia.types.blockchain_format.program import INFINITE_COST
Expand Down Expand Up @@ -136,7 +137,7 @@ async def create_spend_bundles(
assert royalty_percentage is not None
assert royalty_address is not None
for i in range(0, mint_total, chunk):
resp = await self.wallet_client.nft_mint_bulk(
resp: NFTMintBulkResponse = await self.wallet_client.nft_mint_bulk(
wallet_id=self.nft_wallet_id,
metadata_list=metadata_list[i : i + chunk],
target_list=target_list[i : i + chunk],
Expand All @@ -151,12 +152,12 @@ async def create_spend_bundles(
mint_from_did=mint_from_did,
tx_config=DEFAULT_TX_CONFIG,
)
if not resp["success"]:
if not resp:
raise ValueError(
"SpendBundle could not be created for metadata rows: %s to %s"
% (i, i + chunk)
)
sb = SpendBundle.from_json_dict(resp["spend_bundle"])
sb = resp.spend_bundle
spend_bundles.append(bytes(sb))
next_coin = [
c for c in sb.additions() if c.puzzle_hash == funding_coin.puzzle_hash
Expand Down Expand Up @@ -223,7 +224,7 @@ async def add_fee_to_spend(
return spend, 0
total_fee = sb_cost * (fee_per_cost * attempt)
print("Fee for inclusion: {}".format(total_fee))
fee_tx = await self.wallet_client.create_signed_transaction(
fee_tx = await self.wallet_client.create_signed_transactions(
additions=[
{
"amount": fee_coin.amount - total_fee,
Expand All @@ -234,8 +235,8 @@ async def add_fee_to_spend(
fee=uint64(total_fee),
tx_config=DEFAULT_TX_CONFIG,
)
assert fee_tx.spend_bundle is not None
spend_with_fee = SpendBundle.aggregate([fee_tx.spend_bundle, spend])
assert fee_tx.signed_tx.spend_bundle is not None
spend_with_fee = SpendBundle.aggregate([fee_tx.signed_tx.spend_bundle, spend])
return spend_with_fee, total_fee

async def sb_in_mempool(self, sb_name: bytes32) -> bool:
Expand Down Expand Up @@ -365,11 +366,12 @@ async def create_offer(
}
for i in range(10):
try:
offer, tr = await self.wallet_client.create_offer_for_ids(
offer_resp = await self.wallet_client.create_offer_for_ids(
offer_dict,
fee=0,
tx_config=DEFAULT_TX_CONFIG,
)
offer = offer_resp.offer
filepath = "offers/{}.offer".format(launcher_id)
assert offer is not None
with open(Path(filepath), "w") as file:
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
long_description = fh.read()

dependencies = [
"chia-blockchain==2.4.2",
"chia-blockchain==2.4.4",
]

dev_dependencies = [
Expand Down Expand Up @@ -44,9 +44,9 @@
long_description_content_type="text/markdown",
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"License :: OSI Approved :: Apache Software License",
"Topic :: Security :: Cryptography",
],
Expand Down

0 comments on commit d12ab8d

Please sign in to comment.