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,45 @@
/**
* Step 7 — Wallet API: serialize/deserialize for JSON-RPC
* Target: wallet-api packages/core/src/families/ethereum/serializer.ts
*
* Ethereum family already has serialization; ensure chainId is preserved.
* When adding a new family, implement serializeTransaction/deserializeTransaction
* for the new type and add to the union in packages/core/src/families/serializer.ts.
*/
import type { RawEthereumTransaction } from "./types.ethereum-chain138";
import type { EthereumTransaction } from "./types.ethereum-chain138";
export function serializeEthereumTransaction(
tx: EthereumTransaction
): RawEthereumTransaction {
return {
family: "ethereum",
amount: tx.amount,
recipient: tx.recipient,
gasPrice: tx.gasPrice,
maxFeePerGas: tx.maxFeePerGas,
maxPriorityFeePerGas: tx.maxPriorityFeePerGas,
gasLimit: tx.gasLimit,
data: tx.data,
nonce: tx.nonce,
chainId: tx.chainId,
};
}
export function deserializeEthereumTransaction(
raw: RawEthereumTransaction
): EthereumTransaction {
return {
family: "ethereum",
amount: raw.amount,
recipient: raw.recipient,
gasPrice: raw.gasPrice,
maxFeePerGas: raw.maxFeePerGas,
maxPriorityFeePerGas: raw.maxPriorityFeePerGas,
gasLimit: raw.gasLimit,
data: raw.data,
nonce: raw.nonce,
chainId: raw.chainId,
};
}