Add full Chain 138 integration: 8 steps, chain spec, app-ethereum config, docs
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
9
step-01-currency/README.md
Normal file
9
step-01-currency/README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Step 1 — Currency
|
||||
|
||||
Add the Chain 138 currency to `@ledgerhq/cryptoassets`.
|
||||
|
||||
**In ledger-live repo:**
|
||||
|
||||
1. Open `libs/ledgerjs/packages/cryptoassets/src/currencies.ts` (or `currencies.js`).
|
||||
2. Add the `defi_oracle_meta_mainnet` entry from `currencies.chain138.ts` to the cryptoassets map.
|
||||
3. If the repo uses a single flat object keyed by id, add: `defi_oracle_meta_mainnet: { ...defiOracleMetaMainnetCurrencyRaw }`.
|
||||
62
step-01-currency/currencies.chain138.ts
Normal file
62
step-01-currency/currencies.chain138.ts
Normal file
@@ -0,0 +1,62 @@
|
||||
/**
|
||||
* Step 1 — Currency (Cryptoassets library)
|
||||
* Target: ledger-live libs/ledgerjs/packages/cryptoassets/src/currencies.ts
|
||||
* Add this entry to the cryptoassets map (merge with existing ethereum or add as new key).
|
||||
*
|
||||
* Chain 138: Defi Oracle Meta Mainnet
|
||||
* @see https://developers.ledger.com/docs/ledger-live/accounts/integration/blockchain/cryptoassets-library
|
||||
*/
|
||||
|
||||
export const defiOracleMetaMainnetCurrency = {
|
||||
type: "CryptoCurrency",
|
||||
id: "defi_oracle_meta_mainnet",
|
||||
coinType: 60, // SLIP-44 Ethereum
|
||||
name: "Defi Oracle Meta Mainnet",
|
||||
managerAppName: "Ethereum",
|
||||
ticker: "ETH",
|
||||
countervalueTicker: "ETH",
|
||||
scheme: "defi-oracle-meta",
|
||||
color: "#627EEA",
|
||||
family: "ethereum",
|
||||
units: [
|
||||
{ name: "ETH", code: "ETH", magnitude: 18 },
|
||||
{ name: "wei", code: "wei", magnitude: 0 },
|
||||
],
|
||||
ethereumLikeInfo: { chainId: 138 },
|
||||
blockAvgTime: 2, // Chain 138 ~2s block time (Besu QBFT)
|
||||
// disableCountervalue: true, // uncomment if fiat should not be shown
|
||||
explorerViews: [
|
||||
{
|
||||
address: "https://explorer.d-bis.org/address/$address",
|
||||
tx: "https://explorer.d-bis.org/tx/$hash",
|
||||
token: "https://explorer.d-bis.org/token/$contractAddress?a=$address",
|
||||
},
|
||||
],
|
||||
} as const;
|
||||
|
||||
// Plain object form for JSON/currencies.js style (if repo uses .js)
|
||||
export const defiOracleMetaMainnetCurrencyRaw = {
|
||||
type: "CryptoCurrency",
|
||||
id: "defi_oracle_meta_mainnet",
|
||||
coinType: 60,
|
||||
name: "Defi Oracle Meta Mainnet",
|
||||
managerAppName: "Ethereum",
|
||||
ticker: "ETH",
|
||||
countervalueTicker: "ETH",
|
||||
scheme: "defi-oracle-meta",
|
||||
color: "#627EEA",
|
||||
family: "ethereum",
|
||||
units: [
|
||||
{ name: "ETH", code: "ETH", magnitude: 18 },
|
||||
{ name: "wei", code: "wei", magnitude: 0 },
|
||||
],
|
||||
ethereumLikeInfo: { chainId: 138 },
|
||||
blockAvgTime: 2,
|
||||
explorerViews: [
|
||||
{
|
||||
address: "https://explorer.d-bis.org/address/$address",
|
||||
tx: "https://explorer.d-bis.org/tx/$hash",
|
||||
token: "https://explorer.d-bis.org/token/$contractAddress?a=$address",
|
||||
},
|
||||
],
|
||||
} as const;
|
||||
Reference in New Issue
Block a user