Pirichain Smart Scenarios Documentation
  • ➰Pirichain Smart Scenario (PSce)
  • 🧿Which Industries can use easily PSces?
  • ♥️Full Support Interoperability!
  • ➰General Structure of Smart Scenarios
  • ➰PSce Working Principles And Limitations
  • ➰PSce Constants
  • ➰PSce Accumulator Object
  • ➰Simple Usage PSce
  • ➰Generating a new transaction though PSce
  • ➰What will i have if i execute a PCse
  • 💲Operation Costs
  • 🔐Double Protect! your client assets are in safe with addition authenticator code
  • 🛑Avoid these methods and situations in PSce
  • ➿PSce Functions
    • 🏁sendPIRI
    • 🏁sendToken
    • 🏁pushData
    • 🏁getBalance
    • 🏁getBalanceList
    • 🏁getPureTransaction
    • 🏁getTransaction
    • 🏁listPoolTransactions
    • 🏁findData
    • 🏁findDataWithAddress
    • 🏁findDataWithValue
      • 🏁findDataUpperThanValue
      • 🏁findDataLowerThanValue
    • 🏁getRandom
    • 🌏getData
    • 🌎postData
    • 🔓generateAuthenticator
    • 🔓verifyAuthenticator
    • 🔓getMyAuthenticatorToken
    • ❓Validators
    • 🔔Examples
      • 🍁Get PSce owner wallet balance
      • 🍁sendToken Example
      • 🍁EVM based similar approach- Token Management With PSDATA
      • 🍁Connect to EXTERNAL ENVIRONMENTS!
      • 🍁Time Based Inheritor Example
      • 🍁Token Example with Ticket Operation
      • 🍁A sample about token vesting
      • 🍁Asset Management Of Share Holders using with PSce
      • 🍁Double Protect your assets using with Pirichain Authenticator Factor
      • 🍁What an easy to build up your metaverse planet in Pirichain!
      • 🍁A new approach dependency factor using with PSce
      • 🍁Advanced Operation - Withdraw All Your Asset From PCse
      • 🍁Task Diversification and Transaction Proof (TDTP)
      • 🍁A Sample of using Origin Flag Integration on Binance Smart Chain Network.
      • 🍁Deposit/Withdraw from Foreign Chain (BSC) and Add Order , Buy and Sell Token, Just a 277 Code Lines!
      • 🍁Pirichain Decentralized Exchange (DEX) Sample Full Codes
Powered by GitBook
On this page

Simple Usage PSce

As we see below page , system generates some constants such as EXECUTER_ADDRESS, OWNER_ADDRESS

 async function init()
{
// Your code goes here...
 // You can execute only you 

 if (EXECUTER_ADDRESS!==OWNER_ADDRESS) 
 return "You dont have permission for execute this scenario!"; 

 var dummyTest=await Transaction.getBalance(EXECUTER_ADDRESS);
 return dummyTest;
}

If your address doesn't match with EXECUTER_OWNER address , you wont execute this scenario because of code line 6th condition.

 var dummyTest=await Transaction.getBalance(EXECUTER_ADDRESS);

When we executed above code system gives us below response;

{
  "error": 0,
  "name": "PIRI",
  "symbol": "PIRI",
  "logo": "/images/piri.png",
  "assetID": -1,
  "address": "PRTMRKWZ56v4D8mV1oj813bqTgdfUm9J4woVTDMpGxF",
  "frozen": [],
  "balance": "6411.16548965"
}

PreviousPSce Accumulator ObjectNextGenerating a new transaction though PSce

Last updated 1 year ago

➰