Appearance
SkucodeContract
SkucodeContract
extends ethers.Contract
and provides an interface for interacting with smart contract. It includes method for preparing transaction data. It utilieses the following interface internally: SctDetails
Creating Instances
new SkucodeContract( target: string
, contractRunner: Signer | Provider
)
Creates a new instance of SkucodeContract connected to the specified contract address, using the provided signer or provider for interactions.
To query or retrieve blockchain details, use the Provider, while for executing transactions, use the Signer.
Properties
skucodeContract.target ⇒
string
The target to connect to. This can be an address, ENS name or any Addressable, such as another contract.
skucodeContract.contractRunner ⇒
Signer | Provider
The Signer or Provider used for interacting with the contract.
Methods
skucodeContract.prepareTxData ( methodName: string
, args: any[]
, signerAddress: string
, memo?: string
) ⇒ Promise< TransactionRequest >
Prepares transaction data for a specific method in the contract.
skucodeContract.getName ⇒ string
Get the token's name
skucodeContract.getSymbol ⇒ string
Get the token's symbol.
skucodeContract.getOwner ⇒ string
Retrieves the owner's address of the token contract.
skucodeContract.getDecimals ⇒ number
Retrieves the number of decimals used by the token.
skucodeContract.getTotalSupply ⇒ string
Retrieves the total supply of the token.
skucodeContract.getBalance ( address: string
) ⇒ string
Retrieves the balance of a specific address.
skucodeContract.getBalances ⇒ Array<{ accountAddress: string, balance: string }>
Retrieves the balances of all addresses involved in Transfer
events.
.
skucodeContract.getAttachments ⇒ Array<{ cid: string, submitter: string }>
Retrieves and parses all AttachmentAdded
events from the contract.
skucodeContract.getDetails ⇒ Promise< SctDetails >
Retrieves all relevant details of the Skucode token including its name, symbol, owner, decimals, total supply, balances, and attachments.