@getpara/wagmi-v2-integration 2.0.0-dev.5 → 2.0.0-dev.7
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/connectorModal.d.ts +2 -1
- package/dist/index.js +15 -11
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/paraConnector.d.ts +3 -1
- package/package.json +2 -1
package/dist/connectorModal.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import ParaWeb from '@getpara/react-sdk';
|
|
2
2
|
import { ParaModalPropsForInit } from './paraConnector.js';
|
|
3
|
-
|
|
3
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
4
|
+
export declare function renderModal(para: ParaWeb, modalProps: Partial<ParaModalPropsForInit>, onCloseArg: () => void, queryClient: QueryClient): void;
|
package/dist/index.js
CHANGED
|
@@ -57,9 +57,10 @@ import { createParaConnector } from "@getpara/wagmi-v2-connector";
|
|
|
57
57
|
|
|
58
58
|
// src/connectorModal.tsx
|
|
59
59
|
import { ParaProvider, setIsOpen } from "@getpara/react-sdk";
|
|
60
|
+
import { QueryClientProvider } from "@tanstack/react-query";
|
|
60
61
|
import { jsx } from "react/jsx-runtime";
|
|
61
|
-
var
|
|
62
|
-
function renderModal(para, modalProps, onCloseArg) {
|
|
62
|
+
var Root;
|
|
63
|
+
function renderModal(para, modalProps, onCloseArg, queryClient) {
|
|
63
64
|
const existingContainer = document.getElementById("para-modal");
|
|
64
65
|
const container = existingContainer != null ? existingContainer : document.createElement("div");
|
|
65
66
|
container.id = "para-modal";
|
|
@@ -76,22 +77,23 @@ function renderModal(para, modalProps, onCloseArg) {
|
|
|
76
77
|
if (typeof document === "undefined") {
|
|
77
78
|
return;
|
|
78
79
|
}
|
|
79
|
-
const Modal = /* @__PURE__ */ jsx(
|
|
80
|
+
const Modal = /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx(
|
|
80
81
|
ParaProvider,
|
|
81
82
|
{
|
|
82
83
|
paraClientConfig: para,
|
|
83
84
|
config: { appName: (_a = modalProps.appName) != null ? _a : "" },
|
|
84
85
|
paraModalConfig: __spreadProps(__spreadValues({}, modalProps), { onClose })
|
|
85
86
|
}
|
|
86
|
-
);
|
|
87
|
+
) });
|
|
87
88
|
try {
|
|
88
|
-
const
|
|
89
|
-
if (!
|
|
90
|
-
|
|
89
|
+
const client = yield import("react-dom/client");
|
|
90
|
+
if (!Root) {
|
|
91
|
+
Root = client.createRoot(container);
|
|
91
92
|
}
|
|
93
|
+
Root.render(Modal);
|
|
92
94
|
} catch (e) {
|
|
93
95
|
const ReactDOM = yield import("react-dom");
|
|
94
|
-
ReactDOM.
|
|
96
|
+
ReactDOM.render(Modal, container);
|
|
95
97
|
}
|
|
96
98
|
});
|
|
97
99
|
render();
|
|
@@ -109,7 +111,8 @@ var paraConnector = (_a) => {
|
|
|
109
111
|
nameOverride,
|
|
110
112
|
idOverride,
|
|
111
113
|
transports,
|
|
112
|
-
appName
|
|
114
|
+
appName,
|
|
115
|
+
queryClient
|
|
113
116
|
} = _b, modalProps = __objRest(_b, [
|
|
114
117
|
"para",
|
|
115
118
|
"chains",
|
|
@@ -120,7 +123,8 @@ var paraConnector = (_a) => {
|
|
|
120
123
|
"nameOverride",
|
|
121
124
|
"idOverride",
|
|
122
125
|
"transports",
|
|
123
|
-
"appName"
|
|
126
|
+
"appName",
|
|
127
|
+
"queryClient"
|
|
124
128
|
]);
|
|
125
129
|
return createParaConnector({
|
|
126
130
|
para,
|
|
@@ -133,7 +137,7 @@ var paraConnector = (_a) => {
|
|
|
133
137
|
idOverride,
|
|
134
138
|
transports,
|
|
135
139
|
appName,
|
|
136
|
-
renderModal: (onClose) => renderModal(para, __spreadProps(__spreadValues({}, modalProps), { appName }), onClose),
|
|
140
|
+
renderModal: (onClose) => renderModal(para, __spreadProps(__spreadValues({}, modalProps), { appName }), onClose, queryClient),
|
|
137
141
|
openModal: () => {
|
|
138
142
|
setIsOpen2(true);
|
|
139
143
|
}
|
package/dist/index.js.br
CHANGED
|
Binary file
|
package/dist/index.js.gz
CHANGED
|
Binary file
|
package/dist/paraConnector.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ParaModalProps } from '@getpara/react-sdk';
|
|
2
2
|
import { ParaConnectorOpts as ParaConnectorOptsBase } from '@getpara/wagmi-v2-connector';
|
|
3
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
3
4
|
export type ParaModalPropsForInit = Omit<ParaModalProps, 'isOpen' | 'para'> & {
|
|
4
5
|
appName: string;
|
|
6
|
+
queryClient: QueryClient;
|
|
5
7
|
};
|
|
6
8
|
type ParaConnectorOpts = Partial<ParaModalPropsForInit> & ParaConnectorOptsBase;
|
|
7
|
-
export declare const paraConnector: ({ para, chains: _chains, disableModal, storageOverride, options, iconOverride, nameOverride, idOverride, transports, appName, ...modalProps }: ParaConnectorOpts) => import("wagmi").CreateConnectorFn<unknown, {
|
|
9
|
+
export declare const paraConnector: ({ para, chains: _chains, disableModal, storageOverride, options, iconOverride, nameOverride, idOverride, transports, appName, queryClient, ...modalProps }: ParaConnectorOpts) => import("wagmi").CreateConnectorFn<unknown, {
|
|
8
10
|
type: string;
|
|
9
11
|
name: string;
|
|
10
12
|
icon: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/wagmi-v2-integration",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"typescript": "5.1.6"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
+
"@tanstack/react-query": "^5.0.0",
|
|
20
21
|
"react": "*",
|
|
21
22
|
"react-dom": "*"
|
|
22
23
|
},
|