-
Notifications
You must be signed in to change notification settings - Fork 560
Support for Dynamic MPTs (XLS-94D) #3081
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
base: main
Are you sure you want to change the base?
Changes from 10 commits
0681e0a
ad316b7
fd1513d
2a56be3
29b8e80
058ad5b
1e0aaa0
fc51d7e
b792695
7e2e712
0876e86
0e07910
02d4a96
d6ec04a
bda0c2e
cbdcbc3
565402b
747bfd2
ce16616
42049ac
13f9ec9
7260f2f
0f3ae2f
9a6c46c
4a3a978
0c228cd
020b895
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,7 @@ import type { TransactionMetadataBase } from './metadata' | |
|
|
||
| // 2^63 - 1 | ||
| const MAX_AMT = '9223372036854775807' | ||
| const MAX_TRANSFER_FEE = 50000 | ||
| export const MAX_TRANSFER_FEE = 50000 | ||
|
|
||
| /** | ||
| * Transaction Flags for an MPTokenIssuanceCreate Transaction. | ||
|
|
@@ -53,6 +53,15 @@ export enum MPTokenIssuanceCreateFlags { | |
| * to clawback value from individual holders. | ||
| */ | ||
| tfMPTCanClawback = 0x00000040, | ||
|
|
||
| tmfMPTCanMutateCanLock = 0x00000002, | ||
kuan121 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| tmfMPTCanMutateRequireAuth = 0x00000004, | ||
| tmfMPTCanMutateCanEscrow = 0x00000008, | ||
| tmfMPTCanMutateCanTrade = 0x00000010, | ||
| tmfMPTCanMutateCanTransfer = 0x00000020, | ||
| tmfMPTCanMutateCanClawback = 0x00000040, | ||
| tmfMPTCanMutateMetadata = 0x00010000, | ||
| tmfMPTCanMutateTransferFee = 0x00020000, | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -69,6 +78,15 @@ export interface MPTokenIssuanceCreateFlagsInterface | |
| tfMPTCanTrade?: boolean | ||
| tfMPTCanTransfer?: boolean | ||
| tfMPTCanClawback?: boolean | ||
|
|
||
| tmfMPTCanMutateCanLock?: boolean | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These flags are only available for MutableFlags field. Should it be separated into its own interface, similar to what we did with
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Is the xrpl.org documentation updated already?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, the XLS specification is a good source of info for unreleased amendments. Usually, you can find the pre-release documentation for amendments on https://opensource.ripple.com/ as well, however LendingProtocol docs have not been published yet. You can look at pre-release docs for other amendments on that website.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We were separating the flags that can be set with
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| tmfMPTCanMutateRequireAuth?: boolean | ||
| tmfMPTCanMutateCanEscrow?: boolean | ||
| tmfMPTCanMutateCanTrade?: boolean | ||
| tmfMPTCanMutateCanTransfer?: boolean | ||
| tmfMPTCanMutateCanClawback?: boolean | ||
| tmfMPTCanMutateMetadata?: boolean | ||
| tmfMPTCanMutateTransferFee?: boolean | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -120,6 +138,7 @@ export interface MPTokenIssuanceCreate extends BaseTransaction { | |
| MPTokenMetadata?: string | ||
|
|
||
| Flags?: number | MPTokenIssuanceCreateFlagsInterface | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Flags cannot accept the mutable flags so the above change will be needed
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. code has been changed in ce16616 |
||
| MutableFlags?: number | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add docstring for this?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added a recent commit to fix this. However, I could not find the documentation for the
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update: I have added a docstring for the |
||
| } | ||
|
|
||
| export interface MPTokenIssuanceCreateMetadata extends TransactionMetadataBase { | ||
|
|
@@ -141,6 +160,7 @@ export function validateMPTokenIssuanceCreate( | |
| validateOptionalField(tx, 'MPTokenMetadata', isString) | ||
| validateOptionalField(tx, 'TransferFee', isNumber) | ||
| validateOptionalField(tx, 'AssetScale', isNumber) | ||
| validateOptionalField(tx, 'MutableFlags', isNumber) | ||
kuan121 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| if ( | ||
| typeof tx.MPTokenMetadata === 'string' && | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.