@frak-labs/nexus-sdk 0.0.15 → 0.0.16
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/{NexusContext-CSlCNW-G.d.cts → FrakContext-LbQht1ep.d.cts} +2 -2
- package/dist/{NexusContext-CSlCNW-G.d.ts → FrakContext-LbQht1ep.d.ts} +2 -2
- package/dist/bundle/bundle.js +3 -3
- package/dist/{chunk-C25NTD45.cjs → chunk-A3XYA7S7.cjs} +28 -14
- package/dist/{chunk-ARQTOP44.js → chunk-AHUMDUJC.js} +1 -1
- package/dist/{chunk-VMNURFPI.js → chunk-D77BTQYS.js} +19 -16
- package/dist/{chunk-4ADWI2GG.cjs → chunk-DAGCBEBQ.cjs} +18 -18
- package/dist/{chunk-KEATMEOW.cjs → chunk-FO2GFD5C.cjs} +26 -23
- package/dist/{chunk-2LAGZ6S5.js → chunk-FYMOOHMT.js} +35 -27
- package/dist/{chunk-K4FOGADW.js → chunk-HY6YATLS.js} +3 -1
- package/dist/{chunk-4LT3U3H4.cjs → chunk-J655X6YR.cjs} +38 -30
- package/dist/{chunk-I47XQDS3.js → chunk-TIKEZMSD.js} +16 -2
- package/dist/{chunk-DILTMQBI.cjs → chunk-UFJ7W6CQ.cjs} +3 -1
- package/dist/{client-B3Guoe3I.d.ts → client-ALy_TEwJ.d.ts} +28 -8
- package/dist/{client-Of9uIxuI.d.cts → client-DaEox5q4.d.cts} +28 -8
- package/dist/core/actions/index.cjs +5 -5
- package/dist/core/actions/index.d.cts +6 -7
- package/dist/core/actions/index.d.ts +6 -7
- package/dist/core/actions/index.js +4 -4
- package/dist/core/index.cjs +10 -4
- package/dist/core/index.d.cts +41 -9
- package/dist/core/index.d.ts +41 -9
- package/dist/core/index.js +11 -5
- package/dist/core/interactions/index.cjs +5 -3
- package/dist/core/interactions/index.d.cts +9 -1
- package/dist/core/interactions/index.d.ts +9 -1
- package/dist/core/interactions/index.js +6 -4
- package/dist/react/index.cjs +34 -34
- package/dist/react/index.d.cts +3 -3
- package/dist/react/index.d.ts +3 -3
- package/dist/react/index.js +16 -16
- package/dist/{sendTransaction-3d8jO9CJ.d.ts → sendTransaction-BOd-pvXr.d.ts} +2 -2
- package/dist/{sendTransaction-Cz6FoB9_.d.cts → sendTransaction-MhdJPTWd.d.cts} +2 -2
- package/package.json +3 -3
package/dist/react/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createIFrameNexusClient
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-AHUMDUJC.js";
|
|
4
4
|
import {
|
|
5
5
|
displayModal,
|
|
6
6
|
openSso,
|
|
@@ -9,16 +9,16 @@ import {
|
|
|
9
9
|
sendTransaction,
|
|
10
10
|
siweAuthenticate,
|
|
11
11
|
walletStatus
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-D77BTQYS.js";
|
|
13
13
|
import {
|
|
14
14
|
ClientNotFound,
|
|
15
|
+
FrakContextManager,
|
|
15
16
|
FrakRpcError,
|
|
16
|
-
NexusContextManager,
|
|
17
17
|
RpcErrorCodes,
|
|
18
18
|
baseIframeProps
|
|
19
|
-
} from "../chunk-
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
19
|
+
} from "../chunk-FYMOOHMT.js";
|
|
20
|
+
import "../chunk-TIKEZMSD.js";
|
|
21
|
+
import "../chunk-HY6YATLS.js";
|
|
22
22
|
|
|
23
23
|
// src/react/provider/NexusConfigProvider.ts
|
|
24
24
|
import { createContext, createElement } from "react";
|
|
@@ -136,7 +136,7 @@ function useSiweAuthenticate({
|
|
|
136
136
|
import { useQuery as useQuery3 } from "@tanstack/react-query";
|
|
137
137
|
import { useMemo as useMemo2 } from "react";
|
|
138
138
|
|
|
139
|
-
// src/react/hook/utils/
|
|
139
|
+
// src/react/hook/utils/useFrakContext.ts
|
|
140
140
|
import { useMutation as useMutation3, useQuery as useQuery2 } from "@tanstack/react-query";
|
|
141
141
|
|
|
142
142
|
// src/react/hook/utils/useWindowLocation.ts
|
|
@@ -175,14 +175,14 @@ function useWindowLocation() {
|
|
|
175
175
|
return { location, href };
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
// src/react/hook/utils/
|
|
179
|
-
function
|
|
178
|
+
// src/react/hook/utils/useFrakContext.ts
|
|
179
|
+
function useFrakContext() {
|
|
180
180
|
const { location } = useWindowLocation();
|
|
181
|
-
const { data:
|
|
181
|
+
const { data: frakContext } = useQuery2({
|
|
182
182
|
queryKey: ["nexus-sdk", "context", location?.href ?? "no-href"],
|
|
183
183
|
queryFn: async () => {
|
|
184
184
|
if (!location?.href) return null;
|
|
185
|
-
return
|
|
185
|
+
return FrakContextManager.parse({ url: location.href });
|
|
186
186
|
},
|
|
187
187
|
enabled: !!location?.href
|
|
188
188
|
});
|
|
@@ -190,14 +190,14 @@ function useNexusContext() {
|
|
|
190
190
|
mutationKey: ["nexus-sdk", "update-context"],
|
|
191
191
|
mutationFn: async (newContext) => {
|
|
192
192
|
console.log("Updating context", { newContext });
|
|
193
|
-
await
|
|
193
|
+
await FrakContextManager.replaceUrl({
|
|
194
194
|
url: location?.href,
|
|
195
195
|
context: newContext
|
|
196
196
|
});
|
|
197
197
|
}
|
|
198
198
|
});
|
|
199
199
|
return {
|
|
200
|
-
|
|
200
|
+
frakContext,
|
|
201
201
|
updateContext,
|
|
202
202
|
updateContextAsync
|
|
203
203
|
};
|
|
@@ -209,7 +209,7 @@ function useReferralInteraction({
|
|
|
209
209
|
modalConfig
|
|
210
210
|
} = {}) {
|
|
211
211
|
const client = useNexusClient();
|
|
212
|
-
const {
|
|
212
|
+
const { frakContext } = useFrakContext();
|
|
213
213
|
const { data: walletStatus2 } = useWalletStatus();
|
|
214
214
|
const {
|
|
215
215
|
data: referralState,
|
|
@@ -221,7 +221,7 @@ function useReferralInteraction({
|
|
|
221
221
|
queryKey: [
|
|
222
222
|
"nexus-sdk",
|
|
223
223
|
"auto-referral-interaction",
|
|
224
|
-
|
|
224
|
+
frakContext?.r ?? "no-referrer",
|
|
225
225
|
walletStatus2?.key ?? "no-wallet-status",
|
|
226
226
|
productId ?? "no-product-id"
|
|
227
227
|
],
|
|
@@ -231,7 +231,7 @@ function useReferralInteraction({
|
|
|
231
231
|
}
|
|
232
232
|
return processReferral(client, {
|
|
233
233
|
walletStatus: walletStatus2,
|
|
234
|
-
|
|
234
|
+
frakContext,
|
|
235
235
|
modalConfig,
|
|
236
236
|
productId
|
|
237
237
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as SiweAuthenticationParams, b as ModalRpcMetadata, a as NexusClient, h as SiweAuthenticateReturnType, j as SendTransactionModalStepType, k as SendTransactionReturnType } from './client-ALy_TEwJ.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Partial SIWE params, since we can rebuild them from the SDK if they are empty
|
|
@@ -27,4 +27,4 @@ type SendTransactionParams = {
|
|
|
27
27
|
*/
|
|
28
28
|
declare function sendTransaction(client: NexusClient, { tx, metadata }: SendTransactionParams): Promise<SendTransactionReturnType>;
|
|
29
29
|
|
|
30
|
-
export { type
|
|
30
|
+
export { type SendTransactionParams as S, type SiweAuthenticateModalParams as a, sendTransaction as b, siweAuthenticate as s };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as SiweAuthenticationParams, b as ModalRpcMetadata, a as NexusClient, h as SiweAuthenticateReturnType, j as SendTransactionModalStepType, k as SendTransactionReturnType } from './client-DaEox5q4.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Partial SIWE params, since we can rebuild them from the SDK if they are empty
|
|
@@ -27,4 +27,4 @@ type SendTransactionParams = {
|
|
|
27
27
|
*/
|
|
28
28
|
declare function sendTransaction(client: NexusClient, { tx, metadata }: SendTransactionParams): Promise<SendTransactionReturnType>;
|
|
29
29
|
|
|
30
|
-
export { type
|
|
30
|
+
export { type SendTransactionParams as S, type SiweAuthenticateModalParams as a, sendTransaction as b, siweAuthenticate as s };
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"url": "https://twitter.com/QNivelais"
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
|
-
"version": "0.0.
|
|
14
|
+
"version": "0.0.16",
|
|
15
15
|
"description": "Frak Wallet client SDK, helping any person to interact with the Frak wallet, and require the unlock of a premium article within the Frak ecosystem.",
|
|
16
16
|
"repository": {
|
|
17
17
|
"url": "https://github.com/frak-id/wallet",
|
|
@@ -81,9 +81,9 @@
|
|
|
81
81
|
"js-sha256": "^0.11.0"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
|
-
"@tanstack/react-query": ">=5.
|
|
84
|
+
"@tanstack/react-query": ">=5.59.15",
|
|
85
85
|
"@types/node": "^22",
|
|
86
|
-
"tsup": "^8.
|
|
86
|
+
"tsup": "^8.3.0",
|
|
87
87
|
"typescript": "^5"
|
|
88
88
|
}
|
|
89
89
|
}
|