Skip to content

Commit

Permalink
Added support for Epic Cash
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasFlamel1 committed May 8, 2023
1 parent ab26de7 commit 91b103b
Show file tree
Hide file tree
Showing 32 changed files with 934 additions and 44 deletions.
2 changes: 2 additions & 0 deletions apps/cli/src/live-common-setup-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ setSupportedCurrencies([
"mimblewimble_coin_floonet",
"grin",
"grin_testnet",
"epic_cash",
"epic_cash_floonet",
"near",
]);

Expand Down
3 changes: 2 additions & 1 deletion apps/ledger-live-desktop/cryptoassets.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- this file is generated by generate-cryptoassets-md.test.ts -->
# Supported crypto assets
## Crypto currencies (111)
## Crypto currencies (112)
| name | ticker | supported on Ledger Live? | ledger id |
|--|--|--|--|
| Algorand | ALGO | YES | algorand |
Expand All @@ -18,6 +18,7 @@
| Decred | DCR | YES | decred |
| DigiByte | DGB | YES | digibyte |
| Dogecoin | DOGE | YES | dogecoin |
| Epic Cash | EPIC | YES | epic_cash |
| Ethereum | ETH | YES | ethereum |
| Ethereum Classic | ETC | YES | ethereum_classic |
| Fantom | FTM | YES | fantom |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,7 @@ setSupportedCurrencies([
"mimblewimble_coin_floonet",
"grin",
"grin_testnet",
"epic_cash",
"epic_cash_floonet",
"near",
]);
2 changes: 2 additions & 0 deletions apps/ledger-live-mobile/src/live-common-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ setSupportedCurrencies([
"mimblewimble_coin_floonet",
"grin",
"grin_testnet",
"epic_cash",
"epic_cash_floonet",
"near",
]);

Expand Down
10 changes: 10 additions & 0 deletions libs/env/src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,16 @@ const envDefinitions: Record<
def: "http://localhost:13413",
desc: "Node for Grin testnet",
},
API_EPIC_CASH_NODE: {
parser: stringParser,
def: "https://fastepic.eu:3413",
desc: "Node for Epic Cash",
},
API_EPIC_CASH_FLOONET_NODE: {
parser: stringParser,
def: "http://localhost:13413",
desc: "Node for Epic Cash floonet",
},
API_NEAR_ARCHIVE_NODE: {
def: "https://near.coin.ledger.com/node/",
parser: stringParser,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ setSupportedCurrencies([
"mimblewimble_coin_floonet",
"grin",
"grin_testnet",
"epic_cash",
"epic_cash_floonet",
"near",
]);

Expand Down
2 changes: 2 additions & 0 deletions libs/ledger-live-common/src/appSupportsQuitApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export const minAppVersion = {
Elrond: "1.0.6",
EnergyWebChain: "1.4.0",
Eos: "1.3.1",
"Epic Cash": "7.1.0",
"Epic Cash Floonet": "7.1.0",
"Eth Recovery": "0.0.0",
"Eth Ropsten": "1.6.0",
"Eth Goerli": "1.9.11",
Expand Down
2 changes: 2 additions & 0 deletions libs/ledger-live-common/src/apps/support.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ const appVersionsRequired = {
"MimbleWimble Coin Floonet": ">= 6.0.1",
Grin: ">= 6.0.1",
"Grin Testnet": ">= 6.0.1",
"Epic Cash": ">= 7.1.0",
"Epic Cash Floonet": ">= 7.1.0",
NEAR: ">= 1.2.1",
};
export function mustUpgrade(appName: string, appVersion: string): boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ Array [
"ethereum/erc20/iexec_rlc",
"tomo",
"elastos",
"epic_cash",
"polygon/erc20/bandtoken",
"ethereum/erc20/ocean",
"ethereum/erc20/healthcare_administration_token",
Expand Down
4 changes: 4 additions & 0 deletions libs/ledger-live-common/src/data/icons/svg/EPIC.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion libs/ledger-live-common/src/data/icons/svg/GRIN.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ export default class Consensus {
return new BigNumber(`1E${cryptocurrency.units[0].magnitude.toFixed()}`)
.dividedToIntegerBy(100)
.dividedToIntegerBy(20);
case "epic_cash":
case "epic_cash_floonet":
return new BigNumber(
`1E${cryptocurrency.units[0].magnitude.toFixed()}`
).dividedToIntegerBy(1000);
default:
throw new MimbleWimbleCoinInvalidParameters("Invalid cryptocurrency");
}
Expand All @@ -59,6 +64,8 @@ export default class Consensus {
case "mimblewimble_coin_floonet":
case "grin":
case "grin_testnet":
case "epic_cash":
case "epic_cash_floonet":
return Consensus.getBlockHeightDay(cryptocurrency);
default:
throw new MimbleWimbleCoinInvalidParameters("Invalid cryptocurrency");
Expand All @@ -71,6 +78,8 @@ export default class Consensus {
case "mimblewimble_coin_floonet":
case "grin":
case "grin_testnet":
case "epic_cash":
case "epic_cash_floonet":
return 21;
default:
throw new MimbleWimbleCoinInvalidParameters("Invalid cryptocurrency");
Expand All @@ -82,6 +91,8 @@ export default class Consensus {
case "mimblewimble_coin_floonet":
case "grin":
case "grin_testnet":
case "epic_cash":
case "epic_cash_floonet":
return 3;
default:
throw new MimbleWimbleCoinInvalidParameters("Invalid cryptocurrency");
Expand All @@ -94,6 +105,8 @@ export default class Consensus {
case "mimblewimble_coin_floonet":
case "grin":
case "grin_testnet":
case "epic_cash":
case "epic_cash_floonet":
return 1;
default:
throw new MimbleWimbleCoinInvalidParameters("Invalid cryptocurrency");
Expand All @@ -106,6 +119,8 @@ export default class Consensus {
case "mimblewimble_coin_floonet":
case "grin":
case "grin_testnet":
case "epic_cash":
case "epic_cash_floonet":
return 40000;
default:
throw new MimbleWimbleCoinInvalidParameters("Invalid cryptocurrency");
Expand Down Expand Up @@ -151,6 +166,15 @@ export default class Consensus {
} else {
return 5;
}
case "epic_cash":
case "epic_cash_floonet":
if (
height.isLessThan(Consensus.getFirstHardForkHeight(cryptocurrency))
) {
return 6;
} else {
return 7;
}
default:
throw new MimbleWimbleCoinInvalidParameters("Invalid cryptocurrency");
}
Expand All @@ -165,6 +189,8 @@ export default class Consensus {
return true;
case "mimblewimble_coin":
case "grin":
case "epic_cash":
case "epic_cash_floonet":
return false;
default:
throw new MimbleWimbleCoinInvalidParameters("Invalid cryptocurrency");
Expand All @@ -191,6 +217,8 @@ export default class Consensus {
switch (cryptocurrency.id) {
case "mimblewimble_coin":
case "mimblewimble_coin_floonet":
case "epic_cash":
case "epic_cash_floonet":
return 4;
default:
throw new MimbleWimbleCoinInvalidParameters("Invalid cryptocurrency");
Expand All @@ -201,6 +229,8 @@ export default class Consensus {
switch (cryptocurrency.id) {
case "mimblewimble_coin":
case "mimblewimble_coin_floonet":
case "epic_cash":
case "epic_cash_floonet":
return Number.POSITIVE_INFINITY;
case "grin":
case "grin_testnet":
Expand All @@ -220,6 +250,10 @@ export default class Consensus {
return "Grin";
case "grin_testnet":
return "Grin testnet";
case "epic_cash":
return "Epic Cash";
case "epic_cash_floonet":
return "Epic Cash floonet";
default:
throw new MimbleWimbleCoinInvalidParameters("Invalid cryptocurrency");
}
Expand All @@ -237,6 +271,10 @@ export default class Consensus {
return new BigNumber(1687446);
case "grin_testnet":
return new BigNumber(1195819);
case "epic_cash":
return new BigNumber(1943415);
case "epic_cash_floonet":
return new BigNumber(0);
default:
throw new MimbleWimbleCoinInvalidParameters("Invalid cryptocurrency");
}
Expand Down Expand Up @@ -281,6 +319,10 @@ export default class Consensus {
switch (cryptocurrency.id) {
case "grin_testnet":
return new BigNumber(185040);
case "epic_cash":
return new BigNumber(2600000);
case "epic_cash_floonet":
return new BigNumber(25800);
default:
throw new MimbleWimbleCoinInvalidParameters("Invalid cryptocurrency");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ export default class Mqs {
return Buffer.from([1, 69]);
case "mimblewimble_coin_floonet":
return Buffer.from([1, 121]);
case "epic_cash":
return Buffer.from([1, 0]);
case "epic_cash_floonet":
return Buffer.from([1, 136]);
default:
throw new MimbleWimbleCoinInvalidParameters("Invalid cryptocurrency");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ export default class Node {
return getEnv("API_GRIN_NODE");
case "grin_testnet":
return getEnv("API_GRIN_TESTNET_NODE");
case "epic_cash":
return getEnv("API_EPIC_CASH_NODE");
case "epic_cash_floonet":
return getEnv("API_EPIC_CASH_FLOONET_NODE");
default:
throw new MimbleWimbleCoinInvalidParameters("Invalid cryptocurrency");
}
Expand Down
Loading

0 comments on commit 91b103b

Please sign in to comment.