insertFTCommitmentTransaction(data) {
    const { isTransferred, isReceived, isChange, isBurned, isBatchTransferred } = data;

    let mappedData;

    if (isTransferred) mappedData = ftCommitmentTransferTransactionMapper(data);
    else if (isBatchTransferred) mappedData = ftCommitmentTransferTransactionMapper(data);
    else mappedData = ftCommitmentMapper(data);

    if (isReceived)
      return this.ftCommitmentTransactionService.insertTransaction({
        ...mappedData,
        type: 'received',
      });
    if (isTransferred)
      return this.ftCommitmentTransactionService.insertTransaction({
        ...mappedData,
        type: 'transferred',
      });
    if (isBurned)
      return this.ftCommitmentTransactionService.insertTransaction({
        ...mappedData,
        type: 'burned',
      });
    if (isChange)
      return this.ftCommitmentTransactionService.insertTransaction({
        ...mappedData,
        type: 'change',
      });

    if (isBatchTransferred)
      return this.ftCommitmentTransactionService.insertTransaction({
        ...mappedData,
        type: 'batchTransfer',
      });

    return this.ftCommitmentTransactionService.insertTransaction({
      ...mappedData,
      type: 'minted',
    });
  }
/**
   * This function insert ERC-20 commitment (ft-commitment) transaction
   * in ft_commitment_transction collection
   * @param {object} data
   */
This function insert ERC-20 commitment (ft-commitment) transaction
in ft_commitment_transction collection
@param {object} data
This function insert ERC - 20 commitment ( ft - commitment ) transaction in ft_commitment_transction collection @param { object } data
insertFTCommitmentTransaction(data) {
    const { isTransferred, isReceived, isChange, isBurned, isBatchTransferred } = data;
    let mappedData;
    if (isTransferred) mappedData = ftCommitmentTransferTransactionMapper(data);
    else if (isBatchTransferred) mappedData = ftCommitmentTransferTransactionMapper(data);
    else mappedData = ftCommitmentMapper(data);
    if (isReceived)
      return this.ftCommitmentTransactionService.insertTransaction({
        ...mappedData,
        type: 'received',
      });
    if (isTransferred)
      return this.ftCommitmentTransactionService.insertTransaction({
        ...mappedData,
        type: 'transferred',
      });
    if (isBurned)
      return this.ftCommitmentTransactionService.insertTransaction({
        ...mappedData,
        type: 'burned',
      });
    if (isChange)
      return this.ftCommitmentTransactionService.insertTransaction({
        ...mappedData,
        type: 'change',
      });
    if (isBatchTransferred)
      return this.ftCommitmentTransactionService.insertTransaction({
        ...mappedData,
        type: 'batchTransfer',
      });
    return this.ftCommitmentTransactionService.insertTransaction({
      ...mappedData,
      type: 'minted',
    });
  }
insertFTCommitmentTransaction ( data ) { const { isTransferred , isReceived , isChange , isBurned , isBatchTransferred } = data ; let mappedData ; if ( isTransferred ) mappedData = ftCommitmentTransferTransactionMapper ( data ) ; else if ( isBatchTransferred ) mappedData = ftCommitmentTransferTransactionMapper ( data ) ; else mappedData = ftCommitmentMapper ( data ) ; if ( isReceived ) return this . ftCommitmentTransactionService . insertTransaction ( { ... mappedData , type : 'received' , } ) ; if ( isTransferred ) return this . ftCommitmentTransactionService . insertTransaction ( { ... mappedData , type : 'transferred' , } ) ; if ( isBurned ) return this . ftCommitmentTransactionService . insertTransaction ( { ... mappedData , type : 'burned' , } ) ; if ( isChange ) return this . ftCommitmentTransactionService . insertTransaction ( { ... mappedData , type : 'change' , } ) ; if ( isBatchTransferred ) return this . ftCommitmentTransactionService . insertTransaction ( { ... mappedData , type : 'batchTransfer' , } ) ; return this . ftCommitmentTransactionService . insertTransaction ( { ... mappedData , type : 'minted' , } ) ; }
This function insert ERC-20 commitment (ft-commitment) transaction
 in ft_commitment_transction collection
 @param {object} data
This function insert ERC - 20 commitment ( ft - commitment ) transaction in ft_commitment_transction collection @param { object } data