Using EVM in Cocos Creator
Using the viem library
npm install viem --saveimport { createPublicClient, http } from 'viem'
import { mainnet } from 'viem/chains'
const client = createPublicClient({
chain: mainnet,
transport: http(), // http() is a public client, you can also use a wallet client by replacing it with custom(window.ethereum!)
})
// Get the current block height
const blockNumber = await client.getBlockNumber() Using WalletConnect's web3modal
PreviousUsing Ton in Cocos CreatorNextQuick Integration Guide for Alchemy Pay Ramp Fiat-to-Crypto Payment Solution
Last updated