@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.
- package/README.md +4 -4
- package/dist/NexusContext-CSlCNW-G.d.cts +10 -0
- package/dist/NexusContext-CSlCNW-G.d.ts +10 -0
- package/dist/bundle/bundle.js +21 -0
- package/dist/chunk-2LAGZ6S5.js +246 -0
- package/dist/chunk-4ADWI2GG.cjs +243 -0
- package/dist/chunk-4LT3U3H4.cjs +246 -0
- package/dist/{chunk-5LZQXBFJ.js → chunk-ARQTOP44.js} +12 -196
- package/dist/chunk-C25NTD45.cjs +100 -0
- package/dist/chunk-DILTMQBI.cjs +51 -0
- package/dist/{chunk-IH3QWPWT.js → chunk-I47XQDS3.js} +44 -16
- package/dist/chunk-K4FOGADW.js +51 -0
- package/dist/chunk-KEATMEOW.cjs +207 -0
- package/dist/chunk-VMNURFPI.js +207 -0
- package/dist/{client-DJd7-ajw.d.ts → client-B3Guoe3I.d.ts} +7 -4
- package/dist/{client-DXITs1Kf.d.cts → client-Of9uIxuI.d.cts} +7 -4
- package/dist/core/actions/index.cjs +11 -3
- package/dist/core/actions/index.d.cts +28 -4
- package/dist/core/actions/index.d.ts +28 -4
- package/dist/core/actions/index.js +10 -2
- package/dist/core/index.cjs +9 -4
- package/dist/core/index.d.cts +66 -4
- package/dist/core/index.d.ts +66 -4
- package/dist/core/index.js +9 -4
- package/dist/core/interactions/index.cjs +3 -6
- package/dist/core/interactions/index.d.cts +19 -15
- package/dist/core/interactions/index.d.ts +19 -15
- package/dist/core/interactions/index.js +4 -7
- package/dist/{error-C4Zm5nQe.d.cts → error-Dflr3G5x.d.cts} +1 -1
- package/dist/{error-C4Zm5nQe.d.ts → error-Dflr3G5x.d.ts} +1 -1
- package/dist/react/index.cjs +74 -150
- package/dist/react/index.d.cts +4 -5
- package/dist/react/index.d.ts +4 -5
- package/dist/react/index.js +72 -148
- package/dist/{sendTransaction-fLvpfqaQ.d.ts → sendTransaction-3d8jO9CJ.d.ts} +1 -1
- package/dist/{sendTransaction-C19oCc6X.d.cts → sendTransaction-Cz6FoB9_.d.cts} +1 -1
- package/package.json +5 -5
- package/dist/chunk-22T2NHQK.js +0 -22
- package/dist/chunk-5SGDBU5S.cjs +0 -427
- package/dist/chunk-AANA3LEO.cjs +0 -22
- package/dist/chunk-ETV4XYOV.cjs +0 -7
- package/dist/chunk-PKBMQBKP.js +0 -7
- package/dist/chunk-PURWUKEM.cjs +0 -72
- package/dist/chunk-S223FMEJ.js +0 -86
- package/dist/chunk-UOEVM7TR.cjs +0 -86
- package/dist/index.cjs +0 -1
- package/dist/index.d.cts +0 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
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
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-
|
|
4
|
-
import 'viem';
|
|
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
|
|
|
@@ -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
|
-
|
|
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 {
|
|
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
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-
|
|
4
|
-
import 'viem';
|
|
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
|
|
|
@@ -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
|
-
|
|
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-
|
|
9
|
-
import "../../chunk-
|
|
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
|
};
|
package/dist/core/index.cjs
CHANGED
|
@@ -1,23 +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 _chunk5SGDBU5Scjs = require('../chunk-5SGDBU5S.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
+
var _chunk4LT3U3H4cjs = require('../chunk-4LT3U3H4.cjs');
|
|
11
12
|
|
|
12
|
-
var _chunkAANA3LEOcjs = require('../chunk-AANA3LEO.cjs');
|
|
13
|
-
require('../chunk-ETV4XYOV.cjs');
|
|
14
13
|
|
|
15
14
|
|
|
16
15
|
|
|
16
|
+
var _chunkDILTMQBIcjs = require('../chunk-DILTMQBI.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
|
|
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;
|
package/dist/core/index.d.cts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
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,
|
|
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';
|
|
3
5
|
export { P as PreparedInteraction, S as SendInteractionParamsType, a as SendInteractionReturnType } from '../interaction-BngPoHA0.cjs';
|
|
4
|
-
export { F as FrakRpcError, R as RpcErrorCodes } from '../error-
|
|
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,6 +55,35 @@ declare function hashAndCompressData<T>(data: T): Promise<CompressedData>;
|
|
|
53
55
|
*/
|
|
54
56
|
declare function decompressDataAndCheckHash<T>(compressedData: CompressedData): Promise<HashProtectedData<T>>;
|
|
55
57
|
|
|
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
|
+
|
|
56
87
|
/**
|
|
57
88
|
* The keys for each product types
|
|
58
89
|
*/
|
|
@@ -63,11 +94,42 @@ type ProductTypesKey = keyof typeof productTypes;
|
|
|
63
94
|
declare const productTypes: {
|
|
64
95
|
dapp: number;
|
|
65
96
|
press: number;
|
|
97
|
+
webshop: number;
|
|
66
98
|
referral: number;
|
|
99
|
+
purchase: number;
|
|
67
100
|
};
|
|
68
101
|
/**
|
|
69
102
|
* Bitmask for each product types
|
|
70
103
|
*/
|
|
71
104
|
declare const productTypesMask: Record<ProductTypesKey, bigint>;
|
|
72
105
|
|
|
73
|
-
|
|
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 };
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
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,
|
|
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';
|
|
3
5
|
export { P as PreparedInteraction, S as SendInteractionParamsType, a as SendInteractionReturnType } from '../interaction-BngPoHA0.js';
|
|
4
|
-
export { F as FrakRpcError, R as RpcErrorCodes } from '../error-
|
|
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,6 +55,35 @@ declare function hashAndCompressData<T>(data: T): Promise<CompressedData>;
|
|
|
53
55
|
*/
|
|
54
56
|
declare function decompressDataAndCheckHash<T>(compressedData: CompressedData): Promise<HashProtectedData<T>>;
|
|
55
57
|
|
|
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
|
+
|
|
56
87
|
/**
|
|
57
88
|
* The keys for each product types
|
|
58
89
|
*/
|
|
@@ -63,11 +94,42 @@ type ProductTypesKey = keyof typeof productTypes;
|
|
|
63
94
|
declare const productTypes: {
|
|
64
95
|
dapp: number;
|
|
65
96
|
press: number;
|
|
97
|
+
webshop: number;
|
|
66
98
|
referral: number;
|
|
99
|
+
purchase: number;
|
|
67
100
|
};
|
|
68
101
|
/**
|
|
69
102
|
* Bitmask for each product types
|
|
70
103
|
*/
|
|
71
104
|
declare const productTypesMask: Record<ProductTypesKey, bigint>;
|
|
72
105
|
|
|
73
|
-
|
|
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 };
|
package/dist/core/index.js
CHANGED
|
@@ -1,23 +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-
|
|
11
|
+
} from "../chunk-2LAGZ6S5.js";
|
|
9
12
|
import {
|
|
13
|
+
interactionTypes,
|
|
10
14
|
productTypes,
|
|
11
15
|
productTypesMask
|
|
12
|
-
} from "../chunk-
|
|
13
|
-
import "../chunk-PKBMQBKP.js";
|
|
16
|
+
} from "../chunk-K4FOGADW.js";
|
|
14
17
|
export {
|
|
15
18
|
FrakRpcError,
|
|
19
|
+
NexusContextManager,
|
|
16
20
|
RpcErrorCodes,
|
|
17
21
|
createIFrameNexusClient,
|
|
18
22
|
createIframe,
|
|
19
23
|
decompressDataAndCheckHash,
|
|
20
24
|
hashAndCompressData,
|
|
25
|
+
interactionTypes,
|
|
21
26
|
productTypes,
|
|
22
27
|
productTypesMask
|
|
23
28
|
};
|
|
@@ -2,13 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
var _chunkC25NTD45cjs = require('../../chunk-C25NTD45.cjs');
|
|
6
|
+
require('../../chunk-DILTMQBI.cjs');
|
|
5
7
|
|
|
6
|
-
var _chunkPURWUKEMcjs = require('../../chunk-PURWUKEM.cjs');
|
|
7
|
-
require('../../chunk-AANA3LEO.cjs');
|
|
8
|
-
require('../../chunk-ETV4XYOV.cjs');
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
exports.PressActionsSelector = _chunkPURWUKEMcjs.PressActionsSelector; exports.PressInteractionEncoder = _chunkPURWUKEMcjs.PressInteractionEncoder; exports.ReferralActionsSelector = _chunkPURWUKEMcjs.ReferralActionsSelector; exports.ReferralInteractionEncoder = _chunkPURWUKEMcjs.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
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
|
-
|
|
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
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
|
-
|
|
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,14 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
PressActionsSelector,
|
|
3
2
|
PressInteractionEncoder,
|
|
4
|
-
|
|
3
|
+
PurchaseInteractionEncoder,
|
|
5
4
|
ReferralInteractionEncoder
|
|
6
|
-
} from "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-PKBMQBKP.js";
|
|
5
|
+
} from "../../chunk-I47XQDS3.js";
|
|
6
|
+
import "../../chunk-K4FOGADW.js";
|
|
9
7
|
export {
|
|
10
|
-
PressActionsSelector,
|
|
11
8
|
PressInteractionEncoder,
|
|
12
|
-
|
|
9
|
+
PurchaseInteractionEncoder,
|
|
13
10
|
ReferralInteractionEncoder
|
|
14
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
|
|
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
|
|
24
|
+
readonly serverErrorForInteractionDelegation: -32006;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
export { FrakRpcError as F, RpcErrorCodes as R };
|