Comments (6)
hi @Seanxwy
for get balance of wallet you must use this code :
IServiceCollection services = new ServiceCollection();
services.AddTronDotNetCore(x =>
{
x.Network = TronDotNetCorework.MainNet;
x.Channel = new GrpcChannelOption { Host = "47.252.19.181", Port = 50051 };
x.SolidityChannel = new GrpcChannelOption { Host = "47.252.19.181", Port = 50052 };
x.ApiKey = "api-code"; //https://www.trongrid.io
});
services.AddLogging();
var service = services.BuildServiceProvider();
var walletClient = service.GetService<IWalletClient>();
var account = walletClient.GetAccount(privatekey);
//USDT TOKEN
var contractAddress = "TXLAQ63Xg1NAzckPwKHvzw7CSEmLMEqcdj";
var contractClientFactory = service.GetService<IContractClientFactory>();
var contractClient = contractClientFactory.CreateClient(ContractProtocol.TRC20);
var result = contractClient.BalanceOfAsync(contractAddress, account).Result;
from tronnetcore3.1.
if u need get USDT balance in new wallet .
u can reference this blog post
https://blog.no2don.com/2022/01/c-tron-usdt.html
from tronnetcore3.1.
@donma nice
from tronnetcore3.1.
你說的事件是指錢包發生有入帳的事件嗎?
如果是這樣你不是節點應該是無法,你要一直去監聽
除非你是節點,節點就會有自己的事件
from tronnetcore3.1.
不是节点,使用定时监听的方式也应该可以达成需求吧。
from tronnetcore3.1.
對阿 簡單的說就是你要一直去查
from tronnetcore3.1.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tronnetcore3.1.