➰What will i have if i execute a PCse

If we have a sample PCse and we executed the depositLiqudity method ;

async function depositLiqudity(ratio)
{
    if (isNaN(ratio))
        return {error:1,message:'Ratio must be a number!'};    
    if (ratio<=0)
    return {error:1,message:'Could not set Ratio Zero or Negative Number'};
    if (AMOUNT===undefined)
        return {error:1,message:'You must send Amount!'};
    if (AMOUNT<=0)
        return {error:1,message:'Amount must be Positive!'};
    let expireDate=new Date();
    expireDate.setDate(expireDate.getDate() + 2);
    
    const addedLiqsRecords=[
        {key:'addedLiq',value:AMOUNT,enc:0},
        {key:'addedAssetID',value:ASSETID,enc:0},
        {key:'ratio',value:ratio,enc:0},
        {key:'expireDate',value:expireDate,enc:0}
    ];
    return Transaction.pushData(JSON.stringify(addedLiqsRecords),EXECUTER_ADDRESS);
}

System gives us below response if all conditions met. Local Transactions are made by PCse. And User must send a few of AMOUNT to execute. As we see the 20th code line, PCse pushes the a new generated data into block network.

Response:

When we call getTransaction method with relevant Transaction Hash then system gives us below response:

It involves the metaData property explains the this transaction has been created by PCse. and we can find params and which method was executed.

Last updated