@frak-labs/nexus-sdk 0.0.2-alpha → 0.0.3-alpha

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.
@@ -104,13 +104,13 @@ function getIFrameResponseKeyProvider(param) {
104
104
  function createIframe({
105
105
  walletBaseUrl
106
106
  }) {
107
- const isAlreadyCreated = document.querySelector("#frak-wallet");
107
+ const isAlreadyCreated = document.querySelector("#nexus-wallet");
108
108
  if (isAlreadyCreated) {
109
109
  return Promise.resolve(void 0);
110
110
  }
111
111
  const iframe = document.createElement("iframe");
112
- iframe.name = "frak-wallet";
113
- iframe.id = "frak-wallet";
112
+ iframe.name = "nexus-wallet";
113
+ iframe.id = "nexus-wallet";
114
114
  iframe.style.width = "0";
115
115
  iframe.style.height = "0";
116
116
  iframe.style.border = "0";
@@ -104,13 +104,13 @@ function getIFrameResponseKeyProvider(param) {
104
104
  function createIframe({
105
105
  walletBaseUrl
106
106
  }) {
107
- const isAlreadyCreated = document.querySelector("#frak-wallet");
107
+ const isAlreadyCreated = document.querySelector("#nexus-wallet");
108
108
  if (isAlreadyCreated) {
109
109
  return Promise.resolve(void 0);
110
110
  }
111
111
  const iframe = document.createElement("iframe");
112
- iframe.name = "frak-wallet";
113
- iframe.id = "frak-wallet";
112
+ iframe.name = "nexus-wallet";
113
+ iframe.id = "nexus-wallet";
114
114
  iframe.style.width = "0";
115
115
  iframe.style.height = "0";
116
116
  iframe.style.border = "0";
@@ -4,7 +4,7 @@ import { Prettify } from 'viem/chains';
4
4
  /**
5
5
  * Configuration for the Frak Wallet SDK
6
6
  */
7
- type FrakWalletSdkConfig = Readonly<{
7
+ type NexusWalletSdkConfig = Readonly<{
8
8
  walletUrl: string;
9
9
  contentId: Hex;
10
10
  contentTitle: string;
@@ -239,8 +239,8 @@ type IFrameLifecycleEvent = {
239
239
  /**
240
240
  * Representing a Frak client
241
241
  */
242
- type FrakClient = {
243
- config: FrakWalletSdkConfig;
242
+ type NexusClient = {
243
+ config: NexusWalletSdkConfig;
244
244
  } & IFrameTransport;
245
245
 
246
- export type { ArticleUnlockStatusReturnType as A, ExtractedParametersFromRpc as E, FrakClient as F, IFrameRpcSchema as I, PaidArticleUnlockPrice as P, RedirectRpcSchema as R, StartArticleUnlockReturnType as S, UnlockOptionsReturnType as U, WalletStatusReturnType as W, FrakWalletSdkConfig as a, StartArticleUnlockParams as b, ExtractedReturnTypeFromRpc as c, IFrameTransport as d, IFrameRpcEvent as e, IFrameEvent as f };
246
+ 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 };
@@ -4,7 +4,7 @@ import { Prettify } from 'viem/chains';
4
4
  /**
5
5
  * Configuration for the Frak Wallet SDK
6
6
  */
7
- type FrakWalletSdkConfig = Readonly<{
7
+ type NexusWalletSdkConfig = Readonly<{
8
8
  walletUrl: string;
9
9
  contentId: Hex;
10
10
  contentTitle: string;
@@ -239,8 +239,8 @@ type IFrameLifecycleEvent = {
239
239
  /**
240
240
  * Representing a Frak client
241
241
  */
242
- type FrakClient = {
243
- config: FrakWalletSdkConfig;
242
+ type NexusClient = {
243
+ config: NexusWalletSdkConfig;
244
244
  } & IFrameTransport;
245
245
 
246
- export type { ArticleUnlockStatusReturnType as A, ExtractedParametersFromRpc as E, FrakClient as F, IFrameRpcSchema as I, PaidArticleUnlockPrice as P, RedirectRpcSchema as R, StartArticleUnlockReturnType as S, UnlockOptionsReturnType as U, WalletStatusReturnType as W, FrakWalletSdkConfig as a, StartArticleUnlockParams as b, ExtractedReturnTypeFromRpc as c, IFrameTransport as d, IFrameRpcEvent as e, IFrameEvent as f };
246
+ 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 };
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
 
6
- var _chunk4X75PGSKcjs = require('../../chunk-4X75PGSK.cjs');
6
+ var _chunkN4N55SQ6cjs = require('../../chunk-N4N55SQ6.cjs');
7
7
 
8
8
  // src/core/actions/getUnlockOptions.ts
9
9
  function getArticleUnlockOptions(client, { articleId }) {
@@ -36,7 +36,7 @@ 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 _chunk4X75PGSKcjs.hashAndCompressData.call(void 0,
39
+ const { compressed, compressedHash } = await _chunkN4N55SQ6cjs.hashAndCompressData.call(void 0,
40
40
  {
41
41
  method: "frak_startArticleUnlock",
42
42
  params: {
@@ -45,7 +45,7 @@ async function getStartArticleUnlockUrl(config, params) {
45
45
  contentTitle: config.contentTitle
46
46
  }
47
47
  },
48
- _chunk4X75PGSKcjs.redirectRequestKeyProvider
48
+ _chunkN4N55SQ6cjs.redirectRequestKeyProvider
49
49
  );
50
50
  const outputUrl = new URL(config.walletUrl);
51
51
  outputUrl.pathname = "/paywall";
@@ -57,10 +57,10 @@ async function decodeStartUnlockReturn({
57
57
  result,
58
58
  hash
59
59
  }) {
60
- const keyProvider = _chunk4X75PGSKcjs.getRedirectResponseResponseKeyProvider.call(void 0,
60
+ const keyProvider = _chunkN4N55SQ6cjs.getRedirectResponseResponseKeyProvider.call(void 0,
61
61
  "frak_startArticleUnlock"
62
62
  );
63
- return _chunk4X75PGSKcjs.decompressDataAndCheckHash.call(void 0,
63
+ return _chunkN4N55SQ6cjs.decompressDataAndCheckHash.call(void 0,
64
64
  {
65
65
  compressed: decodeURIComponent(result),
66
66
  compressedHash: decodeURIComponent(hash)
@@ -1,5 +1,5 @@
1
1
  import { Hex } from 'viem';
2
- import { F as FrakClient, A as ArticleUnlockStatusReturnType, W as WalletStatusReturnType, a as FrakWalletSdkConfig, S as StartArticleUnlockReturnType, b as StartArticleUnlockParams } from '../../client-SCwoh_kP.cjs';
2
+ import { N as NexusClient, A as ArticleUnlockStatusReturnType, W as WalletStatusReturnType, a as NexusWalletSdkConfig, S as StartArticleUnlockReturnType, b as StartArticleUnlockParams } from '../../client-CkvisXxD.cjs';
3
3
  import 'viem/chains';
4
4
 
5
5
  /**
@@ -13,7 +13,7 @@ type GetUnlockOptionsParams = {
13
13
  * @param client
14
14
  * @param articleId
15
15
  */
16
- declare function getArticleUnlockOptions(client: FrakClient, { articleId }: GetUnlockOptionsParams): Promise<Readonly<{
16
+ declare function getArticleUnlockOptions(client: NexusClient, { articleId }: GetUnlockOptionsParams): Promise<Readonly<{
17
17
  prices: {
18
18
  index: number;
19
19
  unlockDurationInSec: number;
@@ -34,14 +34,14 @@ type WatchUnlockStatusParams = {
34
34
  * @param articleId
35
35
  * @param callback
36
36
  */
37
- declare function watchUnlockStatus(client: FrakClient, { articleId }: WatchUnlockStatusParams, callback: (status: ArticleUnlockStatusReturnType) => void): Promise<void>;
37
+ declare function watchUnlockStatus(client: NexusClient, { articleId }: WatchUnlockStatusParams, callback: (status: ArticleUnlockStatusReturnType) => void): Promise<void>;
38
38
 
39
39
  /**
40
40
  * Function used to watch the current nexus wallet status
41
41
  * @param client
42
42
  * @param callback
43
43
  */
44
- declare function watchWalletStatus(client: FrakClient, callback: (status: WalletStatusReturnType) => void): Promise<void>;
44
+ declare function watchWalletStatus(client: NexusClient, callback: (status: WalletStatusReturnType) => void): Promise<void>;
45
45
 
46
46
  type GetStartUnlockUrlParams = Omit<StartArticleUnlockParams, "contentId" | "contentTitle">;
47
47
  /**
@@ -49,7 +49,7 @@ type GetStartUnlockUrlParams = Omit<StartArticleUnlockParams, "contentId" | "con
49
49
  * @param config
50
50
  * @param params
51
51
  */
52
- declare function getStartArticleUnlockUrl(config: FrakWalletSdkConfig, params: GetStartUnlockUrlParams): Promise<string>;
52
+ declare function getStartArticleUnlockUrl(config: NexusWalletSdkConfig, params: GetStartUnlockUrlParams): Promise<string>;
53
53
  /**
54
54
  * Function used to decode the response from the start unlock request (return typed passed as query param)
55
55
  */
@@ -1,5 +1,5 @@
1
1
  import { Hex } from 'viem';
2
- import { F as FrakClient, A as ArticleUnlockStatusReturnType, W as WalletStatusReturnType, a as FrakWalletSdkConfig, S as StartArticleUnlockReturnType, b as StartArticleUnlockParams } from '../../client-SCwoh_kP.js';
2
+ import { N as NexusClient, A as ArticleUnlockStatusReturnType, W as WalletStatusReturnType, a as NexusWalletSdkConfig, S as StartArticleUnlockReturnType, b as StartArticleUnlockParams } from '../../client-CkvisXxD.js';
3
3
  import 'viem/chains';
4
4
 
5
5
  /**
@@ -13,7 +13,7 @@ type GetUnlockOptionsParams = {
13
13
  * @param client
14
14
  * @param articleId
15
15
  */
16
- declare function getArticleUnlockOptions(client: FrakClient, { articleId }: GetUnlockOptionsParams): Promise<Readonly<{
16
+ declare function getArticleUnlockOptions(client: NexusClient, { articleId }: GetUnlockOptionsParams): Promise<Readonly<{
17
17
  prices: {
18
18
  index: number;
19
19
  unlockDurationInSec: number;
@@ -34,14 +34,14 @@ type WatchUnlockStatusParams = {
34
34
  * @param articleId
35
35
  * @param callback
36
36
  */
37
- declare function watchUnlockStatus(client: FrakClient, { articleId }: WatchUnlockStatusParams, callback: (status: ArticleUnlockStatusReturnType) => void): Promise<void>;
37
+ declare function watchUnlockStatus(client: NexusClient, { articleId }: WatchUnlockStatusParams, callback: (status: ArticleUnlockStatusReturnType) => void): Promise<void>;
38
38
 
39
39
  /**
40
40
  * Function used to watch the current nexus wallet status
41
41
  * @param client
42
42
  * @param callback
43
43
  */
44
- declare function watchWalletStatus(client: FrakClient, callback: (status: WalletStatusReturnType) => void): Promise<void>;
44
+ declare function watchWalletStatus(client: NexusClient, callback: (status: WalletStatusReturnType) => void): Promise<void>;
45
45
 
46
46
  type GetStartUnlockUrlParams = Omit<StartArticleUnlockParams, "contentId" | "contentTitle">;
47
47
  /**
@@ -49,7 +49,7 @@ type GetStartUnlockUrlParams = Omit<StartArticleUnlockParams, "contentId" | "con
49
49
  * @param config
50
50
  * @param params
51
51
  */
52
- declare function getStartArticleUnlockUrl(config: FrakWalletSdkConfig, params: GetStartUnlockUrlParams): Promise<string>;
52
+ declare function getStartArticleUnlockUrl(config: NexusWalletSdkConfig, params: GetStartUnlockUrlParams): Promise<string>;
53
53
  /**
54
54
  * Function used to decode the response from the start unlock request (return typed passed as query param)
55
55
  */
@@ -3,7 +3,7 @@ import {
3
3
  getRedirectResponseResponseKeyProvider,
4
4
  hashAndCompressData,
5
5
  redirectRequestKeyProvider
6
- } from "../../chunk-JE64MPH2.js";
6
+ } from "../../chunk-6ZFDRVV6.js";
7
7
 
8
8
  // src/core/actions/getUnlockOptions.ts
9
9
  function getArticleUnlockOptions(client, { articleId }) {
@@ -7,18 +7,18 @@
7
7
 
8
8
 
9
9
 
10
- var _chunk4X75PGSKcjs = require('../chunk-4X75PGSK.cjs');
10
+ var _chunkN4N55SQ6cjs = require('../chunk-N4N55SQ6.cjs');
11
11
 
12
12
  // src/core/utils/Deferred.ts
13
13
  var Deferred = class {
14
14
  constructor() {
15
- _chunk4X75PGSKcjs.__publicField.call(void 0, this, "_promise");
16
- _chunk4X75PGSKcjs.__publicField.call(void 0, this, "_resolve");
17
- _chunk4X75PGSKcjs.__publicField.call(void 0, this, "_reject");
18
- _chunk4X75PGSKcjs.__publicField.call(void 0, this, "resolve", (value) => {
15
+ _chunkN4N55SQ6cjs.__publicField.call(void 0, this, "_promise");
16
+ _chunkN4N55SQ6cjs.__publicField.call(void 0, this, "_resolve");
17
+ _chunkN4N55SQ6cjs.__publicField.call(void 0, this, "_reject");
18
+ _chunkN4N55SQ6cjs.__publicField.call(void 0, this, "resolve", (value) => {
19
19
  _optionalChain([this, 'access', _ => _._resolve, 'optionalCall', _2 => _2(value)]);
20
20
  });
21
- _chunk4X75PGSKcjs.__publicField.call(void 0, this, "reject", (reason) => {
21
+ _chunkN4N55SQ6cjs.__publicField.call(void 0, this, "reject", (reason) => {
22
22
  _optionalChain([this, 'access', _3 => _3._reject, 'optionalCall', _4 => _4(reason)]);
23
23
  });
24
24
  this._promise = new Promise((resolve, reject) => {
@@ -49,7 +49,7 @@ function createIFrameChannelManager() {
49
49
 
50
50
  // src/core/clients/transports/iframeMessageHandler.ts
51
51
  function createIFrameMessageHandler({
52
- frakWalletUrl,
52
+ nexusWalletUrl,
53
53
  iframe,
54
54
  channelManager
55
55
  }) {
@@ -65,7 +65,7 @@ function createIFrameMessageHandler({
65
65
  if (!event.origin) {
66
66
  return;
67
67
  }
68
- if (new URL(event.origin).origin.toLowerCase() !== new URL(frakWalletUrl).origin.toLowerCase()) {
68
+ if (new URL(event.origin).origin.toLowerCase() !== new URL(nexusWalletUrl).origin.toLowerCase()) {
69
69
  return;
70
70
  }
71
71
  if ("lifecycle" in event.data) {
@@ -82,7 +82,7 @@ function createIFrameMessageHandler({
82
82
  window.addEventListener("message", msgHandler);
83
83
  const sendEvent = (message) => {
84
84
  contentWindow.postMessage(message, {
85
- targetOrigin: frakWalletUrl
85
+ targetOrigin: nexusWalletUrl
86
86
  });
87
87
  };
88
88
  const cleanup = () => {
@@ -95,14 +95,14 @@ function createIFrameMessageHandler({
95
95
  };
96
96
  }
97
97
 
98
- // src/core/clients/createIFrameFrakClient.ts
99
- function createIFrameFrakClient({
98
+ // src/core/clients/createIFrameNexusClient.ts
99
+ function createIFrameNexusClient({
100
100
  config,
101
101
  iframe
102
102
  }) {
103
103
  const channelManager = createIFrameChannelManager();
104
104
  const messageHandler = createIFrameMessageHandler({
105
- frakWalletUrl: config.walletUrl,
105
+ nexusWalletUrl: config.walletUrl,
106
106
  iframe,
107
107
  channelManager
108
108
  });
@@ -112,18 +112,18 @@ function createIFrameFrakClient({
112
112
  throw new Error("The iframe provider isn't connected yet");
113
113
  }
114
114
  const result = new Deferred();
115
- const resultCompressionKeyProvider = _chunk4X75PGSKcjs.getIFrameResponseKeyProvider.call(void 0, args);
115
+ const resultCompressionKeyProvider = _chunkN4N55SQ6cjs.getIFrameResponseKeyProvider.call(void 0, args);
116
116
  const channelId = channelManager.createChannel(async (message) => {
117
- const decompressed = await _chunk4X75PGSKcjs.decompressDataAndCheckHash.call(void 0,
117
+ const decompressed = await _chunkN4N55SQ6cjs.decompressDataAndCheckHash.call(void 0,
118
118
  message.data,
119
119
  resultCompressionKeyProvider
120
120
  );
121
121
  result.resolve(decompressed);
122
122
  channelManager.removeChannel(channelId);
123
123
  });
124
- const compressedMessage = await _chunk4X75PGSKcjs.hashAndCompressData.call(void 0,
124
+ const compressedMessage = await _chunkN4N55SQ6cjs.hashAndCompressData.call(void 0,
125
125
  args,
126
- _chunk4X75PGSKcjs.iFrameRequestKeyProvider
126
+ _chunkN4N55SQ6cjs.iFrameRequestKeyProvider
127
127
  );
128
128
  messageHandler.sendEvent({
129
129
  id: channelId,
@@ -137,17 +137,17 @@ function createIFrameFrakClient({
137
137
  if (!isConnected) {
138
138
  throw new Error("The iframe provider isn't connected yet");
139
139
  }
140
- const resultCompressionKeyProvider = _chunk4X75PGSKcjs.getIFrameResponseKeyProvider.call(void 0, args);
140
+ const resultCompressionKeyProvider = _chunkN4N55SQ6cjs.getIFrameResponseKeyProvider.call(void 0, args);
141
141
  const channelId = channelManager.createChannel(async (message) => {
142
- const decompressed = await _chunk4X75PGSKcjs.decompressDataAndCheckHash.call(void 0,
142
+ const decompressed = await _chunkN4N55SQ6cjs.decompressDataAndCheckHash.call(void 0,
143
143
  message.data,
144
144
  resultCompressionKeyProvider
145
145
  );
146
146
  callback(decompressed);
147
147
  });
148
- const compressedMessage = await _chunk4X75PGSKcjs.hashAndCompressData.call(void 0,
148
+ const compressedMessage = await _chunkN4N55SQ6cjs.hashAndCompressData.call(void 0,
149
149
  args,
150
- _chunk4X75PGSKcjs.iFrameRequestKeyProvider
150
+ _chunkN4N55SQ6cjs.iFrameRequestKeyProvider
151
151
  );
152
152
  messageHandler.sendEvent({
153
153
  id: channelId,
@@ -176,4 +176,4 @@ function createIFrameFrakClient({
176
176
 
177
177
 
178
178
 
179
- exports.createIFrameFrakClient = createIFrameFrakClient; exports.createIframe = _chunk4X75PGSKcjs.createIframe; exports.decompressDataAndCheckHash = _chunk4X75PGSKcjs.decompressDataAndCheckHash; exports.getIFrameResponseKeyProvider = _chunk4X75PGSKcjs.getIFrameResponseKeyProvider; exports.getRedirectResponseResponseKeyProvider = _chunk4X75PGSKcjs.getRedirectResponseResponseKeyProvider; exports.hashAndCompressData = _chunk4X75PGSKcjs.hashAndCompressData; exports.iFrameRequestKeyProvider = _chunk4X75PGSKcjs.iFrameRequestKeyProvider; exports.redirectRequestKeyProvider = _chunk4X75PGSKcjs.redirectRequestKeyProvider;
179
+ exports.createIFrameNexusClient = createIFrameNexusClient; exports.createIframe = _chunkN4N55SQ6cjs.createIframe; exports.decompressDataAndCheckHash = _chunkN4N55SQ6cjs.decompressDataAndCheckHash; exports.getIFrameResponseKeyProvider = _chunkN4N55SQ6cjs.getIFrameResponseKeyProvider; exports.getRedirectResponseResponseKeyProvider = _chunkN4N55SQ6cjs.getRedirectResponseResponseKeyProvider; exports.hashAndCompressData = _chunkN4N55SQ6cjs.hashAndCompressData; exports.iFrameRequestKeyProvider = _chunkN4N55SQ6cjs.iFrameRequestKeyProvider; exports.redirectRequestKeyProvider = _chunkN4N55SQ6cjs.redirectRequestKeyProvider;
@@ -1,15 +1,15 @@
1
- import { a as FrakWalletSdkConfig, F as FrakClient, E as ExtractedParametersFromRpc, I as IFrameRpcSchema, c as ExtractedReturnTypeFromRpc, R as RedirectRpcSchema } from '../client-SCwoh_kP.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-SCwoh_kP.cjs';
1
+ import { a as NexusWalletSdkConfig, N as NexusClient, E as ExtractedParametersFromRpc, I as IFrameRpcSchema, c as ExtractedReturnTypeFromRpc, R as RedirectRpcSchema } from '../client-CkvisXxD.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-CkvisXxD.cjs';
3
3
  import 'viem';
4
4
  import 'viem/chains';
5
5
 
6
6
  /**
7
7
  * Create a new iframe Frak client
8
8
  */
9
- declare function createIFrameFrakClient({ config, iframe, }: {
10
- config: FrakWalletSdkConfig;
9
+ declare function createIFrameNexusClient({ config, iframe, }: {
10
+ config: NexusWalletSdkConfig;
11
11
  iframe: HTMLIFrameElement;
12
- }): FrakClient;
12
+ }): NexusClient;
13
13
 
14
14
  /**
15
15
  * Create the given iframe
@@ -80,4 +80,4 @@ type RedirectRpcResponseKeyProvider<TMethod extends ExtractedParametersFromRpc<R
80
80
  */
81
81
  declare function getRedirectResponseResponseKeyProvider<TMethod extends ExtractedParametersFromRpc<RedirectRpcSchema>["method"]>(method: TMethod): RedirectRpcResponseKeyProvider<TMethod>;
82
82
 
83
- export { type CompressedData, ExtractedParametersFromRpc, ExtractedReturnTypeFromRpc, FrakClient, FrakWalletSdkConfig, type HashProtectedData, IFrameRpcSchema, type KeyProvider, RedirectRpcSchema, createIFrameFrakClient, createIframe, decompressDataAndCheckHash, getIFrameResponseKeyProvider, getRedirectResponseResponseKeyProvider, hashAndCompressData, iFrameRequestKeyProvider, redirectRequestKeyProvider };
83
+ export { type CompressedData, ExtractedParametersFromRpc, ExtractedReturnTypeFromRpc, type HashProtectedData, IFrameRpcSchema, type KeyProvider, NexusClient, NexusWalletSdkConfig, RedirectRpcSchema, createIFrameNexusClient, createIframe, decompressDataAndCheckHash, getIFrameResponseKeyProvider, getRedirectResponseResponseKeyProvider, hashAndCompressData, iFrameRequestKeyProvider, redirectRequestKeyProvider };
@@ -1,15 +1,15 @@
1
- import { a as FrakWalletSdkConfig, F as FrakClient, E as ExtractedParametersFromRpc, I as IFrameRpcSchema, c as ExtractedReturnTypeFromRpc, R as RedirectRpcSchema } from '../client-SCwoh_kP.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-SCwoh_kP.js';
1
+ import { a as NexusWalletSdkConfig, N as NexusClient, E as ExtractedParametersFromRpc, I as IFrameRpcSchema, c as ExtractedReturnTypeFromRpc, R as RedirectRpcSchema } from '../client-CkvisXxD.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-CkvisXxD.js';
3
3
  import 'viem';
4
4
  import 'viem/chains';
5
5
 
6
6
  /**
7
7
  * Create a new iframe Frak client
8
8
  */
9
- declare function createIFrameFrakClient({ config, iframe, }: {
10
- config: FrakWalletSdkConfig;
9
+ declare function createIFrameNexusClient({ config, iframe, }: {
10
+ config: NexusWalletSdkConfig;
11
11
  iframe: HTMLIFrameElement;
12
- }): FrakClient;
12
+ }): NexusClient;
13
13
 
14
14
  /**
15
15
  * Create the given iframe
@@ -80,4 +80,4 @@ type RedirectRpcResponseKeyProvider<TMethod extends ExtractedParametersFromRpc<R
80
80
  */
81
81
  declare function getRedirectResponseResponseKeyProvider<TMethod extends ExtractedParametersFromRpc<RedirectRpcSchema>["method"]>(method: TMethod): RedirectRpcResponseKeyProvider<TMethod>;
82
82
 
83
- export { type CompressedData, ExtractedParametersFromRpc, ExtractedReturnTypeFromRpc, FrakClient, FrakWalletSdkConfig, type HashProtectedData, IFrameRpcSchema, type KeyProvider, RedirectRpcSchema, createIFrameFrakClient, createIframe, decompressDataAndCheckHash, getIFrameResponseKeyProvider, getRedirectResponseResponseKeyProvider, hashAndCompressData, iFrameRequestKeyProvider, redirectRequestKeyProvider };
83
+ export { type CompressedData, ExtractedParametersFromRpc, ExtractedReturnTypeFromRpc, type HashProtectedData, IFrameRpcSchema, type KeyProvider, NexusClient, NexusWalletSdkConfig, RedirectRpcSchema, createIFrameNexusClient, createIframe, decompressDataAndCheckHash, getIFrameResponseKeyProvider, getRedirectResponseResponseKeyProvider, hashAndCompressData, iFrameRequestKeyProvider, redirectRequestKeyProvider };
@@ -7,7 +7,7 @@ import {
7
7
  hashAndCompressData,
8
8
  iFrameRequestKeyProvider,
9
9
  redirectRequestKeyProvider
10
- } from "../chunk-JE64MPH2.js";
10
+ } from "../chunk-6ZFDRVV6.js";
11
11
 
12
12
  // src/core/utils/Deferred.ts
13
13
  var Deferred = class {
@@ -49,7 +49,7 @@ function createIFrameChannelManager() {
49
49
 
50
50
  // src/core/clients/transports/iframeMessageHandler.ts
51
51
  function createIFrameMessageHandler({
52
- frakWalletUrl,
52
+ nexusWalletUrl,
53
53
  iframe,
54
54
  channelManager
55
55
  }) {
@@ -65,7 +65,7 @@ function createIFrameMessageHandler({
65
65
  if (!event.origin) {
66
66
  return;
67
67
  }
68
- if (new URL(event.origin).origin.toLowerCase() !== new URL(frakWalletUrl).origin.toLowerCase()) {
68
+ if (new URL(event.origin).origin.toLowerCase() !== new URL(nexusWalletUrl).origin.toLowerCase()) {
69
69
  return;
70
70
  }
71
71
  if ("lifecycle" in event.data) {
@@ -82,7 +82,7 @@ function createIFrameMessageHandler({
82
82
  window.addEventListener("message", msgHandler);
83
83
  const sendEvent = (message) => {
84
84
  contentWindow.postMessage(message, {
85
- targetOrigin: frakWalletUrl
85
+ targetOrigin: nexusWalletUrl
86
86
  });
87
87
  };
88
88
  const cleanup = () => {
@@ -95,14 +95,14 @@ function createIFrameMessageHandler({
95
95
  };
96
96
  }
97
97
 
98
- // src/core/clients/createIFrameFrakClient.ts
99
- function createIFrameFrakClient({
98
+ // src/core/clients/createIFrameNexusClient.ts
99
+ function createIFrameNexusClient({
100
100
  config,
101
101
  iframe
102
102
  }) {
103
103
  const channelManager = createIFrameChannelManager();
104
104
  const messageHandler = createIFrameMessageHandler({
105
- frakWalletUrl: config.walletUrl,
105
+ nexusWalletUrl: config.walletUrl,
106
106
  iframe,
107
107
  channelManager
108
108
  });
@@ -168,7 +168,7 @@ function createIFrameFrakClient({
168
168
  };
169
169
  }
170
170
  export {
171
- createIFrameFrakClient,
171
+ createIFrameNexusClient,
172
172
  createIframe,
173
173
  decompressDataAndCheckHash,
174
174
  getIFrameResponseKeyProvider,
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "url": "https://twitter.com/QNivelais"
12
12
  }
13
13
  ],
14
- "version": "0.0.2-alpha",
14
+ "version": "0.0.3-alpha",
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",