@appliedblockchain/silentdatarollup-core 1.0.1 → 1.0.2
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-LT2HDZHC.mjs → chunk-XU34XEI3.mjs} +16 -2
- package/dist/index.d.mts +27 -1
- package/dist/index.d.ts +27 -1
- package/dist/index.js +18 -1
- package/dist/index.mjs +7 -1
- package/dist/tests.js +7 -0
- package/dist/tests.mjs +1 -1
- package/package.json +1 -1
|
@@ -6,7 +6,8 @@ var SIGN_RPC_METHODS = [
|
|
|
6
6
|
"eth_getTransactionByHash",
|
|
7
7
|
"eth_getTransactionCount",
|
|
8
8
|
"eth_getProof",
|
|
9
|
-
"eth_getTransactionReceipt"
|
|
9
|
+
"eth_getTransactionReceipt",
|
|
10
|
+
"eth_estimateGas"
|
|
10
11
|
];
|
|
11
12
|
var eip721Domain = {
|
|
12
13
|
name: "Silent Data [Rollup]",
|
|
@@ -545,6 +546,16 @@ var SilentDataRollupContract = class extends Contract2 {
|
|
|
545
546
|
}
|
|
546
547
|
};
|
|
547
548
|
|
|
549
|
+
// src/privateEvents.ts
|
|
550
|
+
import { keccak256, toUtf8Bytes } from "ethers";
|
|
551
|
+
var PRIVATE_EVENT_SIGNATURE = "PrivateEvent(address[],bytes32,bytes)";
|
|
552
|
+
var PRIVATE_EVENT_SIGNATURE_HASH = keccak256(
|
|
553
|
+
toUtf8Bytes(PRIVATE_EVENT_SIGNATURE)
|
|
554
|
+
);
|
|
555
|
+
function calculateEventTypeHash(eventSignature) {
|
|
556
|
+
return keccak256(toUtf8Bytes(eventSignature));
|
|
557
|
+
}
|
|
558
|
+
|
|
548
559
|
export {
|
|
549
560
|
SIGN_RPC_METHODS,
|
|
550
561
|
eip721Domain,
|
|
@@ -573,5 +584,8 @@ export {
|
|
|
573
584
|
defaultGetDelegate,
|
|
574
585
|
prepareTypedDataPayload,
|
|
575
586
|
SilentDataRollupBase,
|
|
576
|
-
SilentDataRollupContract
|
|
587
|
+
SilentDataRollupContract,
|
|
588
|
+
PRIVATE_EVENT_SIGNATURE,
|
|
589
|
+
PRIVATE_EVENT_SIGNATURE_HASH,
|
|
590
|
+
calculateEventTypeHash
|
|
577
591
|
};
|
package/dist/index.d.mts
CHANGED
|
@@ -209,4 +209,30 @@ declare function isSignableContractCall(payload: JsonRpcPayload, contractMethods
|
|
|
209
209
|
declare const defaultGetDelegate: (provider: any) => Promise<Signer>;
|
|
210
210
|
declare const prepareTypedDataPayload: (p: JsonRpcPayload) => AuthSignatureMessageRequest;
|
|
211
211
|
|
|
212
|
-
|
|
212
|
+
/**
|
|
213
|
+
* The standard signature for the PrivateEvent as emitted by contracts
|
|
214
|
+
*/
|
|
215
|
+
declare const PRIVATE_EVENT_SIGNATURE = "PrivateEvent(address[],bytes32,bytes)";
|
|
216
|
+
/**
|
|
217
|
+
* The keccak256 hash of the PrivateEvent signature
|
|
218
|
+
* Used for filtering logs by event signature
|
|
219
|
+
*/
|
|
220
|
+
declare const PRIVATE_EVENT_SIGNATURE_HASH: string;
|
|
221
|
+
/**
|
|
222
|
+
* Interface describing the shape of a PrivateEvent
|
|
223
|
+
*/
|
|
224
|
+
interface PrivateEvent {
|
|
225
|
+
allowedViewers: string[];
|
|
226
|
+
eventType: string;
|
|
227
|
+
payload: string;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Calculate the keccak256 hash of an event signature
|
|
231
|
+
* This is used to create the eventType parameter for PrivateEvent
|
|
232
|
+
*
|
|
233
|
+
* @param eventSignature - The event signature (e.g., "Transfer(address,address,uint256)")
|
|
234
|
+
* @returns The keccak256 hash of the event signature
|
|
235
|
+
*/
|
|
236
|
+
declare function calculateEventTypeHash(eventSignature: string): string;
|
|
237
|
+
|
|
238
|
+
export { type AuthHeaders, type AuthSignatureMessage, type AuthSignatureMessageRequest, type BaseConfig, ChainId, DEBUG_NAMESPACE, DEBUG_NAMESPACE_SILENTDATA_INTERCEPTOR, DEFAULT_DELEGATE_EXPIRES, DELEGATE_EXPIRATION_THRESHOLD_BUFFER, type DelegateConfig, type DelegateHeaders, type DelegateSignerMessage, HEADER_DELEGATE, HEADER_DELEGATE_SIGNATURE, HEADER_EIP712_DELEGATE_SIGNATURE, HEADER_EIP712_SIGNATURE, HEADER_SIGNATURE, HEADER_TIMESTAMP, NetworkName, PRIVATE_EVENT_SIGNATURE, PRIVATE_EVENT_SIGNATURE_HASH, type PrivateEvent, SIGN_RPC_METHODS, SignatureType, type SilentDataProviderOptions, SilentDataRollupBase, SilentDataRollupContract, type SilentDataRollupContractConfig, type SilentdataNetworkConfig, WHITELISTED_METHODS, calculateEventTypeHash, defaultGetDelegate, delegateEIP721Types, eip721Domain, getAuthEIP721Types, getAuthHeaders, isSignableContractCall, prepareTypedDataPayload, signAuthHeaderRawMessage, signAuthHeaderTypedData, signRawDelegateHeader, signTypedDelegateHeader };
|
package/dist/index.d.ts
CHANGED
|
@@ -209,4 +209,30 @@ declare function isSignableContractCall(payload: JsonRpcPayload, contractMethods
|
|
|
209
209
|
declare const defaultGetDelegate: (provider: any) => Promise<Signer>;
|
|
210
210
|
declare const prepareTypedDataPayload: (p: JsonRpcPayload) => AuthSignatureMessageRequest;
|
|
211
211
|
|
|
212
|
-
|
|
212
|
+
/**
|
|
213
|
+
* The standard signature for the PrivateEvent as emitted by contracts
|
|
214
|
+
*/
|
|
215
|
+
declare const PRIVATE_EVENT_SIGNATURE = "PrivateEvent(address[],bytes32,bytes)";
|
|
216
|
+
/**
|
|
217
|
+
* The keccak256 hash of the PrivateEvent signature
|
|
218
|
+
* Used for filtering logs by event signature
|
|
219
|
+
*/
|
|
220
|
+
declare const PRIVATE_EVENT_SIGNATURE_HASH: string;
|
|
221
|
+
/**
|
|
222
|
+
* Interface describing the shape of a PrivateEvent
|
|
223
|
+
*/
|
|
224
|
+
interface PrivateEvent {
|
|
225
|
+
allowedViewers: string[];
|
|
226
|
+
eventType: string;
|
|
227
|
+
payload: string;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Calculate the keccak256 hash of an event signature
|
|
231
|
+
* This is used to create the eventType parameter for PrivateEvent
|
|
232
|
+
*
|
|
233
|
+
* @param eventSignature - The event signature (e.g., "Transfer(address,address,uint256)")
|
|
234
|
+
* @returns The keccak256 hash of the event signature
|
|
235
|
+
*/
|
|
236
|
+
declare function calculateEventTypeHash(eventSignature: string): string;
|
|
237
|
+
|
|
238
|
+
export { type AuthHeaders, type AuthSignatureMessage, type AuthSignatureMessageRequest, type BaseConfig, ChainId, DEBUG_NAMESPACE, DEBUG_NAMESPACE_SILENTDATA_INTERCEPTOR, DEFAULT_DELEGATE_EXPIRES, DELEGATE_EXPIRATION_THRESHOLD_BUFFER, type DelegateConfig, type DelegateHeaders, type DelegateSignerMessage, HEADER_DELEGATE, HEADER_DELEGATE_SIGNATURE, HEADER_EIP712_DELEGATE_SIGNATURE, HEADER_EIP712_SIGNATURE, HEADER_SIGNATURE, HEADER_TIMESTAMP, NetworkName, PRIVATE_EVENT_SIGNATURE, PRIVATE_EVENT_SIGNATURE_HASH, type PrivateEvent, SIGN_RPC_METHODS, SignatureType, type SilentDataProviderOptions, SilentDataRollupBase, SilentDataRollupContract, type SilentDataRollupContractConfig, type SilentdataNetworkConfig, WHITELISTED_METHODS, calculateEventTypeHash, defaultGetDelegate, delegateEIP721Types, eip721Domain, getAuthEIP721Types, getAuthHeaders, isSignableContractCall, prepareTypedDataPayload, signAuthHeaderRawMessage, signAuthHeaderTypedData, signRawDelegateHeader, signTypedDelegateHeader };
|
package/dist/index.js
CHANGED
|
@@ -42,11 +42,14 @@ __export(index_exports, {
|
|
|
42
42
|
HEADER_SIGNATURE: () => HEADER_SIGNATURE,
|
|
43
43
|
HEADER_TIMESTAMP: () => HEADER_TIMESTAMP,
|
|
44
44
|
NetworkName: () => NetworkName,
|
|
45
|
+
PRIVATE_EVENT_SIGNATURE: () => PRIVATE_EVENT_SIGNATURE,
|
|
46
|
+
PRIVATE_EVENT_SIGNATURE_HASH: () => PRIVATE_EVENT_SIGNATURE_HASH,
|
|
45
47
|
SIGN_RPC_METHODS: () => SIGN_RPC_METHODS,
|
|
46
48
|
SignatureType: () => SignatureType,
|
|
47
49
|
SilentDataRollupBase: () => SilentDataRollupBase,
|
|
48
50
|
SilentDataRollupContract: () => SilentDataRollupContract,
|
|
49
51
|
WHITELISTED_METHODS: () => WHITELISTED_METHODS,
|
|
52
|
+
calculateEventTypeHash: () => calculateEventTypeHash,
|
|
50
53
|
defaultGetDelegate: () => defaultGetDelegate,
|
|
51
54
|
delegateEIP721Types: () => delegateEIP721Types,
|
|
52
55
|
eip721Domain: () => eip721Domain,
|
|
@@ -69,7 +72,8 @@ var SIGN_RPC_METHODS = [
|
|
|
69
72
|
"eth_getTransactionByHash",
|
|
70
73
|
"eth_getTransactionCount",
|
|
71
74
|
"eth_getProof",
|
|
72
|
-
"eth_getTransactionReceipt"
|
|
75
|
+
"eth_getTransactionReceipt",
|
|
76
|
+
"eth_estimateGas"
|
|
73
77
|
];
|
|
74
78
|
var eip721Domain = {
|
|
75
79
|
name: "Silent Data [Rollup]",
|
|
@@ -603,6 +607,16 @@ var SilentDataRollupContract = class extends import_ethers2.Contract {
|
|
|
603
607
|
}
|
|
604
608
|
}
|
|
605
609
|
};
|
|
610
|
+
|
|
611
|
+
// src/privateEvents.ts
|
|
612
|
+
var import_ethers3 = require("ethers");
|
|
613
|
+
var PRIVATE_EVENT_SIGNATURE = "PrivateEvent(address[],bytes32,bytes)";
|
|
614
|
+
var PRIVATE_EVENT_SIGNATURE_HASH = (0, import_ethers3.keccak256)(
|
|
615
|
+
(0, import_ethers3.toUtf8Bytes)(PRIVATE_EVENT_SIGNATURE)
|
|
616
|
+
);
|
|
617
|
+
function calculateEventTypeHash(eventSignature) {
|
|
618
|
+
return (0, import_ethers3.keccak256)((0, import_ethers3.toUtf8Bytes)(eventSignature));
|
|
619
|
+
}
|
|
606
620
|
// Annotate the CommonJS export names for ESM import in node:
|
|
607
621
|
0 && (module.exports = {
|
|
608
622
|
ChainId,
|
|
@@ -617,11 +631,14 @@ var SilentDataRollupContract = class extends import_ethers2.Contract {
|
|
|
617
631
|
HEADER_SIGNATURE,
|
|
618
632
|
HEADER_TIMESTAMP,
|
|
619
633
|
NetworkName,
|
|
634
|
+
PRIVATE_EVENT_SIGNATURE,
|
|
635
|
+
PRIVATE_EVENT_SIGNATURE_HASH,
|
|
620
636
|
SIGN_RPC_METHODS,
|
|
621
637
|
SignatureType,
|
|
622
638
|
SilentDataRollupBase,
|
|
623
639
|
SilentDataRollupContract,
|
|
624
640
|
WHITELISTED_METHODS,
|
|
641
|
+
calculateEventTypeHash,
|
|
625
642
|
defaultGetDelegate,
|
|
626
643
|
delegateEIP721Types,
|
|
627
644
|
eip721Domain,
|
package/dist/index.mjs
CHANGED
|
@@ -11,11 +11,14 @@ import {
|
|
|
11
11
|
HEADER_SIGNATURE,
|
|
12
12
|
HEADER_TIMESTAMP,
|
|
13
13
|
NetworkName,
|
|
14
|
+
PRIVATE_EVENT_SIGNATURE,
|
|
15
|
+
PRIVATE_EVENT_SIGNATURE_HASH,
|
|
14
16
|
SIGN_RPC_METHODS,
|
|
15
17
|
SignatureType,
|
|
16
18
|
SilentDataRollupBase,
|
|
17
19
|
SilentDataRollupContract,
|
|
18
20
|
WHITELISTED_METHODS,
|
|
21
|
+
calculateEventTypeHash,
|
|
19
22
|
defaultGetDelegate,
|
|
20
23
|
delegateEIP721Types,
|
|
21
24
|
eip721Domain,
|
|
@@ -27,7 +30,7 @@ import {
|
|
|
27
30
|
signAuthHeaderTypedData,
|
|
28
31
|
signRawDelegateHeader,
|
|
29
32
|
signTypedDelegateHeader
|
|
30
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-XU34XEI3.mjs";
|
|
31
34
|
export {
|
|
32
35
|
ChainId,
|
|
33
36
|
DEBUG_NAMESPACE,
|
|
@@ -41,11 +44,14 @@ export {
|
|
|
41
44
|
HEADER_SIGNATURE,
|
|
42
45
|
HEADER_TIMESTAMP,
|
|
43
46
|
NetworkName,
|
|
47
|
+
PRIVATE_EVENT_SIGNATURE,
|
|
48
|
+
PRIVATE_EVENT_SIGNATURE_HASH,
|
|
44
49
|
SIGN_RPC_METHODS,
|
|
45
50
|
SignatureType,
|
|
46
51
|
SilentDataRollupBase,
|
|
47
52
|
SilentDataRollupContract,
|
|
48
53
|
WHITELISTED_METHODS,
|
|
54
|
+
calculateEventTypeHash,
|
|
49
55
|
defaultGetDelegate,
|
|
50
56
|
delegateEIP721Types,
|
|
51
57
|
eip721Domain,
|
package/dist/tests.js
CHANGED
|
@@ -52,6 +52,13 @@ var log2 = (0, import_debug2.default)(DEBUG_NAMESPACE);
|
|
|
52
52
|
// src/contract.ts
|
|
53
53
|
var import_ethers2 = require("ethers");
|
|
54
54
|
|
|
55
|
+
// src/privateEvents.ts
|
|
56
|
+
var import_ethers3 = require("ethers");
|
|
57
|
+
var PRIVATE_EVENT_SIGNATURE = "PrivateEvent(address[],bytes32,bytes)";
|
|
58
|
+
var PRIVATE_EVENT_SIGNATURE_HASH = (0, import_ethers3.keccak256)(
|
|
59
|
+
(0, import_ethers3.toUtf8Bytes)(PRIVATE_EVENT_SIGNATURE)
|
|
60
|
+
);
|
|
61
|
+
|
|
55
62
|
// tests/utils/mocked-custom-grpc.ts
|
|
56
63
|
var import_http = __toESM(require("http"));
|
|
57
64
|
var currentPort = 3e3;
|
package/dist/tests.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appliedblockchain/silentdatarollup-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Core library for Silent Data [Rollup]",
|
|
5
5
|
"author": "Applied Blockchain",
|
|
6
6
|
"homepage": "https://github.com/appliedblockchain/silent-data-rollup-providers#readme",
|