@onekeyfe/react-native-dns-lookup 3.0.162 → 3.0.163

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +35 -0
  2. package/package.json +5 -4
package/README.md CHANGED
@@ -1,5 +1,40 @@
1
1
  # @onekeyfe/react-native-dns-lookup
2
2
 
3
+ Native hostname resolution for OneKey React Native applications on iOS and
4
+ Android. The wrapper returns the addresses resolved by the device's native
5
+ network stack, without choosing an application connection or transport.
6
+
7
+ ## Installation and usage
8
+
9
+ ```sh
10
+ yarn add @onekeyfe/react-native-dns-lookup
11
+ ```
12
+
13
+ Install the application's iOS pods and rebuild the native application.
14
+
15
+ ```ts
16
+ import { getIpAddressesForHostname } from '@onekeyfe/react-native-dns-lookup';
17
+
18
+ const addresses = await getIpAddressesForHostname('example.com');
19
+ ```
20
+
21
+ ## API
22
+
23
+ `getIpAddressesForHostname(hostname)` returns `Promise<string[]>`. The named
24
+ `DnsLookup` export exposes the underlying `getIpAddresses(hostname)` method,
25
+ and `DnsLookupSpec` provides the interface type.
26
+
27
+ Treat the returned addresses as resolver output rather than a guarantee that a
28
+ service is reachable. Resolution can fail, and a network or DNS change can alter
29
+ subsequent results. The application owns retry, address selection and any cache
30
+ it builds above this API; the wrapper does not expose those policies.
31
+
32
+ The JavaScript wrapper is in [src/index.tsx](src/index.tsx), and the native
33
+ interface is in [src/NativeDnsLookup.ts](src/NativeDnsLookup.ts). Integrations
34
+ should handle rejection and validate actual connections independently of DNS.
35
+
36
+ ## Upstream attribution
37
+
3
38
  First, a sincere thank-you to the
4
39
  `react-native-dns-lookup` maintainers for their excellent work 🙏
5
40
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-dns-lookup",
3
- "version": "3.0.162",
3
+ "version": "3.0.163",
4
4
  "description": "react-native-dns-lookup",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -45,14 +45,15 @@
45
45
  ],
46
46
  "repository": {
47
47
  "type": "git",
48
- "url": "git+https://github.com/OneKeyHQ/app-modules/react-native-dns-lookup.git"
48
+ "url": "git+https://github.com/OneKeyHQ/app-modules.git",
49
+ "directory": "native-modules/react-native-dns-lookup"
49
50
  },
50
51
  "author": "@onekeyhq <huanming@onekey.so> (https://github.com/OneKeyHQ/app-modules)",
51
52
  "license": "MIT",
52
53
  "bugs": {
53
- "url": "https://github.com/OneKeyHQ/app-modules/react-native-dns-lookup/issues"
54
+ "url": "https://github.com/OneKeyHQ/app-modules/issues"
54
55
  },
55
- "homepage": "https://github.com/OneKeyHQ/app-modules/react-native-dns-lookup#readme",
56
+ "homepage": "https://github.com/OneKeyHQ/app-modules/tree/main/native-modules/react-native-dns-lookup#readme",
56
57
  "publishConfig": {
57
58
  "registry": "https://registry.npmjs.org/"
58
59
  },