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:
defiQUG
2026-02-12 15:57:08 -08:00
parent 17020ba236
commit bee1d29d55
33 changed files with 1444 additions and 1 deletions

View File

@@ -0,0 +1,28 @@
/**
* Step 7 — Wallet API: validation (Zod) for Ethereum family with chainId 138
* Target: ledger-live wallet-api packages/core/src/families/ethereum/validation.ts
* (If Ledger adds Chain 138 to Ethereum family, ensure chainId 138 is allowed in schema.)
*
* Example: extend schemaRawEthereumTransaction to allow chainId 138.
*/
import { z } from "zod";
const CHAIN_ID_138 = 138;
export const schemaRawEthereumTransaction = z.object({
family: z.literal("ethereum"),
amount: z.string(),
recipient: z.string(),
gasPrice: z.string().optional(),
maxFeePerGas: z.string().optional(),
maxPriorityFeePerGas: z.string().optional(),
gasLimit: z.string().optional(),
data: z.string().optional(),
nonce: z.number().optional(),
chainId: z.number().refine((id) => id === 1 || id === CHAIN_ID_138, {
message: "chainId must be 1 (Ethereum) or 138 (Defi Oracle Meta Mainnet)",
}),
});
export type RawEthereumTransaction = z.infer<typeof schemaRawEthereumTransaction>;