@frak-labs/nexus-sdk 0.0.14 → 0.0.15

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.
Files changed (49) hide show
  1. package/README.md +4 -4
  2. package/dist/NexusContext-CSlCNW-G.d.cts +10 -0
  3. package/dist/NexusContext-CSlCNW-G.d.ts +10 -0
  4. package/dist/bundle/bundle.js +21 -0
  5. package/dist/chunk-2LAGZ6S5.js +246 -0
  6. package/dist/chunk-4ADWI2GG.cjs +243 -0
  7. package/dist/chunk-4LT3U3H4.cjs +246 -0
  8. package/dist/{chunk-5LZQXBFJ.js → chunk-ARQTOP44.js} +12 -196
  9. package/dist/chunk-C25NTD45.cjs +100 -0
  10. package/dist/chunk-DILTMQBI.cjs +51 -0
  11. package/dist/{chunk-IH3QWPWT.js → chunk-I47XQDS3.js} +44 -16
  12. package/dist/chunk-K4FOGADW.js +51 -0
  13. package/dist/chunk-KEATMEOW.cjs +207 -0
  14. package/dist/chunk-VMNURFPI.js +207 -0
  15. package/dist/{client-DJd7-ajw.d.ts → client-B3Guoe3I.d.ts} +7 -4
  16. package/dist/{client-DXITs1Kf.d.cts → client-Of9uIxuI.d.cts} +7 -4
  17. package/dist/core/actions/index.cjs +11 -3
  18. package/dist/core/actions/index.d.cts +28 -4
  19. package/dist/core/actions/index.d.ts +28 -4
  20. package/dist/core/actions/index.js +10 -2
  21. package/dist/core/index.cjs +9 -4
  22. package/dist/core/index.d.cts +66 -4
  23. package/dist/core/index.d.ts +66 -4
  24. package/dist/core/index.js +9 -4
  25. package/dist/core/interactions/index.cjs +3 -6
  26. package/dist/core/interactions/index.d.cts +19 -15
  27. package/dist/core/interactions/index.d.ts +19 -15
  28. package/dist/core/interactions/index.js +4 -7
  29. package/dist/{error-C4Zm5nQe.d.cts → error-Dflr3G5x.d.cts} +1 -1
  30. package/dist/{error-C4Zm5nQe.d.ts → error-Dflr3G5x.d.ts} +1 -1
  31. package/dist/react/index.cjs +74 -150
  32. package/dist/react/index.d.cts +4 -5
  33. package/dist/react/index.d.ts +4 -5
  34. package/dist/react/index.js +72 -148
  35. package/dist/{sendTransaction-fLvpfqaQ.d.ts → sendTransaction-3d8jO9CJ.d.ts} +1 -1
  36. package/dist/{sendTransaction-C19oCc6X.d.cts → sendTransaction-Cz6FoB9_.d.cts} +1 -1
  37. package/package.json +5 -5
  38. package/dist/chunk-22T2NHQK.js +0 -22
  39. package/dist/chunk-5SGDBU5S.cjs +0 -427
  40. package/dist/chunk-AANA3LEO.cjs +0 -22
  41. package/dist/chunk-ETV4XYOV.cjs +0 -7
  42. package/dist/chunk-PKBMQBKP.js +0 -7
  43. package/dist/chunk-PURWUKEM.cjs +0 -72
  44. package/dist/chunk-S223FMEJ.js +0 -86
  45. package/dist/chunk-UOEVM7TR.cjs +0 -86
  46. package/dist/index.cjs +0 -1
  47. package/dist/index.d.cts +0 -2
  48. package/dist/index.d.ts +0 -2
  49. package/dist/index.js +0 -0
@@ -1,16 +1,13 @@
1
1
  import {
2
+ interactionTypes,
2
3
  productTypes
3
- } from "./chunk-22T2NHQK.js";
4
+ } from "./chunk-K4FOGADW.js";
4
5
 
5
6
  // src/core/interactions/pressEncoder.ts
6
7
  import { concatHex, pad, toHex } from "viem";
7
- var PressActionsSelector = {
8
- OpenArticle: "0xc0a24ffb",
9
- ReadArticle: "0xd5bd0fbe"
10
- };
11
8
  function openArticle({ articleId }) {
12
9
  const interactionData = concatHex([
13
- PressActionsSelector.OpenArticle,
10
+ interactionTypes.press.openArticle,
14
11
  pad(articleId, { size: 32 })
15
12
  ]);
16
13
  return {
@@ -20,7 +17,7 @@ function openArticle({ articleId }) {
20
17
  }
21
18
  function readArticle({ articleId }) {
22
19
  const interactionData = concatHex([
23
- PressActionsSelector.ReadArticle,
20
+ interactionTypes.press.readArticle,
24
21
  pad(articleId, { size: 32 })
25
22
  ]);
26
23
  return {
@@ -35,13 +32,9 @@ var PressInteractionEncoder = {
35
32
 
36
33
  // src/core/interactions/referralEncoder.ts
37
34
  import { concatHex as concatHex2, pad as pad2, toHex as toHex2 } from "viem";
38
- var ReferralActionsSelector = {
39
- CreateLink: "0xb2c0f17c",
40
- Referred: "0x010cc3b9"
41
- };
42
35
  function createLink() {
43
36
  const interactionData = concatHex2([
44
- ReferralActionsSelector.CreateLink,
37
+ interactionTypes.referral.createLink,
45
38
  "0x"
46
39
  ]);
47
40
  return {
@@ -51,7 +44,7 @@ function createLink() {
51
44
  }
52
45
  function referred({ referrer }) {
53
46
  const interactionData = concatHex2([
54
- ReferralActionsSelector.Referred,
47
+ interactionTypes.referral.referred,
55
48
  pad2(referrer, { size: 32 })
56
49
  ]);
57
50
  return {
@@ -64,9 +57,44 @@ var ReferralInteractionEncoder = {
64
57
  referred
65
58
  };
66
59
 
60
+ // src/core/interactions/purchaseEncoder.ts
61
+ import { concatHex as concatHex3, encodeAbiParameters, pad as pad3, toHex as toHex3 } from "viem";
62
+ function startPurchase({
63
+ purchaseId
64
+ }) {
65
+ const interactionData = concatHex3([
66
+ interactionTypes.purchase.started,
67
+ pad3(purchaseId, { size: 32 })
68
+ ]);
69
+ return {
70
+ handlerTypeDenominator: toHex3(productTypes.purchase),
71
+ interactionData
72
+ };
73
+ }
74
+ function completedPurchase({
75
+ purchaseId,
76
+ proof
77
+ }) {
78
+ const innerData = encodeAbiParameters(
79
+ [{ type: "uint256" }, { type: "bytes32[]" }],
80
+ [BigInt(purchaseId), proof]
81
+ );
82
+ const interactionData = concatHex3([
83
+ interactionTypes.purchase.completed,
84
+ innerData
85
+ ]);
86
+ return {
87
+ handlerTypeDenominator: toHex3(productTypes.purchase),
88
+ interactionData
89
+ };
90
+ }
91
+ var PurchaseInteractionEncoder = {
92
+ startPurchase,
93
+ completedPurchase
94
+ };
95
+
67
96
  export {
68
- PressActionsSelector,
69
97
  PressInteractionEncoder,
70
- ReferralActionsSelector,
71
- ReferralInteractionEncoder
98
+ ReferralInteractionEncoder,
99
+ PurchaseInteractionEncoder
72
100
  };
@@ -0,0 +1,51 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+
5
+ // src/core/constants/productTypes.ts
6
+ var productTypes = {
7
+ // content type
8
+ dapp: 1,
9
+ press: 2,
10
+ webshop: 3,
11
+ // feature type
12
+ referral: 30,
13
+ purchase: 31
14
+ };
15
+ var productTypesMask = Object.entries(
16
+ productTypes
17
+ ).reduce(
18
+ (acc, [key, value]) => {
19
+ acc[key] = BigInt(1) << BigInt(value);
20
+ return acc;
21
+ },
22
+ {}
23
+ );
24
+
25
+ // src/core/constants/interactionTypes.ts
26
+ var interactionTypes = {
27
+ press: {
28
+ openArticle: "0xc0a24ffb",
29
+ readArticle: "0xd5bd0fbe"
30
+ },
31
+ dapp: {
32
+ proofVerifiableStorageUpdate: "0x2ab2aeef",
33
+ callableVerifiableStorageUpdate: "0xa07da986"
34
+ },
35
+ webshop: {},
36
+ referral: {
37
+ referred: "0x010cc3b9",
38
+ createLink: "0xb2c0f17c"
39
+ },
40
+ purchase: {
41
+ started: "0xd87e90c3",
42
+ completed: "0x8403aeb4"
43
+ }
44
+ };
45
+
46
+ export {
47
+ __publicField,
48
+ productTypes,
49
+ productTypesMask,
50
+ interactionTypes
51
+ };
@@ -0,0 +1,207 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
+
3
+
4
+
5
+
6
+ var _chunk4LT3U3H4cjs = require('./chunk-4LT3U3H4.cjs');
7
+
8
+
9
+ var _chunkC25NTD45cjs = require('./chunk-C25NTD45.cjs');
10
+
11
+ // src/core/actions/watchWalletStatus.ts
12
+ function watchWalletStatus(client, callback) {
13
+ return client.listenerRequest(
14
+ {
15
+ method: "frak_listenToWalletStatus"
16
+ },
17
+ callback
18
+ );
19
+ }
20
+
21
+ // src/core/utils/computeProductId.ts
22
+ var _viem = require('viem');
23
+ function computeProductId({ domain }) {
24
+ return _viem.keccak256.call(void 0, _viem.toHex.call(void 0, domain));
25
+ }
26
+
27
+ // src/core/actions/sendInteraction.ts
28
+ async function sendInteraction(client, { productId, interaction, validation }) {
29
+ const pId = _nullishCoalesce(productId, () => ( computeProductId(client.config)));
30
+ return await client.request({
31
+ method: "frak_sendInteraction",
32
+ params: [pId, interaction, validation]
33
+ });
34
+ }
35
+
36
+ // src/core/actions/displayModal.ts
37
+ async function displayModal(client, { steps, metadata }) {
38
+ return await client.request({
39
+ method: "frak_displayModal",
40
+ params: [steps, client.config.metadata.name, metadata]
41
+ });
42
+ }
43
+
44
+ // src/core/actions/openSso.ts
45
+ async function openSso(client, args) {
46
+ const { metadata } = client.config;
47
+ await client.request({
48
+ method: "frak_sso",
49
+ params: [args, metadata.name, metadata.css]
50
+ });
51
+ }
52
+
53
+ // src/core/actions/wrapper/siweAuthenticate.ts
54
+ var _siwe = require('viem/siwe');
55
+ async function siweAuthenticate(client, { siwe, metadata }) {
56
+ const realStatement = _nullishCoalesce(_optionalChain([siwe, 'optionalAccess', _ => _.statement]), () => ( `I confirm that I want to use my Frak wallet on: ${client.config.metadata.name}`));
57
+ const builtSiwe = {
58
+ ...siwe,
59
+ statement: realStatement,
60
+ nonce: _nullishCoalesce(_optionalChain([siwe, 'optionalAccess', _2 => _2.nonce]), () => ( _siwe.generateSiweNonce.call(void 0, ))),
61
+ uri: _nullishCoalesce(_optionalChain([siwe, 'optionalAccess', _3 => _3.uri]), () => ( `https://${client.config.domain}`)),
62
+ version: _nullishCoalesce(_optionalChain([siwe, 'optionalAccess', _4 => _4.version]), () => ( "1")),
63
+ domain: client.config.domain
64
+ };
65
+ const result = await displayModal(client, {
66
+ metadata,
67
+ steps: {
68
+ login: {},
69
+ siweAuthenticate: {
70
+ siwe: builtSiwe
71
+ }
72
+ }
73
+ });
74
+ return result.siweAuthenticate;
75
+ }
76
+
77
+ // src/core/actions/wrapper/sendTransaction.ts
78
+ async function sendTransaction(client, { tx, metadata }) {
79
+ const result = await displayModal(client, {
80
+ metadata,
81
+ steps: {
82
+ login: {},
83
+ sendTransaction: { tx }
84
+ }
85
+ });
86
+ return result.sendTransaction;
87
+ }
88
+
89
+ // src/core/actions/wrapper/walletStatus.ts
90
+ async function walletStatus(client, callback) {
91
+ const firstResult = new (0, _chunk4LT3U3H4cjs.Deferred)();
92
+ let hasResolved = false;
93
+ await watchWalletStatus(client, (status) => {
94
+ _optionalChain([callback, 'optionalCall', _5 => _5(status)]);
95
+ if (!hasResolved) {
96
+ firstResult.resolve(status);
97
+ hasResolved = true;
98
+ }
99
+ });
100
+ return firstResult.promise;
101
+ }
102
+
103
+ // src/core/actions/referral/processReferral.ts
104
+
105
+ async function processReferral(client, {
106
+ walletStatus: walletStatus2,
107
+ nexusContext,
108
+ modalConfig,
109
+ productId
110
+ }) {
111
+ try {
112
+ let currentWallet = getCurrentWallet(walletStatus2);
113
+ if (!_optionalChain([nexusContext, 'optionalAccess', _6 => _6.r])) {
114
+ if (currentWallet) {
115
+ await _chunk4LT3U3H4cjs.NexusContextManager.replaceUrl({
116
+ url: _optionalChain([window, 'access', _7 => _7.location, 'optionalAccess', _8 => _8.href]),
117
+ context: { r: currentWallet }
118
+ });
119
+ }
120
+ return "no-referrer";
121
+ }
122
+ if (!currentWallet) {
123
+ currentWallet = await ensureWalletConnected(client, {
124
+ modalConfig,
125
+ walletStatus: walletStatus2
126
+ });
127
+ }
128
+ if (currentWallet && _viem.isAddressEqual.call(void 0, nexusContext.r, currentWallet)) {
129
+ return "self-referral";
130
+ }
131
+ if (currentWallet) {
132
+ await _chunk4LT3U3H4cjs.NexusContextManager.replaceUrl({
133
+ url: _optionalChain([window, 'access', _9 => _9.location, 'optionalAccess', _10 => _10.href]),
134
+ context: { r: currentWallet }
135
+ });
136
+ }
137
+ const interaction = _chunkC25NTD45cjs.ReferralInteractionEncoder.referred({
138
+ referrer: nexusContext.r
139
+ });
140
+ await sendInteraction(client, { productId, interaction });
141
+ return "success";
142
+ } catch (error) {
143
+ return mapErrorToState(error);
144
+ }
145
+ }
146
+ function getCurrentWallet(walletStatus2) {
147
+ return _optionalChain([walletStatus2, 'optionalAccess', _11 => _11.key]) === "connected" ? walletStatus2.wallet : void 0;
148
+ }
149
+ async function ensureWalletConnected(client, {
150
+ modalConfig,
151
+ walletStatus: walletStatus2
152
+ }) {
153
+ if (_optionalChain([walletStatus2, 'optionalAccess', _12 => _12.key]) !== "connected" || !walletStatus2.interactionSession) {
154
+ if (!modalConfig) {
155
+ return void 0;
156
+ }
157
+ const result = await displayModal(client, modalConfig);
158
+ return _nullishCoalesce(_optionalChain([result, 'optionalAccess', _13 => _13.login, 'optionalAccess', _14 => _14.wallet]), () => ( void 0));
159
+ }
160
+ return _nullishCoalesce(walletStatus2.wallet, () => ( void 0));
161
+ }
162
+ function mapErrorToState(error) {
163
+ if (error instanceof _chunk4LT3U3H4cjs.FrakRpcError) {
164
+ switch (error.code) {
165
+ case _chunk4LT3U3H4cjs.RpcErrorCodes.walletNotConnected:
166
+ return "no-wallet";
167
+ case _chunk4LT3U3H4cjs.RpcErrorCodes.serverErrorForInteractionDelegation:
168
+ return "no-session";
169
+ default:
170
+ return "error";
171
+ }
172
+ }
173
+ return "error";
174
+ }
175
+
176
+ // src/core/actions/referral/referralInteraction.ts
177
+ async function referralInteraction(client, {
178
+ productId,
179
+ modalConfig
180
+ } = {}) {
181
+ const nexusContext = await _chunk4LT3U3H4cjs.NexusContextManager.parse({
182
+ url: window.location.href
183
+ });
184
+ const currentWalletStatus = await walletStatus(client);
185
+ try {
186
+ return await processReferral(client, {
187
+ walletStatus: currentWalletStatus,
188
+ nexusContext,
189
+ modalConfig,
190
+ productId
191
+ });
192
+ } catch (error) {
193
+ return error;
194
+ }
195
+ }
196
+
197
+
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+
207
+ exports.watchWalletStatus = watchWalletStatus; exports.sendInteraction = sendInteraction; exports.displayModal = displayModal; exports.openSso = openSso; exports.siweAuthenticate = siweAuthenticate; exports.sendTransaction = sendTransaction; exports.walletStatus = walletStatus; exports.processReferral = processReferral; exports.referralInteraction = referralInteraction;
@@ -0,0 +1,207 @@
1
+ import {
2
+ Deferred,
3
+ FrakRpcError,
4
+ NexusContextManager,
5
+ RpcErrorCodes
6
+ } from "./chunk-2LAGZ6S5.js";
7
+ import {
8
+ ReferralInteractionEncoder
9
+ } from "./chunk-I47XQDS3.js";
10
+
11
+ // src/core/actions/watchWalletStatus.ts
12
+ function watchWalletStatus(client, callback) {
13
+ return client.listenerRequest(
14
+ {
15
+ method: "frak_listenToWalletStatus"
16
+ },
17
+ callback
18
+ );
19
+ }
20
+
21
+ // src/core/utils/computeProductId.ts
22
+ import { keccak256, toHex } from "viem";
23
+ function computeProductId({ domain }) {
24
+ return keccak256(toHex(domain));
25
+ }
26
+
27
+ // src/core/actions/sendInteraction.ts
28
+ async function sendInteraction(client, { productId, interaction, validation }) {
29
+ const pId = productId ?? computeProductId(client.config);
30
+ return await client.request({
31
+ method: "frak_sendInteraction",
32
+ params: [pId, interaction, validation]
33
+ });
34
+ }
35
+
36
+ // src/core/actions/displayModal.ts
37
+ async function displayModal(client, { steps, metadata }) {
38
+ return await client.request({
39
+ method: "frak_displayModal",
40
+ params: [steps, client.config.metadata.name, metadata]
41
+ });
42
+ }
43
+
44
+ // src/core/actions/openSso.ts
45
+ async function openSso(client, args) {
46
+ const { metadata } = client.config;
47
+ await client.request({
48
+ method: "frak_sso",
49
+ params: [args, metadata.name, metadata.css]
50
+ });
51
+ }
52
+
53
+ // src/core/actions/wrapper/siweAuthenticate.ts
54
+ import { generateSiweNonce } from "viem/siwe";
55
+ async function siweAuthenticate(client, { siwe, metadata }) {
56
+ const realStatement = siwe?.statement ?? `I confirm that I want to use my Frak wallet on: ${client.config.metadata.name}`;
57
+ const builtSiwe = {
58
+ ...siwe,
59
+ statement: realStatement,
60
+ nonce: siwe?.nonce ?? generateSiweNonce(),
61
+ uri: siwe?.uri ?? `https://${client.config.domain}`,
62
+ version: siwe?.version ?? "1",
63
+ domain: client.config.domain
64
+ };
65
+ const result = await displayModal(client, {
66
+ metadata,
67
+ steps: {
68
+ login: {},
69
+ siweAuthenticate: {
70
+ siwe: builtSiwe
71
+ }
72
+ }
73
+ });
74
+ return result.siweAuthenticate;
75
+ }
76
+
77
+ // src/core/actions/wrapper/sendTransaction.ts
78
+ async function sendTransaction(client, { tx, metadata }) {
79
+ const result = await displayModal(client, {
80
+ metadata,
81
+ steps: {
82
+ login: {},
83
+ sendTransaction: { tx }
84
+ }
85
+ });
86
+ return result.sendTransaction;
87
+ }
88
+
89
+ // src/core/actions/wrapper/walletStatus.ts
90
+ async function walletStatus(client, callback) {
91
+ const firstResult = new Deferred();
92
+ let hasResolved = false;
93
+ await watchWalletStatus(client, (status) => {
94
+ callback?.(status);
95
+ if (!hasResolved) {
96
+ firstResult.resolve(status);
97
+ hasResolved = true;
98
+ }
99
+ });
100
+ return firstResult.promise;
101
+ }
102
+
103
+ // src/core/actions/referral/processReferral.ts
104
+ import { isAddressEqual } from "viem";
105
+ async function processReferral(client, {
106
+ walletStatus: walletStatus2,
107
+ nexusContext,
108
+ modalConfig,
109
+ productId
110
+ }) {
111
+ try {
112
+ let currentWallet = getCurrentWallet(walletStatus2);
113
+ if (!nexusContext?.r) {
114
+ if (currentWallet) {
115
+ await NexusContextManager.replaceUrl({
116
+ url: window.location?.href,
117
+ context: { r: currentWallet }
118
+ });
119
+ }
120
+ return "no-referrer";
121
+ }
122
+ if (!currentWallet) {
123
+ currentWallet = await ensureWalletConnected(client, {
124
+ modalConfig,
125
+ walletStatus: walletStatus2
126
+ });
127
+ }
128
+ if (currentWallet && isAddressEqual(nexusContext.r, currentWallet)) {
129
+ return "self-referral";
130
+ }
131
+ if (currentWallet) {
132
+ await NexusContextManager.replaceUrl({
133
+ url: window.location?.href,
134
+ context: { r: currentWallet }
135
+ });
136
+ }
137
+ const interaction = ReferralInteractionEncoder.referred({
138
+ referrer: nexusContext.r
139
+ });
140
+ await sendInteraction(client, { productId, interaction });
141
+ return "success";
142
+ } catch (error) {
143
+ return mapErrorToState(error);
144
+ }
145
+ }
146
+ function getCurrentWallet(walletStatus2) {
147
+ return walletStatus2?.key === "connected" ? walletStatus2.wallet : void 0;
148
+ }
149
+ async function ensureWalletConnected(client, {
150
+ modalConfig,
151
+ walletStatus: walletStatus2
152
+ }) {
153
+ if (walletStatus2?.key !== "connected" || !walletStatus2.interactionSession) {
154
+ if (!modalConfig) {
155
+ return void 0;
156
+ }
157
+ const result = await displayModal(client, modalConfig);
158
+ return result?.login?.wallet ?? void 0;
159
+ }
160
+ return walletStatus2.wallet ?? void 0;
161
+ }
162
+ function mapErrorToState(error) {
163
+ if (error instanceof FrakRpcError) {
164
+ switch (error.code) {
165
+ case RpcErrorCodes.walletNotConnected:
166
+ return "no-wallet";
167
+ case RpcErrorCodes.serverErrorForInteractionDelegation:
168
+ return "no-session";
169
+ default:
170
+ return "error";
171
+ }
172
+ }
173
+ return "error";
174
+ }
175
+
176
+ // src/core/actions/referral/referralInteraction.ts
177
+ async function referralInteraction(client, {
178
+ productId,
179
+ modalConfig
180
+ } = {}) {
181
+ const nexusContext = await NexusContextManager.parse({
182
+ url: window.location.href
183
+ });
184
+ const currentWalletStatus = await walletStatus(client);
185
+ try {
186
+ return await processReferral(client, {
187
+ walletStatus: currentWalletStatus,
188
+ nexusContext,
189
+ modalConfig,
190
+ productId
191
+ });
192
+ } catch (error) {
193
+ return error;
194
+ }
195
+ }
196
+
197
+ export {
198
+ watchWalletStatus,
199
+ sendInteraction,
200
+ displayModal,
201
+ openSso,
202
+ siweAuthenticate,
203
+ sendTransaction,
204
+ walletStatus,
205
+ processReferral,
206
+ referralInteraction
207
+ };
@@ -21,13 +21,16 @@ type NexusWalletSdkConfig = Readonly<{
21
21
  type IFrameLifecycleEvent = {
22
22
  iframeLifecycle: "connected" | "show" | "hide";
23
23
  data?: never;
24
- } | DoBackupEvent;
24
+ } | DoBackupEvent | RemoveBackupEvent;
25
25
  type DoBackupEvent = {
26
26
  iframeLifecycle: "do-backup";
27
27
  data: {
28
28
  backup?: string;
29
29
  };
30
30
  };
31
+ type RemoveBackupEvent = {
32
+ iframeLifecycle: "remove-backup";
33
+ };
31
34
 
32
35
  /**
33
36
  * Event related to the iframe lifecycle
@@ -50,8 +53,8 @@ type RestoreBackupEvent = {
50
53
  * SSO Metadata
51
54
  */
52
55
  type SsoMetadata = {
53
- logoUrl: string;
54
- homepageLink: string;
56
+ logoUrl?: string;
57
+ homepageLink?: string;
55
58
  links?: {
56
59
  confidentialityLink?: string;
57
60
  helpLink?: string;
@@ -357,4 +360,4 @@ type NexusClient = {
357
360
  config: NexusWalletSdkConfig;
358
361
  } & IFrameTransport;
359
362
 
360
- export type { ClientLifecycleEvent as C, DisplayModalParamsType as D, ExtractedParametersFromRpc as E, IFrameRpcSchema as I, LoginModalStepType as L, ModalRpcMetadata as M, NexusClient as N, OpenSsoParamsType as O, RpcResponse as R, SiweAuthenticationParams as S, WalletStatusReturnType as W, SiweAuthenticateReturnType as a, SendTransactionModalStepType as b, SendTransactionReturnType as c, ModalStepTypes as d, ModalRpcStepsResultType as e, NexusWalletSdkConfig as f, SuccessModalStepType as g, SsoMetadata as h, ModalRpcStepsInput as i, ModalStepMetadata as j, SiweAuthenticateModalStepType as k, SendTransactionTxType as l, OpenInteractionSessionReturnType as m, OpenInteractionSessionModalStepType as n, IFrameTransport as o, IFrameRpcEvent as p, IFrameEvent as q, IFrameLifecycleEvent as r, ExtractedReturnTypeFromRpc as s };
363
+ export type { ClientLifecycleEvent as C, DisplayModalParamsType as D, ExtractedParametersFromRpc as E, IFrameRpcSchema as I, LoginModalStepType as L, ModalStepTypes as M, NexusWalletSdkConfig as N, OpenSsoParamsType as O, RpcResponse as R, SuccessModalStepType as S, WalletStatusReturnType as W, NexusClient as a, SsoMetadata as b, ModalRpcMetadata as c, ModalRpcStepsInput as d, ModalRpcStepsResultType as e, ModalStepMetadata as f, SiweAuthenticateModalStepType as g, SiweAuthenticationParams as h, SiweAuthenticateReturnType as i, SendTransactionTxType as j, SendTransactionModalStepType as k, SendTransactionReturnType as l, OpenInteractionSessionReturnType as m, OpenInteractionSessionModalStepType as n, IFrameTransport as o, IFrameRpcEvent as p, IFrameEvent as q, IFrameLifecycleEvent as r, ExtractedReturnTypeFromRpc as s };
@@ -21,13 +21,16 @@ type NexusWalletSdkConfig = Readonly<{
21
21
  type IFrameLifecycleEvent = {
22
22
  iframeLifecycle: "connected" | "show" | "hide";
23
23
  data?: never;
24
- } | DoBackupEvent;
24
+ } | DoBackupEvent | RemoveBackupEvent;
25
25
  type DoBackupEvent = {
26
26
  iframeLifecycle: "do-backup";
27
27
  data: {
28
28
  backup?: string;
29
29
  };
30
30
  };
31
+ type RemoveBackupEvent = {
32
+ iframeLifecycle: "remove-backup";
33
+ };
31
34
 
32
35
  /**
33
36
  * Event related to the iframe lifecycle
@@ -50,8 +53,8 @@ type RestoreBackupEvent = {
50
53
  * SSO Metadata
51
54
  */
52
55
  type SsoMetadata = {
53
- logoUrl: string;
54
- homepageLink: string;
56
+ logoUrl?: string;
57
+ homepageLink?: string;
55
58
  links?: {
56
59
  confidentialityLink?: string;
57
60
  helpLink?: string;
@@ -357,4 +360,4 @@ type NexusClient = {
357
360
  config: NexusWalletSdkConfig;
358
361
  } & IFrameTransport;
359
362
 
360
- export type { ClientLifecycleEvent as C, DisplayModalParamsType as D, ExtractedParametersFromRpc as E, IFrameRpcSchema as I, LoginModalStepType as L, ModalRpcMetadata as M, NexusClient as N, OpenSsoParamsType as O, RpcResponse as R, SiweAuthenticationParams as S, WalletStatusReturnType as W, SiweAuthenticateReturnType as a, SendTransactionModalStepType as b, SendTransactionReturnType as c, ModalStepTypes as d, ModalRpcStepsResultType as e, NexusWalletSdkConfig as f, SuccessModalStepType as g, SsoMetadata as h, ModalRpcStepsInput as i, ModalStepMetadata as j, SiweAuthenticateModalStepType as k, SendTransactionTxType as l, OpenInteractionSessionReturnType as m, OpenInteractionSessionModalStepType as n, IFrameTransport as o, IFrameRpcEvent as p, IFrameEvent as q, IFrameLifecycleEvent as r, ExtractedReturnTypeFromRpc as s };
363
+ export type { ClientLifecycleEvent as C, DisplayModalParamsType as D, ExtractedParametersFromRpc as E, IFrameRpcSchema as I, LoginModalStepType as L, ModalStepTypes as M, NexusWalletSdkConfig as N, OpenSsoParamsType as O, RpcResponse as R, SuccessModalStepType as S, WalletStatusReturnType as W, NexusClient as a, SsoMetadata as b, ModalRpcMetadata as c, ModalRpcStepsInput as d, ModalRpcStepsResultType as e, ModalStepMetadata as f, SiweAuthenticateModalStepType as g, SiweAuthenticationParams as h, SiweAuthenticateReturnType as i, SendTransactionTxType as j, SendTransactionModalStepType as k, SendTransactionReturnType as l, OpenInteractionSessionReturnType as m, OpenInteractionSessionModalStepType as n, IFrameTransport as o, IFrameRpcEvent as p, IFrameEvent as q, IFrameLifecycleEvent as r, ExtractedReturnTypeFromRpc as s };
@@ -5,13 +5,21 @@
5
5
 
6
6
 
7
7
 
8
- var _chunkUOEVM7TRcjs = require('../../chunk-UOEVM7TR.cjs');
9
- require('../../chunk-ETV4XYOV.cjs');
10
8
 
11
9
 
12
10
 
11
+ var _chunkKEATMEOWcjs = require('../../chunk-KEATMEOW.cjs');
12
+ require('../../chunk-4LT3U3H4.cjs');
13
+ require('../../chunk-C25NTD45.cjs');
14
+ require('../../chunk-DILTMQBI.cjs');
13
15
 
14
16
 
15
17
 
16
18
 
17
- exports.displayModal = _chunkUOEVM7TRcjs.displayModal; exports.openSso = _chunkUOEVM7TRcjs.openSso; exports.sendInteraction = _chunkUOEVM7TRcjs.sendInteraction; exports.sendTransaction = _chunkUOEVM7TRcjs.sendTransaction; exports.siweAuthenticate = _chunkUOEVM7TRcjs.siweAuthenticate; exports.watchWalletStatus = _chunkUOEVM7TRcjs.watchWalletStatus;
19
+
20
+
21
+
22
+
23
+
24
+
25
+ exports.displayModal = _chunkKEATMEOWcjs.displayModal; exports.openSso = _chunkKEATMEOWcjs.openSso; exports.processReferral = _chunkKEATMEOWcjs.processReferral; exports.referralInteraction = _chunkKEATMEOWcjs.referralInteraction; exports.sendInteraction = _chunkKEATMEOWcjs.sendInteraction; exports.sendTransaction = _chunkKEATMEOWcjs.sendTransaction; exports.siweAuthenticate = _chunkKEATMEOWcjs.siweAuthenticate; exports.walletStatus = _chunkKEATMEOWcjs.walletStatus; exports.watchWalletStatus = _chunkKEATMEOWcjs.watchWalletStatus;