All Projects → filecoin-shipyard → java-filecoin-api-client

filecoin-shipyard / java-filecoin-api-client

Licence: other
An API client for Filecoin implemented in Java

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to java-filecoin-api-client

AndroidTutorials
Ejemplos Android [Dagger2,RxJava,MVP,Retrofit2,SQLite]
Stars: ✭ 22 (-42.11%)
Mutual labels:  retrofit2
SunnyBeach
阳光沙滩APP
Stars: ✭ 60 (+57.89%)
Mutual labels:  retrofit2
filecoin-client
Golang的轻量级filecoin客户端,支持离线签名,基本满足钱包交易所充值提现逻辑
Stars: ✭ 50 (+31.58%)
Mutual labels:  filecoin
codeKK-Android
http://p.codekk.com/
Stars: ✭ 29 (-23.68%)
Mutual labels:  retrofit2
research
distributed system;blokchain;filecoin/ipfs,...
Stars: ✭ 39 (+2.63%)
Mutual labels:  filecoin
Fineract-CN-mobile
DEPRECATED project - Check the Apache fineract-cn-mobile project instead
Stars: ✭ 17 (-55.26%)
Mutual labels:  retrofit2
MVVMJetpack
JectpackDemo
Stars: ✭ 37 (-2.63%)
Mutual labels:  retrofit2
store-apps-mvvm
Implementation component of Android Jetpack with clean architecture
Stars: ✭ 32 (-15.79%)
Mutual labels:  retrofit2
Bilibili-MusicPlayer
B站音乐区音频第三方播放器 (Bilibili Third-party online music player for Android) MVVM+Room+LiveData+Retrofit+Exoplayer
Stars: ✭ 19 (-50%)
Mutual labels:  retrofit2
MockAppMVVM
A sample app structure using the MVVM architecture using Retrofit, Dagger2, LiveData, RxJava, ViewModel and Room.
Stars: ✭ 14 (-63.16%)
Mutual labels:  retrofit2
bitcoin-market-android
Bitcoin Market app shows you the current Bitcoin market price and price chart of different time intervals 💰
Stars: ✭ 284 (+647.37%)
Mutual labels:  retrofit2
DirectCurrencyConverter
Currency Converter App for Android showing usage of Flow, Live Data, Coroutines, Hilt - (Clean Architecture)
Stars: ✭ 40 (+5.26%)
Mutual labels:  retrofit2
Clean Marvel Kotlin
This repository contains a detailed sample app that implements Clean architecture and MVP in Kotlin using RxJava2, Retrofit
Stars: ✭ 27 (-28.95%)
Mutual labels:  retrofit2
RetrofitHelper
💪 RetrofitHelper是一个支持配置多个BaseUrl,支持动态改变BaseUrl,动态配置超时时长的Retrofit帮助类
Stars: ✭ 15 (-60.53%)
Mutual labels:  retrofit2
LittleLight
An Android app that uses Destiny's API to interact with in-game inventory.
Stars: ✭ 19 (-50%)
Mutual labels:  retrofit2
BESTV
Android TV App powered by TMDb. It is a easy way to find the best TV content, the top movies, series... all of that in your TV.
Stars: ✭ 49 (+28.95%)
Mutual labels:  retrofit2
BookReader
📕 "任阅" 网络小说阅读器,3D翻页效果、txt/pdf/epub书籍阅读、Wifi传书~
Stars: ✭ 6,113 (+15986.84%)
Mutual labels:  retrofit2
libbra
A currency tracker app demonstration. It refreshes currency list every single second based on the main currency. In addition to that, main currency is selectable.
Stars: ✭ 45 (+18.42%)
Mutual labels:  retrofit2
UdacityPopularMovies
An Android app, that helps you browse most popular and most rated movies. This project is created for Udacity Android Developer Nanodegree.
Stars: ✭ 26 (-31.58%)
Mutual labels:  retrofit2
uv-index
This is a work-in-progress (🔧️) ultraviolet index viewer app for demonstrating Instant Apps + Kotlin + Dagger + MVP
Stars: ✭ 64 (+68.42%)
Mutual labels:  retrofit2

java-filecoin-api-client

Status

This repository is in a frozen state. It is not being maintained or kept in sync with the libraries it depends on. This library was designed for an early version of go-filecoin, which is now known as Venus. Even though work on this repository has been shelved, anyone interested in updating or maintaining this library should express their interest on one Filecoin community conversation mediums: https://github.com/filecoin-project/community#join-the-community.


An API client for Filecoin implemented in Java

Quick Start

At present, this artifact has not been published to Maven central repository, so you should install locally

mvn clean install

For general projects

(1) import dependency in pom.xml

<dependency>
    <groupId>org.rockyang</groupId>
    <artifactId>filecoin-api-client</artifactId>
    <version>0.0.1</version>
</dependency>

(2) initialize Filecoin instance

Filecoin filecoin = new Filecoin("http://127.0.0.1:3453", false);

For SpringBoot projects

(1) import dependency in pom.xml, and you do not need to import filecoin-api-client in additional.

<dependency>
    <groupId>org.rockyang</groupId>
    <artifactId>filecoin-api-client-spring-boot-starter</artifactId>
    <version>0.0.1</version>
</dependency>

(2) set log-debug and api-base-url in application.properties

# switch to open http debug log
filecoin.log-debug=true
# filecoin rpc api base url
filecoin.api-base-url=http://127.0.0.1:3453

(3) use the Filecoin instance by @Autowired or @Resource annotation any where you want to do.

public class FilecoinController {

	@Autowired
	private Filecoin filecoin;
}

Usage

// create a new addresss
String address = filecoin.newAddress();

// fetch all address of current node
List<String> addresses = filecoin.getAddressList();

// export an address
String address = "t1b3keswmeuk4tipp5egjbk3aoag56g5zd3cle2va";
KeyInfo keyInfo = filecoin.walletExport(address);

// import wallet
String privateKey = "pdHwTOrJXnAGvQ0861k66xRsiT7N3Ms8IGte3nT837E=";
String address = filecoin.walletImport(privateKey);

// get balance 
String address = "t1esjjrygs7adcfbjnodbpdjzulzobznnln4tmsxq";
BigDecimal balance = filecoin.getBalance(address);
logger.info(balance);

// send transaction  
String from = "t16cgjiwgypve4uup27uk4xgppgd3i4nsldpid6ii";
String to = "t1esjjrygs7adcfbjnodbpdjzulzobznnln4tmsxq";
BigDecimal value = BigDecimal.valueOf(123.456);
BigDecimal gasPrice = BigDecimal.valueOf(0.001);
Integer gasLimit = 300;
String cid = filecoin.sendTransaction(from, to, value, gasPrice, gasLimit);

// get transction status
String cid = "zDPWYqFCtwpgqBEth4wFK53D8Sm9UGxhrL1tueb4RrgFDQLoKC1P";
MessageStatusRes.Message message = filecoin.getTransaction(cid);

document | API

The document is building, if you need it urgently, we provide unit testing for each API.

Contribute

Feel free to dive in! Open an issue or submit PRs.

License

The Filecoin Project is dual-licensed under Apache 2.0 and MIT terms:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].