7
7
8
8
from chia .consensus .default_constants import DEFAULT_CONSTANTS
9
9
from chia .rpc .full_node_rpc_client import FullNodeRpcClient
10
+ from chia .rpc .wallet_request_types import NFTMintBulkResponse
10
11
from chia .rpc .wallet_rpc_client import WalletRpcClient
11
12
from chia .types .blockchain_format .coin import Coin
12
13
from chia .types .blockchain_format .program import INFINITE_COST
@@ -136,7 +137,7 @@ async def create_spend_bundles(
136
137
assert royalty_percentage is not None
137
138
assert royalty_address is not None
138
139
for i in range (0 , mint_total , chunk ):
139
- resp = await self .wallet_client .nft_mint_bulk (
140
+ resp : NFTMintBulkResponse = await self .wallet_client .nft_mint_bulk (
140
141
wallet_id = self .nft_wallet_id ,
141
142
metadata_list = metadata_list [i : i + chunk ],
142
143
target_list = target_list [i : i + chunk ],
@@ -151,12 +152,12 @@ async def create_spend_bundles(
151
152
mint_from_did = mint_from_did ,
152
153
tx_config = DEFAULT_TX_CONFIG ,
153
154
)
154
- if not resp [ "success" ] :
155
+ if not resp :
155
156
raise ValueError (
156
157
"SpendBundle could not be created for metadata rows: %s to %s"
157
158
% (i , i + chunk )
158
159
)
159
- sb = SpendBundle . from_json_dict ( resp [ " spend_bundle" ])
160
+ sb = resp . spend_bundle
160
161
spend_bundles .append (bytes (sb ))
161
162
next_coin = [
162
163
c for c in sb .additions () if c .puzzle_hash == funding_coin .puzzle_hash
@@ -223,7 +224,7 @@ async def add_fee_to_spend(
223
224
return spend , 0
224
225
total_fee = sb_cost * (fee_per_cost * attempt )
225
226
print ("Fee for inclusion: {}" .format (total_fee ))
226
- fee_tx = await self .wallet_client .create_signed_transaction (
227
+ fee_tx = await self .wallet_client .create_signed_transactions (
227
228
additions = [
228
229
{
229
230
"amount" : fee_coin .amount - total_fee ,
@@ -234,8 +235,8 @@ async def add_fee_to_spend(
234
235
fee = uint64 (total_fee ),
235
236
tx_config = DEFAULT_TX_CONFIG ,
236
237
)
237
- assert fee_tx .spend_bundle is not None
238
- spend_with_fee = SpendBundle .aggregate ([fee_tx .spend_bundle , spend ])
238
+ assert fee_tx .signed_tx . spend_bundle is not None
239
+ spend_with_fee = SpendBundle .aggregate ([fee_tx .signed_tx . spend_bundle , spend ])
239
240
return spend_with_fee , total_fee
240
241
241
242
async def sb_in_mempool (self , sb_name : bytes32 ) -> bool :
@@ -365,11 +366,12 @@ async def create_offer(
365
366
}
366
367
for i in range (10 ):
367
368
try :
368
- offer , tr = await self .wallet_client .create_offer_for_ids (
369
+ offer_resp = await self .wallet_client .create_offer_for_ids (
369
370
offer_dict ,
370
371
fee = 0 ,
371
372
tx_config = DEFAULT_TX_CONFIG ,
372
373
)
374
+ offer = offer_resp .offer
373
375
filepath = "offers/{}.offer" .format (launcher_id )
374
376
assert offer is not None
375
377
with open (Path (filepath ), "w" ) as file :
0 commit comments