async def generate_new_coloured_coin( self, amount: uint64) -> Optional[SpendBundle]: coins = await self.standard_wallet.select_coins(amount) if coins is None: return None origin = coins.copy().pop() origin_id = origin.name() cc_inner_hash = await self.get_new_inner_hash() await self.add_lineage(origin_id, Program.to((0, [origin.as_list(), 0]))) genesis_coin_checker = create_genesis_or_zero_coin_checker(origin_id) minted_cc_puzzle_hash = cc_puzzle_hash_for_inner_puzzle_hash( CC_MOD, genesis_coin_checker, cc_inner_hash) tx_record = await self.standard_wallet.generate_signed_transaction( amount, minted_cc_puzzle_hash, uint64(0), origin_id, coins) if tx_record is None: return None lineage_proof: Optional[Program] = lineage_proof_for_genesis(origin) lineage_proofs = [(origin_id, lineage_proof)] cc_info: CCInfo = CCInfo(genesis_coin_checker, lineage_proofs) await self.save_info(cc_info) return tx_record.spend_bundle
def coin_checker_for_farmed_coin_by_coin_id(coin: Coin): return create_genesis_or_zero_coin_checker(coin.name())