Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Client for Hathor Wallet API

License

NotificationsYou must be signed in to change notification settings

michielpost/Hathor.Client

Repository files navigation

C# / .NET Client forHathor Wallet API

Install

Install the latest version fromNuGet
NuGet package name:Hathor

Getting Started

Make sure you have access to theHathor Headless Wallet API. You can use thehathornetwork/hathor-wallet-headless docker image.

Start docker image:

dockerpullhathornetwork/hathor-wallet-headlessdockerrun-p8000:8000hathornetwork/hathor-wallet-headless--seed_default"YOUR24SEEDWORDS"#Example,donotuse:dockerrun-p8000:8000hathornetwork/hathor-wallet-headless--seed_default"workaboveeconomycaptainadvancebreadlogicpaddlecopperchangemazetonguesalonsadnesscannonfishdebrisneedmakepurposeusageworthvaultshrug"#Examplefortestnet,donotuse:dockerrun-p8000:8000hathornetwork/hathor-wallet-headless--network"testnet"--server"https://node1.testnet.hathor.network/v1a/"--seed_default"workaboveeconomycaptainadvancebreadlogicpaddlecopperchangemazetonguesalonsadnesscannonfishdebrisneedmakepurposeusageworthvaultshrug"#ExamplewithAPIkey,donotuse:dockerrun-p8000:8000hathornetwork/hathor-wallet-headless--api_key"MYSECRETKEY"--seed_default"workaboveeconomycaptainadvancebreadlogicpaddlecopperchangemazetonguesalonsadnesscannonfishdebrisneedmakepurposeusageworthvaultshrug"

The Hathor Headless Wallet API is now available onhttp://localhost:8000

Sample App

There are two sample apps in this repository.

First, install Microsoft .Net 7 SDK fromhttps://dot.net, then run the following commands:

dotnetrestoredotnetbuild

Start the includedHathor.Client.Sample.ConsoleApp sample app to get a quick demo of what's possible with this library.

dotnetrun--projectHathor.Client.Sample.ConsoleApp

Start the includedHathor.Client.Sample.WebApp sample website get a visual look at the data.

dotnetrun--projectHathor.Client.Sample.WebApp

Use the Hathor Client

Create a new Hathor Client

stringwalletId="my-wallet";IHathorWalletApiclient=HathorClient.GetWalletClient("http://localhost:8000",walletId,"optional-api-key");

Start the wallet

//"default" refers to the seed key you used when starting the docker imagevarreq=newStartRequest(walletId,"default");varresponse=awaitclient.Start(req);

When the wallet is started, you can view transaction history, create new transactions etc

//Get balancevarbalance=awaitclient.GetBalance();//Tx historyvartxHistory=awaitclient.GetTxHistory();//Create a transactionvartransaction=newSendTransactionSimpleRequest("ADDRESS",1);varresponse=awaitclient.SendTransaction(transaction);

Check the sample apps and unit tests for more example usage.

Stop the wallet:

varresponse=awaitclient.Stop();

Multi Sig

View theMULTISIG.md documentation to use the Multi Sig APIs from the Headless Wallet.

Atomic Swap

View theATOMICSWAP.md documentation to use the Atomic Swap APIs from the Headless Wallet.

Full node support

There is partial support to use theHathor full node API

IHathorNodeApinodeClient=HathorClient.GetNodeClient("https://node2.mainnet.hathor.network/v1a/");//Get node version infovarversionInfo=awaitnodeClient.GetVersion();//Get balance of an addressvarbalanceInfo=awaitnodeClient.GetBalanceForAddress("ANY HATHOR ADDRESS")

Open source credits

RestEase

Acknowledgements

Development has been made possible with a grant fromHathor.

Hathor API Reference

https://docs.hathor.network/references/headless-wallet/http-api/

About

Client for Hathor Wallet API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp