@frak-labs/nexus-sdk 0.0.13 → 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 (50) 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-FF32LTPI.js → chunk-ARQTOP44.js} +13 -197
  9. package/dist/chunk-C25NTD45.cjs +100 -0
  10. package/dist/chunk-DILTMQBI.cjs +51 -0
  11. package/dist/chunk-I47XQDS3.js +100 -0
  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-B6_BIGc3.d.ts → client-B3Guoe3I.d.ts} +13 -7
  16. package/dist/{client-Oily5ph8.d.cts → client-Of9uIxuI.d.cts} +13 -7
  17. package/dist/core/actions/index.cjs +11 -3
  18. package/dist/core/actions/index.d.cts +33 -9
  19. package/dist/core/actions/index.d.ts +33 -9
  20. package/dist/core/actions/index.js +10 -2
  21. package/dist/core/index.cjs +14 -3
  22. package/dist/core/index.d.cts +84 -5
  23. package/dist/core/index.d.ts +84 -5
  24. package/dist/core/index.js +15 -4
  25. package/dist/core/interactions/index.cjs +3 -5
  26. package/dist/core/interactions/index.d.cts +20 -16
  27. package/dist/core/interactions/index.d.ts +20 -16
  28. package/dist/core/interactions/index.js +4 -6
  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/{interaction-D3-M3nBh.d.ts → interaction-BngPoHA0.d.cts} +1 -1
  32. package/dist/{interaction-D3-M3nBh.d.cts → interaction-BngPoHA0.d.ts} +1 -1
  33. package/dist/react/index.cjs +75 -150
  34. package/dist/react/index.d.cts +8 -9
  35. package/dist/react/index.d.ts +8 -9
  36. package/dist/react/index.js +73 -148
  37. package/dist/{sendTransaction-BHqCq_9X.d.ts → sendTransaction-3d8jO9CJ.d.ts} +1 -1
  38. package/dist/{sendTransaction-BKKYEt8p.d.cts → sendTransaction-Cz6FoB9_.d.cts} +1 -1
  39. package/package.json +5 -5
  40. package/dist/chunk-2SGRLI7T.cjs +0 -427
  41. package/dist/chunk-5CFD5FM2.js +0 -86
  42. package/dist/chunk-ETV4XYOV.cjs +0 -7
  43. package/dist/chunk-GUDT2W6I.js +0 -70
  44. package/dist/chunk-IQQTTKJL.cjs +0 -70
  45. package/dist/chunk-PKBMQBKP.js +0 -7
  46. package/dist/chunk-S5FVCA2E.cjs +0 -86
  47. package/dist/index.cjs +0 -1
  48. package/dist/index.d.cts +0 -2
  49. package/dist/index.d.ts +0 -2
  50. package/dist/index.js +0 -0
@@ -5,13 +5,21 @@
5
5
 
6
6
 
7
7
 
8
- var _chunkS5FVCA2Ecjs = require('../../chunk-S5FVCA2E.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 = _chunkS5FVCA2Ecjs.displayModal; exports.openSso = _chunkS5FVCA2Ecjs.openSso; exports.sendInteraction = _chunkS5FVCA2Ecjs.sendInteraction; exports.sendTransaction = _chunkS5FVCA2Ecjs.sendTransaction; exports.siweAuthenticate = _chunkS5FVCA2Ecjs.siweAuthenticate; exports.watchWalletStatus = _chunkS5FVCA2Ecjs.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;
@@ -1,7 +1,8 @@
1
- import { N as NexusClient, W as WalletStatusReturnType, d as ModalStepTypes, D as DisplayModalParamsType, e as ModalRpcStepsResultType, O as OpenSsoParamsType } from '../../client-Oily5ph8.cjs';
2
- import { S as SendInteractionParamsType, a as SendInteractionReturnType } from '../../interaction-D3-M3nBh.cjs';
3
- export { b as SendTransactionParams, S as SiweAuthenticateModalParams, a as sendTransaction, s as siweAuthenticate } from '../../sendTransaction-BKKYEt8p.cjs';
4
- import 'viem';
1
+ import { a as NexusClient, W as WalletStatusReturnType, M as ModalStepTypes, D as DisplayModalParamsType, e as ModalRpcStepsResultType, O as OpenSsoParamsType } from '../../client-Of9uIxuI.cjs';
2
+ import { S as SendInteractionParamsType, a as SendInteractionReturnType } from '../../interaction-BngPoHA0.cjs';
3
+ export { b as SendTransactionParams, S as SiweAuthenticateModalParams, a as sendTransaction, s as siweAuthenticate } from '../../sendTransaction-Cz6FoB9_.cjs';
4
+ import { Hex } from 'viem';
5
+ import { N as NexusContext } from '../../NexusContext-CSlCNW-G.cjs';
5
6
  import 'viem/chains';
6
7
  import 'viem/siwe';
7
8
 
@@ -15,16 +16,16 @@ declare function watchWalletStatus(client: NexusClient, callback: (status: Walle
15
16
  /**
16
17
  * Function used to send an interaction
17
18
  * @param client
18
- * @param contentId
19
- * @param request
19
+ * @param productId
20
+ * @param interaction
20
21
  * @param validation
21
22
  */
22
- declare function sendInteraction(client: NexusClient, { contentId, interaction, validation }: SendInteractionParamsType): Promise<SendInteractionReturnType>;
23
+ declare function sendInteraction(client: NexusClient, { productId, interaction, validation }: SendInteractionParamsType): Promise<SendInteractionReturnType>;
23
24
 
24
25
  /**
25
26
  * Function used to display a modal
26
27
  * @param client
27
- * @param contentId
28
+ * @param args
28
29
  */
29
30
  declare function displayModal<T extends ModalStepTypes[] = ModalStepTypes[]>(client: NexusClient, { steps, metadata }: DisplayModalParamsType<T>): Promise<ModalRpcStepsResultType<T>>;
30
31
 
@@ -36,4 +37,27 @@ declare function displayModal<T extends ModalStepTypes[] = ModalStepTypes[]>(cli
36
37
  */
37
38
  declare function openSso(client: NexusClient, args: OpenSsoParamsType): Promise<void>;
38
39
 
39
- export { displayModal, openSso, sendInteraction, watchWalletStatus };
40
+ declare function walletStatus(client: NexusClient, callback?: (status: WalletStatusReturnType) => void): Promise<WalletStatusReturnType>;
41
+
42
+ declare function referralInteraction(client: NexusClient, { productId, modalConfig, }?: {
43
+ productId?: Hex;
44
+ modalConfig?: DisplayModalParamsType<ModalStepTypes[]>;
45
+ }): Promise<unknown>;
46
+
47
+ type ReferralState = "idle" | "processing" | "success" | "no-wallet" | "no-session" | "error" | "no-referrer" | "self-referral";
48
+ /**
49
+ * Automatically submit a referral interaction when detected
50
+ * -> And automatically set the referral context in the url
51
+ * @param walletStatus
52
+ * @param nexusContext
53
+ * @param modalConfig
54
+ * @param productId
55
+ */
56
+ declare function processReferral(client: NexusClient, { walletStatus, nexusContext, modalConfig, productId, }: {
57
+ walletStatus?: WalletStatusReturnType;
58
+ nexusContext?: Partial<NexusContext> | null;
59
+ modalConfig?: DisplayModalParamsType<ModalStepTypes[]>;
60
+ productId?: Hex;
61
+ }): Promise<ReferralState>;
62
+
63
+ export { displayModal, openSso, processReferral, referralInteraction, sendInteraction, walletStatus, watchWalletStatus };
@@ -1,7 +1,8 @@
1
- import { N as NexusClient, W as WalletStatusReturnType, d as ModalStepTypes, D as DisplayModalParamsType, e as ModalRpcStepsResultType, O as OpenSsoParamsType } from '../../client-B6_BIGc3.js';
2
- import { S as SendInteractionParamsType, a as SendInteractionReturnType } from '../../interaction-D3-M3nBh.js';
3
- export { b as SendTransactionParams, S as SiweAuthenticateModalParams, a as sendTransaction, s as siweAuthenticate } from '../../sendTransaction-BHqCq_9X.js';
4
- import 'viem';
1
+ import { a as NexusClient, W as WalletStatusReturnType, M as ModalStepTypes, D as DisplayModalParamsType, e as ModalRpcStepsResultType, O as OpenSsoParamsType } from '../../client-B3Guoe3I.js';
2
+ import { S as SendInteractionParamsType, a as SendInteractionReturnType } from '../../interaction-BngPoHA0.js';
3
+ export { b as SendTransactionParams, S as SiweAuthenticateModalParams, a as sendTransaction, s as siweAuthenticate } from '../../sendTransaction-3d8jO9CJ.js';
4
+ import { Hex } from 'viem';
5
+ import { N as NexusContext } from '../../NexusContext-CSlCNW-G.js';
5
6
  import 'viem/chains';
6
7
  import 'viem/siwe';
7
8
 
@@ -15,16 +16,16 @@ declare function watchWalletStatus(client: NexusClient, callback: (status: Walle
15
16
  /**
16
17
  * Function used to send an interaction
17
18
  * @param client
18
- * @param contentId
19
- * @param request
19
+ * @param productId
20
+ * @param interaction
20
21
  * @param validation
21
22
  */
22
- declare function sendInteraction(client: NexusClient, { contentId, interaction, validation }: SendInteractionParamsType): Promise<SendInteractionReturnType>;
23
+ declare function sendInteraction(client: NexusClient, { productId, interaction, validation }: SendInteractionParamsType): Promise<SendInteractionReturnType>;
23
24
 
24
25
  /**
25
26
  * Function used to display a modal
26
27
  * @param client
27
- * @param contentId
28
+ * @param args
28
29
  */
29
30
  declare function displayModal<T extends ModalStepTypes[] = ModalStepTypes[]>(client: NexusClient, { steps, metadata }: DisplayModalParamsType<T>): Promise<ModalRpcStepsResultType<T>>;
30
31
 
@@ -36,4 +37,27 @@ declare function displayModal<T extends ModalStepTypes[] = ModalStepTypes[]>(cli
36
37
  */
37
38
  declare function openSso(client: NexusClient, args: OpenSsoParamsType): Promise<void>;
38
39
 
39
- export { displayModal, openSso, sendInteraction, watchWalletStatus };
40
+ declare function walletStatus(client: NexusClient, callback?: (status: WalletStatusReturnType) => void): Promise<WalletStatusReturnType>;
41
+
42
+ declare function referralInteraction(client: NexusClient, { productId, modalConfig, }?: {
43
+ productId?: Hex;
44
+ modalConfig?: DisplayModalParamsType<ModalStepTypes[]>;
45
+ }): Promise<unknown>;
46
+
47
+ type ReferralState = "idle" | "processing" | "success" | "no-wallet" | "no-session" | "error" | "no-referrer" | "self-referral";
48
+ /**
49
+ * Automatically submit a referral interaction when detected
50
+ * -> And automatically set the referral context in the url
51
+ * @param walletStatus
52
+ * @param nexusContext
53
+ * @param modalConfig
54
+ * @param productId
55
+ */
56
+ declare function processReferral(client: NexusClient, { walletStatus, nexusContext, modalConfig, productId, }: {
57
+ walletStatus?: WalletStatusReturnType;
58
+ nexusContext?: Partial<NexusContext> | null;
59
+ modalConfig?: DisplayModalParamsType<ModalStepTypes[]>;
60
+ productId?: Hex;
61
+ }): Promise<ReferralState>;
62
+
63
+ export { displayModal, openSso, processReferral, referralInteraction, sendInteraction, walletStatus, watchWalletStatus };
@@ -1,17 +1,25 @@
1
1
  import {
2
2
  displayModal,
3
3
  openSso,
4
+ processReferral,
5
+ referralInteraction,
4
6
  sendInteraction,
5
7
  sendTransaction,
6
8
  siweAuthenticate,
9
+ walletStatus,
7
10
  watchWalletStatus
8
- } from "../../chunk-5CFD5FM2.js";
9
- import "../../chunk-PKBMQBKP.js";
11
+ } from "../../chunk-VMNURFPI.js";
12
+ import "../../chunk-2LAGZ6S5.js";
13
+ import "../../chunk-I47XQDS3.js";
14
+ import "../../chunk-K4FOGADW.js";
10
15
  export {
11
16
  displayModal,
12
17
  openSso,
18
+ processReferral,
19
+ referralInteraction,
13
20
  sendInteraction,
14
21
  sendTransaction,
15
22
  siweAuthenticate,
23
+ walletStatus,
16
24
  watchWalletStatus
17
25
  };
@@ -1,17 +1,28 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
+ var _chunk4ADWI2GGcjs = require('../chunk-4ADWI2GG.cjs');
3
4
 
4
5
 
5
6
 
6
7
 
7
8
 
8
- var _chunk2SGRLI7Tcjs = require('../chunk-2SGRLI7T.cjs');
9
- require('../chunk-ETV4XYOV.cjs');
10
9
 
11
10
 
11
+ var _chunk4LT3U3H4cjs = require('../chunk-4LT3U3H4.cjs');
12
12
 
13
13
 
14
14
 
15
15
 
16
+ var _chunkDILTMQBIcjs = require('../chunk-DILTMQBI.cjs');
16
17
 
17
- exports.FrakRpcError = _chunk2SGRLI7Tcjs.FrakRpcError; exports.RpcErrorCodes = _chunk2SGRLI7Tcjs.RpcErrorCodes; exports.createIFrameNexusClient = _chunk2SGRLI7Tcjs.createIFrameNexusClient; exports.createIframe = _chunk2SGRLI7Tcjs.createIframe; exports.decompressDataAndCheckHash = _chunk2SGRLI7Tcjs.decompressDataAndCheckHash; exports.hashAndCompressData = _chunk2SGRLI7Tcjs.hashAndCompressData;
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+ exports.FrakRpcError = _chunk4LT3U3H4cjs.FrakRpcError; exports.NexusContextManager = _chunk4LT3U3H4cjs.NexusContextManager; exports.RpcErrorCodes = _chunk4LT3U3H4cjs.RpcErrorCodes; exports.createIFrameNexusClient = _chunk4ADWI2GGcjs.createIFrameNexusClient; exports.createIframe = _chunk4LT3U3H4cjs.createIframe; exports.decompressDataAndCheckHash = _chunk4LT3U3H4cjs.decompressDataAndCheckHash; exports.hashAndCompressData = _chunk4LT3U3H4cjs.hashAndCompressData; exports.interactionTypes = _chunkDILTMQBIcjs.interactionTypes; exports.productTypes = _chunkDILTMQBIcjs.productTypes; exports.productTypesMask = _chunkDILTMQBIcjs.productTypesMask;
@@ -1,7 +1,9 @@
1
- import { f as NexusWalletSdkConfig, N as NexusClient } from '../client-Oily5ph8.cjs';
2
- export { C as ClientLifecycleEvent, D as DisplayModalParamsType, E as ExtractedParametersFromRpc, s as ExtractedReturnTypeFromRpc, q as IFrameEvent, r as IFrameLifecycleEvent, p as IFrameRpcEvent, I as IFrameRpcSchema, o as IFrameTransport, L as LoginModalStepType, M as ModalRpcMetadata, i as ModalRpcStepsInput, e as ModalRpcStepsResultType, j as ModalStepMetadata, d as ModalStepTypes, n as OpenInteractionSessionModalStepType, m as OpenInteractionSessionReturnType, O as OpenSsoParamsType, R as RpcResponse, b as SendTransactionModalStepType, c as SendTransactionReturnType, l as SendTransactionTxType, k as SiweAuthenticateModalStepType, a as SiweAuthenticateReturnType, S as SiweAuthenticationParams, h as SsoMetadata, g as SuccessModalStepType, W as WalletStatusReturnType } from '../client-Oily5ph8.cjs';
3
- export { P as PreparedInteraction, S as SendInteractionParamsType, a as SendInteractionReturnType } from '../interaction-D3-M3nBh.cjs';
4
- export { F as FrakRpcError, R as RpcErrorCodes } from '../error-C4Zm5nQe.cjs';
1
+ import { N as NexusWalletSdkConfig, a as NexusClient } from '../client-Of9uIxuI.cjs';
2
+ export { C as ClientLifecycleEvent, D as DisplayModalParamsType, E as ExtractedParametersFromRpc, s as ExtractedReturnTypeFromRpc, q as IFrameEvent, r as IFrameLifecycleEvent, p as IFrameRpcEvent, I as IFrameRpcSchema, o as IFrameTransport, L as LoginModalStepType, c as ModalRpcMetadata, d as ModalRpcStepsInput, e as ModalRpcStepsResultType, f as ModalStepMetadata, M as ModalStepTypes, n as OpenInteractionSessionModalStepType, m as OpenInteractionSessionReturnType, O as OpenSsoParamsType, R as RpcResponse, k as SendTransactionModalStepType, l as SendTransactionReturnType, j as SendTransactionTxType, g as SiweAuthenticateModalStepType, i as SiweAuthenticateReturnType, h as SiweAuthenticationParams, b as SsoMetadata, S as SuccessModalStepType, W as WalletStatusReturnType } from '../client-Of9uIxuI.cjs';
3
+ import { Address } from '../abi.js';
4
+ import { N as NexusContext } from '../NexusContext-CSlCNW-G.cjs';
5
+ export { P as PreparedInteraction, S as SendInteractionParamsType, a as SendInteractionReturnType } from '../interaction-BngPoHA0.cjs';
6
+ export { F as FrakRpcError, R as RpcErrorCodes } from '../error-Dflr3G5x.cjs';
5
7
  import 'viem';
6
8
  import 'viem/chains';
7
9
  import 'viem/siwe';
@@ -53,4 +55,81 @@ declare function hashAndCompressData<T>(data: T): Promise<CompressedData>;
53
55
  */
54
56
  declare function decompressDataAndCheckHash<T>(compressedData: CompressedData): Promise<HashProtectedData<T>>;
55
57
 
56
- export { type CompressedData, type HashProtectedData, type KeyProvider, NexusClient, NexusWalletSdkConfig, createIFrameNexusClient, createIframe, decompressDataAndCheckHash, hashAndCompressData };
58
+ /**
59
+ * Parse the current Nexus context in the given url
60
+ * @param url
61
+ */
62
+ declare function parse({ url }: {
63
+ url: string;
64
+ }): Promise<Readonly<{
65
+ r: Address;
66
+ }> | null>;
67
+ /**
68
+ * Populate the current url with the given Nexus context
69
+ */
70
+ declare function update({ url, context, }: {
71
+ url?: string;
72
+ context: Partial<NexusContext>;
73
+ }): Promise<string | null | undefined>;
74
+ declare function replaceUrl({ url, context, }: {
75
+ url?: string;
76
+ context: Partial<NexusContext>;
77
+ }): Promise<void>;
78
+ /**
79
+ * Export our nexus context "class"
80
+ */
81
+ declare const NexusContextManager: {
82
+ parse: typeof parse;
83
+ update: typeof update;
84
+ replaceUrl: typeof replaceUrl;
85
+ };
86
+
87
+ /**
88
+ * The keys for each product types
89
+ */
90
+ type ProductTypesKey = keyof typeof productTypes;
91
+ /**
92
+ * List of the product types per denominator
93
+ */
94
+ declare const productTypes: {
95
+ dapp: number;
96
+ press: number;
97
+ webshop: number;
98
+ referral: number;
99
+ purchase: number;
100
+ };
101
+ /**
102
+ * Bitmask for each product types
103
+ */
104
+ declare const productTypesMask: Record<ProductTypesKey, bigint>;
105
+
106
+ /**
107
+ * The keys for each interaction types
108
+ */
109
+ type InteractionTypesKey = {
110
+ [K in keyof typeof interactionTypes]: keyof (typeof interactionTypes)[K];
111
+ }[keyof typeof interactionTypes];
112
+ /**
113
+ * Each interactions types according to the product types
114
+ */
115
+ declare const interactionTypes: {
116
+ readonly press: {
117
+ readonly openArticle: "0xc0a24ffb";
118
+ readonly readArticle: "0xd5bd0fbe";
119
+ };
120
+ readonly dapp: {
121
+ readonly proofVerifiableStorageUpdate: "0x2ab2aeef";
122
+ readonly callableVerifiableStorageUpdate: "0xa07da986";
123
+ };
124
+ readonly webshop: {};
125
+ readonly referral: {
126
+ readonly referred: "0x010cc3b9";
127
+ readonly createLink: "0xb2c0f17c";
128
+ };
129
+ readonly purchase: {
130
+ readonly started: "0xd87e90c3";
131
+ readonly completed: "0x8403aeb4";
132
+ };
133
+ };
134
+
135
+ export { type CompressedData, type HashProtectedData, type InteractionTypesKey, type KeyProvider, NexusClient, NexusContextManager, NexusWalletSdkConfig, type ProductTypesKey, createIFrameNexusClient, createIframe, decompressDataAndCheckHash, hashAndCompressData, interactionTypes, productTypes, productTypesMask };
@@ -1,7 +1,9 @@
1
- import { f as NexusWalletSdkConfig, N as NexusClient } from '../client-B6_BIGc3.js';
2
- export { C as ClientLifecycleEvent, D as DisplayModalParamsType, E as ExtractedParametersFromRpc, s as ExtractedReturnTypeFromRpc, q as IFrameEvent, r as IFrameLifecycleEvent, p as IFrameRpcEvent, I as IFrameRpcSchema, o as IFrameTransport, L as LoginModalStepType, M as ModalRpcMetadata, i as ModalRpcStepsInput, e as ModalRpcStepsResultType, j as ModalStepMetadata, d as ModalStepTypes, n as OpenInteractionSessionModalStepType, m as OpenInteractionSessionReturnType, O as OpenSsoParamsType, R as RpcResponse, b as SendTransactionModalStepType, c as SendTransactionReturnType, l as SendTransactionTxType, k as SiweAuthenticateModalStepType, a as SiweAuthenticateReturnType, S as SiweAuthenticationParams, h as SsoMetadata, g as SuccessModalStepType, W as WalletStatusReturnType } from '../client-B6_BIGc3.js';
3
- export { P as PreparedInteraction, S as SendInteractionParamsType, a as SendInteractionReturnType } from '../interaction-D3-M3nBh.js';
4
- export { F as FrakRpcError, R as RpcErrorCodes } from '../error-C4Zm5nQe.js';
1
+ import { N as NexusWalletSdkConfig, a as NexusClient } from '../client-B3Guoe3I.js';
2
+ export { C as ClientLifecycleEvent, D as DisplayModalParamsType, E as ExtractedParametersFromRpc, s as ExtractedReturnTypeFromRpc, q as IFrameEvent, r as IFrameLifecycleEvent, p as IFrameRpcEvent, I as IFrameRpcSchema, o as IFrameTransport, L as LoginModalStepType, c as ModalRpcMetadata, d as ModalRpcStepsInput, e as ModalRpcStepsResultType, f as ModalStepMetadata, M as ModalStepTypes, n as OpenInteractionSessionModalStepType, m as OpenInteractionSessionReturnType, O as OpenSsoParamsType, R as RpcResponse, k as SendTransactionModalStepType, l as SendTransactionReturnType, j as SendTransactionTxType, g as SiweAuthenticateModalStepType, i as SiweAuthenticateReturnType, h as SiweAuthenticationParams, b as SsoMetadata, S as SuccessModalStepType, W as WalletStatusReturnType } from '../client-B3Guoe3I.js';
3
+ import { Address } from '../abi.js';
4
+ import { N as NexusContext } from '../NexusContext-CSlCNW-G.js';
5
+ export { P as PreparedInteraction, S as SendInteractionParamsType, a as SendInteractionReturnType } from '../interaction-BngPoHA0.js';
6
+ export { F as FrakRpcError, R as RpcErrorCodes } from '../error-Dflr3G5x.js';
5
7
  import 'viem';
6
8
  import 'viem/chains';
7
9
  import 'viem/siwe';
@@ -53,4 +55,81 @@ declare function hashAndCompressData<T>(data: T): Promise<CompressedData>;
53
55
  */
54
56
  declare function decompressDataAndCheckHash<T>(compressedData: CompressedData): Promise<HashProtectedData<T>>;
55
57
 
56
- export { type CompressedData, type HashProtectedData, type KeyProvider, NexusClient, NexusWalletSdkConfig, createIFrameNexusClient, createIframe, decompressDataAndCheckHash, hashAndCompressData };
58
+ /**
59
+ * Parse the current Nexus context in the given url
60
+ * @param url
61
+ */
62
+ declare function parse({ url }: {
63
+ url: string;
64
+ }): Promise<Readonly<{
65
+ r: Address;
66
+ }> | null>;
67
+ /**
68
+ * Populate the current url with the given Nexus context
69
+ */
70
+ declare function update({ url, context, }: {
71
+ url?: string;
72
+ context: Partial<NexusContext>;
73
+ }): Promise<string | null | undefined>;
74
+ declare function replaceUrl({ url, context, }: {
75
+ url?: string;
76
+ context: Partial<NexusContext>;
77
+ }): Promise<void>;
78
+ /**
79
+ * Export our nexus context "class"
80
+ */
81
+ declare const NexusContextManager: {
82
+ parse: typeof parse;
83
+ update: typeof update;
84
+ replaceUrl: typeof replaceUrl;
85
+ };
86
+
87
+ /**
88
+ * The keys for each product types
89
+ */
90
+ type ProductTypesKey = keyof typeof productTypes;
91
+ /**
92
+ * List of the product types per denominator
93
+ */
94
+ declare const productTypes: {
95
+ dapp: number;
96
+ press: number;
97
+ webshop: number;
98
+ referral: number;
99
+ purchase: number;
100
+ };
101
+ /**
102
+ * Bitmask for each product types
103
+ */
104
+ declare const productTypesMask: Record<ProductTypesKey, bigint>;
105
+
106
+ /**
107
+ * The keys for each interaction types
108
+ */
109
+ type InteractionTypesKey = {
110
+ [K in keyof typeof interactionTypes]: keyof (typeof interactionTypes)[K];
111
+ }[keyof typeof interactionTypes];
112
+ /**
113
+ * Each interactions types according to the product types
114
+ */
115
+ declare const interactionTypes: {
116
+ readonly press: {
117
+ readonly openArticle: "0xc0a24ffb";
118
+ readonly readArticle: "0xd5bd0fbe";
119
+ };
120
+ readonly dapp: {
121
+ readonly proofVerifiableStorageUpdate: "0x2ab2aeef";
122
+ readonly callableVerifiableStorageUpdate: "0xa07da986";
123
+ };
124
+ readonly webshop: {};
125
+ readonly referral: {
126
+ readonly referred: "0x010cc3b9";
127
+ readonly createLink: "0xb2c0f17c";
128
+ };
129
+ readonly purchase: {
130
+ readonly started: "0xd87e90c3";
131
+ readonly completed: "0x8403aeb4";
132
+ };
133
+ };
134
+
135
+ export { type CompressedData, type HashProtectedData, type InteractionTypesKey, type KeyProvider, NexusClient, NexusContextManager, NexusWalletSdkConfig, type ProductTypesKey, createIFrameNexusClient, createIframe, decompressDataAndCheckHash, hashAndCompressData, interactionTypes, productTypes, productTypesMask };
@@ -1,17 +1,28 @@
1
+ import {
2
+ createIFrameNexusClient
3
+ } from "../chunk-ARQTOP44.js";
1
4
  import {
2
5
  FrakRpcError,
6
+ NexusContextManager,
3
7
  RpcErrorCodes,
4
- createIFrameNexusClient,
5
8
  createIframe,
6
9
  decompressDataAndCheckHash,
7
10
  hashAndCompressData
8
- } from "../chunk-FF32LTPI.js";
9
- import "../chunk-PKBMQBKP.js";
11
+ } from "../chunk-2LAGZ6S5.js";
12
+ import {
13
+ interactionTypes,
14
+ productTypes,
15
+ productTypesMask
16
+ } from "../chunk-K4FOGADW.js";
10
17
  export {
11
18
  FrakRpcError,
19
+ NexusContextManager,
12
20
  RpcErrorCodes,
13
21
  createIFrameNexusClient,
14
22
  createIframe,
15
23
  decompressDataAndCheckHash,
16
- hashAndCompressData
24
+ hashAndCompressData,
25
+ interactionTypes,
26
+ productTypes,
27
+ productTypesMask
17
28
  };
@@ -2,12 +2,10 @@
2
2
 
3
3
 
4
4
 
5
+ var _chunkC25NTD45cjs = require('../../chunk-C25NTD45.cjs');
6
+ require('../../chunk-DILTMQBI.cjs');
5
7
 
6
- var _chunkIQQTTKJLcjs = require('../../chunk-IQQTTKJL.cjs');
7
- require('../../chunk-ETV4XYOV.cjs');
8
8
 
9
9
 
10
10
 
11
-
12
-
13
- exports.PressActionsSelector = _chunkIQQTTKJLcjs.PressActionsSelector; exports.PressInteractionEncoder = _chunkIQQTTKJLcjs.PressInteractionEncoder; exports.ReferralActionsSelector = _chunkIQQTTKJLcjs.ReferralActionsSelector; exports.ReferralInteractionEncoder = _chunkIQQTTKJLcjs.ReferralInteractionEncoder;
11
+ exports.PressInteractionEncoder = _chunkC25NTD45cjs.PressInteractionEncoder; exports.PurchaseInteractionEncoder = _chunkC25NTD45cjs.PurchaseInteractionEncoder; exports.ReferralInteractionEncoder = _chunkC25NTD45cjs.ReferralInteractionEncoder;
@@ -1,13 +1,6 @@
1
1
  import { Hex, Address } from 'viem';
2
- import { P as PreparedInteraction } from '../../interaction-D3-M3nBh.cjs';
2
+ import { P as PreparedInteraction } from '../../interaction-BngPoHA0.cjs';
3
3
 
4
- /**
5
- * All the press interactions actions
6
- */
7
- declare const PressActionsSelector: {
8
- readonly OpenArticle: "0xc0a24ffb";
9
- readonly ReadArticle: "0xd5bd0fbe";
10
- };
11
4
  /**
12
5
  * Encode an open article interaction
13
6
  * @param articleId
@@ -27,13 +20,6 @@ declare const PressInteractionEncoder: {
27
20
  readArticle: typeof readArticle;
28
21
  };
29
22
 
30
- /**
31
- * All the referral interactions actions
32
- */
33
- declare const ReferralActionsSelector: {
34
- readonly CreateLink: "0xb2c0f17c";
35
- readonly Referred: "0x010cc3b9";
36
- };
37
23
  /**
38
24
  * Encode a create referral link interaction
39
25
  */
@@ -50,4 +36,22 @@ declare const ReferralInteractionEncoder: {
50
36
  referred: typeof referred;
51
37
  };
52
38
 
53
- export { PressActionsSelector, PressInteractionEncoder, ReferralActionsSelector, ReferralInteractionEncoder };
39
+ /**
40
+ * Encode a start purchase interaction
41
+ */
42
+ declare function startPurchase({ purchaseId, }: {
43
+ purchaseId: Hex;
44
+ }): PreparedInteraction;
45
+ /**
46
+ * Encode a complete purchase interaction
47
+ */
48
+ declare function completedPurchase({ purchaseId, proof, }: {
49
+ purchaseId: Hex;
50
+ proof: Hex[];
51
+ }): PreparedInteraction;
52
+ declare const PurchaseInteractionEncoder: {
53
+ startPurchase: typeof startPurchase;
54
+ completedPurchase: typeof completedPurchase;
55
+ };
56
+
57
+ export { PressInteractionEncoder, PurchaseInteractionEncoder, ReferralInteractionEncoder };
@@ -1,13 +1,6 @@
1
1
  import { Hex, Address } from 'viem';
2
- import { P as PreparedInteraction } from '../../interaction-D3-M3nBh.js';
2
+ import { P as PreparedInteraction } from '../../interaction-BngPoHA0.js';
3
3
 
4
- /**
5
- * All the press interactions actions
6
- */
7
- declare const PressActionsSelector: {
8
- readonly OpenArticle: "0xc0a24ffb";
9
- readonly ReadArticle: "0xd5bd0fbe";
10
- };
11
4
  /**
12
5
  * Encode an open article interaction
13
6
  * @param articleId
@@ -27,13 +20,6 @@ declare const PressInteractionEncoder: {
27
20
  readArticle: typeof readArticle;
28
21
  };
29
22
 
30
- /**
31
- * All the referral interactions actions
32
- */
33
- declare const ReferralActionsSelector: {
34
- readonly CreateLink: "0xb2c0f17c";
35
- readonly Referred: "0x010cc3b9";
36
- };
37
23
  /**
38
24
  * Encode a create referral link interaction
39
25
  */
@@ -50,4 +36,22 @@ declare const ReferralInteractionEncoder: {
50
36
  referred: typeof referred;
51
37
  };
52
38
 
53
- export { PressActionsSelector, PressInteractionEncoder, ReferralActionsSelector, ReferralInteractionEncoder };
39
+ /**
40
+ * Encode a start purchase interaction
41
+ */
42
+ declare function startPurchase({ purchaseId, }: {
43
+ purchaseId: Hex;
44
+ }): PreparedInteraction;
45
+ /**
46
+ * Encode a complete purchase interaction
47
+ */
48
+ declare function completedPurchase({ purchaseId, proof, }: {
49
+ purchaseId: Hex;
50
+ proof: Hex[];
51
+ }): PreparedInteraction;
52
+ declare const PurchaseInteractionEncoder: {
53
+ startPurchase: typeof startPurchase;
54
+ completedPurchase: typeof completedPurchase;
55
+ };
56
+
57
+ export { PressInteractionEncoder, PurchaseInteractionEncoder, ReferralInteractionEncoder };
@@ -1,13 +1,11 @@
1
1
  import {
2
- PressActionsSelector,
3
2
  PressInteractionEncoder,
4
- ReferralActionsSelector,
3
+ PurchaseInteractionEncoder,
5
4
  ReferralInteractionEncoder
6
- } from "../../chunk-GUDT2W6I.js";
7
- import "../../chunk-PKBMQBKP.js";
5
+ } from "../../chunk-I47XQDS3.js";
6
+ import "../../chunk-K4FOGADW.js";
8
7
  export {
9
- PressActionsSelector,
10
8
  PressInteractionEncoder,
11
- ReferralActionsSelector,
9
+ PurchaseInteractionEncoder,
12
10
  ReferralInteractionEncoder
13
11
  };
@@ -21,7 +21,7 @@ declare const RpcErrorCodes: {
21
21
  readonly corruptedResponse: -32003;
22
22
  readonly clientAborted: -32004;
23
23
  readonly walletNotConnected: -32005;
24
- readonly noInteractionSession: -32006;
24
+ readonly serverErrorForInteractionDelegation: -32006;
25
25
  };
26
26
 
27
27
  export { FrakRpcError as F, RpcErrorCodes as R };
@@ -21,7 +21,7 @@ declare const RpcErrorCodes: {
21
21
  readonly corruptedResponse: -32003;
22
22
  readonly clientAborted: -32004;
23
23
  readonly walletNotConnected: -32005;
24
- readonly noInteractionSession: -32006;
24
+ readonly serverErrorForInteractionDelegation: -32006;
25
25
  };
26
26
 
27
27
  export { FrakRpcError as F, RpcErrorCodes as R };
@@ -8,7 +8,7 @@ type PreparedInteraction = Readonly<{
8
8
  * Parameters of an interaction handling request
9
9
  */
10
10
  type SendInteractionParamsType = {
11
- contentId?: Hex;
11
+ productId?: Hex;
12
12
  interaction: PreparedInteraction;
13
13
  validation?: Hex;
14
14
  };
@@ -8,7 +8,7 @@ type PreparedInteraction = Readonly<{
8
8
  * Parameters of an interaction handling request
9
9
  */
10
10
  type SendInteractionParamsType = {
11
- contentId?: Hex;
11
+ productId?: Hex;
12
12
  interaction: PreparedInteraction;
13
13
  validation?: Hex;
14
14
  };