Contract

What is it?

Contracts, or rather smart contracts, are software plug-ins that are available on every network and create the assets we call tokens, nft. Because it can be added externally to the blockchain and we call it deploying.

However, this is a structure that may differ according to the blockchain network, for example, in Solana, they are called "programs". Therefore, Contract classes may differ according to the network.

For example, only "getAddress" of the methods given below is valid for all networks. All other methods may not be "implemented" according to the network because of the working logic of the network.

Again, for example, all the methods below are considered to be accessible in the same way on EVM and Tron. Only getMethodData is not implemented in Tron. This is again due to the structure of the network. For example, in Solana none of the following methods are implemented except "getAddress".

Methods

import { assets } from '@multiplechain/evm-chains'

const token = new assets.Contract('0x')

const address = token.getAddress()

const name = token.callMethod('name')

const methodData = token.getMethodData('transfer', '0x', 100)

const transactionData = token.createTransactionData('transfer', '0x', 100)

Last updated