mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-23 13:15:49 +00:00
add auth minter
This commit is contained in:
@@ -126,8 +126,9 @@ This function sets the authorized minter for an account. Each account can have 0
|
||||
Get the wallet of the account granting permission and instantiate a client.
|
||||
|
||||
```python
|
||||
def set_minter(_seed, _minter):
|
||||
granter_wallet = Wallet(_seed, sequence = 16237283)
|
||||
def set_minter(seed, minter):
|
||||
"""set_minter"""
|
||||
granter_wallet=Wallet(seed, sequence = 16237283)
|
||||
client=JsonRpcClient(testnet_url)
|
||||
```
|
||||
|
||||
@@ -136,7 +137,7 @@ Define the AccountSet transaction that grants permission to another account to m
|
||||
```python
|
||||
set_minter_tx=xrpl.models.transactions.AccountSet(
|
||||
account=granter_wallet.classic_address,
|
||||
nftoken_minter = _minter,
|
||||
nftoken_minter=minter,
|
||||
set_flag=xrpl.models.transactions.AccountSetFlag.ASF_AUTHORIZED_NFTOKEN_MINTER
|
||||
)
|
||||
```
|
||||
@@ -151,11 +152,13 @@ Sign the transaction
|
||||
Submit the transaction and return the results.
|
||||
|
||||
```python
|
||||
reply=""
|
||||
try:
|
||||
response=xrpl.transaction.send_reliable_submission(signed_tx,client)
|
||||
reply=response.result
|
||||
except xrpl.transaction.XRPLReliableSubmissionException as e:
|
||||
response = f"Submit failed: {e}"
|
||||
return response.result
|
||||
reply=f"Submit failed: {e}"
|
||||
return reply
|
||||
```
|
||||
|
||||
### mint_other
|
||||
@@ -163,8 +166,9 @@ Submit the transaction and return the results.
|
||||
Get the minter wallet and instantiate a client connection to the XRP ledger.
|
||||
|
||||
``` python
|
||||
def mint_other(_seed, _uri, _flags, _transfer_fee, _taxon, _issuer):
|
||||
minter_wallet = Wallet(_seed, sequence = 16237283)
|
||||
def mint_other(seed, uri, flags, transfer_fee, taxon, issuer):
|
||||
"""mint_other"""
|
||||
minter_wallet=Wallet(seed, sequence=16237283)
|
||||
client=JsonRpcClient(testnet_url)
|
||||
```
|
||||
|
||||
@@ -173,11 +177,11 @@ Define the `NFTokenMint` transaction. The new parameter in this method is the _i
|
||||
```python
|
||||
mint_other_tx=xrpl.models.transactions.NFTokenMint(
|
||||
account=minter_wallet.classic_address,
|
||||
uri = xrpl.utils.str_to_hex(_uri),
|
||||
flags = int(_flags),
|
||||
transfer_fee = int(_transfer_fee),
|
||||
nftoken_taxon = int(_taxon),
|
||||
issuer = _issuer
|
||||
uri=xrpl.utils.str_to_hex(uri),
|
||||
flags=int(flags),
|
||||
transfer_fee=int(transfer_fee),
|
||||
nftoken_taxon=int(taxon),
|
||||
issuer=issuer
|
||||
)
|
||||
```
|
||||
|
||||
@@ -191,9 +195,11 @@ Sign and fill the transaction.
|
||||
Submit the transaction and report the results.
|
||||
|
||||
```python
|
||||
reply=""
|
||||
try:
|
||||
response=xrpl.transaction.send_reliable_submission(signed_tx,client)
|
||||
reply=response.result
|
||||
except xrpl.transaction.XRPLReliableSubmissionException as e:
|
||||
response = f"Submit failed: {e}"
|
||||
return response.result
|
||||
reply=f"Submit failed: {e}"
|
||||
return reply
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user