2017-06-26 22:27:55 +00:00
|
|
|
// @flow
|
|
|
|
|
2017-07-27 17:05:09 +00:00
|
|
|
/*** 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
|
|
|
};
|
|
|
|
|
2017-07-27 17:05:09 +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
|
|
|
}
|
2017-07-27 17:05:09 +00:00
|
|
|
|
|
|
|
/*** Union Type ***/
|
|
|
|
export type EnsAction = ResolveEnsNameAction | CacheEnsAddressAction;
|