-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
53 lines (47 loc) · 2.37 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// import ETHEREUMRPC
import { ETHEREUMRPC } from "./src/ethereumRPC/ethersmethod";
import { Provider } from "./src/constants/constant";
import { ETHEREUM } from "./src/ethereumRPC/Ethereum";
const OldEthereum =async()=>{
const add :string ="0x65E28C9C4Ef1a756d8df1c507b7A84eFcF606fd4"
const hash:`0x${string}` = "0x357885eed5a87ef53212d2540f68c5eca320c9c15576a0842d60d8c19d13be7a"
const ethereum = new ETHEREUMRPC(add,Provider)
const bal = await ethereum.getBalance()
console.log("eth_getBalance",Number(bal))
const history = await ethereum.getUserTokenHistory()
console.log("eth_getUserTokenHistory",history)
const blockNumber = await ethereum.getBlockNumber();
console.log("eth_getBlockNumber",blockNumber)
const blockByNumber = await ethereum.getBlockByNumber()
console.log("eth_getBlockByNumber",blockByNumber)
const getBlockByHash = await ethereum.getBlockByHash(hash)
console.log("eth_getBlockByHash",getBlockByHash)
const getTransationByHash = await ethereum.getTransactionByHash(hash)
console.log("eth_getTransactionByHash",getTransationByHash)
const getTransactionReceipt = await ethereum.getTransactionReceipts(hash)
console.log("eth_getTransactionReceipt",getTransactionReceipt)
}
const NewEthereum = async()=>{
const add :string ="0x65E28C9C4Ef1a756d8df1c507b7A84eFcF606fd4"
const ETHEREUMRPC_JSON = new ETHEREUM(add,Provider)
const eth_chainId = await ETHEREUMRPC_JSON.getChainId()
console.log("eth_chainId",eth_chainId)
const eth_blockNumber = await ETHEREUMRPC_JSON.getBlockNumber()
console.log("eth_blockNumber",eth_blockNumber)
const eth_gasPrice = await ETHEREUMRPC_JSON.getGasPrice()
console.log("eth_gasPrice",eth_gasPrice)
const eth_maxPriorityFeePerGas = await ETHEREUMRPC_JSON.getMaxPriorityFeePerGas()
console.log("eth_maxPriorityFeePerGas",eth_maxPriorityFeePerGas)
//const eth_blobBaseFee = await ETHEREUMRPC_JSON.getBlobBaseFee()
//console.log("eth_blobBaseFee",eth_blobBaseFee)
const eth_feeHistory = await ETHEREUMRPC_JSON.getFeeHistory()
console.log("eth_feeHistory",eth_feeHistory)
const eth_getBalance = await ETHEREUMRPC_JSON.getBalance()
console.log("eth_getBalance",eth_getBalance)
const eth_getCode = await ETHEREUMRPC_JSON.getCode()
console.log("eth_getCode",eth_getCode)
}
(async()=>{
//await OldEthereum()
await NewEthereum()
})();