@edgeandnode/graph-auth-kit 7.5.0-states-1762442220508-888452cdd9c03ff4cf758190cb03eac321327dbd → 7.6.0-upgrade-safe-auth-kit-1764978260567-c31bac8b22a141997a5895a6694543a4e660027a
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/GraphAuthKit.context.d.ts +3 -0
- package/dist/GraphAuthKit.context.d.ts.map +1 -1
- package/dist/{GraphAuthKitInner.context-4tahCZlU.js → GraphAuthKitInner.context-C5MOzchk.js} +29 -20
- package/dist/client.d.ts +3813 -102
- package/dist/client.d.ts.map +1 -1
- package/dist/constants.d.ts +2 -2
- package/dist/ens/index.js +1 -1
- package/dist/{hooks-CW9U91xq.js → hooks-C4y8dwNT.js} +8 -5
- package/dist/hooks.d.ts.map +1 -1
- package/dist/index.js +17 -16
- package/dist/inner/GraphAuthKitInner.context.d.ts +5 -1
- package/dist/inner/GraphAuthKitInner.context.d.ts.map +1 -1
- package/dist/inner/hooks.d.ts.map +1 -1
- package/dist/safe/SafeEthersSigner.d.ts +1 -0
- package/dist/safe/SafeEthersSigner.d.ts.map +1 -1
- package/dist/safe/index.js +3 -3
- package/dist/safe/utils.d.ts +1 -1
- package/dist/safe/utils.d.ts.map +1 -1
- package/dist/test-harness/index.js +1 -1
- package/dist/test-harness/utils.d.ts +2 -2
- package/dist/types.d.ts +5 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/{useGraphAuthKitEnsNames-DSfxgVd2.js → useGraphAuthKitEnsNames-IEJib_9F.js} +2 -2
- package/dist/{useWaitForSafeTransaction-qzXyQLlA.js → useWaitForSafeTransaction-CQ2jQA-M.js} +2 -2
- package/dist/{utils-DhU0bGPc.js → utils-BuAt-Vrk.js} +5 -4
- package/package.json +17 -17
|
@@ -26,6 +26,7 @@ export type GraphAuthKitProviderProps<config extends Config = ResolvedRegister['
|
|
|
26
26
|
* If null, will instantiate a `QueryClient` and pass to the `QueryClientProvider`.
|
|
27
27
|
*/
|
|
28
28
|
queryClient?: QueryClient;
|
|
29
|
+
safeApiKey?: string;
|
|
29
30
|
} & Readonly<{
|
|
30
31
|
children: ReactNode;
|
|
31
32
|
}>;
|
|
@@ -57,6 +58,7 @@ export type GraphAuthKitProviderProps<config extends Config = ResolvedRegister['
|
|
|
57
58
|
* const infuraKey = process.env.INFURA_KEY!
|
|
58
59
|
* const walletConnectProjectID = process.env.WALLETCONNECT_PROJECT_ID!
|
|
59
60
|
* const gatewayApiKey = process.env.GATEWAY_API_KEY
|
|
61
|
+
* const safeApiKey = process.env.SAFE_API_KEY
|
|
60
62
|
*
|
|
61
63
|
* const config = createConfig({
|
|
62
64
|
* chains: [L2Chain, L1Chain] as const,
|
|
@@ -116,6 +118,7 @@ export type GraphAuthKitProviderProps<config extends Config = ResolvedRegister['
|
|
|
116
118
|
* queryClient={queryClient.current}
|
|
117
119
|
* infuraKey={infuraKey}
|
|
118
120
|
* gatewayApiKey={gatewayApiKey}
|
|
121
|
+
* safeApiKey={safeApiKey}
|
|
119
122
|
* >
|
|
120
123
|
* <Component {...pageProps} />
|
|
121
124
|
* </GraphAuthKitProvider>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphAuthKit.context.d.ts","sourceRoot":"","sources":["../src/GraphAuthKit.context.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAuB,MAAM,uBAAuB,CAAA;AACxE,OAAO,EAAiB,KAAK,SAAS,EAAc,MAAM,OAAO,CAAA;AACjE,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,gBAAgB,EAAgC,MAAM,OAAO,CAAA;AAIxF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAEhD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,2FAA2F;IAC3F,gBAAgB,CAAC,KAAK,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,SAAS,CAAC;QAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;Q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,MAAM,yBAAyB,CAAC,MAAM,SAAS,MAAM,GAAG,gBAAgB,CAAC,QAAQ,CAAC,IAAI,iBAAiB,GAAG;IAC9G;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,GAAG,QAAQ,CAAC;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,CAAC,CAAA;AACrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+FG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,CAAC,MAAM,SAAS,MAAM,GAAG,gBAAgB,CAAC,QAAQ,CAAC,EAC3F,KAAK,EAAE,yBAAyB,CAAC,MAAM,CAAC,2CA0BzC"}
|
package/dist/{GraphAuthKitInner.context-4tahCZlU.js → GraphAuthKitInner.context-C5MOzchk.js}
RENAMED
|
@@ -8,6 +8,7 @@ import { z } from "zod";
|
|
|
8
8
|
import { l1Mainnet, l1Testnet, l2Mainnet, l2Testnet } from "@edgeandnode/common";
|
|
9
9
|
import { mainnet, sepolia, arbitrum, arbitrumSepolia } from "viem/chains";
|
|
10
10
|
import { injected, coinbaseWallet, walletConnect } from "wagmi/connectors";
|
|
11
|
+
import "@safe-global/protocol-kit";
|
|
11
12
|
import { providers } from "ethers";
|
|
12
13
|
const AUTH_STORAGE_KEY = "thegraph__authstate";
|
|
13
14
|
const MULTISIG_AUTH_STORAGE_KEY = "multisig";
|
|
@@ -34,7 +35,10 @@ const RequiredWalletConnectProjectId = z.object({
|
|
|
34
35
|
const OptionalGatewayApiKey = z.object({
|
|
35
36
|
gatewayApiKey: z.string().min(32).max(32).optional().nullable().describe("The Graph Gateway API Key used to query Subgraphs published on The Graph Network")
|
|
36
37
|
});
|
|
37
|
-
const
|
|
38
|
+
const OptionalSafeApiKey = z.object({
|
|
39
|
+
safeApiKey: z.string().min(1).optional().describe("The Safe Transaction Service API Key")
|
|
40
|
+
});
|
|
41
|
+
const GraphAuthKitProps = RequiredInfuraKey.merge(OptionalGatewayApiKey).merge(OptionalSafeApiKey);
|
|
38
42
|
const GraphAuthKitConnector = z.union([
|
|
39
43
|
z.literal(injected.type),
|
|
40
44
|
z.literal(coinbaseWallet.type),
|
|
@@ -216,18 +220,19 @@ const SafeMinimalAbi = [
|
|
|
216
220
|
type: "function"
|
|
217
221
|
}
|
|
218
222
|
];
|
|
219
|
-
async function createApiKit(chainId) {
|
|
223
|
+
async function createApiKit(chainId, apiKey) {
|
|
220
224
|
const { default: SafeApiKit } = await import("@safe-global/api-kit");
|
|
221
225
|
const SafeApiKitClass = typeof SafeApiKit === "function" ? SafeApiKit : SafeApiKit.default;
|
|
222
226
|
const apiKit = new SafeApiKitClass({
|
|
223
227
|
chainId: BigInt(chainId),
|
|
224
|
-
txServiceUrl: ApiKitUrlMap[chainId]
|
|
228
|
+
txServiceUrl: ApiKitUrlMap[chainId],
|
|
229
|
+
apiKey
|
|
225
230
|
});
|
|
226
231
|
return apiKit;
|
|
227
232
|
}
|
|
228
233
|
async function createSafe(config) {
|
|
229
|
-
const { default:
|
|
230
|
-
const SafeClass = typeof
|
|
234
|
+
const { default: Safe2 } = await import("@safe-global/protocol-kit");
|
|
235
|
+
const SafeClass = typeof Safe2 === "function" ? Safe2 : Safe2.default;
|
|
231
236
|
return await SafeClass.init(config);
|
|
232
237
|
}
|
|
233
238
|
async function isValidSafe(args) {
|
|
@@ -348,6 +353,7 @@ const MultisigSchema = z.object({
|
|
|
348
353
|
const defInnerState = {
|
|
349
354
|
_infuraKey: "",
|
|
350
355
|
_gatewayApiKey: null,
|
|
356
|
+
_safeApiKey: void 0,
|
|
351
357
|
// just a default value so that the context can be initialized. overridden in the provider
|
|
352
358
|
_ensResolver: {
|
|
353
359
|
async resolveEnsName() {
|
|
@@ -396,6 +402,7 @@ function GraphAuthKitInnerContextProvider({
|
|
|
396
402
|
config,
|
|
397
403
|
infuraKey,
|
|
398
404
|
gatewayApiKey,
|
|
405
|
+
safeApiKey,
|
|
399
406
|
children
|
|
400
407
|
}) {
|
|
401
408
|
const { connect } = useConnect({ config });
|
|
@@ -534,6 +541,7 @@ function GraphAuthKitInnerContextProvider({
|
|
|
534
541
|
value: {
|
|
535
542
|
_infuraKey: infuraKey,
|
|
536
543
|
_gatewayApiKey: gatewayApiKey,
|
|
544
|
+
_safeApiKey: safeApiKey,
|
|
537
545
|
_ensResolver: buildEnsResolver({ infuraKey, gatewayApiKey }),
|
|
538
546
|
_connectModalOpen,
|
|
539
547
|
_setConnectModalOpen: setConnectModalOpen,
|
|
@@ -575,23 +583,24 @@ function GraphAuthKitInnerContextProvider({
|
|
|
575
583
|
export {
|
|
576
584
|
ApiKitUrlMap as A,
|
|
577
585
|
BuildPublicClientArgs as B,
|
|
578
|
-
|
|
586
|
+
isChainL2 as C,
|
|
579
587
|
DefChain as D,
|
|
580
|
-
|
|
581
|
-
|
|
588
|
+
isChainL1 as E,
|
|
589
|
+
isChainMainnet as F,
|
|
582
590
|
GraphAuthKitProps as G,
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
591
|
+
isChainTestnet as H,
|
|
592
|
+
clientToProvider as I,
|
|
593
|
+
connectedWalletIsEoA as J,
|
|
594
|
+
useGraphAuthKitInnerContext as K,
|
|
587
595
|
L1Chain as L,
|
|
588
596
|
MULTISIG_AUTH_STORAGE_KEY as M,
|
|
589
|
-
|
|
597
|
+
MultisigSchema as N,
|
|
590
598
|
OptionalGatewayApiKey as O,
|
|
591
|
-
|
|
592
|
-
|
|
599
|
+
GraphAuthKitInnerContextProvider as P,
|
|
600
|
+
GraphAuthKitInnerContext as Q,
|
|
593
601
|
RequiredInfuraKey as R,
|
|
594
602
|
SafeSupportedNetworks as S,
|
|
603
|
+
defInnerState as T,
|
|
595
604
|
SafeSupportedNetworkNames as a,
|
|
596
605
|
createSafe as b,
|
|
597
606
|
createApiKit as c,
|
|
@@ -613,9 +622,9 @@ export {
|
|
|
613
622
|
SupportedL1ClientChainId as s,
|
|
614
623
|
SupportedL2ClientChainId as t,
|
|
615
624
|
RequiredWalletConnectProjectId as u,
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
625
|
+
OptionalSafeApiKey as v,
|
|
626
|
+
GraphAuthKitConnector as w,
|
|
627
|
+
chainIsSupportedChain as x,
|
|
628
|
+
isSupportedChainId as y,
|
|
629
|
+
mapChainIdToChain as z
|
|
621
630
|
};
|