@ledgerhq/coin-stacks
Version:
Ledger Stacks Coin integration
20 lines • 758 B
JavaScript
import { AddressVersion } from "@stacks/transactions/dist";
import { getPath, throwIfError } from "../utils";
const resolver = (signerContext) => {
return async (deviceId, { path, verify }) => {
const r = await signerContext(deviceId, async (signer) => {
const r = verify
? await signer.showAddressAndPubKey(getPath(path), AddressVersion.MainnetSingleSig)
: await signer.getAddressAndPubKey(getPath(path), AddressVersion.MainnetSingleSig);
return r;
});
throwIfError(r);
return {
path,
address: r.address,
publicKey: r.publicKey.toString("hex"),
};
};
};
export default resolver;
//# sourceMappingURL=getAddress.js.map