Skip to content

Commit

Permalink
More token info
Browse files Browse the repository at this point in the history
  • Loading branch information
mikera committed Sep 4, 2024
1 parent 43156f7 commit 0732428
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[
["USDF" "Foundation US Dollar" "Convex Foundation USD" "£" 10000 2 1.0]
["USDF" "Foundation US Dollar" "Convex Foundation USD" "$" 10000 2 1.0]
["GBPF" "Foundation Pound Sterling" "Convex Foundation GBP" "£" 10000 2 1.27]
]
2 changes: 1 addition & 1 deletion convex-gui/src/main/java/convex/gui/etch/EtchExplorer.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static void main(String[] args) {
* Main component panel
*/
JPanel panel = new JPanel();

private static StateModel<EtchStore> etchState = StateModel.create((EtchStore)Stores.getGlobalStore());

DatabasePanel homePanel = new DatabasePanel(this);
Expand Down
19 changes: 18 additions & 1 deletion convex-gui/src/main/java/convex/gui/wallet/TokenInfoPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import convex.api.Convex;
import convex.core.data.ACell;
import convex.core.lang.RT;
import net.miginfocom.swing.MigLayout;

@SuppressWarnings("serial")
Expand All @@ -18,9 +19,25 @@ public TokenInfoPanel(Convex convex, TokenInfo token) {

add(new JLabel("ID: "));
ACell id=token.getID();
String idString=id==null? "(Native Coin)":id.print().toString();
String idString=RT.toString(id);
add(new JLabel(idString),"wrap");


add(new JLabel("Actor Description: "));
JLabel descLabel=new JLabel("Loading...");
if (id==null) {
descLabel.setText("(Native coin)");
} else {
convex.query("(get (call *registry* (lookup (query (address "+id+")))) :name)").thenAcceptAsync(r->{
if (r.isError()) {
descLabel.setText(r.getErrorCode().toString());
} else {
descLabel.setText(RT.toString(r.getValue()));
}
});
}
add(descLabel,"wrap");

}

}

0 comments on commit 0732428

Please sign in to comment.