Skip to content

Instantly share code, notes, and snippets.

@zhangweis
Created September 4, 2022 14:33
Show Gist options
  • Save zhangweis/bc4389457d7f93f01b962b51719719f9 to your computer and use it in GitHub Desktop.
Save zhangweis/bc4389457d7f93f01b962b51719719f9 to your computer and use it in GitHub Desktop.
import Web3 from 'https://deno.land/x/web3/mod.ts'
const providerURL = Deno.args[0]
const web3 = new Web3(new (Web3 as any).providers.HttpProvider(providerURL))
const balance = await (web3 as any).eth.getBalance("0x7a915e362353d72570dcf90aa5baa1c5b341c7aa")
console.log(`the balance is ${balance} wei`)
const transactionHash = "0x0d558d490c89fc94ddfebd284e39da5c1bcff15d18c4e9fd2eb37a202d20c703"
const transaction = (await web3.eth.getTransaction(transactionHash))
console.log(transaction)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment