CCC Docs
    Preparing search index...

    Class UdtPausable

    Represents a UDT (User Defined Token) with pausable functionality.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    script: Script

    Methods

    • Transfers UDT to specified addresses.

      Parameters

      • signer: Signer
      • transfers: { to: ScriptLike; amount: NumLike }[]

        The array of transfers.

      • Optionaltx: null | TransactionLike

        Transfer on the basis of an existing transaction to achieve combined actions. If not provided, a new transaction will be created.

      Returns Promise<ExecutorResponse<Transaction>>

      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);
    • Checks if the UDT is paused for the specified lock hashes within a transaction. If not using external pause list, it can also be run on Code environment level.

      Parameters

      Returns Promise<ExecutorResponse<boolean[]>>

      True if any of the lock hashes are paused, false otherwise.

    • Enumerates all paused lock hashes in UDTPausableData.

      Parameters

      • Optionaloffset: bigint
      • Optionallimit: bigint

      Returns Promise<ExecutorResponse<`0x${string}`[]>>

      The array of lock hashes.