Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package btdex.markets; | ||
|
||
import java.util.HashMap; | ||
|
||
import org.stellar.sdk.Account; | ||
|
||
import btdex.locale.Translation; | ||
|
||
public class MarketXLM extends MarketCrypto { | ||
|
||
public static final String TICKER = "XLM"; | ||
|
||
public String getTicker() { | ||
return TICKER; | ||
} | ||
|
||
@Override | ||
public String getChainDetails() { | ||
return "Stellar chain livenet"; | ||
} | ||
|
||
@Override | ||
public String getExplorerLink() { | ||
return "https://stellarchain.io/"; | ||
} | ||
|
||
@Override | ||
public long getID() { | ||
return MARKET_XLM; | ||
} | ||
|
||
@Override | ||
public int getUCA_ID() { | ||
return 512; | ||
} | ||
|
||
@Override | ||
public void validate(HashMap<String, String> fields) throws Exception { | ||
super.validate(fields); | ||
|
||
String addr = fields.get(ADDRESS); | ||
|
||
try { | ||
Account ac = new Account(addr, 1L); | ||
ac.getKeyPair(); | ||
} | ||
catch (Exception e) { | ||
throw new Exception(Translation.tr("mkt_invalid_address", addr, toString())); | ||
} | ||
} | ||
} |