File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed
library/src/main/kotlin/one/mixin/bot/vo
samples/src/main/java/jvmMain/java Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 1+ package one.mixin.bot.vo
2+
3+ import com.google.gson.Gson
4+ import com.google.gson.JsonObject
5+
6+ class Utxo (
7+ val amount : String ,
8+ val hash : String ,
9+ val index : Int ,
10+ val keys : List <String >,
11+ val lock : String ,
12+ val mask : String ,
13+ val script : String ,
14+ val type : Int ,
15+ ) {
16+ companion object {
17+ fun fromJson (json : JsonObject ): Utxo {
18+ return Gson ().fromJson(json.toString(), Utxo ::class .java)
19+ }
20+ }
21+ }
Original file line number Diff line number Diff line change @@ -99,10 +99,9 @@ public static void main(String[] args) {
9999 }
100100
101101 private static void utxo (HttpClient client ) throws IOException {
102- ArrayList <Object > list = new ArrayList <>();
103102 JsonObject response = client .getExternalService ().getutxoCall ("b6afed179a8192513990e29953e3a6875eab53050b1e174d5c83ab76bbbd4b29" ,0 ).execute ().body ();
104103 assert response != null ;
105- System .out .printf ("%s%n" , response .toString ());
104+ System .out .printf ("%s%n" , Utxo . Companion . fromJson ( response .getAsJsonObject ( "data" )). getHash ());
106105 }
107106
108107 private static String createAddress (HttpClient client , String userAesKey ) throws IOException {
You can’t perform that action at this time.
0 commit comments