@frak-labs/nexus-sdk 0.0.9 → 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.
- package/dist/chunk-3T2FNW6E.cjs +100 -0
- package/dist/chunk-72IEHEQX.js +48 -0
- package/dist/chunk-BPFJZRJ6.cjs +152 -0
- package/dist/chunk-ETV4XYOV.cjs +7 -0
- package/dist/{chunk-SZUN32YC.js → chunk-HOX3RRO6.js} +58 -30
- package/dist/chunk-NIFJZD3M.cjs +48 -0
- package/dist/chunk-PKBMQBKP.js +7 -0
- package/dist/{chunk-AYZHGMEV.cjs → chunk-SGLR6RFA.cjs} +59 -31
- package/dist/chunk-T54VMWHQ.js +100 -0
- package/dist/chunk-TPC5PMRC.js +152 -0
- package/dist/{client-BwzXSgqQ.d.ts → client--U_6SK0l.d.cts} +91 -30
- package/dist/{client-BwzXSgqQ.d.cts → client-6_BJp7Ub.d.ts} +91 -30
- package/dist/core/actions/index.cjs +8 -3
- package/dist/core/actions/index.d.cts +25 -13
- package/dist/core/actions/index.d.ts +25 -13
- package/dist/core/actions/index.js +9 -4
- package/dist/core/index.cjs +4 -7
- package/dist/core/index.d.cts +8 -35
- package/dist/core/index.d.ts +8 -35
- package/dist/core/index.js +9 -12
- package/dist/core/interactions/index.cjs +9 -0
- package/dist/core/interactions/index.d.cts +39 -0
- package/dist/core/interactions/index.d.ts +39 -0
- package/dist/core/interactions/index.js +9 -0
- package/dist/error-C4Zm5nQe.d.cts +27 -0
- package/dist/error-C4Zm5nQe.d.ts +27 -0
- package/dist/interaction-D_CzyqRE.d.cts +22 -0
- package/dist/interaction-D_CzyqRE.d.ts +22 -0
- package/dist/react/index.cjs +234 -109
- package/dist/react/index.d.cts +69 -19
- package/dist/react/index.d.ts +69 -19
- package/dist/react/index.js +236 -111
- package/dist/{watchUnlockStatus-WJxoDliF.d.ts → watchUnlockStatus-CxnibdQx.d.cts} +3 -3
- package/dist/{watchUnlockStatus-DXClCYH9.d.cts → watchUnlockStatus-g8wIxpeM.d.ts} +3 -3
- package/package.json +11 -5
- package/dist/chunk-PDR3CF3P.js +0 -86
- package/dist/chunk-VK7GPKK4.js +0 -169
- package/dist/chunk-X4JNNWJ4.cjs +0 -86
- package/dist/chunk-ZOLP2FJZ.cjs +0 -169
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
export { G as GetUnlockOptionsParams, W as WatchUnlockStatusParams, g as getArticleUnlockOptions, w as watchUnlockStatus } from '../../watchUnlockStatus-
|
|
2
|
-
import { N as NexusClient, W as WalletStatusReturnType, a as NexusWalletSdkConfig,
|
|
3
|
-
import {
|
|
1
|
+
export { G as GetUnlockOptionsParams, W as WatchUnlockStatusParams, g as getArticleUnlockOptions, w as watchUnlockStatus } from '../../watchUnlockStatus-CxnibdQx.cjs';
|
|
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--U_6SK0l.cjs';
|
|
3
|
+
import { S as SendInteractionParamsType, a as SendInteractionReturnType } from '../../interaction-D_CzyqRE.cjs';
|
|
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
|
|
@@ -28,19 +30,29 @@ declare function decodeStartUnlockReturn({ result, hash, }: {
|
|
|
28
30
|
}>>;
|
|
29
31
|
|
|
30
32
|
/**
|
|
31
|
-
*
|
|
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
|
|
32
46
|
*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
walletAddress: Address;
|
|
36
|
-
};
|
|
47
|
+
declare function siweAuthenticate(client: NexusClient, { siwe, context }: SiweAuthenticateActionParamsType): Promise<SiweAuthenticateReturnType>;
|
|
48
|
+
|
|
37
49
|
/**
|
|
38
|
-
* Function used to
|
|
50
|
+
* Function used to send an interaction
|
|
39
51
|
* @param client
|
|
40
52
|
* @param contentId
|
|
41
|
-
* @param
|
|
42
|
-
* @param
|
|
53
|
+
* @param request
|
|
54
|
+
* @param validation
|
|
43
55
|
*/
|
|
44
|
-
declare function
|
|
56
|
+
declare function sendInteraction(client: NexusClient, { contentId, interaction, validation }: SendInteractionParamsType): Promise<SendInteractionReturnType>;
|
|
45
57
|
|
|
46
|
-
export { decodeStartUnlockReturn, getStartArticleUnlockUrl,
|
|
58
|
+
export { decodeStartUnlockReturn, getStartArticleUnlockUrl, sendInteraction, sendTransaction, siweAuthenticate, watchWalletStatus };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
export { G as GetUnlockOptionsParams, W as WatchUnlockStatusParams, g as getArticleUnlockOptions, w as watchUnlockStatus } from '../../watchUnlockStatus-
|
|
2
|
-
import { N as NexusClient, W as WalletStatusReturnType, a as NexusWalletSdkConfig,
|
|
3
|
-
import {
|
|
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';
|
|
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
|
|
@@ -28,19 +30,29 @@ declare function decodeStartUnlockReturn({ result, hash, }: {
|
|
|
28
30
|
}>>;
|
|
29
31
|
|
|
30
32
|
/**
|
|
31
|
-
*
|
|
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
|
|
32
46
|
*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
walletAddress: Address;
|
|
36
|
-
};
|
|
47
|
+
declare function siweAuthenticate(client: NexusClient, { siwe, context }: SiweAuthenticateActionParamsType): Promise<SiweAuthenticateReturnType>;
|
|
48
|
+
|
|
37
49
|
/**
|
|
38
|
-
* Function used to
|
|
50
|
+
* Function used to send an interaction
|
|
39
51
|
* @param client
|
|
40
52
|
* @param contentId
|
|
41
|
-
* @param
|
|
42
|
-
* @param
|
|
53
|
+
* @param request
|
|
54
|
+
* @param validation
|
|
43
55
|
*/
|
|
44
|
-
declare function
|
|
56
|
+
declare function sendInteraction(client: NexusClient, { contentId, interaction, validation }: SendInteractionParamsType): Promise<SendInteractionReturnType>;
|
|
45
57
|
|
|
46
|
-
export { decodeStartUnlockReturn, getStartArticleUnlockUrl,
|
|
58
|
+
export { decodeStartUnlockReturn, getStartArticleUnlockUrl, sendInteraction, sendTransaction, siweAuthenticate, watchWalletStatus };
|
|
@@ -2,16 +2,21 @@ import {
|
|
|
2
2
|
decodeStartUnlockReturn,
|
|
3
3
|
getArticleUnlockOptions,
|
|
4
4
|
getStartArticleUnlockUrl,
|
|
5
|
-
|
|
5
|
+
sendInteraction,
|
|
6
|
+
sendTransaction,
|
|
7
|
+
siweAuthenticate,
|
|
6
8
|
watchUnlockStatus,
|
|
7
9
|
watchWalletStatus
|
|
8
|
-
} from "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
10
|
+
} from "../../chunk-T54VMWHQ.js";
|
|
11
|
+
import "../../chunk-TPC5PMRC.js";
|
|
12
|
+
import "../../chunk-PKBMQBKP.js";
|
|
10
13
|
export {
|
|
11
14
|
decodeStartUnlockReturn,
|
|
12
15
|
getArticleUnlockOptions,
|
|
13
16
|
getStartArticleUnlockUrl,
|
|
14
|
-
|
|
17
|
+
sendInteraction,
|
|
18
|
+
sendTransaction,
|
|
19
|
+
siweAuthenticate,
|
|
15
20
|
watchUnlockStatus,
|
|
16
21
|
watchWalletStatus
|
|
17
22
|
};
|
package/dist/core/index.cjs
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
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 _chunkZOLP2FJZcjs = require('../chunk-ZOLP2FJZ.cjs');
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
exports.createIFrameNexusClient = _chunkAYZHGMEVcjs.createIFrameNexusClient; exports.createIframe = _chunkZOLP2FJZcjs.createIframe; exports.decompressDataAndCheckHash = _chunkZOLP2FJZcjs.decompressDataAndCheckHash; exports.getIFrameResponseKeyProvider = _chunkZOLP2FJZcjs.getIFrameResponseKeyProvider; exports.getRedirectResponseResponseKeyProvider = _chunkZOLP2FJZcjs.getRedirectResponseResponseKeyProvider; exports.hashAndCompressData = _chunkZOLP2FJZcjs.hashAndCompressData; exports.iFrameRequestKeyProvider = _chunkZOLP2FJZcjs.iFrameRequestKeyProvider; exports.redirectRequestKeyProvider = _chunkZOLP2FJZcjs.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;
|
package/dist/core/index.d.cts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { a as NexusWalletSdkConfig, N as NexusClient
|
|
2
|
-
export { A as ArticleUnlockStatusReturnType,
|
|
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
|
|
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
|
|
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 };
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { a as NexusWalletSdkConfig, N as NexusClient
|
|
2
|
-
export { A as ArticleUnlockStatusReturnType,
|
|
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
|
|
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
|
|
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 };
|
package/dist/core/index.js
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createIFrameNexusClient
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-HOX3RRO6.js";
|
|
4
4
|
import {
|
|
5
|
+
FrakRpcError,
|
|
6
|
+
RpcErrorCodes,
|
|
5
7
|
createIframe,
|
|
6
8
|
decompressDataAndCheckHash,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
iFrameRequestKeyProvider,
|
|
11
|
-
redirectRequestKeyProvider
|
|
12
|
-
} from "../chunk-VK7GPKK4.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
|
-
|
|
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,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 };
|