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:
32
step-07-wallet-api/walletApiAdapter.chain138.ts
Normal file
32
step-07-wallet-api/walletApiAdapter.chain138.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* Step 7 — Wallet API: Ledger Wallet adapter (WalletAPI tx <-> LL tx)
|
||||
* Target: ledger-live libs/ledger-live-common/src/families/ethereum/walletApiAdapter.ts
|
||||
*
|
||||
* If Chain 138 is exposed via Wallet API, ensure the adapter maps WalletAPI
|
||||
* Ethereum transaction (with chainId 138) to Ledger Wallet Ethereum transaction.
|
||||
* Add to the generated walletApiAdapter dispatch (via sync-families-dispatch script).
|
||||
*/
|
||||
|
||||
/*
|
||||
// Example: in libs/ledger-live-common/src/families/ethereum/walletApiAdapter.ts
|
||||
export function fromWalletAPITransaction(
|
||||
walletApiTx: WalletAPIEthereumTransaction
|
||||
): EthereumTransaction {
|
||||
return {
|
||||
...walletApiTx,
|
||||
chainId: walletApiTx.chainId ?? 138,
|
||||
};
|
||||
}
|
||||
|
||||
export function toWalletAPITransaction(
|
||||
llTx: EthereumTransaction
|
||||
): WalletAPIEthereumTransaction {
|
||||
return {
|
||||
...llTx,
|
||||
chainId: llTx.chainId,
|
||||
};
|
||||
}
|
||||
*/
|
||||
|
||||
export const ADAPTER_NOTE =
|
||||
"Extend ethereum walletApiAdapter to handle chainId 138; register in sync-families-dispatch so generated walletApiAdapter.ts includes it.";
|
||||
Reference in New Issue
Block a user