@frak-labs/nexus-sdk 0.0.8 → 0.0.10

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.
Files changed (39) hide show
  1. package/dist/chunk-3T2FNW6E.cjs +100 -0
  2. package/dist/chunk-72IEHEQX.js +48 -0
  3. package/dist/chunk-BPFJZRJ6.cjs +152 -0
  4. package/dist/chunk-ETV4XYOV.cjs +7 -0
  5. package/dist/{chunk-OXP3VK26.js → chunk-HOX3RRO6.js} +58 -30
  6. package/dist/chunk-NIFJZD3M.cjs +48 -0
  7. package/dist/chunk-PKBMQBKP.js +7 -0
  8. package/dist/{chunk-JXQKTLEE.cjs → chunk-SGLR6RFA.cjs} +59 -31
  9. package/dist/chunk-T54VMWHQ.js +100 -0
  10. package/dist/chunk-TPC5PMRC.js +152 -0
  11. package/dist/{client-MgLVRfPw.d.cts → client--U_6SK0l.d.cts} +101 -12
  12. package/dist/{client-MgLVRfPw.d.ts → client-6_BJp7Ub.d.ts} +101 -12
  13. package/dist/core/actions/index.cjs +10 -3
  14. package/dist/core/actions/index.d.cts +31 -3
  15. package/dist/core/actions/index.d.ts +31 -3
  16. package/dist/core/actions/index.js +9 -2
  17. package/dist/core/index.cjs +4 -7
  18. package/dist/core/index.d.cts +8 -35
  19. package/dist/core/index.d.ts +8 -35
  20. package/dist/core/index.js +9 -12
  21. package/dist/core/interactions/index.cjs +9 -0
  22. package/dist/core/interactions/index.d.cts +39 -0
  23. package/dist/core/interactions/index.d.ts +39 -0
  24. package/dist/core/interactions/index.js +9 -0
  25. package/dist/error-C4Zm5nQe.d.cts +27 -0
  26. package/dist/error-C4Zm5nQe.d.ts +27 -0
  27. package/dist/interaction-D_CzyqRE.d.cts +22 -0
  28. package/dist/interaction-D_CzyqRE.d.ts +22 -0
  29. package/dist/react/index.cjs +276 -42
  30. package/dist/react/index.d.cts +72 -12
  31. package/dist/react/index.d.ts +72 -12
  32. package/dist/react/index.js +272 -38
  33. package/dist/{watchUnlockStatus-DQYfUj46.d.ts → watchUnlockStatus-CxnibdQx.d.cts} +3 -3
  34. package/dist/{watchUnlockStatus-DqWkImYK.d.cts → watchUnlockStatus-g8wIxpeM.d.ts} +3 -3
  35. package/package.json +11 -5
  36. package/dist/chunk-2XUJYDD3.cjs +0 -160
  37. package/dist/chunk-4VFMYMTH.js +0 -74
  38. package/dist/chunk-5QWG35A2.js +0 -160
  39. package/dist/chunk-6V4UCVTD.cjs +0 -74
@@ -1,7 +1,9 @@
1
- export { G as GetUnlockOptionsParams, W as WatchUnlockStatusParams, g as getArticleUnlockOptions, w as watchUnlockStatus } from '../../watchUnlockStatus-DQYfUj46.js';
2
- import { N as NexusClient, W as WalletStatusReturnType, a as NexusWalletSdkConfig, S as StartArticleUnlockReturnType, b as StartArticleUnlockParams } from '../../client-MgLVRfPw.js';
1
+ export { G as GetUnlockOptionsParams, W as WatchUnlockStatusParams, g as getArticleUnlockOptions, w as watchUnlockStatus } from '../../watchUnlockStatus-g8wIxpeM.js';
2
+ import { N as NexusClient, W as WalletStatusReturnType, a as NexusWalletSdkConfig, b as StartArticleUnlockReturnType, S as StartArticleUnlockParams, c as SendTransactionActionParamsType, d as SendTransactionReturnType, g as SiweAuthenticateActionParamsType, f as SiweAuthenticateReturnType } from '../../client-6_BJp7Ub.js';
3
+ import { S as SendInteractionParamsType, a as SendInteractionReturnType } from '../../interaction-D_CzyqRE.js';
3
4
  import 'viem';
4
5
  import 'viem/chains';
6
+ import 'viem/siwe';
5
7
 
6
8
  /**
7
9
  * Function used to watch the current nexus wallet status
@@ -27,4 +29,30 @@ declare function decodeStartUnlockReturn({ result, hash, }: {
27
29
  validationHash: string;
28
30
  }>>;
29
31
 
30
- export { decodeStartUnlockReturn, getStartArticleUnlockUrl, watchWalletStatus };
32
+ /**
33
+ * Function used to send a user transaction
34
+ * @param client
35
+ * @param tx
36
+ * @param context
37
+ * @param callback
38
+ */
39
+ declare function sendTransaction(client: NexusClient, { tx, context }: SendTransactionActionParamsType): Promise<SendTransactionReturnType>;
40
+
41
+ /**
42
+ * Function used to launch a siwe authentication
43
+ * @param client
44
+ * @param siwe
45
+ * @param context
46
+ */
47
+ declare function siweAuthenticate(client: NexusClient, { siwe, context }: SiweAuthenticateActionParamsType): Promise<SiweAuthenticateReturnType>;
48
+
49
+ /**
50
+ * Function used to send an interaction
51
+ * @param client
52
+ * @param contentId
53
+ * @param request
54
+ * @param validation
55
+ */
56
+ declare function sendInteraction(client: NexusClient, { contentId, interaction, validation }: SendInteractionParamsType): Promise<SendInteractionReturnType>;
57
+
58
+ export { decodeStartUnlockReturn, getStartArticleUnlockUrl, sendInteraction, sendTransaction, siweAuthenticate, watchWalletStatus };
@@ -2,14 +2,21 @@ import {
2
2
  decodeStartUnlockReturn,
3
3
  getArticleUnlockOptions,
4
4
  getStartArticleUnlockUrl,
5
+ sendInteraction,
6
+ sendTransaction,
7
+ siweAuthenticate,
5
8
  watchUnlockStatus,
6
9
  watchWalletStatus
7
- } from "../../chunk-4VFMYMTH.js";
8
- import "../../chunk-5QWG35A2.js";
10
+ } from "../../chunk-T54VMWHQ.js";
11
+ import "../../chunk-TPC5PMRC.js";
12
+ import "../../chunk-PKBMQBKP.js";
9
13
  export {
10
14
  decodeStartUnlockReturn,
11
15
  getArticleUnlockOptions,
12
16
  getStartArticleUnlockUrl,
17
+ sendInteraction,
18
+ sendTransaction,
19
+ siweAuthenticate,
13
20
  watchUnlockStatus,
14
21
  watchWalletStatus
15
22
  };
@@ -1,22 +1,19 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkJXQKTLEEcjs = require('../chunk-JXQKTLEE.cjs');
3
+ var _chunkSGLR6RFAcjs = require('../chunk-SGLR6RFA.cjs');
4
4
 
5
5
 
6
6
 
7
7
 
8
8
 
9
9
 
10
+ var _chunkBPFJZRJ6cjs = require('../chunk-BPFJZRJ6.cjs');
11
+ require('../chunk-ETV4XYOV.cjs');
10
12
 
11
13
 
12
- var _chunk2XUJYDD3cjs = require('../chunk-2XUJYDD3.cjs');
13
14
 
14
15
 
15
16
 
16
17
 
17
18
 
18
-
19
-
20
-
21
-
22
- exports.createIFrameNexusClient = _chunkJXQKTLEEcjs.createIFrameNexusClient; exports.createIframe = _chunk2XUJYDD3cjs.createIframe; exports.decompressDataAndCheckHash = _chunk2XUJYDD3cjs.decompressDataAndCheckHash; exports.getIFrameResponseKeyProvider = _chunk2XUJYDD3cjs.getIFrameResponseKeyProvider; exports.getRedirectResponseResponseKeyProvider = _chunk2XUJYDD3cjs.getRedirectResponseResponseKeyProvider; exports.hashAndCompressData = _chunk2XUJYDD3cjs.hashAndCompressData; exports.iFrameRequestKeyProvider = _chunk2XUJYDD3cjs.iFrameRequestKeyProvider; exports.redirectRequestKeyProvider = _chunk2XUJYDD3cjs.redirectRequestKeyProvider;
19
+ exports.FrakRpcError = _chunkBPFJZRJ6cjs.FrakRpcError; exports.RpcErrorCodes = _chunkBPFJZRJ6cjs.RpcErrorCodes; exports.createIFrameNexusClient = _chunkSGLR6RFAcjs.createIFrameNexusClient; exports.createIframe = _chunkBPFJZRJ6cjs.createIframe; exports.decompressDataAndCheckHash = _chunkBPFJZRJ6cjs.decompressDataAndCheckHash; exports.hashAndCompressData = _chunkBPFJZRJ6cjs.hashAndCompressData;
@@ -1,7 +1,10 @@
1
- import { a as NexusWalletSdkConfig, N as NexusClient, E as ExtractedParametersFromRpc, I as IFrameRpcSchema, c as ExtractedReturnTypeFromRpc, R as RedirectRpcSchema } from '../client-MgLVRfPw.cjs';
2
- export { A as ArticleUnlockStatusReturnType, f as IFrameEvent, e as IFrameRpcEvent, d as IFrameTransport, P as PaidArticleUnlockPrice, b as StartArticleUnlockParams, S as StartArticleUnlockReturnType, U as UnlockOptionsReturnType, W as WalletStatusReturnType } from '../client-MgLVRfPw.cjs';
1
+ import { a as NexusWalletSdkConfig, N as NexusClient } from '../client--U_6SK0l.cjs';
2
+ export { A as ArticleUnlockStatusReturnType, E as ExtractedParametersFromRpc, m as ExtractedReturnTypeFromRpc, l as IFrameEvent, k as IFrameRpcEvent, I as IFrameRpcSchema, j as IFrameTransport, P as PaidArticleUnlockPrice, R as RedirectRpcSchema, i as RpcResponse, c as SendTransactionActionParamsType, d as SendTransactionReturnType, e as SendTransactionTxType, g as SiweAuthenticateActionParamsType, f as SiweAuthenticateReturnType, h as SiweAuthenticationParams, S as StartArticleUnlockParams, b as StartArticleUnlockReturnType, U as UnlockOptionsReturnType, W as WalletStatusReturnType } from '../client--U_6SK0l.cjs';
3
+ export { P as PreparedInteraction, S as SendInteractionParamsType, a as SendInteractionReturnType } from '../interaction-D_CzyqRE.cjs';
4
+ export { F as FrakRpcError, R as RpcErrorCodes } from '../error-C4Zm5nQe.cjs';
3
5
  import 'viem';
4
6
  import 'viem/chains';
7
+ import 'viem/siwe';
5
8
 
6
9
  /**
7
10
  * Create a new iframe Nexus client
@@ -41,43 +44,13 @@ type KeyProvider<DataType> = (value: DataType) => string[];
41
44
  /**
42
45
  * Compress the given params, and add hash protection to (rapidly) prevent interception modification
43
46
  * @param data The params to encode
44
- * @param keyProvider The method used to access the keys
45
47
  */
46
- declare function hashAndCompressData<T>(data: T, keyProvider: KeyProvider<T>): Promise<CompressedData>;
48
+ declare function hashAndCompressData<T>(data: T): Promise<CompressedData>;
47
49
 
48
50
  /**
49
51
  * Decompress the given string
50
52
  * @param compressedData The params to encode
51
- * @param keyAccessor The key accessor used to query the keys used for the validation hash
52
53
  */
53
- declare function decompressDataAndCheckHash<T>(compressedData: CompressedData, keyAccessor: KeyProvider<T>): Promise<HashProtectedData<T>>;
54
+ declare function decompressDataAndCheckHash<T>(compressedData: CompressedData): Promise<HashProtectedData<T>>;
54
55
 
55
- /**
56
- * Get the right request key provider for the given args
57
- * @param args
58
- */
59
- declare const iFrameRequestKeyProvider: KeyProvider<ExtractedParametersFromRpc<IFrameRpcSchema>>;
60
- type RpcResponseKeyProvider<TParameters extends Pick<ExtractedParametersFromRpc<IFrameRpcSchema>, "method">> = KeyProvider<ExtractedReturnTypeFromRpc<IFrameRpcSchema, Extract<ExtractedParametersFromRpc<IFrameRpcSchema>, {
61
- method: TParameters["method"];
62
- }>>>;
63
- /**
64
- * Get the right response key provider for the given param
65
- * @param param
66
- */
67
- declare function getIFrameResponseKeyProvider<TParameters extends Pick<ExtractedParametersFromRpc<IFrameRpcSchema>, "method">>(param: TParameters): RpcResponseKeyProvider<TParameters>;
68
-
69
- /**
70
- * Get the right request key provider for the given args
71
- * @param args
72
- */
73
- declare const redirectRequestKeyProvider: KeyProvider<ExtractedParametersFromRpc<RedirectRpcSchema>>;
74
- type RedirectRpcResponseKeyProvider<TMethod extends ExtractedParametersFromRpc<RedirectRpcSchema>["method"]> = KeyProvider<Extract<RedirectRpcSchema[number], {
75
- Method: TMethod;
76
- }>["ReturnType"]>;
77
- /**
78
- * Get the right response key provider for the given redirect method
79
- * @param method
80
- */
81
- declare function getRedirectResponseResponseKeyProvider<TMethod extends ExtractedParametersFromRpc<RedirectRpcSchema>["method"]>(method: TMethod): RedirectRpcResponseKeyProvider<TMethod>;
82
-
83
- export { type CompressedData, ExtractedParametersFromRpc, ExtractedReturnTypeFromRpc, type HashProtectedData, IFrameRpcSchema, type KeyProvider, NexusClient, NexusWalletSdkConfig, RedirectRpcSchema, createIFrameNexusClient, createIframe, decompressDataAndCheckHash, getIFrameResponseKeyProvider, getRedirectResponseResponseKeyProvider, hashAndCompressData, iFrameRequestKeyProvider, redirectRequestKeyProvider };
56
+ export { type CompressedData, type HashProtectedData, type KeyProvider, NexusClient, NexusWalletSdkConfig, createIFrameNexusClient, createIframe, decompressDataAndCheckHash, hashAndCompressData };
@@ -1,7 +1,10 @@
1
- import { a as NexusWalletSdkConfig, N as NexusClient, E as ExtractedParametersFromRpc, I as IFrameRpcSchema, c as ExtractedReturnTypeFromRpc, R as RedirectRpcSchema } from '../client-MgLVRfPw.js';
2
- export { A as ArticleUnlockStatusReturnType, f as IFrameEvent, e as IFrameRpcEvent, d as IFrameTransport, P as PaidArticleUnlockPrice, b as StartArticleUnlockParams, S as StartArticleUnlockReturnType, U as UnlockOptionsReturnType, W as WalletStatusReturnType } from '../client-MgLVRfPw.js';
1
+ import { a as NexusWalletSdkConfig, N as NexusClient } from '../client-6_BJp7Ub.js';
2
+ export { A as ArticleUnlockStatusReturnType, E as ExtractedParametersFromRpc, m as ExtractedReturnTypeFromRpc, l as IFrameEvent, k as IFrameRpcEvent, I as IFrameRpcSchema, j as IFrameTransport, P as PaidArticleUnlockPrice, R as RedirectRpcSchema, i as RpcResponse, c as SendTransactionActionParamsType, d as SendTransactionReturnType, e as SendTransactionTxType, g as SiweAuthenticateActionParamsType, f as SiweAuthenticateReturnType, h as SiweAuthenticationParams, S as StartArticleUnlockParams, b as StartArticleUnlockReturnType, U as UnlockOptionsReturnType, W as WalletStatusReturnType } from '../client-6_BJp7Ub.js';
3
+ export { P as PreparedInteraction, S as SendInteractionParamsType, a as SendInteractionReturnType } from '../interaction-D_CzyqRE.js';
4
+ export { F as FrakRpcError, R as RpcErrorCodes } from '../error-C4Zm5nQe.js';
3
5
  import 'viem';
4
6
  import 'viem/chains';
7
+ import 'viem/siwe';
5
8
 
6
9
  /**
7
10
  * Create a new iframe Nexus client
@@ -41,43 +44,13 @@ type KeyProvider<DataType> = (value: DataType) => string[];
41
44
  /**
42
45
  * Compress the given params, and add hash protection to (rapidly) prevent interception modification
43
46
  * @param data The params to encode
44
- * @param keyProvider The method used to access the keys
45
47
  */
46
- declare function hashAndCompressData<T>(data: T, keyProvider: KeyProvider<T>): Promise<CompressedData>;
48
+ declare function hashAndCompressData<T>(data: T): Promise<CompressedData>;
47
49
 
48
50
  /**
49
51
  * Decompress the given string
50
52
  * @param compressedData The params to encode
51
- * @param keyAccessor The key accessor used to query the keys used for the validation hash
52
53
  */
53
- declare function decompressDataAndCheckHash<T>(compressedData: CompressedData, keyAccessor: KeyProvider<T>): Promise<HashProtectedData<T>>;
54
+ declare function decompressDataAndCheckHash<T>(compressedData: CompressedData): Promise<HashProtectedData<T>>;
54
55
 
55
- /**
56
- * Get the right request key provider for the given args
57
- * @param args
58
- */
59
- declare const iFrameRequestKeyProvider: KeyProvider<ExtractedParametersFromRpc<IFrameRpcSchema>>;
60
- type RpcResponseKeyProvider<TParameters extends Pick<ExtractedParametersFromRpc<IFrameRpcSchema>, "method">> = KeyProvider<ExtractedReturnTypeFromRpc<IFrameRpcSchema, Extract<ExtractedParametersFromRpc<IFrameRpcSchema>, {
61
- method: TParameters["method"];
62
- }>>>;
63
- /**
64
- * Get the right response key provider for the given param
65
- * @param param
66
- */
67
- declare function getIFrameResponseKeyProvider<TParameters extends Pick<ExtractedParametersFromRpc<IFrameRpcSchema>, "method">>(param: TParameters): RpcResponseKeyProvider<TParameters>;
68
-
69
- /**
70
- * Get the right request key provider for the given args
71
- * @param args
72
- */
73
- declare const redirectRequestKeyProvider: KeyProvider<ExtractedParametersFromRpc<RedirectRpcSchema>>;
74
- type RedirectRpcResponseKeyProvider<TMethod extends ExtractedParametersFromRpc<RedirectRpcSchema>["method"]> = KeyProvider<Extract<RedirectRpcSchema[number], {
75
- Method: TMethod;
76
- }>["ReturnType"]>;
77
- /**
78
- * Get the right response key provider for the given redirect method
79
- * @param method
80
- */
81
- declare function getRedirectResponseResponseKeyProvider<TMethod extends ExtractedParametersFromRpc<RedirectRpcSchema>["method"]>(method: TMethod): RedirectRpcResponseKeyProvider<TMethod>;
82
-
83
- export { type CompressedData, ExtractedParametersFromRpc, ExtractedReturnTypeFromRpc, type HashProtectedData, IFrameRpcSchema, type KeyProvider, NexusClient, NexusWalletSdkConfig, RedirectRpcSchema, createIFrameNexusClient, createIframe, decompressDataAndCheckHash, getIFrameResponseKeyProvider, getRedirectResponseResponseKeyProvider, hashAndCompressData, iFrameRequestKeyProvider, redirectRequestKeyProvider };
56
+ export { type CompressedData, type HashProtectedData, type KeyProvider, NexusClient, NexusWalletSdkConfig, createIFrameNexusClient, createIframe, decompressDataAndCheckHash, hashAndCompressData };
@@ -1,22 +1,19 @@
1
1
  import {
2
2
  createIFrameNexusClient
3
- } from "../chunk-OXP3VK26.js";
3
+ } from "../chunk-HOX3RRO6.js";
4
4
  import {
5
+ FrakRpcError,
6
+ RpcErrorCodes,
5
7
  createIframe,
6
8
  decompressDataAndCheckHash,
7
- getIFrameResponseKeyProvider,
8
- getRedirectResponseResponseKeyProvider,
9
- hashAndCompressData,
10
- iFrameRequestKeyProvider,
11
- redirectRequestKeyProvider
12
- } from "../chunk-5QWG35A2.js";
9
+ hashAndCompressData
10
+ } from "../chunk-TPC5PMRC.js";
11
+ import "../chunk-PKBMQBKP.js";
13
12
  export {
13
+ FrakRpcError,
14
+ RpcErrorCodes,
14
15
  createIFrameNexusClient,
15
16
  createIframe,
16
17
  decompressDataAndCheckHash,
17
- getIFrameResponseKeyProvider,
18
- getRedirectResponseResponseKeyProvider,
19
- hashAndCompressData,
20
- iFrameRequestKeyProvider,
21
- redirectRequestKeyProvider
18
+ hashAndCompressData
22
19
  };
@@ -0,0 +1,9 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunkNIFJZD3Mcjs = require('../../chunk-NIFJZD3M.cjs');
5
+ require('../../chunk-ETV4XYOV.cjs');
6
+
7
+
8
+
9
+ exports.PressActionsSelector = _chunkNIFJZD3Mcjs.PressActionsSelector; exports.PressInteractionEncoder = _chunkNIFJZD3Mcjs.PressInteractionEncoder;
@@ -0,0 +1,39 @@
1
+ import { Hex, Address } from 'viem';
2
+ import { P as PreparedInteraction } from '../../interaction-D_CzyqRE.cjs';
3
+
4
+ /**
5
+ * All the press interactions actions
6
+ */
7
+ declare const PressActionsSelector: {
8
+ readonly OpenArticle: "0xc0a24ffb";
9
+ readonly ReadArticle: "0xd5bd0fbe";
10
+ readonly Referred: "0x3d1508ad";
11
+ };
12
+ /**
13
+ * Encode an open article interaction
14
+ * @param articleId
15
+ */
16
+ declare function openArticle({ articleId }: {
17
+ articleId: Hex;
18
+ }): PreparedInteraction;
19
+ /**
20
+ * Encode a read article interaction
21
+ * @param articleId
22
+ */
23
+ declare function readArticle({ articleId }: {
24
+ articleId: Hex;
25
+ }): PreparedInteraction;
26
+ /**
27
+ * Encode a referred interaction
28
+ * @param referrer
29
+ */
30
+ declare function referred({ referrer }: {
31
+ referrer: Address;
32
+ }): PreparedInteraction;
33
+ declare const PressInteractionEncoder: {
34
+ openArticle: typeof openArticle;
35
+ readArticle: typeof readArticle;
36
+ referred: typeof referred;
37
+ };
38
+
39
+ export { PressActionsSelector, PressInteractionEncoder };
@@ -0,0 +1,39 @@
1
+ import { Hex, Address } from 'viem';
2
+ import { P as PreparedInteraction } from '../../interaction-D_CzyqRE.js';
3
+
4
+ /**
5
+ * All the press interactions actions
6
+ */
7
+ declare const PressActionsSelector: {
8
+ readonly OpenArticle: "0xc0a24ffb";
9
+ readonly ReadArticle: "0xd5bd0fbe";
10
+ readonly Referred: "0x3d1508ad";
11
+ };
12
+ /**
13
+ * Encode an open article interaction
14
+ * @param articleId
15
+ */
16
+ declare function openArticle({ articleId }: {
17
+ articleId: Hex;
18
+ }): PreparedInteraction;
19
+ /**
20
+ * Encode a read article interaction
21
+ * @param articleId
22
+ */
23
+ declare function readArticle({ articleId }: {
24
+ articleId: Hex;
25
+ }): PreparedInteraction;
26
+ /**
27
+ * Encode a referred interaction
28
+ * @param referrer
29
+ */
30
+ declare function referred({ referrer }: {
31
+ referrer: Address;
32
+ }): PreparedInteraction;
33
+ declare const PressInteractionEncoder: {
34
+ openArticle: typeof openArticle;
35
+ readArticle: typeof readArticle;
36
+ referred: typeof referred;
37
+ };
38
+
39
+ export { PressActionsSelector, PressInteractionEncoder };
@@ -0,0 +1,9 @@
1
+ import {
2
+ PressActionsSelector,
3
+ PressInteractionEncoder
4
+ } from "../../chunk-72IEHEQX.js";
5
+ import "../../chunk-PKBMQBKP.js";
6
+ export {
7
+ PressActionsSelector,
8
+ PressInteractionEncoder
9
+ };
@@ -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
+ hash: Hex;
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
+ hash: Hex;
20
+ }>;
21
+
22
+ export type { PreparedInteraction as P, SendInteractionParamsType as S, SendInteractionReturnType as a };