@arcium-hq/client 0.10.1 → 0.10.3
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 +1 -1
- package/build/index.cjs +6 -12
- package/build/index.mjs +7 -13
- package/build/types/idl/arcium.d.ts +1 -1
- package/build/types/pda.d.ts +1 -2
- package/build/types/pda.d.ts.map +1 -1
- package/build/types/utils.d.ts +1 -1
- package/build/types/utils.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/idl/arcium.json +1 -1
- package/src/idl/arcium.ts +1 -1
- package/src/pda.ts +2 -7
- package/src/utils.ts +3 -4
package/README.md
CHANGED
package/build/index.cjs
CHANGED
|
@@ -4,10 +4,10 @@ var crypto = require('crypto');
|
|
|
4
4
|
var ed25519 = require('@noble/curves/ed25519');
|
|
5
5
|
var sha3 = require('@noble/hashes/sha3');
|
|
6
6
|
var modular = require('@noble/curves/abstract/modular');
|
|
7
|
-
var anchor = require('@anchor-lang/core');
|
|
8
7
|
var utils = require('@noble/hashes/utils');
|
|
9
8
|
var edwards = require('@noble/curves/abstract/edwards');
|
|
10
9
|
var fs = require('fs');
|
|
10
|
+
var anchor = require('@anchor-lang/core');
|
|
11
11
|
var web3_js = require('@solana/web3.js');
|
|
12
12
|
|
|
13
13
|
function _interopNamespaceDefault(e) {
|
|
@@ -309,9 +309,8 @@ function decodeRescueDecryptedToNumber(v) {
|
|
|
309
309
|
* @returns true if the reference is null, false otherwise.
|
|
310
310
|
*/
|
|
311
311
|
function isNullRef(ref) {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
&& ref.priorityFee === bigZero);
|
|
312
|
+
return (ref.computationOffset.isZero()
|
|
313
|
+
&& ref.priorityFee.isZero());
|
|
315
314
|
}
|
|
316
315
|
|
|
317
316
|
/**
|
|
@@ -1884,7 +1883,7 @@ function createPacker(fields, typeName = 'Packer') {
|
|
|
1884
1883
|
var address = "Arcj82pX7HxYKLR92qvgZUAd7vGS1k4hQvAFcPATFdEQ";
|
|
1885
1884
|
var metadata = {
|
|
1886
1885
|
name: "arcium",
|
|
1887
|
-
version: "0.10.
|
|
1886
|
+
version: "0.10.3",
|
|
1888
1887
|
spec: "0.1.0",
|
|
1889
1888
|
description: "The Arcium program"
|
|
1890
1889
|
};
|
|
@@ -15456,16 +15455,11 @@ function getRecoveryClusterAccAddress(mxeProgramId) {
|
|
|
15456
15455
|
}
|
|
15457
15456
|
/**
|
|
15458
15457
|
* Derive the MXE recovery account address for a key recovery session.
|
|
15459
|
-
* @param backupMxeProgramId - Public key of the backup MXE program that will take over.
|
|
15460
15458
|
* @param originalMxeProgramId - Public key of the original MXE program being recovered.
|
|
15461
15459
|
* @returns Derived MXE recovery account public key.
|
|
15462
15460
|
*/
|
|
15463
|
-
function getMxeRecoveryAccAddress(
|
|
15464
|
-
const seeds = [
|
|
15465
|
-
Buffer.from(MXE_RECOVERY_ACC_SEED),
|
|
15466
|
-
backupMxeProgramId.toBuffer(),
|
|
15467
|
-
originalMxeProgramId.toBuffer(),
|
|
15468
|
-
];
|
|
15461
|
+
function getMxeRecoveryAccAddress(originalMxeProgramId) {
|
|
15462
|
+
const seeds = [Buffer.from(MXE_RECOVERY_ACC_SEED), originalMxeProgramId.toBuffer()];
|
|
15469
15463
|
return generateArciumPDAFrom(seeds)[0];
|
|
15470
15464
|
}
|
|
15471
15465
|
/**
|
package/build/index.mjs
CHANGED
|
@@ -3,11 +3,11 @@ import { ed25519 } from '@noble/curves/ed25519';
|
|
|
3
3
|
export { x25519 } from '@noble/curves/ed25519';
|
|
4
4
|
import { shake256, sha3_512 } from '@noble/hashes/sha3';
|
|
5
5
|
import { invert, mod, isNegativeLE, pow2 } from '@noble/curves/abstract/modular';
|
|
6
|
-
import * as anchor from '@anchor-lang/core';
|
|
7
|
-
import { Program } from '@anchor-lang/core';
|
|
8
6
|
import { randomBytes as randomBytes$1 } from '@noble/hashes/utils';
|
|
9
7
|
import { twistedEdwards } from '@noble/curves/abstract/edwards';
|
|
10
8
|
import fs from 'fs';
|
|
9
|
+
import * as anchor from '@anchor-lang/core';
|
|
10
|
+
import { Program } from '@anchor-lang/core';
|
|
11
11
|
import { PublicKey, AddressLookupTableProgram } from '@solana/web3.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -290,9 +290,8 @@ function decodeRescueDecryptedToNumber(v) {
|
|
|
290
290
|
* @returns true if the reference is null, false otherwise.
|
|
291
291
|
*/
|
|
292
292
|
function isNullRef(ref) {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
&& ref.priorityFee === bigZero);
|
|
293
|
+
return (ref.computationOffset.isZero()
|
|
294
|
+
&& ref.priorityFee.isZero());
|
|
296
295
|
}
|
|
297
296
|
|
|
298
297
|
/**
|
|
@@ -1865,7 +1864,7 @@ function createPacker(fields, typeName = 'Packer') {
|
|
|
1865
1864
|
var address = "Arcj82pX7HxYKLR92qvgZUAd7vGS1k4hQvAFcPATFdEQ";
|
|
1866
1865
|
var metadata = {
|
|
1867
1866
|
name: "arcium",
|
|
1868
|
-
version: "0.10.
|
|
1867
|
+
version: "0.10.3",
|
|
1869
1868
|
spec: "0.1.0",
|
|
1870
1869
|
description: "The Arcium program"
|
|
1871
1870
|
};
|
|
@@ -15437,16 +15436,11 @@ function getRecoveryClusterAccAddress(mxeProgramId) {
|
|
|
15437
15436
|
}
|
|
15438
15437
|
/**
|
|
15439
15438
|
* Derive the MXE recovery account address for a key recovery session.
|
|
15440
|
-
* @param backupMxeProgramId - Public key of the backup MXE program that will take over.
|
|
15441
15439
|
* @param originalMxeProgramId - Public key of the original MXE program being recovered.
|
|
15442
15440
|
* @returns Derived MXE recovery account public key.
|
|
15443
15441
|
*/
|
|
15444
|
-
function getMxeRecoveryAccAddress(
|
|
15445
|
-
const seeds = [
|
|
15446
|
-
Buffer.from(MXE_RECOVERY_ACC_SEED),
|
|
15447
|
-
backupMxeProgramId.toBuffer(),
|
|
15448
|
-
originalMxeProgramId.toBuffer(),
|
|
15449
|
-
];
|
|
15442
|
+
function getMxeRecoveryAccAddress(originalMxeProgramId) {
|
|
15443
|
+
const seeds = [Buffer.from(MXE_RECOVERY_ACC_SEED), originalMxeProgramId.toBuffer()];
|
|
15450
15444
|
return generateArciumPDAFrom(seeds)[0];
|
|
15451
15445
|
}
|
|
15452
15446
|
/**
|
package/build/types/pda.d.ts
CHANGED
|
@@ -67,11 +67,10 @@ export declare function getCompDefAccAddress(mxeProgramId: PublicKey, compDefOff
|
|
|
67
67
|
export declare function getRecoveryClusterAccAddress(mxeProgramId: PublicKey): PublicKey;
|
|
68
68
|
/**
|
|
69
69
|
* Derive the MXE recovery account address for a key recovery session.
|
|
70
|
-
* @param backupMxeProgramId - Public key of the backup MXE program that will take over.
|
|
71
70
|
* @param originalMxeProgramId - Public key of the original MXE program being recovered.
|
|
72
71
|
* @returns Derived MXE recovery account public key.
|
|
73
72
|
*/
|
|
74
|
-
export declare function getMxeRecoveryAccAddress(
|
|
73
|
+
export declare function getMxeRecoveryAccAddress(originalMxeProgramId: PublicKey): PublicKey;
|
|
75
74
|
/**
|
|
76
75
|
* Derive the raw circuit account address for a given computation definition and index.
|
|
77
76
|
* @param compDefPubkey - Public key of the computation definition account.
|
package/build/types/pda.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pda.d.ts","sourceRoot":"","sources":["../../src/pda.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA6B,MAAM,iBAAiB,CAAC;AACvE,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAkB5C;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,SAAS,CAE9C;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,aAAa,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,CAAC,EAAE,GAAG,SAAS,CAMvG;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,CAMrE;AAED;;;;GAIG;AACH,wBAAgB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BAAoB,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,CAMrE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAMlE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,SAAS,GAAG,SAAS,CAInE;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,GAAG,SAAS,CAM9F;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,YAAY,EAAE,SAAS,GAAG,SAAS,CAG/E;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,oBAAoB,EAAE,SAAS,GAAG,SAAS,CAGnF;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,aAAa,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,GAAG,SAAS,CAOpG;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,GAAG,SAAS,CAK9F"}
|
package/build/types/utils.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAGjD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C;;;GAGG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAKnC;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,UAAU,CAAC,OAAO,OAAO,CAAC,GAAG,CAAC,QAKhF;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAI9C;AAED;;GAEG;AACH,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAE5C;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAoB9E;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAK/D;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAG/D;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,sBAAsB,CAAC,CAAC;AAE1F;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAK5D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcium-hq/client",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.3",
|
|
4
4
|
"description": "Client SDK for interacting with encrypted Solana programs",
|
|
5
5
|
"author": "Arcium",
|
|
6
6
|
"license": "GPL-3.0-only",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"typescript-eslint": "^8.15.0"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@anchor-lang/core": "^1.0.
|
|
61
|
+
"@anchor-lang/core": "^1.0.2",
|
|
62
62
|
"@noble/curves": "^1.9.5",
|
|
63
63
|
"@noble/hashes": "^1.7.1",
|
|
64
64
|
"@solana/web3.js": "^1.95.4"
|
package/src/idl/arcium.json
CHANGED
package/src/idl/arcium.ts
CHANGED
package/src/pda.ts
CHANGED
|
@@ -149,16 +149,11 @@ export function getRecoveryClusterAccAddress(mxeProgramId: PublicKey): PublicKey
|
|
|
149
149
|
|
|
150
150
|
/**
|
|
151
151
|
* Derive the MXE recovery account address for a key recovery session.
|
|
152
|
-
* @param backupMxeProgramId - Public key of the backup MXE program that will take over.
|
|
153
152
|
* @param originalMxeProgramId - Public key of the original MXE program being recovered.
|
|
154
153
|
* @returns Derived MXE recovery account public key.
|
|
155
154
|
*/
|
|
156
|
-
export function getMxeRecoveryAccAddress(
|
|
157
|
-
const seeds = [
|
|
158
|
-
Buffer.from(MXE_RECOVERY_ACC_SEED),
|
|
159
|
-
backupMxeProgramId.toBuffer(),
|
|
160
|
-
originalMxeProgramId.toBuffer(),
|
|
161
|
-
];
|
|
155
|
+
export function getMxeRecoveryAccAddress(originalMxeProgramId: PublicKey): PublicKey {
|
|
156
|
+
const seeds = [Buffer.from(MXE_RECOVERY_ACC_SEED), originalMxeProgramId.toBuffer()];
|
|
162
157
|
return generateArciumPDAFrom(seeds)[0];
|
|
163
158
|
}
|
|
164
159
|
|
package/src/utils.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as anchor from '@anchor-lang/core';
|
|
1
|
+
import type * as anchor from '@anchor-lang/core';
|
|
2
2
|
import { CURVE25519_BASE_FIELD } from './cryptography/rescueDesc.js';
|
|
3
3
|
import { ctAdd, ctLt, ctSelect, ctSignBit, ctSub, verifyBinSize } from './ctUtils.js';
|
|
4
4
|
import { ArciumIdlType } from './idl/index.js';
|
|
@@ -118,9 +118,8 @@ export type ComputationReference = anchor.IdlTypes<ArciumIdlType>['computationRe
|
|
|
118
118
|
* @returns true if the reference is null, false otherwise.
|
|
119
119
|
*/
|
|
120
120
|
export function isNullRef(ref: ComputationReference): boolean {
|
|
121
|
-
const bigZero = new anchor.BN(0);
|
|
122
121
|
return (
|
|
123
|
-
ref.computationOffset
|
|
124
|
-
&& ref.priorityFee
|
|
122
|
+
ref.computationOffset.isZero()
|
|
123
|
+
&& ref.priorityFee.isZero()
|
|
125
124
|
);
|
|
126
125
|
}
|