Developer Platform API Methods
API Methods of Developer Platform
Client Methods
Client.init(config)
: Initializes the client with an API key, blockchain network (Cronos EVM or ZK EVM), and an optional provider.Client.getApiKey()
: Returns the configured API key.Client.getProvider()
: Returns the configured provider URL (if available).Client.getChainId()
: Returns the chain ID based on the configured network.
Wallet Methods
Wallet.create()
: Creates a new wallet and returns the address, private key, and mnemonic.Wallet.balance(address)
: Fetches the native token balance for a specified address.
Token Methods
Token.getNativeTokenBalance(address)
: Fetches the native token balance of a wallet address.Token.getERC20TokenBalance(address, contractAddress)
: Fetches the ERC20 token balance of a wallet for a specific contract.Token.transfer(payload)
: Sends a token transfer transaction.Token.wrap(payload)
: Sends a token wrapping transaction.Token.swap(payload)
: Sends a token swapping transaction.
Transaction Methods
Transaction.getTransactionsByAddress(address)
: Fetches transactions associated with a wallet address.Transaction.getTransactionByHash(txHash)
: Fetches transaction details by its hash.Transaction.getTransactionStatus(txHash)
: Fetches the status of a transaction by its hash.
Contract Methods
Contract.getContractABI(contractAddress)
: Fetches the ABI of a smart contract using its contract address.
Block Methods
Block.getBlockByTag(blockTag)
: Fetches block data using a block tag (e.g., 'latest', 'earliest') or block number.
CronosId Methods
CronosId.forwardResolve(croAddress)
: Converts.cro
addresses to EVM addressCronosId.reverseResolve(evmAddress)
: Converts EVM addresses to.cro
addresses
Defi Methods
Defi.getWhitelistedTokens(defiProtocol)
: Obtains all whitelisted tokens from a supported defi protocolDefi.getAllFarms(defiProtocol)
: Obtains all farms from a supported defi protocolDefi.getFarmBySymbol(defiProtocol, symbol)
: Obtains a farm by farm symbol from a supported defi protocol
Exchange Methods
Exchange.getAllTickers()
: Get all tickers from the Crypto.com exchange APIExchange.getTickerByInstrument(ticker)
: Get instrument information by ticket, e.g `BTC_USD`
Last updated
Was this helpful?