Skip to content

sendTransaction · FT ​

Back to the sendTransaction overview

Covers FT minting, transfers, and UTXO merging.

FT_MINT ​

Mint a new fungible token with specified name, symbol, decimal places, and initial supply.

To match the sample project, decimal is fixed at 6 and shown as read-only in the live example; the mint amount supports up to 6 decimal places.

ts
const params = [
  {
    flag: "FT_MINT",              // Required
    ft_data: "",                  // Required, FTData in JSON format
    broadcastEnabled: true,       // Optional, defaults to true
  },
];

const { txid } = await Turing.sendTransaction(params);
// const { txraw } = await Turing.sendTransaction(params); // When broadcastEnabled is false, the returned txraw contains two transactions separated by commas, which need to be broadcast in batch, ensuring the first txraw is broadcast first
// const { error } = await Turing.sendTransaction(params); // When an error occurs

FT_TRANSFER ​

Transfer fungible tokens to a recipient. Optionally transfer TBC simultaneously.

The wallet detects FT v1–v4 from the actual on-chain parent output and selects the matching transfer method automatically. DApps do not pass an FT version parameter.

ts
const params = [
  {
    flag: "FT_TRANSFER",          // Required
    ft_contract_address: "",      // Required, FT contract address
    address: "",                  // Required, recipient address
    ft_amount: 0,                 // Required, FT amount to transfer
    tbc_amount: 0,                // Optional, TBC amount to transfer simultaneously, defaults to 0
    broadcastEnabled: true,       // Optional, defaults to true
  },
];

const { txid } = await Turing.sendTransaction(params);
// const { txraw } = await Turing.sendTransaction(params); // When broadcastEnabled is false
// const { error } = await Turing.sendTransaction(params); // When an error occurs

FT_MERGE ​

Merge FT UTXOs to consolidate fragmented token holdings.

ts
const params = [
  {
    flag: "FT_MERGE",             // Required
    ft_contract_address: "",      // Required, FT contract address
  },
];

const { txid } = await Turing.sendTransaction(params); // txid is multiple Merge transaction txids separated by commas
// const { error } = await Turing.sendTransaction(params); // When an error occurs

Live Example ​

Live Example

Turing.sendTransaction() / FT

Detecting Wallet...

The active wallet network is Unknown. This method requires TBC. Switch networks and try again.

Fixed at 6.

Form and JSON stay in sync. Use real transaction IDs from the current network for on-chain resources.

Detecting Wallet...
Code Preview