@bloxchain/sdk 1.0.0-alpha
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 +338 -0
- package/abi/BareBlox.abi.json +1341 -0
- package/abi/BaseStateMachine.abi.json +1308 -0
- package/abi/ControlBlox.abi.json +6210 -0
- package/abi/EngineBlox.abi.json +872 -0
- package/abi/GuardController.abi.json +3045 -0
- package/abi/IDefinition.abi.json +94 -0
- package/abi/RoleBlox.abi.json +4569 -0
- package/abi/RuntimeRBAC.abi.json +1857 -0
- package/abi/RuntimeRBACDefinitions.abi.json +133 -0
- package/abi/SecureBlox.abi.json +4085 -0
- package/abi/SecureOwnable.abi.json +4085 -0
- package/abi/SecureOwnableDefinitions.abi.json +354 -0
- package/abi/SimpleRWA20.abi.json +5545 -0
- package/abi/SimpleRWA20Definitions.abi.json +172 -0
- package/abi/SimpleVault.abi.json +5208 -0
- package/abi/SimpleVaultDefinitions.abi.json +250 -0
- package/dist/abi/BaseStateMachine.abi.json +1308 -0
- package/dist/abi/GuardController.abi.json +3045 -0
- package/dist/abi/IDefinition.abi.json +94 -0
- package/dist/abi/RuntimeRBAC.abi.json +1857 -0
- package/dist/abi/SecureOwnable.abi.json +4085 -0
- package/dist/contracts/BaseStateMachine.d.ts +83 -0
- package/dist/contracts/BaseStateMachine.d.ts.map +1 -0
- package/dist/contracts/BaseStateMachine.js +251 -0
- package/dist/contracts/BaseStateMachine.js.map +1 -0
- package/dist/contracts/GuardController.d.ts +120 -0
- package/dist/contracts/GuardController.d.ts.map +1 -0
- package/dist/contracts/GuardController.js +149 -0
- package/dist/contracts/GuardController.js.map +1 -0
- package/dist/contracts/RuntimeRBAC.d.ts +56 -0
- package/dist/contracts/RuntimeRBAC.d.ts.map +1 -0
- package/dist/contracts/RuntimeRBAC.js +57 -0
- package/dist/contracts/RuntimeRBAC.js.map +1 -0
- package/dist/contracts/SecureOwnable.d.ts +41 -0
- package/dist/contracts/SecureOwnable.d.ts.map +1 -0
- package/dist/contracts/SecureOwnable.js +82 -0
- package/dist/contracts/SecureOwnable.js.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/base.index.d.ts +18 -0
- package/dist/interfaces/base.index.d.ts.map +1 -0
- package/dist/interfaces/base.index.js +2 -0
- package/dist/interfaces/base.index.js.map +1 -0
- package/dist/interfaces/base.state.machine.index.d.ts +72 -0
- package/dist/interfaces/base.state.machine.index.d.ts.map +1 -0
- package/dist/interfaces/base.state.machine.index.js +2 -0
- package/dist/interfaces/base.state.machine.index.js.map +1 -0
- package/dist/interfaces/core.access.index.d.ts +37 -0
- package/dist/interfaces/core.access.index.d.ts.map +1 -0
- package/dist/interfaces/core.access.index.js +2 -0
- package/dist/interfaces/core.access.index.js.map +1 -0
- package/dist/interfaces/core.execution.index.d.ts +44 -0
- package/dist/interfaces/core.execution.index.d.ts.map +1 -0
- package/dist/interfaces/core.execution.index.js +2 -0
- package/dist/interfaces/core.execution.index.js.map +1 -0
- package/dist/interfaces/core.security.index.d.ts +83 -0
- package/dist/interfaces/core.security.index.d.ts.map +1 -0
- package/dist/interfaces/core.security.index.js +2 -0
- package/dist/interfaces/core.security.index.js.map +1 -0
- package/dist/interfaces/definition.index.d.ts +38 -0
- package/dist/interfaces/definition.index.d.ts.map +1 -0
- package/dist/interfaces/definition.index.js +2 -0
- package/dist/interfaces/definition.index.js.map +1 -0
- package/dist/interfaces/lib.index.d.ts +83 -0
- package/dist/interfaces/lib.index.d.ts.map +1 -0
- package/dist/interfaces/lib.index.js +2 -0
- package/dist/interfaces/lib.index.js.map +1 -0
- package/dist/lib/Definition.d.ts +84 -0
- package/dist/lib/Definition.d.ts.map +1 -0
- package/dist/lib/Definition.js +159 -0
- package/dist/lib/Definition.js.map +1 -0
- package/dist/lib/EngineBlox.d.ts +167 -0
- package/dist/lib/EngineBlox.d.ts.map +1 -0
- package/dist/lib/EngineBlox.js +266 -0
- package/dist/lib/EngineBlox.js.map +1 -0
- package/dist/types/base.state.machine.index.d.ts +45 -0
- package/dist/types/base.state.machine.index.d.ts.map +1 -0
- package/dist/types/base.state.machine.index.js +49 -0
- package/dist/types/base.state.machine.index.js.map +1 -0
- package/dist/types/core.access.index.d.ts +51 -0
- package/dist/types/core.access.index.d.ts.map +1 -0
- package/dist/types/core.access.index.js +41 -0
- package/dist/types/core.access.index.js.map +1 -0
- package/dist/types/core.execution.index.d.ts +36 -0
- package/dist/types/core.execution.index.d.ts.map +1 -0
- package/dist/types/core.execution.index.js +30 -0
- package/dist/types/core.execution.index.js.map +1 -0
- package/dist/types/core.security.index.d.ts +36 -0
- package/dist/types/core.security.index.d.ts.map +1 -0
- package/dist/types/core.security.index.js +37 -0
- package/dist/types/core.security.index.js.map +1 -0
- package/dist/types/definition.index.d.ts +36 -0
- package/dist/types/definition.index.d.ts.map +1 -0
- package/dist/types/definition.index.js +4 -0
- package/dist/types/definition.index.js.map +1 -0
- package/dist/types/lib.index.d.ts +66 -0
- package/dist/types/lib.index.d.ts.map +1 -0
- package/dist/types/lib.index.js +68 -0
- package/dist/types/lib.index.js.map +1 -0
- package/dist/utils/bitmap.d.ts +75 -0
- package/dist/utils/bitmap.d.ts.map +1 -0
- package/dist/utils/bitmap.js +124 -0
- package/dist/utils/bitmap.js.map +1 -0
- package/dist/utils/contract-errors.d.ts +536 -0
- package/dist/utils/contract-errors.d.ts.map +1 -0
- package/dist/utils/contract-errors.js +412 -0
- package/dist/utils/contract-errors.js.map +1 -0
- package/dist/utils/erc20/ERC20Token.abi.json +217 -0
- package/dist/utils/erc20/erc20Token.d.ts +83 -0
- package/dist/utils/erc20/erc20Token.d.ts.map +1 -0
- package/dist/utils/erc20/erc20Token.js +173 -0
- package/dist/utils/erc20/erc20Token.js.map +1 -0
- package/dist/utils/interface-ids.d.ts +59 -0
- package/dist/utils/interface-ids.d.ts.map +1 -0
- package/dist/utils/interface-ids.js +149 -0
- package/dist/utils/interface-ids.js.map +1 -0
- package/dist/utils/metaTx/metaTransaction.d.ts +138 -0
- package/dist/utils/metaTx/metaTransaction.d.ts.map +1 -0
- package/dist/utils/metaTx/metaTransaction.js +271 -0
- package/dist/utils/metaTx/metaTransaction.js.map +1 -0
- package/dist/utils/validations.d.ts +104 -0
- package/dist/utils/validations.d.ts.map +1 -0
- package/dist/utils/validations.js +254 -0
- package/dist/utils/validations.js.map +1 -0
- package/dist/utils/viem-error-handler.d.ts +48 -0
- package/dist/utils/viem-error-handler.d.ts.map +1 -0
- package/dist/utils/viem-error-handler.js +172 -0
- package/dist/utils/viem-error-handler.js.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EngineBlox.d.ts","sourceRoot":"","sources":["../../lib/EngineBlox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4B,OAAO,EAAE,GAAG,EAAE,YAAY,EAA8B,MAAM,MAAM,CAAC;AACxG,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAsB,MAAM,iBAAiB,CAAC;AASnE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,UAAU;IAGrB;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE,GAAG,CAA0B;IAEjE;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAK;IAE1C;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAK;IAE1C;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAK;IAI1C;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAC,wBAAwB,EAAE,GAAG,CAEpC;IAET;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,yBAAyB,EAAE,GAAG,CAAgC;IAE9E;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAC,uBAAuB,EAAE,GAAG,CAEnC;IAET;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,wBAAwB,EAAE,GAAG,CAA+B;IAI5E;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,GAAG,CAA2B;IAE1D;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,gBAAgB,EAAE,GAAG,CAAiC;IAEtE;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,aAAa,EAAE,GAAG,CAA8B;IAIhE;;;;;;;;;;;;;;;;OAgBG;WACU,aAAa,CAAC,WAAW,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC;IAwC9E;;;;;;;;;;;;;;;;;;OAkBG;WACU,wBAAwB,CACnC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,OAAO,EACxB,QAAQ,EAAE,GAAG,GACZ,OAAO,CAAC,OAAO,CAAC;IA8CnB;;;;;;;;;;OAUG;IACH,MAAM,CAAC,iBAAiB,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,GAAG,OAAO;IAIzE;;;;;;;;;;OAUG;IACH,MAAM,CAAC,iBAAiB,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,GAAG,YAAY;IAI9E;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,uBAAuB,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,YAAY;IAQjE;;;;;;;;;;OAUG;IACH,MAAM,CAAC,sBAAsB,CAAC,MAAM,EAAE,YAAY,GAAG,QAAQ,EAAE;CAYhE;AAED;;GAEG;AACH,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { keccak256 as k256, recoverAddress } from 'viem';
|
|
2
|
+
import { createUint16Bitmap } from '../utils/bitmap';
|
|
3
|
+
/**
|
|
4
|
+
* Helper function to compute keccak256 of a string
|
|
5
|
+
*/
|
|
6
|
+
const keccak256 = (str) => {
|
|
7
|
+
return k256(new TextEncoder().encode(str));
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* @title EngineBlox Library SDK
|
|
11
|
+
* @dev Provides access to public library constants and pure functions from EngineBlox.sol
|
|
12
|
+
*
|
|
13
|
+
* This module exposes all accessible constants and pure/view functions from the EngineBlox library
|
|
14
|
+
* that don't require storage access (no `self` parameter). Functions meant for delegatecall
|
|
15
|
+
* (those using `self`) are excluded.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* import { EngineBlox } from '@bloxchain/sdk/lib/EngineBlox';
|
|
20
|
+
*
|
|
21
|
+
* // Access constants
|
|
22
|
+
* const protocolName = EngineBlox.PROTOCOL_NAME_HASH;
|
|
23
|
+
* const version = `${EngineBlox.VERSION_MAJOR}.${EngineBlox.VERSION_MINOR}.${EngineBlox.VERSION_PATCH}`;
|
|
24
|
+
*
|
|
25
|
+
* // Use pure functions
|
|
26
|
+
* const signer = EngineBlox.recoverSigner(messageHash, signature);
|
|
27
|
+
*
|
|
28
|
+
* // Use bitmap helpers
|
|
29
|
+
* const hasAction = EngineBlox.hasActionInBitmap(bitmap, TxAction.EXECUTE_TIME_DELAY_REQUEST);
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export class EngineBlox {
|
|
33
|
+
// ============ PURE FUNCTIONS ============
|
|
34
|
+
/**
|
|
35
|
+
* @dev Recovers the signer address from a message hash and signature
|
|
36
|
+
* @param messageHash The hash of the message that was signed (bytes32)
|
|
37
|
+
* @param signature The signature to recover the address from (65 bytes)
|
|
38
|
+
* @returns Promise that resolves to the address of the signer
|
|
39
|
+
* @throws Error if signature is invalid or recovery fails
|
|
40
|
+
*
|
|
41
|
+
* @notice This matches the contract's recoverSigner function which uses
|
|
42
|
+
* messageHash.toEthSignedMessageHash() to convert to EIP-191 format
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* const messageHash = "0x1234...";
|
|
47
|
+
* const signature = "0xabcd...";
|
|
48
|
+
* const signer = await EngineBlox.recoverSigner(messageHash, signature);
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
static async recoverSigner(messageHash, signature) {
|
|
52
|
+
// Validate signature length (65 bytes = 130 hex chars + '0x' prefix)
|
|
53
|
+
if (signature.length !== 132) {
|
|
54
|
+
throw new Error(`Invalid signature length: expected 65 bytes (132 hex chars), got ${signature.length - 2} bytes`);
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
// The contract uses messageHash.toEthSignedMessageHash() which converts to EIP-191 format
|
|
58
|
+
// EIP-191 format for 32-byte hash: keccak256("\x19Ethereum Signed Message:\n32" + messageHash)
|
|
59
|
+
// We need to create the EIP-191 formatted hash and then recover from it
|
|
60
|
+
const prefix = '\x19Ethereum Signed Message:\n32';
|
|
61
|
+
const messageHashBytes = Buffer.from(messageHash.slice(2), 'hex');
|
|
62
|
+
// Concatenate prefix and hash
|
|
63
|
+
const eip191Message = Buffer.concat([
|
|
64
|
+
Buffer.from(prefix, 'utf8'),
|
|
65
|
+
messageHashBytes
|
|
66
|
+
]);
|
|
67
|
+
// Convert Buffer to Uint8Array for viem
|
|
68
|
+
const eip191MessageBytes = new Uint8Array(eip191Message);
|
|
69
|
+
// Hash the EIP-191 formatted message
|
|
70
|
+
const eip191Hash = (await k256(eip191MessageBytes));
|
|
71
|
+
// Recover address from the EIP-191 formatted hash
|
|
72
|
+
// Note: recoverAddress is async in viem
|
|
73
|
+
const recovered = await recoverAddress({
|
|
74
|
+
hash: eip191Hash,
|
|
75
|
+
signature: signature
|
|
76
|
+
});
|
|
77
|
+
return recovered;
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
throw new Error(`Failed to recover signer: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
// ============ VIEW FUNCTIONS (No storage access) ============
|
|
84
|
+
/**
|
|
85
|
+
* @dev Checks if a function selector exists in a contract's bytecode
|
|
86
|
+
* @param client PublicClient instance for reading contract bytecode
|
|
87
|
+
* @param contractAddress The address of the contract to check
|
|
88
|
+
* @param selector The 4-byte function selector to search for
|
|
89
|
+
* @returns Promise that resolves to true if the selector is found in the contract's function selector dispatch table
|
|
90
|
+
*
|
|
91
|
+
* @notice Searches the first 2KB where function selectors are stored in the dispatch table
|
|
92
|
+
* @notice This is a heuristic check - false positives are possible but unlikely
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```typescript
|
|
96
|
+
* const exists = await EngineBlox.selectorExistsInContract(
|
|
97
|
+
* publicClient,
|
|
98
|
+
* '0x1234...',
|
|
99
|
+
* '0xabcd1234'
|
|
100
|
+
* );
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
static async selectorExistsInContract(client, contractAddress, selector) {
|
|
104
|
+
try {
|
|
105
|
+
// Get the contract's bytecode
|
|
106
|
+
const code = await client.getCode({ address: contractAddress });
|
|
107
|
+
if (!code || code.length < 12) { // Need at least '0x' + PUSH4 (1 byte = 2 hex chars) + selector (4 bytes = 8 hex chars) = 12 chars
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
// Function selectors are in the dispatch table at the beginning
|
|
111
|
+
// Typical dispatch tables are < 2KB even for large contracts
|
|
112
|
+
// Searching only this area reduces gas cost and false positives from metadata/data
|
|
113
|
+
// 2KB = 2048 bytes = 4096 hex chars (plus '0x' prefix = 4098 total)
|
|
114
|
+
const maxSearchBytes = 2048;
|
|
115
|
+
const codeHexLength = code.length - 2; // Remove '0x' prefix
|
|
116
|
+
const maxSearchHexChars = maxSearchBytes * 2; // Each byte is 2 hex chars
|
|
117
|
+
const searchLength = codeHexLength < maxSearchHexChars ? codeHexLength : maxSearchHexChars;
|
|
118
|
+
// Convert hex strings for searching (normalize to lowercase)
|
|
119
|
+
const codeBytes = code.slice(2).toLowerCase(); // Remove '0x' prefix and normalize
|
|
120
|
+
const selectorBytes = selector.slice(2).toLowerCase(); // Remove '0x' and normalize
|
|
121
|
+
// Scan for PUSH4 opcode (0x63 = "63" in hex) with 1-byte sliding window
|
|
122
|
+
// PUSH4 opcode is followed by 4 bytes (8 hex chars) which is the function selector
|
|
123
|
+
// Function selectors in EVM bytecode are emitted as PUSH4 <selector> instructions
|
|
124
|
+
// These can start at any byte offset, not just 4-byte-aligned positions
|
|
125
|
+
for (let i = 0; i + 10 <= searchLength; i += 2) { // i += 2 because each byte is 2 hex chars
|
|
126
|
+
// Check if current byte is PUSH4 opcode (0x63 = "63" in hex)
|
|
127
|
+
if (codeBytes.slice(i, i + 2) === '63') {
|
|
128
|
+
// Check if the next 8 hex chars (4 bytes) match the selector
|
|
129
|
+
const candidate = codeBytes.slice(i + 2, i + 10);
|
|
130
|
+
if (candidate === selectorBytes) {
|
|
131
|
+
return true;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
catch (error) {
|
|
138
|
+
// If we can't read the bytecode, return false
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
// ============ BITMAP HELPER FUNCTIONS ============
|
|
143
|
+
/**
|
|
144
|
+
* @dev Checks if a TxAction is present in a bitmap
|
|
145
|
+
* @param bitmap The bitmap to check
|
|
146
|
+
* @param action The TxAction to check for
|
|
147
|
+
* @returns True if the action is present in the bitmap
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```typescript
|
|
151
|
+
* const hasAction = EngineBlox.hasActionInBitmap(bitmap, TxAction.EXECUTE_TIME_DELAY_REQUEST);
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
static hasActionInBitmap(bitmap, action) {
|
|
155
|
+
return (bitmap & (1 << action)) !== 0;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* @dev Adds a TxAction to a bitmap
|
|
159
|
+
* @param bitmap The original bitmap
|
|
160
|
+
* @param action The TxAction to add
|
|
161
|
+
* @returns The updated bitmap with the action added
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* ```typescript
|
|
165
|
+
* const newBitmap = EngineBlox.addActionToBitmap(bitmap, TxAction.EXECUTE_TIME_DELAY_REQUEST);
|
|
166
|
+
* ```
|
|
167
|
+
*/
|
|
168
|
+
static addActionToBitmap(bitmap, action) {
|
|
169
|
+
return createUint16Bitmap(bitmap | (1 << action));
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* @dev Creates a bitmap from an array of TxActions
|
|
173
|
+
* @param actions Array of TxActions to convert to bitmap
|
|
174
|
+
* @returns Bitmap representation of the actions
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* ```typescript
|
|
178
|
+
* const bitmap = EngineBlox.createBitmapFromActions([
|
|
179
|
+
* TxAction.EXECUTE_TIME_DELAY_REQUEST,
|
|
180
|
+
* TxAction.EXECUTE_TIME_DELAY_APPROVE
|
|
181
|
+
* ]);
|
|
182
|
+
* ```
|
|
183
|
+
*/
|
|
184
|
+
static createBitmapFromActions(actions) {
|
|
185
|
+
let bitmap = createUint16Bitmap(0);
|
|
186
|
+
for (const action of actions) {
|
|
187
|
+
bitmap = this.addActionToBitmap(bitmap, action);
|
|
188
|
+
}
|
|
189
|
+
return bitmap;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* @dev Converts a bitmap to an array of TxActions
|
|
193
|
+
* @param bitmap The bitmap to convert
|
|
194
|
+
* @returns Array of TxActions represented by the bitmap
|
|
195
|
+
*
|
|
196
|
+
* @example
|
|
197
|
+
* ```typescript
|
|
198
|
+
* const actions = EngineBlox.convertBitmapToActions(bitmap);
|
|
199
|
+
* // Returns [TxAction.EXECUTE_TIME_DELAY_REQUEST, TxAction.EXECUTE_TIME_DELAY_APPROVE]
|
|
200
|
+
* ```
|
|
201
|
+
*/
|
|
202
|
+
static convertBitmapToActions(bitmap) {
|
|
203
|
+
// Count how many actions are set
|
|
204
|
+
const actions = [];
|
|
205
|
+
for (let i = 0; i < 16; i++) {
|
|
206
|
+
if ((bitmap & (1 << i)) !== 0) {
|
|
207
|
+
actions.push(i);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return actions;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
// ============ VERSION INFORMATION ============
|
|
214
|
+
/**
|
|
215
|
+
* Protocol name hash (keccak256("Bloxchain"))
|
|
216
|
+
*/
|
|
217
|
+
EngineBlox.PROTOCOL_NAME_HASH = keccak256("Bloxchain");
|
|
218
|
+
/**
|
|
219
|
+
* Major version number
|
|
220
|
+
*/
|
|
221
|
+
EngineBlox.VERSION_MAJOR = 1;
|
|
222
|
+
/**
|
|
223
|
+
* Minor version number
|
|
224
|
+
*/
|
|
225
|
+
EngineBlox.VERSION_MINOR = 0;
|
|
226
|
+
/**
|
|
227
|
+
* Patch version number
|
|
228
|
+
*/
|
|
229
|
+
EngineBlox.VERSION_PATCH = 0;
|
|
230
|
+
// ============ FUNCTION SELECTORS ============
|
|
231
|
+
/**
|
|
232
|
+
* Native token transfer selector (reserved signature for simple ETH transfers)
|
|
233
|
+
* Computed as bytes4(keccak256("__bloxchain_native_transfer__()"))
|
|
234
|
+
*/
|
|
235
|
+
EngineBlox.NATIVE_TRANSFER_SELECTOR = ('0x' + k256(new TextEncoder().encode("__bloxchain_native_transfer__()")).slice(2, 10));
|
|
236
|
+
/**
|
|
237
|
+
* Native token transfer operation type hash
|
|
238
|
+
*/
|
|
239
|
+
EngineBlox.NATIVE_TRANSFER_OPERATION = keccak256("NATIVE_TRANSFER");
|
|
240
|
+
/**
|
|
241
|
+
* Payment update selector (reserved signature for payment detail updates)
|
|
242
|
+
* Computed as bytes4(keccak256("__bloxchain_update_payment__()"))
|
|
243
|
+
*/
|
|
244
|
+
EngineBlox.UPDATE_PAYMENT_SELECTOR = ('0x' + k256(new TextEncoder().encode("__bloxchain_update_payment__()")).slice(2, 10));
|
|
245
|
+
/**
|
|
246
|
+
* Payment update operation type hash
|
|
247
|
+
*/
|
|
248
|
+
EngineBlox.UPDATE_PAYMENT_OPERATION = keccak256("UPDATE_PAYMENT");
|
|
249
|
+
// ============ ROLE CONSTANTS ============
|
|
250
|
+
/**
|
|
251
|
+
* Owner role hash
|
|
252
|
+
*/
|
|
253
|
+
EngineBlox.OWNER_ROLE = keccak256("OWNER_ROLE");
|
|
254
|
+
/**
|
|
255
|
+
* Broadcaster role hash
|
|
256
|
+
*/
|
|
257
|
+
EngineBlox.BROADCASTER_ROLE = keccak256("BROADCASTER_ROLE");
|
|
258
|
+
/**
|
|
259
|
+
* Recovery role hash
|
|
260
|
+
*/
|
|
261
|
+
EngineBlox.RECOVERY_ROLE = keccak256("RECOVERY_ROLE");
|
|
262
|
+
/**
|
|
263
|
+
* Default export for convenience
|
|
264
|
+
*/
|
|
265
|
+
export default EngineBlox;
|
|
266
|
+
//# sourceMappingURL=EngineBlox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EngineBlox.js","sourceRoot":"","sources":["../../lib/EngineBlox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,IAAI,EAAqC,cAAc,EAAc,MAAM,MAAM,CAAC;AAExG,OAAO,EAAgB,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAEnE;;GAEG;AACH,MAAM,SAAS,GAAG,CAAC,GAAW,EAAO,EAAE;IACrC,OAAO,IAAI,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAQ,CAAC;AACpD,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,OAAO,UAAU;IAoErB,2CAA2C;IAE3C;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,WAAgB,EAAE,SAAc;QACzD,qEAAqE;QACrE,IAAI,SAAS,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC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,CAAC;AAEjE;;GAEG;AACa,wBAAa,GAAW,CAAC,CAAC;AAE1C;;GAEG;AACa,wBAAa,GAAW,CAAC,CAAC;AAE1C;;GAEG;AACa,wBAAa,GAAW,CAAC,CAAC;AAE1C,+CAA+C;AAE/C;;;GAGG;AACa,mCAAwB,GAAQ,CAC9C,IAAI,GAAG,IAAI,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,iCAAiC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAC/E,CAAC;AAET;;GAEG;AACa,oCAAyB,GAAQ,SAAS,CAAC,iBAAiB,CAAC,CAAC;AAE9E;;;GAGG;AACa,kCAAuB,GAAQ,CAC7C,IAAI,GAAG,IAAI,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,gCAAgC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAC9E,CAAC;AAET;;GAEG;AACa,mCAAwB,GAAQ,SAAS,CAAC,gBAAgB,CAAC,CAAC;AAE5E,2CAA2C;AAE3C;;GAEG;AACa,qBAAU,GAAQ,SAAS,CAAC,YAAY,CAAC,CAAC;AAE1D;;GAEG;AACa,2BAAgB,GAAQ,SAAS,CAAC,kBAAkB,CAAC,CAAC;AAEtE;;GAEG;AACa,wBAAa,GAAQ,SAAS,CAAC,eAAe,CAAC,CAAC;AA8MlE;;GAEG;AACH,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constants for BaseStateMachine operations
|
|
3
|
+
*/
|
|
4
|
+
export declare const BASE_STATE_MACHINE_OPERATION_TYPES: {
|
|
5
|
+
readonly TX_REQUEST: `0x${string}`;
|
|
6
|
+
readonly TX_DELAYED_APPROVAL: `0x${string}`;
|
|
7
|
+
readonly TX_CANCELLATION: `0x${string}`;
|
|
8
|
+
readonly META_TX_APPROVAL: `0x${string}`;
|
|
9
|
+
readonly META_TX_CANCELLATION: `0x${string}`;
|
|
10
|
+
readonly META_TX_REQUEST_AND_APPROVE: `0x${string}`;
|
|
11
|
+
readonly UPDATE_PAYMENT: `0x${string}`;
|
|
12
|
+
};
|
|
13
|
+
export type BaseStateMachineOperationType = typeof BASE_STATE_MACHINE_OPERATION_TYPES[keyof typeof BASE_STATE_MACHINE_OPERATION_TYPES];
|
|
14
|
+
/**
|
|
15
|
+
* Constants for BaseStateMachine function selectors
|
|
16
|
+
*/
|
|
17
|
+
export declare const BASE_STATE_MACHINE_FUNCTION_SELECTORS: {
|
|
18
|
+
readonly CREATE_META_TX_PARAMS: string;
|
|
19
|
+
readonly GENERATE_UNSIGNED_META_TX_FOR_NEW: string;
|
|
20
|
+
readonly GENERATE_UNSIGNED_META_TX_FOR_EXISTING: string;
|
|
21
|
+
readonly GET_TRANSACTION_HISTORY: string;
|
|
22
|
+
readonly GET_TRANSACTION: string;
|
|
23
|
+
readonly GET_PENDING_TRANSACTIONS: string;
|
|
24
|
+
readonly HAS_ROLE: string;
|
|
25
|
+
readonly IS_ACTION_SUPPORTED_BY_FUNCTION: string;
|
|
26
|
+
readonly GET_ACTIVE_ROLE_PERMISSIONS: string;
|
|
27
|
+
readonly GET_SIGNER_NONCE: string;
|
|
28
|
+
readonly GET_SUPPORTED_OPERATION_TYPES: string;
|
|
29
|
+
readonly GET_SUPPORTED_ROLES: string;
|
|
30
|
+
readonly GET_SUPPORTED_FUNCTIONS: string;
|
|
31
|
+
readonly GET_TIME_LOCK_PERIOD_SEC: string;
|
|
32
|
+
readonly INITIALIZED: string;
|
|
33
|
+
readonly SUPPORTS_INTERFACE: string;
|
|
34
|
+
};
|
|
35
|
+
export type BaseStateMachineFunctionSelector = typeof BASE_STATE_MACHINE_FUNCTION_SELECTORS[keyof typeof BASE_STATE_MACHINE_FUNCTION_SELECTORS];
|
|
36
|
+
/**
|
|
37
|
+
* Constants for core role hashes
|
|
38
|
+
*/
|
|
39
|
+
export declare const CORE_ROLE_HASHES: {
|
|
40
|
+
readonly OWNER_ROLE: `0x${string}`;
|
|
41
|
+
readonly BROADCASTER_ROLE: `0x${string}`;
|
|
42
|
+
readonly RECOVERY_ROLE: `0x${string}`;
|
|
43
|
+
};
|
|
44
|
+
export type CoreRoleHash = typeof CORE_ROLE_HASHES[keyof typeof CORE_ROLE_HASHES];
|
|
45
|
+
//# sourceMappingURL=base.state.machine.index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.state.machine.index.d.ts","sourceRoot":"","sources":["../../types/base.state.machine.index.tsx"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;CASrC,CAAC;AAEX,MAAM,MAAM,6BAA6B,GAAG,OAAO,kCAAkC,CAAC,MAAM,OAAO,kCAAkC,CAAC,CAAC;AAEvI;;GAEG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;CA0BxC,CAAC;AAEX,MAAM,MAAM,gCAAgC,GAAG,OAAO,qCAAqC,CAAC,MAAM,OAAO,qCAAqC,CAAC,CAAC;AAEhJ;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;CAInB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,OAAO,gBAAgB,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { keccak256 } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* Constants for BaseStateMachine operations
|
|
4
|
+
*/
|
|
5
|
+
export const BASE_STATE_MACHINE_OPERATION_TYPES = {
|
|
6
|
+
// Core state machine operations
|
|
7
|
+
TX_REQUEST: keccak256(new TextEncoder().encode("TX_REQUEST")),
|
|
8
|
+
TX_DELAYED_APPROVAL: keccak256(new TextEncoder().encode("TX_DELAYED_APPROVAL")),
|
|
9
|
+
TX_CANCELLATION: keccak256(new TextEncoder().encode("TX_CANCELLATION")),
|
|
10
|
+
META_TX_APPROVAL: keccak256(new TextEncoder().encode("META_TX_APPROVAL")),
|
|
11
|
+
META_TX_CANCELLATION: keccak256(new TextEncoder().encode("META_TX_CANCELLATION")),
|
|
12
|
+
META_TX_REQUEST_AND_APPROVE: keccak256(new TextEncoder().encode("META_TX_REQUEST_AND_APPROVE")),
|
|
13
|
+
UPDATE_PAYMENT: keccak256(new TextEncoder().encode("UPDATE_PAYMENT"))
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Constants for BaseStateMachine function selectors
|
|
17
|
+
*/
|
|
18
|
+
export const BASE_STATE_MACHINE_FUNCTION_SELECTORS = {
|
|
19
|
+
// Meta-transaction utilities
|
|
20
|
+
CREATE_META_TX_PARAMS: keccak256(new TextEncoder().encode("createMetaTxParams(address,bytes4,uint8,uint256,uint256,address)")).slice(0, 10),
|
|
21
|
+
GENERATE_UNSIGNED_META_TX_FOR_NEW: keccak256(new TextEncoder().encode("generateUnsignedMetaTransactionForNew(address,address,uint256,uint256,bytes32,uint8,bytes,(uint256,uint256,address,bytes4,uint256,uint256,address))")).slice(0, 10),
|
|
22
|
+
GENERATE_UNSIGNED_META_TX_FOR_EXISTING: keccak256(new TextEncoder().encode("generateUnsignedMetaTransactionForExisting(uint256,(uint256,uint256,address,bytes4,uint256,uint256,address))")).slice(0, 10),
|
|
23
|
+
// State queries
|
|
24
|
+
GET_TRANSACTION_HISTORY: keccak256(new TextEncoder().encode("getTransactionHistory(uint256,uint256)")).slice(0, 10),
|
|
25
|
+
GET_TRANSACTION: keccak256(new TextEncoder().encode("getTransaction(uint256)")).slice(0, 10),
|
|
26
|
+
GET_PENDING_TRANSACTIONS: keccak256(new TextEncoder().encode("getPendingTransactions()")).slice(0, 10),
|
|
27
|
+
// Role and permission queries
|
|
28
|
+
HAS_ROLE: keccak256(new TextEncoder().encode("hasRole(bytes32,address)")).slice(0, 10),
|
|
29
|
+
IS_ACTION_SUPPORTED_BY_FUNCTION: keccak256(new TextEncoder().encode("isActionSupportedByFunction(bytes4,uint8)")).slice(0, 10),
|
|
30
|
+
GET_ACTIVE_ROLE_PERMISSIONS: keccak256(new TextEncoder().encode("getActiveRolePermissions(bytes32)")).slice(0, 10),
|
|
31
|
+
GET_SIGNER_NONCE: keccak256(new TextEncoder().encode("getSignerNonce(address)")).slice(0, 10),
|
|
32
|
+
// System state queries
|
|
33
|
+
GET_SUPPORTED_OPERATION_TYPES: keccak256(new TextEncoder().encode("getSupportedOperationTypes()")).slice(0, 10),
|
|
34
|
+
GET_SUPPORTED_ROLES: keccak256(new TextEncoder().encode("getSupportedRoles()")).slice(0, 10),
|
|
35
|
+
GET_SUPPORTED_FUNCTIONS: keccak256(new TextEncoder().encode("getSupportedFunctions()")).slice(0, 10),
|
|
36
|
+
GET_TIME_LOCK_PERIOD_SEC: keccak256(new TextEncoder().encode("getTimeLockPeriodSec()")).slice(0, 10),
|
|
37
|
+
INITIALIZED: keccak256(new TextEncoder().encode("initialized()")).slice(0, 10),
|
|
38
|
+
// Interface support
|
|
39
|
+
SUPPORTS_INTERFACE: keccak256(new TextEncoder().encode("supportsInterface(bytes4)")).slice(0, 10)
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Constants for core role hashes
|
|
43
|
+
*/
|
|
44
|
+
export const CORE_ROLE_HASHES = {
|
|
45
|
+
OWNER_ROLE: keccak256(new TextEncoder().encode("OWNER_ROLE")),
|
|
46
|
+
BROADCASTER_ROLE: keccak256(new TextEncoder().encode("BROADCASTER_ROLE")),
|
|
47
|
+
RECOVERY_ROLE: keccak256(new TextEncoder().encode("RECOVERY_ROLE"))
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=base.state.machine.index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.state.machine.index.js","sourceRoot":"","sources":["../../types/base.state.machine.index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjC;;GAEG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG;IAChD,gCAAgC;IAChC,UAA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SAAS,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;IACpG,WAAW,EAAE,SAAS,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;IAE9E,oBAAoB;IACpB,kBAAkB,EAAE,SAAS,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,2BAA2B,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;CACzF,CAAC;AAIX;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,UAAU,EAAE,SAAS,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAC7D,gBAAgB,EAAE,SAAS,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;IACzE,aAAa,EAAE,SAAS,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;CAC3D,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Hex } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* RoleConfigActionType enum matching Solidity RuntimeRBAC.RoleConfigActionType
|
|
4
|
+
*/
|
|
5
|
+
export declare enum RoleConfigActionType {
|
|
6
|
+
CREATE_ROLE = 0,
|
|
7
|
+
REMOVE_ROLE = 1,
|
|
8
|
+
ADD_WALLET = 2,
|
|
9
|
+
REVOKE_WALLET = 3,
|
|
10
|
+
ADD_FUNCTION_TO_ROLE = 4,
|
|
11
|
+
REMOVE_FUNCTION_FROM_ROLE = 5
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Type for RoleConfigAction struct
|
|
15
|
+
*/
|
|
16
|
+
export interface RoleConfigAction {
|
|
17
|
+
actionType: RoleConfigActionType;
|
|
18
|
+
data: Hex;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Constants for RuntimeRBAC operation types
|
|
22
|
+
* These match the keccak256 hashes defined in RuntimeRBACDefinitions.sol
|
|
23
|
+
*/
|
|
24
|
+
export declare const RUNTIME_RBAC_OPERATION_TYPES: {
|
|
25
|
+
readonly ROLE_CONFIG_BATCH: `0x${string}`;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Legacy export for backwards compatibility
|
|
29
|
+
* @deprecated Use RUNTIME_RBAC_OPERATION_TYPES instead
|
|
30
|
+
*/
|
|
31
|
+
export declare const DYNAMIC_RBAC_OPERATION_TYPES: {
|
|
32
|
+
readonly ROLE_CONFIG_BATCH: `0x${string}`;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Constants for RuntimeRBAC function selectors
|
|
36
|
+
* These match the selectors from RuntimeRBACDefinitions.sol
|
|
37
|
+
*/
|
|
38
|
+
export declare const RUNTIME_RBAC_FUNCTION_SELECTORS: {
|
|
39
|
+
readonly ROLE_CONFIG_BATCH_EXECUTE_SELECTOR: Hex;
|
|
40
|
+
readonly ROLE_CONFIG_BATCH_META_SELECTOR: Hex;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Legacy export for backwards compatibility
|
|
44
|
+
* @deprecated Use RUNTIME_RBAC_FUNCTION_SELECTORS instead
|
|
45
|
+
*/
|
|
46
|
+
export declare const DYNAMIC_RBAC_FUNCTION_SELECTORS: {
|
|
47
|
+
readonly ROLE_CONFIG_BATCH_EXECUTE_SELECTOR: Hex;
|
|
48
|
+
readonly ROLE_CONFIG_BATCH_META_SELECTOR: Hex;
|
|
49
|
+
};
|
|
50
|
+
export { OPERATION_TYPES, FUNCTION_SELECTORS } from './core.security.index';
|
|
51
|
+
//# sourceMappingURL=core.access.index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.access.index.d.ts","sourceRoot":"","sources":["../../types/core.access.index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,GAAG,EAAE,MAAM,MAAM,CAAC;AAEtC;;GAEG;AACH,oBAAY,oBAAoB;IAC9B,WAAW,IAAI;IACf,WAAW,IAAI;IACf,UAAU,IAAI;IACd,aAAa,IAAI;IACjB,oBAAoB,IAAI;IACxB,yBAAyB,IAAI;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,oBAAoB,CAAC;IACjC,IAAI,EAAE,GAAG,CAAC;CACX;AAED;;;GAGG;AACH,eAAO,MAAM,4BAA4B;;CAE/B,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,4BAA4B;;CAA+B,CAAC;AAEzE;;;GAGG;AACH,eAAO,MAAM,+BAA+B;iDAGxB,GAAG;8CAKH,GAAG;CACb,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,+BAA+B;iDAZxB,GAAG;8CAKH,GAAG;CAOuD,CAAC;AAG/E,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { keccak256 } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* RoleConfigActionType enum matching Solidity RuntimeRBAC.RoleConfigActionType
|
|
4
|
+
*/
|
|
5
|
+
export var RoleConfigActionType;
|
|
6
|
+
(function (RoleConfigActionType) {
|
|
7
|
+
RoleConfigActionType[RoleConfigActionType["CREATE_ROLE"] = 0] = "CREATE_ROLE";
|
|
8
|
+
RoleConfigActionType[RoleConfigActionType["REMOVE_ROLE"] = 1] = "REMOVE_ROLE";
|
|
9
|
+
RoleConfigActionType[RoleConfigActionType["ADD_WALLET"] = 2] = "ADD_WALLET";
|
|
10
|
+
RoleConfigActionType[RoleConfigActionType["REVOKE_WALLET"] = 3] = "REVOKE_WALLET";
|
|
11
|
+
RoleConfigActionType[RoleConfigActionType["ADD_FUNCTION_TO_ROLE"] = 4] = "ADD_FUNCTION_TO_ROLE";
|
|
12
|
+
RoleConfigActionType[RoleConfigActionType["REMOVE_FUNCTION_FROM_ROLE"] = 5] = "REMOVE_FUNCTION_FROM_ROLE";
|
|
13
|
+
})(RoleConfigActionType || (RoleConfigActionType = {}));
|
|
14
|
+
/**
|
|
15
|
+
* Constants for RuntimeRBAC operation types
|
|
16
|
+
* These match the keccak256 hashes defined in RuntimeRBACDefinitions.sol
|
|
17
|
+
*/
|
|
18
|
+
export const RUNTIME_RBAC_OPERATION_TYPES = {
|
|
19
|
+
ROLE_CONFIG_BATCH: keccak256(new TextEncoder().encode("ROLE_CONFIG_BATCH"))
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Legacy export for backwards compatibility
|
|
23
|
+
* @deprecated Use RUNTIME_RBAC_OPERATION_TYPES instead
|
|
24
|
+
*/
|
|
25
|
+
export const DYNAMIC_RBAC_OPERATION_TYPES = RUNTIME_RBAC_OPERATION_TYPES;
|
|
26
|
+
/**
|
|
27
|
+
* Constants for RuntimeRBAC function selectors
|
|
28
|
+
* These match the selectors from RuntimeRBACDefinitions.sol
|
|
29
|
+
*/
|
|
30
|
+
export const RUNTIME_RBAC_FUNCTION_SELECTORS = {
|
|
31
|
+
ROLE_CONFIG_BATCH_EXECUTE_SELECTOR: keccak256(new TextEncoder().encode("executeRoleConfigBatch((uint8,bytes)[])")).slice(0, 10),
|
|
32
|
+
ROLE_CONFIG_BATCH_META_SELECTOR: keccak256(new TextEncoder().encode("roleConfigBatchRequestAndApprove(((uint256,uint256,uint8,(address,address,uint256,uint256,bytes32,uint8,bytes),bytes32,bytes,(address,uint256,address,uint256)),(uint256,uint256,address,bytes4,uint8,uint256,uint256,address),bytes32,bytes,bytes))")).slice(0, 10)
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Legacy export for backwards compatibility
|
|
36
|
+
* @deprecated Use RUNTIME_RBAC_FUNCTION_SELECTORS instead
|
|
37
|
+
*/
|
|
38
|
+
export const DYNAMIC_RBAC_FUNCTION_SELECTORS = RUNTIME_RBAC_FUNCTION_SELECTORS;
|
|
39
|
+
// Re-export SecureOwnable constants from core.security.index for convenience
|
|
40
|
+
export { OPERATION_TYPES, FUNCTION_SELECTORS } from './core.security.index';
|
|
41
|
+
//# sourceMappingURL=core.access.index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.access.index.js","sourceRoot":"","sources":["../../types/core.access.index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAO,MAAM,MAAM,CAAC;AAEtC;;GAEG;AACH,MAAM,CAAN,IAAY,oBAOX;AAPD,WAAY,oBAAoB;IAC9B,6EAAe,CAAA;IACf,6EAAe,CAAA;IACf,2EAAc,CAAA;IACd,iFAAiB,CAAA;IACjB,+FAAwB,CAAA;IACxB,yGAA6B,CAAA;AAC/B,CAAC,EAPW,oBAAoB,KAApB,oBAAoB,QAO/B;AAUD;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,iBAAiB,EAAE,SAAS,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;CACnE,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,4BAA4B,CAAC;AAEzE;;;GAGG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,kCAAkC,EAAE,SAAS,CAC3C,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,yCAAyC,CAAC,CACpE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAQ;IACrB,+BAA+B,EAAE,SAAS,CACxC,IAAI,WAAW,EAAE,CAAC,MAAM,CACtB,sPAAsP,CACvP,CACF,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAQ;CACb,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,+BAA+B,CAAC;AAE/E,6EAA6E;AAC7E,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Hex } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* Constants for GuardController operation types
|
|
4
|
+
* These match the keccak256 hashes defined in GuardControllerDefinitions.sol
|
|
5
|
+
*/
|
|
6
|
+
export declare const GUARD_CONTROLLER_OPERATION_TYPES: {
|
|
7
|
+
readonly CONTROLLER_OPERATION: `0x${string}`;
|
|
8
|
+
readonly NATIVE_TRANSFER: `0x${string}`;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Constants for GuardController function selectors
|
|
12
|
+
* These match the selectors from GuardControllerDefinitions.sol
|
|
13
|
+
*/
|
|
14
|
+
export declare const GUARD_CONTROLLER_FUNCTION_SELECTORS: {
|
|
15
|
+
readonly GUARD_CONFIG_BATCH_EXECUTE_SELECTOR: Hex;
|
|
16
|
+
readonly GUARD_CONFIG_BATCH_META_SELECTOR: Hex;
|
|
17
|
+
readonly REQUEST_AND_APPROVE_EXECUTION_SELECTOR: Hex;
|
|
18
|
+
readonly NATIVE_TRANSFER_SELECTOR: Hex;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* GuardConfigActionType enum matching Solidity GuardController.GuardConfigActionType
|
|
22
|
+
*/
|
|
23
|
+
export declare enum GuardConfigActionType {
|
|
24
|
+
ADD_TARGET_TO_WHITELIST = 0,
|
|
25
|
+
REMOVE_TARGET_FROM_WHITELIST = 1,
|
|
26
|
+
REGISTER_FUNCTION = 2,
|
|
27
|
+
UNREGISTER_FUNCTION = 3
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Type for GuardConfigAction struct
|
|
31
|
+
*/
|
|
32
|
+
export interface GuardConfigAction {
|
|
33
|
+
actionType: GuardConfigActionType;
|
|
34
|
+
data: Hex;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=core.execution.index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.execution.index.d.ts","sourceRoot":"","sources":["../../types/core.execution.index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,GAAG,EAAE,MAAM,MAAM,CAAC;AAEtC;;;GAGG;AACH,eAAO,MAAM,gCAAgC;;;CAGnC,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,mCAAmC;kDAG5B,GAAG;+CAKH,GAAG;qDAKH,GAAG;uCACqB,GAAG;CACrC,CAAC;AAEX;;GAEG;AACH,oBAAY,qBAAqB;IAC/B,uBAAuB,IAAI;IAC3B,4BAA4B,IAAI;IAChC,iBAAiB,IAAI;IACrB,mBAAmB,IAAI;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,qBAAqB,CAAC;IAClC,IAAI,EAAE,GAAG,CAAC;CACX"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { keccak256 } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* Constants for GuardController operation types
|
|
4
|
+
* These match the keccak256 hashes defined in GuardControllerDefinitions.sol
|
|
5
|
+
*/
|
|
6
|
+
export const GUARD_CONTROLLER_OPERATION_TYPES = {
|
|
7
|
+
CONTROLLER_OPERATION: keccak256(new TextEncoder().encode("CONTROLLER_OPERATION")),
|
|
8
|
+
NATIVE_TRANSFER: keccak256(new TextEncoder().encode("NATIVE_TRANSFER"))
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Constants for GuardController function selectors
|
|
12
|
+
* These match the selectors from GuardControllerDefinitions.sol
|
|
13
|
+
*/
|
|
14
|
+
export const GUARD_CONTROLLER_FUNCTION_SELECTORS = {
|
|
15
|
+
GUARD_CONFIG_BATCH_EXECUTE_SELECTOR: keccak256(new TextEncoder().encode("executeGuardConfigBatch((uint8,bytes)[])")).slice(0, 10),
|
|
16
|
+
GUARD_CONFIG_BATCH_META_SELECTOR: keccak256(new TextEncoder().encode("guardConfigBatchRequestAndApprove(((uint256,uint256,uint8,(address,address,uint256,uint256,bytes32,bytes4,bytes),bytes32,bytes,(address,uint256,address,uint256)),(uint256,uint256,address,bytes4,uint8,uint256,uint256,address),bytes32,bytes,bytes))")).slice(0, 10),
|
|
17
|
+
REQUEST_AND_APPROVE_EXECUTION_SELECTOR: keccak256(new TextEncoder().encode("requestAndApproveExecution(((uint256,uint256,uint8,(address,address,uint256,uint256,bytes32,bytes4,bytes),bytes32,bytes,(address,uint256,address,uint256)),(uint256,uint256,address,bytes4,uint8,uint256,uint256,address),bytes32,bytes,bytes))")).slice(0, 10),
|
|
18
|
+
NATIVE_TRANSFER_SELECTOR: "0xd8cb519d" // bytes4(keccak256("__bloxchain_native_transfer__()")) - matches EngineBlox.NATIVE_TRANSFER_SELECTOR
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* GuardConfigActionType enum matching Solidity GuardController.GuardConfigActionType
|
|
22
|
+
*/
|
|
23
|
+
export var GuardConfigActionType;
|
|
24
|
+
(function (GuardConfigActionType) {
|
|
25
|
+
GuardConfigActionType[GuardConfigActionType["ADD_TARGET_TO_WHITELIST"] = 0] = "ADD_TARGET_TO_WHITELIST";
|
|
26
|
+
GuardConfigActionType[GuardConfigActionType["REMOVE_TARGET_FROM_WHITELIST"] = 1] = "REMOVE_TARGET_FROM_WHITELIST";
|
|
27
|
+
GuardConfigActionType[GuardConfigActionType["REGISTER_FUNCTION"] = 2] = "REGISTER_FUNCTION";
|
|
28
|
+
GuardConfigActionType[GuardConfigActionType["UNREGISTER_FUNCTION"] = 3] = "UNREGISTER_FUNCTION";
|
|
29
|
+
})(GuardConfigActionType || (GuardConfigActionType = {}));
|
|
30
|
+
//# sourceMappingURL=core.execution.index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.execution.index.js","sourceRoot":"","sources":["../../types/core.execution.index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAO,MAAM,MAAM,CAAC;AAEtC;;;GAGG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG;IAC9C,oBAAoB,EAAE,SAAS,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC;IACjF,eAAe,EAAE,SAAS,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;CAC/D,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG;IACjD,mCAAmC,EAAE,SAAS,CAC5C,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,0CAA0C,CAAC,CACrE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAQ;IACrB,gCAAgC,EAAE,SAAS,CACzC,IAAI,WAAW,EAAE,CAAC,MAAM,CACtB,wPAAwP,CACzP,CACF,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAQ;IACrB,sCAAsC,EAAE,SAAS,CAC/C,IAAI,WAAW,EAAE,CAAC,MAAM,CACtB,iPAAiP,CAClP,CACF,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAQ;IACrB,wBAAwB,EAAE,YAAmB,CAAC,qGAAqG;CAC3I,CAAC;AAEX;;GAEG;AACH,MAAM,CAAN,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC/B,uGAA2B,CAAA;IAC3B,iHAAgC,CAAA;IAChC,2FAAqB,CAAA;IACrB,+FAAuB,CAAA;AACzB,CAAC,EALW,qBAAqB,KAArB,qBAAqB,QAKhC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Hex } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* Constants for SecureOwnable operations
|
|
4
|
+
* These match the keccak256 hashes defined in SecureOwnableDefinitions.sol
|
|
5
|
+
*/
|
|
6
|
+
export declare const OPERATION_TYPES: {
|
|
7
|
+
readonly OWNERSHIP_TRANSFER: `0x${string}`;
|
|
8
|
+
readonly BROADCASTER_UPDATE: `0x${string}`;
|
|
9
|
+
readonly RECOVERY_UPDATE: `0x${string}`;
|
|
10
|
+
readonly TIMELOCK_UPDATE: `0x${string}`;
|
|
11
|
+
};
|
|
12
|
+
export type OperationType = typeof OPERATION_TYPES[keyof typeof OPERATION_TYPES];
|
|
13
|
+
/**
|
|
14
|
+
* Constants for function selectors
|
|
15
|
+
* These match the selectors from SecureOwnableDefinitions.sol
|
|
16
|
+
*/
|
|
17
|
+
export declare const FUNCTION_SELECTORS: {
|
|
18
|
+
readonly TRANSFER_OWNERSHIP_SELECTOR: Hex;
|
|
19
|
+
readonly UPDATE_BROADCASTER_SELECTOR: Hex;
|
|
20
|
+
readonly UPDATE_RECOVERY_SELECTOR: Hex;
|
|
21
|
+
readonly UPDATE_TIMELOCK_SELECTOR: Hex;
|
|
22
|
+
readonly TRANSFER_OWNERSHIP_REQUEST_SELECTOR: Hex;
|
|
23
|
+
readonly TRANSFER_OWNERSHIP_DELAYED_APPROVAL_SELECTOR: Hex;
|
|
24
|
+
readonly TRANSFER_OWNERSHIP_CANCELLATION_SELECTOR: Hex;
|
|
25
|
+
readonly UPDATE_BROADCASTER_REQUEST_SELECTOR: Hex;
|
|
26
|
+
readonly UPDATE_BROADCASTER_DELAYED_APPROVAL_SELECTOR: Hex;
|
|
27
|
+
readonly UPDATE_BROADCASTER_CANCELLATION_SELECTOR: Hex;
|
|
28
|
+
readonly TRANSFER_OWNERSHIP_APPROVE_META_SELECTOR: Hex;
|
|
29
|
+
readonly TRANSFER_OWNERSHIP_CANCEL_META_SELECTOR: Hex;
|
|
30
|
+
readonly UPDATE_BROADCASTER_APPROVE_META_SELECTOR: Hex;
|
|
31
|
+
readonly UPDATE_BROADCASTER_CANCEL_META_SELECTOR: Hex;
|
|
32
|
+
readonly UPDATE_RECOVERY_META_SELECTOR: Hex;
|
|
33
|
+
readonly UPDATE_TIMELOCK_META_SELECTOR: Hex;
|
|
34
|
+
};
|
|
35
|
+
export type FunctionSelector = typeof FUNCTION_SELECTORS[keyof typeof FUNCTION_SELECTORS];
|
|
36
|
+
//# sourceMappingURL=core.security.index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.security.index.d.ts","sourceRoot":"","sources":["../../types/core.security.index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,GAAG,EAAE,MAAM,MAAM,CAAC;AAGtC;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;CAKlB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,OAAO,eAAe,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAEjF;;;GAGG;AACH,eAAO,MAAM,kBAAkB;0CAEyF,GAAG;0CACH,GAAG;uCACT,GAAG;uCACH,GAAG;kDAGI,GAAG;2DACqB,GAAG;uDACV,GAAG;kDACb,GAAG;2DACc,GAAG;uDACV,GAAG;uDAG+M,GAAG;sDACA,GAAG;uDACN,GAAG;sDACA,GAAG;4CACrB,GAAG;4CACH,GAAG;CACtU,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,OAAO,kBAAkB,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC"}
|