@inco/js 0.1.25 → 0.1.26
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/lite/index.cjs +7 -5
- package/dist/lite/index.mjs +7 -5
- package/dist/lite/lightning.d.ts +6 -7
- package/package.json +1 -1
package/dist/lite/index.cjs
CHANGED
@@ -52442,18 +52442,23 @@ function getCovalidatorGrpcHelper(chain, network, cluster) {
|
|
52442
52442
|
class Lightning {
|
52443
52443
|
_deployment;
|
52444
52444
|
covalidatorUrl;
|
52445
|
+
executorAddress;
|
52446
|
+
eciesPublicKey;
|
52447
|
+
chainId;
|
52445
52448
|
encryptor;
|
52446
52449
|
ephemeralKeypair;
|
52447
52450
|
kmsClient;
|
52448
52451
|
constructor(_deployment, covalidatorUrl) {
|
52449
52452
|
this._deployment = _deployment;
|
52450
52453
|
this.covalidatorUrl = covalidatorUrl;
|
52454
|
+
this.executorAddress = parseAddress(_deployment.executorAddress);
|
52455
|
+
this.eciesPublicKey = parse3(HexString, _deployment.eciesPublicKey);
|
52456
|
+
this.chainId = BigInt(_deployment.chainId);
|
52451
52457
|
this.ephemeralKeypair = generateSecp256k1Keypair();
|
52452
|
-
const eciesPubKey = decodeSecp256k1PublicKey(hexToBytes(parse3(HexString, _deployment.eciesPublicKey)));
|
52453
52458
|
this.kmsClient = getKmsClient(covalidatorUrl);
|
52454
52459
|
this.encryptor = getEciesEncryptor({
|
52455
52460
|
scheme: encryptionSchemes.ecies,
|
52456
|
-
pubKeyA:
|
52461
|
+
pubKeyA: decodeSecp256k1PublicKey(hexToBytes(parse3(HexString, _deployment.eciesPublicKey))),
|
52457
52462
|
privKeyB: this.ephemeralKeypair
|
52458
52463
|
});
|
52459
52464
|
}
|
@@ -52489,9 +52494,6 @@ class Lightning {
|
|
52489
52494
|
get deployment() {
|
52490
52495
|
return { ...this._deployment };
|
52491
52496
|
}
|
52492
|
-
get chainId() {
|
52493
|
-
return BigInt(this._deployment.chainId);
|
52494
|
-
}
|
52495
52497
|
async encrypt(value6, { accountAddress, dappAddress }) {
|
52496
52498
|
const { ciphertext } = await this.encryptor({
|
52497
52499
|
plaintext: Lightning.plaintextFromValue(value6),
|
package/dist/lite/index.mjs
CHANGED
@@ -71266,18 +71266,23 @@ function getCovalidatorGrpcHelper(chain, network, cluster) {
|
|
71266
71266
|
class Lightning {
|
71267
71267
|
_deployment;
|
71268
71268
|
covalidatorUrl;
|
71269
|
+
executorAddress;
|
71270
|
+
eciesPublicKey;
|
71271
|
+
chainId;
|
71269
71272
|
encryptor;
|
71270
71273
|
ephemeralKeypair;
|
71271
71274
|
kmsClient;
|
71272
71275
|
constructor(_deployment, covalidatorUrl) {
|
71273
71276
|
this._deployment = _deployment;
|
71274
71277
|
this.covalidatorUrl = covalidatorUrl;
|
71278
|
+
this.executorAddress = parseAddress(_deployment.executorAddress);
|
71279
|
+
this.eciesPublicKey = parse3(HexString, _deployment.eciesPublicKey);
|
71280
|
+
this.chainId = BigInt(_deployment.chainId);
|
71275
71281
|
this.ephemeralKeypair = generateSecp256k1Keypair();
|
71276
|
-
const eciesPubKey = decodeSecp256k1PublicKey(hexToBytes(parse3(HexString, _deployment.eciesPublicKey)));
|
71277
71282
|
this.kmsClient = getKmsClient(covalidatorUrl);
|
71278
71283
|
this.encryptor = getEciesEncryptor({
|
71279
71284
|
scheme: encryptionSchemes.ecies,
|
71280
|
-
pubKeyA:
|
71285
|
+
pubKeyA: decodeSecp256k1PublicKey(hexToBytes(parse3(HexString, _deployment.eciesPublicKey))),
|
71281
71286
|
privKeyB: this.ephemeralKeypair
|
71282
71287
|
});
|
71283
71288
|
}
|
@@ -71313,9 +71318,6 @@ class Lightning {
|
|
71313
71318
|
get deployment() {
|
71314
71319
|
return { ...this._deployment };
|
71315
71320
|
}
|
71316
|
-
get chainId() {
|
71317
|
-
return BigInt(this._deployment.chainId);
|
71318
|
-
}
|
71319
71321
|
async encrypt(value6, { accountAddress, dappAddress }) {
|
71320
71322
|
const { ciphertext } = await this.encryptor({
|
71321
71323
|
plaintext: Lightning.plaintextFromValue(value6),
|
package/dist/lite/lightning.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Account, Chain, Transport, WalletClient } from 'viem';
|
2
|
-
import { HexString } from '../binary';
|
2
|
+
import { Address, HexString } from '../binary';
|
3
3
|
import { EciesScheme } from '../encryption';
|
4
4
|
import { lightningDeployments } from '../generated/lightning';
|
5
5
|
import type { Reencryptor } from '../reencryption';
|
@@ -31,9 +31,12 @@ export type DeploymentSlice = {
|
|
31
31
|
* The Lightning class provides a convenient way to interact with the Inco Lightning contract by binding to a specific
|
32
32
|
* deployment.
|
33
33
|
*/
|
34
|
-
export declare class Lightning<T extends DeploymentSlice> {
|
34
|
+
export declare class Lightning<T extends DeploymentSlice = DeploymentSlice> {
|
35
35
|
private readonly _deployment;
|
36
36
|
readonly covalidatorUrl: string;
|
37
|
+
readonly executorAddress: Address;
|
38
|
+
readonly eciesPublicKey: HexString;
|
39
|
+
readonly chainId: bigint;
|
37
40
|
private readonly encryptor;
|
38
41
|
private readonly ephemeralKeypair;
|
39
42
|
private readonly kmsClient;
|
@@ -57,7 +60,7 @@ export declare class Lightning<T extends DeploymentSlice> {
|
|
57
60
|
eciesPublicKey: string;
|
58
61
|
chainId: bigint;
|
59
62
|
covalidatorUrl: string;
|
60
|
-
}): Lightning
|
63
|
+
}): Lightning;
|
61
64
|
/**
|
62
65
|
* Get the latest deployment for a given pepper, which usually denotes a family of deployments distinct from their
|
63
66
|
* version such as 'devnet', 'testnet', 'mainnet', etc.
|
@@ -76,10 +79,6 @@ export declare class Lightning<T extends DeploymentSlice> {
|
|
76
79
|
*/
|
77
80
|
static latest<P extends Pepper>(pepper: P, chainId: ChainId): Lightning<Deployment>;
|
78
81
|
get deployment(): T;
|
79
|
-
/**
|
80
|
-
* Get the chainId of the deployment to which this Lightning instance is bound.
|
81
|
-
*/
|
82
|
-
get chainId(): bigint;
|
83
82
|
/**
|
84
83
|
* Encrypt a value using the public ECIES key of the Lightning deployment.
|
85
84
|
*
|