Git Product home page Git Product logo

tatum-csharp's People

Contributors

karolrec avatar nader-tatum avatar smrecz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

tatum-csharp's Issues

Update

Please update code on main page is not the same to be used with last version, and make section with more example code.
Particularly i'm interested to connect with Elrond blockchain

Minting exmple

I created my wallet but now I have no idea how to mint an NFT. Could you please provide some documentation?

Create Private Key for One BTC address failed with Rest Client, but works with Node.js

Hello:
I read the Tatum documents, and I tried to use C# later on to do some testing. I use Rest Client - Insomnia, which can generate HTTP requests, so I can see the HTTP requests, then I can use the C# code generated by Insomnia to write the code, it is better than writing C# code from the very beginning.
Following the documents, I can use HTTP requests to create one BTC wallet, one BTC wallet address. But when I tried to create a private key for the generated BTC address, I got the following errors:
{
"statusCode": 400,
"errorCode": "validation.failed",
"message": "Request validation failed. Please see data for additional information.",
"data": [
"Mnemonics must consist of 12 or 24 words, and every word should be at least 2 letters long.",
"mnemonic must be shorter than or equal to 500 characters",
"mnemonic should not be empty",
"index must not be greater than 2147483647",
"index must not be less than 0",
"index must be an integer number",
"index should not be empty"
]
}
I used the Mnemonics when I created BTC wallet, I don't think it is wrong.
The following is the payload for HTTP POST request:
{
"mnemonic": "My_24_Words_Long_Paraphrase",
"index": 1
}
However, since I know some Node.js, so I wrote the following node.js (ver 19.1.0) script:
const Tatum = require('@tatumio/tatum');
const {generatePrivateKeyFromMnemonic, Currency} = require("@tatumio/tatum");

const CreatePrivateKey = async () =>
{
try
{
const btcPrivateKey =
await generatePrivateKeyFromMnemonic(Currency.BTC, false, "My_24_Words_Long_Paraphrase", 1);
console.log({key: btcPrivateKey});}
catch (err)
{
console.log(err);
}
};
CreatePrivateKey();
And this Node.JS script works.
Please advise on what could be the issue for using Rest Client - Insomnia to generate a private key for the address I created. But for Node.JS, my code works.
Thanks,

How to use the C# in the repo to generate private key for Ethereum address?

Hello:
I am new to this repo, I want to do some test.
I have done the following:
I created one C# WinForms app target .NET 6, and install the following NUGET packages:
PM> Install-Package Microsoft.AspNetCore.Mvc -Version 2.2.0
PM> Install-Package Tatum.CSharp.Core -Version 2.4.0
PM> Install-Package Tatum.CSharp.Ethereum -Version 2.4.0

I created a normal Form1.cs and add one class: GeneratePrivateKeyExampleService.cs
The following is the code in GeneratePrivateKeyExampleService.cs:
using Microsoft.AspNetCore.Mvc;
using Tatum.CSharp.Core.Model;
using Tatum.CSharp.Ethereum.Clients;

namespace GenPrivateKeysForm
{
public class GeneratePrivateKeyExampleService
{
private const string ERC20_Mnemonic =
@"My_24_Words_Parameter_For_Ethereum_Wallet";

    private readonly IEthereumClient _ethereumClient;

    public GeneratePrivateKeyExampleService(IEthereumClient ethereumClient)
    {
        _ethereumClient = ethereumClient;
    }

    public PrivKey GeneratePrivateKey([FromBody] PrivKeyRequest request)
    {
        request.Mnemonic = ERC20_Mnemonic;
        request.Index = 1;

        PrivKey privateKey = _ethereumClient.Local.GenerateAddressPrivateKey(request);
        return privateKey;
    }
}

}

I can compile my code, but I don’t know how to call this and get the private. How can I pass the request parameter in GeneratePrivateKey function?

By the way, I also tried to use Rest-Clien (Insomnia) to generate private key for the address I created before. But I got the following error:
{
"statusCode": 400,
"errorCode": "validation.failed",
"message": "Request validation failed. Please see data for additional information.",
"data": [
"Mnemonics must consist of 12 or 24 words, and every word should be at least 2 letters long.",
"mnemonic must be shorter than or equal to 500 characters",
"mnemonic should not be empty",
"index must not be greater than 2147483647",
"index must not be less than 0",
"index must be an integer number",
"index should not be empty"
]
}

I used the same mnemonic when I generated an Ethereum wallet. But I got the error.
Finally, I tried to write some Node Javascript to generate a private key for the Ethereum address I created.
The following is the Node JavaScript (Node version: 19.1.0)

const Tatum = require('@tatumio/tatum');
const {generatePrivateKeyFromMnemonic, Currency} = require("@tatumio/tatum");

const CreatePrivateKey = async () =>
{
try
{
const erc20PrivateKey =
await generatePrivateKeyFromMnemonic(Currency.ETHEREUM, false, "My_24_Words_Parameter_For_Ethereum_Wallet" 1);
console.log({key: erc20PrivateKeyPrivateKey});}
catch (err)
{
console.log(err);
}
};
CreatePrivateKey();

When I run this, I got no output at all.
D:\nodejs\Tatum>npm list
Tatum@ D:\nodejs\Tatum
`-- @tatumio/[email protected]

D:\nodejs\Tatum>node PrivateKey_ERC20Address1.js
^C
D:\nodejs\Tatum>

How can I debug or show more verbose output to find the issue?
I am using Windows 10 (Version 22H2), Visual Studio 2022 (Version 17.4.1)
Please advise,
Thanks,

How to get some credits and multi-chain wallet?

Hello,
I am new to this repo, I read some documents, and I found many API calls
need credits, I am now in free plan, I want to do more testing before I
can subscribe to a paid plan.
So, how can I get some credits to use those API calls which need credits?
Finally, I want to have one wallet, which I can have at least the following
4 network addresses:
Ethereum, BSC, Solana and Tron.
I want to be able to receive cryptos in the multi-chain wallet, and able
to send the cryptos from my wallet to other wallet address.
For example: I want to be able to receive USDT from another address via
Ethereum(ERC20) network, and able to send USDT from my wallet address to anoter
address via BSC(BEP20) network.
Let me know if I can use the repo to do this?
To create multi-chain address wallet which can cross 4 different networks,
how many addresses I have to create?
I think 3 will be enough, right?
One address for both Ethereum and BSC, another one for Solana and yet
another one for TRON network.
Let me know if I can do this with the repo and if yes, how to proceed.
One final question: how can I find the gas fees before I send cryptos out of my multi-chain wallet?
Thanks

Error in Wallet.cs

Please fix line 38 and 57 ff

case Currency.ETH:

case Currency.CELO:
IEthereumClient ethereumClient = new EthereumClient("");
return ethereumClient.CreateWallet(mnemonic, testnet);

How to get some fake currency in test net?

Hello:
As I am new to this SDK, I have a few questions to ask.
I think if I have a main net wallet address, I can use it to receive real cryptocurrencies, like: BTC, ETH or USDT.
But if I have only test net wallet address, where and how can I get some free or fake currencies, so I can do some testings.
If I have two test net addresses generated by different private key, can I use the test net address to send and receive fake currencies, just for testing to know the process.
Please advise,
Thanks,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.