@biconomy/abstractjs
Version:
SDK for Biconomy integration with support for account abstraction, smart accounts, ERC-4337.
16 lines • 586 B
JavaScript
/**
* Creates a type-safe mapping from chain IDs to addresses with runtime safety utilities
* @param entries - Array of tuples containing [chainId, address]
* @returns An object mapping chain IDs to addresses with type safety and utility methods
*/
export function createChainAddressMap(entries) {
const map = {};
for (const [chainId, address] of entries) {
map[chainId] = address;
}
// Add utility methods
map.get = (chainId) => map[chainId];
map.has = (chainId) => chainId in map;
return map;
}
//# sourceMappingURL=createChainAddressMap.js.map