@arcium-hq/client 0.6.0 → 0.6.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/build/index.cjs +303 -119
- package/build/index.d.ts +128 -73
- package/build/index.mjs +301 -120
- package/package.json +1 -1
package/build/index.cjs
CHANGED
|
@@ -281,6 +281,28 @@ function encodeAsRescueEncryptable(v) {
|
|
|
281
281
|
}
|
|
282
282
|
throw new Error('Invalid type to convert from number to bigint');
|
|
283
283
|
}
|
|
284
|
+
/**
|
|
285
|
+
* Decodes a Rescue-decrypted value back to a signed bigint.
|
|
286
|
+
* Handles the conversion from field element representation to signed integer.
|
|
287
|
+
* @param v - The decrypted field element value
|
|
288
|
+
* @returns The decoded signed bigint value
|
|
289
|
+
*/
|
|
290
|
+
function decodeRescueDecryptedToBigInt(v) {
|
|
291
|
+
const twoInv = (CURVE25519_BASE_FIELD.ORDER + 1n) / 2n;
|
|
292
|
+
const binSize = getBinSize(CURVE25519_BASE_FIELD.ORDER - 1n);
|
|
293
|
+
const isLtTwoInv = ctLt(v, twoInv, binSize);
|
|
294
|
+
return ctSelect(isLtTwoInv, v, ctSub(v, CURVE25519_BASE_FIELD.ORDER, binSize), binSize);
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Decodes a Rescue-decrypted value back to a JavaScript number.
|
|
298
|
+
* Converts from field element representation to a floating-point number.
|
|
299
|
+
* @param v - The decrypted field element value
|
|
300
|
+
* @returns The decoded number value
|
|
301
|
+
*/
|
|
302
|
+
function decodeRescueDecryptedToNumber(v) {
|
|
303
|
+
const vSigned = decodeRescueDecryptedToBigInt(v);
|
|
304
|
+
return Number(vSigned) * 2 ** -DOUBLE_PRECISION_MANTISSA;
|
|
305
|
+
}
|
|
284
306
|
/**
|
|
285
307
|
* Checks if a computation reference is null (all zeros).
|
|
286
308
|
* @param ref - The computation reference to check
|
|
@@ -1271,22 +1293,22 @@ class Aes256Cipher extends AesCtrCipher {
|
|
|
1271
1293
|
}
|
|
1272
1294
|
|
|
1273
1295
|
class DataSize {
|
|
1274
|
-
|
|
1296
|
+
isFull;
|
|
1275
1297
|
size;
|
|
1276
1298
|
index;
|
|
1277
1299
|
constructor(index, size) {
|
|
1278
|
-
const
|
|
1279
|
-
this.
|
|
1280
|
-
this.size =
|
|
1300
|
+
const isUndefined = size === undefined;
|
|
1301
|
+
this.isFull = isUndefined;
|
|
1302
|
+
this.size = isUndefined ? 0 : size;
|
|
1281
1303
|
this.index = index;
|
|
1282
1304
|
}
|
|
1283
1305
|
}
|
|
1284
1306
|
function sortDataSizes(arr) {
|
|
1285
|
-
arr.sort((left, right) => {
|
|
1286
|
-
if (left.
|
|
1287
|
-
return left.
|
|
1307
|
+
return [...arr].sort((left, right) => {
|
|
1308
|
+
if (left.isFull !== right.isFull) {
|
|
1309
|
+
return left.isFull ? -1 : 1;
|
|
1288
1310
|
}
|
|
1289
|
-
if (left.size
|
|
1311
|
+
if (left.size !== right.size) {
|
|
1290
1312
|
return right.size - left.size;
|
|
1291
1313
|
}
|
|
1292
1314
|
return left.index - right.index;
|
|
@@ -1309,7 +1331,7 @@ class PackingState {
|
|
|
1309
1331
|
this.maxSize = maxSize;
|
|
1310
1332
|
}
|
|
1311
1333
|
getCurrentLoad(index) {
|
|
1312
|
-
return this.loads[index]
|
|
1334
|
+
return this.loads[index] === undefined ? 0 : this.loads[index];
|
|
1313
1335
|
}
|
|
1314
1336
|
canFit(index, size) {
|
|
1315
1337
|
return this.getCurrentLoad(index) + size <= this.maxSize;
|
|
@@ -1324,7 +1346,7 @@ class PackingState {
|
|
|
1324
1346
|
return this.lastInsert + 1;
|
|
1325
1347
|
}
|
|
1326
1348
|
insert(size) {
|
|
1327
|
-
if (size.
|
|
1349
|
+
if (size.isFull) {
|
|
1328
1350
|
this.lastInsert = this.nFull;
|
|
1329
1351
|
this.nFull++;
|
|
1330
1352
|
return new PackLocation(this.lastInsert, 0);
|
|
@@ -1339,23 +1361,27 @@ class PackingState {
|
|
|
1339
1361
|
}
|
|
1340
1362
|
}
|
|
1341
1363
|
function packing(maxSize, arr) {
|
|
1342
|
-
sortDataSizes(arr);
|
|
1364
|
+
const sortedArr = sortDataSizes(arr);
|
|
1343
1365
|
const inserts = [];
|
|
1344
1366
|
const state = new PackingState(maxSize);
|
|
1345
|
-
|
|
1367
|
+
sortedArr.forEach((value) => {
|
|
1346
1368
|
const pack = state.insert(value);
|
|
1347
1369
|
inserts.push([value.index, pack]);
|
|
1348
1370
|
});
|
|
1349
|
-
const
|
|
1371
|
+
const nPacks = state.nFull + state.loads.length;
|
|
1350
1372
|
inserts.sort((left, right) => left[0] - right[0]);
|
|
1351
1373
|
const res = inserts.map((arg) => arg[1]);
|
|
1352
|
-
return [
|
|
1374
|
+
return [nPacks, res];
|
|
1353
1375
|
}
|
|
1354
1376
|
const ARCIS_PACKING_SIZE = 214;
|
|
1355
1377
|
function arcisPacking(arr) {
|
|
1356
1378
|
return packing(ARCIS_PACKING_SIZE, arr);
|
|
1357
1379
|
}
|
|
1358
1380
|
|
|
1381
|
+
/** Length of a Pubkey in bytes (Solana public keys are 32 bytes) */
|
|
1382
|
+
const PUBKEY_BYTE_LENGTH = 32;
|
|
1383
|
+
/** Maximum value a Pubkey bigint can hold (2^256) */
|
|
1384
|
+
const PUBKEY_MAX_VALUE = 1n << 256n;
|
|
1359
1385
|
var ArcisValueKind;
|
|
1360
1386
|
(function (ArcisValueKind) {
|
|
1361
1387
|
ArcisValueKind[ArcisValueKind["Integer"] = 0] = "Integer";
|
|
@@ -1377,10 +1403,10 @@ class IntegerInfo {
|
|
|
1377
1403
|
minValue() {
|
|
1378
1404
|
return this.signed ? -1n << (this.width - 1n) : 0n;
|
|
1379
1405
|
}
|
|
1380
|
-
|
|
1381
|
-
const
|
|
1382
|
-
const
|
|
1383
|
-
return
|
|
1406
|
+
isWithinBounds(b) {
|
|
1407
|
+
const minVal = this.minValue();
|
|
1408
|
+
const maxVal = this.signed ? 1n << (this.width - 1n) : 1n << this.width;
|
|
1409
|
+
return minVal <= b && b < maxVal;
|
|
1384
1410
|
}
|
|
1385
1411
|
name() {
|
|
1386
1412
|
return (this.signed ? "i" : "u") + this.width;
|
|
@@ -1414,9 +1440,9 @@ class ArcisValueField {
|
|
|
1414
1440
|
kind = ArcisValueKind.Pubkey;
|
|
1415
1441
|
break;
|
|
1416
1442
|
}
|
|
1417
|
-
if (kind
|
|
1418
|
-
if (typeof rawType
|
|
1419
|
-
throw TypeError("
|
|
1443
|
+
if (kind === ArcisValueKind.Integer) {
|
|
1444
|
+
if (typeof rawType === "string") {
|
|
1445
|
+
throw new TypeError("Expected Integer type object with signed/width properties");
|
|
1420
1446
|
}
|
|
1421
1447
|
const info = IntegerInfo.fromJson(rawType.Integer);
|
|
1422
1448
|
return new ArcisValueField(name, kind, info);
|
|
@@ -1426,38 +1452,63 @@ class ArcisValueField {
|
|
|
1426
1452
|
}
|
|
1427
1453
|
}
|
|
1428
1454
|
toBigInt(arg) {
|
|
1455
|
+
if (this.kind === ArcisValueKind.Float) {
|
|
1456
|
+
if (typeof arg !== 'number') {
|
|
1457
|
+
throw new TypeError(`Field ${this.name} expected a number, got ${typeof arg}`);
|
|
1458
|
+
}
|
|
1459
|
+
return encodeAsRescueEncryptable(arg);
|
|
1460
|
+
}
|
|
1461
|
+
let value = arg;
|
|
1462
|
+
if (typeof value === 'number') {
|
|
1463
|
+
if (!Number.isInteger(value)) {
|
|
1464
|
+
throw new TypeError(`Field ${this.name}: expected integer, got float ${value}`);
|
|
1465
|
+
}
|
|
1466
|
+
if (!Number.isSafeInteger(value)) {
|
|
1467
|
+
throw new RangeError(`Field ${this.name}: ${value} exceeds safe integer range, use BigInt`);
|
|
1468
|
+
}
|
|
1469
|
+
value = BigInt(value);
|
|
1470
|
+
}
|
|
1429
1471
|
switch (this.kind) {
|
|
1430
1472
|
case ArcisValueKind.Bool:
|
|
1431
|
-
if (typeof
|
|
1432
|
-
throw new TypeError(
|
|
1433
|
-
}
|
|
1434
|
-
return BigInt(arg);
|
|
1435
|
-
case ArcisValueKind.Float:
|
|
1436
|
-
if (typeof arg != "number") {
|
|
1437
|
-
throw new TypeError("Field " + this.name + " expected a `number`, got `" + typeof arg + "`.");
|
|
1473
|
+
if (typeof value !== 'boolean') {
|
|
1474
|
+
throw new TypeError(`Field ${this.name} expected a boolean, got ${typeof value}`);
|
|
1438
1475
|
}
|
|
1439
|
-
return
|
|
1476
|
+
return BigInt(value);
|
|
1440
1477
|
case ArcisValueKind.FullInteger:
|
|
1441
|
-
if (typeof
|
|
1442
|
-
throw new TypeError(
|
|
1478
|
+
if (typeof value !== 'bigint') {
|
|
1479
|
+
throw new TypeError(`Field ${this.name} expected a bigint, got ${typeof value}`);
|
|
1443
1480
|
}
|
|
1444
|
-
return
|
|
1481
|
+
return value;
|
|
1445
1482
|
case ArcisValueKind.Integer:
|
|
1446
|
-
if (typeof
|
|
1447
|
-
throw new TypeError(
|
|
1483
|
+
if (typeof value !== 'bigint') {
|
|
1484
|
+
throw new TypeError(`Field ${this.name} expected a bigint, got ${typeof value}`);
|
|
1448
1485
|
}
|
|
1449
|
-
if (
|
|
1450
|
-
throw new TypeError(
|
|
1486
|
+
if (this.info === undefined) {
|
|
1487
|
+
throw new TypeError(`Field ${this.name} is an integer, but signedness and width are unknown`);
|
|
1451
1488
|
}
|
|
1452
|
-
if (!this.info.
|
|
1453
|
-
|
|
1489
|
+
if (!this.info.isWithinBounds(value)) {
|
|
1490
|
+
const min = this.info.minValue();
|
|
1491
|
+
const max = this.info.signed ? (1n << (this.info.width - 1n)) - 1n : (1n << this.info.width) - 1n;
|
|
1492
|
+
throw new RangeError(`Field "${this.name}" (${this.info.name()}): value ${value} out of range [${min}, ${max}]`);
|
|
1454
1493
|
}
|
|
1455
|
-
return
|
|
1456
|
-
case ArcisValueKind.Pubkey:
|
|
1457
|
-
if (!(
|
|
1458
|
-
throw new TypeError(
|
|
1494
|
+
return value - this.info.minValue();
|
|
1495
|
+
case ArcisValueKind.Pubkey: {
|
|
1496
|
+
if (!(value instanceof Uint8Array)) {
|
|
1497
|
+
throw new TypeError(`Field ${this.name} expected a Uint8Array, got ${typeof value}`);
|
|
1459
1498
|
}
|
|
1460
|
-
|
|
1499
|
+
if (value.length !== PUBKEY_BYTE_LENGTH) {
|
|
1500
|
+
throw new RangeError(`Field ${this.name} expected ${PUBKEY_BYTE_LENGTH}-byte Uint8Array, got ${value.length} bytes`);
|
|
1501
|
+
}
|
|
1502
|
+
let pubkeyResult = 0n;
|
|
1503
|
+
for (let i = 0; i < PUBKEY_BYTE_LENGTH; i++) {
|
|
1504
|
+
pubkeyResult |= BigInt(value[i]) << BigInt(i * 8);
|
|
1505
|
+
}
|
|
1506
|
+
return pubkeyResult;
|
|
1507
|
+
}
|
|
1508
|
+
default: {
|
|
1509
|
+
const _exhaustive = this.kind;
|
|
1510
|
+
throw new Error(`Unhandled ArcisValueKind: ${_exhaustive}`);
|
|
1511
|
+
}
|
|
1461
1512
|
}
|
|
1462
1513
|
}
|
|
1463
1514
|
fromBigInt(arg) {
|
|
@@ -1469,20 +1520,57 @@ class ArcisValueField {
|
|
|
1469
1520
|
case 1n:
|
|
1470
1521
|
return true;
|
|
1471
1522
|
default:
|
|
1472
|
-
throw new
|
|
1523
|
+
throw new RangeError(`Field ${this.name}: Bool must be 0 or 1, got ${arg}`);
|
|
1473
1524
|
}
|
|
1474
1525
|
case ArcisValueKind.Float:
|
|
1475
|
-
return
|
|
1526
|
+
return decodeRescueDecryptedToNumber(arg);
|
|
1476
1527
|
case ArcisValueKind.FullInteger:
|
|
1477
1528
|
return arg;
|
|
1478
1529
|
case ArcisValueKind.Integer:
|
|
1479
|
-
if (this.info
|
|
1480
|
-
throw TypeError("Integer type without integer info");
|
|
1530
|
+
if (this.info === undefined) {
|
|
1531
|
+
throw new TypeError("Integer type without integer info");
|
|
1481
1532
|
}
|
|
1482
1533
|
return arg + this.info.minValue();
|
|
1483
|
-
case ArcisValueKind.Pubkey:
|
|
1484
|
-
|
|
1534
|
+
case ArcisValueKind.Pubkey: {
|
|
1535
|
+
if (arg < 0n) {
|
|
1536
|
+
throw new RangeError(`Field ${this.name}: Pubkey cannot be negative`);
|
|
1537
|
+
}
|
|
1538
|
+
if (arg >= PUBKEY_MAX_VALUE) {
|
|
1539
|
+
throw new RangeError(`Field ${this.name}: Pubkey exceeds 256 bits`);
|
|
1540
|
+
}
|
|
1541
|
+
const pubkeyBytes = new Uint8Array(PUBKEY_BYTE_LENGTH);
|
|
1542
|
+
let remaining = arg;
|
|
1543
|
+
for (let i = 0; i < PUBKEY_BYTE_LENGTH; i++) {
|
|
1544
|
+
pubkeyBytes[i] = Number(remaining & 0xffn);
|
|
1545
|
+
remaining >>= 8n;
|
|
1546
|
+
}
|
|
1547
|
+
return pubkeyBytes;
|
|
1548
|
+
}
|
|
1549
|
+
default: {
|
|
1550
|
+
const _exhaustive = this.kind;
|
|
1551
|
+
throw new Error(`Unhandled ArcisValueKind: ${_exhaustive}`);
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1555
|
+
static fromFieldInfo(info) {
|
|
1556
|
+
const name = info.name;
|
|
1557
|
+
if (info.type === 'Bool') {
|
|
1558
|
+
return new ArcisValueField(name, ArcisValueKind.Bool);
|
|
1559
|
+
}
|
|
1560
|
+
if (info.type === 'FullInteger') {
|
|
1561
|
+
return new ArcisValueField(name, ArcisValueKind.FullInteger);
|
|
1485
1562
|
}
|
|
1563
|
+
if (info.type === 'Float') {
|
|
1564
|
+
return new ArcisValueField(name, ArcisValueKind.Float);
|
|
1565
|
+
}
|
|
1566
|
+
if (info.type === 'Pubkey') {
|
|
1567
|
+
return new ArcisValueField(name, ArcisValueKind.Pubkey);
|
|
1568
|
+
}
|
|
1569
|
+
if (typeof info.type === 'object' && 'Integer' in info.type) {
|
|
1570
|
+
const intInfo = new IntegerInfo(info.type.Integer.signed, BigInt(info.type.Integer.width));
|
|
1571
|
+
return new ArcisValueField(name, ArcisValueKind.Integer, intInfo);
|
|
1572
|
+
}
|
|
1573
|
+
throw new TypeError(`Unknown field type for ${name}`);
|
|
1486
1574
|
}
|
|
1487
1575
|
toDataSize(index) {
|
|
1488
1576
|
switch (this.kind) {
|
|
@@ -1507,6 +1595,9 @@ class ArcisType {
|
|
|
1507
1595
|
this.fields = fields;
|
|
1508
1596
|
}
|
|
1509
1597
|
pack(rawData) {
|
|
1598
|
+
if (rawData.length !== this.fields.length) {
|
|
1599
|
+
throw new RangeError(`Expected ${this.fields.length} fields, got ${rawData.length}`);
|
|
1600
|
+
}
|
|
1510
1601
|
const data = rawData.map((val, index) => this.fields[index].toBigInt(val));
|
|
1511
1602
|
const dataSizes = this.fields.map((field, index) => field.toDataSize(index));
|
|
1512
1603
|
const packing = arcisPacking(dataSizes);
|
|
@@ -1521,11 +1612,14 @@ class ArcisType {
|
|
|
1521
1612
|
unpack(packed) {
|
|
1522
1613
|
const dataSizes = this.fields.map((field, index) => field.toDataSize(index));
|
|
1523
1614
|
const packing = arcisPacking(dataSizes);
|
|
1615
|
+
if (packed.length < packing[0]) {
|
|
1616
|
+
throw new RangeError(`Expected at least ${packing[0]} packed elements, got ${packed.length}`);
|
|
1617
|
+
}
|
|
1524
1618
|
const res = [];
|
|
1525
1619
|
for (let idx = 0; idx < dataSizes.length; idx++) {
|
|
1526
1620
|
const packLocation = packing[1][idx];
|
|
1527
1621
|
const dataSize = dataSizes[idx];
|
|
1528
|
-
const val = dataSize.
|
|
1622
|
+
const val = dataSize.isFull ? packed[packLocation.index] : (packed[packLocation.index] >> BigInt(packLocation.offset)) % (1n << BigInt(dataSize.size));
|
|
1529
1623
|
res.push(this.fields[idx].fromBigInt(val));
|
|
1530
1624
|
}
|
|
1531
1625
|
return res;
|
|
@@ -1557,10 +1651,76 @@ class ArcisModule {
|
|
|
1557
1651
|
}
|
|
1558
1652
|
}
|
|
1559
1653
|
|
|
1560
|
-
|
|
1654
|
+
function parseFieldName(name) {
|
|
1655
|
+
const match = name.match(/^(.+)\[(\d+)\]$/);
|
|
1656
|
+
if (match) {
|
|
1657
|
+
return { base: match[1], index: parseInt(match[2], 10) };
|
|
1658
|
+
}
|
|
1659
|
+
return { base: name, index: null };
|
|
1660
|
+
}
|
|
1661
|
+
function extractValue(data, fieldName) {
|
|
1662
|
+
const { base, index } = parseFieldName(fieldName);
|
|
1663
|
+
const value = data[base];
|
|
1664
|
+
if (index !== null) {
|
|
1665
|
+
if (!Array.isArray(value)) {
|
|
1666
|
+
throw new TypeError(`Field "${base}" should be an array`);
|
|
1667
|
+
}
|
|
1668
|
+
if (index >= value.length) {
|
|
1669
|
+
throw new RangeError(`Field "${base}[${index}]" out of bounds (array length: ${value.length})`);
|
|
1670
|
+
}
|
|
1671
|
+
return value[index];
|
|
1672
|
+
}
|
|
1673
|
+
return value;
|
|
1674
|
+
}
|
|
1675
|
+
function groupUnpackedValues(values, fieldNames) {
|
|
1676
|
+
const result = {};
|
|
1677
|
+
for (let i = 0; i < fieldNames.length; i++) {
|
|
1678
|
+
const { base, index } = parseFieldName(fieldNames[i]);
|
|
1679
|
+
const value = values[i];
|
|
1680
|
+
if (index !== null) {
|
|
1681
|
+
if (!result[base]) {
|
|
1682
|
+
result[base] = [];
|
|
1683
|
+
}
|
|
1684
|
+
result[base][index] = value;
|
|
1685
|
+
}
|
|
1686
|
+
else {
|
|
1687
|
+
result[base] = value;
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
return result;
|
|
1691
|
+
}
|
|
1692
|
+
/**
|
|
1693
|
+
* Creates a type-safe packer from field definitions.
|
|
1694
|
+
* Use `as const` on the fields array for compile-time field name validation.
|
|
1695
|
+
* @param fields - Field definitions from generated code.
|
|
1696
|
+
* @param typeName - Type name for debugging.
|
|
1697
|
+
*/
|
|
1698
|
+
function createPacker(fields, typeName = 'Packer') {
|
|
1699
|
+
const arcisFields = fields.map(f => ArcisValueField.fromFieldInfo(f));
|
|
1700
|
+
const arcisType = new ArcisType(typeName, arcisFields);
|
|
1701
|
+
const fieldNames = fields.map(f => f.name);
|
|
1702
|
+
return {
|
|
1703
|
+
pack(data) {
|
|
1704
|
+
const arr = fieldNames.map(name => {
|
|
1705
|
+
const value = extractValue(data, name);
|
|
1706
|
+
if (value === undefined) {
|
|
1707
|
+
throw new Error(`Missing required field: "${name}"`);
|
|
1708
|
+
}
|
|
1709
|
+
return value;
|
|
1710
|
+
});
|
|
1711
|
+
return arcisType.pack(arr);
|
|
1712
|
+
},
|
|
1713
|
+
unpack(packed) {
|
|
1714
|
+
const arr = arcisType.unpack(packed);
|
|
1715
|
+
return groupUnpackedValues(arr, fieldNames);
|
|
1716
|
+
}
|
|
1717
|
+
};
|
|
1718
|
+
}
|
|
1719
|
+
|
|
1720
|
+
var address = "Arcj82pX7HxYKLR92qvgZUAd7vGS1k4hQvAFcPATFdEQ";
|
|
1561
1721
|
var metadata = {
|
|
1562
1722
|
name: "arcium",
|
|
1563
|
-
version: "0.6.
|
|
1723
|
+
version: "0.6.2",
|
|
1564
1724
|
spec: "0.1.0",
|
|
1565
1725
|
description: "The Arcium program"
|
|
1566
1726
|
};
|
|
@@ -2733,18 +2893,24 @@ var instructions = [
|
|
|
2733
2893
|
{
|
|
2734
2894
|
kind: "const",
|
|
2735
2895
|
value: [
|
|
2736
|
-
|
|
2896
|
+
77,
|
|
2737
2897
|
120,
|
|
2738
2898
|
101,
|
|
2739
|
-
|
|
2740
|
-
114,
|
|
2899
|
+
82,
|
|
2741
2900
|
101,
|
|
2742
2901
|
99,
|
|
2743
2902
|
111,
|
|
2744
2903
|
118,
|
|
2745
2904
|
101,
|
|
2746
2905
|
114,
|
|
2747
|
-
121
|
|
2906
|
+
121,
|
|
2907
|
+
65,
|
|
2908
|
+
99,
|
|
2909
|
+
99,
|
|
2910
|
+
111,
|
|
2911
|
+
117,
|
|
2912
|
+
110,
|
|
2913
|
+
116
|
|
2748
2914
|
]
|
|
2749
2915
|
},
|
|
2750
2916
|
{
|
|
@@ -3510,18 +3676,24 @@ var instructions = [
|
|
|
3510
3676
|
{
|
|
3511
3677
|
kind: "const",
|
|
3512
3678
|
value: [
|
|
3513
|
-
|
|
3679
|
+
77,
|
|
3514
3680
|
120,
|
|
3515
3681
|
101,
|
|
3516
|
-
|
|
3517
|
-
114,
|
|
3682
|
+
82,
|
|
3518
3683
|
101,
|
|
3519
3684
|
99,
|
|
3520
3685
|
111,
|
|
3521
3686
|
118,
|
|
3522
3687
|
101,
|
|
3523
3688
|
114,
|
|
3524
|
-
121
|
|
3689
|
+
121,
|
|
3690
|
+
65,
|
|
3691
|
+
99,
|
|
3692
|
+
99,
|
|
3693
|
+
111,
|
|
3694
|
+
117,
|
|
3695
|
+
110,
|
|
3696
|
+
116
|
|
3525
3697
|
]
|
|
3526
3698
|
},
|
|
3527
3699
|
{
|
|
@@ -3865,18 +4037,24 @@ var instructions = [
|
|
|
3865
4037
|
{
|
|
3866
4038
|
kind: "const",
|
|
3867
4039
|
value: [
|
|
3868
|
-
|
|
4040
|
+
77,
|
|
3869
4041
|
120,
|
|
3870
4042
|
101,
|
|
3871
|
-
|
|
3872
|
-
114,
|
|
4043
|
+
82,
|
|
3873
4044
|
101,
|
|
3874
4045
|
99,
|
|
3875
4046
|
111,
|
|
3876
4047
|
118,
|
|
3877
4048
|
101,
|
|
3878
4049
|
114,
|
|
3879
|
-
121
|
|
4050
|
+
121,
|
|
4051
|
+
65,
|
|
4052
|
+
99,
|
|
4053
|
+
99,
|
|
4054
|
+
111,
|
|
4055
|
+
117,
|
|
4056
|
+
110,
|
|
4057
|
+
116
|
|
3880
4058
|
]
|
|
3881
4059
|
},
|
|
3882
4060
|
{
|
|
@@ -4979,18 +5157,24 @@ var instructions = [
|
|
|
4979
5157
|
{
|
|
4980
5158
|
kind: "const",
|
|
4981
5159
|
value: [
|
|
4982
|
-
|
|
5160
|
+
77,
|
|
4983
5161
|
120,
|
|
4984
5162
|
101,
|
|
4985
|
-
|
|
4986
|
-
114,
|
|
5163
|
+
82,
|
|
4987
5164
|
101,
|
|
4988
5165
|
99,
|
|
4989
5166
|
111,
|
|
4990
5167
|
118,
|
|
4991
5168
|
101,
|
|
4992
5169
|
114,
|
|
4993
|
-
121
|
|
5170
|
+
121,
|
|
5171
|
+
65,
|
|
5172
|
+
99,
|
|
5173
|
+
99,
|
|
5174
|
+
111,
|
|
5175
|
+
117,
|
|
5176
|
+
110,
|
|
5177
|
+
116
|
|
4994
5178
|
]
|
|
4995
5179
|
},
|
|
4996
5180
|
{
|
|
@@ -5152,18 +5336,24 @@ var instructions = [
|
|
|
5152
5336
|
{
|
|
5153
5337
|
kind: "const",
|
|
5154
5338
|
value: [
|
|
5155
|
-
|
|
5339
|
+
77,
|
|
5156
5340
|
120,
|
|
5157
5341
|
101,
|
|
5158
|
-
|
|
5159
|
-
114,
|
|
5342
|
+
82,
|
|
5160
5343
|
101,
|
|
5161
5344
|
99,
|
|
5162
5345
|
111,
|
|
5163
5346
|
118,
|
|
5164
5347
|
101,
|
|
5165
5348
|
114,
|
|
5166
|
-
121
|
|
5349
|
+
121,
|
|
5350
|
+
65,
|
|
5351
|
+
99,
|
|
5352
|
+
99,
|
|
5353
|
+
111,
|
|
5354
|
+
117,
|
|
5355
|
+
110,
|
|
5356
|
+
116
|
|
5167
5357
|
]
|
|
5168
5358
|
},
|
|
5169
5359
|
{
|
|
@@ -7320,18 +7510,24 @@ var instructions = [
|
|
|
7320
7510
|
{
|
|
7321
7511
|
kind: "const",
|
|
7322
7512
|
value: [
|
|
7323
|
-
|
|
7513
|
+
77,
|
|
7324
7514
|
120,
|
|
7325
7515
|
101,
|
|
7326
|
-
|
|
7327
|
-
114,
|
|
7516
|
+
82,
|
|
7328
7517
|
101,
|
|
7329
7518
|
99,
|
|
7330
7519
|
111,
|
|
7331
7520
|
118,
|
|
7332
7521
|
101,
|
|
7333
7522
|
114,
|
|
7334
|
-
121
|
|
7523
|
+
121,
|
|
7524
|
+
65,
|
|
7525
|
+
99,
|
|
7526
|
+
99,
|
|
7527
|
+
111,
|
|
7528
|
+
117,
|
|
7529
|
+
110,
|
|
7530
|
+
116
|
|
7335
7531
|
]
|
|
7336
7532
|
},
|
|
7337
7533
|
{
|
|
@@ -8560,18 +8756,24 @@ var instructions = [
|
|
|
8560
8756
|
{
|
|
8561
8757
|
kind: "const",
|
|
8562
8758
|
value: [
|
|
8563
|
-
|
|
8759
|
+
77,
|
|
8564
8760
|
120,
|
|
8565
8761
|
101,
|
|
8566
|
-
|
|
8567
|
-
114,
|
|
8762
|
+
82,
|
|
8568
8763
|
101,
|
|
8569
8764
|
99,
|
|
8570
8765
|
111,
|
|
8571
8766
|
118,
|
|
8572
8767
|
101,
|
|
8573
8768
|
114,
|
|
8574
|
-
121
|
|
8769
|
+
121,
|
|
8770
|
+
65,
|
|
8771
|
+
99,
|
|
8772
|
+
99,
|
|
8773
|
+
111,
|
|
8774
|
+
117,
|
|
8775
|
+
110,
|
|
8776
|
+
116
|
|
8575
8777
|
]
|
|
8576
8778
|
},
|
|
8577
8779
|
{
|
|
@@ -9685,6 +9887,11 @@ var errors = [
|
|
|
9685
9887
|
code: 6713,
|
|
9686
9888
|
name: "BackupClusterNotSet",
|
|
9687
9889
|
msg: "Backup MXE cluster is not set"
|
|
9890
|
+
},
|
|
9891
|
+
{
|
|
9892
|
+
code: 6714,
|
|
9893
|
+
name: "ShareAlreadySubmitted",
|
|
9894
|
+
msg: "Share already submitted"
|
|
9688
9895
|
}
|
|
9689
9896
|
];
|
|
9690
9897
|
var types = [
|
|
@@ -11545,17 +11752,11 @@ var types = [
|
|
|
11545
11752
|
kind: "struct",
|
|
11546
11753
|
fields: [
|
|
11547
11754
|
{
|
|
11548
|
-
name: "
|
|
11755
|
+
name: "key_recovery_finalize_offset",
|
|
11549
11756
|
docs: [
|
|
11550
|
-
"
|
|
11551
|
-
"Bit index corresponds to the index in the original MXE's recovery_peers array."
|
|
11757
|
+
"The computation offset for the queued key_recovery_finalize circuit."
|
|
11552
11758
|
],
|
|
11553
|
-
type:
|
|
11554
|
-
array: [
|
|
11555
|
-
"u8",
|
|
11556
|
-
13
|
|
11557
|
-
]
|
|
11558
|
-
}
|
|
11759
|
+
type: "u64"
|
|
11559
11760
|
},
|
|
11560
11761
|
{
|
|
11561
11762
|
name: "shares",
|
|
@@ -11581,52 +11782,32 @@ var types = [
|
|
|
11581
11782
|
}
|
|
11582
11783
|
},
|
|
11583
11784
|
{
|
|
11584
|
-
name: "
|
|
11585
|
-
|
|
11586
|
-
"Whether the recovery has been finalized (threshold met and marked ready)."
|
|
11587
|
-
],
|
|
11588
|
-
type: "u8"
|
|
11785
|
+
name: "original_mxe_pubkey",
|
|
11786
|
+
type: "pubkey"
|
|
11589
11787
|
},
|
|
11590
11788
|
{
|
|
11591
|
-
name: "
|
|
11592
|
-
|
|
11593
|
-
"Padding for u64 alignment (need 5 bytes to align key_recovery_final_offset at 8-byte",
|
|
11594
|
-
"boundary)"
|
|
11595
|
-
],
|
|
11596
|
-
type: {
|
|
11597
|
-
array: [
|
|
11598
|
-
"u8",
|
|
11599
|
-
2
|
|
11600
|
-
]
|
|
11601
|
-
}
|
|
11789
|
+
name: "backup_mxe_pubkey",
|
|
11790
|
+
type: "pubkey"
|
|
11602
11791
|
},
|
|
11603
11792
|
{
|
|
11604
|
-
name: "
|
|
11793
|
+
name: "is_finalized",
|
|
11605
11794
|
docs: [
|
|
11606
|
-
"
|
|
11795
|
+
"Whether the recovery has been finalized (threshold met and marked ready)."
|
|
11607
11796
|
],
|
|
11608
|
-
type: "
|
|
11797
|
+
type: "u8"
|
|
11609
11798
|
},
|
|
11610
11799
|
{
|
|
11611
11800
|
name: "_padding2",
|
|
11612
11801
|
docs: [
|
|
11613
|
-
"Padding to ensure struct size is
|
|
11802
|
+
"Padding to ensure struct size is u64 aligned (6 bytes)"
|
|
11614
11803
|
],
|
|
11615
11804
|
type: {
|
|
11616
11805
|
array: [
|
|
11617
11806
|
"u8",
|
|
11618
|
-
|
|
11807
|
+
6
|
|
11619
11808
|
]
|
|
11620
11809
|
}
|
|
11621
11810
|
},
|
|
11622
|
-
{
|
|
11623
|
-
name: "original_mxe_pubkey",
|
|
11624
|
-
type: "pubkey"
|
|
11625
|
-
},
|
|
11626
|
-
{
|
|
11627
|
-
name: "backup_mxe_pubkey",
|
|
11628
|
-
type: "pubkey"
|
|
11629
|
-
},
|
|
11630
11811
|
{
|
|
11631
11812
|
name: "bump",
|
|
11632
11813
|
type: "u8"
|
|
@@ -12615,7 +12796,7 @@ const RECOVERY_CLUSTER_ACC_SEED = 'RecoveryClusterAccount';
|
|
|
12615
12796
|
* Seed for MxeRecoveryAccount PDA
|
|
12616
12797
|
* @constant {string}
|
|
12617
12798
|
*/
|
|
12618
|
-
const MXE_RECOVERY_ACC_SEED = '
|
|
12799
|
+
const MXE_RECOVERY_ACC_SEED = 'MxeRecoveryAccount';
|
|
12619
12800
|
/**
|
|
12620
12801
|
* Maximum number of bytes that can be reallocated per instruction.
|
|
12621
12802
|
* @constant {number}
|
|
@@ -13452,8 +13633,10 @@ exports.Aes192Cipher = Aes192Cipher;
|
|
|
13452
13633
|
exports.Aes256Cipher = Aes256Cipher;
|
|
13453
13634
|
exports.ArcisModule = ArcisModule;
|
|
13454
13635
|
exports.ArcisType = ArcisType;
|
|
13636
|
+
exports.ArcisValueField = ArcisValueField;
|
|
13455
13637
|
exports.CURVE25519_BASE_FIELD = CURVE25519_BASE_FIELD;
|
|
13456
13638
|
exports.CURVE25519_SCALAR_FIELD_MODULUS = CURVE25519_SCALAR_FIELD_MODULUS;
|
|
13639
|
+
exports.IntegerInfo = IntegerInfo;
|
|
13457
13640
|
exports.Matrix = Matrix;
|
|
13458
13641
|
exports.RescueCipher = RescueCipher;
|
|
13459
13642
|
exports.RescueDesc = RescueDesc;
|
|
@@ -13461,6 +13644,7 @@ exports.RescuePrimeHash = RescuePrimeHash;
|
|
|
13461
13644
|
exports.arcisEd25519 = arcisEd25519;
|
|
13462
13645
|
exports.awaitComputationFinalization = awaitComputationFinalization;
|
|
13463
13646
|
exports.buildFinalizeCompDefTx = buildFinalizeCompDefTx;
|
|
13647
|
+
exports.createPacker = createPacker;
|
|
13464
13648
|
exports.deserializeLE = deserializeLE;
|
|
13465
13649
|
exports.finalizeKeyRecoveryExecution = finalizeKeyRecoveryExecution;
|
|
13466
13650
|
exports.generateRandomFieldElem = generateRandomFieldElem;
|