@frak-labs/nexus-sdk 0.0.15 → 0.0.17
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/dist/{NexusContext-CSlCNW-G.d.cts → FrakContext-LbQht1ep.d.cts} +2 -2
- package/dist/{NexusContext-CSlCNW-G.d.ts → FrakContext-LbQht1ep.d.ts} +2 -2
- package/dist/bundle/bundle.js +3 -3
- package/dist/{chunk-KEATMEOW.cjs → chunk-6GPWXPN4.cjs} +26 -23
- package/dist/{chunk-C25NTD45.cjs → chunk-A3XYA7S7.cjs} +28 -14
- package/dist/{chunk-2LAGZ6S5.js → chunk-B75G6TB3.js} +38 -30
- package/dist/{chunk-VMNURFPI.js → chunk-BP7RT2HB.js} +19 -16
- package/dist/{chunk-4ADWI2GG.cjs → chunk-ES3EBWJ6.cjs} +18 -18
- package/dist/{chunk-4LT3U3H4.cjs → chunk-H7YKYMTC.cjs} +41 -33
- package/dist/{chunk-K4FOGADW.js → chunk-HY6YATLS.js} +3 -1
- package/dist/{chunk-I47XQDS3.js → chunk-TIKEZMSD.js} +16 -2
- package/dist/{chunk-DILTMQBI.cjs → chunk-UFJ7W6CQ.cjs} +3 -1
- package/dist/{chunk-ARQTOP44.js → chunk-VXVUPIW7.js} +1 -1
- package/dist/{client-B3Guoe3I.d.ts → client-ALy_TEwJ.d.ts} +28 -8
- package/dist/{client-Of9uIxuI.d.cts → client-DaEox5q4.d.cts} +28 -8
- package/dist/core/actions/index.cjs +5 -5
- package/dist/core/actions/index.d.cts +6 -7
- package/dist/core/actions/index.d.ts +6 -7
- package/dist/core/actions/index.js +4 -4
- package/dist/core/index.cjs +10 -4
- package/dist/core/index.d.cts +41 -9
- package/dist/core/index.d.ts +41 -9
- package/dist/core/index.js +11 -5
- package/dist/core/interactions/index.cjs +5 -3
- package/dist/core/interactions/index.d.cts +9 -1
- package/dist/core/interactions/index.d.ts +9 -1
- package/dist/core/interactions/index.js +6 -4
- package/dist/react/index.cjs +34 -34
- package/dist/react/index.d.cts +3 -3
- package/dist/react/index.d.ts +3 -3
- package/dist/react/index.js +16 -16
- package/dist/{sendTransaction-3d8jO9CJ.d.ts → sendTransaction-BOd-pvXr.d.ts} +2 -2
- package/dist/{sendTransaction-Cz6FoB9_.d.cts → sendTransaction-MhdJPTWd.d.cts} +2 -2
- package/package.json +3 -3
|
@@ -67,6 +67,7 @@ type SsoMetadata = {
|
|
|
67
67
|
type OpenSsoParamsType = {
|
|
68
68
|
redirectUrl?: string;
|
|
69
69
|
directExit?: boolean;
|
|
70
|
+
lang?: "en" | "fr";
|
|
70
71
|
metadata: SsoMetadata;
|
|
71
72
|
};
|
|
72
73
|
|
|
@@ -125,7 +126,6 @@ type SiweAuthenticateModalStepType = GenericModalStepType<"siweAuthenticate", {
|
|
|
125
126
|
|
|
126
127
|
/**
|
|
127
128
|
* Generic format representing a tx to be sent
|
|
128
|
-
* todo: exploit the EIP-5792 here? https://eips.ethereum.org/EIPS/eip-5792
|
|
129
129
|
*/
|
|
130
130
|
type SendTransactionTxType = Readonly<{
|
|
131
131
|
to: Address;
|
|
@@ -155,20 +155,29 @@ type OpenInteractionSessionReturnType = Readonly<{
|
|
|
155
155
|
type OpenInteractionSessionModalStepType = GenericModalStepType<"openSession", object, OpenInteractionSessionReturnType>;
|
|
156
156
|
|
|
157
157
|
/**
|
|
158
|
-
*
|
|
158
|
+
* The final modal step type (displayed on success or dimissed)
|
|
159
159
|
*/
|
|
160
|
-
type
|
|
161
|
-
|
|
160
|
+
type FinalModalStepType = GenericModalStepType<"final", {
|
|
161
|
+
dismissedMetadata?: ModalStepMetadata["metadata"];
|
|
162
|
+
action: FinalActionType;
|
|
163
|
+
autoSkip?: boolean;
|
|
164
|
+
}, object>;
|
|
165
|
+
type FinalActionType = {
|
|
166
|
+
key: "sharing";
|
|
167
|
+
options?: {
|
|
162
168
|
popupTitle?: string;
|
|
163
169
|
text?: string;
|
|
164
170
|
link?: string;
|
|
165
171
|
};
|
|
166
|
-
}
|
|
172
|
+
} | {
|
|
173
|
+
key: "reward";
|
|
174
|
+
options?: never;
|
|
175
|
+
};
|
|
167
176
|
|
|
168
177
|
/**
|
|
169
178
|
* Generic type of steps we will display in the modal to the end user
|
|
170
179
|
*/
|
|
171
|
-
type ModalStepTypes = LoginModalStepType | SiweAuthenticateModalStepType | SendTransactionModalStepType | OpenInteractionSessionModalStepType |
|
|
180
|
+
type ModalStepTypes = LoginModalStepType | SiweAuthenticateModalStepType | SendTransactionModalStepType | OpenInteractionSessionModalStepType | FinalModalStepType;
|
|
172
181
|
/**
|
|
173
182
|
* Type for the result of a modal request
|
|
174
183
|
*/
|
|
@@ -194,7 +203,14 @@ type ModalRpcMetadata = Readonly<{
|
|
|
194
203
|
icon?: string;
|
|
195
204
|
};
|
|
196
205
|
context?: string;
|
|
197
|
-
|
|
206
|
+
lang?: "en" | "fr";
|
|
207
|
+
} & ({
|
|
208
|
+
isDismissible: true;
|
|
209
|
+
dismissActionTxt?: string;
|
|
210
|
+
} | {
|
|
211
|
+
isDismissible?: false;
|
|
212
|
+
dismissActionTxt?: never;
|
|
213
|
+
})>;
|
|
198
214
|
/**
|
|
199
215
|
* Generic params used to display modals
|
|
200
216
|
*/
|
|
@@ -207,6 +223,7 @@ type WalletStatusReturnType = Readonly<WalletConnected | WalletNotConnected>;
|
|
|
207
223
|
type WalletConnected = {
|
|
208
224
|
key: "connected";
|
|
209
225
|
wallet: Address;
|
|
226
|
+
interactionToken?: string;
|
|
210
227
|
interactionSession?: {
|
|
211
228
|
startTimestamp: number;
|
|
212
229
|
endTimestamp: number;
|
|
@@ -214,6 +231,9 @@ type WalletConnected = {
|
|
|
214
231
|
};
|
|
215
232
|
type WalletNotConnected = {
|
|
216
233
|
key: "not-connected";
|
|
234
|
+
wallet?: never;
|
|
235
|
+
interactionToken?: never;
|
|
236
|
+
interactionSession?: never;
|
|
217
237
|
};
|
|
218
238
|
|
|
219
239
|
/**
|
|
@@ -360,4 +380,4 @@ type NexusClient = {
|
|
|
360
380
|
config: NexusWalletSdkConfig;
|
|
361
381
|
} & IFrameTransport;
|
|
362
382
|
|
|
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,
|
|
383
|
+
export type { ClientLifecycleEvent as C, DisplayModalParamsType as D, ExtractedParametersFromRpc as E, FinalModalStepType as F, IFrameRpcSchema as I, LoginModalStepType as L, ModalStepTypes as M, NexusWalletSdkConfig as N, OpenSsoParamsType as O, RpcResponse as R, SsoMetadata as S, WalletStatusReturnType as W, NexusClient as a, ModalRpcMetadata as b, ModalRpcStepsInput as c, ModalRpcStepsResultType as d, ModalStepMetadata as e, SiweAuthenticateModalStepType as f, SiweAuthenticationParams as g, SiweAuthenticateReturnType as h, SendTransactionTxType as i, SendTransactionModalStepType as j, SendTransactionReturnType as k, OpenInteractionSessionReturnType as l, OpenInteractionSessionModalStepType as m, FinalActionType as n, IFrameTransport as o, IFrameRpcEvent as p, IFrameEvent as q, IFrameLifecycleEvent as r, ExtractedReturnTypeFromRpc as s };
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
12
|
-
require('../../chunk-
|
|
13
|
-
require('../../chunk-
|
|
14
|
-
require('../../chunk-
|
|
11
|
+
var _chunk6GPWXPN4cjs = require('../../chunk-6GPWXPN4.cjs');
|
|
12
|
+
require('../../chunk-H7YKYMTC.cjs');
|
|
13
|
+
require('../../chunk-A3XYA7S7.cjs');
|
|
14
|
+
require('../../chunk-UFJ7W6CQ.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
@@ -22,4 +22,4 @@ require('../../chunk-DILTMQBI.cjs');
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
exports.displayModal =
|
|
25
|
+
exports.displayModal = _chunk6GPWXPN4cjs.displayModal; exports.openSso = _chunk6GPWXPN4cjs.openSso; exports.processReferral = _chunk6GPWXPN4cjs.processReferral; exports.referralInteraction = _chunk6GPWXPN4cjs.referralInteraction; exports.sendInteraction = _chunk6GPWXPN4cjs.sendInteraction; exports.sendTransaction = _chunk6GPWXPN4cjs.sendTransaction; exports.siweAuthenticate = _chunk6GPWXPN4cjs.siweAuthenticate; exports.walletStatus = _chunk6GPWXPN4cjs.walletStatus; exports.watchWalletStatus = _chunk6GPWXPN4cjs.watchWalletStatus;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as NexusClient, W as WalletStatusReturnType, M as ModalStepTypes, D as DisplayModalParamsType,
|
|
1
|
+
import { a as NexusClient, W as WalletStatusReturnType, M as ModalStepTypes, D as DisplayModalParamsType, d as ModalRpcStepsResultType, O as OpenSsoParamsType } from '../../client-DaEox5q4.cjs';
|
|
2
2
|
import { S as SendInteractionParamsType, a as SendInteractionReturnType } from '../../interaction-BngPoHA0.cjs';
|
|
3
|
-
export {
|
|
3
|
+
export { S as SendTransactionParams, a as SiweAuthenticateModalParams, b as sendTransaction, s as siweAuthenticate } from '../../sendTransaction-MhdJPTWd.cjs';
|
|
4
4
|
import { Hex } from 'viem';
|
|
5
|
-
import {
|
|
5
|
+
import { F as FrakContext } from '../../FrakContext-LbQht1ep.cjs';
|
|
6
6
|
import 'viem/chains';
|
|
7
7
|
import 'viem/siwe';
|
|
8
8
|
|
|
@@ -31,7 +31,6 @@ declare function displayModal<T extends ModalStepTypes[] = ModalStepTypes[]>(cli
|
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Function used to open the SSO
|
|
34
|
-
* todo: We are using the iframe here, since we need to send potentially load of datas, and it couldn't fit inside the query params of an url
|
|
35
34
|
* @param client
|
|
36
35
|
* @param args
|
|
37
36
|
*/
|
|
@@ -49,13 +48,13 @@ type ReferralState = "idle" | "processing" | "success" | "no-wallet" | "no-sessi
|
|
|
49
48
|
* Automatically submit a referral interaction when detected
|
|
50
49
|
* -> And automatically set the referral context in the url
|
|
51
50
|
* @param walletStatus
|
|
52
|
-
* @param
|
|
51
|
+
* @param frakContext
|
|
53
52
|
* @param modalConfig
|
|
54
53
|
* @param productId
|
|
55
54
|
*/
|
|
56
|
-
declare function processReferral(client: NexusClient, { walletStatus,
|
|
55
|
+
declare function processReferral(client: NexusClient, { walletStatus, frakContext, modalConfig, productId, }: {
|
|
57
56
|
walletStatus?: WalletStatusReturnType;
|
|
58
|
-
|
|
57
|
+
frakContext?: Partial<FrakContext> | null;
|
|
59
58
|
modalConfig?: DisplayModalParamsType<ModalStepTypes[]>;
|
|
60
59
|
productId?: Hex;
|
|
61
60
|
}): Promise<ReferralState>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as NexusClient, W as WalletStatusReturnType, M as ModalStepTypes, D as DisplayModalParamsType,
|
|
1
|
+
import { a as NexusClient, W as WalletStatusReturnType, M as ModalStepTypes, D as DisplayModalParamsType, d as ModalRpcStepsResultType, O as OpenSsoParamsType } from '../../client-ALy_TEwJ.js';
|
|
2
2
|
import { S as SendInteractionParamsType, a as SendInteractionReturnType } from '../../interaction-BngPoHA0.js';
|
|
3
|
-
export {
|
|
3
|
+
export { S as SendTransactionParams, a as SiweAuthenticateModalParams, b as sendTransaction, s as siweAuthenticate } from '../../sendTransaction-BOd-pvXr.js';
|
|
4
4
|
import { Hex } from 'viem';
|
|
5
|
-
import {
|
|
5
|
+
import { F as FrakContext } from '../../FrakContext-LbQht1ep.js';
|
|
6
6
|
import 'viem/chains';
|
|
7
7
|
import 'viem/siwe';
|
|
8
8
|
|
|
@@ -31,7 +31,6 @@ declare function displayModal<T extends ModalStepTypes[] = ModalStepTypes[]>(cli
|
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Function used to open the SSO
|
|
34
|
-
* todo: We are using the iframe here, since we need to send potentially load of datas, and it couldn't fit inside the query params of an url
|
|
35
34
|
* @param client
|
|
36
35
|
* @param args
|
|
37
36
|
*/
|
|
@@ -49,13 +48,13 @@ type ReferralState = "idle" | "processing" | "success" | "no-wallet" | "no-sessi
|
|
|
49
48
|
* Automatically submit a referral interaction when detected
|
|
50
49
|
* -> And automatically set the referral context in the url
|
|
51
50
|
* @param walletStatus
|
|
52
|
-
* @param
|
|
51
|
+
* @param frakContext
|
|
53
52
|
* @param modalConfig
|
|
54
53
|
* @param productId
|
|
55
54
|
*/
|
|
56
|
-
declare function processReferral(client: NexusClient, { walletStatus,
|
|
55
|
+
declare function processReferral(client: NexusClient, { walletStatus, frakContext, modalConfig, productId, }: {
|
|
57
56
|
walletStatus?: WalletStatusReturnType;
|
|
58
|
-
|
|
57
|
+
frakContext?: Partial<FrakContext> | null;
|
|
59
58
|
modalConfig?: DisplayModalParamsType<ModalStepTypes[]>;
|
|
60
59
|
productId?: Hex;
|
|
61
60
|
}): Promise<ReferralState>;
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
siweAuthenticate,
|
|
9
9
|
walletStatus,
|
|
10
10
|
watchWalletStatus
|
|
11
|
-
} from "../../chunk-
|
|
12
|
-
import "../../chunk-
|
|
13
|
-
import "../../chunk-
|
|
14
|
-
import "../../chunk-
|
|
11
|
+
} from "../../chunk-BP7RT2HB.js";
|
|
12
|
+
import "../../chunk-B75G6TB3.js";
|
|
13
|
+
import "../../chunk-TIKEZMSD.js";
|
|
14
|
+
import "../../chunk-HY6YATLS.js";
|
|
15
15
|
export {
|
|
16
16
|
displayModal,
|
|
17
17
|
openSso,
|
package/dist/core/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkES3EBWJ6cjs = require('../chunk-ES3EBWJ6.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -8,15 +8,15 @@ var _chunk4ADWI2GGcjs = require('../chunk-4ADWI2GG.cjs');
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var _chunk4LT3U3H4cjs = require('../chunk-4LT3U3H4.cjs');
|
|
12
11
|
|
|
13
12
|
|
|
14
13
|
|
|
14
|
+
var _chunkH7YKYMTCcjs = require('../chunk-H7YKYMTC.cjs');
|
|
15
15
|
|
|
16
|
-
var _chunkDILTMQBIcjs = require('../chunk-DILTMQBI.cjs');
|
|
17
16
|
|
|
18
17
|
|
|
19
18
|
|
|
19
|
+
var _chunkUFJ7W6CQcjs = require('../chunk-UFJ7W6CQ.cjs');
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
@@ -25,4 +25,10 @@ var _chunkDILTMQBIcjs = require('../chunk-DILTMQBI.cjs');
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
exports.Deferred = _chunkH7YKYMTCcjs.Deferred; exports.FrakContextManager = _chunkH7YKYMTCcjs.FrakContextManager; exports.FrakRpcError = _chunkH7YKYMTCcjs.FrakRpcError; exports.RpcErrorCodes = _chunkH7YKYMTCcjs.RpcErrorCodes; exports.compressJson = _chunkH7YKYMTCcjs.compressJson; exports.createIFrameNexusClient = _chunkES3EBWJ6cjs.createIFrameNexusClient; exports.createIframe = _chunkH7YKYMTCcjs.createIframe; exports.decompressDataAndCheckHash = _chunkH7YKYMTCcjs.decompressDataAndCheckHash; exports.decompressJson = _chunkH7YKYMTCcjs.decompressJson; exports.hashAndCompressData = _chunkH7YKYMTCcjs.hashAndCompressData; exports.interactionTypes = _chunkUFJ7W6CQcjs.interactionTypes; exports.productTypes = _chunkUFJ7W6CQcjs.productTypes; exports.productTypesMask = _chunkUFJ7W6CQcjs.productTypesMask;
|
package/dist/core/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { N as NexusWalletSdkConfig, a as NexusClient } from '../client-
|
|
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-DaEox5q4.cjs';
|
|
2
|
+
export { C as ClientLifecycleEvent, D as DisplayModalParamsType, E as ExtractedParametersFromRpc, s as ExtractedReturnTypeFromRpc, n as FinalActionType, F as FinalModalStepType, q as IFrameEvent, r as IFrameLifecycleEvent, p as IFrameRpcEvent, I as IFrameRpcSchema, o as IFrameTransport, L as LoginModalStepType, b as ModalRpcMetadata, c as ModalRpcStepsInput, d as ModalRpcStepsResultType, e as ModalStepMetadata, M as ModalStepTypes, m as OpenInteractionSessionModalStepType, l as OpenInteractionSessionReturnType, O as OpenSsoParamsType, R as RpcResponse, j as SendTransactionModalStepType, k as SendTransactionReturnType, i as SendTransactionTxType, f as SiweAuthenticateModalStepType, h as SiweAuthenticateReturnType, g as SiweAuthenticationParams, S as SsoMetadata, W as WalletStatusReturnType } from '../client-DaEox5q4.cjs';
|
|
3
3
|
import { Address } from '../abi.js';
|
|
4
|
-
import {
|
|
4
|
+
import { F as FrakContext } from '../FrakContext-LbQht1ep.cjs';
|
|
5
5
|
export { P as PreparedInteraction, S as SendInteractionParamsType, a as SendInteractionReturnType } from '../interaction-BngPoHA0.cjs';
|
|
6
6
|
export { F as FrakRpcError, R as RpcErrorCodes } from '../error-Dflr3G5x.cjs';
|
|
7
7
|
import 'viem';
|
|
@@ -48,12 +48,22 @@ declare function createIframe({ walletBaseUrl, }: {
|
|
|
48
48
|
* @param data The params to encode
|
|
49
49
|
*/
|
|
50
50
|
declare function hashAndCompressData<T>(data: T): Promise<CompressedData>;
|
|
51
|
+
/**
|
|
52
|
+
* Compress json data
|
|
53
|
+
* @param data
|
|
54
|
+
*/
|
|
55
|
+
declare function compressJson(data: unknown): Promise<string>;
|
|
51
56
|
|
|
52
57
|
/**
|
|
53
58
|
* Decompress the given string
|
|
54
59
|
* @param compressedData The params to encode
|
|
55
60
|
*/
|
|
56
61
|
declare function decompressDataAndCheckHash<T>(compressedData: CompressedData): Promise<HashProtectedData<T>>;
|
|
62
|
+
/**
|
|
63
|
+
* Decompress json data
|
|
64
|
+
* @param data
|
|
65
|
+
*/
|
|
66
|
+
declare function decompressJson<T>(data: string): Promise<T | null>;
|
|
57
67
|
|
|
58
68
|
/**
|
|
59
69
|
* Parse the current Nexus context in the given url
|
|
@@ -69,21 +79,41 @@ declare function parse({ url }: {
|
|
|
69
79
|
*/
|
|
70
80
|
declare function update({ url, context, }: {
|
|
71
81
|
url?: string;
|
|
72
|
-
context: Partial<
|
|
82
|
+
context: Partial<FrakContext>;
|
|
73
83
|
}): Promise<string | null | undefined>;
|
|
84
|
+
/**
|
|
85
|
+
* Remove Nexus context from current url
|
|
86
|
+
*/
|
|
87
|
+
declare function remove(url: string): string;
|
|
88
|
+
/**
|
|
89
|
+
* Replace the current url with the given Nexus context
|
|
90
|
+
* @param url
|
|
91
|
+
* @param context
|
|
92
|
+
*/
|
|
74
93
|
declare function replaceUrl({ url, context, }: {
|
|
75
94
|
url?: string;
|
|
76
|
-
context: Partial<
|
|
95
|
+
context: Partial<FrakContext>;
|
|
77
96
|
}): Promise<void>;
|
|
78
97
|
/**
|
|
79
|
-
* Export our
|
|
98
|
+
* Export our frak context "class"
|
|
80
99
|
*/
|
|
81
|
-
declare const
|
|
100
|
+
declare const FrakContextManager: {
|
|
82
101
|
parse: typeof parse;
|
|
83
102
|
update: typeof update;
|
|
103
|
+
remove: typeof remove;
|
|
84
104
|
replaceUrl: typeof replaceUrl;
|
|
85
105
|
};
|
|
86
106
|
|
|
107
|
+
declare class Deferred<T> {
|
|
108
|
+
private readonly _promise;
|
|
109
|
+
private _resolve;
|
|
110
|
+
private _reject;
|
|
111
|
+
constructor();
|
|
112
|
+
get promise(): Promise<T>;
|
|
113
|
+
resolve: (value: T | PromiseLike<T>) => void;
|
|
114
|
+
reject: (reason?: unknown) => void;
|
|
115
|
+
}
|
|
116
|
+
|
|
87
117
|
/**
|
|
88
118
|
* The keys for each product types
|
|
89
119
|
*/
|
|
@@ -121,7 +151,9 @@ declare const interactionTypes: {
|
|
|
121
151
|
readonly proofVerifiableStorageUpdate: "0x2ab2aeef";
|
|
122
152
|
readonly callableVerifiableStorageUpdate: "0xa07da986";
|
|
123
153
|
};
|
|
124
|
-
readonly webshop: {
|
|
154
|
+
readonly webshop: {
|
|
155
|
+
readonly open: "0xb311798f";
|
|
156
|
+
};
|
|
125
157
|
readonly referral: {
|
|
126
158
|
readonly referred: "0x010cc3b9";
|
|
127
159
|
readonly createLink: "0xb2c0f17c";
|
|
@@ -132,4 +164,4 @@ declare const interactionTypes: {
|
|
|
132
164
|
};
|
|
133
165
|
};
|
|
134
166
|
|
|
135
|
-
export { type CompressedData, type HashProtectedData, type InteractionTypesKey, type KeyProvider, NexusClient,
|
|
167
|
+
export { type CompressedData, Deferred, FrakContextManager, type HashProtectedData, type InteractionTypesKey, type KeyProvider, NexusClient, NexusWalletSdkConfig, type ProductTypesKey, compressJson, createIFrameNexusClient, createIframe, decompressDataAndCheckHash, decompressJson, hashAndCompressData, interactionTypes, productTypes, productTypesMask };
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { N as NexusWalletSdkConfig, a as NexusClient } from '../client-
|
|
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-ALy_TEwJ.js';
|
|
2
|
+
export { C as ClientLifecycleEvent, D as DisplayModalParamsType, E as ExtractedParametersFromRpc, s as ExtractedReturnTypeFromRpc, n as FinalActionType, F as FinalModalStepType, q as IFrameEvent, r as IFrameLifecycleEvent, p as IFrameRpcEvent, I as IFrameRpcSchema, o as IFrameTransport, L as LoginModalStepType, b as ModalRpcMetadata, c as ModalRpcStepsInput, d as ModalRpcStepsResultType, e as ModalStepMetadata, M as ModalStepTypes, m as OpenInteractionSessionModalStepType, l as OpenInteractionSessionReturnType, O as OpenSsoParamsType, R as RpcResponse, j as SendTransactionModalStepType, k as SendTransactionReturnType, i as SendTransactionTxType, f as SiweAuthenticateModalStepType, h as SiweAuthenticateReturnType, g as SiweAuthenticationParams, S as SsoMetadata, W as WalletStatusReturnType } from '../client-ALy_TEwJ.js';
|
|
3
3
|
import { Address } from '../abi.js';
|
|
4
|
-
import {
|
|
4
|
+
import { F as FrakContext } from '../FrakContext-LbQht1ep.js';
|
|
5
5
|
export { P as PreparedInteraction, S as SendInteractionParamsType, a as SendInteractionReturnType } from '../interaction-BngPoHA0.js';
|
|
6
6
|
export { F as FrakRpcError, R as RpcErrorCodes } from '../error-Dflr3G5x.js';
|
|
7
7
|
import 'viem';
|
|
@@ -48,12 +48,22 @@ declare function createIframe({ walletBaseUrl, }: {
|
|
|
48
48
|
* @param data The params to encode
|
|
49
49
|
*/
|
|
50
50
|
declare function hashAndCompressData<T>(data: T): Promise<CompressedData>;
|
|
51
|
+
/**
|
|
52
|
+
* Compress json data
|
|
53
|
+
* @param data
|
|
54
|
+
*/
|
|
55
|
+
declare function compressJson(data: unknown): Promise<string>;
|
|
51
56
|
|
|
52
57
|
/**
|
|
53
58
|
* Decompress the given string
|
|
54
59
|
* @param compressedData The params to encode
|
|
55
60
|
*/
|
|
56
61
|
declare function decompressDataAndCheckHash<T>(compressedData: CompressedData): Promise<HashProtectedData<T>>;
|
|
62
|
+
/**
|
|
63
|
+
* Decompress json data
|
|
64
|
+
* @param data
|
|
65
|
+
*/
|
|
66
|
+
declare function decompressJson<T>(data: string): Promise<T | null>;
|
|
57
67
|
|
|
58
68
|
/**
|
|
59
69
|
* Parse the current Nexus context in the given url
|
|
@@ -69,21 +79,41 @@ declare function parse({ url }: {
|
|
|
69
79
|
*/
|
|
70
80
|
declare function update({ url, context, }: {
|
|
71
81
|
url?: string;
|
|
72
|
-
context: Partial<
|
|
82
|
+
context: Partial<FrakContext>;
|
|
73
83
|
}): Promise<string | null | undefined>;
|
|
84
|
+
/**
|
|
85
|
+
* Remove Nexus context from current url
|
|
86
|
+
*/
|
|
87
|
+
declare function remove(url: string): string;
|
|
88
|
+
/**
|
|
89
|
+
* Replace the current url with the given Nexus context
|
|
90
|
+
* @param url
|
|
91
|
+
* @param context
|
|
92
|
+
*/
|
|
74
93
|
declare function replaceUrl({ url, context, }: {
|
|
75
94
|
url?: string;
|
|
76
|
-
context: Partial<
|
|
95
|
+
context: Partial<FrakContext>;
|
|
77
96
|
}): Promise<void>;
|
|
78
97
|
/**
|
|
79
|
-
* Export our
|
|
98
|
+
* Export our frak context "class"
|
|
80
99
|
*/
|
|
81
|
-
declare const
|
|
100
|
+
declare const FrakContextManager: {
|
|
82
101
|
parse: typeof parse;
|
|
83
102
|
update: typeof update;
|
|
103
|
+
remove: typeof remove;
|
|
84
104
|
replaceUrl: typeof replaceUrl;
|
|
85
105
|
};
|
|
86
106
|
|
|
107
|
+
declare class Deferred<T> {
|
|
108
|
+
private readonly _promise;
|
|
109
|
+
private _resolve;
|
|
110
|
+
private _reject;
|
|
111
|
+
constructor();
|
|
112
|
+
get promise(): Promise<T>;
|
|
113
|
+
resolve: (value: T | PromiseLike<T>) => void;
|
|
114
|
+
reject: (reason?: unknown) => void;
|
|
115
|
+
}
|
|
116
|
+
|
|
87
117
|
/**
|
|
88
118
|
* The keys for each product types
|
|
89
119
|
*/
|
|
@@ -121,7 +151,9 @@ declare const interactionTypes: {
|
|
|
121
151
|
readonly proofVerifiableStorageUpdate: "0x2ab2aeef";
|
|
122
152
|
readonly callableVerifiableStorageUpdate: "0xa07da986";
|
|
123
153
|
};
|
|
124
|
-
readonly webshop: {
|
|
154
|
+
readonly webshop: {
|
|
155
|
+
readonly open: "0xb311798f";
|
|
156
|
+
};
|
|
125
157
|
readonly referral: {
|
|
126
158
|
readonly referred: "0x010cc3b9";
|
|
127
159
|
readonly createLink: "0xb2c0f17c";
|
|
@@ -132,4 +164,4 @@ declare const interactionTypes: {
|
|
|
132
164
|
};
|
|
133
165
|
};
|
|
134
166
|
|
|
135
|
-
export { type CompressedData, type HashProtectedData, type InteractionTypesKey, type KeyProvider, NexusClient,
|
|
167
|
+
export { type CompressedData, Deferred, FrakContextManager, type HashProtectedData, type InteractionTypesKey, type KeyProvider, NexusClient, NexusWalletSdkConfig, type ProductTypesKey, compressJson, createIFrameNexusClient, createIframe, decompressDataAndCheckHash, decompressJson, hashAndCompressData, interactionTypes, productTypes, productTypesMask };
|
package/dist/core/index.js
CHANGED
|
@@ -1,26 +1,32 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createIFrameNexusClient
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-VXVUPIW7.js";
|
|
4
4
|
import {
|
|
5
|
+
Deferred,
|
|
6
|
+
FrakContextManager,
|
|
5
7
|
FrakRpcError,
|
|
6
|
-
NexusContextManager,
|
|
7
8
|
RpcErrorCodes,
|
|
9
|
+
compressJson,
|
|
8
10
|
createIframe,
|
|
9
11
|
decompressDataAndCheckHash,
|
|
12
|
+
decompressJson,
|
|
10
13
|
hashAndCompressData
|
|
11
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-B75G6TB3.js";
|
|
12
15
|
import {
|
|
13
16
|
interactionTypes,
|
|
14
17
|
productTypes,
|
|
15
18
|
productTypesMask
|
|
16
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-HY6YATLS.js";
|
|
17
20
|
export {
|
|
21
|
+
Deferred,
|
|
22
|
+
FrakContextManager,
|
|
18
23
|
FrakRpcError,
|
|
19
|
-
NexusContextManager,
|
|
20
24
|
RpcErrorCodes,
|
|
25
|
+
compressJson,
|
|
21
26
|
createIFrameNexusClient,
|
|
22
27
|
createIframe,
|
|
23
28
|
decompressDataAndCheckHash,
|
|
29
|
+
decompressJson,
|
|
24
30
|
hashAndCompressData,
|
|
25
31
|
interactionTypes,
|
|
26
32
|
productTypes,
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var _chunkC25NTD45cjs = require('../../chunk-C25NTD45.cjs');
|
|
6
|
-
require('../../chunk-DILTMQBI.cjs');
|
|
7
5
|
|
|
6
|
+
var _chunkA3XYA7S7cjs = require('../../chunk-A3XYA7S7.cjs');
|
|
7
|
+
require('../../chunk-UFJ7W6CQ.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
exports.PressInteractionEncoder = _chunkA3XYA7S7cjs.PressInteractionEncoder; exports.PurchaseInteractionEncoder = _chunkA3XYA7S7cjs.PurchaseInteractionEncoder; exports.ReferralInteractionEncoder = _chunkA3XYA7S7cjs.ReferralInteractionEncoder; exports.WebShopInteractionEncoder = _chunkA3XYA7S7cjs.WebShopInteractionEncoder;
|
|
@@ -54,4 +54,12 @@ declare const PurchaseInteractionEncoder: {
|
|
|
54
54
|
completedPurchase: typeof completedPurchase;
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Encode a create referral link interaction
|
|
59
|
+
*/
|
|
60
|
+
declare function open(): PreparedInteraction;
|
|
61
|
+
declare const WebShopInteractionEncoder: {
|
|
62
|
+
open: typeof open;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export { PressInteractionEncoder, PurchaseInteractionEncoder, ReferralInteractionEncoder, WebShopInteractionEncoder };
|
|
@@ -54,4 +54,12 @@ declare const PurchaseInteractionEncoder: {
|
|
|
54
54
|
completedPurchase: typeof completedPurchase;
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Encode a create referral link interaction
|
|
59
|
+
*/
|
|
60
|
+
declare function open(): PreparedInteraction;
|
|
61
|
+
declare const WebShopInteractionEncoder: {
|
|
62
|
+
open: typeof open;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export { PressInteractionEncoder, PurchaseInteractionEncoder, ReferralInteractionEncoder, WebShopInteractionEncoder };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PressInteractionEncoder,
|
|
3
3
|
PurchaseInteractionEncoder,
|
|
4
|
-
ReferralInteractionEncoder
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
ReferralInteractionEncoder,
|
|
5
|
+
WebShopInteractionEncoder
|
|
6
|
+
} from "../../chunk-TIKEZMSD.js";
|
|
7
|
+
import "../../chunk-HY6YATLS.js";
|
|
7
8
|
export {
|
|
8
9
|
PressInteractionEncoder,
|
|
9
10
|
PurchaseInteractionEncoder,
|
|
10
|
-
ReferralInteractionEncoder
|
|
11
|
+
ReferralInteractionEncoder,
|
|
12
|
+
WebShopInteractionEncoder
|
|
11
13
|
};
|