Swisstronik & Ethereum calls
Calls in the blockchain context are read-only interactions with the blockchain, retrieving information from the blockchain without altering, deleting, or adding data.
Ethereum Calls
We can use ethers.js to execute calls to the Ethereum blockchain. specifically for smart contracts, we can use provider.call({to, data})
to retrieve values from smart contracts
In this code example, the function call
is made to the to
smart contract address, executing the view returns
function getMessage(uint256)
while providing the argument 1
. This process will return a message from the smart contract.
Swisstronik Calls
For Swisstronik calls, we need to make sure the data
field of the call
is encrypted using SwisstronikJS.
This example shows that when making Swisstronik calls, the data field needs to be filled with an encrypted value using SwisstronikJS. Otherwise, the call won't work. Let's now explore how to encrypt this data for successful calls on the Swisstronik blockchain.
Last updated