Skip to main content
You are here: iOS SDK

Basic Contract Access

There are a basic set of traditional contracts that are supported in the credenza ecosystem. Specifically, ERC 20 store value/crypto contracts and ERC 721/ERC 1155 non fungible token contracts. These functions were built to provide direct access to messages, supported by those standard contracts.

checkVersion(_ contractAddress: String, _ contractType: String)

public func checkVersion(_ contractAddress: String, _ contractType: String) async -> String 

Parameters:

This asynchronous function checks the version of a contract for the given contract address and type. Every Credenza contract has immutable metadata associated with it that provides a version number.

  • contractAddress: The contract address for which to check the version.

  • contractType: The type of the contract for which to check the version.

  • Returns: A string containing the contract version or "NONE" if there was an error.

nftCheck(_ contractAddress: String, _ userAddress: String)

public func nftCheck(_ contractAddress: String, _ userAddress: String) async -> BigUInt

This function checks the ownership of an NFT (Non-Fungible Token) for the given Ethereum address. It constructs a contract instance, calls the 'balanceOfBatch' function to get the NFT balance, and then prints the response message or error message accordingly.

Parameters:

  • contractAddress: An Ethereum contract address for which to check NFT balance.

  • userAddress: An Ethereum public address of the user whose NFT balance to check.

  • Returns: The balance of NFT.

svCheck(_ address: String)

public func svCheck(_ address: String) 

Checks the balance of a user's account for a given ERC20 token contract.

Parameters:

  • address: The address of the user's account to check the balance of.

  • Returns: The balance of the user's account.

credCheck(_ address: String)

public func credCheck(_ address: String) 

Checks the balance of a user's account for a given ERC20 token contract.

Parameters:

  • address: The address of the user's account to check the balance of.

  • Returns: The balance of the user's account.