Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add disallow_incoming flags #522

Merged
merged 4 commits into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Created function alias to `safe_sign_and_autofill_transaction` called `autofill_and_sign` to reflect order of operations
- Created function alias to `submit_transaction` called `submit`
- Created function alias to `safe_sign_and_submit_transaction` called `sign_and_submit`
- AccountSetFlags for disallowing incoming objects (e.g. `asf_disallow_incoming_trustline`)

### Changed:
- `check_fee` now has a higher limit that is less likely to be hit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ def test_account_set_flags(self):
asf_no_freeze=True,
asf_require_auth=True,
asf_require_dest=True,
asf_disable_incoming_nft_offer=True,
asf_disable_incoming_check=True,
asf_disable_incoming_paychan=True,
asf_disable_incoming_trustline=True,
),
)
self.assertTrue(actual.has_flag(flag=0x00000005))
Expand Down
16 changes: 16 additions & 0 deletions xrpl/models/transactions/account_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,18 @@ class AccountSetFlag(int, Enum):
ASF_AUTHORIZED_NFTOKEN_MINTER = 10
"""Allow another account to mint and burn tokens on behalf of this account."""

ASF_DISABLE_INCOMING_NFT_OFFER = 12
"""Disallow other accounts from creating NFTokenOffers directed at this account."""

ASF_DISABLE_INCOMING_CHECK = 13
"""Disallow other accounts from creating Checks directed at this account."""

ASF_DISABLE_INCOMING_PAYCHAN = 14
"""Disallow other accounts from creating PayChannels directed at this account."""

ASF_DISABLE_INCOMING_TRUSTLINE = 15
"""Disallow other accounts from creating Trustlines directed at this account."""


class AccountSetFlagInterface(FlagInterface):
"""
Expand All @@ -112,6 +124,10 @@ class AccountSetFlagInterface(FlagInterface):
ASF_REQUIRE_AUTH: bool
ASF_REQUIRE_DEST: bool
ASF_AUTHORIZED_NFTOKEN_MINTER: bool
ASF_DISABLE_INCOMING_NFT_OFFER: bool
ASF_DISABLE_INCOMING_CHECK: bool
ASF_DISABLE_INCOMING_PAYCHAN: bool
ASF_DISABLE_INCOMING_TRUSTLINE: bool


@require_kwargs_on_init
Expand Down