@invariance/sdk 0.0.1
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/LICENSE +21 -0
- package/README.md +274 -0
- package/dist/abis-F52VBHAX.js +30 -0
- package/dist/abis-F52VBHAX.js.map +1 -0
- package/dist/chunk-3ONNY6AX.js +849 -0
- package/dist/chunk-3ONNY6AX.js.map +1 -0
- package/dist/chunk-GHYGRZHM.js +7485 -0
- package/dist/chunk-GHYGRZHM.js.map +1 -0
- package/dist/chunk-VUNV25KB.js +16 -0
- package/dist/chunk-VUNV25KB.js.map +1 -0
- package/dist/contract-helpers-XI4NOQLS.js +73 -0
- package/dist/contract-helpers-XI4NOQLS.js.map +1 -0
- package/dist/index.cjs +19028 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +4735 -0
- package/dist/index.d.ts +4735 -0
- package/dist/index.js +10135 -0
- package/dist/index.js.map +1 -0
- package/dist/main-I6AWLQD7.js +364 -0
- package/dist/main-I6AWLQD7.js.map +1 -0
- package/package.json +95 -0
|
@@ -0,0 +1,849 @@
|
|
|
1
|
+
import {
|
|
2
|
+
InvarianceAtomicVerifierAbi,
|
|
3
|
+
InvarianceCompactLedgerAbi,
|
|
4
|
+
InvarianceIntentAbi,
|
|
5
|
+
InvarianceLedgerAbi,
|
|
6
|
+
InvarianceRegistryAbi,
|
|
7
|
+
InvarianceReviewAbi
|
|
8
|
+
} from "./chunk-GHYGRZHM.js";
|
|
9
|
+
|
|
10
|
+
// src/utils/contract-helpers.ts
|
|
11
|
+
import { keccak256, toHex, decodeEventLog, stringToHex, hexToString } from "viem";
|
|
12
|
+
|
|
13
|
+
// ../packages/common/dist/index.js
|
|
14
|
+
var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => {
|
|
15
|
+
ErrorCode2["IDENTITY_NOT_FOUND"] = "IDENTITY_NOT_FOUND";
|
|
16
|
+
ErrorCode2["IDENTITY_SUSPENDED"] = "IDENTITY_SUSPENDED";
|
|
17
|
+
ErrorCode2["INVALID_ACTOR_TYPE"] = "INVALID_ACTOR_TYPE";
|
|
18
|
+
ErrorCode2["WALLET_NOT_CONNECTED"] = "WALLET_NOT_CONNECTED";
|
|
19
|
+
ErrorCode2["INSUFFICIENT_BALANCE"] = "INSUFFICIENT_BALANCE";
|
|
20
|
+
ErrorCode2["INTENT_REJECTED"] = "INTENT_REJECTED";
|
|
21
|
+
ErrorCode2["INTENT_EXPIRED"] = "INTENT_EXPIRED";
|
|
22
|
+
ErrorCode2["APPROVAL_TIMEOUT"] = "APPROVAL_TIMEOUT";
|
|
23
|
+
ErrorCode2["POLICY_VIOLATION"] = "POLICY_VIOLATION";
|
|
24
|
+
ErrorCode2["BUDGET_EXCEEDED"] = "BUDGET_EXCEEDED";
|
|
25
|
+
ErrorCode2["ACTION_NOT_ALLOWED"] = "ACTION_NOT_ALLOWED";
|
|
26
|
+
ErrorCode2["TARGET_BLOCKED"] = "TARGET_BLOCKED";
|
|
27
|
+
ErrorCode2["COOLDOWN_ACTIVE"] = "COOLDOWN_ACTIVE";
|
|
28
|
+
ErrorCode2["RATE_LIMITED"] = "RATE_LIMITED";
|
|
29
|
+
ErrorCode2["STATE_GATE_FAILED"] = "STATE_GATE_FAILED";
|
|
30
|
+
ErrorCode2["ATTESTATION_REQUIRED"] = "ATTESTATION_REQUIRED";
|
|
31
|
+
ErrorCode2["ESCROW_NOT_FOUND"] = "ESCROW_NOT_FOUND";
|
|
32
|
+
ErrorCode2["ESCROW_WRONG_STATE"] = "ESCROW_WRONG_STATE";
|
|
33
|
+
ErrorCode2["NOT_AUTHORIZED_SIGNER"] = "NOT_AUTHORIZED_SIGNER";
|
|
34
|
+
ErrorCode2["NO_ESCROW_FOR_REVIEW"] = "NO_ESCROW_FOR_REVIEW";
|
|
35
|
+
ErrorCode2["ALREADY_REVIEWED"] = "ALREADY_REVIEWED";
|
|
36
|
+
ErrorCode2["NETWORK_ERROR"] = "NETWORK_ERROR";
|
|
37
|
+
ErrorCode2["TX_REVERTED"] = "TX_REVERTED";
|
|
38
|
+
ErrorCode2["VERIFICATION_FAILED"] = "VERIFICATION_FAILED";
|
|
39
|
+
ErrorCode2["PAYMENT_REQUIRED"] = "PAYMENT_REQUIRED";
|
|
40
|
+
ErrorCode2["PAYMENT_FAILED"] = "PAYMENT_FAILED";
|
|
41
|
+
ErrorCode2["PAYMENT_VERIFICATION_FAILED"] = "PAYMENT_VERIFICATION_FAILED";
|
|
42
|
+
ErrorCode2["ERC8004_NOT_DEPLOYED"] = "ERC8004_NOT_DEPLOYED";
|
|
43
|
+
ErrorCode2["ERC8004_AGENT_NOT_FOUND"] = "ERC8004_AGENT_NOT_FOUND";
|
|
44
|
+
ErrorCode2["NOT_IMPLEMENTED"] = "NOT_IMPLEMENTED";
|
|
45
|
+
ErrorCode2["INVALID_INPUT"] = "INVALID_INPUT";
|
|
46
|
+
return ErrorCode2;
|
|
47
|
+
})(ErrorCode || {});
|
|
48
|
+
var BASE_MAINNET = {
|
|
49
|
+
id: 8453,
|
|
50
|
+
name: "Base",
|
|
51
|
+
rpcUrl: "https://mainnet.base.org",
|
|
52
|
+
explorerUrl: "https://basescan.org",
|
|
53
|
+
testnet: false,
|
|
54
|
+
pollingInterval: 2e3
|
|
55
|
+
};
|
|
56
|
+
var BASE_SEPOLIA = {
|
|
57
|
+
id: 84532,
|
|
58
|
+
name: "Base Sepolia",
|
|
59
|
+
rpcUrl: "https://sepolia.base.org",
|
|
60
|
+
explorerUrl: "https://sepolia.basescan.org",
|
|
61
|
+
testnet: true,
|
|
62
|
+
pollingInterval: 2e3
|
|
63
|
+
};
|
|
64
|
+
var SUPPORTED_CHAINS = {
|
|
65
|
+
[BASE_MAINNET.id]: BASE_MAINNET,
|
|
66
|
+
[BASE_SEPOLIA.id]: BASE_SEPOLIA
|
|
67
|
+
};
|
|
68
|
+
function getChainConfig(chainId) {
|
|
69
|
+
return SUPPORTED_CHAINS[chainId];
|
|
70
|
+
}
|
|
71
|
+
var BASE_MAINNET_CONTRACTS = {
|
|
72
|
+
identity: "0x0000000000000000000000000000000000000000",
|
|
73
|
+
intent: "0x0000000000000000000000000000000000000000",
|
|
74
|
+
policy: "0x0000000000000000000000000000000000000000",
|
|
75
|
+
escrow: "0x0000000000000000000000000000000000000000",
|
|
76
|
+
ledger: "0x0000000000000000000000000000000000000000",
|
|
77
|
+
review: "0x0000000000000000000000000000000000000000",
|
|
78
|
+
registry: "0x0000000000000000000000000000000000000000"
|
|
79
|
+
};
|
|
80
|
+
var BASE_SEPOLIA_CONTRACTS = {
|
|
81
|
+
identity: "0x98082761AC9ef71f5D2FD0D81Fa68DDe0a5f549d",
|
|
82
|
+
intent: "0xBd6f5e95C18Bb7E913d56fdFa7a9e9b726Cf5F1D",
|
|
83
|
+
policy: "0x476b03fa71f65D34AE95Cbd5E8c6833Fe5a0b7d9",
|
|
84
|
+
escrow: "0x72E55D252385E761C1DEf0b705D3a6e7b341bbF6",
|
|
85
|
+
ledger: "0xf9eeCe4534e43B8683d035D847EB80cf1d2591Bf",
|
|
86
|
+
review: "0xB8A7246CAA56764c4b6ef18dc72379Cfc03505D3",
|
|
87
|
+
registry: "0xd5Ea9F94B51B8aDb441d74450066173863509043",
|
|
88
|
+
usdc: "0x036CbD53842c5426634e7929541eC2318f3dCF7e"
|
|
89
|
+
};
|
|
90
|
+
var CONTRACT_ADDRESSES = {
|
|
91
|
+
8453: BASE_MAINNET_CONTRACTS,
|
|
92
|
+
84532: BASE_SEPOLIA_CONTRACTS
|
|
93
|
+
};
|
|
94
|
+
function getContractAddresses(chainId) {
|
|
95
|
+
return CONTRACT_ADDRESSES[chainId];
|
|
96
|
+
}
|
|
97
|
+
var MAX_UINT256 = BigInt(
|
|
98
|
+
"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
// src/errors/InvarianceError.ts
|
|
102
|
+
var InvarianceError = class _InvarianceError extends Error {
|
|
103
|
+
/** Structured error code for programmatic handling */
|
|
104
|
+
code;
|
|
105
|
+
/** Public explorer URL relevant to the error context */
|
|
106
|
+
explorerUrl;
|
|
107
|
+
/** On-chain transaction hash related to the error */
|
|
108
|
+
txHash;
|
|
109
|
+
constructor(code, message, opts) {
|
|
110
|
+
super(message);
|
|
111
|
+
this.name = "InvarianceError";
|
|
112
|
+
this.code = code;
|
|
113
|
+
this.explorerUrl = opts?.explorerUrl;
|
|
114
|
+
this.txHash = opts?.txHash;
|
|
115
|
+
if (Error.captureStackTrace) {
|
|
116
|
+
Error.captureStackTrace(this, _InvarianceError);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
// src/utils/contract-helpers.ts
|
|
122
|
+
var ACTOR_TYPE_MAP = {
|
|
123
|
+
agent: 0,
|
|
124
|
+
human: 1,
|
|
125
|
+
device: 2,
|
|
126
|
+
service: 3,
|
|
127
|
+
any: 255
|
|
128
|
+
};
|
|
129
|
+
var REVERSE_ACTOR_TYPE_MAP = {
|
|
130
|
+
0: "agent",
|
|
131
|
+
1: "human",
|
|
132
|
+
2: "device",
|
|
133
|
+
3: "service"
|
|
134
|
+
};
|
|
135
|
+
var IDENTITY_STATUS_MAP = {
|
|
136
|
+
0: "active",
|
|
137
|
+
1: "suspended",
|
|
138
|
+
2: "deactivated"
|
|
139
|
+
};
|
|
140
|
+
function actorTypeToEnum(type) {
|
|
141
|
+
const val = ACTOR_TYPE_MAP[type];
|
|
142
|
+
if (val === void 0) {
|
|
143
|
+
throw new InvarianceError(
|
|
144
|
+
ErrorCode.INVALID_ACTOR_TYPE,
|
|
145
|
+
`Unknown actor type: ${type}`
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
return val;
|
|
149
|
+
}
|
|
150
|
+
function enumToActorType(val) {
|
|
151
|
+
const type = REVERSE_ACTOR_TYPE_MAP[val];
|
|
152
|
+
if (!type) {
|
|
153
|
+
throw new InvarianceError(
|
|
154
|
+
ErrorCode.INVALID_ACTOR_TYPE,
|
|
155
|
+
`Unknown on-chain actor type enum: ${val}`
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
return type;
|
|
159
|
+
}
|
|
160
|
+
function identityStatusFromEnum(val) {
|
|
161
|
+
const status = IDENTITY_STATUS_MAP[val];
|
|
162
|
+
if (!status) {
|
|
163
|
+
throw new InvarianceError(
|
|
164
|
+
ErrorCode.INVALID_INPUT,
|
|
165
|
+
`Unknown on-chain identity status enum: ${val}`
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
return status;
|
|
169
|
+
}
|
|
170
|
+
function toBytes32(id) {
|
|
171
|
+
if (id.startsWith("0x") && id.length === 66) {
|
|
172
|
+
return id;
|
|
173
|
+
}
|
|
174
|
+
if (id.startsWith("0x") && /^0x[0-9a-fA-F]+$/.test(id)) {
|
|
175
|
+
const hexPart = id.slice(2);
|
|
176
|
+
if (hexPart.length > 64) {
|
|
177
|
+
throw new InvarianceError(
|
|
178
|
+
ErrorCode.INVALID_INPUT,
|
|
179
|
+
`Hex ID exceeds 32 bytes: "${id}". Use a shorter identifier or hash it first.`
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
return `0x${hexPart.padStart(64, "0")}`;
|
|
183
|
+
}
|
|
184
|
+
const hex = stringToHex(id);
|
|
185
|
+
const hexBody = hex.slice(2);
|
|
186
|
+
if (hexBody.length > 64) {
|
|
187
|
+
throw new InvarianceError(
|
|
188
|
+
ErrorCode.INVALID_INPUT,
|
|
189
|
+
`ID exceeds 32 bytes: "${id}" (${hexBody.length / 2} bytes). Use a shorter identifier or hash it first.`
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
return `0x${hexBody.padEnd(64, "0")}`;
|
|
193
|
+
}
|
|
194
|
+
function fromBytes32(bytes) {
|
|
195
|
+
const hex = bytes.slice(2);
|
|
196
|
+
const trimmed = hex.replace(/(00)+$/, "");
|
|
197
|
+
if (trimmed.length === 0) return "";
|
|
198
|
+
let decoded;
|
|
199
|
+
try {
|
|
200
|
+
decoded = hexToString(`0x${trimmed}`);
|
|
201
|
+
} catch {
|
|
202
|
+
console.warn(`[Invariance] fromBytes32: failed to decode hex as UTF-8 string, returning raw hex: ${bytes}`);
|
|
203
|
+
return bytes;
|
|
204
|
+
}
|
|
205
|
+
const reencoded = stringToHex(decoded).slice(2);
|
|
206
|
+
if (/[\uFFFD]/.test(decoded) || reencoded.toLowerCase() !== trimmed.toLowerCase()) {
|
|
207
|
+
console.warn(`[Invariance] fromBytes32: round-trip decode mismatch, returning raw hex: ${bytes}`);
|
|
208
|
+
return bytes;
|
|
209
|
+
}
|
|
210
|
+
return decoded;
|
|
211
|
+
}
|
|
212
|
+
async function waitForReceipt(publicClient, txHash, options) {
|
|
213
|
+
if (options?.optimistic) {
|
|
214
|
+
return {
|
|
215
|
+
txHash,
|
|
216
|
+
blockNumber: 0,
|
|
217
|
+
gasUsed: "0",
|
|
218
|
+
status: "success",
|
|
219
|
+
logs: []
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
const receipt = await publicClient.waitForTransactionReceipt({
|
|
223
|
+
hash: txHash,
|
|
224
|
+
timeout: options?.timeout ?? 3e4,
|
|
225
|
+
confirmations: 1
|
|
226
|
+
});
|
|
227
|
+
const result = {
|
|
228
|
+
txHash: receipt.transactionHash,
|
|
229
|
+
blockNumber: Number(receipt.blockNumber),
|
|
230
|
+
gasUsed: receipt.gasUsed.toString(),
|
|
231
|
+
status: receipt.status,
|
|
232
|
+
logs: receipt.logs.map((log) => ({
|
|
233
|
+
topics: log.topics,
|
|
234
|
+
data: log.data
|
|
235
|
+
}))
|
|
236
|
+
};
|
|
237
|
+
if (receipt.status === "reverted") {
|
|
238
|
+
throw new InvarianceError(
|
|
239
|
+
ErrorCode.TX_REVERTED,
|
|
240
|
+
`Transaction reverted: ${txHash}`,
|
|
241
|
+
{ txHash }
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
return result;
|
|
245
|
+
}
|
|
246
|
+
var POLICY_STATE_MAP = {
|
|
247
|
+
0: "active",
|
|
248
|
+
1: "revoked",
|
|
249
|
+
2: "expired"
|
|
250
|
+
};
|
|
251
|
+
var POLICY_RULE_TYPE_MAP = {
|
|
252
|
+
"max-spend": 0,
|
|
253
|
+
"max-per-tx": 1,
|
|
254
|
+
"daily-limit": 2,
|
|
255
|
+
"action-whitelist": 3,
|
|
256
|
+
"action-blacklist": 4,
|
|
257
|
+
"target-whitelist": 5,
|
|
258
|
+
"target-blacklist": 6,
|
|
259
|
+
"time-window": 7,
|
|
260
|
+
"cooldown": 8,
|
|
261
|
+
"rate-limit": 9,
|
|
262
|
+
"require-state": 10,
|
|
263
|
+
"require-balance": 11,
|
|
264
|
+
"require-approval": 12,
|
|
265
|
+
"require-attestation": 13,
|
|
266
|
+
// Off-chain only: encoded as Custom on-chain
|
|
267
|
+
"require-payment": 14,
|
|
268
|
+
"custom": 14
|
|
269
|
+
};
|
|
270
|
+
var REVERSE_POLICY_RULE_TYPE_MAP = {
|
|
271
|
+
0: "max-spend",
|
|
272
|
+
1: "max-per-tx",
|
|
273
|
+
2: "daily-limit",
|
|
274
|
+
3: "action-whitelist",
|
|
275
|
+
4: "action-blacklist",
|
|
276
|
+
5: "target-whitelist",
|
|
277
|
+
6: "target-blacklist",
|
|
278
|
+
7: "time-window",
|
|
279
|
+
8: "cooldown",
|
|
280
|
+
9: "rate-limit",
|
|
281
|
+
10: "require-state",
|
|
282
|
+
11: "require-balance",
|
|
283
|
+
12: "require-approval",
|
|
284
|
+
13: "require-attestation",
|
|
285
|
+
14: "custom"
|
|
286
|
+
};
|
|
287
|
+
function policyRuleTypeToEnum(type) {
|
|
288
|
+
const val = POLICY_RULE_TYPE_MAP[type];
|
|
289
|
+
if (val === void 0) {
|
|
290
|
+
throw new InvarianceError(
|
|
291
|
+
ErrorCode.INVALID_INPUT,
|
|
292
|
+
`Unknown policy rule type: ${type}`
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
return val;
|
|
296
|
+
}
|
|
297
|
+
function enumToPolicyRuleType(val) {
|
|
298
|
+
const type = REVERSE_POLICY_RULE_TYPE_MAP[val];
|
|
299
|
+
if (!type) {
|
|
300
|
+
throw new InvarianceError(
|
|
301
|
+
ErrorCode.INVALID_INPUT,
|
|
302
|
+
`Unknown on-chain policy rule type enum: ${val}`
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
return type;
|
|
306
|
+
}
|
|
307
|
+
function policyStateFromEnum(val) {
|
|
308
|
+
const state = POLICY_STATE_MAP[val];
|
|
309
|
+
if (!state) {
|
|
310
|
+
throw new InvarianceError(
|
|
311
|
+
ErrorCode.INVALID_INPUT,
|
|
312
|
+
`Unknown on-chain policy state enum: ${val}`
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
return state;
|
|
316
|
+
}
|
|
317
|
+
function mapActorTypesToEnums(types) {
|
|
318
|
+
return types.map(actorTypeToEnum);
|
|
319
|
+
}
|
|
320
|
+
var ESCROW_STATE_MAP = {
|
|
321
|
+
0: "created",
|
|
322
|
+
1: "funded",
|
|
323
|
+
2: "active",
|
|
324
|
+
3: "released",
|
|
325
|
+
4: "refunded",
|
|
326
|
+
5: "disputed",
|
|
327
|
+
6: "resolved"
|
|
328
|
+
};
|
|
329
|
+
var ESCROW_CONDITION_TYPE_MAP = {
|
|
330
|
+
"task-completion": 0,
|
|
331
|
+
"multi-sig": 1,
|
|
332
|
+
"intent-verified": 2,
|
|
333
|
+
"milestone": 3
|
|
334
|
+
};
|
|
335
|
+
var REVERSE_ESCROW_CONDITION_TYPE_MAP = {
|
|
336
|
+
0: "task-completion",
|
|
337
|
+
1: "multi-sig",
|
|
338
|
+
2: "intent-verified",
|
|
339
|
+
3: "milestone"
|
|
340
|
+
};
|
|
341
|
+
function escrowConditionTypeToEnum(type) {
|
|
342
|
+
const val = ESCROW_CONDITION_TYPE_MAP[type];
|
|
343
|
+
if (val === void 0) {
|
|
344
|
+
throw new InvarianceError(
|
|
345
|
+
ErrorCode.INVALID_INPUT,
|
|
346
|
+
`Unknown escrow condition type: ${type}`
|
|
347
|
+
);
|
|
348
|
+
}
|
|
349
|
+
return val;
|
|
350
|
+
}
|
|
351
|
+
function enumToEscrowConditionType(val) {
|
|
352
|
+
const type = REVERSE_ESCROW_CONDITION_TYPE_MAP[val];
|
|
353
|
+
if (!type) {
|
|
354
|
+
throw new InvarianceError(
|
|
355
|
+
ErrorCode.INVALID_INPUT,
|
|
356
|
+
`Unknown on-chain escrow condition type enum: ${val}`
|
|
357
|
+
);
|
|
358
|
+
}
|
|
359
|
+
return type;
|
|
360
|
+
}
|
|
361
|
+
function escrowStateFromEnum(val) {
|
|
362
|
+
const state = ESCROW_STATE_MAP[val];
|
|
363
|
+
if (state === void 0) {
|
|
364
|
+
throw new InvarianceError(
|
|
365
|
+
ErrorCode.ESCROW_NOT_FOUND,
|
|
366
|
+
`Unknown on-chain escrow state enum: ${val}`
|
|
367
|
+
);
|
|
368
|
+
}
|
|
369
|
+
return state;
|
|
370
|
+
}
|
|
371
|
+
var CONTRACT_ERROR_MAP = {
|
|
372
|
+
IdentityNotFound: ErrorCode.IDENTITY_NOT_FOUND,
|
|
373
|
+
NotIdentityOwner: ErrorCode.NOT_AUTHORIZED_SIGNER,
|
|
374
|
+
AddressAlreadyRegistered: ErrorCode.INVALID_INPUT,
|
|
375
|
+
IdentityNotActive: ErrorCode.IDENTITY_SUSPENDED,
|
|
376
|
+
IdentityAlreadyDeactivated: ErrorCode.IDENTITY_SUSPENDED,
|
|
377
|
+
IdentityNotSuspended: ErrorCode.IDENTITY_NOT_FOUND,
|
|
378
|
+
InvalidAddress: ErrorCode.INVALID_INPUT,
|
|
379
|
+
AttestationNotFound: ErrorCode.IDENTITY_NOT_FOUND,
|
|
380
|
+
AttestationAlreadyRevoked: ErrorCode.IDENTITY_NOT_FOUND,
|
|
381
|
+
NotAttester: ErrorCode.NOT_AUTHORIZED_SIGNER,
|
|
382
|
+
AccessControlUnauthorizedAccount: ErrorCode.NOT_AUTHORIZED_SIGNER,
|
|
383
|
+
// Escrow-specific errors
|
|
384
|
+
EscrowNotFound: ErrorCode.ESCROW_NOT_FOUND,
|
|
385
|
+
InvalidAmount: ErrorCode.INVALID_INPUT,
|
|
386
|
+
InvalidBeneficiary: ErrorCode.INVALID_INPUT,
|
|
387
|
+
NotDepositor: ErrorCode.NOT_AUTHORIZED_SIGNER,
|
|
388
|
+
NotBeneficiary: ErrorCode.NOT_AUTHORIZED_SIGNER,
|
|
389
|
+
NotParty: ErrorCode.NOT_AUTHORIZED_SIGNER,
|
|
390
|
+
InvalidState: ErrorCode.ESCROW_WRONG_STATE,
|
|
391
|
+
AlreadyFunded: ErrorCode.ESCROW_WRONG_STATE,
|
|
392
|
+
NotFunded: ErrorCode.ESCROW_WRONG_STATE,
|
|
393
|
+
AlreadyApproved: ErrorCode.ESCROW_WRONG_STATE,
|
|
394
|
+
NotSigner: ErrorCode.NOT_AUTHORIZED_SIGNER,
|
|
395
|
+
ThresholdNotMet: ErrorCode.ESCROW_WRONG_STATE,
|
|
396
|
+
EscrowExpired: ErrorCode.ESCROW_WRONG_STATE,
|
|
397
|
+
DisputeAlreadyExists: ErrorCode.ESCROW_WRONG_STATE,
|
|
398
|
+
DisputeNotFound: ErrorCode.ESCROW_NOT_FOUND,
|
|
399
|
+
DisputeAlreadyResolved: ErrorCode.ESCROW_WRONG_STATE,
|
|
400
|
+
// Policy-specific errors
|
|
401
|
+
PolicyNotFound: ErrorCode.POLICY_VIOLATION,
|
|
402
|
+
PolicyNotActive: ErrorCode.POLICY_VIOLATION,
|
|
403
|
+
PolicyAlreadyAttached: ErrorCode.POLICY_VIOLATION,
|
|
404
|
+
PolicyNotAttached: ErrorCode.POLICY_VIOLATION,
|
|
405
|
+
NotPolicyCreator: ErrorCode.NOT_AUTHORIZED_SIGNER,
|
|
406
|
+
NoRulesProvided: ErrorCode.POLICY_VIOLATION,
|
|
407
|
+
InvalidExpiresAt: ErrorCode.POLICY_VIOLATION,
|
|
408
|
+
// Intent-specific errors
|
|
409
|
+
IntentNotFound: ErrorCode.INVALID_INPUT,
|
|
410
|
+
IntentNotPending: ErrorCode.INTENT_REJECTED,
|
|
411
|
+
IntentNotApproved: ErrorCode.INTENT_REJECTED,
|
|
412
|
+
IntentNotExecuting: ErrorCode.INTENT_REJECTED,
|
|
413
|
+
IntentExpiredError: ErrorCode.INTENT_EXPIRED,
|
|
414
|
+
NotRequester: ErrorCode.NOT_AUTHORIZED_SIGNER,
|
|
415
|
+
PolicyDenied: ErrorCode.POLICY_VIOLATION,
|
|
416
|
+
InvalidExpiration: ErrorCode.INVALID_INPUT,
|
|
417
|
+
// Registry-specific errors
|
|
418
|
+
ListingNotFound: ErrorCode.INVALID_INPUT,
|
|
419
|
+
NotListingOwner: ErrorCode.NOT_AUTHORIZED_SIGNER,
|
|
420
|
+
ListingAlreadyInactive: ErrorCode.INVALID_INPUT,
|
|
421
|
+
EmptyName: ErrorCode.INVALID_INPUT,
|
|
422
|
+
// Review-specific errors
|
|
423
|
+
ReviewNotFound: ErrorCode.INVALID_INPUT,
|
|
424
|
+
EscrowNotCompleted: ErrorCode.ESCROW_WRONG_STATE,
|
|
425
|
+
NotEscrowParty: ErrorCode.NOT_AUTHORIZED_SIGNER,
|
|
426
|
+
AlreadyReviewed: ErrorCode.ALREADY_REVIEWED
|
|
427
|
+
};
|
|
428
|
+
function mapContractError(error) {
|
|
429
|
+
if (error instanceof InvarianceError) {
|
|
430
|
+
return error;
|
|
431
|
+
}
|
|
432
|
+
if (error !== null && typeof error === "object" && "name" in error && error.name === "ContractFunctionRevertedError") {
|
|
433
|
+
const revertError = error;
|
|
434
|
+
const errorName = revertError.data?.errorName;
|
|
435
|
+
if (errorName && errorName in CONTRACT_ERROR_MAP) {
|
|
436
|
+
const mapped3 = new InvarianceError(CONTRACT_ERROR_MAP[errorName], errorName);
|
|
437
|
+
mapped3.cause = error;
|
|
438
|
+
return mapped3;
|
|
439
|
+
}
|
|
440
|
+
const mapped2 = new InvarianceError(ErrorCode.TX_REVERTED, revertError.message);
|
|
441
|
+
mapped2.cause = error;
|
|
442
|
+
return mapped2;
|
|
443
|
+
}
|
|
444
|
+
const message = error instanceof Error ? error.message : "Unknown contract error";
|
|
445
|
+
const mapped = new InvarianceError(ErrorCode.NETWORK_ERROR, message);
|
|
446
|
+
mapped.cause = error;
|
|
447
|
+
return mapped;
|
|
448
|
+
}
|
|
449
|
+
var INTENT_STATUS_MAP = {
|
|
450
|
+
0: "pending",
|
|
451
|
+
1: "approved",
|
|
452
|
+
2: "executing",
|
|
453
|
+
3: "completed",
|
|
454
|
+
4: "rejected",
|
|
455
|
+
5: "expired"
|
|
456
|
+
};
|
|
457
|
+
function intentStatusFromEnum(val) {
|
|
458
|
+
const status = INTENT_STATUS_MAP[val];
|
|
459
|
+
if (!status) {
|
|
460
|
+
throw new InvarianceError(
|
|
461
|
+
ErrorCode.INVALID_INPUT,
|
|
462
|
+
`Unknown on-chain intent status enum: ${val}`
|
|
463
|
+
);
|
|
464
|
+
}
|
|
465
|
+
return status;
|
|
466
|
+
}
|
|
467
|
+
function parseIntentIdFromLogs(logs) {
|
|
468
|
+
for (const log of logs) {
|
|
469
|
+
try {
|
|
470
|
+
const decoded = decodeEventLog({
|
|
471
|
+
abi: InvarianceIntentAbi,
|
|
472
|
+
data: log.data,
|
|
473
|
+
topics: log.topics
|
|
474
|
+
});
|
|
475
|
+
if (decoded.eventName === "IntentRequested") {
|
|
476
|
+
return decoded.args.intentId;
|
|
477
|
+
}
|
|
478
|
+
} catch {
|
|
479
|
+
continue;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
throw new InvarianceError(
|
|
483
|
+
ErrorCode.TX_REVERTED,
|
|
484
|
+
"IntentRequested event not found in transaction logs"
|
|
485
|
+
);
|
|
486
|
+
}
|
|
487
|
+
function hashMetadata(metadata) {
|
|
488
|
+
const json = JSON.stringify(metadata);
|
|
489
|
+
return keccak256(toHex(json));
|
|
490
|
+
}
|
|
491
|
+
var SEVERITY_MAP = {
|
|
492
|
+
info: 0,
|
|
493
|
+
warn: 1,
|
|
494
|
+
error: 2
|
|
495
|
+
};
|
|
496
|
+
function mapSeverity(severity) {
|
|
497
|
+
return SEVERITY_MAP[severity];
|
|
498
|
+
}
|
|
499
|
+
function parseEntryIdFromLogs(logs) {
|
|
500
|
+
for (const log of logs) {
|
|
501
|
+
try {
|
|
502
|
+
const decoded = decodeEventLog({
|
|
503
|
+
abi: InvarianceLedgerAbi,
|
|
504
|
+
data: log.data,
|
|
505
|
+
topics: log.topics
|
|
506
|
+
});
|
|
507
|
+
if (decoded.eventName === "EntryLogged") {
|
|
508
|
+
return decoded.args.entryId;
|
|
509
|
+
}
|
|
510
|
+
} catch {
|
|
511
|
+
continue;
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
throw new InvarianceError(
|
|
515
|
+
ErrorCode.TX_REVERTED,
|
|
516
|
+
"EntryLogged event not found in transaction logs"
|
|
517
|
+
);
|
|
518
|
+
}
|
|
519
|
+
var COMPACT_LEDGER_TYPES = {
|
|
520
|
+
LogEntry: [
|
|
521
|
+
{ name: "actorIdentityId", type: "bytes32" },
|
|
522
|
+
{ name: "actorAddress", type: "address" },
|
|
523
|
+
{ name: "action", type: "string" },
|
|
524
|
+
{ name: "category", type: "string" },
|
|
525
|
+
{ name: "metadataHash", type: "bytes32" },
|
|
526
|
+
{ name: "proofHash", type: "bytes32" },
|
|
527
|
+
{ name: "severity", type: "uint8" }
|
|
528
|
+
]
|
|
529
|
+
};
|
|
530
|
+
async function generateActorSignatureEIP712(input, domain, walletClient) {
|
|
531
|
+
const account = walletClient.account;
|
|
532
|
+
if (!account) {
|
|
533
|
+
throw new InvarianceError(
|
|
534
|
+
ErrorCode.WALLET_NOT_CONNECTED,
|
|
535
|
+
"EIP-712 signing requires a connected wallet account. No keccak fallback is available for CompactLedger."
|
|
536
|
+
);
|
|
537
|
+
}
|
|
538
|
+
return walletClient.signTypedData({
|
|
539
|
+
account,
|
|
540
|
+
domain,
|
|
541
|
+
types: COMPACT_LEDGER_TYPES,
|
|
542
|
+
primaryType: "LogEntry",
|
|
543
|
+
message: {
|
|
544
|
+
actorIdentityId: input.actorIdentityId,
|
|
545
|
+
actorAddress: input.actorAddress,
|
|
546
|
+
action: input.action,
|
|
547
|
+
category: input.category,
|
|
548
|
+
metadataHash: input.metadataHash,
|
|
549
|
+
proofHash: input.proofHash,
|
|
550
|
+
severity: input.severity
|
|
551
|
+
}
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
async function generatePlatformAttestationEIP712(input, apiKey, apiBaseUrl) {
|
|
555
|
+
if (!apiKey) {
|
|
556
|
+
throw new InvarianceError(
|
|
557
|
+
ErrorCode.INVALID_INPUT,
|
|
558
|
+
"CompactLedger requires an API key for platform attestation. The keccak256 fallback is not a valid ECDSA signature and will revert on-chain. Set apiKey in your Invariance config."
|
|
559
|
+
);
|
|
560
|
+
}
|
|
561
|
+
const envUrl = typeof process !== "undefined" ? process.env["INVARIANCE_API_URL"] : void 0;
|
|
562
|
+
const baseUrl = apiBaseUrl ?? envUrl ?? "https://api.useinvariance.com";
|
|
563
|
+
const response = await fetch(`${baseUrl}/v1/attest`, {
|
|
564
|
+
method: "POST",
|
|
565
|
+
headers: {
|
|
566
|
+
"Content-Type": "application/json",
|
|
567
|
+
"Authorization": `Bearer ${apiKey}`
|
|
568
|
+
},
|
|
569
|
+
body: JSON.stringify({
|
|
570
|
+
mode: "eip712",
|
|
571
|
+
input: {
|
|
572
|
+
actorIdentityId: input.actorIdentityId,
|
|
573
|
+
actorAddress: input.actorAddress,
|
|
574
|
+
action: input.action,
|
|
575
|
+
category: input.category,
|
|
576
|
+
metadataHash: input.metadataHash,
|
|
577
|
+
proofHash: input.proofHash,
|
|
578
|
+
severity: input.severity
|
|
579
|
+
}
|
|
580
|
+
})
|
|
581
|
+
});
|
|
582
|
+
if (!response.ok) {
|
|
583
|
+
throw new InvarianceError(
|
|
584
|
+
ErrorCode.NETWORK_ERROR,
|
|
585
|
+
`Platform attestation API returned ${response.status}. CompactLedger requires a valid platform signature.`
|
|
586
|
+
);
|
|
587
|
+
}
|
|
588
|
+
const result = await response.json();
|
|
589
|
+
return result.data.signature;
|
|
590
|
+
}
|
|
591
|
+
function parseCompactEntryIdFromLogs(logs) {
|
|
592
|
+
for (const log of logs) {
|
|
593
|
+
try {
|
|
594
|
+
const decoded = decodeEventLog({
|
|
595
|
+
abi: InvarianceCompactLedgerAbi,
|
|
596
|
+
data: log.data,
|
|
597
|
+
topics: log.topics
|
|
598
|
+
});
|
|
599
|
+
if (decoded.eventName === "EntryLogged") {
|
|
600
|
+
return decoded.args.entryId;
|
|
601
|
+
}
|
|
602
|
+
} catch {
|
|
603
|
+
continue;
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
throw new InvarianceError(
|
|
607
|
+
ErrorCode.TX_REVERTED,
|
|
608
|
+
"CompactLedger EntryLogged event not found in transaction logs"
|
|
609
|
+
);
|
|
610
|
+
}
|
|
611
|
+
function parseAtomicEntryIdFromLogs(logs) {
|
|
612
|
+
for (const log of logs) {
|
|
613
|
+
try {
|
|
614
|
+
const decoded = decodeEventLog({
|
|
615
|
+
abi: InvarianceAtomicVerifierAbi,
|
|
616
|
+
data: log.data,
|
|
617
|
+
topics: log.topics
|
|
618
|
+
});
|
|
619
|
+
if (decoded.eventName === "AtomicVerification") {
|
|
620
|
+
return decoded.args.entryId;
|
|
621
|
+
}
|
|
622
|
+
} catch {
|
|
623
|
+
continue;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
throw new InvarianceError(
|
|
627
|
+
ErrorCode.TX_REVERTED,
|
|
628
|
+
"AtomicVerification event not found in transaction logs"
|
|
629
|
+
);
|
|
630
|
+
}
|
|
631
|
+
async function generateActorSignature(event, walletClient) {
|
|
632
|
+
const message = JSON.stringify({ action: event.action, metadata: event.metadata ?? {} });
|
|
633
|
+
const account = walletClient.account;
|
|
634
|
+
if (!account) {
|
|
635
|
+
return keccak256(toHex(message));
|
|
636
|
+
}
|
|
637
|
+
return walletClient.signMessage({ account, message });
|
|
638
|
+
}
|
|
639
|
+
function generatePlatformCommitment(event) {
|
|
640
|
+
const payload = JSON.stringify({ action: event.action, metadata: event.metadata ?? {}, platform: "Invariance" });
|
|
641
|
+
return keccak256(toHex(payload));
|
|
642
|
+
}
|
|
643
|
+
async function generatePlatformAttestation(event, apiKey, apiBaseUrl) {
|
|
644
|
+
if (!apiKey) {
|
|
645
|
+
return generatePlatformCommitment(event);
|
|
646
|
+
}
|
|
647
|
+
const envUrl = typeof process !== "undefined" ? process.env["INVARIANCE_API_URL"] : void 0;
|
|
648
|
+
const baseUrl = apiBaseUrl ?? envUrl ?? "https://api.useinvariance.com";
|
|
649
|
+
try {
|
|
650
|
+
const response = await fetch(`${baseUrl}/v1/attest`, {
|
|
651
|
+
method: "POST",
|
|
652
|
+
headers: {
|
|
653
|
+
"Content-Type": "application/json",
|
|
654
|
+
"Authorization": `Bearer ${apiKey}`
|
|
655
|
+
},
|
|
656
|
+
body: JSON.stringify({
|
|
657
|
+
action: event.action,
|
|
658
|
+
metadata: event.metadata ?? {}
|
|
659
|
+
})
|
|
660
|
+
});
|
|
661
|
+
if (!response.ok) {
|
|
662
|
+
throw new InvarianceError(
|
|
663
|
+
ErrorCode.NETWORK_ERROR,
|
|
664
|
+
`Attestation API returned ${response.status}. Cannot generate platform signature.`
|
|
665
|
+
);
|
|
666
|
+
}
|
|
667
|
+
const result = await response.json();
|
|
668
|
+
const data = result["data"];
|
|
669
|
+
if (!data || typeof data["signature"] !== "string") {
|
|
670
|
+
throw new InvarianceError(
|
|
671
|
+
ErrorCode.NETWORK_ERROR,
|
|
672
|
+
"Attestation API returned invalid response shape. Expected { data: { signature: string } }."
|
|
673
|
+
);
|
|
674
|
+
}
|
|
675
|
+
return data["signature"];
|
|
676
|
+
} catch (err) {
|
|
677
|
+
if (err instanceof InvarianceError) throw err;
|
|
678
|
+
throw new InvarianceError(
|
|
679
|
+
ErrorCode.NETWORK_ERROR,
|
|
680
|
+
`Attestation API unreachable: ${err instanceof Error ? err.message : String(err)}`
|
|
681
|
+
);
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
function convertToCSV(entries) {
|
|
685
|
+
if (entries.length === 0) return "entryId,action,timestamp,txHash\n";
|
|
686
|
+
const sanitize = (v) => {
|
|
687
|
+
const first = v.charAt(0);
|
|
688
|
+
if (first === "=" || first === "+" || first === "-" || first === "@") {
|
|
689
|
+
return `'${v}`;
|
|
690
|
+
}
|
|
691
|
+
return v.includes(",") || v.includes('"') ? `"${v.replace(/"/g, '""')}"` : v;
|
|
692
|
+
};
|
|
693
|
+
const headers = "entryId,action,timestamp,txHash\n";
|
|
694
|
+
const rows = entries.map((e) => `${sanitize(e.entryId)},${sanitize(e.action)},${e.timestamp},${sanitize(e.txHash)}`).join("\n");
|
|
695
|
+
return headers + rows;
|
|
696
|
+
}
|
|
697
|
+
function parseReviewIdFromLogs(logs) {
|
|
698
|
+
for (const log of logs) {
|
|
699
|
+
try {
|
|
700
|
+
const decoded = decodeEventLog({
|
|
701
|
+
abi: InvarianceReviewAbi,
|
|
702
|
+
data: log.data,
|
|
703
|
+
topics: log.topics
|
|
704
|
+
});
|
|
705
|
+
if (decoded.eventName === "ReviewSubmitted") {
|
|
706
|
+
return decoded.args.reviewId;
|
|
707
|
+
}
|
|
708
|
+
} catch {
|
|
709
|
+
continue;
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
throw new InvarianceError(
|
|
713
|
+
ErrorCode.TX_REVERTED,
|
|
714
|
+
"ReviewSubmitted event not found in transaction logs"
|
|
715
|
+
);
|
|
716
|
+
}
|
|
717
|
+
var LISTING_CATEGORY_MAP = {
|
|
718
|
+
trading: 0,
|
|
719
|
+
content: 1,
|
|
720
|
+
analysis: 2,
|
|
721
|
+
automation: 3,
|
|
722
|
+
research: 4,
|
|
723
|
+
creative: 5,
|
|
724
|
+
development: 6,
|
|
725
|
+
custom: 7
|
|
726
|
+
};
|
|
727
|
+
var REVERSE_LISTING_CATEGORY_MAP = {
|
|
728
|
+
0: "trading",
|
|
729
|
+
1: "content",
|
|
730
|
+
2: "analysis",
|
|
731
|
+
3: "automation",
|
|
732
|
+
4: "research",
|
|
733
|
+
5: "creative",
|
|
734
|
+
6: "development",
|
|
735
|
+
7: "custom"
|
|
736
|
+
};
|
|
737
|
+
var PRICING_TYPE_MAP = {
|
|
738
|
+
fixed: 0,
|
|
739
|
+
hourly: 1,
|
|
740
|
+
"per-task": 2,
|
|
741
|
+
subscription: 3
|
|
742
|
+
};
|
|
743
|
+
var REVERSE_PRICING_TYPE_MAP = {
|
|
744
|
+
0: "fixed",
|
|
745
|
+
1: "hourly",
|
|
746
|
+
2: "per-task",
|
|
747
|
+
3: "subscription"
|
|
748
|
+
};
|
|
749
|
+
function listingCategoryToEnum(category) {
|
|
750
|
+
const val = LISTING_CATEGORY_MAP[category];
|
|
751
|
+
if (val === void 0) {
|
|
752
|
+
throw new InvarianceError(
|
|
753
|
+
ErrorCode.INVALID_INPUT,
|
|
754
|
+
`Unknown listing category: ${category}`
|
|
755
|
+
);
|
|
756
|
+
}
|
|
757
|
+
return val;
|
|
758
|
+
}
|
|
759
|
+
function enumToListingCategory(val) {
|
|
760
|
+
const category = REVERSE_LISTING_CATEGORY_MAP[val];
|
|
761
|
+
if (!category) {
|
|
762
|
+
throw new InvarianceError(
|
|
763
|
+
ErrorCode.INVALID_INPUT,
|
|
764
|
+
`Unknown on-chain listing category enum: ${val}`
|
|
765
|
+
);
|
|
766
|
+
}
|
|
767
|
+
return category;
|
|
768
|
+
}
|
|
769
|
+
function pricingTypeToEnum(type) {
|
|
770
|
+
const val = PRICING_TYPE_MAP[type];
|
|
771
|
+
if (val === void 0) {
|
|
772
|
+
throw new InvarianceError(
|
|
773
|
+
ErrorCode.INVALID_INPUT,
|
|
774
|
+
`Unknown pricing type: ${type}`
|
|
775
|
+
);
|
|
776
|
+
}
|
|
777
|
+
return val;
|
|
778
|
+
}
|
|
779
|
+
function enumToPricingType(val) {
|
|
780
|
+
const type = REVERSE_PRICING_TYPE_MAP[val];
|
|
781
|
+
if (!type) {
|
|
782
|
+
throw new InvarianceError(
|
|
783
|
+
ErrorCode.INVALID_INPUT,
|
|
784
|
+
`Unknown on-chain pricing type enum: ${val}`
|
|
785
|
+
);
|
|
786
|
+
}
|
|
787
|
+
return type;
|
|
788
|
+
}
|
|
789
|
+
function parseListingIdFromLogs(logs) {
|
|
790
|
+
for (const log of logs) {
|
|
791
|
+
try {
|
|
792
|
+
const decoded = decodeEventLog({
|
|
793
|
+
abi: InvarianceRegistryAbi,
|
|
794
|
+
data: log.data,
|
|
795
|
+
topics: log.topics
|
|
796
|
+
});
|
|
797
|
+
if (decoded.eventName === "ListingRegistered") {
|
|
798
|
+
return decoded.args.listingId;
|
|
799
|
+
}
|
|
800
|
+
} catch {
|
|
801
|
+
continue;
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
throw new InvarianceError(
|
|
805
|
+
ErrorCode.TX_REVERTED,
|
|
806
|
+
"ListingRegistered event not found in transaction logs"
|
|
807
|
+
);
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
export {
|
|
811
|
+
ErrorCode,
|
|
812
|
+
getChainConfig,
|
|
813
|
+
getContractAddresses,
|
|
814
|
+
InvarianceError,
|
|
815
|
+
actorTypeToEnum,
|
|
816
|
+
enumToActorType,
|
|
817
|
+
identityStatusFromEnum,
|
|
818
|
+
toBytes32,
|
|
819
|
+
fromBytes32,
|
|
820
|
+
waitForReceipt,
|
|
821
|
+
policyRuleTypeToEnum,
|
|
822
|
+
enumToPolicyRuleType,
|
|
823
|
+
policyStateFromEnum,
|
|
824
|
+
mapActorTypesToEnums,
|
|
825
|
+
escrowConditionTypeToEnum,
|
|
826
|
+
enumToEscrowConditionType,
|
|
827
|
+
escrowStateFromEnum,
|
|
828
|
+
mapContractError,
|
|
829
|
+
intentStatusFromEnum,
|
|
830
|
+
parseIntentIdFromLogs,
|
|
831
|
+
hashMetadata,
|
|
832
|
+
mapSeverity,
|
|
833
|
+
parseEntryIdFromLogs,
|
|
834
|
+
generateActorSignatureEIP712,
|
|
835
|
+
generatePlatformAttestationEIP712,
|
|
836
|
+
parseCompactEntryIdFromLogs,
|
|
837
|
+
parseAtomicEntryIdFromLogs,
|
|
838
|
+
generateActorSignature,
|
|
839
|
+
generatePlatformCommitment,
|
|
840
|
+
generatePlatformAttestation,
|
|
841
|
+
convertToCSV,
|
|
842
|
+
parseReviewIdFromLogs,
|
|
843
|
+
listingCategoryToEnum,
|
|
844
|
+
enumToListingCategory,
|
|
845
|
+
pricingTypeToEnum,
|
|
846
|
+
enumToPricingType,
|
|
847
|
+
parseListingIdFromLogs
|
|
848
|
+
};
|
|
849
|
+
//# sourceMappingURL=chunk-3ONNY6AX.js.map
|