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:
28
step-07-wallet-api/validation.ethereum-chain138.ts
Normal file
28
step-07-wallet-api/validation.ethereum-chain138.ts
Normal 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>;
|
||||
Reference in New Issue
Block a user