mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-09-20 16:08:51 +03:00
add nft id to rpcs (#14588)
* add the nft id to the rpc returns * fixup mypy issue
This commit is contained in:
parent
ed8cee2b4b
commit
8de40f8299
@ -21,6 +21,8 @@ DEFAULT_STATUS = "DEFAULT"
|
||||
class NFTInfo(Streamable):
|
||||
"""NFT Info for displaying NFT on the UI"""
|
||||
|
||||
nft_id: str
|
||||
|
||||
launcher_id: bytes32
|
||||
"""Launcher coin ID"""
|
||||
|
||||
|
@ -9,11 +9,13 @@ from clvm_tools.binutils import disassemble
|
||||
from chia.types.blockchain_format.program import Program
|
||||
from chia.types.blockchain_format.serialized_program import SerializedProgram
|
||||
from chia.types.blockchain_format.sized_bytes import bytes32
|
||||
from chia.util.bech32m import encode_puzzle_hash
|
||||
from chia.util.ints import uint16, uint64
|
||||
from chia.wallet.nft_wallet.nft_info import NFTCoinInfo, NFTInfo
|
||||
from chia.wallet.nft_wallet.uncurry_nft import UncurriedNFT
|
||||
from chia.wallet.puzzles.load_clvm import load_clvm_maybe_recompile
|
||||
from chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import solution_for_conditions
|
||||
from chia.wallet.util.address_type import AddressType
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
SINGLETON_TOP_LAYER_MOD = load_clvm_maybe_recompile("singleton_top_layer_v1_1.clvm")
|
||||
@ -81,7 +83,7 @@ def create_full_puzzle(
|
||||
|
||||
|
||||
async def get_nft_info_from_puzzle(
|
||||
nft_coin_info: NFTCoinInfo, config: Dict = None, ignore_size_limit: bool = False
|
||||
nft_coin_info: NFTCoinInfo, config: Dict[str, Any], ignore_size_limit: bool = False
|
||||
) -> NFTInfo:
|
||||
"""
|
||||
Extract NFT info from a full puzzle
|
||||
@ -104,6 +106,7 @@ async def get_nft_info_from_puzzle(
|
||||
license_uris.append(str(uri, "utf-8"))
|
||||
off_chain_metadata: Optional[str] = None
|
||||
nft_info = NFTInfo(
|
||||
encode_puzzle_hash(uncurried_nft.singleton_launcher_id, prefix=AddressType.NFT.hrp(config=config)),
|
||||
uncurried_nft.singleton_launcher_id,
|
||||
nft_coin_info.coin.name(),
|
||||
uncurried_nft.owner_did,
|
||||
|
Loading…
Reference in New Issue
Block a user