MyCrypto/common/actions/ens.js

37 lines
603 B
JavaScript
Raw Normal View History

2017-06-26 22:27:55 +00:00
// @flow
export type ResolveEnsNameAction = {
2017-07-02 05:49:06 +00:00
type: 'ENS_RESOLVE',
payload: string
2017-06-26 22:27:55 +00:00
};
export type CacheEnsAddressAction = {
2017-07-02 05:49:06 +00:00
type: 'ENS_CACHE',
payload: {
ensName: string,
address: string
}
2017-06-26 22:27:55 +00:00
};
export type EnsAction = ResolveEnsNameAction | CacheEnsAddressAction;
export function resolveEnsName(name: string): ResolveEnsNameAction {
2017-07-02 05:49:06 +00:00
return {
type: 'ENS_RESOLVE',
payload: name
};
2017-06-26 22:27:55 +00:00
}
2017-07-02 05:49:06 +00:00
export function cacheEnsAddress(
ensName: string,
address: string
): CacheEnsAddressAction {
return {
type: 'ENS_CACHE',
payload: {
ensName,
address
}
};
2017-06-26 22:27:55 +00:00
}