Merge pull request #11775 from AmineKhaldi/minting_cli_royalty_percentage

Add royalty percentage flag to the NFT minting command
This commit is contained in:
William Allen
2022-06-08 16:21:16 -05:00
committed by GitHub
2 changed files with 12 additions and 0 deletions
+10
View File
@@ -524,6 +524,14 @@ def nft_wallet_create_cmd(wallet_rpc_port: Optional[int], fingerprint: int) -> N
show_default=True,
callback=validate_fee,
)
@click.option(
"-rp",
"--royalty-percentage-fraction",
help="NFT royalty percentage fraction in basis points. Example: 175 would represent 1.75%",
type=int,
default=0,
show_default=True,
)
def nft_mint_cmd(
wallet_rpc_port: Optional[int],
fingerprint: int,
@@ -539,6 +547,7 @@ def nft_mint_cmd(
series_total: Optional[int],
series_number: Optional[int],
fee: str,
royalty_percentage: int,
) -> None:
import asyncio
from .wallet_funcs import execute_with_wallet, mint_nft
@@ -566,6 +575,7 @@ def nft_mint_cmd(
"series_total": series_total,
"series_number": series_number,
"fee": fee,
"royalty_percentage": royalty_percentage,
}
asyncio.run(execute_with_wallet(wallet_rpc_port, fingerprint, extra_params, mint_nft))
+2
View File
@@ -703,6 +703,7 @@ async def mint_nft(args: Dict, wallet_client: WalletRpcClient, fingerprint: int)
series_total = args["series_total"]
series_number = args["series_number"]
fee = args["fee"]
royalty_percentage = args["royalty_percentage"]
try:
response = await wallet_client.mint_nft(
wallet_id,
@@ -717,6 +718,7 @@ async def mint_nft(args: Dict, wallet_client: WalletRpcClient, fingerprint: int)
series_total,
series_number,
fee,
royalty_percentage,
)
spend_bundle = response["spend_bundle"]
print(f"NFT minted Successfully with spend bundle: {spend_bundle}")