33 lines
1.0 KiB
TypeScript
33 lines
1.0 KiB
TypeScript
/**
|
|
* 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.";
|