Comments (17)
@artem03 right now I am using this library to create&sign&send TRC20 TriggerSmartContract transactions without problem.
Did you try to send any?
I will check if there was any custom modification for TriggerSmartContract on my side, but as I remember I done nothing regarding to it.
from hdwallet.
@farukterzioglu I was trying to send a TRC20 TriggerSmartContract for USDT just today, and got a SIGERROR error when broadcasting.
from hdwallet.
Let me check more
from hdwallet.
Yes of course, maybe I made a mistake somewhere, but I've checked my code many times, maybe I'm just doing something wrong
from hdwallet.
@farukterzioglu Did you find any "custom modification" for the TRC20 TriggerSmartContract sign?
from hdwallet.
@artem03 Just checked and saw they are same, there is no difference between signing TRX transaction and TRC20 transaction. Both signs the txid and adds the result to the signatures field. Both signatures is 68 bytes and this works in Tron Mainnet and Shasta.
from hdwallet.
@farukterzioglu Oh, sorry, I sent a transaction to the broadcast without the fee_limit field, after adding this field everything worked, the problem can be closed, I wanted to ask if you know how to decode the data field (to get the recipient and the amount you received) when receiving the transaction block
from hdwallet.
@artem03 normal TRX transaction or TRC20 transaction?
from hdwallet.
I guess you are asking about this
Amount = Convert.ToInt64(transactionEvent.Result.Value),
From = transactionEvent.Result.From.Replace("0x", "41").ToVisibleAddress(),
To = transactionEvent.Result.To.Replace("0x", "41").ToVisibleAddress(),
with
using NBitcoin.DataEncoders;
public static string ToVisibleAddress(this string tronAddress)
{
if (string.IsNullOrWhiteSpace(tronAddress))
{
return null;
}
byte[] bytes = tronAddress.FromHexToByteArray();
return Encoders.Base58Check.EncodeData(bytes);
}
public static byte[] FromHexToByteArray(this string input)
{
var numberChars = input.Length;
var bytes = new byte[numberChars / 2];
for (var i = 0; i < numberChars; i += 2)
{
bytes[i / 2] = Convert.ToByte(input.Substring(i, 2), 16);
}
return bytes;
}
from hdwallet.
Not sure what exactly I need, I asked about Data in TriggerSmartContract, I use the following code to encode the data
public class TestParamsInput
{
[Parameter("address", 1)]
public string First { get; set; }
[Parameter("uint256", 2)]
public UInt64 Second { get; set; }
}
var abiEncode = new ABIEncode();
var data = abiEncode.GetABIParamsEncoded<TestParamsInput>(new TestParamsInput() { First = "address", Second = UInt64.Parse("amount") });
But I don't know how to decode them
from hdwallet.
can you paste the encoded data here
from hdwallet.
"00000000000000000000000033a53245269c4706e378e7c58788bfb47c8d4fbd00000000000000000000000000000000000000000000000000000000000f4240"
from hdwallet.
not sure this what you want but you can check this request:
https://api.trongrid.io/event/transaction/f87d6f7973895f1d8de5dd7bbbf23b4a9fcb7ae8961378b556147df3d42e2386?visible=true
from hdwallet.
Thanks, it will help me
from hdwallet.
to decode that kind of data, I use Nethereum heavily
some code to give an idea:
_contractBuilder = new ContractBuilder(abi, contractAddressVisible);
_contract = new Nethereum.Contracts.Contract(null, abi, contractAddressVisible);
...
public Function GetFunction(string functionName)
{
return _contract.GetFunction(functionName);
}
public TReponse DecodeSimpleResponse<TReponse>(string functionName, string data)
{
Function function = GetFunction(functionName);
return function.DecodeSimpleTypeOutput<TReponse>(data);
}
from hdwallet.
May you please help me with some c# code how to transfer Trc20 contract balance to another trx wallet? both creating the transaction signing and broadcasting to the network
from hdwallet.
to decode that kind of data, I use Nethereum heavily
some code to give an idea:
_contractBuilder = new ContractBuilder(abi, contractAddressVisible); _contract = new Nethereum.Contracts.Contract(null, abi, contractAddressVisible); ... public Function GetFunction(string functionName) { return _contract.GetFunction(functionName); } public TReponse DecodeSimpleResponse<TReponse>(string functionName, string data) { Function function = GetFunction(functionName); return function.DecodeSimpleTypeOutput<TReponse>(data); }
Hey, I have the similar problems, might need your help. Can you do me a favor?
from hdwallet.
Related Issues (20)
- HDWallet.Ethereum HOT 3
- netstandard versions HOT 3
- Some Cryptos (Terra, Avalanche ...) Do Not Work With NBitcoin 7.0.5 HOT 3
- Balance and transactions HOT 4
- TronNet 0.2.0 is not compatible with netstandard2.0 (.NETStandard,Version=v2.0). HOT 1
- Not compatible with netstandard2.0 (.NETStandard,Version=v2.0). HOT 6
- Do you support trc20 token transfer? HOT 1
- Need Offline build transaction and sign HOT 7
- Deposit USDT TRC20 HOT 1
- Internal Address HOT 1
- Is it possible to create multiple addresses from a private key HOT 1
- Tutorial about how to create Dogecoin and Litecoin HD Wallet HOT 1
- send and receive USDT in Tron network HOT 3
- Aggregate values HOT 5
- Tron/Ethereum HD Wallet
- Scan 100,000 wallets and get notified after receiving coinsReceive when receiving coins
- Stacks addresses incorrect
- Hardened deriviation path HOT 1
- Reclaim Your $KSM Today
- Cleanup non issue
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 hdwallet.