@frak-labs/nexus-sdk 0.0.14 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/NexusContext-CSlCNW-G.d.cts +10 -0
- package/dist/NexusContext-CSlCNW-G.d.ts +10 -0
- package/dist/bundle/bundle.js +21 -0
- package/dist/chunk-2LAGZ6S5.js +246 -0
- package/dist/chunk-4ADWI2GG.cjs +243 -0
- package/dist/chunk-4LT3U3H4.cjs +246 -0
- package/dist/{chunk-5LZQXBFJ.js → chunk-ARQTOP44.js} +12 -196
- package/dist/chunk-C25NTD45.cjs +100 -0
- package/dist/chunk-DILTMQBI.cjs +51 -0
- package/dist/{chunk-IH3QWPWT.js → chunk-I47XQDS3.js} +44 -16
- package/dist/chunk-K4FOGADW.js +51 -0
- package/dist/chunk-KEATMEOW.cjs +207 -0
- package/dist/chunk-VMNURFPI.js +207 -0
- package/dist/{client-DJd7-ajw.d.ts → client-B3Guoe3I.d.ts} +7 -4
- package/dist/{client-DXITs1Kf.d.cts → client-Of9uIxuI.d.cts} +7 -4
- package/dist/core/actions/index.cjs +11 -3
- package/dist/core/actions/index.d.cts +28 -4
- package/dist/core/actions/index.d.ts +28 -4
- package/dist/core/actions/index.js +10 -2
- package/dist/core/index.cjs +9 -4
- package/dist/core/index.d.cts +66 -4
- package/dist/core/index.d.ts +66 -4
- package/dist/core/index.js +9 -4
- package/dist/core/interactions/index.cjs +3 -6
- package/dist/core/interactions/index.d.cts +19 -15
- package/dist/core/interactions/index.d.ts +19 -15
- package/dist/core/interactions/index.js +4 -7
- package/dist/{error-C4Zm5nQe.d.cts → error-Dflr3G5x.d.cts} +1 -1
- package/dist/{error-C4Zm5nQe.d.ts → error-Dflr3G5x.d.ts} +1 -1
- package/dist/react/index.cjs +74 -150
- package/dist/react/index.d.cts +4 -5
- package/dist/react/index.d.ts +4 -5
- package/dist/react/index.js +72 -148
- package/dist/{sendTransaction-fLvpfqaQ.d.ts → sendTransaction-3d8jO9CJ.d.ts} +1 -1
- package/dist/{sendTransaction-C19oCc6X.d.cts → sendTransaction-Cz6FoB9_.d.cts} +1 -1
- package/package.json +5 -5
- package/dist/chunk-22T2NHQK.js +0 -22
- package/dist/chunk-5SGDBU5S.cjs +0 -427
- package/dist/chunk-AANA3LEO.cjs +0 -22
- package/dist/chunk-ETV4XYOV.cjs +0 -7
- package/dist/chunk-PKBMQBKP.js +0 -7
- package/dist/chunk-PURWUKEM.cjs +0 -72
- package/dist/chunk-S223FMEJ.js +0 -86
- package/dist/chunk-UOEVM7TR.cjs +0 -86
- package/dist/index.cjs +0 -1
- package/dist/index.d.cts +0 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -0
package/dist/chunk-UOEVM7TR.cjs
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
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; }// src/core/actions/watchWalletStatus.ts
|
|
2
|
-
function watchWalletStatus(client, callback) {
|
|
3
|
-
return client.listenerRequest(
|
|
4
|
-
{
|
|
5
|
-
method: "frak_listenToWalletStatus"
|
|
6
|
-
},
|
|
7
|
-
callback
|
|
8
|
-
);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// src/core/utils/computeProductId.ts
|
|
12
|
-
var _viem = require('viem');
|
|
13
|
-
function computeProductId({ domain }) {
|
|
14
|
-
return _viem.keccak256.call(void 0, _viem.toHex.call(void 0, domain));
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// src/core/actions/sendInteraction.ts
|
|
18
|
-
async function sendInteraction(client, { productId, interaction, validation }) {
|
|
19
|
-
const pId = _nullishCoalesce(productId, () => ( computeProductId(client.config)));
|
|
20
|
-
return await client.request({
|
|
21
|
-
method: "frak_sendInteraction",
|
|
22
|
-
params: [pId, interaction, validation]
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// src/core/actions/displayModal.ts
|
|
27
|
-
async function displayModal(client, { steps, metadata }) {
|
|
28
|
-
return await client.request({
|
|
29
|
-
method: "frak_displayModal",
|
|
30
|
-
params: [steps, client.config.metadata.name, metadata]
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// src/core/actions/openSso.ts
|
|
35
|
-
async function openSso(client, args) {
|
|
36
|
-
const { metadata } = client.config;
|
|
37
|
-
await client.request({
|
|
38
|
-
method: "frak_sso",
|
|
39
|
-
params: [args, metadata.name, metadata.css]
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// src/core/actions/wrapper/siweAuthenticate.ts
|
|
44
|
-
var _siwe = require('viem/siwe');
|
|
45
|
-
async function siweAuthenticate(client, { siwe, metadata }) {
|
|
46
|
-
const realStatement = _nullishCoalesce(_optionalChain([siwe, 'optionalAccess', _ => _.statement]), () => ( `I confirm that I want to use my Nexus wallet on: ${client.config.metadata.name}`));
|
|
47
|
-
const builtSiwe = {
|
|
48
|
-
...siwe,
|
|
49
|
-
statement: realStatement,
|
|
50
|
-
nonce: _nullishCoalesce(_optionalChain([siwe, 'optionalAccess', _2 => _2.nonce]), () => ( _siwe.generateSiweNonce.call(void 0, ))),
|
|
51
|
-
uri: _nullishCoalesce(_optionalChain([siwe, 'optionalAccess', _3 => _3.uri]), () => ( `https://${client.config.domain}`)),
|
|
52
|
-
version: _nullishCoalesce(_optionalChain([siwe, 'optionalAccess', _4 => _4.version]), () => ( "1")),
|
|
53
|
-
domain: client.config.domain
|
|
54
|
-
};
|
|
55
|
-
const result = await displayModal(client, {
|
|
56
|
-
metadata,
|
|
57
|
-
steps: {
|
|
58
|
-
login: {},
|
|
59
|
-
siweAuthenticate: {
|
|
60
|
-
siwe: builtSiwe
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
return result.siweAuthenticate;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// src/core/actions/wrapper/sendTransaction.ts
|
|
68
|
-
async function sendTransaction(client, { tx, metadata }) {
|
|
69
|
-
const result = await displayModal(client, {
|
|
70
|
-
metadata,
|
|
71
|
-
steps: {
|
|
72
|
-
login: {},
|
|
73
|
-
sendTransaction: { tx }
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
return result.sendTransaction;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
exports.watchWalletStatus = watchWalletStatus; exports.sendInteraction = sendInteraction; exports.displayModal = displayModal; exports.openSso = openSso; exports.siweAuthenticate = siweAuthenticate; exports.sendTransaction = sendTransaction;
|
package/dist/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
package/dist/index.d.cts
DELETED
package/dist/index.d.ts
DELETED
package/dist/index.js
DELETED
|
File without changes
|