Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3399032
D9524.id32153.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D9524.id32153.diff
View Options
diff --git a/lib/components/ens-cache-provider.react.js b/lib/components/ens-cache-provider.react.js
--- a/lib/components/ens-cache-provider.react.js
+++ b/lib/components/ens-cache-provider.react.js
@@ -2,7 +2,8 @@
import * as React from 'react';
-import { ENSCache, type EthersProvider } from '../utils/ens-cache.js';
+import type { EthersProvider } from '../types/ethers-types.js';
+import { ENSCache } from '../utils/ens-cache.js';
import {
getENSNames as baseGetENSNames,
type GetENSNames,
diff --git a/lib/types/ethers-types.js b/lib/types/ethers-types.js
new file mode 100644
--- /dev/null
+++ b/lib/types/ethers-types.js
@@ -0,0 +1,8 @@
+// @flow
+
+export type EthersProvider = {
+ +lookupAddress: (address: string) => Promise<?string>,
+ +resolveName: (name: string) => Promise<?string>,
+ +getAvatar: (name: string) => Promise<?string>,
+ ...
+};
diff --git a/lib/utils/ens-cache.js b/lib/utils/ens-cache.js
--- a/lib/utils/ens-cache.js
+++ b/lib/utils/ens-cache.js
@@ -3,6 +3,7 @@
import namehash from 'eth-ens-namehash';
import sleep from './sleep.js';
+import type { EthersProvider } from '../types/ethers-types.js';
const cacheTimeout = 24 * 60 * 60 * 1000; // one day
const failedQueryCacheTimeout = 5 * 60 * 1000; // five minutes
@@ -13,12 +14,6 @@
throw new Error(`ENS fetch for ${identifier} timed out`);
}
-export type EthersProvider = {
- +lookupAddress: (address: string) => Promise<?string>,
- +resolveName: (name: string) => Promise<?string>,
- +getAvatar: (name: string) => Promise<?string>,
- ...
-};
type ENSNameQueryCacheEntry = {
// We normalize ETH addresses to lowercase characters
+normalizedETHAddress: string,
diff --git a/native/utils/ethers-utils.js b/native/utils/ethers-utils.js
--- a/native/utils/ethers-utils.js
+++ b/native/utils/ethers-utils.js
@@ -4,7 +4,7 @@
import { ethers } from 'ethers';
-import type { EthersProvider } from 'lib/utils/ens-cache.js';
+import type { EthersProvider } from 'lib/types/ethers-types.js';
let alchemyKey;
try {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 3, 1:31 AM (20 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2609330
Default Alt Text
D9524.id32153.diff (1 KB)
Attached To
Mode
D9524: [lib] Move EthersProvider type to separate file
Attached
Detach File
Event Timeline
Log In to Comment