37 lines
603 B
JavaScript
Raw Normal View History

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