Retrieves the human-readable name of the User Defined Token.
Optionalcontext: ContextScriptOptional SSRI context for script execution.
A promise resolving to the token's name.
Retrieves the symbol of the UDT.
Optionalcontext: ContextScriptOptional SSRI context for script execution.
The symbol of the UDT.
Retrieves the decimals of the UDT.
Optionalcontext: ContextScriptOptional SSRI context for script execution.
The decimals of the UDT.
Retrieves the icon of the UDT.
Optionalcontext: ContextScriptOptional SSRI context for script execution.
The icon of the UDT.
Transfers UDT to specified addresses.
The signer to use for the transaction.
The array of transfers.
Optionaltx: null | TransactionLikeTransfer on the basis of an existing transaction to achieve combined actions. If not provided, a new transaction will be created.
The transaction result.
Mutation - This method represents a mutation of the onchain state and will return a transaction object.
const { script: change } = await signer.getRecommendedAddressObj();
const { script: to } = await ccc.Address.fromString(receiver, signer.client);
const udt = new Udt(
{
txHash: "0x4e2e832e0b1e7b5994681b621b00c1e65f577ee4b440ef95fa07db9bb3d50269",
index: 0,
},
{
codeHash: "0xcc9dc33ef234e14bc788c43a4848556a5fb16401a04662fc55db9bb201987037",
hashType: "type",
args: "0x71fd1985b2971a9903e4d8ed0d59e6710166985217ca0681437883837b86162f"
},
);
const { res: tx } = await udtTrait.transfer(
signer,
[{ to, amount: 100 }],
);
const completedTx = udt.completeUdtBy(tx, signer);
await completedTx.completeInputsByCapacity(signer);
await completedTx.completeFeeBy(signer);
const transferTxHash = await signer.sendTransaction(completedTx);
Mints new tokens to specified addresses. See the example in transfer as they are similar.
The signer to use for the transaction.
Array of mints
Optionaltx: null | TransactionLikeOptional existing transaction to build upon
The transaction containing the mint operation
Completes a UDT transaction by adding change output to a specific lock script.
The transaction to complete.
The signer to use for input selection.
The lock script for the change output.
The completed transaction.
Completes a UDT transaction by adding change output to the signer's address.
The transaction to complete.
The signer to use for input selection and change address.
The completed transaction.
Pauses the UDT for the specified lock scripts. Pausing/Unpause without lock scripts should take effect on the global level. Note that this method is only available if the pausable UDT uses external pause list.
The signer to use for the transaction.
The array of lock scripts to be paused.
Optionaltx: null | TransactionLikeThe transaction to be used.
OptionalextraLockHashes: null | BytesLike[]Additional lock hashes to be paused.
The transaction result.
Unpauses the UDT for the specified lock scripts. Note that this method is only available if the pausable UDT uses external pause list.
The signer to use for the transaction.
The array of lock scripts to be unpaused.
Optionaltx: null | TransactionLikeThe transaction to be used.
OptionalextraLockHashes: null | BytesLike[]Additional lock hashes to be unpaused.
The transaction result.
Checks if the UDT is paused for the specified lock scripts within a transaction. If not using external pause list, it can also be run on Code environment level.
The lock scripts to check.
OptionalextraLockHashes: null | BytesLike[]Additional lock hashes to check.
True if any of the lock scripts are paused, false otherwise.
Enumerates all paused lock hashes in UDTPausableData.
Optionaloffset: bigintOptionallimit: bigintThe array of lock hashes.
Represents a UDT (User Defined Token) with pausable functionality.