@ledgerhq/hw-app-eth
Version:
Ledger Hardware Wallet Ethereum Application API
20 lines • 817 B
JavaScript
import ledgerService from "../../services/ledger";
/**
* @ignore for the README
*
* This method will execute the pipeline of actions necessary for clear signing domains.
* Signature is provided by the backend used in @ledgerhq/domain-service
*/
export const domainResolutionFlow = async (appBinding, domainDescriptor) => {
if (!domainDescriptor)
return;
const { domain, address, registry, type } = domainDescriptor;
const challenge = await appBinding.getChallenge();
const domainAPDU = type === "forward"
? await ledgerService.signDomainResolution(domain, registry, challenge)
: await ledgerService.signAddressResolution(address, registry, challenge);
if (domainAPDU) {
await appBinding.provideDomainName(domainAPDU);
}
};
//# sourceMappingURL=index.js.map