@frak-labs/nexus-sdk 0.0.23 → 0.0.24
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-DBdWC7ls.d.cts → FrakContext-DKSVaeVb.d.cts} +62 -3
- package/dist/{FrakContext-CDVlUN75.d.ts → FrakContext-DjeuWC2U.d.ts} +62 -3
- package/dist/bundle/bundle.js +5 -5
- package/dist/{chunk-ZQSA2VQ4.js → chunk-2VNIEGOJ.js} +10 -6
- package/dist/{chunk-4Q2OHGWX.js → chunk-4MMSQL44.js} +15 -5
- package/dist/{chunk-4OJ2NPAS.cjs → chunk-4PVF24BB.cjs} +15 -15
- package/dist/{chunk-H3T2GAEC.js → chunk-BOGCLEPR.js} +2 -1
- package/dist/{chunk-BHZDDGW6.cjs → chunk-DE2KWQVP.cjs} +36 -26
- package/dist/{chunk-P4QEVLVV.js → chunk-FETGS7X7.js} +1 -1
- package/dist/{chunk-F3F4BCGV.cjs → chunk-H4BK3CNV.cjs} +20 -16
- package/dist/{chunk-QSXZKZJA.cjs → chunk-P3J2BIUT.cjs} +2 -1
- package/dist/{chunk-QYOOKB34.cjs → chunk-QLM5NFMZ.cjs} +22 -22
- package/dist/{chunk-VVF4NKYR.js → chunk-YPQA63LW.js} +2 -2
- package/dist/core/actions/index.cjs +7 -5
- package/dist/core/actions/index.d.cts +11 -5
- package/dist/core/actions/index.d.ts +11 -5
- package/dist/core/actions/index.js +6 -4
- package/dist/core/index.cjs +4 -4
- package/dist/core/index.d.cts +13 -25
- package/dist/core/index.d.ts +13 -25
- 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-CFyGAENf.d.ts → processReferral-CJI_Rc4K.d.ts} +1 -1
- package/dist/{processReferral-BWSIamn2.d.cts → processReferral-DUP8imQV.d.cts} +1 -1
- package/dist/react/index.cjs +48 -27
- package/dist/react/index.d.cts +20 -13
- package/dist/react/index.d.ts +20 -13
- package/dist/react/index.js +26 -5
- package/package.json +42 -19
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
displayModal,
|
|
3
|
+
getProductInformation,
|
|
3
4
|
modalBuilder,
|
|
4
5
|
openSso,
|
|
5
6
|
processReferral,
|
|
@@ -9,12 +10,13 @@ import {
|
|
|
9
10
|
siweAuthenticate,
|
|
10
11
|
trackPurchaseStatus,
|
|
11
12
|
watchWalletStatus
|
|
12
|
-
} from "../../chunk-
|
|
13
|
-
import "../../chunk-
|
|
14
|
-
import "../../chunk-
|
|
15
|
-
import "../../chunk-
|
|
13
|
+
} from "../../chunk-4MMSQL44.js";
|
|
14
|
+
import "../../chunk-2VNIEGOJ.js";
|
|
15
|
+
import "../../chunk-FETGS7X7.js";
|
|
16
|
+
import "../../chunk-BOGCLEPR.js";
|
|
16
17
|
export {
|
|
17
18
|
displayModal,
|
|
19
|
+
getProductInformation,
|
|
18
20
|
modalBuilder,
|
|
19
21
|
openSso,
|
|
20
22
|
processReferral,
|
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 _chunkQLM5NFMZcjs = require('../chunk-QLM5NFMZ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -11,12 +11,12 @@ var _chunkQYOOKB34cjs = require('../chunk-QYOOKB34.cjs');
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkH4BK3CNVcjs = require('../chunk-H4BK3CNV.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunkP3J2BIUTcjs = require('../chunk-P3J2BIUT.cjs');
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
@@ -31,4 +31,4 @@ var _chunkQSXZKZJAcjs = require('../chunk-QSXZKZJA.cjs');
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
exports.Deferred =
|
|
34
|
+
exports.Deferred = _chunkH4BK3CNVcjs.Deferred; exports.FrakContextManager = _chunkH4BK3CNVcjs.FrakContextManager; exports.FrakRpcError = _chunkH4BK3CNVcjs.FrakRpcError; exports.RpcErrorCodes = _chunkH4BK3CNVcjs.RpcErrorCodes; exports.compressJson = _chunkH4BK3CNVcjs.compressJson; exports.createIFrameNexusClient = _chunkQLM5NFMZcjs.createIFrameNexusClient; exports.createIframe = _chunkH4BK3CNVcjs.createIframe; exports.decompressDataAndCheckHash = _chunkH4BK3CNVcjs.decompressDataAndCheckHash; exports.decompressJson = _chunkH4BK3CNVcjs.decompressJson; exports.hashAndCompressData = _chunkH4BK3CNVcjs.hashAndCompressData; exports.interactionTypes = _chunkP3J2BIUTcjs.interactionTypes; exports.productTypes = _chunkP3J2BIUTcjs.productTypes; exports.productTypesMask = _chunkP3J2BIUTcjs.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,
|
|
1
|
+
import { N as NexusWalletSdkConfig, a as NexusClient, F as FrakContext } from '../FrakContext-DKSVaeVb.cjs';
|
|
2
|
+
export { C as ClientLifecycleEvent, D as DisplayModalParamsType, E as ExtractedParametersFromRpc, v as ExtractedReturnTypeFromRpc, q as FinalActionType, o as FinalModalStepType, G as GetProductInformationReturnType, t as IFrameEvent, u as IFrameLifecycleEvent, s as IFrameRpcEvent, I as IFrameRpcSchema, r 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, P as ProductTypesKey, R as RpcResponse, k as SendTransactionModalStepType, l as SendTransactionReturnType, j as SendTransactionTxType, g as SiweAuthenticateModalStepType, i as SiweAuthenticateReturnType, h as SiweAuthenticationParams, S as SsoMetadata, W as WalletStatusReturnType, p as productTypes, b as productTypesMask } from '../FrakContext-DKSVaeVb.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';
|
|
@@ -35,11 +35,11 @@ declare function createIFrameNexusClient({ config, iframe, }: {
|
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* Create the given iframe
|
|
38
|
-
* @param walletBaseUrl
|
|
38
|
+
* @param walletBaseUrl - @deprecated Use config.walletUrl instead. Will be removed in future versions.
|
|
39
39
|
* @param config
|
|
40
40
|
*/
|
|
41
41
|
declare function createIframe({ walletBaseUrl, config, }: {
|
|
42
|
-
walletBaseUrl
|
|
42
|
+
walletBaseUrl?: string;
|
|
43
43
|
config?: NexusWalletSdkConfig;
|
|
44
44
|
}): Promise<HTMLIFrameElement | undefined>;
|
|
45
45
|
|
|
@@ -127,30 +127,17 @@ declare class Deferred<T> {
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
/**
|
|
130
|
-
* The keys for each
|
|
131
|
-
*/
|
|
132
|
-
type ProductTypesKey = keyof typeof productTypes;
|
|
133
|
-
/**
|
|
134
|
-
* List of the product types per denominator
|
|
135
|
-
*/
|
|
136
|
-
declare const productTypes: {
|
|
137
|
-
dapp: number;
|
|
138
|
-
press: number;
|
|
139
|
-
webshop: number;
|
|
140
|
-
referral: number;
|
|
141
|
-
purchase: number;
|
|
142
|
-
};
|
|
143
|
-
/**
|
|
144
|
-
* Bitmask for each product types
|
|
145
|
-
*/
|
|
146
|
-
declare const productTypesMask: Record<ProductTypesKey, bigint>;
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* The keys for each interaction types
|
|
130
|
+
* The final keys for each interaction types (e.g. `openArticle`) -> interaction type
|
|
150
131
|
*/
|
|
151
132
|
type InteractionTypesKey = {
|
|
152
133
|
[K in keyof typeof interactionTypes]: keyof (typeof interactionTypes)[K];
|
|
153
134
|
}[keyof typeof interactionTypes];
|
|
135
|
+
/**
|
|
136
|
+
* The keys for each interaction types (e.g. `press.openArticle`) -> category_type.interaction_type
|
|
137
|
+
*/
|
|
138
|
+
type FullInteractionTypesKey = {
|
|
139
|
+
[Category in keyof typeof interactionTypes]: `${Category & string}.${keyof (typeof interactionTypes)[Category] & string}`;
|
|
140
|
+
}[keyof typeof interactionTypes];
|
|
154
141
|
/**
|
|
155
142
|
* Each interactions types according to the product types
|
|
156
143
|
*/
|
|
@@ -173,7 +160,8 @@ declare const interactionTypes: {
|
|
|
173
160
|
readonly purchase: {
|
|
174
161
|
readonly started: "0xd87e90c3";
|
|
175
162
|
readonly completed: "0x8403aeb4";
|
|
163
|
+
readonly unsafeCompleted: "0x4d5b14e0";
|
|
176
164
|
};
|
|
177
165
|
};
|
|
178
166
|
|
|
179
|
-
export { type CompressedData, Deferred, FrakContextManager, type HashProtectedData, type InteractionTypesKey, type KeyProvider, NexusClient, NexusWalletSdkConfig,
|
|
167
|
+
export { type CompressedData, Deferred, FrakContextManager, type FullInteractionTypesKey, type HashProtectedData, type InteractionTypesKey, type KeyProvider, NexusClient, NexusWalletSdkConfig, compressJson, createIFrameNexusClient, createIframe, decompressDataAndCheckHash, decompressJson, hashAndCompressData, interactionTypes };
|
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,
|
|
1
|
+
import { N as NexusWalletSdkConfig, a as NexusClient, F as FrakContext } from '../FrakContext-DjeuWC2U.js';
|
|
2
|
+
export { C as ClientLifecycleEvent, D as DisplayModalParamsType, E as ExtractedParametersFromRpc, v as ExtractedReturnTypeFromRpc, q as FinalActionType, o as FinalModalStepType, G as GetProductInformationReturnType, t as IFrameEvent, u as IFrameLifecycleEvent, s as IFrameRpcEvent, I as IFrameRpcSchema, r 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, P as ProductTypesKey, R as RpcResponse, k as SendTransactionModalStepType, l as SendTransactionReturnType, j as SendTransactionTxType, g as SiweAuthenticateModalStepType, i as SiweAuthenticateReturnType, h as SiweAuthenticationParams, S as SsoMetadata, W as WalletStatusReturnType, p as productTypes, b as productTypesMask } from '../FrakContext-DjeuWC2U.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';
|
|
@@ -35,11 +35,11 @@ declare function createIFrameNexusClient({ config, iframe, }: {
|
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* Create the given iframe
|
|
38
|
-
* @param walletBaseUrl
|
|
38
|
+
* @param walletBaseUrl - @deprecated Use config.walletUrl instead. Will be removed in future versions.
|
|
39
39
|
* @param config
|
|
40
40
|
*/
|
|
41
41
|
declare function createIframe({ walletBaseUrl, config, }: {
|
|
42
|
-
walletBaseUrl
|
|
42
|
+
walletBaseUrl?: string;
|
|
43
43
|
config?: NexusWalletSdkConfig;
|
|
44
44
|
}): Promise<HTMLIFrameElement | undefined>;
|
|
45
45
|
|
|
@@ -127,30 +127,17 @@ declare class Deferred<T> {
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
/**
|
|
130
|
-
* The keys for each
|
|
131
|
-
*/
|
|
132
|
-
type ProductTypesKey = keyof typeof productTypes;
|
|
133
|
-
/**
|
|
134
|
-
* List of the product types per denominator
|
|
135
|
-
*/
|
|
136
|
-
declare const productTypes: {
|
|
137
|
-
dapp: number;
|
|
138
|
-
press: number;
|
|
139
|
-
webshop: number;
|
|
140
|
-
referral: number;
|
|
141
|
-
purchase: number;
|
|
142
|
-
};
|
|
143
|
-
/**
|
|
144
|
-
* Bitmask for each product types
|
|
145
|
-
*/
|
|
146
|
-
declare const productTypesMask: Record<ProductTypesKey, bigint>;
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* The keys for each interaction types
|
|
130
|
+
* The final keys for each interaction types (e.g. `openArticle`) -> interaction type
|
|
150
131
|
*/
|
|
151
132
|
type InteractionTypesKey = {
|
|
152
133
|
[K in keyof typeof interactionTypes]: keyof (typeof interactionTypes)[K];
|
|
153
134
|
}[keyof typeof interactionTypes];
|
|
135
|
+
/**
|
|
136
|
+
* The keys for each interaction types (e.g. `press.openArticle`) -> category_type.interaction_type
|
|
137
|
+
*/
|
|
138
|
+
type FullInteractionTypesKey = {
|
|
139
|
+
[Category in keyof typeof interactionTypes]: `${Category & string}.${keyof (typeof interactionTypes)[Category] & string}`;
|
|
140
|
+
}[keyof typeof interactionTypes];
|
|
154
141
|
/**
|
|
155
142
|
* Each interactions types according to the product types
|
|
156
143
|
*/
|
|
@@ -173,7 +160,8 @@ declare const interactionTypes: {
|
|
|
173
160
|
readonly purchase: {
|
|
174
161
|
readonly started: "0xd87e90c3";
|
|
175
162
|
readonly completed: "0x8403aeb4";
|
|
163
|
+
readonly unsafeCompleted: "0x4d5b14e0";
|
|
176
164
|
};
|
|
177
165
|
};
|
|
178
166
|
|
|
179
|
-
export { type CompressedData, Deferred, FrakContextManager, type HashProtectedData, type InteractionTypesKey, type KeyProvider, NexusClient, NexusWalletSdkConfig,
|
|
167
|
+
export { type CompressedData, Deferred, FrakContextManager, type FullInteractionTypesKey, type HashProtectedData, type InteractionTypesKey, type KeyProvider, NexusClient, NexusWalletSdkConfig, compressJson, createIFrameNexusClient, createIframe, decompressDataAndCheckHash, decompressJson, hashAndCompressData, interactionTypes };
|
package/dist/core/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createIFrameNexusClient
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-YPQA63LW.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-2VNIEGOJ.js";
|
|
15
15
|
import {
|
|
16
16
|
interactionTypes,
|
|
17
17
|
productTypes,
|
|
18
18
|
productTypesMask
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-BOGCLEPR.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 _chunk4PVF24BBcjs = require('../../chunk-4PVF24BB.cjs');
|
|
7
|
+
require('../../chunk-P3J2BIUT.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
exports.PressInteractionEncoder =
|
|
13
|
+
exports.PressInteractionEncoder = _chunk4PVF24BBcjs.PressInteractionEncoder; exports.PurchaseInteractionEncoder = _chunk4PVF24BBcjs.PurchaseInteractionEncoder; exports.ReferralInteractionEncoder = _chunk4PVF24BBcjs.ReferralInteractionEncoder; exports.WebShopInteractionEncoder = _chunk4PVF24BBcjs.WebShopInteractionEncoder;
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
PurchaseInteractionEncoder,
|
|
4
4
|
ReferralInteractionEncoder,
|
|
5
5
|
WebShopInteractionEncoder
|
|
6
|
-
} from "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
} from "../../chunk-FETGS7X7.js";
|
|
7
|
+
import "../../chunk-BOGCLEPR.js";
|
|
8
8
|
export {
|
|
9
9
|
PressInteractionEncoder,
|
|
10
10
|
PurchaseInteractionEncoder,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h as SiweAuthenticationParams, c as ModalRpcMetadata, a as NexusClient, i as SiweAuthenticateReturnType, k as SendTransactionModalStepType, l as SendTransactionReturnType, W as WalletStatusReturnType, F as FrakContext, D as DisplayModalParamsType, M as ModalStepTypes } from './FrakContext-DjeuWC2U.js';
|
|
2
2
|
import { Hex } from 'viem';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h as SiweAuthenticationParams, c as ModalRpcMetadata, a as NexusClient, i as SiweAuthenticateReturnType, k as SendTransactionModalStepType, l as SendTransactionReturnType, W as WalletStatusReturnType, F as FrakContext, D as DisplayModalParamsType, M as ModalStepTypes } from './FrakContext-DKSVaeVb.cjs';
|
|
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 _chunkQLM5NFMZcjs = require('../chunk-QLM5NFMZ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -9,16 +9,17 @@ var _chunkQYOOKB34cjs = require('../chunk-QYOOKB34.cjs');
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var _chunkBHZDDGW6cjs = require('../chunk-BHZDDGW6.cjs');
|
|
13
12
|
|
|
13
|
+
var _chunkDE2KWQVPcjs = require('../chunk-DE2KWQVP.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
require('../chunk-
|
|
21
|
-
require('../chunk-
|
|
19
|
+
|
|
20
|
+
var _chunkH4BK3CNVcjs = require('../chunk-H4BK3CNV.cjs');
|
|
21
|
+
require('../chunk-4PVF24BB.cjs');
|
|
22
|
+
require('../chunk-P3J2BIUT.cjs');
|
|
22
23
|
|
|
23
24
|
// src/react/provider/NexusConfigProvider.ts
|
|
24
25
|
var _react = require('react');
|
|
@@ -30,6 +31,7 @@ function NexusConfigProvider(parameters) {
|
|
|
30
31
|
{
|
|
31
32
|
value: {
|
|
32
33
|
...config,
|
|
34
|
+
walletUrl: _nullishCoalesce(config.walletUrl, () => ( "https://wallet.frak.id")),
|
|
33
35
|
domain: _nullishCoalesce(_nullishCoalesce(config.domain, () => ( (typeof window !== "undefined" ? _optionalChain([window, 'optionalAccess', _ => _.location, 'optionalAccess', _2 => _2.host]) : void 0))), () => ( "not-found"))
|
|
34
36
|
}
|
|
35
37
|
},
|
|
@@ -50,8 +52,8 @@ function NexusConfigProvider(parameters) {
|
|
|
50
52
|
function useNexusConfig() {
|
|
51
53
|
const config = _react.useContext.call(void 0, NexusConfigContext);
|
|
52
54
|
if (!config) {
|
|
53
|
-
throw new (0,
|
|
54
|
-
|
|
55
|
+
throw new (0, _chunkH4BK3CNVcjs.FrakRpcError)(
|
|
56
|
+
_chunkH4BK3CNVcjs.RpcErrorCodes.configError,
|
|
55
57
|
"Nexus config not found"
|
|
56
58
|
);
|
|
57
59
|
}
|
|
@@ -85,9 +87,9 @@ function useWalletStatus() {
|
|
|
85
87
|
queryKey: ["nexus-sdk", "wallet-status-listener"],
|
|
86
88
|
queryFn: async () => {
|
|
87
89
|
if (!client) {
|
|
88
|
-
throw new (0,
|
|
90
|
+
throw new (0, _chunkH4BK3CNVcjs.ClientNotFound)();
|
|
89
91
|
}
|
|
90
|
-
return
|
|
92
|
+
return _chunkDE2KWQVPcjs.watchWalletStatus.call(void 0, client, newStatusUpdated);
|
|
91
93
|
},
|
|
92
94
|
enabled: !!client
|
|
93
95
|
});
|
|
@@ -104,9 +106,9 @@ function useSendTransactionAction({
|
|
|
104
106
|
mutationKey: ["nexus-sdk", "send-transaction"],
|
|
105
107
|
mutationFn: async (params) => {
|
|
106
108
|
if (!client) {
|
|
107
|
-
throw new (0,
|
|
109
|
+
throw new (0, _chunkH4BK3CNVcjs.ClientNotFound)();
|
|
108
110
|
}
|
|
109
|
-
return
|
|
111
|
+
return _chunkDE2KWQVPcjs.sendTransaction.call(void 0, client, params);
|
|
110
112
|
}
|
|
111
113
|
});
|
|
112
114
|
}
|
|
@@ -126,9 +128,9 @@ function useSiweAuthenticate({
|
|
|
126
128
|
],
|
|
127
129
|
mutationFn: async (params) => {
|
|
128
130
|
if (!client) {
|
|
129
|
-
throw new (0,
|
|
131
|
+
throw new (0, _chunkH4BK3CNVcjs.ClientNotFound)();
|
|
130
132
|
}
|
|
131
|
-
return
|
|
133
|
+
return _chunkDE2KWQVPcjs.siweAuthenticate.call(void 0, client, params);
|
|
132
134
|
}
|
|
133
135
|
});
|
|
134
136
|
}
|
|
@@ -181,12 +183,12 @@ function useFrakContext() {
|
|
|
181
183
|
const { location } = useWindowLocation();
|
|
182
184
|
const frakContext = _react.useMemo.call(void 0, () => {
|
|
183
185
|
if (!_optionalChain([location, 'optionalAccess', _7 => _7.href])) return null;
|
|
184
|
-
return
|
|
186
|
+
return _chunkH4BK3CNVcjs.FrakContextManager.parse({ url: location.href });
|
|
185
187
|
}, [_optionalChain([location, 'optionalAccess', _8 => _8.href])]);
|
|
186
188
|
const updateContext = _react.useCallback.call(void 0,
|
|
187
189
|
(newContext) => {
|
|
188
190
|
console.log("Updating context", { newContext });
|
|
189
|
-
|
|
191
|
+
_chunkH4BK3CNVcjs.FrakContextManager.replaceUrl({
|
|
190
192
|
url: _optionalChain([location, 'optionalAccess', _9 => _9.href]),
|
|
191
193
|
context: newContext
|
|
192
194
|
});
|
|
@@ -224,9 +226,9 @@ function useReferralInteraction({
|
|
|
224
226
|
],
|
|
225
227
|
queryFn: () => {
|
|
226
228
|
if (!client) {
|
|
227
|
-
throw new (0,
|
|
229
|
+
throw new (0, _chunkH4BK3CNVcjs.ClientNotFound)();
|
|
228
230
|
}
|
|
229
|
-
return
|
|
231
|
+
return _chunkDE2KWQVPcjs.processReferral.call(void 0, client, {
|
|
230
232
|
walletStatus,
|
|
231
233
|
frakContext,
|
|
232
234
|
modalConfig,
|
|
@@ -254,9 +256,9 @@ function useSendInteraction({
|
|
|
254
256
|
mutationKey: ["nexus-sdk", "send-interaction"],
|
|
255
257
|
mutationFn: async (params) => {
|
|
256
258
|
if (!client) {
|
|
257
|
-
throw new (0,
|
|
259
|
+
throw new (0, _chunkH4BK3CNVcjs.ClientNotFound)();
|
|
258
260
|
}
|
|
259
|
-
return
|
|
261
|
+
return _chunkDE2KWQVPcjs.sendInteraction.call(void 0, client, params);
|
|
260
262
|
}
|
|
261
263
|
});
|
|
262
264
|
}
|
|
@@ -272,9 +274,9 @@ function useDisplayModal({
|
|
|
272
274
|
mutationKey: ["nexus-sdk", "display-modal"],
|
|
273
275
|
mutationFn: async (args) => {
|
|
274
276
|
if (!client) {
|
|
275
|
-
throw new (0,
|
|
277
|
+
throw new (0, _chunkH4BK3CNVcjs.ClientNotFound)();
|
|
276
278
|
}
|
|
277
|
-
return
|
|
279
|
+
return _chunkDE2KWQVPcjs.displayModal.call(void 0, client, args);
|
|
278
280
|
}
|
|
279
281
|
});
|
|
280
282
|
}
|
|
@@ -288,9 +290,27 @@ function useOpenSso({ mutations } = {}) {
|
|
|
288
290
|
mutationKey: ["nexus-sdk", "open-sso"],
|
|
289
291
|
mutationFn: async (params) => {
|
|
290
292
|
if (!client) {
|
|
291
|
-
throw new (0,
|
|
293
|
+
throw new (0, _chunkH4BK3CNVcjs.ClientNotFound)();
|
|
292
294
|
}
|
|
293
|
-
return
|
|
295
|
+
return _chunkDE2KWQVPcjs.openSso.call(void 0, client, params);
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
// src/react/hook/useGetProductInformation.ts
|
|
301
|
+
|
|
302
|
+
function useGetProductInformation({
|
|
303
|
+
query
|
|
304
|
+
} = {}) {
|
|
305
|
+
const client = useNexusClient();
|
|
306
|
+
return _reactquery.useQuery.call(void 0, {
|
|
307
|
+
...query,
|
|
308
|
+
queryKey: ["nexus-sdk", "get-product-information"],
|
|
309
|
+
queryFn: async () => {
|
|
310
|
+
if (!client) {
|
|
311
|
+
throw new (0, _chunkH4BK3CNVcjs.ClientNotFound)();
|
|
312
|
+
}
|
|
313
|
+
return _chunkDE2KWQVPcjs.getProductInformation.call(void 0, client);
|
|
294
314
|
}
|
|
295
315
|
});
|
|
296
316
|
}
|
|
@@ -306,15 +326,15 @@ function NexusIFrameClientProvider({
|
|
|
306
326
|
const config = useNexusConfig();
|
|
307
327
|
const [client, setClient] = _react.useState.call(void 0, void 0);
|
|
308
328
|
const iFrame = _react.createElement.call(void 0, "iframe", {
|
|
309
|
-
...
|
|
329
|
+
..._chunkH4BK3CNVcjs.baseIframeProps,
|
|
310
330
|
src: `${config.walletUrl}/listener`,
|
|
311
|
-
style: _nullishCoalesce(style, () => (
|
|
331
|
+
style: _nullishCoalesce(style, () => ( _chunkH4BK3CNVcjs.baseIframeProps.style)),
|
|
312
332
|
ref: (iframe) => {
|
|
313
333
|
if (!iframe || client) {
|
|
314
334
|
return;
|
|
315
335
|
}
|
|
316
336
|
setClient(
|
|
317
|
-
|
|
337
|
+
_chunkQLM5NFMZcjs.createIFrameNexusClient.call(void 0, {
|
|
318
338
|
iframe,
|
|
319
339
|
config
|
|
320
340
|
})
|
|
@@ -342,4 +362,5 @@ function NexusIFrameClientProvider({
|
|
|
342
362
|
|
|
343
363
|
|
|
344
364
|
|
|
345
|
-
|
|
365
|
+
|
|
366
|
+
exports.NexusConfigContext = NexusConfigContext; exports.NexusConfigProvider = NexusConfigProvider; exports.NexusIFrameClientContext = NexusIFrameClientContext; exports.NexusIFrameClientProvider = NexusIFrameClientProvider; exports.useDisplayModal = useDisplayModal; exports.useGetProductInformation = useGetProductInformation; exports.useNexusClient = useNexusClient; exports.useNexusConfig = useNexusConfig; exports.useOpenSso = useOpenSso; exports.useReferralInteraction = useReferralInteraction; exports.useSendInteraction = useSendInteraction; exports.useSendTransactionAction = useSendTransactionAction; exports.useSiweAuthenticate = useSiweAuthenticate; exports.useWalletStatus = useWalletStatus;
|
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,
|
|
3
|
+
import { N as NexusWalletSdkConfig, a as NexusClient, W as WalletStatusReturnType, l as SendTransactionReturnType, i as SiweAuthenticateReturnType, D as DisplayModalParamsType, M as ModalStepTypes, e as ModalRpcStepsResultType, O as OpenSsoParamsType, G as GetProductInformationReturnType } from '../FrakContext-DKSVaeVb.cjs';
|
|
4
4
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
5
|
-
import { UseMutationOptions } from '@tanstack/react-query';
|
|
5
|
+
import { UseMutationOptions, UseQueryOptions } 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-DUP8imQV.cjs';
|
|
10
10
|
import { S as SendInteractionParamsType, a as SendInteractionReturnType } from '../interaction-BngPoHA0.cjs';
|
|
11
11
|
import 'viem/chains';
|
|
12
12
|
import 'viem/siwe';
|
|
@@ -15,21 +15,19 @@ import 'viem/siwe';
|
|
|
15
15
|
* The context that will keep the Nexus Wallet SDK configuration
|
|
16
16
|
*/
|
|
17
17
|
declare const NexusConfigContext: react.Context<Readonly<{
|
|
18
|
-
walletUrl
|
|
18
|
+
walletUrl?: string;
|
|
19
19
|
metadata: {
|
|
20
20
|
name: string;
|
|
21
21
|
css?: string;
|
|
22
22
|
buttonShare?: string;
|
|
23
23
|
};
|
|
24
|
-
domain
|
|
24
|
+
domain?: string;
|
|
25
25
|
}> | undefined>;
|
|
26
26
|
/**
|
|
27
27
|
* Props to instantiate the Nexus Wallet SDK configuration provider
|
|
28
28
|
*/
|
|
29
29
|
type NexusConfigProviderProps = {
|
|
30
|
-
config:
|
|
31
|
-
domain?: string;
|
|
32
|
-
};
|
|
30
|
+
config: NexusWalletSdkConfig;
|
|
33
31
|
};
|
|
34
32
|
/**
|
|
35
33
|
* Simple config provider for the Nexus Wallet SDK
|
|
@@ -37,13 +35,13 @@ type NexusConfigProviderProps = {
|
|
|
37
35
|
* @constructor
|
|
38
36
|
*/
|
|
39
37
|
declare function NexusConfigProvider(parameters: PropsWithChildren<NexusConfigProviderProps>): react.FunctionComponentElement<react.ProviderProps<Readonly<{
|
|
40
|
-
walletUrl
|
|
38
|
+
walletUrl?: string;
|
|
41
39
|
metadata: {
|
|
42
40
|
name: string;
|
|
43
41
|
css?: string;
|
|
44
42
|
buttonShare?: string;
|
|
45
43
|
};
|
|
46
|
-
domain
|
|
44
|
+
domain?: string;
|
|
47
45
|
}> | undefined>>;
|
|
48
46
|
|
|
49
47
|
/**
|
|
@@ -73,13 +71,13 @@ declare function NexusIFrameClientProvider({ style, children, }: {
|
|
|
73
71
|
* Use the current nexus config
|
|
74
72
|
*/
|
|
75
73
|
declare function useNexusConfig(): Readonly<{
|
|
76
|
-
walletUrl
|
|
74
|
+
walletUrl?: string;
|
|
77
75
|
metadata: {
|
|
78
76
|
name: string;
|
|
79
77
|
css?: string;
|
|
80
78
|
buttonShare?: string;
|
|
81
79
|
};
|
|
82
|
-
domain
|
|
80
|
+
domain?: string;
|
|
83
81
|
}>;
|
|
84
82
|
|
|
85
83
|
/**
|
|
@@ -157,4 +155,13 @@ interface UseSendInteractionParams {
|
|
|
157
155
|
*/
|
|
158
156
|
declare function useOpenSso({ mutations }?: UseSendInteractionParams): _tanstack_react_query.UseMutationResult<void, FrakRpcError<undefined>, OpenSsoParamsType, unknown>;
|
|
159
157
|
|
|
160
|
-
|
|
158
|
+
type QueryOptions = Omit<UseQueryOptions<GetProductInformationReturnType, FrakRpcError, undefined>, "queryKey" | "queryFn">;
|
|
159
|
+
interface UseGetProductInformationParams {
|
|
160
|
+
query?: QueryOptions;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Open the SSO
|
|
164
|
+
*/
|
|
165
|
+
declare function useGetProductInformation({ query, }?: UseGetProductInformationParams): _tanstack_react_query.UseQueryResult<undefined, FrakRpcError<undefined>>;
|
|
166
|
+
|
|
167
|
+
export { NexusConfigContext, NexusConfigProvider, type NexusConfigProviderProps, NexusIFrameClientContext, type NexusIFrameClientProps, NexusIFrameClientProvider, useDisplayModal, useGetProductInformation, useNexusClient, useNexusConfig, useOpenSso, useReferralInteraction, useSendInteraction, useSendTransactionAction, useSiweAuthenticate, useWalletStatus };
|
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,
|
|
3
|
+
import { N as NexusWalletSdkConfig, a as NexusClient, W as WalletStatusReturnType, l as SendTransactionReturnType, i as SiweAuthenticateReturnType, D as DisplayModalParamsType, M as ModalStepTypes, e as ModalRpcStepsResultType, O as OpenSsoParamsType, G as GetProductInformationReturnType } from '../FrakContext-DjeuWC2U.js';
|
|
4
4
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
5
|
-
import { UseMutationOptions } from '@tanstack/react-query';
|
|
5
|
+
import { UseMutationOptions, UseQueryOptions } 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-CJI_Rc4K.js';
|
|
10
10
|
import { S as SendInteractionParamsType, a as SendInteractionReturnType } from '../interaction-BngPoHA0.js';
|
|
11
11
|
import 'viem/chains';
|
|
12
12
|
import 'viem/siwe';
|
|
@@ -15,21 +15,19 @@ import 'viem/siwe';
|
|
|
15
15
|
* The context that will keep the Nexus Wallet SDK configuration
|
|
16
16
|
*/
|
|
17
17
|
declare const NexusConfigContext: react.Context<Readonly<{
|
|
18
|
-
walletUrl
|
|
18
|
+
walletUrl?: string;
|
|
19
19
|
metadata: {
|
|
20
20
|
name: string;
|
|
21
21
|
css?: string;
|
|
22
22
|
buttonShare?: string;
|
|
23
23
|
};
|
|
24
|
-
domain
|
|
24
|
+
domain?: string;
|
|
25
25
|
}> | undefined>;
|
|
26
26
|
/**
|
|
27
27
|
* Props to instantiate the Nexus Wallet SDK configuration provider
|
|
28
28
|
*/
|
|
29
29
|
type NexusConfigProviderProps = {
|
|
30
|
-
config:
|
|
31
|
-
domain?: string;
|
|
32
|
-
};
|
|
30
|
+
config: NexusWalletSdkConfig;
|
|
33
31
|
};
|
|
34
32
|
/**
|
|
35
33
|
* Simple config provider for the Nexus Wallet SDK
|
|
@@ -37,13 +35,13 @@ type NexusConfigProviderProps = {
|
|
|
37
35
|
* @constructor
|
|
38
36
|
*/
|
|
39
37
|
declare function NexusConfigProvider(parameters: PropsWithChildren<NexusConfigProviderProps>): react.FunctionComponentElement<react.ProviderProps<Readonly<{
|
|
40
|
-
walletUrl
|
|
38
|
+
walletUrl?: string;
|
|
41
39
|
metadata: {
|
|
42
40
|
name: string;
|
|
43
41
|
css?: string;
|
|
44
42
|
buttonShare?: string;
|
|
45
43
|
};
|
|
46
|
-
domain
|
|
44
|
+
domain?: string;
|
|
47
45
|
}> | undefined>>;
|
|
48
46
|
|
|
49
47
|
/**
|
|
@@ -73,13 +71,13 @@ declare function NexusIFrameClientProvider({ style, children, }: {
|
|
|
73
71
|
* Use the current nexus config
|
|
74
72
|
*/
|
|
75
73
|
declare function useNexusConfig(): Readonly<{
|
|
76
|
-
walletUrl
|
|
74
|
+
walletUrl?: string;
|
|
77
75
|
metadata: {
|
|
78
76
|
name: string;
|
|
79
77
|
css?: string;
|
|
80
78
|
buttonShare?: string;
|
|
81
79
|
};
|
|
82
|
-
domain
|
|
80
|
+
domain?: string;
|
|
83
81
|
}>;
|
|
84
82
|
|
|
85
83
|
/**
|
|
@@ -157,4 +155,13 @@ interface UseSendInteractionParams {
|
|
|
157
155
|
*/
|
|
158
156
|
declare function useOpenSso({ mutations }?: UseSendInteractionParams): _tanstack_react_query.UseMutationResult<void, FrakRpcError<undefined>, OpenSsoParamsType, unknown>;
|
|
159
157
|
|
|
160
|
-
|
|
158
|
+
type QueryOptions = Omit<UseQueryOptions<GetProductInformationReturnType, FrakRpcError, undefined>, "queryKey" | "queryFn">;
|
|
159
|
+
interface UseGetProductInformationParams {
|
|
160
|
+
query?: QueryOptions;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Open the SSO
|
|
164
|
+
*/
|
|
165
|
+
declare function useGetProductInformation({ query, }?: UseGetProductInformationParams): _tanstack_react_query.UseQueryResult<undefined, FrakRpcError<undefined>>;
|
|
166
|
+
|
|
167
|
+
export { NexusConfigContext, NexusConfigProvider, type NexusConfigProviderProps, NexusIFrameClientContext, type NexusIFrameClientProps, NexusIFrameClientProvider, useDisplayModal, useGetProductInformation, useNexusClient, useNexusConfig, useOpenSso, useReferralInteraction, useSendInteraction, useSendTransactionAction, useSiweAuthenticate, useWalletStatus };
|