@frak-labs/nexus-sdk 0.0.4 → 0.0.6
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/{client-gnNyzrko.d.cts → client-DWLJ8zR-.d.cts} +5 -4
- package/dist/{client-gnNyzrko.d.ts → client-DWLJ8zR-.d.ts} +5 -4
- package/dist/core/actions/index.d.cts +2 -2
- package/dist/core/actions/index.d.ts +2 -2
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/react/index.cjs +3 -3
- package/dist/react/index.d.cts +7 -7
- package/dist/react/index.d.ts +7 -7
- package/dist/react/index.js +3 -3
- package/dist/{watchUnlockStatus-Btjg-WTs.d.ts → watchUnlockStatus--7dFtOJr.d.ts} +1 -1
- package/dist/{watchUnlockStatus-DvDS55TN.d.cts → watchUnlockStatus-B4kRztOM.d.cts} +1 -1
- package/package.json +2 -2
|
@@ -29,6 +29,7 @@ type StartArticleUnlockParams = Readonly<{
|
|
|
29
29
|
articleUrl: string;
|
|
30
30
|
redirectUrl: string;
|
|
31
31
|
previewUrl?: string;
|
|
32
|
+
provider: "le-monde" | "wired" | "l-equipe";
|
|
32
33
|
}>;
|
|
33
34
|
/**
|
|
34
35
|
* Return type of the unlock request
|
|
@@ -69,7 +70,7 @@ type UnlockOptionsReturnType = Readonly<{
|
|
|
69
70
|
*/
|
|
70
71
|
type ArticleUnlockStatusReturnType = Readonly<UnlockStatusLocked | UnlockStatusProcessing | UnlockStatusValid | UnlockStatusError>;
|
|
71
72
|
/**
|
|
72
|
-
* When the content unlocked was expired
|
|
73
|
+
* When the content unlocked was expired or not unlocked
|
|
73
74
|
*/
|
|
74
75
|
type UnlockStatusLocked = {
|
|
75
76
|
key: "expired";
|
|
@@ -80,7 +81,7 @@ type UnlockStatusLocked = {
|
|
|
80
81
|
status: "locked";
|
|
81
82
|
};
|
|
82
83
|
/**
|
|
83
|
-
* When the content
|
|
84
|
+
* When the content unlock is in progress
|
|
84
85
|
*/
|
|
85
86
|
type UnlockStatusProcessing = {
|
|
86
87
|
status: "in-progress";
|
|
@@ -95,7 +96,7 @@ type UnlockStatusProcessing = {
|
|
|
95
96
|
txHash: Hex;
|
|
96
97
|
});
|
|
97
98
|
/**
|
|
98
|
-
* When the content unlocked
|
|
99
|
+
* When the content is unlocked
|
|
99
100
|
*/
|
|
100
101
|
type UnlockStatusValid = {
|
|
101
102
|
key: "valid";
|
|
@@ -103,7 +104,7 @@ type UnlockStatusValid = {
|
|
|
103
104
|
allowedUntil: number;
|
|
104
105
|
};
|
|
105
106
|
/**
|
|
106
|
-
* When the content
|
|
107
|
+
* When the unlock content is in error
|
|
107
108
|
*/
|
|
108
109
|
type UnlockStatusError = {
|
|
109
110
|
key: "error";
|
|
@@ -29,6 +29,7 @@ type StartArticleUnlockParams = Readonly<{
|
|
|
29
29
|
articleUrl: string;
|
|
30
30
|
redirectUrl: string;
|
|
31
31
|
previewUrl?: string;
|
|
32
|
+
provider: "le-monde" | "wired" | "l-equipe";
|
|
32
33
|
}>;
|
|
33
34
|
/**
|
|
34
35
|
* Return type of the unlock request
|
|
@@ -69,7 +70,7 @@ type UnlockOptionsReturnType = Readonly<{
|
|
|
69
70
|
*/
|
|
70
71
|
type ArticleUnlockStatusReturnType = Readonly<UnlockStatusLocked | UnlockStatusProcessing | UnlockStatusValid | UnlockStatusError>;
|
|
71
72
|
/**
|
|
72
|
-
* When the content unlocked was expired
|
|
73
|
+
* When the content unlocked was expired or not unlocked
|
|
73
74
|
*/
|
|
74
75
|
type UnlockStatusLocked = {
|
|
75
76
|
key: "expired";
|
|
@@ -80,7 +81,7 @@ type UnlockStatusLocked = {
|
|
|
80
81
|
status: "locked";
|
|
81
82
|
};
|
|
82
83
|
/**
|
|
83
|
-
* When the content
|
|
84
|
+
* When the content unlock is in progress
|
|
84
85
|
*/
|
|
85
86
|
type UnlockStatusProcessing = {
|
|
86
87
|
status: "in-progress";
|
|
@@ -95,7 +96,7 @@ type UnlockStatusProcessing = {
|
|
|
95
96
|
txHash: Hex;
|
|
96
97
|
});
|
|
97
98
|
/**
|
|
98
|
-
* When the content unlocked
|
|
99
|
+
* When the content is unlocked
|
|
99
100
|
*/
|
|
100
101
|
type UnlockStatusValid = {
|
|
101
102
|
key: "valid";
|
|
@@ -103,7 +104,7 @@ type UnlockStatusValid = {
|
|
|
103
104
|
allowedUntil: number;
|
|
104
105
|
};
|
|
105
106
|
/**
|
|
106
|
-
* When the content
|
|
107
|
+
* When the unlock content is in error
|
|
107
108
|
*/
|
|
108
109
|
type UnlockStatusError = {
|
|
109
110
|
key: "error";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { G as GetUnlockOptionsParams, W as WatchUnlockStatusParams, g as getArticleUnlockOptions, w as watchUnlockStatus } from '../../watchUnlockStatus-
|
|
2
|
-
import { N as NexusClient, W as WalletStatusReturnType, a as NexusWalletSdkConfig, S as StartArticleUnlockReturnType, b as StartArticleUnlockParams } from '../../client-
|
|
1
|
+
export { G as GetUnlockOptionsParams, W as WatchUnlockStatusParams, g as getArticleUnlockOptions, w as watchUnlockStatus } from '../../watchUnlockStatus-B4kRztOM.cjs';
|
|
2
|
+
import { N as NexusClient, W as WalletStatusReturnType, a as NexusWalletSdkConfig, S as StartArticleUnlockReturnType, b as StartArticleUnlockParams } from '../../client-DWLJ8zR-.cjs';
|
|
3
3
|
import 'viem';
|
|
4
4
|
import 'viem/chains';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { G as GetUnlockOptionsParams, W as WatchUnlockStatusParams, g as getArticleUnlockOptions, w as watchUnlockStatus } from '../../watchUnlockStatus
|
|
2
|
-
import { N as NexusClient, W as WalletStatusReturnType, a as NexusWalletSdkConfig, S as StartArticleUnlockReturnType, b as StartArticleUnlockParams } from '../../client-
|
|
1
|
+
export { G as GetUnlockOptionsParams, W as WatchUnlockStatusParams, g as getArticleUnlockOptions, w as watchUnlockStatus } from '../../watchUnlockStatus--7dFtOJr.js';
|
|
2
|
+
import { N as NexusClient, W as WalletStatusReturnType, a as NexusWalletSdkConfig, S as StartArticleUnlockReturnType, b as StartArticleUnlockParams } from '../../client-DWLJ8zR-.js';
|
|
3
3
|
import 'viem';
|
|
4
4
|
import 'viem/chains';
|
|
5
5
|
|
package/dist/core/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as NexusWalletSdkConfig, N as NexusClient, E as ExtractedParametersFromRpc, I as IFrameRpcSchema, c as ExtractedReturnTypeFromRpc, R as RedirectRpcSchema } from '../client-
|
|
2
|
-
export { A as ArticleUnlockStatusReturnType, f as IFrameEvent, e as IFrameRpcEvent, d as IFrameTransport, P as PaidArticleUnlockPrice, b as StartArticleUnlockParams, S as StartArticleUnlockReturnType, U as UnlockOptionsReturnType, W as WalletStatusReturnType } from '../client-
|
|
1
|
+
import { a as NexusWalletSdkConfig, N as NexusClient, E as ExtractedParametersFromRpc, I as IFrameRpcSchema, c as ExtractedReturnTypeFromRpc, R as RedirectRpcSchema } from '../client-DWLJ8zR-.cjs';
|
|
2
|
+
export { A as ArticleUnlockStatusReturnType, f as IFrameEvent, e as IFrameRpcEvent, d as IFrameTransport, P as PaidArticleUnlockPrice, b as StartArticleUnlockParams, S as StartArticleUnlockReturnType, U as UnlockOptionsReturnType, W as WalletStatusReturnType } from '../client-DWLJ8zR-.cjs';
|
|
3
3
|
import 'viem';
|
|
4
4
|
import 'viem/chains';
|
|
5
5
|
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as NexusWalletSdkConfig, N as NexusClient, E as ExtractedParametersFromRpc, I as IFrameRpcSchema, c as ExtractedReturnTypeFromRpc, R as RedirectRpcSchema } from '../client-
|
|
2
|
-
export { A as ArticleUnlockStatusReturnType, f as IFrameEvent, e as IFrameRpcEvent, d as IFrameTransport, P as PaidArticleUnlockPrice, b as StartArticleUnlockParams, S as StartArticleUnlockReturnType, U as UnlockOptionsReturnType, W as WalletStatusReturnType } from '../client-
|
|
1
|
+
import { a as NexusWalletSdkConfig, N as NexusClient, E as ExtractedParametersFromRpc, I as IFrameRpcSchema, c as ExtractedReturnTypeFromRpc, R as RedirectRpcSchema } from '../client-DWLJ8zR-.js';
|
|
2
|
+
export { A as ArticleUnlockStatusReturnType, f as IFrameEvent, e as IFrameRpcEvent, d as IFrameTransport, P as PaidArticleUnlockPrice, b as StartArticleUnlockParams, S as StartArticleUnlockReturnType, U as UnlockOptionsReturnType, W as WalletStatusReturnType } from '../client-DWLJ8zR-.js';
|
|
3
3
|
import 'viem';
|
|
4
4
|
import 'viem/chains';
|
|
5
5
|
|
package/dist/react/index.cjs
CHANGED
|
@@ -122,7 +122,7 @@ function NexusIFrameClientProvider({
|
|
|
122
122
|
children
|
|
123
123
|
}) {
|
|
124
124
|
const config = useNexusConfig();
|
|
125
|
-
const [iframeElem,
|
|
125
|
+
const [iframeElem, setIframeElem] = _react.useState.call(void 0,
|
|
126
126
|
void 0
|
|
127
127
|
);
|
|
128
128
|
const client = _react.useMemo.call(void 0,
|
|
@@ -143,10 +143,10 @@ function NexusIFrameClientProvider({
|
|
|
143
143
|
},
|
|
144
144
|
ref: (iframe) => {
|
|
145
145
|
if (!iframe) {
|
|
146
|
-
|
|
146
|
+
setIframeElem(void 0);
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
|
-
|
|
149
|
+
setIframeElem(iframe);
|
|
150
150
|
}
|
|
151
151
|
});
|
|
152
152
|
const providerComponent = _react.createElement.call(void 0,
|
package/dist/react/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { PropsWithChildren, ReactNode } from 'react';
|
|
3
|
-
import { a as NexusWalletSdkConfig, N as NexusClient, W as WalletStatusReturnType, A as ArticleUnlockStatusReturnType } from '../client-
|
|
4
|
-
import * as
|
|
5
|
-
import { G as GetUnlockOptionsParams, W as WatchUnlockStatusParams } from '../watchUnlockStatus-
|
|
3
|
+
import { a as NexusWalletSdkConfig, N as NexusClient, W as WalletStatusReturnType, A as ArticleUnlockStatusReturnType } from '../client-DWLJ8zR-.cjs';
|
|
4
|
+
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
5
|
+
import { G as GetUnlockOptionsParams, W as WatchUnlockStatusParams } from '../watchUnlockStatus-B4kRztOM.cjs';
|
|
6
6
|
import 'viem';
|
|
7
7
|
import 'viem/chains';
|
|
8
8
|
|
|
@@ -70,7 +70,7 @@ declare function useNexusClient(): NexusClient;
|
|
|
70
70
|
/**
|
|
71
71
|
* Hook used to get the unlock options for an article
|
|
72
72
|
*/
|
|
73
|
-
declare function useArticleUnlockOptions({ articleId }: GetUnlockOptionsParams):
|
|
73
|
+
declare function useArticleUnlockOptions({ articleId }: GetUnlockOptionsParams): _tanstack_react_query.UseQueryResult<Readonly<{
|
|
74
74
|
prices: {
|
|
75
75
|
index: number;
|
|
76
76
|
unlockDurationInSec: number;
|
|
@@ -85,15 +85,15 @@ type WalletStatusQueryReturnType = WalletStatusReturnType | {
|
|
|
85
85
|
/**
|
|
86
86
|
* Hooks used to listen to the current wallet status
|
|
87
87
|
*/
|
|
88
|
-
declare function useWalletStatus():
|
|
88
|
+
declare function useWalletStatus(): _tanstack_react_query.UseQueryResult<WalletStatusQueryReturnType, Error>;
|
|
89
89
|
|
|
90
90
|
type ArticleUnlockStatusQueryReturnType = ArticleUnlockStatusReturnType | {
|
|
91
91
|
status: "waiting-response";
|
|
92
92
|
key: "waiting-response";
|
|
93
93
|
};
|
|
94
94
|
/**
|
|
95
|
-
* Hooks used to listen to the current
|
|
95
|
+
* Hooks used to listen to the current article unlock status
|
|
96
96
|
*/
|
|
97
|
-
declare function useArticleUnlockStatus({ articleId }: WatchUnlockStatusParams):
|
|
97
|
+
declare function useArticleUnlockStatus({ articleId }: WatchUnlockStatusParams): _tanstack_react_query.UseQueryResult<ArticleUnlockStatusQueryReturnType, Error>;
|
|
98
98
|
|
|
99
99
|
export { type ArticleUnlockStatusQueryReturnType, NexusConfigContext, NexusConfigProvider, type NexusConfigProviderProps, NexusIFrameClientContext, type NexusIFrameClientProps, NexusIFrameClientProvider, type WalletStatusQueryReturnType, useArticleUnlockOptions, useArticleUnlockStatus, useNexusClient, useNexusConfig, useWalletStatus };
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { PropsWithChildren, ReactNode } from 'react';
|
|
3
|
-
import { a as NexusWalletSdkConfig, N as NexusClient, W as WalletStatusReturnType, A as ArticleUnlockStatusReturnType } from '../client-
|
|
4
|
-
import * as
|
|
5
|
-
import { G as GetUnlockOptionsParams, W as WatchUnlockStatusParams } from '../watchUnlockStatus
|
|
3
|
+
import { a as NexusWalletSdkConfig, N as NexusClient, W as WalletStatusReturnType, A as ArticleUnlockStatusReturnType } from '../client-DWLJ8zR-.js';
|
|
4
|
+
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
5
|
+
import { G as GetUnlockOptionsParams, W as WatchUnlockStatusParams } from '../watchUnlockStatus--7dFtOJr.js';
|
|
6
6
|
import 'viem';
|
|
7
7
|
import 'viem/chains';
|
|
8
8
|
|
|
@@ -70,7 +70,7 @@ declare function useNexusClient(): NexusClient;
|
|
|
70
70
|
/**
|
|
71
71
|
* Hook used to get the unlock options for an article
|
|
72
72
|
*/
|
|
73
|
-
declare function useArticleUnlockOptions({ articleId }: GetUnlockOptionsParams):
|
|
73
|
+
declare function useArticleUnlockOptions({ articleId }: GetUnlockOptionsParams): _tanstack_react_query.UseQueryResult<Readonly<{
|
|
74
74
|
prices: {
|
|
75
75
|
index: number;
|
|
76
76
|
unlockDurationInSec: number;
|
|
@@ -85,15 +85,15 @@ type WalletStatusQueryReturnType = WalletStatusReturnType | {
|
|
|
85
85
|
/**
|
|
86
86
|
* Hooks used to listen to the current wallet status
|
|
87
87
|
*/
|
|
88
|
-
declare function useWalletStatus():
|
|
88
|
+
declare function useWalletStatus(): _tanstack_react_query.UseQueryResult<WalletStatusQueryReturnType, Error>;
|
|
89
89
|
|
|
90
90
|
type ArticleUnlockStatusQueryReturnType = ArticleUnlockStatusReturnType | {
|
|
91
91
|
status: "waiting-response";
|
|
92
92
|
key: "waiting-response";
|
|
93
93
|
};
|
|
94
94
|
/**
|
|
95
|
-
* Hooks used to listen to the current
|
|
95
|
+
* Hooks used to listen to the current article unlock status
|
|
96
96
|
*/
|
|
97
|
-
declare function useArticleUnlockStatus({ articleId }: WatchUnlockStatusParams):
|
|
97
|
+
declare function useArticleUnlockStatus({ articleId }: WatchUnlockStatusParams): _tanstack_react_query.UseQueryResult<ArticleUnlockStatusQueryReturnType, Error>;
|
|
98
98
|
|
|
99
99
|
export { type ArticleUnlockStatusQueryReturnType, NexusConfigContext, NexusConfigProvider, type NexusConfigProviderProps, NexusIFrameClientContext, type NexusIFrameClientProps, NexusIFrameClientProvider, type WalletStatusQueryReturnType, useArticleUnlockOptions, useArticleUnlockStatus, useNexusClient, useNexusConfig, useWalletStatus };
|
package/dist/react/index.js
CHANGED
|
@@ -122,7 +122,7 @@ function NexusIFrameClientProvider({
|
|
|
122
122
|
children
|
|
123
123
|
}) {
|
|
124
124
|
const config = useNexusConfig();
|
|
125
|
-
const [iframeElem,
|
|
125
|
+
const [iframeElem, setIframeElem] = useState(
|
|
126
126
|
void 0
|
|
127
127
|
);
|
|
128
128
|
const client = useMemo(
|
|
@@ -143,10 +143,10 @@ function NexusIFrameClientProvider({
|
|
|
143
143
|
},
|
|
144
144
|
ref: (iframe) => {
|
|
145
145
|
if (!iframe) {
|
|
146
|
-
|
|
146
|
+
setIframeElem(void 0);
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
|
-
|
|
149
|
+
setIframeElem(iframe);
|
|
150
150
|
}
|
|
151
151
|
});
|
|
152
152
|
const providerComponent = createElement2(
|
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.6",
|
|
15
15
|
"description": "Nexus 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": "https://github.com/frak-id/wallet",
|
|
17
17
|
"homepage": "https://docs.frak.id/wallet-sdk",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"js-sha256": "^0.11.0"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@tanstack/react-query": ">=5.
|
|
75
|
+
"@tanstack/react-query": ">=5.28.6",
|
|
76
76
|
"@types/node": "^20",
|
|
77
77
|
"tsup": "^8.0.2",
|
|
78
78
|
"typescript": "^5"
|