-
Notifications
You must be signed in to change notification settings - Fork 32
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
3 changed files
with
40 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
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
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,36 @@ | ||
package btdex.markets; | ||
|
||
import java.util.HashMap; | ||
|
||
import btdex.core.Globals; | ||
import btdex.locale.Translation; | ||
|
||
public class MarketXCH extends MarketCrypto { | ||
|
||
public String getTicker() { | ||
return "XCH"; | ||
} | ||
|
||
@Override | ||
public long getID() { | ||
return MARKET_XCH; | ||
} | ||
|
||
@Override | ||
public int getUCA_ID() { | ||
// TODO: Fix this when they get an actual UCA ID | ||
return 666666; | ||
} | ||
|
||
@Override | ||
public void validate(HashMap<String, String> fields) throws Exception { | ||
super.validate(fields); | ||
|
||
String addr = fields.get(ADDRESS); | ||
|
||
// TODO: add a better check when there is some documentation | ||
if(!addr.startsWith(Globals.getInstance().isTestnet() ? "txch1" : "xch1")) { | ||
throw new Exception(Translation.tr("mkt_invalid_address", addr, toString())); | ||
} | ||
} | ||
} |