@frak-labs/nexus-sdk 0.0.7 → 0.0.9

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Nexus Wallet SDK
2
2
 
3
- This SDK help any dApps, or gated content provider, use the [Nexus Wallet](https://poc-wallet.frak.id/) as a regular wallet, with smoother UX for your end-users (pay for his gas fees, check the paywall options, track his consumption etc.)
3
+ This SDK help any dApps, or gated content provider, use the [Nexus Wallet](https://nexus.frak.id/) as a regular wallet, with smoother UX for your end-users (pay for his gas fees, check the paywall options, track his consumption etc.)
4
4
 
5
5
  Checkout our documentation for more informations about the usage:
6
6
  - [React client usage](https://docs.frak.id/wallet-sdk/how-to/client-react)
@@ -29,11 +29,12 @@ import type { NexusClient, NexusWalletSdkConfig } from "@frak-labs/nexus-sdk/cor
29
29
  // Create the config for the Nexus Wallet SDK
30
30
  export const nexusConfig: NexusWalletSdkConfig = {
31
31
  // The current url for the wallet sdk
32
- walletUrl: "https://poc-wallet.frak.id",
33
- // The content id on which this sdk will be used
34
- contentId: "0xdeadbeef",
35
- // The content title, this will be displayed to the user during a few registration steps
36
- contentTitle: "My dApp content title"
32
+ walletUrl: "https://nexus-dev.frak.id",
33
+ // The name of your dapp
34
+ metadata: {
35
+ // Your app name
36
+ name: string,
37
+ },
37
38
  }
38
39
 
39
40
  // Create the iFrame and the associated NexusClient
@@ -4,18 +4,18 @@
4
4
 
5
5
 
6
6
 
7
- var _chunk2XUJYDD3cjs = require('./chunk-2XUJYDD3.cjs');
7
+ var _chunkZOLP2FJZcjs = require('./chunk-ZOLP2FJZ.cjs');
8
8
 
9
9
  // src/core/utils/Deferred.ts
10
10
  var Deferred = class {
11
11
  constructor() {
12
- _chunk2XUJYDD3cjs.__publicField.call(void 0, this, "_promise");
13
- _chunk2XUJYDD3cjs.__publicField.call(void 0, this, "_resolve");
14
- _chunk2XUJYDD3cjs.__publicField.call(void 0, this, "_reject");
15
- _chunk2XUJYDD3cjs.__publicField.call(void 0, this, "resolve", (value) => {
12
+ _chunkZOLP2FJZcjs.__publicField.call(void 0, this, "_promise");
13
+ _chunkZOLP2FJZcjs.__publicField.call(void 0, this, "_resolve");
14
+ _chunkZOLP2FJZcjs.__publicField.call(void 0, this, "_reject");
15
+ _chunkZOLP2FJZcjs.__publicField.call(void 0, this, "resolve", (value) => {
16
16
  _optionalChain([this, 'access', _ => _._resolve, 'optionalCall', _2 => _2(value)]);
17
17
  });
18
- _chunk2XUJYDD3cjs.__publicField.call(void 0, this, "reject", (reason) => {
18
+ _chunkZOLP2FJZcjs.__publicField.call(void 0, this, "reject", (reason) => {
19
19
  _optionalChain([this, 'access', _3 => _3._reject, 'optionalCall', _4 => _4(reason)]);
20
20
  });
21
21
  this._promise = new Promise((resolve, reject) => {
@@ -109,18 +109,18 @@ function createIFrameNexusClient({
109
109
  throw new Error("The iframe provider isn't connected yet");
110
110
  }
111
111
  const result = new Deferred();
112
- const resultCompressionKeyProvider = _chunk2XUJYDD3cjs.getIFrameResponseKeyProvider.call(void 0, args);
112
+ const resultCompressionKeyProvider = _chunkZOLP2FJZcjs.getIFrameResponseKeyProvider.call(void 0, args);
113
113
  const channelId = channelManager.createChannel(async (message) => {
114
- const decompressed = await _chunk2XUJYDD3cjs.decompressDataAndCheckHash.call(void 0,
114
+ const decompressed = await _chunkZOLP2FJZcjs.decompressDataAndCheckHash.call(void 0,
115
115
  message.data,
116
116
  resultCompressionKeyProvider
117
117
  );
118
118
  result.resolve(decompressed);
119
119
  channelManager.removeChannel(channelId);
120
120
  });
121
- const compressedMessage = await _chunk2XUJYDD3cjs.hashAndCompressData.call(void 0,
121
+ const compressedMessage = await _chunkZOLP2FJZcjs.hashAndCompressData.call(void 0,
122
122
  args,
123
- _chunk2XUJYDD3cjs.iFrameRequestKeyProvider
123
+ _chunkZOLP2FJZcjs.iFrameRequestKeyProvider
124
124
  );
125
125
  messageHandler.sendEvent({
126
126
  id: channelId,
@@ -134,17 +134,17 @@ function createIFrameNexusClient({
134
134
  if (!isConnected) {
135
135
  throw new Error("The iframe provider isn't connected yet");
136
136
  }
137
- const resultCompressionKeyProvider = _chunk2XUJYDD3cjs.getIFrameResponseKeyProvider.call(void 0, args);
137
+ const resultCompressionKeyProvider = _chunkZOLP2FJZcjs.getIFrameResponseKeyProvider.call(void 0, args);
138
138
  const channelId = channelManager.createChannel(async (message) => {
139
- const decompressed = await _chunk2XUJYDD3cjs.decompressDataAndCheckHash.call(void 0,
139
+ const decompressed = await _chunkZOLP2FJZcjs.decompressDataAndCheckHash.call(void 0,
140
140
  message.data,
141
141
  resultCompressionKeyProvider
142
142
  );
143
143
  callback(decompressed);
144
144
  });
145
- const compressedMessage = await _chunk2XUJYDD3cjs.hashAndCompressData.call(void 0,
145
+ const compressedMessage = await _chunkZOLP2FJZcjs.hashAndCompressData.call(void 0,
146
146
  args,
147
- _chunk2XUJYDD3cjs.iFrameRequestKeyProvider
147
+ _chunkZOLP2FJZcjs.iFrameRequestKeyProvider
148
148
  );
149
149
  messageHandler.sendEvent({
150
150
  id: channelId,
@@ -3,22 +3,22 @@ import {
3
3
  getRedirectResponseResponseKeyProvider,
4
4
  hashAndCompressData,
5
5
  redirectRequestKeyProvider
6
- } from "./chunk-5QWG35A2.js";
6
+ } from "./chunk-VK7GPKK4.js";
7
7
 
8
8
  // src/core/actions/getUnlockOptions.ts
9
- function getArticleUnlockOptions(client, { articleId }) {
9
+ function getArticleUnlockOptions(client, { articleId, contentId }) {
10
10
  return client.request({
11
11
  method: "frak_getArticleUnlockOptions",
12
- params: [client.config.contentId, articleId]
12
+ params: [contentId, articleId]
13
13
  });
14
14
  }
15
15
 
16
16
  // src/core/actions/watchUnlockStatus.ts
17
- function watchUnlockStatus(client, { articleId }, callback) {
17
+ function watchUnlockStatus(client, { articleId, contentId }, callback) {
18
18
  return client.listenerRequest(
19
19
  {
20
20
  method: "frak_listenToArticleUnlockStatus",
21
- params: [client.config.contentId, articleId]
21
+ params: [contentId, articleId]
22
22
  },
23
23
  callback
24
24
  );
@@ -39,11 +39,7 @@ async function getStartArticleUnlockUrl(config, params) {
39
39
  const { compressed, compressedHash } = await hashAndCompressData(
40
40
  {
41
41
  method: "frak_startArticleUnlock",
42
- params: {
43
- ...params,
44
- contentId: config.contentId,
45
- contentTitle: config.contentTitle
46
- }
42
+ params
47
43
  },
48
44
  redirectRequestKeyProvider
49
45
  );
@@ -69,10 +65,22 @@ async function decodeStartUnlockReturn({
69
65
  );
70
66
  }
71
67
 
68
+ // src/core/actions/setUserReferred.ts
69
+ function setUserReferred(client, { contentId, walletAddress }, callback) {
70
+ return client.listenerRequest(
71
+ {
72
+ method: "frak_listenToSetUserReferred",
73
+ params: [contentId, walletAddress]
74
+ },
75
+ callback
76
+ );
77
+ }
78
+
72
79
  export {
73
80
  getArticleUnlockOptions,
74
81
  watchUnlockStatus,
75
82
  watchWalletStatus,
76
83
  getStartArticleUnlockUrl,
77
- decodeStartUnlockReturn
84
+ decodeStartUnlockReturn,
85
+ setUserReferred
78
86
  };
@@ -4,7 +4,7 @@ import {
4
4
  getIFrameResponseKeyProvider,
5
5
  hashAndCompressData,
6
6
  iFrameRequestKeyProvider
7
- } from "./chunk-5QWG35A2.js";
7
+ } from "./chunk-VK7GPKK4.js";
8
8
 
9
9
  // src/core/utils/Deferred.ts
10
10
  var Deferred = class {
@@ -74,6 +74,9 @@ var iFrameRequestKeyProvider = (args) => {
74
74
  if (args.method === "frak_listenToArticleUnlockStatus") {
75
75
  return ["article-unlock-status", args.params[0], args.params[1]];
76
76
  }
77
+ if (args.method === "frak_listenToSetUserReferred") {
78
+ return ["user-referred", args.params[0], args.params[1]];
79
+ }
77
80
  throw new Error(`No key provider found for the arguments ${args}`);
78
81
  };
79
82
  function getIFrameResponseKeyProvider(param) {
@@ -97,6 +100,12 @@ function getIFrameResponseKeyProvider(param) {
97
100
  response.key === "valid" ? response.allowedUntil.toString(16) : "deadbeef"
98
101
  ];
99
102
  }
103
+ if (param.method === "frak_listenToSetUserReferred") {
104
+ return (response) => [
105
+ "user-referred",
106
+ response.key
107
+ ];
108
+ }
100
109
  throw new Error(`No key provider found for the request ${param}`);
101
110
  }
102
111
 
@@ -3,22 +3,22 @@
3
3
 
4
4
 
5
5
 
6
- var _chunk2XUJYDD3cjs = require('./chunk-2XUJYDD3.cjs');
6
+ var _chunkZOLP2FJZcjs = require('./chunk-ZOLP2FJZ.cjs');
7
7
 
8
8
  // src/core/actions/getUnlockOptions.ts
9
- function getArticleUnlockOptions(client, { articleId }) {
9
+ function getArticleUnlockOptions(client, { articleId, contentId }) {
10
10
  return client.request({
11
11
  method: "frak_getArticleUnlockOptions",
12
- params: [client.config.contentId, articleId]
12
+ params: [contentId, articleId]
13
13
  });
14
14
  }
15
15
 
16
16
  // src/core/actions/watchUnlockStatus.ts
17
- function watchUnlockStatus(client, { articleId }, callback) {
17
+ function watchUnlockStatus(client, { articleId, contentId }, callback) {
18
18
  return client.listenerRequest(
19
19
  {
20
20
  method: "frak_listenToArticleUnlockStatus",
21
- params: [client.config.contentId, articleId]
21
+ params: [contentId, articleId]
22
22
  },
23
23
  callback
24
24
  );
@@ -36,16 +36,12 @@ function watchWalletStatus(client, callback) {
36
36
 
37
37
  // src/core/actions/startUnlock.ts
38
38
  async function getStartArticleUnlockUrl(config, params) {
39
- const { compressed, compressedHash } = await _chunk2XUJYDD3cjs.hashAndCompressData.call(void 0,
39
+ const { compressed, compressedHash } = await _chunkZOLP2FJZcjs.hashAndCompressData.call(void 0,
40
40
  {
41
41
  method: "frak_startArticleUnlock",
42
- params: {
43
- ...params,
44
- contentId: config.contentId,
45
- contentTitle: config.contentTitle
46
- }
42
+ params
47
43
  },
48
- _chunk2XUJYDD3cjs.redirectRequestKeyProvider
44
+ _chunkZOLP2FJZcjs.redirectRequestKeyProvider
49
45
  );
50
46
  const outputUrl = new URL(config.walletUrl);
51
47
  outputUrl.pathname = "/paywall";
@@ -57,10 +53,10 @@ async function decodeStartUnlockReturn({
57
53
  result,
58
54
  hash
59
55
  }) {
60
- const keyProvider = _chunk2XUJYDD3cjs.getRedirectResponseResponseKeyProvider.call(void 0,
56
+ const keyProvider = _chunkZOLP2FJZcjs.getRedirectResponseResponseKeyProvider.call(void 0,
61
57
  "frak_startArticleUnlock"
62
58
  );
63
- return _chunk2XUJYDD3cjs.decompressDataAndCheckHash.call(void 0,
59
+ return _chunkZOLP2FJZcjs.decompressDataAndCheckHash.call(void 0,
64
60
  {
65
61
  compressed: decodeURIComponent(result),
66
62
  compressedHash: decodeURIComponent(hash)
@@ -69,10 +65,22 @@ async function decodeStartUnlockReturn({
69
65
  );
70
66
  }
71
67
 
68
+ // src/core/actions/setUserReferred.ts
69
+ function setUserReferred(client, { contentId, walletAddress }, callback) {
70
+ return client.listenerRequest(
71
+ {
72
+ method: "frak_listenToSetUserReferred",
73
+ params: [contentId, walletAddress]
74
+ },
75
+ callback
76
+ );
77
+ }
78
+
79
+
72
80
 
73
81
 
74
82
 
75
83
 
76
84
 
77
85
 
78
- exports.getArticleUnlockOptions = getArticleUnlockOptions; exports.watchUnlockStatus = watchUnlockStatus; exports.watchWalletStatus = watchWalletStatus; exports.getStartArticleUnlockUrl = getStartArticleUnlockUrl; exports.decodeStartUnlockReturn = decodeStartUnlockReturn;
86
+ exports.getArticleUnlockOptions = getArticleUnlockOptions; exports.watchUnlockStatus = watchUnlockStatus; exports.watchWalletStatus = watchWalletStatus; exports.getStartArticleUnlockUrl = getStartArticleUnlockUrl; exports.decodeStartUnlockReturn = decodeStartUnlockReturn; exports.setUserReferred = setUserReferred;
@@ -74,6 +74,9 @@ var iFrameRequestKeyProvider = (args) => {
74
74
  if (args.method === "frak_listenToArticleUnlockStatus") {
75
75
  return ["article-unlock-status", args.params[0], args.params[1]];
76
76
  }
77
+ if (args.method === "frak_listenToSetUserReferred") {
78
+ return ["user-referred", args.params[0], args.params[1]];
79
+ }
77
80
  throw new Error(`No key provider found for the arguments ${args}`);
78
81
  };
79
82
  function getIFrameResponseKeyProvider(param) {
@@ -97,6 +100,12 @@ function getIFrameResponseKeyProvider(param) {
97
100
  response.key === "valid" ? response.allowedUntil.toString(16) : "deadbeef"
98
101
  ];
99
102
  }
103
+ if (param.method === "frak_listenToSetUserReferred") {
104
+ return (response) => [
105
+ "user-referred",
106
+ response.key
107
+ ];
108
+ }
100
109
  throw new Error(`No key provider found for the request ${param}`);
101
110
  }
102
111
 
@@ -6,9 +6,30 @@ import { Prettify } from 'viem/chains';
6
6
  */
7
7
  type NexusWalletSdkConfig = Readonly<{
8
8
  walletUrl: string;
9
+ metadata: {
10
+ name: string;
11
+ };
12
+ }>;
13
+
14
+ /**
15
+ * Parameters of the referred request
16
+ */
17
+ type SetUserReferredParams = Readonly<{
9
18
  contentId: Hex;
10
- contentTitle: string;
11
19
  }>;
20
+ /**
21
+ * Return type of the referred request
22
+ */
23
+ type SetUserReferredReturnType = UserIsSameWallet | UserReferredSuccessful | UserReferredHistory;
24
+ type UserIsSameWallet = {
25
+ key: "same-wallet";
26
+ };
27
+ type UserReferredSuccessful = {
28
+ key: "referred-successful";
29
+ };
30
+ type UserReferredHistory = {
31
+ key: "referred-history";
32
+ };
12
33
 
13
34
  type PaidArticleUnlockPrice = Readonly<{
14
35
  index: number;
@@ -57,6 +78,7 @@ type UnlockError = {
57
78
  * The response to the get unlock options response
58
79
  */
59
80
  type UnlockOptionsReturnType = Readonly<{
81
+ frkBalanceAsHex?: Hex;
60
82
  prices: {
61
83
  index: number;
62
84
  unlockDurationInSec: number;
@@ -116,7 +138,6 @@ type WalletStatusReturnType = Readonly<WalletConnected | WalletNotConnected>;
116
138
  type WalletConnected = {
117
139
  key: "connected";
118
140
  wallet: Address;
119
- frkBalanceAsHex: Hex;
120
141
  };
121
142
  type WalletNotConnected = {
122
143
  key: "not-connected";
@@ -149,6 +170,14 @@ type IFrameRpcSchema = [
149
170
  Method: "frak_listenToArticleUnlockStatus";
150
171
  Parameters: [contentId: Hex, articleId: Hex];
151
172
  ReturnType: ArticleUnlockStatusReturnType;
173
+ },
174
+ /**
175
+ * Method used to set the referred user
176
+ */
177
+ {
178
+ Method: "frak_listenToSetUserReferred";
179
+ Parameters: [contentId: Hex, walletAddress: Address];
180
+ ReturnType: SetUserReferredReturnType;
152
181
  }
153
182
  ];
154
183
  /**
@@ -246,4 +275,4 @@ type NexusClient = {
246
275
  config: NexusWalletSdkConfig;
247
276
  } & IFrameTransport;
248
277
 
249
- export type { ArticleUnlockStatusReturnType as A, ExtractedParametersFromRpc as E, IFrameRpcSchema as I, NexusClient as N, PaidArticleUnlockPrice as P, RedirectRpcSchema as R, StartArticleUnlockReturnType as S, UnlockOptionsReturnType as U, WalletStatusReturnType as W, NexusWalletSdkConfig as a, StartArticleUnlockParams as b, ExtractedReturnTypeFromRpc as c, IFrameTransport as d, IFrameRpcEvent as e, IFrameEvent as f };
278
+ export type { ArticleUnlockStatusReturnType as A, ExtractedParametersFromRpc as E, IFrameRpcSchema as I, NexusClient as N, PaidArticleUnlockPrice as P, RedirectRpcSchema as R, StartArticleUnlockReturnType as S, UnlockOptionsReturnType as U, WalletStatusReturnType as W, NexusWalletSdkConfig as a, StartArticleUnlockParams as b, SetUserReferredReturnType as c, ExtractedReturnTypeFromRpc as d, SetUserReferredParams as e, IFrameTransport as f, IFrameRpcEvent as g, IFrameEvent as h };
@@ -6,9 +6,30 @@ import { Prettify } from 'viem/chains';
6
6
  */
7
7
  type NexusWalletSdkConfig = Readonly<{
8
8
  walletUrl: string;
9
+ metadata: {
10
+ name: string;
11
+ };
12
+ }>;
13
+
14
+ /**
15
+ * Parameters of the referred request
16
+ */
17
+ type SetUserReferredParams = Readonly<{
9
18
  contentId: Hex;
10
- contentTitle: string;
11
19
  }>;
20
+ /**
21
+ * Return type of the referred request
22
+ */
23
+ type SetUserReferredReturnType = UserIsSameWallet | UserReferredSuccessful | UserReferredHistory;
24
+ type UserIsSameWallet = {
25
+ key: "same-wallet";
26
+ };
27
+ type UserReferredSuccessful = {
28
+ key: "referred-successful";
29
+ };
30
+ type UserReferredHistory = {
31
+ key: "referred-history";
32
+ };
12
33
 
13
34
  type PaidArticleUnlockPrice = Readonly<{
14
35
  index: number;
@@ -57,6 +78,7 @@ type UnlockError = {
57
78
  * The response to the get unlock options response
58
79
  */
59
80
  type UnlockOptionsReturnType = Readonly<{
81
+ frkBalanceAsHex?: Hex;
60
82
  prices: {
61
83
  index: number;
62
84
  unlockDurationInSec: number;
@@ -116,7 +138,6 @@ type WalletStatusReturnType = Readonly<WalletConnected | WalletNotConnected>;
116
138
  type WalletConnected = {
117
139
  key: "connected";
118
140
  wallet: Address;
119
- frkBalanceAsHex: Hex;
120
141
  };
121
142
  type WalletNotConnected = {
122
143
  key: "not-connected";
@@ -149,6 +170,14 @@ type IFrameRpcSchema = [
149
170
  Method: "frak_listenToArticleUnlockStatus";
150
171
  Parameters: [contentId: Hex, articleId: Hex];
151
172
  ReturnType: ArticleUnlockStatusReturnType;
173
+ },
174
+ /**
175
+ * Method used to set the referred user
176
+ */
177
+ {
178
+ Method: "frak_listenToSetUserReferred";
179
+ Parameters: [contentId: Hex, walletAddress: Address];
180
+ ReturnType: SetUserReferredReturnType;
152
181
  }
153
182
  ];
154
183
  /**
@@ -246,4 +275,4 @@ type NexusClient = {
246
275
  config: NexusWalletSdkConfig;
247
276
  } & IFrameTransport;
248
277
 
249
- export type { ArticleUnlockStatusReturnType as A, ExtractedParametersFromRpc as E, IFrameRpcSchema as I, NexusClient as N, PaidArticleUnlockPrice as P, RedirectRpcSchema as R, StartArticleUnlockReturnType as S, UnlockOptionsReturnType as U, WalletStatusReturnType as W, NexusWalletSdkConfig as a, StartArticleUnlockParams as b, ExtractedReturnTypeFromRpc as c, IFrameTransport as d, IFrameRpcEvent as e, IFrameEvent as f };
278
+ export type { ArticleUnlockStatusReturnType as A, ExtractedParametersFromRpc as E, IFrameRpcSchema as I, NexusClient as N, PaidArticleUnlockPrice as P, RedirectRpcSchema as R, StartArticleUnlockReturnType as S, UnlockOptionsReturnType as U, WalletStatusReturnType as W, NexusWalletSdkConfig as a, StartArticleUnlockParams as b, SetUserReferredReturnType as c, ExtractedReturnTypeFromRpc as d, SetUserReferredParams as e, IFrameTransport as f, IFrameRpcEvent as g, IFrameEvent as h };
@@ -4,12 +4,14 @@
4
4
 
5
5
 
6
6
 
7
- var _chunk3LF3FGI6cjs = require('../../chunk-3LF3FGI6.cjs');
8
- require('../../chunk-2XUJYDD3.cjs');
9
7
 
8
+ var _chunkX4JNNWJ4cjs = require('../../chunk-X4JNNWJ4.cjs');
9
+ require('../../chunk-ZOLP2FJZ.cjs');
10
10
 
11
11
 
12
12
 
13
13
 
14
14
 
15
- exports.decodeStartUnlockReturn = _chunk3LF3FGI6cjs.decodeStartUnlockReturn; exports.getArticleUnlockOptions = _chunk3LF3FGI6cjs.getArticleUnlockOptions; exports.getStartArticleUnlockUrl = _chunk3LF3FGI6cjs.getStartArticleUnlockUrl; exports.watchUnlockStatus = _chunk3LF3FGI6cjs.watchUnlockStatus; exports.watchWalletStatus = _chunk3LF3FGI6cjs.watchWalletStatus;
15
+
16
+
17
+ exports.decodeStartUnlockReturn = _chunkX4JNNWJ4cjs.decodeStartUnlockReturn; exports.getArticleUnlockOptions = _chunkX4JNNWJ4cjs.getArticleUnlockOptions; exports.getStartArticleUnlockUrl = _chunkX4JNNWJ4cjs.getStartArticleUnlockUrl; exports.setUserReferred = _chunkX4JNNWJ4cjs.setUserReferred; exports.watchUnlockStatus = _chunkX4JNNWJ4cjs.watchUnlockStatus; exports.watchWalletStatus = _chunkX4JNNWJ4cjs.watchWalletStatus;
@@ -1,6 +1,6 @@
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
- import 'viem';
1
+ export { G as GetUnlockOptionsParams, W as WatchUnlockStatusParams, g as getArticleUnlockOptions, w as watchUnlockStatus } from '../../watchUnlockStatus-DXClCYH9.cjs';
2
+ import { N as NexusClient, W as WalletStatusReturnType, a as NexusWalletSdkConfig, S as StartArticleUnlockReturnType, b as StartArticleUnlockParams, c as SetUserReferredReturnType } from '../../client-BwzXSgqQ.cjs';
3
+ import { Hex, Address } from 'viem';
4
4
  import 'viem/chains';
5
5
 
6
6
  /**
@@ -10,7 +10,7 @@ import 'viem/chains';
10
10
  */
11
11
  declare function watchWalletStatus(client: NexusClient, callback: (status: WalletStatusReturnType) => void): Promise<void>;
12
12
 
13
- type GetStartUnlockUrlParams = Omit<StartArticleUnlockParams, "contentId" | "contentTitle">;
13
+ type GetStartUnlockUrlParams = StartArticleUnlockParams;
14
14
  /**
15
15
  * Function used to build the unlock URL for a given article
16
16
  * @param config
@@ -27,4 +27,20 @@ declare function decodeStartUnlockReturn({ result, hash, }: {
27
27
  validationHash: string;
28
28
  }>>;
29
29
 
30
- export { decodeStartUnlockReturn, getStartArticleUnlockUrl, watchWalletStatus };
30
+ /**
31
+ * Type used to get the user referred options
32
+ */
33
+ type SetUserReferredParams = {
34
+ contentId: Hex;
35
+ walletAddress: Address;
36
+ };
37
+ /**
38
+ * Function used to watch a current user referred
39
+ * @param client
40
+ * @param contentId
41
+ * @param walletAddress
42
+ * @param callback
43
+ */
44
+ declare function setUserReferred(client: NexusClient, { contentId, walletAddress }: SetUserReferredParams, callback: (status: SetUserReferredReturnType) => void): Promise<void>;
45
+
46
+ export { decodeStartUnlockReturn, getStartArticleUnlockUrl, setUserReferred, watchWalletStatus };
@@ -1,6 +1,6 @@
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
- import 'viem';
1
+ export { G as GetUnlockOptionsParams, W as WatchUnlockStatusParams, g as getArticleUnlockOptions, w as watchUnlockStatus } from '../../watchUnlockStatus-WJxoDliF.js';
2
+ import { N as NexusClient, W as WalletStatusReturnType, a as NexusWalletSdkConfig, S as StartArticleUnlockReturnType, b as StartArticleUnlockParams, c as SetUserReferredReturnType } from '../../client-BwzXSgqQ.js';
3
+ import { Hex, Address } from 'viem';
4
4
  import 'viem/chains';
5
5
 
6
6
  /**
@@ -10,7 +10,7 @@ import 'viem/chains';
10
10
  */
11
11
  declare function watchWalletStatus(client: NexusClient, callback: (status: WalletStatusReturnType) => void): Promise<void>;
12
12
 
13
- type GetStartUnlockUrlParams = Omit<StartArticleUnlockParams, "contentId" | "contentTitle">;
13
+ type GetStartUnlockUrlParams = StartArticleUnlockParams;
14
14
  /**
15
15
  * Function used to build the unlock URL for a given article
16
16
  * @param config
@@ -27,4 +27,20 @@ declare function decodeStartUnlockReturn({ result, hash, }: {
27
27
  validationHash: string;
28
28
  }>>;
29
29
 
30
- export { decodeStartUnlockReturn, getStartArticleUnlockUrl, watchWalletStatus };
30
+ /**
31
+ * Type used to get the user referred options
32
+ */
33
+ type SetUserReferredParams = {
34
+ contentId: Hex;
35
+ walletAddress: Address;
36
+ };
37
+ /**
38
+ * Function used to watch a current user referred
39
+ * @param client
40
+ * @param contentId
41
+ * @param walletAddress
42
+ * @param callback
43
+ */
44
+ declare function setUserReferred(client: NexusClient, { contentId, walletAddress }: SetUserReferredParams, callback: (status: SetUserReferredReturnType) => void): Promise<void>;
45
+
46
+ export { decodeStartUnlockReturn, getStartArticleUnlockUrl, setUserReferred, watchWalletStatus };
@@ -2,14 +2,16 @@ import {
2
2
  decodeStartUnlockReturn,
3
3
  getArticleUnlockOptions,
4
4
  getStartArticleUnlockUrl,
5
+ setUserReferred,
5
6
  watchUnlockStatus,
6
7
  watchWalletStatus
7
- } from "../../chunk-DI2REDPX.js";
8
- import "../../chunk-5QWG35A2.js";
8
+ } from "../../chunk-PDR3CF3P.js";
9
+ import "../../chunk-VK7GPKK4.js";
9
10
  export {
10
11
  decodeStartUnlockReturn,
11
12
  getArticleUnlockOptions,
12
13
  getStartArticleUnlockUrl,
14
+ setUserReferred,
13
15
  watchUnlockStatus,
14
16
  watchWalletStatus
15
17
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkJXQKTLEEcjs = require('../chunk-JXQKTLEE.cjs');
3
+ var _chunkAYZHGMEVcjs = require('../chunk-AYZHGMEV.cjs');
4
4
 
5
5
 
6
6
 
@@ -9,7 +9,7 @@ var _chunkJXQKTLEEcjs = require('../chunk-JXQKTLEE.cjs');
9
9
 
10
10
 
11
11
 
12
- var _chunk2XUJYDD3cjs = require('../chunk-2XUJYDD3.cjs');
12
+ var _chunkZOLP2FJZcjs = require('../chunk-ZOLP2FJZ.cjs');
13
13
 
14
14
 
15
15
 
@@ -19,4 +19,4 @@ var _chunk2XUJYDD3cjs = require('../chunk-2XUJYDD3.cjs');
19
19
 
20
20
 
21
21
 
22
- exports.createIFrameNexusClient = _chunkJXQKTLEEcjs.createIFrameNexusClient; exports.createIframe = _chunk2XUJYDD3cjs.createIframe; exports.decompressDataAndCheckHash = _chunk2XUJYDD3cjs.decompressDataAndCheckHash; exports.getIFrameResponseKeyProvider = _chunk2XUJYDD3cjs.getIFrameResponseKeyProvider; exports.getRedirectResponseResponseKeyProvider = _chunk2XUJYDD3cjs.getRedirectResponseResponseKeyProvider; exports.hashAndCompressData = _chunk2XUJYDD3cjs.hashAndCompressData; exports.iFrameRequestKeyProvider = _chunk2XUJYDD3cjs.iFrameRequestKeyProvider; exports.redirectRequestKeyProvider = _chunk2XUJYDD3cjs.redirectRequestKeyProvider;
22
+ exports.createIFrameNexusClient = _chunkAYZHGMEVcjs.createIFrameNexusClient; exports.createIframe = _chunkZOLP2FJZcjs.createIframe; exports.decompressDataAndCheckHash = _chunkZOLP2FJZcjs.decompressDataAndCheckHash; exports.getIFrameResponseKeyProvider = _chunkZOLP2FJZcjs.getIFrameResponseKeyProvider; exports.getRedirectResponseResponseKeyProvider = _chunkZOLP2FJZcjs.getRedirectResponseResponseKeyProvider; exports.hashAndCompressData = _chunkZOLP2FJZcjs.hashAndCompressData; exports.iFrameRequestKeyProvider = _chunkZOLP2FJZcjs.iFrameRequestKeyProvider; exports.redirectRequestKeyProvider = _chunkZOLP2FJZcjs.redirectRequestKeyProvider;
@@ -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-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';
1
+ import { a as NexusWalletSdkConfig, N as NexusClient, E as ExtractedParametersFromRpc, I as IFrameRpcSchema, d as ExtractedReturnTypeFromRpc, R as RedirectRpcSchema } from '../client-BwzXSgqQ.cjs';
2
+ export { A as ArticleUnlockStatusReturnType, h as IFrameEvent, g as IFrameRpcEvent, f as IFrameTransport, P as PaidArticleUnlockPrice, e as SetUserReferredParams, c as SetUserReferredReturnType, b as StartArticleUnlockParams, S as StartArticleUnlockReturnType, U as UnlockOptionsReturnType, W as WalletStatusReturnType } from '../client-BwzXSgqQ.cjs';
3
3
  import 'viem';
4
4
  import 'viem/chains';
5
5
 
@@ -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-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';
1
+ import { a as NexusWalletSdkConfig, N as NexusClient, E as ExtractedParametersFromRpc, I as IFrameRpcSchema, d as ExtractedReturnTypeFromRpc, R as RedirectRpcSchema } from '../client-BwzXSgqQ.js';
2
+ export { A as ArticleUnlockStatusReturnType, h as IFrameEvent, g as IFrameRpcEvent, f as IFrameTransport, P as PaidArticleUnlockPrice, e as SetUserReferredParams, c as SetUserReferredReturnType, b as StartArticleUnlockParams, S as StartArticleUnlockReturnType, U as UnlockOptionsReturnType, W as WalletStatusReturnType } from '../client-BwzXSgqQ.js';
3
3
  import 'viem';
4
4
  import 'viem/chains';
5
5
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createIFrameNexusClient
3
- } from "../chunk-OXP3VK26.js";
3
+ } from "../chunk-SZUN32YC.js";
4
4
  import {
5
5
  createIframe,
6
6
  decompressDataAndCheckHash,
@@ -9,7 +9,7 @@ import {
9
9
  hashAndCompressData,
10
10
  iFrameRequestKeyProvider,
11
11
  redirectRequestKeyProvider
12
- } from "../chunk-5QWG35A2.js";
12
+ } from "../chunk-VK7GPKK4.js";
13
13
  export {
14
14
  createIFrameNexusClient,
15
15
  createIframe,