EVM 호환
Last updated
Was this helpful?
Was this helpful?
const appId = 'app_id_eg12sf3491azgs520' // 테스트용 앱 ID
const appKey = 'ak_test_ghq1D5s1sfG234sbnhdsw24mnovk313' // 테스트용 앱 키
const attributes = {
type: 'show'
}
// Wepin을 initialize 합니다.
await Wepin.init(appId, appKey, attributes)
// initialize 된 Wepin으로 부터 provider를 얻어 옵니다.
const provider = Wepin.getProvider({ network: 'ethereum' });import Web3 from 'web3'
const provider = Wepin.getProvider({ network: 'ethereum' })
const web3 = new Web3(provider)import "react-native-get-random-values"
// Import the the ethers shims (**BEFORE** ethers)
import "@ethersproject/shims"
// Import the ethers library
import { ethers } from "ethers"
const provider = wepin.getProvider({ network: 'ethereum' })
const web3 = new ethers.providers.Web3Provider(provider)const accounts = await web3.eth.getAccounts()const balance = await web3.eth.getBalance(accounts[0])const accounts = await web3.eth.getAccounts()
const tx = {
from: accounts[0],
gasPrice: "2000000000",
gas: "21000",
to: '0x11f4d0A3c1......13F7E19D048276DAe',
value: "10000000000000000",
}
const response = await web3.eth.sendTransaction(tx)const callObject = {
to: '0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe', //contract address
data: '0xc6888fa10000000000000000000000000000000000000000000000000000000000000003'
}
const response = await web3.eth.call(callObject)