@monolythium/core-sdk 0.2.0 → 0.2.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/crypto/index.cjs.map +1 -1
- package/dist/crypto/index.d.cts +3 -3
- package/dist/crypto/index.d.ts +3 -3
- package/dist/crypto/index.js.map +1 -1
- package/dist/ethers/index.cjs +58 -5
- package/dist/ethers/index.cjs.map +1 -1
- package/dist/ethers/index.d.cts +1 -1
- package/dist/ethers/index.d.ts +1 -1
- package/dist/ethers/index.js +58 -5
- package/dist/ethers/index.js.map +1 -1
- package/dist/index.cjs +183 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -22
- package/dist/index.d.ts +40 -22
- package/dist/index.js +181 -33
- package/dist/index.js.map +1 -1
- package/dist/{native-events-BEkkGoak.d.cts → native-events-CA0yrnj-.d.cts} +33 -16
- package/dist/{native-events-BEkkGoak.d.ts → native-events-CA0yrnj-.d.ts} +33 -16
- package/dist/{submission-BrsftNSl.d.cts → submission-AOqfeSIS.d.cts} +1 -1
- package/dist/{submission-CelGfDRQ.d.ts → submission-msoZzFIa.d.ts} +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -128,6 +128,41 @@ function parseAddress(address) {
|
|
|
128
128
|
}
|
|
129
129
|
return bech32ToAddressBytes(address);
|
|
130
130
|
}
|
|
131
|
+
function validateAddress(address) {
|
|
132
|
+
if (typeof address !== "string" || address.length === 0) {
|
|
133
|
+
return { valid: false, reason: "address cannot be empty" };
|
|
134
|
+
}
|
|
135
|
+
const trimmed = address.trim();
|
|
136
|
+
if (trimmed.length === 0) {
|
|
137
|
+
return { valid: false, reason: "address cannot be empty" };
|
|
138
|
+
}
|
|
139
|
+
if (trimmed.startsWith("0x") || trimmed.startsWith("0X")) {
|
|
140
|
+
try {
|
|
141
|
+
const bytes = hexToAddressBytes(trimmed);
|
|
142
|
+
return {
|
|
143
|
+
valid: true,
|
|
144
|
+
normalized: addressToBech32(bytes),
|
|
145
|
+
kind: null,
|
|
146
|
+
format: "hex",
|
|
147
|
+
bytes
|
|
148
|
+
};
|
|
149
|
+
} catch (err) {
|
|
150
|
+
return { valid: false, reason: err instanceof Error ? err.message : String(err) };
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
try {
|
|
154
|
+
const typed = typedBech32ToAddress(trimmed);
|
|
155
|
+
return {
|
|
156
|
+
valid: true,
|
|
157
|
+
normalized: typed.address,
|
|
158
|
+
kind: typed.kind,
|
|
159
|
+
format: "bech32m",
|
|
160
|
+
bytes: typed.bytes
|
|
161
|
+
};
|
|
162
|
+
} catch (err) {
|
|
163
|
+
return { valid: false, reason: err instanceof Error ? err.message : String(err) };
|
|
164
|
+
}
|
|
165
|
+
}
|
|
131
166
|
function normalizeAddressHex(address) {
|
|
132
167
|
return addressBytesToHex(parseAddress(address));
|
|
133
168
|
}
|
|
@@ -314,28 +349,24 @@ var PRECOMPILE_ADDRESSES = {
|
|
|
314
349
|
TOKEN_FACTORY: "0x0000000000000000000000000000000000001000",
|
|
315
350
|
/** Native central-limit order book — gateable. */
|
|
316
351
|
CLOB: "0x0000000000000000000000000000000000001001",
|
|
317
|
-
/** Agent execution surface
|
|
352
|
+
/** Agent execution surface — gateable. */
|
|
318
353
|
AGENT: "0x0000000000000000000000000000000000001003",
|
|
319
354
|
/** Account privacy policy + stealth/confidential ops — gateable. */
|
|
320
355
|
PRIVACY: "0x0000000000000000000000000000000000001004",
|
|
321
356
|
/** Operator + RPC node registry — non-gateable consensus invariant. */
|
|
322
357
|
NODE_REGISTRY: "0x0000000000000000000000000000000000001005",
|
|
323
|
-
/**
|
|
324
|
-
IBC: "0x0000000000000000000000000000000000001007",
|
|
325
|
-
/** Native zk-light-client bridge — gateable. */
|
|
358
|
+
/** Native bridge route-control surface — gateable. */
|
|
326
359
|
BRIDGE: "0x0000000000000000000000000000000000001008",
|
|
327
|
-
/** Decentralized multi-signer oracle
|
|
360
|
+
/** Decentralized multi-signer oracle — non-gateable. */
|
|
328
361
|
ORACLE: "0x0000000000000000000000000000000000001009",
|
|
329
|
-
/** Distributed delegation primitive
|
|
362
|
+
/** Distributed delegation primitive — gateable. */
|
|
330
363
|
DELEGATION: "0x000000000000000000000000000000000000100A",
|
|
331
|
-
/** One-time emergency-key registry
|
|
364
|
+
/** One-time emergency-key registry — non-gateable. */
|
|
332
365
|
EMERGENCY_KEY: "0x0000000000000000000000000000000000001100",
|
|
333
|
-
/** VRF precompile
|
|
366
|
+
/** VRF precompile. */
|
|
334
367
|
VRF: "0x0000000000000000000000000000000000001101",
|
|
335
|
-
/** Streaming-payments primitive
|
|
368
|
+
/** Streaming-payments primitive — gateable. */
|
|
336
369
|
STREAMING_PAYMENTS: "0x0000000000000000000000000000000000001102",
|
|
337
|
-
/** Human-readable name registry (Law §5.4 / §5.8) — gateable. */
|
|
338
|
-
NAME_REGISTRY: "0x0000000000000000000000000000000000001103",
|
|
339
370
|
/** Cluster-name registry. */
|
|
340
371
|
CLUSTER_NAME_REGISTRY: "0x0000000000000000000000000000000000001104",
|
|
341
372
|
/** Agent-commerce attestation precompile. */
|
|
@@ -352,10 +383,12 @@ var PRECOMPILE_ADDRESSES = {
|
|
|
352
383
|
ESCROW: "0x000000000000000000000000000000000000110A",
|
|
353
384
|
/** Agent-commerce arbiter registry. */
|
|
354
385
|
ARBITER_REGISTRY: "0x000000000000000000000000000000000000110B",
|
|
355
|
-
/** Agent spending policy — gateable
|
|
386
|
+
/** Agent spending policy — gateable. */
|
|
356
387
|
SPENDING_POLICY: "0x000000000000000000000000000000000000110C",
|
|
357
|
-
/** Primary ML-DSA-65 pubkey registry — gateable
|
|
358
|
-
PUBKEY_REGISTRY: "0x000000000000000000000000000000000000110D"
|
|
388
|
+
/** Primary ML-DSA-65 pubkey registry — gateable. */
|
|
389
|
+
PUBKEY_REGISTRY: "0x000000000000000000000000000000000000110D",
|
|
390
|
+
/** Hierarchical name registry — gateable. */
|
|
391
|
+
NAME_REGISTRY: "0x000000000000000000000000000000000000110E"
|
|
359
392
|
};
|
|
360
393
|
|
|
361
394
|
// src/node-registry.ts
|
|
@@ -2355,7 +2388,7 @@ var RpcClient = class _RpcClient {
|
|
|
2355
2388
|
async web3Sha3(data) {
|
|
2356
2389
|
return this.call("web3_sha3", [data]);
|
|
2357
2390
|
}
|
|
2358
|
-
// ---- lyth_*
|
|
2391
|
+
// ---- lyth_* native namespace --------------------------------------
|
|
2359
2392
|
/** `lyth_listProviders` — paged registry enumeration. */
|
|
2360
2393
|
async lythListProviders(capabilityMask, cursor = null, limit = 100) {
|
|
2361
2394
|
return this.call("lyth_listProviders", [capabilityMask, cursor, limit]);
|
|
@@ -2587,14 +2620,26 @@ var RpcClient = class _RpcClient {
|
|
|
2587
2620
|
async lythCurrentRound() {
|
|
2588
2621
|
return normalizeRoundInfo(await this.call("lyth_currentRound", []));
|
|
2589
2622
|
}
|
|
2623
|
+
/** `lyth_getTransactionCount` — native sender nonce. */
|
|
2624
|
+
async lythGetTransactionCount(address) {
|
|
2625
|
+
return parseRpcBigint(
|
|
2626
|
+
await this.call("lyth_getTransactionCount", [
|
|
2627
|
+
sdkTypedAddress(address, "user", "address")
|
|
2628
|
+
]),
|
|
2629
|
+
"lyth_getTransactionCount"
|
|
2630
|
+
);
|
|
2631
|
+
}
|
|
2632
|
+
/** `lyth_executionUnitPrice` — native execution-unit price in lythoshi. */
|
|
2633
|
+
async lythExecutionUnitPrice() {
|
|
2634
|
+
return normalizeExecutionUnitPriceResponse(
|
|
2635
|
+
await this.call("lyth_executionUnitPrice", [])
|
|
2636
|
+
);
|
|
2637
|
+
}
|
|
2590
2638
|
/** `lyth_peerSummary` — public-safe aggregate peer-network diagnostics. */
|
|
2591
2639
|
async lythPeerSummary() {
|
|
2592
2640
|
return this.call("lyth_peerSummary", []);
|
|
2593
2641
|
}
|
|
2594
|
-
/**
|
|
2595
|
-
* `lyth_listActivePrecompiles` — milestone-gated precompile catalogue
|
|
2596
|
-
* (OI-0170 / ADR-0015 §5).
|
|
2597
|
-
*/
|
|
2642
|
+
/** `lyth_listActivePrecompiles` — native precompile catalogue. */
|
|
2598
2643
|
async lythListActivePrecompiles(block = "latest") {
|
|
2599
2644
|
return this.call("lyth_listActivePrecompiles", [encodeBlockSelector(block)]);
|
|
2600
2645
|
}
|
|
@@ -3519,6 +3564,34 @@ function normalizeRoundInfo(value) {
|
|
|
3519
3564
|
height: parseRpcBigint(row["height"], "round height")
|
|
3520
3565
|
};
|
|
3521
3566
|
}
|
|
3567
|
+
function normalizeExecutionUnitPriceResponse(value) {
|
|
3568
|
+
if (!value || typeof value !== "object") {
|
|
3569
|
+
throw SdkError.malformed("execution unit price response must be an object");
|
|
3570
|
+
}
|
|
3571
|
+
const row = value;
|
|
3572
|
+
return {
|
|
3573
|
+
executionUnitPriceLythoshi: parseRpcBigint(
|
|
3574
|
+
fieldAlias(row, ["executionUnitPriceLythoshi", "execution_unit_price_lythoshi"]),
|
|
3575
|
+
"executionUnitPriceLythoshi"
|
|
3576
|
+
).toString(),
|
|
3577
|
+
basePricePerExecutionUnitLythoshi: parseRpcBigint(
|
|
3578
|
+
fieldAlias(row, [
|
|
3579
|
+
"basePricePerExecutionUnitLythoshi",
|
|
3580
|
+
"base_price_per_execution_unit_lythoshi"
|
|
3581
|
+
]),
|
|
3582
|
+
"basePricePerExecutionUnitLythoshi"
|
|
3583
|
+
).toString(),
|
|
3584
|
+
priorityTipLythoshi: parseRpcBigint(
|
|
3585
|
+
fieldAlias(row, ["priorityTipLythoshi", "priority_tip_lythoshi"]),
|
|
3586
|
+
"priorityTipLythoshi"
|
|
3587
|
+
).toString(),
|
|
3588
|
+
blockNumber: parseRpcNumberNullable(
|
|
3589
|
+
fieldAlias(row, ["blockNumber", "block_number"]),
|
|
3590
|
+
"blockNumber"
|
|
3591
|
+
),
|
|
3592
|
+
source: readStringField(row, ["source"], "execution unit price source")
|
|
3593
|
+
};
|
|
3594
|
+
}
|
|
3522
3595
|
function normalizeMempoolSnapshot(value) {
|
|
3523
3596
|
if (!value || typeof value !== "object") {
|
|
3524
3597
|
throw SdkError.malformed("mempool snapshot must be an object");
|
|
@@ -3535,6 +3608,19 @@ function normalizeMempoolSnapshot(value) {
|
|
|
3535
3608
|
bytes_by_class: bytesByClass.map((v, i) => parseRpcBigint(v, `mempool bytes_by_class[${i}]`))
|
|
3536
3609
|
};
|
|
3537
3610
|
}
|
|
3611
|
+
function fieldAlias(record, keys) {
|
|
3612
|
+
for (const key of keys) {
|
|
3613
|
+
if (Object.prototype.hasOwnProperty.call(record, key)) return record[key];
|
|
3614
|
+
}
|
|
3615
|
+
return void 0;
|
|
3616
|
+
}
|
|
3617
|
+
function readStringField(record, keys, label) {
|
|
3618
|
+
const value = fieldAlias(record, keys);
|
|
3619
|
+
if (typeof value !== "string" || value.trim().length === 0) {
|
|
3620
|
+
throw SdkError.malformed(`${label} must be a non-empty string`);
|
|
3621
|
+
}
|
|
3622
|
+
return value.trim();
|
|
3623
|
+
}
|
|
3538
3624
|
function normalizeCapabilitiesResponse(value) {
|
|
3539
3625
|
return {
|
|
3540
3626
|
...value,
|
|
@@ -4039,6 +4125,8 @@ var BRIDGE_REVERT_TAGS = {
|
|
|
4039
4125
|
};
|
|
4040
4126
|
var BRIDGE_QUOTE_API_BLOCKED_REASON = "bridge quote requires a mono-core live quote API/runtime primitive";
|
|
4041
4127
|
var BRIDGE_SUBMIT_API_BLOCKED_REASON = "bridge submit requires a mono-core live submit API/runtime primitive";
|
|
4128
|
+
var V1_BRIDGE_ALLOWED_FEE_TOKEN = "LINK";
|
|
4129
|
+
var V1_BRIDGE_ALLOWED_PROTOCOL = "chainlink-ccip";
|
|
4042
4130
|
var BridgePrecompileError = class extends Error {
|
|
4043
4131
|
constructor(message) {
|
|
4044
4132
|
super(message);
|
|
@@ -4097,9 +4185,18 @@ function isBridgeFinalityZeroRevert(data) {
|
|
|
4097
4185
|
function assessBridgeRoute(route) {
|
|
4098
4186
|
const blockedReasons = [];
|
|
4099
4187
|
const warnings = [];
|
|
4188
|
+
const feeToken = String(route.feeToken ?? "").trim();
|
|
4100
4189
|
if (route.routeId.trim() === "") blockedReasons.push("route id missing");
|
|
4101
4190
|
if (route.bridge.trim() === "") blockedReasons.push("bridge name missing");
|
|
4191
|
+
if (!isChainlinkCcipRoute(route.protocol, route.bridge, route.verifier.model)) {
|
|
4192
|
+
blockedReasons.push("bridge protocol must be Chainlink CCIP");
|
|
4193
|
+
}
|
|
4102
4194
|
if (route.asset.trim() === "") blockedReasons.push("asset disclosure missing");
|
|
4195
|
+
if (feeToken === "") {
|
|
4196
|
+
blockedReasons.push("route fee token missing");
|
|
4197
|
+
} else if (feeToken.toUpperCase() !== V1_BRIDGE_ALLOWED_FEE_TOKEN) {
|
|
4198
|
+
blockedReasons.push("CCIP route fee token must be LINK");
|
|
4199
|
+
}
|
|
4103
4200
|
if (route.verifier.model.trim() === "") blockedReasons.push("verifier model missing");
|
|
4104
4201
|
if (route.verifier.threshold < 2 || route.verifier.participantCount < 2) {
|
|
4105
4202
|
blockedReasons.push("verifier set must not be 1-of-1");
|
|
@@ -4341,8 +4438,23 @@ function validateBridgeRouteCatalogueRoute(idx, value, seen, blockedReasons) {
|
|
|
4341
4438
|
20,
|
|
4342
4439
|
blockedReasons
|
|
4343
4440
|
);
|
|
4344
|
-
validateTextField(`${prefix}.bridge`, value.bridge, 64, blockedReasons);
|
|
4441
|
+
const bridge = validateTextField(`${prefix}.bridge`, value.bridge, 64, blockedReasons);
|
|
4442
|
+
const protocol = validateOptionalTextField(
|
|
4443
|
+
`${prefix}.protocol`,
|
|
4444
|
+
field(value, "protocol", "routeProtocol", "route_protocol"),
|
|
4445
|
+
64,
|
|
4446
|
+
blockedReasons
|
|
4447
|
+
);
|
|
4345
4448
|
validateTextField(`${prefix}.asset`, value.asset, 64, blockedReasons);
|
|
4449
|
+
const feeToken = validateTextField(
|
|
4450
|
+
`${prefix}.feeToken`,
|
|
4451
|
+
field(value, "feeToken", "fee_token"),
|
|
4452
|
+
32,
|
|
4453
|
+
blockedReasons
|
|
4454
|
+
);
|
|
4455
|
+
if (feeToken != null && feeToken.toUpperCase() !== V1_BRIDGE_ALLOWED_FEE_TOKEN) {
|
|
4456
|
+
blockedReasons.push(`${prefix}.feeToken must be LINK for CCIP routes`);
|
|
4457
|
+
}
|
|
4346
4458
|
validateTextField(
|
|
4347
4459
|
`${prefix}.sourceChain`,
|
|
4348
4460
|
field(value, "sourceChain", "source_chain"),
|
|
@@ -4356,10 +4468,11 @@ function validateBridgeRouteCatalogueRoute(idx, value, seen, blockedReasons) {
|
|
|
4356
4468
|
blockedReasons
|
|
4357
4469
|
);
|
|
4358
4470
|
const verifier = value.verifier;
|
|
4471
|
+
let verifierModel = null;
|
|
4359
4472
|
if (!isRecord2(verifier)) {
|
|
4360
4473
|
blockedReasons.push(`${prefix}.verifier must be an object`);
|
|
4361
4474
|
} else {
|
|
4362
|
-
validateTextField(`${prefix}.verifier.model`, verifier.model, 64, blockedReasons);
|
|
4475
|
+
verifierModel = validateTextField(`${prefix}.verifier.model`, verifier.model, 64, blockedReasons);
|
|
4363
4476
|
const participantCount = field(verifier, "participantCount", "participant_count");
|
|
4364
4477
|
if (!isU16(participantCount) || participantCount === 0) {
|
|
4365
4478
|
blockedReasons.push(`${prefix}.verifier.participantCount must be non-zero`);
|
|
@@ -4370,6 +4483,9 @@ function validateBridgeRouteCatalogueRoute(idx, value, seen, blockedReasons) {
|
|
|
4370
4483
|
blockedReasons.push(`${prefix}.verifier.threshold must be in 1..=participantCount`);
|
|
4371
4484
|
}
|
|
4372
4485
|
}
|
|
4486
|
+
if (!isChainlinkCcipRoute(protocol, bridge ?? "", verifierModel ?? "")) {
|
|
4487
|
+
blockedReasons.push(`${prefix}.protocol must be Chainlink CCIP`);
|
|
4488
|
+
}
|
|
4373
4489
|
if (!decimalStringIsPositiveU256(field(value, "drainCapAtomic", "drain_cap_atomic"))) {
|
|
4374
4490
|
blockedReasons.push(`${prefix}.drainCapAtomic must be a non-zero decimal u256`);
|
|
4375
4491
|
}
|
|
@@ -4411,7 +4527,9 @@ function coerceBridgeRouteCatalogueRoute(value) {
|
|
|
4411
4527
|
bridgeId: stringField2(value, "bridgeId", "bridge_id"),
|
|
4412
4528
|
wrappedAsset: stringField2(value, "wrappedAsset", "wrapped_asset"),
|
|
4413
4529
|
bridge: stringField2(value, "bridge").trim(),
|
|
4530
|
+
protocol: optionalStringField(value, "protocol", "routeProtocol", "route_protocol"),
|
|
4414
4531
|
asset: stringField2(value, "asset").trim(),
|
|
4532
|
+
feeToken: stringField2(value, "feeToken", "fee_token").trim(),
|
|
4415
4533
|
sourceChain: stringField2(value, "sourceChain", "source_chain").trim(),
|
|
4416
4534
|
destinationChain: stringField2(value, "destinationChain", "destination_chain").trim(),
|
|
4417
4535
|
verifier: {
|
|
@@ -4440,6 +4558,19 @@ function cloneBridgeRouteCatalogueRoute(route) {
|
|
|
4440
4558
|
verifier: { ...route.verifier }
|
|
4441
4559
|
};
|
|
4442
4560
|
}
|
|
4561
|
+
function isChainlinkCcipRoute(protocol, bridge, verifierModel) {
|
|
4562
|
+
const normalizedProtocol = normalizeBridgeProtocol(protocol ?? "");
|
|
4563
|
+
if (normalizedProtocol.length > 0) {
|
|
4564
|
+
return normalizedProtocol === "chainlinkccip" || normalizedProtocol === "ccip";
|
|
4565
|
+
}
|
|
4566
|
+
return bridgeLabelLooksCcip(bridge) || bridgeLabelLooksCcip(verifierModel);
|
|
4567
|
+
}
|
|
4568
|
+
function bridgeLabelLooksCcip(value) {
|
|
4569
|
+
return normalizeBridgeProtocol(value).includes("ccip");
|
|
4570
|
+
}
|
|
4571
|
+
function normalizeBridgeProtocol(value) {
|
|
4572
|
+
return value.trim().toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
4573
|
+
}
|
|
4443
4574
|
function bridgeRouteCandidate(intent, intentReasons, route) {
|
|
4444
4575
|
const assessment = assessBridgeRoute(route);
|
|
4445
4576
|
const blockedReasons = [...intentReasons, ...assessment.blockedReasons];
|
|
@@ -4535,16 +4666,28 @@ function trimmedEq(left, right) {
|
|
|
4535
4666
|
function isRecord2(value) {
|
|
4536
4667
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4537
4668
|
}
|
|
4538
|
-
function field(record,
|
|
4539
|
-
|
|
4540
|
-
|
|
4669
|
+
function field(record, ...keys) {
|
|
4670
|
+
for (const key of keys) {
|
|
4671
|
+
if (Object.prototype.hasOwnProperty.call(record, key)) return record[key];
|
|
4672
|
+
}
|
|
4541
4673
|
return void 0;
|
|
4542
4674
|
}
|
|
4543
|
-
function stringField2(record,
|
|
4544
|
-
return field(record,
|
|
4675
|
+
function stringField2(record, ...keys) {
|
|
4676
|
+
return field(record, ...keys);
|
|
4677
|
+
}
|
|
4678
|
+
function optionalStringField(record, ...keys) {
|
|
4679
|
+
let raw;
|
|
4680
|
+
for (const key of keys) {
|
|
4681
|
+
if (Object.prototype.hasOwnProperty.call(record, key)) {
|
|
4682
|
+
raw = record[key];
|
|
4683
|
+
break;
|
|
4684
|
+
}
|
|
4685
|
+
}
|
|
4686
|
+
if (raw === void 0 || raw === null) return null;
|
|
4687
|
+
return typeof raw === "string" ? raw.trim() : "";
|
|
4545
4688
|
}
|
|
4546
|
-
function numberField(record,
|
|
4547
|
-
return field(record,
|
|
4689
|
+
function numberField(record, ...keys) {
|
|
4690
|
+
return field(record, ...keys);
|
|
4548
4691
|
}
|
|
4549
4692
|
function validateTextField(name, value, maxLen, blockedReasons) {
|
|
4550
4693
|
if (typeof value !== "string") {
|
|
@@ -4558,6 +4701,10 @@ function validateTextField(name, value, maxLen, blockedReasons) {
|
|
|
4558
4701
|
}
|
|
4559
4702
|
return trimmed;
|
|
4560
4703
|
}
|
|
4704
|
+
function validateOptionalTextField(name, value, maxLen, blockedReasons) {
|
|
4705
|
+
if (value === void 0 || value === null) return null;
|
|
4706
|
+
return validateTextField(name, value, maxLen, blockedReasons);
|
|
4707
|
+
}
|
|
4561
4708
|
function validateHexBytes(name, value, expectedBytes, blockedReasons) {
|
|
4562
4709
|
if (typeof value !== "string") {
|
|
4563
4710
|
blockedReasons.push(`${name} must be ${expectedBytes} bytes of hex`);
|
|
@@ -4687,9 +4834,10 @@ function concatBytes4(...parts) {
|
|
|
4687
4834
|
var NO_EVM_RECEIPT_PROOF_SCHEMA = "mono.no_evm_receipt_proof.v1";
|
|
4688
4835
|
var NO_EVM_RECEIPT_PROOF_TYPE = "canonicalReceiptsTranscript";
|
|
4689
4836
|
var NO_EVM_RECEIPT_INCLUSION_PROOF_TYPE = "canonicalReceiptInclusion";
|
|
4690
|
-
var NO_EVM_RECEIPT_ROOT_ALGORITHM = "keccak256(monolythium/v4.1/
|
|
4837
|
+
var NO_EVM_RECEIPT_ROOT_ALGORITHM = "keccak256-binary-merkle(monolythium/v4.1/receipt_leaf/1, monolythium/v4.1/receipt_node/1, duplicate-last padding)";
|
|
4838
|
+
var NO_EVM_LEGACY_BINARY_RECEIPT_ROOT_ALGORITHM = "keccak256(monolythium/v4.1/receipts_root_empty/1|receipt_leaf/1|receipt_node/1 binary Merkle)";
|
|
4691
4839
|
var NO_EVM_LEGACY_RECEIPT_ROOT_ALGORITHM = "keccak256(monolythium/v2/receipts_root/1 || len || indexed bincode receipts)";
|
|
4692
|
-
var NO_EVM_RECEIPT_CODEC = "bincode(
|
|
4840
|
+
var NO_EVM_RECEIPT_CODEC = "bincode(protocore_execution_types::Receipt)";
|
|
4693
4841
|
var NO_EVM_RECEIPTS_ROOT_DOMAIN = "monolythium/v4.1/receipts_root_empty/1";
|
|
4694
4842
|
var NO_EVM_RECEIPT_LEAF_DOMAIN = "monolythium/v4.1/receipt_leaf/1";
|
|
4695
4843
|
var NO_EVM_RECEIPT_NODE_DOMAIN = "monolythium/v4.1/receipt_node/1";
|
|
@@ -5926,7 +6074,7 @@ function getOptionalHistorySource(proof) {
|
|
|
5926
6074
|
return value === void 0 ? void 0 : String(value);
|
|
5927
6075
|
}
|
|
5928
6076
|
function assertSupportedRootAlgorithm(actual) {
|
|
5929
|
-
if (actual !== NO_EVM_RECEIPT_ROOT_ALGORITHM && actual !== NO_EVM_LEGACY_RECEIPT_ROOT_ALGORITHM && actual !== NO_EVM_COMPACT_INCLUSION_TREE_ALGORITHM) {
|
|
6077
|
+
if (actual !== NO_EVM_RECEIPT_ROOT_ALGORITHM && actual !== NO_EVM_LEGACY_BINARY_RECEIPT_ROOT_ALGORITHM && actual !== NO_EVM_LEGACY_RECEIPT_ROOT_ALGORITHM && actual !== NO_EVM_COMPACT_INCLUSION_TREE_ALGORITHM) {
|
|
5930
6078
|
throw new NoEvmReceiptProofError(
|
|
5931
6079
|
"unsupported_root_algorithm",
|
|
5932
6080
|
`unsupported no-EVM receipt proof rootAlgorithm: ${actual}`
|
|
@@ -7854,7 +8002,7 @@ var MONOLYTHIUM_TESTNET_CHAIN_ID = 69420n;
|
|
|
7854
8002
|
var MONOLYTHIUM_TESTNET_NETWORK_NAME = "monolythium-testnet";
|
|
7855
8003
|
|
|
7856
8004
|
// src/index.ts
|
|
7857
|
-
var version = "0.2.
|
|
8005
|
+
var version = "0.2.2";
|
|
7858
8006
|
|
|
7859
8007
|
exports.ADDRESS_HRP = ADDRESS_HRP;
|
|
7860
8008
|
exports.ADDRESS_KIND_HRPS = ADDRESS_KIND_HRPS;
|
|
@@ -7938,6 +8086,8 @@ exports.SPENDING_POLICY_SELECTORS = SPENDING_POLICY_SELECTORS;
|
|
|
7938
8086
|
exports.SdkError = SdkError;
|
|
7939
8087
|
exports.SpendingPolicyError = SpendingPolicyError;
|
|
7940
8088
|
exports.TESTNET_69420 = TESTNET_69420;
|
|
8089
|
+
exports.V1_BRIDGE_ALLOWED_FEE_TOKEN = V1_BRIDGE_ALLOWED_FEE_TOKEN;
|
|
8090
|
+
exports.V1_BRIDGE_ALLOWED_PROTOCOL = V1_BRIDGE_ALLOWED_PROTOCOL;
|
|
7941
8091
|
exports.addressBytesToHex = addressBytesToHex;
|
|
7942
8092
|
exports.addressToBech32 = addressToBech32;
|
|
7943
8093
|
exports.addressToTypedBech32 = addressToTypedBech32;
|
|
@@ -8149,6 +8299,7 @@ exports.submitMrvCallNativeTx = submitMrvCallNativeTx;
|
|
|
8149
8299
|
exports.submitMrvDeployNativeTx = submitMrvDeployNativeTx;
|
|
8150
8300
|
exports.submitMrvDeployPayloadNativeTx = submitMrvDeployPayloadNativeTx;
|
|
8151
8301
|
exports.typedBech32ToAddress = typedBech32ToAddress;
|
|
8302
|
+
exports.validateAddress = validateAddress;
|
|
8152
8303
|
exports.validateBridgeRouteCatalogue = validateBridgeRouteCatalogue;
|
|
8153
8304
|
exports.validateMrvArtifactMetadata = validateMrvArtifactMetadata;
|
|
8154
8305
|
exports.validateMrvCallRequest = validateMrvCallRequest;
|