Scaled UI Amount Issuer Guide

How to use the Scaled UI Amount extension

To use the Scaled UI Amount extension, you need to enable it on a token mint or token account. Note that once a token is created, you cannot modify which extensions are enabled.

Enable the Scaled UI Amount extension on a token mint

To enable the Scaled UI Amount extension on a token mint, you need to set the scaled_ui_amount_extension field to true in the Mint account. Here is an example of how to create a token with the Scaled UI Amount extension enabled using the spl-token CLI:

$ spl-token --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb create-token --ui-amount-multiplier 1.5
Creating token 66EV4CaihdqyQ1fbsr51wBsoqKLgAG5KiYz7r5XNrxUM under program TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
Address: 66EV4CaihdqyQ1fbsr51wBsoqKLgAG5KiYz7r5XNrxUM
Decimals: 9
Signature: 2sPziXu9M3duTCvsDvxQE9UKC9nBiLayi8muDvnjhA2qYvfXSZuaUieoq39MFjg4kf8xFrw6crmYSkPyV59dvudF

Update the UI amount multiplier

To update the UI amount multiplier, you need to use the update-ui-amount-multiplier command. A timestamp is optional and can be used to set a custom start time for the new multiplier. If no timestamp is provided, the current timestamp will be used.

$ spl-token update-ui-amount-multiplier 66EV4CaihdqyQ1fbsr51wBsoqKLgAG5KiYz7r5XNrxUM 1.5 -- 1746471400

Fetch the Balance

To fetch the balance, you need to use the balance command.

$ spl-token balance 66EV4CaihdqyQ1fbsr51wBsoqKLgAG5KiYz7r5XNrxUM

Is this page helpful?

सामग्री तालिका

पृष्ठ संपादित करें