@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
24 lines (22 loc) • 723 B
text/typescript
import { makeScanAccounts } from "@ledgerhq/coin-framework/bridge/jsHelpers";
import { CurrencyBridge } from "@ledgerhq/types-live";
import { genericGetAccountShape } from "./getAccountShape";
import { getSigner } from "./signer";
import type { AlpacaSigner } from "./signer/types";
export function getAlpacaCurrencyBridge(
network: string,
kind: string,
customSigner?: AlpacaSigner,
): CurrencyBridge {
const signer = customSigner ?? getSigner(network);
return {
preload: () => Promise.resolve({}),
hydrate: () => {
return;
},
scanAccounts: makeScanAccounts({
getAccountShape: genericGetAccountShape(network, kind),
getAddressFn: signer.getAddress.bind(signer),
}),
};
}