mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-21 12:15:50 +00:00
Change to AccountSetAsfFlag for enum
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
from xrpl.clients import JsonRpcClient
|
from xrpl.clients import JsonRpcClient
|
||||||
from xrpl.models.transactions import AccountSet, SetRegularKey, AccountSetFlag
|
from xrpl.models.transactions import AccountSet, SetRegularKey, AccountSetAsfFlag
|
||||||
from xrpl.transaction import submit_and_wait
|
from xrpl.transaction import submit_and_wait
|
||||||
from xrpl.wallet import generate_faucet_wallet
|
from xrpl.wallet import generate_faucet_wallet
|
||||||
from xrpl.models.requests import AccountInfo
|
from xrpl.models.requests import AccountInfo
|
||||||
@@ -41,7 +41,7 @@ print(f" Tx content: {submit_tx_regular}")
|
|||||||
# This permanently blackholes an account!
|
# This permanently blackholes an account!
|
||||||
tx_disable_master_key = AccountSet(
|
tx_disable_master_key = AccountSet(
|
||||||
account=myAddr,
|
account=myAddr,
|
||||||
set_flag=AccountSetFlag.ASF_DISABLE_MASTER
|
set_flag=AccountSetAsfFlag.ASF_DISABLE_MASTER
|
||||||
)
|
)
|
||||||
|
|
||||||
# Sign and submit the transaction
|
# Sign and submit the transaction
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
from xrpl.clients import JsonRpcClient
|
from xrpl.clients import JsonRpcClient
|
||||||
from xrpl.models import AccountSet, AccountSetFlag
|
from xrpl.models import AccountSet, AccountSetAsfFlag
|
||||||
from xrpl.transaction import submit_and_wait
|
from xrpl.transaction import submit_and_wait
|
||||||
from xrpl.wallet import generate_faucet_wallet
|
from xrpl.wallet import generate_faucet_wallet
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ sender_wallet = generate_faucet_wallet(client=client)
|
|||||||
print("Successfully generated test wallet")
|
print("Successfully generated test wallet")
|
||||||
|
|
||||||
# build accountset transaction to disable freezing
|
# build accountset transaction to disable freezing
|
||||||
accountset = AccountSet(account=sender_wallet.address, set_flag=AccountSetFlag.ASF_NO_FREEZE)
|
accountset = AccountSet(account=sender_wallet.address, set_flag=AccountSetAsfFlag.ASF_NO_FREEZE)
|
||||||
|
|
||||||
print("Now sending an AccountSet transaction to set the ASF_NO_FREEZE flag...")
|
print("Now sending an AccountSet transaction to set the ASF_NO_FREEZE flag...")
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
from xrpl.clients import JsonRpcClient
|
from xrpl.clients import JsonRpcClient
|
||||||
from xrpl.models import AccountSet, AccountSetFlag
|
from xrpl.models import AccountSet, AccountSetAsfFlag
|
||||||
from xrpl.transaction import submit_and_wait
|
from xrpl.transaction import submit_and_wait
|
||||||
from xrpl.wallet import generate_faucet_wallet
|
from xrpl.wallet import generate_faucet_wallet
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ print("Successfully generated test wallet")
|
|||||||
|
|
||||||
# Build accountset transaction to enable global freeze
|
# Build accountset transaction to enable global freeze
|
||||||
accountset = AccountSet(account=sender_wallet.address,
|
accountset = AccountSet(account=sender_wallet.address,
|
||||||
set_flag=AccountSetFlag.ASF_GLOBAL_FREEZE)
|
set_flag=AccountSetAsfFlag.ASF_GLOBAL_FREEZE)
|
||||||
|
|
||||||
print("Preparing and submitting Account set transaction with ASF_GLOBAL_FREEZE ...")
|
print("Preparing and submitting Account set transaction with ASF_GLOBAL_FREEZE ...")
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ cold_settings_tx = xrpl.models.transactions.AccountSet(
|
|||||||
transfer_rate=0,
|
transfer_rate=0,
|
||||||
tick_size=5,
|
tick_size=5,
|
||||||
domain=bytes.hex("example.com".encode("ASCII")),
|
domain=bytes.hex("example.com".encode("ASCII")),
|
||||||
set_flag=xrpl.models.transactions.AccountSetFlag.ASF_DEFAULT_RIPPLE,
|
set_flag=xrpl.models.transactions.AccountSetAsfFlag.ASF_DEFAULT_RIPPLE,
|
||||||
)
|
)
|
||||||
|
|
||||||
print("Sending cold address AccountSet transaction...")
|
print("Sending cold address AccountSet transaction...")
|
||||||
@@ -34,7 +34,7 @@ print(response)
|
|||||||
# Configure hot address settings -----------------------------------------------
|
# Configure hot address settings -----------------------------------------------
|
||||||
hot_settings_tx = xrpl.models.transactions.AccountSet(
|
hot_settings_tx = xrpl.models.transactions.AccountSet(
|
||||||
account=hot_wallet.address,
|
account=hot_wallet.address,
|
||||||
set_flag=xrpl.models.transactions.AccountSetFlag.ASF_REQUIRE_AUTH,
|
set_flag=xrpl.models.transactions.AccountSetAsfFlag.ASF_REQUIRE_AUTH,
|
||||||
)
|
)
|
||||||
|
|
||||||
print("Sending hot address AccountSet transaction...")
|
print("Sending hot address AccountSet transaction...")
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
from xrpl.transaction import submit_and_wait
|
from xrpl.transaction import submit_and_wait
|
||||||
from xrpl.models.transactions.nftoken_mint import NFTokenMint, NFTokenMintFlag
|
from xrpl.models.transactions.nftoken_mint import NFTokenMint, NFTokenMintFlag
|
||||||
from xrpl.models.transactions.account_set import AccountSet, AccountSetFlag
|
from xrpl.models.transactions.account_set import AccountSet, AccountSetAsfFlag
|
||||||
from xrpl.wallet import generate_faucet_wallet
|
from xrpl.wallet import generate_faucet_wallet
|
||||||
from xrpl.models.requests import AccountNFTs
|
from xrpl.models.requests import AccountNFTs
|
||||||
from xrpl.clients import JsonRpcClient
|
from xrpl.clients import JsonRpcClient
|
||||||
@@ -40,7 +40,7 @@ print(f" Seed: {nftoken_minter_wallet.seed}")
|
|||||||
print(f"\nAuthorizing account {minterAddr} as a NFT minter on account {issuerAddr}...")
|
print(f"\nAuthorizing account {minterAddr} as a NFT minter on account {issuerAddr}...")
|
||||||
authorize_minter_tx = AccountSet(
|
authorize_minter_tx = AccountSet(
|
||||||
account=issuerAddr,
|
account=issuerAddr,
|
||||||
set_flag=AccountSetFlag.ASF_AUTHORIZED_NFTOKEN_MINTER,
|
set_flag=AccountSetAsfFlag.ASF_AUTHORIZED_NFTOKEN_MINTER,
|
||||||
nftoken_minter=minterAddr
|
nftoken_minter=minterAddr
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from xrpl.transaction import submit_and_wait
|
|||||||
from xrpl.models.transactions.nftoken_mint import NFTokenMint, NFTokenMintFlag
|
from xrpl.models.transactions.nftoken_mint import NFTokenMint, NFTokenMintFlag
|
||||||
from xrpl.models.transactions.nftoken_accept_offer import NFTokenAcceptOffer
|
from xrpl.models.transactions.nftoken_accept_offer import NFTokenAcceptOffer
|
||||||
from xrpl.models.transactions.nftoken_cancel_offer import NFTokenCancelOffer
|
from xrpl.models.transactions.nftoken_cancel_offer import NFTokenCancelOffer
|
||||||
from xrpl.models.transactions.account_set import AccountSet, AccountSetFlag
|
from xrpl.models.transactions.account_set import AccountSet, AccountSetAsfFlag
|
||||||
from xrpl.models.transactions.nftoken_burn import NFTokenBurn
|
from xrpl.models.transactions.nftoken_burn import NFTokenBurn
|
||||||
from xrpl.wallet import generate_faucet_wallet
|
from xrpl.wallet import generate_faucet_wallet
|
||||||
from xrpl.models.requests import AccountNFTs
|
from xrpl.models.requests import AccountNFTs
|
||||||
@@ -94,7 +94,7 @@ else:
|
|||||||
print(f"\n - Authorizing account {minterAddr} as a NFT minter on account {issuerAddr}...")
|
print(f"\n - Authorizing account {minterAddr} as a NFT minter on account {issuerAddr}...")
|
||||||
authorize_minter_tx = AccountSet(
|
authorize_minter_tx = AccountSet(
|
||||||
account=issuerAddr,
|
account=issuerAddr,
|
||||||
set_flag=AccountSetFlag.ASF_AUTHORIZED_NFTOKEN_MINTER,
|
set_flag=AccountSetAsfFlag.ASF_AUTHORIZED_NFTOKEN_MINTER,
|
||||||
nftoken_minter=minterAddr
|
nftoken_minter=minterAddr
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ from xrpl.asyncio.wallet import generate_faucet_wallet
|
|||||||
from xrpl.models.requests import AccountInfo
|
from xrpl.models.requests import AccountInfo
|
||||||
from xrpl.models.transactions import (
|
from xrpl.models.transactions import (
|
||||||
AccountSet,
|
AccountSet,
|
||||||
AccountSetFlag,
|
AccountSetAsfFlag,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ async def main() -> int:
|
|||||||
# Send AccountSet transaction -----------------------------------------------
|
# Send AccountSet transaction -----------------------------------------------
|
||||||
tx = AccountSet(
|
tx = AccountSet(
|
||||||
account=wallet.address,
|
account=wallet.address,
|
||||||
set_flag=AccountSetFlag.ASF_REQUIRE_DEST,
|
set_flag=AccountSetAsfFlag.ASF_REQUIRE_DEST,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Sign and autofill the transaction (ready to submit)
|
# Sign and autofill the transaction (ready to submit)
|
||||||
|
|||||||
Reference in New Issue
Block a user