@ensdomains/ethers-patch-v5 0.0.2 → 0.0.4
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.
- package/dist/index.cjs +7 -2
- package/dist/index.js +7 -2
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -88,7 +88,12 @@ import_ethers.providers.BaseProvider.prototype.resolveName = async function(name
|
|
|
88
88
|
}
|
|
89
89
|
const fwd = await this.getResolver(name);
|
|
90
90
|
if (!fwd) return null;
|
|
91
|
-
|
|
91
|
+
try {
|
|
92
|
+
const a = await fetchAddress(fwd, coinType);
|
|
93
|
+
if (!/^0x0+$/.test(a)) return a;
|
|
94
|
+
} catch {
|
|
95
|
+
}
|
|
96
|
+
return null;
|
|
92
97
|
};
|
|
93
98
|
import_ethers.providers.BaseProvider.prototype.lookupAddress = async function(address, coinType = COIN_TYPE_ETH) {
|
|
94
99
|
if (coinType === "old") return lookupAddress.call(this, address);
|
|
@@ -149,7 +154,7 @@ async function fetchAddress(resolver, coinType) {
|
|
|
149
154
|
"addr(bytes32,uint256)",
|
|
150
155
|
coinType
|
|
151
156
|
);
|
|
152
|
-
return isEVMCoinType(coinType) ? a === "0x" ? a.padEnd(42) : (0, import_utils.getAddress)(a) : a;
|
|
157
|
+
return isEVMCoinType(coinType) ? a === "0x" ? a.padEnd(42, "0") : (0, import_utils.getAddress)(a) : a;
|
|
153
158
|
}
|
|
154
159
|
async function callResolver(resolver, fragment, ...args) {
|
|
155
160
|
const f = ABI.getFunction(fragment);
|
package/dist/index.js
CHANGED
|
@@ -84,7 +84,12 @@ providers.BaseProvider.prototype.resolveName = async function(name, coinType = C
|
|
|
84
84
|
}
|
|
85
85
|
const fwd = await this.getResolver(name);
|
|
86
86
|
if (!fwd) return null;
|
|
87
|
-
|
|
87
|
+
try {
|
|
88
|
+
const a = await fetchAddress(fwd, coinType);
|
|
89
|
+
if (!/^0x0+$/.test(a)) return a;
|
|
90
|
+
} catch {
|
|
91
|
+
}
|
|
92
|
+
return null;
|
|
88
93
|
};
|
|
89
94
|
providers.BaseProvider.prototype.lookupAddress = async function(address, coinType = COIN_TYPE_ETH) {
|
|
90
95
|
if (coinType === "old") return lookupAddress.call(this, address);
|
|
@@ -145,7 +150,7 @@ async function fetchAddress(resolver, coinType) {
|
|
|
145
150
|
"addr(bytes32,uint256)",
|
|
146
151
|
coinType
|
|
147
152
|
);
|
|
148
|
-
return isEVMCoinType(coinType) ? a === "0x" ? a.padEnd(42) : getAddress(a) : a;
|
|
153
|
+
return isEVMCoinType(coinType) ? a === "0x" ? a.padEnd(42, "0") : getAddress(a) : a;
|
|
149
154
|
}
|
|
150
155
|
async function callResolver(resolver, fragment, ...args) {
|
|
151
156
|
const f = ABI.getFunction(fragment);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ensdomains/ethers-patch-v5",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"typescript": "^5"
|
|
18
|
+
"typescript": "^5",
|
|
19
|
+
"ethers": "5",
|
|
20
|
+
"@ethersproject/providers": "5"
|
|
19
21
|
},
|
|
20
22
|
"dependencies": {
|
|
21
|
-
"@adraffy/ens-normalize": "^1.11.1"
|
|
22
|
-
"ethers": "^5.0.0",
|
|
23
|
-
"@ethersproject/providers": "^5.0.0"
|
|
23
|
+
"@adraffy/ens-normalize": "^1.11.1"
|
|
24
24
|
},
|
|
25
25
|
"publishConfig": {
|
|
26
26
|
"access": "public"
|