@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
25 lines • 788 B
JavaScript
import { fromAccountRaw, toAccountRaw } from "../account";
export { getCurrencyBridge, getAccountBridge } from "./impl";
export async function fromScanAccountEventRaw(raw) {
switch (raw.type) {
case "discovered":
return {
type: raw.type,
account: await fromAccountRaw(raw.account),
};
default:
throw new Error("unsupported ScanAccountEvent " + raw.type);
}
}
export function toScanAccountEventRaw(e) {
switch (e.type) {
case "discovered":
return {
type: e.type,
account: toAccountRaw(e.account),
};
default:
throw new Error("unsupported ScanAccountEvent " + e.type);
}
}
//# sourceMappingURL=index.js.map