-
Notifications
You must be signed in to change notification settings - Fork 0
/
lcd.js
12 lines (12 loc) · 1.7 KB
/
lcd.js
1
2
3
4
5
6
7
8
9
10
11
12
import { LCDClient } from '@terra-money/feather.js';
const clients = new Map();
export function createLCDClient(networks) {
const cacheKey = JSON.stringify(networks);
if (clients.has(cacheKey)) {
return clients.get(cacheKey);
}
const lcdClient = new LCDClient(networks);
clients.set(cacheKey, lcdClient);
return lcdClient;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGNkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL0B0ZXJyYS1tb25leS93YWxsZXQtdHlwZXMvbGNkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQW1CLE1BQU0seUJBQXlCLENBQUM7QUFFckUsTUFBTSxPQUFPLEdBQUcsSUFBSSxHQUFHLEVBQXFCLENBQUM7QUFFN0MsTUFBTSxVQUFVLGVBQWUsQ0FBQyxRQUF5QztJQUN2RSxNQUFNLFFBQVEsR0FBRyxJQUFJLENBQUMsU0FBUyxDQUFDLFFBQVEsQ0FBQyxDQUFDO0lBRTFDLElBQUksT0FBTyxDQUFDLEdBQUcsQ0FBQyxRQUFRLENBQUMsRUFBRTtRQUN6QixPQUFPLE9BQU8sQ0FBQyxHQUFHLENBQUMsUUFBUSxDQUFFLENBQUM7S0FDL0I7SUFFRCxNQUFNLFNBQVMsR0FBRyxJQUFJLFNBQVMsQ0FBQyxRQUFRLENBQUMsQ0FBQztJQUUxQyxPQUFPLENBQUMsR0FBRyxDQUFDLFFBQVEsRUFBRSxTQUFTLENBQUMsQ0FBQztJQUVqQyxPQUFPLFNBQVMsQ0FBQztBQUNuQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgTENEQ2xpZW50LCBMQ0RDbGllbnRDb25maWcgfSBmcm9tICdAdGVycmEt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