Skip to content

Commit

Permalink
[LIVE-13938] Feature - ZKsync (#8182)
Browse files Browse the repository at this point in the history
* Add ZKsync icons

* Add ZKSync to `@ledgerhq/cryptoassets` & types

* Add ZKsync to supported currencies

* Add abandonseed for ZKsync currencies

* Add ZKsync feature flag

* Add ZKsync config

* Import CAL for ZKsync

* changeset

* Update snapshot
  • Loading branch information
lambertkevin authored Nov 4, 2024
1 parent b74caa7 commit 63e5392
Show file tree
Hide file tree
Showing 24 changed files with 582 additions and 24 deletions.
12 changes: 12 additions & 0 deletions .changeset/mean-eyes-lay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
"@ledgerhq/types-cryptoassets": minor
"@ledgerhq/cryptoassets": minor
"@ledgerhq/types-live": minor
"@ledgerhq/crypto-icons-ui": minor
"ledger-live-desktop": minor
"live-mobile": minor
"@ledgerhq/live-common": minor
"@ledgerhq/live-cli": minor
---

Add support for ZKsync currency
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 @@ -99,6 +99,8 @@ setSupportedCurrencies([
"scroll",
"scroll_sepolia",
"etherlink",
"zksync",
"zksync_sepolia",
]);

for (const k in process.env) setEnvUnsafe(k as EnvName, process.env[k]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,6 @@ setSupportedCurrencies([
"scroll_sepolia",
"ton",
"etherlink",
"zksync",
"zksync_sepolia",
]);
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ const StepChooseCurrency = ({ currency, setCurrency }: StepProps) => {
const icon = useFeature("currencyIcon");
const ton = useFeature("currencyTon");
const etherlink = useFeature("currencyEtherlink");
const zksync = useFeature("currencyZkSync");
const zksyncSepolia = useFeature("currencyZkSyncSepolia");

const featureFlaggedCurrencies = useMemo(
(): Partial<Record<CryptoCurrencyId, Feature<unknown> | null>> => ({
Expand Down Expand Up @@ -132,6 +134,8 @@ const StepChooseCurrency = ({ currency, setCurrency }: StepProps) => {
scroll_sepolia: scrollSepolia,
icon,
etherlink,
zksync,
zksync_sepolia: zksyncSepolia,
}),
[
axelar,
Expand Down Expand Up @@ -181,6 +185,8 @@ const StepChooseCurrency = ({ currency, setCurrency }: StepProps) => {
scrollSepolia,
icon,
etherlink,
zksync,
zksyncSepolia,
],
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -781,5 +781,23 @@
"family": "ethereum",
"color": "#38FF9C",
"decimals": 18
},
{
"type": "CryptoCurrency",
"id": "zksync",
"ticker": "ETH",
"name": "ZKsync",
"family": "ethereum",
"color": "#000000",
"decimals": 18
},
{
"type": "CryptoCurrency",
"id": "zksync_sepolia",
"ticker": "ETH",
"name": "ZKsync Sepolia",
"family": "ethereum",
"color": "#ff0000",
"decimals": 18
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -781,5 +781,23 @@
"family": "ethereum",
"color": "#38FF9C",
"decimals": 18
},
{
"type": "CryptoCurrency",
"id": "zksync",
"ticker": "ETH",
"name": "ZKsync",
"family": "ethereum",
"color": "#000000",
"decimals": 18
},
{
"type": "CryptoCurrency",
"id": "zksync_sepolia",
"ticker": "ETH",
"name": "ZKsync Sepolia",
"family": "ethereum",
"color": "#ff0000",
"decimals": 18
}
]
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 @@ -126,6 +126,8 @@ setSupportedCurrencies([
"scroll_sepolia",
"ton",
"etherlink",
"zksync",
"zksync_sepolia",
]);

if (Config.BLE_LOG_LEVEL) BluetoothTransport.setLogLevel(Config.BLE_LOG_LEVEL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ export default function AddAccountsSelectCrypto({ navigation, route }: Props) {
const icon = useFeature("currencyIcon");
const ton = useFeature("currencyTon");
const etherlink = useFeature("currencyEtherlink");
const zksync = useFeature("currencyZkSync");
const zksyncSepolia = useFeature("currencyZkSyncSepolia");

const featureFlaggedCurrencies = useMemo(
(): Partial<Record<CryptoCurrencyId, Feature<unknown> | null>> => ({
Expand Down Expand Up @@ -154,6 +156,8 @@ export default function AddAccountsSelectCrypto({ navigation, route }: Props) {
scroll_sepolia: scrollSepolia,
icon,
etherlink,
zksync,
zksync_sepolia: zksyncSepolia,
}),
[
axelar,
Expand Down Expand Up @@ -203,6 +207,8 @@ export default function AddAccountsSelectCrypto({ navigation, route }: Props) {
scrollSepolia,
icon,
etherlink,
zksync,
zksyncSepolia,
],
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,10 @@ exports[`formatCurrencyUnit with custom options with locale de-DE should correct

exports[`formatCurrencyUnit with custom options with locale de-DE should correctly format ZCoin unit (XZC) 1`] = `"123.456.789,00000000- -XZC"`;

exports[`formatCurrencyUnit with custom options with locale de-DE should correctly format ZKsync Sepolia unit (ETH) 1`] = `"0,012345678900000000- -𝚝ETH"`;

exports[`formatCurrencyUnit with custom options with locale de-DE should correctly format ZKsync unit (ETH) 1`] = `"0,012345678900000000- -ETH"`;

exports[`formatCurrencyUnit with custom options with locale de-DE should correctly format Zcash unit (zcash) 1`] = `"123.456.789,00000000- -ZEC"`;

exports[`formatCurrencyUnit with custom options with locale de-DE should correctly format Zilliqa unit (ZIL) 1`] = `"12.345,678900000000- -ZIL"`;
Expand Down Expand Up @@ -642,6 +646,10 @@ exports[`formatCurrencyUnit with custom options with locale en-US should correct

exports[`formatCurrencyUnit with custom options with locale en-US should correctly format ZCoin unit (XZC) 1`] = `"123,456,789.00000000- -XZC"`;

exports[`formatCurrencyUnit with custom options with locale en-US should correctly format ZKsync Sepolia unit (ETH) 1`] = `"0.012345678900000000- -𝚝ETH"`;

exports[`formatCurrencyUnit with custom options with locale en-US should correctly format ZKsync unit (ETH) 1`] = `"0.012345678900000000- -ETH"`;

exports[`formatCurrencyUnit with custom options with locale en-US should correctly format Zcash unit (zcash) 1`] = `"123,456,789.00000000- -ZEC"`;

exports[`formatCurrencyUnit with custom options with locale en-US should correctly format Zilliqa unit (ZIL) 1`] = `"12,345.678900000000- -ZIL"`;
Expand Down Expand Up @@ -968,6 +976,10 @@ exports[`formatCurrencyUnit with custom options with locale es-ES should correct

exports[`formatCurrencyUnit with custom options with locale es-ES should correctly format ZCoin unit (XZC) 1`] = `"123.456.789,00000000- -XZC"`;

exports[`formatCurrencyUnit with custom options with locale es-ES should correctly format ZKsync Sepolia unit (ETH) 1`] = `"0,012345678900000000- -𝚝ETH"`;

exports[`formatCurrencyUnit with custom options with locale es-ES should correctly format ZKsync unit (ETH) 1`] = `"0,012345678900000000- -ETH"`;

exports[`formatCurrencyUnit with custom options with locale es-ES should correctly format Zcash unit (zcash) 1`] = `"123.456.789,00000000- -ZEC"`;

exports[`formatCurrencyUnit with custom options with locale es-ES should correctly format Zilliqa unit (ZIL) 1`] = `"12.345,678900000000- -ZIL"`;
Expand Down Expand Up @@ -1294,6 +1306,10 @@ exports[`formatCurrencyUnit with custom options with locale fr-FR should correct

exports[`formatCurrencyUnit with custom options with locale fr-FR should correctly format ZCoin unit (XZC) 1`] = `"123 456 789,00000000- -XZC"`;

exports[`formatCurrencyUnit with custom options with locale fr-FR should correctly format ZKsync Sepolia unit (ETH) 1`] = `"0,012345678900000000- -𝚝ETH"`;

exports[`formatCurrencyUnit with custom options with locale fr-FR should correctly format ZKsync unit (ETH) 1`] = `"0,012345678900000000- -ETH"`;

exports[`formatCurrencyUnit with custom options with locale fr-FR should correctly format Zcash unit (zcash) 1`] = `"123 456 789,00000000- -ZEC"`;

exports[`formatCurrencyUnit with custom options with locale fr-FR should correctly format Zilliqa unit (ZIL) 1`] = `"12 345,678900000000- -ZIL"`;
Expand Down Expand Up @@ -1620,6 +1636,10 @@ exports[`formatCurrencyUnit with custom options with locale ja-JP should correct

exports[`formatCurrencyUnit with custom options with locale ja-JP should correctly format ZCoin unit (XZC) 1`] = `"123,456,789.00000000- -XZC"`;

exports[`formatCurrencyUnit with custom options with locale ja-JP should correctly format ZKsync Sepolia unit (ETH) 1`] = `"0.012345678900000000- -𝚝ETH"`;

exports[`formatCurrencyUnit with custom options with locale ja-JP should correctly format ZKsync unit (ETH) 1`] = `"0.012345678900000000- -ETH"`;

exports[`formatCurrencyUnit with custom options with locale ja-JP should correctly format Zcash unit (zcash) 1`] = `"123,456,789.00000000- -ZEC"`;

exports[`formatCurrencyUnit with custom options with locale ja-JP should correctly format Zilliqa unit (ZIL) 1`] = `"12,345.678900000000- -ZIL"`;
Expand Down Expand Up @@ -1946,6 +1966,10 @@ exports[`formatCurrencyUnit with custom options with locale ko-KR should correct

exports[`formatCurrencyUnit with custom options with locale ko-KR should correctly format ZCoin unit (XZC) 1`] = `"123,456,789.00000000- -XZC"`;

exports[`formatCurrencyUnit with custom options with locale ko-KR should correctly format ZKsync Sepolia unit (ETH) 1`] = `"0.012345678900000000- -𝚝ETH"`;

exports[`formatCurrencyUnit with custom options with locale ko-KR should correctly format ZKsync unit (ETH) 1`] = `"0.012345678900000000- -ETH"`;

exports[`formatCurrencyUnit with custom options with locale ko-KR should correctly format Zcash unit (zcash) 1`] = `"123,456,789.00000000- -ZEC"`;

exports[`formatCurrencyUnit with custom options with locale ko-KR should correctly format Zilliqa unit (ZIL) 1`] = `"12,345.678900000000- -ZIL"`;
Expand Down Expand Up @@ -2272,6 +2296,10 @@ exports[`formatCurrencyUnit with custom options with locale pt-BR should correct

exports[`formatCurrencyUnit with custom options with locale pt-BR should correctly format ZCoin unit (XZC) 1`] = `"123.456.789,00000000- -XZC"`;

exports[`formatCurrencyUnit with custom options with locale pt-BR should correctly format ZKsync Sepolia unit (ETH) 1`] = `"0,012345678900000000- -𝚝ETH"`;

exports[`formatCurrencyUnit with custom options with locale pt-BR should correctly format ZKsync unit (ETH) 1`] = `"0,012345678900000000- -ETH"`;

exports[`formatCurrencyUnit with custom options with locale pt-BR should correctly format Zcash unit (zcash) 1`] = `"123.456.789,00000000- -ZEC"`;

exports[`formatCurrencyUnit with custom options with locale pt-BR should correctly format Zilliqa unit (ZIL) 1`] = `"12.345,678900000000- -ZIL"`;
Expand Down Expand Up @@ -2598,6 +2626,10 @@ exports[`formatCurrencyUnit with custom options with locale ru-RU should correct

exports[`formatCurrencyUnit with custom options with locale ru-RU should correctly format ZCoin unit (XZC) 1`] = `"123 456 789,00000000- -XZC"`;

exports[`formatCurrencyUnit with custom options with locale ru-RU should correctly format ZKsync Sepolia unit (ETH) 1`] = `"0,012345678900000000- -𝚝ETH"`;

exports[`formatCurrencyUnit with custom options with locale ru-RU should correctly format ZKsync unit (ETH) 1`] = `"0,012345678900000000- -ETH"`;

exports[`formatCurrencyUnit with custom options with locale ru-RU should correctly format Zcash unit (zcash) 1`] = `"123 456 789,00000000- -ZEC"`;

exports[`formatCurrencyUnit with custom options with locale ru-RU should correctly format Zilliqa unit (ZIL) 1`] = `"12 345,678900000000- -ZIL"`;
Expand Down Expand Up @@ -2924,6 +2956,10 @@ exports[`formatCurrencyUnit with custom options with locale tr-TR should correct

exports[`formatCurrencyUnit with custom options with locale tr-TR should correctly format ZCoin unit (XZC) 1`] = `"123.456.789,00000000- -XZC"`;

exports[`formatCurrencyUnit with custom options with locale tr-TR should correctly format ZKsync Sepolia unit (ETH) 1`] = `"0,012345678900000000- -𝚝ETH"`;

exports[`formatCurrencyUnit with custom options with locale tr-TR should correctly format ZKsync unit (ETH) 1`] = `"0,012345678900000000- -ETH"`;

exports[`formatCurrencyUnit with custom options with locale tr-TR should correctly format Zcash unit (zcash) 1`] = `"123.456.789,00000000- -ZEC"`;

exports[`formatCurrencyUnit with custom options with locale tr-TR should correctly format Zilliqa unit (ZIL) 1`] = `"12.345,678900000000- -ZIL"`;
Expand Down Expand Up @@ -3250,6 +3286,10 @@ exports[`formatCurrencyUnit with custom options with locale zh-CN should correct

exports[`formatCurrencyUnit with custom options with locale zh-CN should correctly format ZCoin unit (XZC) 1`] = `"123,456,789.00000000- -XZC"`;

exports[`formatCurrencyUnit with custom options with locale zh-CN should correctly format ZKsync Sepolia unit (ETH) 1`] = `"0.012345678900000000- -𝚝ETH"`;

exports[`formatCurrencyUnit with custom options with locale zh-CN should correctly format ZKsync unit (ETH) 1`] = `"0.012345678900000000- -ETH"`;

exports[`formatCurrencyUnit with custom options with locale zh-CN should correctly format Zcash unit (zcash) 1`] = `"123,456,789.00000000- -ZEC"`;

exports[`formatCurrencyUnit with custom options with locale zh-CN should correctly format Zilliqa unit (ZIL) 1`] = `"12,345.678900000000- -ZIL"`;
Expand Down Expand Up @@ -3576,6 +3616,10 @@ exports[`formatCurrencyUnit with default options should correctly format ZClassi

exports[`formatCurrencyUnit with default options should correctly format ZCoin unit (XZC) 1`] = `"123,456,789"`;

exports[`formatCurrencyUnit with default options should correctly format ZKsync Sepolia unit (ETH) 1`] = `"0.0123456"`;

exports[`formatCurrencyUnit with default options should correctly format ZKsync unit (ETH) 1`] = `"0.0123456"`;

exports[`formatCurrencyUnit with default options should correctly format Zcash unit (zcash) 1`] = `"123,456,789"`;

exports[`formatCurrencyUnit with default options should correctly format Zilliqa unit (ZIL) 1`] = `"12,345.6"`;
Expand Down
Loading

0 comments on commit 63e5392

Please sign in to comment.