@frak-labs/nexus-sdk 0.0.9 → 0.0.11
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/chunk-5CFD5FM2.js +86 -0
- package/dist/chunk-7MVQQ2X6.js +381 -0
- package/dist/chunk-ETV4XYOV.cjs +7 -0
- package/dist/chunk-GUDT2W6I.js +70 -0
- package/dist/chunk-IQQTTKJL.cjs +70 -0
- package/dist/chunk-PKBMQBKP.js +7 -0
- package/dist/chunk-S5FVCA2E.cjs +86 -0
- package/dist/chunk-V3S6RBRJ.cjs +381 -0
- package/dist/client-C7u9zGwC.d.cts +332 -0
- package/dist/client-gE3fYzkD.d.ts +332 -0
- package/dist/core/actions/index.cjs +3 -3
- package/dist/core/actions/index.d.cts +21 -28
- package/dist/core/actions/index.d.ts +21 -28
- package/dist/core/actions/index.js +12 -12
- package/dist/core/index.cjs +3 -8
- package/dist/core/index.d.cts +8 -35
- package/dist/core/index.d.ts +8 -35
- package/dist/core/index.js +9 -14
- package/dist/core/interactions/index.cjs +13 -0
- package/dist/core/interactions/index.d.cts +53 -0
- package/dist/core/interactions/index.d.ts +53 -0
- package/dist/core/interactions/index.js +13 -0
- package/dist/error-C4Zm5nQe.d.cts +27 -0
- package/dist/error-C4Zm5nQe.d.ts +27 -0
- package/dist/interaction-D3-M3nBh.d.cts +22 -0
- package/dist/interaction-D3-M3nBh.d.ts +22 -0
- package/dist/react/index.cjs +279 -166
- package/dist/react/index.d.cts +80 -37
- package/dist/react/index.d.ts +80 -37
- package/dist/react/index.js +291 -178
- package/dist/sendTransaction-BZW627cT.d.cts +30 -0
- package/dist/sendTransaction-DpJTfGJc.d.ts +30 -0
- package/package.json +16 -7
- package/dist/chunk-AYZHGMEV.cjs +0 -171
- package/dist/chunk-PDR3CF3P.js +0 -86
- package/dist/chunk-SZUN32YC.js +0 -171
- package/dist/chunk-VK7GPKK4.js +0 -169
- package/dist/chunk-X4JNNWJ4.cjs +0 -86
- package/dist/chunk-ZOLP2FJZ.cjs +0 -169
- package/dist/client-BwzXSgqQ.d.cts +0 -278
- package/dist/client-BwzXSgqQ.d.ts +0 -278
- package/dist/watchUnlockStatus-DXClCYH9.d.cts +0 -43
- package/dist/watchUnlockStatus-WJxoDliF.d.ts +0 -43
package/dist/core/index.js
CHANGED
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
FrakRpcError,
|
|
3
|
+
RpcErrorCodes,
|
|
4
|
+
createIFrameNexusClient,
|
|
5
5
|
createIframe,
|
|
6
6
|
decompressDataAndCheckHash,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
iFrameRequestKeyProvider,
|
|
11
|
-
redirectRequestKeyProvider
|
|
12
|
-
} from "../chunk-VK7GPKK4.js";
|
|
7
|
+
hashAndCompressData
|
|
8
|
+
} from "../chunk-7MVQQ2X6.js";
|
|
9
|
+
import "../chunk-PKBMQBKP.js";
|
|
13
10
|
export {
|
|
11
|
+
FrakRpcError,
|
|
12
|
+
RpcErrorCodes,
|
|
14
13
|
createIFrameNexusClient,
|
|
15
14
|
createIframe,
|
|
16
15
|
decompressDataAndCheckHash,
|
|
17
|
-
|
|
18
|
-
getRedirectResponseResponseKeyProvider,
|
|
19
|
-
hashAndCompressData,
|
|
20
|
-
iFrameRequestKeyProvider,
|
|
21
|
-
redirectRequestKeyProvider
|
|
16
|
+
hashAndCompressData
|
|
22
17
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkIQQTTKJLcjs = require('../../chunk-IQQTTKJL.cjs');
|
|
7
|
+
require('../../chunk-ETV4XYOV.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
exports.PressActionsSelector = _chunkIQQTTKJLcjs.PressActionsSelector; exports.PressInteractionEncoder = _chunkIQQTTKJLcjs.PressInteractionEncoder; exports.ReferralActionsSelector = _chunkIQQTTKJLcjs.ReferralActionsSelector; exports.ReferralInteractionEncoder = _chunkIQQTTKJLcjs.ReferralInteractionEncoder;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Hex, Address } from 'viem';
|
|
2
|
+
import { P as PreparedInteraction } from '../../interaction-D3-M3nBh.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* All the press interactions actions
|
|
6
|
+
*/
|
|
7
|
+
declare const PressActionsSelector: {
|
|
8
|
+
readonly OpenArticle: "0xc0a24ffb";
|
|
9
|
+
readonly ReadArticle: "0xd5bd0fbe";
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Encode an open article interaction
|
|
13
|
+
* @param articleId
|
|
14
|
+
*/
|
|
15
|
+
declare function openArticle({ articleId }: {
|
|
16
|
+
articleId: Hex;
|
|
17
|
+
}): PreparedInteraction;
|
|
18
|
+
/**
|
|
19
|
+
* Encode a read article interaction
|
|
20
|
+
* @param articleId
|
|
21
|
+
*/
|
|
22
|
+
declare function readArticle({ articleId }: {
|
|
23
|
+
articleId: Hex;
|
|
24
|
+
}): PreparedInteraction;
|
|
25
|
+
declare const PressInteractionEncoder: {
|
|
26
|
+
openArticle: typeof openArticle;
|
|
27
|
+
readArticle: typeof readArticle;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* All the referral interactions actions
|
|
32
|
+
*/
|
|
33
|
+
declare const ReferralActionsSelector: {
|
|
34
|
+
readonly CreateLink: "0xb2c0f17c";
|
|
35
|
+
readonly Referred: "0x010cc3b9";
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Encode a create referral link interaction
|
|
39
|
+
*/
|
|
40
|
+
declare function createLink(): PreparedInteraction;
|
|
41
|
+
/**
|
|
42
|
+
* Encode a referred interaction
|
|
43
|
+
* @param referrer
|
|
44
|
+
*/
|
|
45
|
+
declare function referred({ referrer }: {
|
|
46
|
+
referrer: Address;
|
|
47
|
+
}): PreparedInteraction;
|
|
48
|
+
declare const ReferralInteractionEncoder: {
|
|
49
|
+
createLink: typeof createLink;
|
|
50
|
+
referred: typeof referred;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export { PressActionsSelector, PressInteractionEncoder, ReferralActionsSelector, ReferralInteractionEncoder };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Hex, Address } from 'viem';
|
|
2
|
+
import { P as PreparedInteraction } from '../../interaction-D3-M3nBh.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* All the press interactions actions
|
|
6
|
+
*/
|
|
7
|
+
declare const PressActionsSelector: {
|
|
8
|
+
readonly OpenArticle: "0xc0a24ffb";
|
|
9
|
+
readonly ReadArticle: "0xd5bd0fbe";
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Encode an open article interaction
|
|
13
|
+
* @param articleId
|
|
14
|
+
*/
|
|
15
|
+
declare function openArticle({ articleId }: {
|
|
16
|
+
articleId: Hex;
|
|
17
|
+
}): PreparedInteraction;
|
|
18
|
+
/**
|
|
19
|
+
* Encode a read article interaction
|
|
20
|
+
* @param articleId
|
|
21
|
+
*/
|
|
22
|
+
declare function readArticle({ articleId }: {
|
|
23
|
+
articleId: Hex;
|
|
24
|
+
}): PreparedInteraction;
|
|
25
|
+
declare const PressInteractionEncoder: {
|
|
26
|
+
openArticle: typeof openArticle;
|
|
27
|
+
readArticle: typeof readArticle;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* All the referral interactions actions
|
|
32
|
+
*/
|
|
33
|
+
declare const ReferralActionsSelector: {
|
|
34
|
+
readonly CreateLink: "0xb2c0f17c";
|
|
35
|
+
readonly Referred: "0x010cc3b9";
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Encode a create referral link interaction
|
|
39
|
+
*/
|
|
40
|
+
declare function createLink(): PreparedInteraction;
|
|
41
|
+
/**
|
|
42
|
+
* Encode a referred interaction
|
|
43
|
+
* @param referrer
|
|
44
|
+
*/
|
|
45
|
+
declare function referred({ referrer }: {
|
|
46
|
+
referrer: Address;
|
|
47
|
+
}): PreparedInteraction;
|
|
48
|
+
declare const ReferralInteractionEncoder: {
|
|
49
|
+
createLink: typeof createLink;
|
|
50
|
+
referred: typeof referred;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export { PressActionsSelector, PressInteractionEncoder, ReferralActionsSelector, ReferralInteractionEncoder };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PressActionsSelector,
|
|
3
|
+
PressInteractionEncoder,
|
|
4
|
+
ReferralActionsSelector,
|
|
5
|
+
ReferralInteractionEncoder
|
|
6
|
+
} from "../../chunk-GUDT2W6I.js";
|
|
7
|
+
import "../../chunk-PKBMQBKP.js";
|
|
8
|
+
export {
|
|
9
|
+
PressActionsSelector,
|
|
10
|
+
PressInteractionEncoder,
|
|
11
|
+
ReferralActionsSelector,
|
|
12
|
+
ReferralInteractionEncoder
|
|
13
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic Frak RPC error
|
|
3
|
+
*/
|
|
4
|
+
declare class FrakRpcError<T = undefined> extends Error {
|
|
5
|
+
code: number;
|
|
6
|
+
data?: T | undefined;
|
|
7
|
+
constructor(code: number, message: string, data?: T | undefined);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* All the rpc error codes
|
|
11
|
+
*/
|
|
12
|
+
declare const RpcErrorCodes: {
|
|
13
|
+
readonly parseError: -32700;
|
|
14
|
+
readonly invalidRequest: -32600;
|
|
15
|
+
readonly methodNotFound: -32601;
|
|
16
|
+
readonly invalidParams: -32602;
|
|
17
|
+
readonly internalError: -32603;
|
|
18
|
+
readonly serverError: -32000;
|
|
19
|
+
readonly clientNotConnected: -32001;
|
|
20
|
+
readonly configError: -32002;
|
|
21
|
+
readonly corruptedResponse: -32003;
|
|
22
|
+
readonly clientAborted: -32004;
|
|
23
|
+
readonly walletNotConnected: -32005;
|
|
24
|
+
readonly noInteractionSession: -32006;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export { FrakRpcError as F, RpcErrorCodes as R };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic Frak RPC error
|
|
3
|
+
*/
|
|
4
|
+
declare class FrakRpcError<T = undefined> extends Error {
|
|
5
|
+
code: number;
|
|
6
|
+
data?: T | undefined;
|
|
7
|
+
constructor(code: number, message: string, data?: T | undefined);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* All the rpc error codes
|
|
11
|
+
*/
|
|
12
|
+
declare const RpcErrorCodes: {
|
|
13
|
+
readonly parseError: -32700;
|
|
14
|
+
readonly invalidRequest: -32600;
|
|
15
|
+
readonly methodNotFound: -32601;
|
|
16
|
+
readonly invalidParams: -32602;
|
|
17
|
+
readonly internalError: -32603;
|
|
18
|
+
readonly serverError: -32000;
|
|
19
|
+
readonly clientNotConnected: -32001;
|
|
20
|
+
readonly configError: -32002;
|
|
21
|
+
readonly corruptedResponse: -32003;
|
|
22
|
+
readonly clientAborted: -32004;
|
|
23
|
+
readonly walletNotConnected: -32005;
|
|
24
|
+
readonly noInteractionSession: -32006;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export { FrakRpcError as F, RpcErrorCodes as R };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Hex } from 'viem';
|
|
2
|
+
|
|
3
|
+
type PreparedInteraction = Readonly<{
|
|
4
|
+
handlerTypeDenominator: Hex;
|
|
5
|
+
interactionData: Hex;
|
|
6
|
+
}>;
|
|
7
|
+
/**
|
|
8
|
+
* Parameters of an interaction handling request
|
|
9
|
+
*/
|
|
10
|
+
type SendInteractionParamsType = {
|
|
11
|
+
contentId?: Hex;
|
|
12
|
+
interaction: PreparedInteraction;
|
|
13
|
+
validation?: Hex;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Return type of the send interaction rpc request
|
|
17
|
+
*/
|
|
18
|
+
type SendInteractionReturnType = Readonly<{
|
|
19
|
+
delegationId: string;
|
|
20
|
+
}>;
|
|
21
|
+
|
|
22
|
+
export type { PreparedInteraction as P, SendInteractionParamsType as S, SendInteractionReturnType as a };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Hex } from 'viem';
|
|
2
|
+
|
|
3
|
+
type PreparedInteraction = Readonly<{
|
|
4
|
+
handlerTypeDenominator: Hex;
|
|
5
|
+
interactionData: Hex;
|
|
6
|
+
}>;
|
|
7
|
+
/**
|
|
8
|
+
* Parameters of an interaction handling request
|
|
9
|
+
*/
|
|
10
|
+
type SendInteractionParamsType = {
|
|
11
|
+
contentId?: Hex;
|
|
12
|
+
interaction: PreparedInteraction;
|
|
13
|
+
validation?: Hex;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Return type of the send interaction rpc request
|
|
17
|
+
*/
|
|
18
|
+
type SendInteractionReturnType = Readonly<{
|
|
19
|
+
delegationId: string;
|
|
20
|
+
}>;
|
|
21
|
+
|
|
22
|
+
export type { PreparedInteraction as P, SendInteractionParamsType as S, SendInteractionReturnType as a };
|