MyCrypto/common/actions/ens.js

40 lines
679 B
JavaScript
Raw Normal View History

2017-06-26 22:27:55 +00:00
// @flow
/*** Resolve ENS name ***/
2017-06-26 22:27:55 +00:00
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 function resolveEnsName(name: string): ResolveEnsNameAction {
return {
type: 'ENS_RESOLVE',
payload: name
};
}
/*** Cache ENS address ***/
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
};
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
}
/*** Union Type ***/
export type EnsAction = ResolveEnsNameAction | CacheEnsAddressAction;