@edgeandnode/graph-auth-kit 3.1.0 → 3.1.1
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/{GraphAuthKitInner.context-CtAz6ns5.js → GraphAuthKitInner.context-BvAxo6i8.js} +17 -10
- package/dist/ens/index.js +2 -2
- package/dist/ens/resolver.d.ts.map +1 -1
- package/dist/{hooks-DS-uXH1-.js → hooks-0pNjHb5c.js} +1 -1
- package/dist/index.js +4 -4
- package/dist/test-harness/index.js +1 -1
- package/dist/{utils-BxmehMLK.js → utils-BBVQP8l4.js} +1 -1
- package/package.json +1 -1
package/dist/{GraphAuthKitInner.context-CtAz6ns5.js → GraphAuthKitInner.context-BvAxo6i8.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "@theme-ui/core/jsx-runtime";
|
|
2
2
|
import { createContext, useContext, useRef, useState } from "react";
|
|
3
|
-
import { isAddress } from "viem";
|
|
3
|
+
import { getAddress, isAddress } from "viem";
|
|
4
4
|
import { useConnect, useDisconnect, useAccountEffect } from "wagmi";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { R as RequiredInfuraKey, O as OptionalGatewayApiKey, L as L1Chain, g as buildInfuraHttpTransport, n as L1ChainTestnet, q as SupportedClientChainId, D as DefChain, o as L2Chain, p as L2ChainTestnet, S as SafeSupportedNetworks, M as MULTISIG_AUTH_STORAGE_KEY, m as AUTH_STORAGE_KEY, j as buildPublicClient, e as isSafeOwner } from "./utils-CWqavpCw.js";
|
|
@@ -183,12 +183,15 @@ function buildEnsResolver({ infuraKey, gatewayApiKey }) {
|
|
|
183
183
|
try {
|
|
184
184
|
const publicClient = publicClientMap[testnet ? L1ChainTestnet.id : L1Chain.id];
|
|
185
185
|
const ids = [...new Set(addresses)];
|
|
186
|
-
const result = await publicClient.ensBatch(
|
|
186
|
+
const result = await publicClient.ensBatch(
|
|
187
|
+
...ids.map((address) => getName.batch({ address: getAddress(address) }))
|
|
188
|
+
);
|
|
187
189
|
return result.reduce((map, curr, idx) => {
|
|
188
190
|
const address = ids[idx];
|
|
189
191
|
return {
|
|
190
192
|
...map,
|
|
191
|
-
|
|
193
|
+
// always store the addresses as lower case
|
|
194
|
+
[address.toLowerCase()]: curr != null && curr.match ? curr.name : null
|
|
192
195
|
};
|
|
193
196
|
}, {});
|
|
194
197
|
} catch (err) {
|
|
@@ -224,7 +227,7 @@ function buildEnsResolver({ infuraKey, gatewayApiKey }) {
|
|
|
224
227
|
gatewayApiKey: apiKey
|
|
225
228
|
}) {
|
|
226
229
|
const resolvedNames = addresses.reduce((acc, address) => {
|
|
227
|
-
acc[address] = null;
|
|
230
|
+
acc[address.toLowerCase()] = null;
|
|
228
231
|
return acc;
|
|
229
232
|
}, {});
|
|
230
233
|
const _gatewayApiKey = gatewayApiKey || apiKey;
|
|
@@ -264,24 +267,28 @@ function buildEnsResolver({ infuraKey, gatewayApiKey }) {
|
|
|
264
267
|
},
|
|
265
268
|
async resolveEnsNamesBatch({ addresses, gatewayApiKey: apiKey, testnet }) {
|
|
266
269
|
const resolvedNames = addresses.reduce((acc, address) => {
|
|
267
|
-
acc[address] = null;
|
|
270
|
+
acc[address.toLowerCase()] = null;
|
|
268
271
|
return acc;
|
|
269
272
|
}, {});
|
|
270
273
|
const resolvedFromNetworkSubgraph = await defaultNamesBulkLookup({ addresses, testnet, gatewayApiKey: apiKey });
|
|
271
274
|
addresses.forEach((addr) => {
|
|
272
|
-
|
|
273
|
-
|
|
275
|
+
const address = addr.toLowerCase();
|
|
276
|
+
if (resolvedFromNetworkSubgraph[address] != null) {
|
|
277
|
+
resolvedNames[address] = resolvedFromNetworkSubgraph[address];
|
|
274
278
|
}
|
|
275
279
|
});
|
|
276
|
-
const unresolvedAddressesFromNetworkSubgraph = addresses.filter(
|
|
280
|
+
const unresolvedAddressesFromNetworkSubgraph = addresses.filter(
|
|
281
|
+
(addr) => resolvedNames[addr.toLowerCase()] == null
|
|
282
|
+
);
|
|
277
283
|
if (unresolvedAddressesFromNetworkSubgraph.length > 0) {
|
|
278
284
|
const resolvedFromEnsSubgraph = await ensBulkLookup({
|
|
279
285
|
addresses: unresolvedAddressesFromNetworkSubgraph,
|
|
280
286
|
testnet
|
|
281
287
|
});
|
|
282
288
|
unresolvedAddressesFromNetworkSubgraph.forEach((addr) => {
|
|
283
|
-
|
|
284
|
-
|
|
289
|
+
const address = addr.toLowerCase();
|
|
290
|
+
if (resolvedFromEnsSubgraph[address] != null) {
|
|
291
|
+
resolvedNames[address] = resolvedFromEnsSubgraph[address];
|
|
285
292
|
}
|
|
286
293
|
});
|
|
287
294
|
}
|
package/dist/ens/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b } from "../GraphAuthKitInner.context-
|
|
2
|
-
import { u, a } from "../hooks-
|
|
1
|
+
import { b } from "../GraphAuthKitInner.context-BvAxo6i8.js";
|
|
2
|
+
import { u, a } from "../hooks-0pNjHb5c.js";
|
|
3
3
|
export {
|
|
4
4
|
b as buildEnsResolver,
|
|
5
5
|
u as useGraphAuthKitEnsName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../src/ens/resolver.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,OAAO,
|
|
1
|
+
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../src/ens/resolver.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,MAAM,CAAA;AAE/C,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,CAAA;AAa5B,OAAO,EAAgB,KAAK,oBAAoB,EAAE,KAAK,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAEhG,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC;IACxC,OAAO,EAAE,OAAO,CAAA;IAChB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAC,CAAA;AACF,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAAC;IAC7C,SAAS,EAAE,OAAO,EAAE,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAC,CAAA;AACF,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,cAAc,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;IACvE;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,oBAAoB,CAAC,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAA;CACvF;AAED,eAAO,MAAM,oBAAoB;;;;;;;;;;EAAiD,CAAA;AAClF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AACvE,wBAAgB,gBAAgB,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,EAAE,oBAAoB,GAAG,iBAAiB,CAsMtG"}
|
|
@@ -9,7 +9,7 @@ import { useMutation } from "@tanstack/react-query";
|
|
|
9
9
|
import { watchAccount } from "@wagmi/core";
|
|
10
10
|
import { useMemo, useState, useEffect } from "react";
|
|
11
11
|
import { encodeFunctionData, getAddress, isAddress } from "viem";
|
|
12
|
-
import { u as useGraphAuthKitInnerContext, g as clientToProvider, M as MultisigSchema } from "./GraphAuthKitInner.context-
|
|
12
|
+
import { u as useGraphAuthKitInnerContext, g as clientToProvider, M as MultisigSchema } from "./GraphAuthKitInner.context-BvAxo6i8.js";
|
|
13
13
|
import { VoidSigner } from "@ethersproject/abstract-signer";
|
|
14
14
|
import { OperationType } from "@safe-global/safe-core-sdk-types";
|
|
15
15
|
import { utils, BigNumber } from "ethers";
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { m, A, k, B, D, v, G, L, n, o, p, M, O, R, u, a, S, q, r, s, t, l, g, j, c, b, f, h, e, i, d } from "./utils-CWqavpCw.js";
|
|
2
|
-
import { b as b2, c as c2, g as g2, h as h2, d as d2, a as a2, e as e2, f as f2, i as i2, m as m2 } from "./GraphAuthKitInner.context-
|
|
3
|
-
import { G as G2, a as a3, M as M2, b as b3, d as d3, u as u2 } from "./utils-
|
|
4
|
-
import { b as useGraphAuthKitAccount, c as useGraphAuthKitConnector } from "./hooks-
|
|
5
|
-
import { e as e3, d as d4, g as g3, u as u3, a as a4, h as h3, i as i3, f as f3 } from "./hooks-
|
|
2
|
+
import { b as b2, c as c2, g as g2, h as h2, d as d2, a as a2, e as e2, f as f2, i as i2, m as m2 } from "./GraphAuthKitInner.context-BvAxo6i8.js";
|
|
3
|
+
import { G as G2, a as a3, M as M2, b as b3, d as d3, u as u2 } from "./utils-BBVQP8l4.js";
|
|
4
|
+
import { b as useGraphAuthKitAccount, c as useGraphAuthKitConnector } from "./hooks-0pNjHb5c.js";
|
|
5
|
+
import { e as e3, d as d4, g as g3, u as u3, a as a4, h as h3, i as i3, f as f3 } from "./hooks-0pNjHb5c.js";
|
|
6
6
|
import { jsx, jsxs } from "@theme-ui/core/jsx-runtime";
|
|
7
7
|
import { useConfig, useSwitchChain } from "wagmi";
|
|
8
8
|
import { Alert, ExperimentalButton } from "@edgeandnode/gds";
|
|
@@ -5,7 +5,7 @@ import { injected, walletConnect, coinbaseWallet, mock } from "wagmi/connectors"
|
|
|
5
5
|
import { v as GraphAuthKitConnector, o as L2Chain, S as SafeSupportedNetworks, a as SafeSupportedNetworkNames, j as buildPublicClient, L as L1Chain, n as L1ChainTestnet, d as isValidSafe, p as L2ChainTestnet, D as DefChain, l as buildClient, m as AUTH_STORAGE_KEY, R as RequiredInfuraKey, O as OptionalGatewayApiKey, q as SupportedClientChainId } from "./utils-CWqavpCw.js";
|
|
6
6
|
import { useState, useReducer, useEffect, createContext, useContext } from "react";
|
|
7
7
|
import { Icon, ExperimentalButton, Alert, Divider, Link, ExperimentalSelect, ExperimentalInput, List, ExperimentalModal, ExperimentalLoadingIndicator } from "@edgeandnode/gds";
|
|
8
|
-
import { u as useGraphAuthKitInnerContext, G as GraphAuthKitInnerContextProvider, c as chainIsSupportedChain, j as GraphAuthKitInnerContext, k as defInnerState, b as buildEnsResolver } from "./GraphAuthKitInner.context-
|
|
8
|
+
import { u as useGraphAuthKitInnerContext, G as GraphAuthKitInnerContextProvider, c as chainIsSupportedChain, j as GraphAuthKitInnerContext, k as defInnerState, b as buildEnsResolver } from "./GraphAuthKitInner.context-BvAxo6i8.js";
|
|
9
9
|
import { isAddress } from "viem";
|
|
10
10
|
import { addrShortener } from "@edgeandnode/common";
|
|
11
11
|
import { z } from "zod";
|