@frak-labs/nexus-sdk 0.0.21 → 0.0.23
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/{FrakContext-p0Jtv9gl.d.ts → FrakContext-CDVlUN75.d.ts} +1 -0
- package/dist/{FrakContext-BsezWx2F.d.cts → FrakContext-DBdWC7ls.d.cts} +1 -0
- package/dist/bundle/bundle.js +4 -4
- package/dist/{chunk-A3XYA7S7.cjs → chunk-4OJ2NPAS.cjs} +15 -15
- package/dist/{chunk-MDGMJ6EQ.js → chunk-4Q2OHGWX.js} +134 -25
- package/dist/{chunk-BSCR57ZI.cjs → chunk-BHZDDGW6.cjs} +148 -39
- package/dist/chunk-F3F4BCGV.cjs +860 -0
- package/dist/chunk-H3T2GAEC.js +79 -0
- package/dist/{chunk-TIKEZMSD.js → chunk-P4QEVLVV.js} +1 -1
- package/dist/chunk-QSXZKZJA.cjs +79 -0
- package/dist/{chunk-WXNW7ZMU.cjs → chunk-QYOOKB34.cjs} +20 -18
- package/dist/{chunk-ZZ7LUFNV.js → chunk-VVF4NKYR.js} +3 -1
- package/dist/chunk-ZQSA2VQ4.js +860 -0
- package/dist/core/actions/index.cjs +7 -5
- package/dist/core/actions/index.d.cts +45 -6
- package/dist/core/actions/index.d.ts +45 -6
- package/dist/core/actions/index.js +8 -6
- package/dist/core/index.cjs +4 -4
- package/dist/core/index.d.cts +5 -3
- package/dist/core/index.d.ts +5 -3
- package/dist/core/index.js +3 -3
- package/dist/core/interactions/index.cjs +3 -3
- package/dist/core/interactions/index.js +2 -2
- package/dist/{processReferral-YbCg90hu.d.cts → processReferral-BWSIamn2.d.cts} +1 -1
- package/dist/{processReferral-t3gUNwJu.d.ts → processReferral-CFyGAENf.d.ts} +1 -1
- package/dist/react/index.cjs +30 -30
- package/dist/react/index.d.cts +5 -2
- package/dist/react/index.d.ts +5 -2
- package/dist/react/index.js +11 -11
- package/package.json +2 -11
- package/dist/chunk-E527CMMJ.cjs +0 -294
- package/dist/chunk-HY6YATLS.js +0 -53
- package/dist/chunk-UFJ7W6CQ.cjs +0 -53
- package/dist/chunk-ZRPCX25Q.js +0 -294
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var _chunkBSCR57ZIcjs = require('../../chunk-BSCR57ZI.cjs');
|
|
12
|
-
require('../../chunk-E527CMMJ.cjs');
|
|
13
|
-
require('../../chunk-A3XYA7S7.cjs');
|
|
14
|
-
require('../../chunk-UFJ7W6CQ.cjs');
|
|
15
11
|
|
|
12
|
+
var _chunkBHZDDGW6cjs = require('../../chunk-BHZDDGW6.cjs');
|
|
13
|
+
require('../../chunk-F3F4BCGV.cjs');
|
|
14
|
+
require('../../chunk-4OJ2NPAS.cjs');
|
|
15
|
+
require('../../chunk-QSXZKZJA.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
@@ -22,4 +22,6 @@ require('../../chunk-UFJ7W6CQ.cjs');
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
exports.displayModal = _chunkBHZDDGW6cjs.displayModal; exports.modalBuilder = _chunkBHZDDGW6cjs.modalBuilder; exports.openSso = _chunkBHZDDGW6cjs.openSso; exports.processReferral = _chunkBHZDDGW6cjs.processReferral; exports.referralInteraction = _chunkBHZDDGW6cjs.referralInteraction; exports.sendInteraction = _chunkBHZDDGW6cjs.sendInteraction; exports.sendTransaction = _chunkBHZDDGW6cjs.sendTransaction; exports.siweAuthenticate = _chunkBHZDDGW6cjs.siweAuthenticate; exports.trackPurchaseStatus = _chunkBHZDDGW6cjs.trackPurchaseStatus; exports.watchWalletStatus = _chunkBHZDDGW6cjs.watchWalletStatus;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as NexusClient, W as WalletStatusReturnType, M as ModalStepTypes, D as DisplayModalParamsType, d as ModalRpcStepsResultType, O as OpenSsoParamsType } from '../../FrakContext-
|
|
1
|
+
import { a as NexusClient, W as WalletStatusReturnType, M as ModalStepTypes, D as DisplayModalParamsType, d as ModalRpcStepsResultType, O as OpenSsoParamsType, j as SendTransactionModalStepType, n as FinalModalStepType, o as FinalActionType, L as LoginModalStepType, m as OpenInteractionSessionModalStepType, b as ModalRpcMetadata } from '../../FrakContext-DBdWC7ls.cjs';
|
|
2
2
|
import { S as SendInteractionParamsType, a as SendInteractionReturnType } from '../../interaction-BngPoHA0.cjs';
|
|
3
|
-
import { P as ProcessReferralOptions } from '../../processReferral-
|
|
4
|
-
export { S as SendTransactionParams, a as SiweAuthenticateModalParams, p as processReferral, b as sendTransaction, s as siweAuthenticate } from '../../processReferral-
|
|
3
|
+
import { P as ProcessReferralOptions } from '../../processReferral-BWSIamn2.cjs';
|
|
4
|
+
export { S as SendTransactionParams, a as SiweAuthenticateModalParams, p as processReferral, b as sendTransaction, s as siweAuthenticate } from '../../processReferral-BWSIamn2.cjs';
|
|
5
5
|
import { Hex } from 'viem';
|
|
6
6
|
import 'viem/chains';
|
|
7
7
|
import 'viem/siwe';
|
|
@@ -11,7 +11,7 @@ import 'viem/siwe';
|
|
|
11
11
|
* @param client
|
|
12
12
|
* @param callback
|
|
13
13
|
*/
|
|
14
|
-
declare function watchWalletStatus(client: NexusClient, callback
|
|
14
|
+
declare function watchWalletStatus(client: NexusClient, callback?: (status: WalletStatusReturnType) => void): Promise<WalletStatusReturnType>;
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Function used to send an interaction
|
|
@@ -36,7 +36,46 @@ declare function displayModal<T extends ModalStepTypes[] = ModalStepTypes[]>(cli
|
|
|
36
36
|
*/
|
|
37
37
|
declare function openSso(client: NexusClient, args: OpenSsoParamsType): Promise<void>;
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Function used to track the status of a purchase
|
|
41
|
+
*/
|
|
42
|
+
declare function trackPurchaseStatus(args: {
|
|
43
|
+
customerId: string | number;
|
|
44
|
+
orderId: string | number;
|
|
45
|
+
token: string;
|
|
46
|
+
}): Promise<void>;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Represent the type of the modal step builder
|
|
50
|
+
*/
|
|
51
|
+
type ModalStepBuilder<Steps extends ModalStepTypes[] = ModalStepTypes[]> = {
|
|
52
|
+
params: DisplayModalParamsType<Steps>;
|
|
53
|
+
sendTx: (options: SendTransactionModalStepType["params"]) => ModalStepBuilder<[...Steps, SendTransactionModalStepType]>;
|
|
54
|
+
reward: (options?: Omit<FinalModalStepType["params"], "action">) => ModalStepBuilder<[...Steps, FinalModalStepType]>;
|
|
55
|
+
sharing: (sharingOptions?: Extract<FinalActionType, {
|
|
56
|
+
key: "sharing";
|
|
57
|
+
}>["options"], options?: Omit<FinalModalStepType["params"], "action">) => ModalStepBuilder<[...Steps, FinalModalStepType]>;
|
|
58
|
+
display: () => Promise<ModalRpcStepsResultType<Steps>>;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Represent the output type of the modal builder
|
|
62
|
+
*/
|
|
63
|
+
type ModalBuilder = ModalStepBuilder<[
|
|
64
|
+
LoginModalStepType,
|
|
65
|
+
OpenInteractionSessionModalStepType
|
|
66
|
+
]>;
|
|
67
|
+
/**
|
|
68
|
+
* Simple modal builder params builder
|
|
69
|
+
* @param client
|
|
70
|
+
* @param metadata
|
|
71
|
+
* @param login
|
|
72
|
+
* @param openSession
|
|
73
|
+
*/
|
|
74
|
+
declare function modalBuilder(client: NexusClient, { metadata, login, openSession, }: {
|
|
75
|
+
metadata: ModalRpcMetadata;
|
|
76
|
+
login?: LoginModalStepType["params"];
|
|
77
|
+
openSession?: OpenInteractionSessionModalStepType["params"];
|
|
78
|
+
}): ModalBuilder;
|
|
40
79
|
|
|
41
80
|
declare function referralInteraction(client: NexusClient, { productId, modalConfig, options, }?: {
|
|
42
81
|
productId?: Hex;
|
|
@@ -44,4 +83,4 @@ declare function referralInteraction(client: NexusClient, { productId, modalConf
|
|
|
44
83
|
options?: ProcessReferralOptions;
|
|
45
84
|
}): Promise<unknown>;
|
|
46
85
|
|
|
47
|
-
export { displayModal, openSso, referralInteraction, sendInteraction,
|
|
86
|
+
export { type ModalBuilder, type ModalStepBuilder, displayModal, modalBuilder, openSso, referralInteraction, sendInteraction, trackPurchaseStatus, watchWalletStatus };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as NexusClient, W as WalletStatusReturnType, M as ModalStepTypes, D as DisplayModalParamsType, d as ModalRpcStepsResultType, O as OpenSsoParamsType } from '../../FrakContext-
|
|
1
|
+
import { a as NexusClient, W as WalletStatusReturnType, M as ModalStepTypes, D as DisplayModalParamsType, d as ModalRpcStepsResultType, O as OpenSsoParamsType, j as SendTransactionModalStepType, n as FinalModalStepType, o as FinalActionType, L as LoginModalStepType, m as OpenInteractionSessionModalStepType, b as ModalRpcMetadata } from '../../FrakContext-CDVlUN75.js';
|
|
2
2
|
import { S as SendInteractionParamsType, a as SendInteractionReturnType } from '../../interaction-BngPoHA0.js';
|
|
3
|
-
import { P as ProcessReferralOptions } from '../../processReferral-
|
|
4
|
-
export { S as SendTransactionParams, a as SiweAuthenticateModalParams, p as processReferral, b as sendTransaction, s as siweAuthenticate } from '../../processReferral-
|
|
3
|
+
import { P as ProcessReferralOptions } from '../../processReferral-CFyGAENf.js';
|
|
4
|
+
export { S as SendTransactionParams, a as SiweAuthenticateModalParams, p as processReferral, b as sendTransaction, s as siweAuthenticate } from '../../processReferral-CFyGAENf.js';
|
|
5
5
|
import { Hex } from 'viem';
|
|
6
6
|
import 'viem/chains';
|
|
7
7
|
import 'viem/siwe';
|
|
@@ -11,7 +11,7 @@ import 'viem/siwe';
|
|
|
11
11
|
* @param client
|
|
12
12
|
* @param callback
|
|
13
13
|
*/
|
|
14
|
-
declare function watchWalletStatus(client: NexusClient, callback
|
|
14
|
+
declare function watchWalletStatus(client: NexusClient, callback?: (status: WalletStatusReturnType) => void): Promise<WalletStatusReturnType>;
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Function used to send an interaction
|
|
@@ -36,7 +36,46 @@ declare function displayModal<T extends ModalStepTypes[] = ModalStepTypes[]>(cli
|
|
|
36
36
|
*/
|
|
37
37
|
declare function openSso(client: NexusClient, args: OpenSsoParamsType): Promise<void>;
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Function used to track the status of a purchase
|
|
41
|
+
*/
|
|
42
|
+
declare function trackPurchaseStatus(args: {
|
|
43
|
+
customerId: string | number;
|
|
44
|
+
orderId: string | number;
|
|
45
|
+
token: string;
|
|
46
|
+
}): Promise<void>;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Represent the type of the modal step builder
|
|
50
|
+
*/
|
|
51
|
+
type ModalStepBuilder<Steps extends ModalStepTypes[] = ModalStepTypes[]> = {
|
|
52
|
+
params: DisplayModalParamsType<Steps>;
|
|
53
|
+
sendTx: (options: SendTransactionModalStepType["params"]) => ModalStepBuilder<[...Steps, SendTransactionModalStepType]>;
|
|
54
|
+
reward: (options?: Omit<FinalModalStepType["params"], "action">) => ModalStepBuilder<[...Steps, FinalModalStepType]>;
|
|
55
|
+
sharing: (sharingOptions?: Extract<FinalActionType, {
|
|
56
|
+
key: "sharing";
|
|
57
|
+
}>["options"], options?: Omit<FinalModalStepType["params"], "action">) => ModalStepBuilder<[...Steps, FinalModalStepType]>;
|
|
58
|
+
display: () => Promise<ModalRpcStepsResultType<Steps>>;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Represent the output type of the modal builder
|
|
62
|
+
*/
|
|
63
|
+
type ModalBuilder = ModalStepBuilder<[
|
|
64
|
+
LoginModalStepType,
|
|
65
|
+
OpenInteractionSessionModalStepType
|
|
66
|
+
]>;
|
|
67
|
+
/**
|
|
68
|
+
* Simple modal builder params builder
|
|
69
|
+
* @param client
|
|
70
|
+
* @param metadata
|
|
71
|
+
* @param login
|
|
72
|
+
* @param openSession
|
|
73
|
+
*/
|
|
74
|
+
declare function modalBuilder(client: NexusClient, { metadata, login, openSession, }: {
|
|
75
|
+
metadata: ModalRpcMetadata;
|
|
76
|
+
login?: LoginModalStepType["params"];
|
|
77
|
+
openSession?: OpenInteractionSessionModalStepType["params"];
|
|
78
|
+
}): ModalBuilder;
|
|
40
79
|
|
|
41
80
|
declare function referralInteraction(client: NexusClient, { productId, modalConfig, options, }?: {
|
|
42
81
|
productId?: Hex;
|
|
@@ -44,4 +83,4 @@ declare function referralInteraction(client: NexusClient, { productId, modalConf
|
|
|
44
83
|
options?: ProcessReferralOptions;
|
|
45
84
|
}): Promise<unknown>;
|
|
46
85
|
|
|
47
|
-
export { displayModal, openSso, referralInteraction, sendInteraction,
|
|
86
|
+
export { type ModalBuilder, type ModalStepBuilder, displayModal, modalBuilder, openSso, referralInteraction, sendInteraction, trackPurchaseStatus, watchWalletStatus };
|
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
2
|
displayModal,
|
|
3
|
+
modalBuilder,
|
|
3
4
|
openSso,
|
|
4
5
|
processReferral,
|
|
5
6
|
referralInteraction,
|
|
6
7
|
sendInteraction,
|
|
7
8
|
sendTransaction,
|
|
8
9
|
siweAuthenticate,
|
|
9
|
-
|
|
10
|
+
trackPurchaseStatus,
|
|
10
11
|
watchWalletStatus
|
|
11
|
-
} from "../../chunk-
|
|
12
|
-
import "../../chunk-
|
|
13
|
-
import "../../chunk-
|
|
14
|
-
import "../../chunk-
|
|
12
|
+
} from "../../chunk-4Q2OHGWX.js";
|
|
13
|
+
import "../../chunk-ZQSA2VQ4.js";
|
|
14
|
+
import "../../chunk-P4QEVLVV.js";
|
|
15
|
+
import "../../chunk-H3T2GAEC.js";
|
|
15
16
|
export {
|
|
16
17
|
displayModal,
|
|
18
|
+
modalBuilder,
|
|
17
19
|
openSso,
|
|
18
20
|
processReferral,
|
|
19
21
|
referralInteraction,
|
|
20
22
|
sendInteraction,
|
|
21
23
|
sendTransaction,
|
|
22
24
|
siweAuthenticate,
|
|
23
|
-
|
|
25
|
+
trackPurchaseStatus,
|
|
24
26
|
watchWalletStatus
|
|
25
27
|
};
|
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 _chunkQYOOKB34cjs = require('../chunk-QYOOKB34.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -11,12 +11,12 @@ var _chunkWXNW7ZMUcjs = require('../chunk-WXNW7ZMU.cjs');
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkF3F4BCGVcjs = require('../chunk-F3F4BCGV.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunkQSXZKZJAcjs = require('../chunk-QSXZKZJA.cjs');
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
@@ -31,4 +31,4 @@ var _chunkUFJ7W6CQcjs = require('../chunk-UFJ7W6CQ.cjs');
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
exports.Deferred =
|
|
34
|
+
exports.Deferred = _chunkF3F4BCGVcjs.Deferred; exports.FrakContextManager = _chunkF3F4BCGVcjs.FrakContextManager; exports.FrakRpcError = _chunkF3F4BCGVcjs.FrakRpcError; exports.RpcErrorCodes = _chunkF3F4BCGVcjs.RpcErrorCodes; exports.compressJson = _chunkF3F4BCGVcjs.compressJson; exports.createIFrameNexusClient = _chunkQYOOKB34cjs.createIFrameNexusClient; exports.createIframe = _chunkF3F4BCGVcjs.createIframe; exports.decompressDataAndCheckHash = _chunkF3F4BCGVcjs.decompressDataAndCheckHash; exports.decompressJson = _chunkF3F4BCGVcjs.decompressJson; exports.hashAndCompressData = _chunkF3F4BCGVcjs.hashAndCompressData; exports.interactionTypes = _chunkQSXZKZJAcjs.interactionTypes; exports.productTypes = _chunkQSXZKZJAcjs.productTypes; exports.productTypesMask = _chunkQSXZKZJAcjs.productTypesMask;
|
package/dist/core/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as NexusWalletSdkConfig, a as NexusClient, F as FrakContext } from '../FrakContext-
|
|
2
|
-
export { C as ClientLifecycleEvent, D as DisplayModalParamsType, E as ExtractedParametersFromRpc, t as ExtractedReturnTypeFromRpc, o as FinalActionType, n as FinalModalStepType, r as IFrameEvent, s as IFrameLifecycleEvent, q as IFrameRpcEvent, I as IFrameRpcSchema, p 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 '../FrakContext-
|
|
1
|
+
import { N as NexusWalletSdkConfig, a as NexusClient, F as FrakContext } from '../FrakContext-DBdWC7ls.cjs';
|
|
2
|
+
export { C as ClientLifecycleEvent, D as DisplayModalParamsType, E as ExtractedParametersFromRpc, t as ExtractedReturnTypeFromRpc, o as FinalActionType, n as FinalModalStepType, r as IFrameEvent, s as IFrameLifecycleEvent, q as IFrameRpcEvent, I as IFrameRpcSchema, p 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 '../FrakContext-DBdWC7ls.cjs';
|
|
3
3
|
import { Address } from 'viem';
|
|
4
4
|
export { P as PreparedInteraction, S as SendInteractionParamsType, a as SendInteractionReturnType } from '../interaction-BngPoHA0.cjs';
|
|
5
5
|
export { F as FrakRpcError, R as RpcErrorCodes } from '../error-Dflr3G5x.cjs';
|
|
@@ -36,9 +36,11 @@ declare function createIFrameNexusClient({ config, iframe, }: {
|
|
|
36
36
|
/**
|
|
37
37
|
* Create the given iframe
|
|
38
38
|
* @param walletBaseUrl
|
|
39
|
+
* @param config
|
|
39
40
|
*/
|
|
40
|
-
declare function createIframe({ walletBaseUrl, }: {
|
|
41
|
+
declare function createIframe({ walletBaseUrl, config, }: {
|
|
41
42
|
walletBaseUrl: string;
|
|
43
|
+
config?: NexusWalletSdkConfig;
|
|
42
44
|
}): Promise<HTMLIFrameElement | undefined>;
|
|
43
45
|
|
|
44
46
|
/**
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as NexusWalletSdkConfig, a as NexusClient, F as FrakContext } from '../FrakContext-
|
|
2
|
-
export { C as ClientLifecycleEvent, D as DisplayModalParamsType, E as ExtractedParametersFromRpc, t as ExtractedReturnTypeFromRpc, o as FinalActionType, n as FinalModalStepType, r as IFrameEvent, s as IFrameLifecycleEvent, q as IFrameRpcEvent, I as IFrameRpcSchema, p 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 '../FrakContext-
|
|
1
|
+
import { N as NexusWalletSdkConfig, a as NexusClient, F as FrakContext } from '../FrakContext-CDVlUN75.js';
|
|
2
|
+
export { C as ClientLifecycleEvent, D as DisplayModalParamsType, E as ExtractedParametersFromRpc, t as ExtractedReturnTypeFromRpc, o as FinalActionType, n as FinalModalStepType, r as IFrameEvent, s as IFrameLifecycleEvent, q as IFrameRpcEvent, I as IFrameRpcSchema, p 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 '../FrakContext-CDVlUN75.js';
|
|
3
3
|
import { Address } from 'viem';
|
|
4
4
|
export { P as PreparedInteraction, S as SendInteractionParamsType, a as SendInteractionReturnType } from '../interaction-BngPoHA0.js';
|
|
5
5
|
export { F as FrakRpcError, R as RpcErrorCodes } from '../error-Dflr3G5x.js';
|
|
@@ -36,9 +36,11 @@ declare function createIFrameNexusClient({ config, iframe, }: {
|
|
|
36
36
|
/**
|
|
37
37
|
* Create the given iframe
|
|
38
38
|
* @param walletBaseUrl
|
|
39
|
+
* @param config
|
|
39
40
|
*/
|
|
40
|
-
declare function createIframe({ walletBaseUrl, }: {
|
|
41
|
+
declare function createIframe({ walletBaseUrl, config, }: {
|
|
41
42
|
walletBaseUrl: string;
|
|
43
|
+
config?: NexusWalletSdkConfig;
|
|
42
44
|
}): Promise<HTMLIFrameElement | undefined>;
|
|
43
45
|
|
|
44
46
|
/**
|
package/dist/core/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createIFrameNexusClient
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-VVF4NKYR.js";
|
|
4
4
|
import {
|
|
5
5
|
Deferred,
|
|
6
6
|
FrakContextManager,
|
|
@@ -11,12 +11,12 @@ import {
|
|
|
11
11
|
decompressDataAndCheckHash,
|
|
12
12
|
decompressJson,
|
|
13
13
|
hashAndCompressData
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-ZQSA2VQ4.js";
|
|
15
15
|
import {
|
|
16
16
|
interactionTypes,
|
|
17
17
|
productTypes,
|
|
18
18
|
productTypesMask
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-H3T2GAEC.js";
|
|
20
20
|
export {
|
|
21
21
|
Deferred,
|
|
22
22
|
FrakContextManager,
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
require('../../chunk-
|
|
6
|
+
var _chunk4OJ2NPAScjs = require('../../chunk-4OJ2NPAS.cjs');
|
|
7
|
+
require('../../chunk-QSXZKZJA.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
exports.PressInteractionEncoder =
|
|
13
|
+
exports.PressInteractionEncoder = _chunk4OJ2NPAScjs.PressInteractionEncoder; exports.PurchaseInteractionEncoder = _chunk4OJ2NPAScjs.PurchaseInteractionEncoder; exports.ReferralInteractionEncoder = _chunk4OJ2NPAScjs.ReferralInteractionEncoder; exports.WebShopInteractionEncoder = _chunk4OJ2NPAScjs.WebShopInteractionEncoder;
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
PurchaseInteractionEncoder,
|
|
4
4
|
ReferralInteractionEncoder,
|
|
5
5
|
WebShopInteractionEncoder
|
|
6
|
-
} from "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
} from "../../chunk-P4QEVLVV.js";
|
|
7
|
+
import "../../chunk-H3T2GAEC.js";
|
|
8
8
|
export {
|
|
9
9
|
PressInteractionEncoder,
|
|
10
10
|
PurchaseInteractionEncoder,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as SiweAuthenticationParams, b as ModalRpcMetadata, a as NexusClient, h as SiweAuthenticateReturnType, j as SendTransactionModalStepType, k as SendTransactionReturnType, W as WalletStatusReturnType, F as FrakContext, D as DisplayModalParamsType, M as ModalStepTypes } from './FrakContext-
|
|
1
|
+
import { g as SiweAuthenticationParams, b as ModalRpcMetadata, a as NexusClient, h as SiweAuthenticateReturnType, j as SendTransactionModalStepType, k as SendTransactionReturnType, W as WalletStatusReturnType, F as FrakContext, D as DisplayModalParamsType, M as ModalStepTypes } from './FrakContext-DBdWC7ls.cjs';
|
|
2
2
|
import { Hex } from 'viem';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as SiweAuthenticationParams, b as ModalRpcMetadata, a as NexusClient, h as SiweAuthenticateReturnType, j as SendTransactionModalStepType, k as SendTransactionReturnType, W as WalletStatusReturnType, F as FrakContext, D as DisplayModalParamsType, M as ModalStepTypes } from './FrakContext-
|
|
1
|
+
import { g as SiweAuthenticationParams, b as ModalRpcMetadata, a as NexusClient, h as SiweAuthenticateReturnType, j as SendTransactionModalStepType, k as SendTransactionReturnType, W as WalletStatusReturnType, F as FrakContext, D as DisplayModalParamsType, M as ModalStepTypes } from './FrakContext-CDVlUN75.js';
|
|
2
2
|
import { Hex } from 'viem';
|
|
3
3
|
|
|
4
4
|
/**
|
package/dist/react/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
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
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkQYOOKB34cjs = require('../chunk-QYOOKB34.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -9,16 +9,16 @@ var _chunkWXNW7ZMUcjs = require('../chunk-WXNW7ZMU.cjs');
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkBHZDDGW6cjs = require('../chunk-BHZDDGW6.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
20
|
-
require('../chunk-
|
|
21
|
-
require('../chunk-
|
|
19
|
+
var _chunkF3F4BCGVcjs = require('../chunk-F3F4BCGV.cjs');
|
|
20
|
+
require('../chunk-4OJ2NPAS.cjs');
|
|
21
|
+
require('../chunk-QSXZKZJA.cjs');
|
|
22
22
|
|
|
23
23
|
// src/react/provider/NexusConfigProvider.ts
|
|
24
24
|
var _react = require('react');
|
|
@@ -50,8 +50,8 @@ function NexusConfigProvider(parameters) {
|
|
|
50
50
|
function useNexusConfig() {
|
|
51
51
|
const config = _react.useContext.call(void 0, NexusConfigContext);
|
|
52
52
|
if (!config) {
|
|
53
|
-
throw new (0,
|
|
54
|
-
|
|
53
|
+
throw new (0, _chunkF3F4BCGVcjs.FrakRpcError)(
|
|
54
|
+
_chunkF3F4BCGVcjs.RpcErrorCodes.configError,
|
|
55
55
|
"Nexus config not found"
|
|
56
56
|
);
|
|
57
57
|
}
|
|
@@ -85,9 +85,9 @@ function useWalletStatus() {
|
|
|
85
85
|
queryKey: ["nexus-sdk", "wallet-status-listener"],
|
|
86
86
|
queryFn: async () => {
|
|
87
87
|
if (!client) {
|
|
88
|
-
throw new (0,
|
|
88
|
+
throw new (0, _chunkF3F4BCGVcjs.ClientNotFound)();
|
|
89
89
|
}
|
|
90
|
-
return
|
|
90
|
+
return _chunkBHZDDGW6cjs.watchWalletStatus.call(void 0, client, newStatusUpdated);
|
|
91
91
|
},
|
|
92
92
|
enabled: !!client
|
|
93
93
|
});
|
|
@@ -104,9 +104,9 @@ function useSendTransactionAction({
|
|
|
104
104
|
mutationKey: ["nexus-sdk", "send-transaction"],
|
|
105
105
|
mutationFn: async (params) => {
|
|
106
106
|
if (!client) {
|
|
107
|
-
throw new (0,
|
|
107
|
+
throw new (0, _chunkF3F4BCGVcjs.ClientNotFound)();
|
|
108
108
|
}
|
|
109
|
-
return
|
|
109
|
+
return _chunkBHZDDGW6cjs.sendTransaction.call(void 0, client, params);
|
|
110
110
|
}
|
|
111
111
|
});
|
|
112
112
|
}
|
|
@@ -126,9 +126,9 @@ function useSiweAuthenticate({
|
|
|
126
126
|
],
|
|
127
127
|
mutationFn: async (params) => {
|
|
128
128
|
if (!client) {
|
|
129
|
-
throw new (0,
|
|
129
|
+
throw new (0, _chunkF3F4BCGVcjs.ClientNotFound)();
|
|
130
130
|
}
|
|
131
|
-
return
|
|
131
|
+
return _chunkBHZDDGW6cjs.siweAuthenticate.call(void 0, client, params);
|
|
132
132
|
}
|
|
133
133
|
});
|
|
134
134
|
}
|
|
@@ -181,12 +181,12 @@ function useFrakContext() {
|
|
|
181
181
|
const { location } = useWindowLocation();
|
|
182
182
|
const frakContext = _react.useMemo.call(void 0, () => {
|
|
183
183
|
if (!_optionalChain([location, 'optionalAccess', _7 => _7.href])) return null;
|
|
184
|
-
return
|
|
184
|
+
return _chunkF3F4BCGVcjs.FrakContextManager.parse({ url: location.href });
|
|
185
185
|
}, [_optionalChain([location, 'optionalAccess', _8 => _8.href])]);
|
|
186
186
|
const updateContext = _react.useCallback.call(void 0,
|
|
187
187
|
(newContext) => {
|
|
188
188
|
console.log("Updating context", { newContext });
|
|
189
|
-
|
|
189
|
+
_chunkF3F4BCGVcjs.FrakContextManager.replaceUrl({
|
|
190
190
|
url: _optionalChain([location, 'optionalAccess', _9 => _9.href]),
|
|
191
191
|
context: newContext
|
|
192
192
|
});
|
|
@@ -207,7 +207,7 @@ function useReferralInteraction({
|
|
|
207
207
|
} = {}) {
|
|
208
208
|
const client = useNexusClient();
|
|
209
209
|
const { frakContext } = useFrakContext();
|
|
210
|
-
const { data:
|
|
210
|
+
const { data: walletStatus } = useWalletStatus();
|
|
211
211
|
const {
|
|
212
212
|
data: referralState,
|
|
213
213
|
error,
|
|
@@ -219,22 +219,22 @@ function useReferralInteraction({
|
|
|
219
219
|
"nexus-sdk",
|
|
220
220
|
"auto-referral-interaction",
|
|
221
221
|
_nullishCoalesce(_optionalChain([frakContext, 'optionalAccess', _11 => _11.r]), () => ( "no-referrer")),
|
|
222
|
-
_nullishCoalesce(_optionalChain([
|
|
222
|
+
_nullishCoalesce(_optionalChain([walletStatus, 'optionalAccess', _12 => _12.key]), () => ( "no-wallet-status")),
|
|
223
223
|
_nullishCoalesce(productId, () => ( "no-product-id"))
|
|
224
224
|
],
|
|
225
225
|
queryFn: () => {
|
|
226
226
|
if (!client) {
|
|
227
|
-
throw new (0,
|
|
227
|
+
throw new (0, _chunkF3F4BCGVcjs.ClientNotFound)();
|
|
228
228
|
}
|
|
229
|
-
return
|
|
230
|
-
walletStatus
|
|
229
|
+
return _chunkBHZDDGW6cjs.processReferral.call(void 0, client, {
|
|
230
|
+
walletStatus,
|
|
231
231
|
frakContext,
|
|
232
232
|
modalConfig,
|
|
233
233
|
productId,
|
|
234
234
|
options
|
|
235
235
|
});
|
|
236
236
|
},
|
|
237
|
-
enabled: !!
|
|
237
|
+
enabled: !!walletStatus
|
|
238
238
|
});
|
|
239
239
|
return _react.useMemo.call(void 0, () => {
|
|
240
240
|
if (status === "pending") return "processing";
|
|
@@ -254,9 +254,9 @@ function useSendInteraction({
|
|
|
254
254
|
mutationKey: ["nexus-sdk", "send-interaction"],
|
|
255
255
|
mutationFn: async (params) => {
|
|
256
256
|
if (!client) {
|
|
257
|
-
throw new (0,
|
|
257
|
+
throw new (0, _chunkF3F4BCGVcjs.ClientNotFound)();
|
|
258
258
|
}
|
|
259
|
-
return
|
|
259
|
+
return _chunkBHZDDGW6cjs.sendInteraction.call(void 0, client, params);
|
|
260
260
|
}
|
|
261
261
|
});
|
|
262
262
|
}
|
|
@@ -272,9 +272,9 @@ function useDisplayModal({
|
|
|
272
272
|
mutationKey: ["nexus-sdk", "display-modal"],
|
|
273
273
|
mutationFn: async (args) => {
|
|
274
274
|
if (!client) {
|
|
275
|
-
throw new (0,
|
|
275
|
+
throw new (0, _chunkF3F4BCGVcjs.ClientNotFound)();
|
|
276
276
|
}
|
|
277
|
-
return
|
|
277
|
+
return _chunkBHZDDGW6cjs.displayModal.call(void 0, client, args);
|
|
278
278
|
}
|
|
279
279
|
});
|
|
280
280
|
}
|
|
@@ -288,9 +288,9 @@ function useOpenSso({ mutations } = {}) {
|
|
|
288
288
|
mutationKey: ["nexus-sdk", "open-sso"],
|
|
289
289
|
mutationFn: async (params) => {
|
|
290
290
|
if (!client) {
|
|
291
|
-
throw new (0,
|
|
291
|
+
throw new (0, _chunkF3F4BCGVcjs.ClientNotFound)();
|
|
292
292
|
}
|
|
293
|
-
return
|
|
293
|
+
return _chunkBHZDDGW6cjs.openSso.call(void 0, client, params);
|
|
294
294
|
}
|
|
295
295
|
});
|
|
296
296
|
}
|
|
@@ -306,15 +306,15 @@ function NexusIFrameClientProvider({
|
|
|
306
306
|
const config = useNexusConfig();
|
|
307
307
|
const [client, setClient] = _react.useState.call(void 0, void 0);
|
|
308
308
|
const iFrame = _react.createElement.call(void 0, "iframe", {
|
|
309
|
-
...
|
|
309
|
+
..._chunkF3F4BCGVcjs.baseIframeProps,
|
|
310
310
|
src: `${config.walletUrl}/listener`,
|
|
311
|
-
style: _nullishCoalesce(style, () => (
|
|
311
|
+
style: _nullishCoalesce(style, () => ( _chunkF3F4BCGVcjs.baseIframeProps.style)),
|
|
312
312
|
ref: (iframe) => {
|
|
313
313
|
if (!iframe || client) {
|
|
314
314
|
return;
|
|
315
315
|
}
|
|
316
316
|
setClient(
|
|
317
|
-
|
|
317
|
+
_chunkQYOOKB34cjs.createIFrameNexusClient.call(void 0, {
|
|
318
318
|
iframe,
|
|
319
319
|
config
|
|
320
320
|
})
|
package/dist/react/index.d.cts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { PropsWithChildren, CSSProperties, ReactNode } from 'react';
|
|
3
|
-
import { N as NexusWalletSdkConfig, a as NexusClient, W as WalletStatusReturnType, k as SendTransactionReturnType, h as SiweAuthenticateReturnType, D as DisplayModalParamsType, M as ModalStepTypes, d as ModalRpcStepsResultType, O as OpenSsoParamsType } from '../FrakContext-
|
|
3
|
+
import { N as NexusWalletSdkConfig, a as NexusClient, W as WalletStatusReturnType, k as SendTransactionReturnType, h as SiweAuthenticateReturnType, D as DisplayModalParamsType, M as ModalStepTypes, d as ModalRpcStepsResultType, O as OpenSsoParamsType } from '../FrakContext-DBdWC7ls.cjs';
|
|
4
4
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
5
5
|
import { UseMutationOptions } from '@tanstack/react-query';
|
|
6
6
|
import * as viem from 'viem';
|
|
7
7
|
import { Hex } from 'viem';
|
|
8
8
|
import { F as FrakRpcError } from '../error-Dflr3G5x.cjs';
|
|
9
|
-
import { S as SendTransactionParams, a as SiweAuthenticateModalParams, P as ProcessReferralOptions } from '../processReferral-
|
|
9
|
+
import { S as SendTransactionParams, a as SiweAuthenticateModalParams, P as ProcessReferralOptions } from '../processReferral-BWSIamn2.cjs';
|
|
10
10
|
import { S as SendInteractionParamsType, a as SendInteractionReturnType } from '../interaction-BngPoHA0.cjs';
|
|
11
11
|
import 'viem/chains';
|
|
12
12
|
import 'viem/siwe';
|
|
@@ -19,6 +19,7 @@ declare const NexusConfigContext: react.Context<Readonly<{
|
|
|
19
19
|
metadata: {
|
|
20
20
|
name: string;
|
|
21
21
|
css?: string;
|
|
22
|
+
buttonShare?: string;
|
|
22
23
|
};
|
|
23
24
|
domain: string;
|
|
24
25
|
}> | undefined>;
|
|
@@ -40,6 +41,7 @@ declare function NexusConfigProvider(parameters: PropsWithChildren<NexusConfigPr
|
|
|
40
41
|
metadata: {
|
|
41
42
|
name: string;
|
|
42
43
|
css?: string;
|
|
44
|
+
buttonShare?: string;
|
|
43
45
|
};
|
|
44
46
|
domain: string;
|
|
45
47
|
}> | undefined>>;
|
|
@@ -75,6 +77,7 @@ declare function useNexusConfig(): Readonly<{
|
|
|
75
77
|
metadata: {
|
|
76
78
|
name: string;
|
|
77
79
|
css?: string;
|
|
80
|
+
buttonShare?: string;
|
|
78
81
|
};
|
|
79
82
|
domain: string;
|
|
80
83
|
}>;
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { PropsWithChildren, CSSProperties, ReactNode } from 'react';
|
|
3
|
-
import { N as NexusWalletSdkConfig, a as NexusClient, W as WalletStatusReturnType, k as SendTransactionReturnType, h as SiweAuthenticateReturnType, D as DisplayModalParamsType, M as ModalStepTypes, d as ModalRpcStepsResultType, O as OpenSsoParamsType } from '../FrakContext-
|
|
3
|
+
import { N as NexusWalletSdkConfig, a as NexusClient, W as WalletStatusReturnType, k as SendTransactionReturnType, h as SiweAuthenticateReturnType, D as DisplayModalParamsType, M as ModalStepTypes, d as ModalRpcStepsResultType, O as OpenSsoParamsType } from '../FrakContext-CDVlUN75.js';
|
|
4
4
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
5
5
|
import { UseMutationOptions } from '@tanstack/react-query';
|
|
6
6
|
import * as viem from 'viem';
|
|
7
7
|
import { Hex } from 'viem';
|
|
8
8
|
import { F as FrakRpcError } from '../error-Dflr3G5x.js';
|
|
9
|
-
import { S as SendTransactionParams, a as SiweAuthenticateModalParams, P as ProcessReferralOptions } from '../processReferral-
|
|
9
|
+
import { S as SendTransactionParams, a as SiweAuthenticateModalParams, P as ProcessReferralOptions } from '../processReferral-CFyGAENf.js';
|
|
10
10
|
import { S as SendInteractionParamsType, a as SendInteractionReturnType } from '../interaction-BngPoHA0.js';
|
|
11
11
|
import 'viem/chains';
|
|
12
12
|
import 'viem/siwe';
|
|
@@ -19,6 +19,7 @@ declare const NexusConfigContext: react.Context<Readonly<{
|
|
|
19
19
|
metadata: {
|
|
20
20
|
name: string;
|
|
21
21
|
css?: string;
|
|
22
|
+
buttonShare?: string;
|
|
22
23
|
};
|
|
23
24
|
domain: string;
|
|
24
25
|
}> | undefined>;
|
|
@@ -40,6 +41,7 @@ declare function NexusConfigProvider(parameters: PropsWithChildren<NexusConfigPr
|
|
|
40
41
|
metadata: {
|
|
41
42
|
name: string;
|
|
42
43
|
css?: string;
|
|
44
|
+
buttonShare?: string;
|
|
43
45
|
};
|
|
44
46
|
domain: string;
|
|
45
47
|
}> | undefined>>;
|
|
@@ -75,6 +77,7 @@ declare function useNexusConfig(): Readonly<{
|
|
|
75
77
|
metadata: {
|
|
76
78
|
name: string;
|
|
77
79
|
css?: string;
|
|
80
|
+
buttonShare?: string;
|
|
78
81
|
};
|
|
79
82
|
domain: string;
|
|
80
83
|
}>;
|