@inco/js 0.9.0-devnet-test-10 → 0.10.0-devnet-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/README.md +503 -47
- package/dist/cjs/advancedacl/session-key.d.ts +5 -5
- package/dist/cjs/advancedacl/session-key.js +33 -9
- package/dist/cjs/attestedcompute/attested-compute.d.ts +1 -2
- package/dist/cjs/attestedcompute/attested-compute.js +15 -7
- package/dist/cjs/attesteddecrypt/attested-decrypt.d.ts +5 -43
- package/dist/cjs/attesteddecrypt/attested-decrypt.js +33 -96
- package/dist/cjs/attestedreveal/attested-reveal.d.ts +21 -0
- package/dist/cjs/attestedreveal/attested-reveal.js +31 -0
- package/dist/cjs/attestedreveal/index.d.ts +2 -0
- package/dist/cjs/attestedreveal/index.js +21 -0
- package/dist/cjs/attestedreveal/types.d.ts +4 -0
- package/dist/cjs/attestedreveal/types.js +13 -0
- package/dist/cjs/binary.d.ts +82 -0
- package/dist/cjs/binary.js +87 -5
- package/dist/cjs/chain.d.ts +29 -4
- package/dist/cjs/chain.js +34 -6
- package/dist/cjs/eip712/eip712.d.ts +18 -0
- package/dist/cjs/eip712/eip712.js +51 -0
- package/dist/cjs/eip712/index.d.ts +1 -0
- package/dist/cjs/eip712/index.js +8 -0
- package/dist/cjs/elistattesteddecrypt/elist-attested-decrypt.d.ts +49 -0
- package/dist/cjs/elistattesteddecrypt/elist-attested-decrypt.js +94 -0
- package/dist/cjs/elistattesteddecrypt/index.d.ts +2 -0
- package/dist/cjs/elistattesteddecrypt/index.js +22 -0
- package/dist/cjs/elistattesteddecrypt/types.d.ts +31 -0
- package/dist/cjs/elistattesteddecrypt/types.js +16 -0
- package/dist/cjs/encryption/encryption.d.ts +115 -0
- package/dist/cjs/encryption/encryption.js +98 -7
- package/dist/cjs/encryption/index.d.ts +1 -1
- package/dist/cjs/encryption/index.js +17 -16
- package/dist/cjs/generated/abis/lightning.d.ts +1119 -107
- package/dist/cjs/generated/abis/lightning.js +762 -52
- package/dist/cjs/generated/abis/test-elist.d.ts +20 -2
- package/dist/cjs/generated/abis/test-elist.js +16 -3
- package/dist/cjs/generated/abis/verifier.d.ts +118 -15
- package/dist/cjs/generated/abis/verifier.js +71 -19
- package/dist/cjs/generated/es/inco/covalidator/compute/v1/server_pb.d.ts +23 -37
- package/dist/cjs/generated/es/inco/covalidator/compute/v1/server_pb.js +36 -41
- package/dist/cjs/generated/es/inco/covalidator/compute/v1/types_pb.js +1 -1
- package/dist/cjs/generated/es/inco/helioswrapper/v1/helioswrapper_pb.js +1 -1
- package/dist/cjs/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +16 -0
- package/dist/cjs/generated/es/inco/kms/lite/v1/kms_service_pb.js +3 -3
- package/dist/cjs/generated/es/inco/kms/lite/v1/types_pb.js +1 -1
- package/dist/cjs/generated/es/inco/sealingfetcher/v1/sealingfetcher_pb.d.ts +7 -0
- package/dist/cjs/generated/es/inco/sealingfetcher/v1/sealingfetcher_pb.js +3 -3
- package/dist/cjs/generated/lightning.d.ts +150 -0
- package/dist/cjs/generated/lightning.js +157 -1
- package/dist/cjs/generated/local-node.d.ts +9 -9
- package/dist/cjs/generated/local-node.js +37 -10
- package/dist/cjs/handle.d.ts +72 -0
- package/dist/cjs/handle.js +113 -9
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +11 -2
- package/dist/cjs/kms/client.d.ts +1 -1
- package/dist/cjs/kms/client.js +4 -3
- package/dist/cjs/kms/quorumClient.d.ts +18 -12
- package/dist/cjs/kms/quorumClient.js +212 -231
- package/dist/cjs/kms/quorumConsistency.d.ts +82 -0
- package/dist/cjs/kms/quorumConsistency.js +269 -0
- package/dist/cjs/kms/signatureVerification.d.ts +35 -0
- package/dist/cjs/kms/signatureVerification.js +88 -0
- package/dist/cjs/kms/thresholdPromises.d.ts +4 -3
- package/dist/cjs/kms/thresholdPromises.js +25 -15
- package/dist/cjs/lite/attested-compute.d.ts +2 -2
- package/dist/cjs/lite/attested-compute.js +2 -3
- package/dist/cjs/lite/attested-decrypt.d.ts +2 -2
- package/dist/cjs/lite/attested-decrypt.js +2 -3
- package/dist/cjs/lite/hadu.d.ts +1 -1
- package/dist/cjs/lite/hadu.js +3 -3
- package/dist/cjs/lite/index.d.ts +6 -2
- package/dist/cjs/lite/index.js +8 -14
- package/dist/cjs/lite/lightning.d.ts +96 -47
- package/dist/cjs/lite/lightning.js +221 -267
- package/dist/cjs/lite/types.d.ts +47 -0
- package/dist/cjs/lite/types.js +3 -0
- package/dist/cjs/lite/xwing.d.ts +33 -2
- package/dist/cjs/lite/xwing.js +62 -7
- package/dist/cjs/local/local-node.d.ts +18 -0
- package/dist/cjs/local/local-node.js +18 -3
- package/dist/cjs/reencryption/eip712.d.ts +27 -0
- package/dist/cjs/reencryption/eip712.js +20 -7
- package/dist/cjs/reencryption/types.d.ts +24 -0
- package/dist/cjs/retry.d.ts +14 -0
- package/dist/cjs/retry.js +58 -2
- package/dist/cjs/test/mocks.d.ts +6 -1
- package/dist/cjs/test/mocks.js +31 -6
- package/dist/cjs/viem.d.ts +361 -1
- package/dist/cjs/viem.js +14 -1
- package/dist/esm/advancedacl/session-key.d.ts +5 -5
- package/dist/esm/advancedacl/session-key.js +33 -9
- package/dist/esm/attestedcompute/attested-compute.d.ts +1 -2
- package/dist/esm/attestedcompute/attested-compute.js +13 -5
- package/dist/esm/attesteddecrypt/attested-decrypt.d.ts +5 -43
- package/dist/esm/attesteddecrypt/attested-decrypt.js +34 -96
- package/dist/esm/attestedreveal/attested-reveal.d.ts +21 -0
- package/dist/esm/attestedreveal/attested-reveal.js +28 -0
- package/dist/esm/attestedreveal/index.d.ts +2 -0
- package/dist/esm/attestedreveal/index.js +3 -0
- package/dist/esm/attestedreveal/types.d.ts +4 -0
- package/dist/esm/attestedreveal/types.js +9 -0
- package/dist/esm/binary.d.ts +82 -0
- package/dist/esm/binary.js +87 -5
- package/dist/esm/chain.d.ts +29 -4
- package/dist/esm/chain.js +33 -5
- package/dist/esm/eip712/eip712.d.ts +18 -0
- package/dist/esm/eip712/eip712.js +46 -0
- package/dist/esm/eip712/index.d.ts +1 -0
- package/dist/esm/eip712/index.js +2 -0
- package/dist/esm/elistattesteddecrypt/elist-attested-decrypt.d.ts +49 -0
- package/dist/esm/elistattesteddecrypt/elist-attested-decrypt.js +89 -0
- package/dist/esm/elistattesteddecrypt/index.d.ts +2 -0
- package/dist/esm/elistattesteddecrypt/index.js +3 -0
- package/dist/esm/elistattesteddecrypt/types.d.ts +31 -0
- package/dist/esm/elistattesteddecrypt/types.js +12 -0
- package/dist/esm/encryption/encryption.d.ts +115 -0
- package/dist/esm/encryption/encryption.js +98 -7
- package/dist/esm/encryption/index.d.ts +1 -1
- package/dist/esm/encryption/index.js +2 -2
- package/dist/esm/generated/abis/lightning.d.ts +1119 -107
- package/dist/esm/generated/abis/lightning.js +761 -51
- package/dist/esm/generated/abis/test-elist.d.ts +20 -2
- package/dist/esm/generated/abis/test-elist.js +16 -3
- package/dist/esm/generated/abis/verifier.d.ts +118 -15
- package/dist/esm/generated/abis/verifier.js +71 -19
- package/dist/esm/generated/es/inco/covalidator/compute/v1/server_pb.d.ts +23 -37
- package/dist/esm/generated/es/inco/covalidator/compute/v1/server_pb.js +35 -40
- package/dist/esm/generated/es/inco/covalidator/compute/v1/types_pb.js +1 -1
- package/dist/esm/generated/es/inco/helioswrapper/v1/helioswrapper_pb.js +1 -1
- package/dist/esm/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +16 -0
- package/dist/esm/generated/es/inco/kms/lite/v1/kms_service_pb.js +3 -3
- package/dist/esm/generated/es/inco/kms/lite/v1/types_pb.js +1 -1
- package/dist/esm/generated/es/inco/sealingfetcher/v1/sealingfetcher_pb.d.ts +7 -0
- package/dist/esm/generated/es/inco/sealingfetcher/v1/sealingfetcher_pb.js +3 -3
- package/dist/esm/generated/lightning.d.ts +150 -0
- package/dist/esm/generated/lightning.js +157 -1
- package/dist/esm/generated/local-node.d.ts +9 -9
- package/dist/esm/generated/local-node.js +37 -10
- package/dist/esm/handle.d.ts +72 -0
- package/dist/esm/handle.js +110 -8
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/kms/client.d.ts +1 -1
- package/dist/esm/kms/client.js +3 -2
- package/dist/esm/kms/quorumClient.d.ts +18 -12
- package/dist/esm/kms/quorumClient.js +213 -232
- package/dist/esm/kms/quorumConsistency.d.ts +82 -0
- package/dist/esm/kms/quorumConsistency.js +260 -0
- package/dist/esm/kms/signatureVerification.d.ts +35 -0
- package/dist/esm/kms/signatureVerification.js +84 -0
- package/dist/esm/kms/thresholdPromises.d.ts +4 -3
- package/dist/esm/kms/thresholdPromises.js +25 -15
- package/dist/esm/lite/attested-compute.d.ts +2 -2
- package/dist/esm/lite/attested-compute.js +3 -3
- package/dist/esm/lite/attested-decrypt.d.ts +2 -2
- package/dist/esm/lite/attested-decrypt.js +3 -3
- package/dist/esm/lite/hadu.d.ts +1 -1
- package/dist/esm/lite/hadu.js +2 -2
- package/dist/esm/lite/index.d.ts +6 -2
- package/dist/esm/lite/index.js +5 -3
- package/dist/esm/lite/lightning.d.ts +96 -47
- package/dist/esm/lite/lightning.js +217 -263
- package/dist/esm/lite/types.d.ts +47 -0
- package/dist/esm/lite/types.js +2 -0
- package/dist/esm/lite/xwing.d.ts +33 -2
- package/dist/esm/lite/xwing.js +59 -7
- package/dist/esm/local/local-node.d.ts +18 -0
- package/dist/esm/local/local-node.js +18 -3
- package/dist/esm/reencryption/eip712.d.ts +27 -0
- package/dist/esm/reencryption/eip712.js +20 -7
- package/dist/esm/reencryption/types.d.ts +24 -0
- package/dist/esm/retry.d.ts +14 -0
- package/dist/esm/retry.js +56 -2
- package/dist/esm/test/mocks.d.ts +6 -1
- package/dist/esm/test/mocks.js +31 -8
- package/dist/esm/viem.d.ts +361 -1
- package/dist/esm/viem.js +15 -2
- package/dist/types/advancedacl/session-key.d.ts +5 -5
- package/dist/types/attestedcompute/attested-compute.d.ts +1 -2
- package/dist/types/attesteddecrypt/attested-decrypt.d.ts +5 -43
- package/dist/types/attestedreveal/attested-reveal.d.ts +21 -0
- package/dist/types/attestedreveal/index.d.ts +2 -0
- package/dist/types/attestedreveal/types.d.ts +4 -0
- package/dist/types/binary.d.ts +82 -0
- package/dist/types/chain.d.ts +29 -4
- package/dist/types/eip712/eip712.d.ts +18 -0
- package/dist/types/eip712/index.d.ts +1 -0
- package/dist/types/elistattesteddecrypt/elist-attested-decrypt.d.ts +49 -0
- package/dist/types/elistattesteddecrypt/index.d.ts +2 -0
- package/dist/types/elistattesteddecrypt/types.d.ts +31 -0
- package/dist/types/encryption/encryption.d.ts +115 -0
- package/dist/types/encryption/index.d.ts +1 -1
- package/dist/types/generated/abis/lightning.d.ts +1119 -107
- package/dist/types/generated/abis/test-elist.d.ts +20 -2
- package/dist/types/generated/abis/verifier.d.ts +118 -15
- package/dist/types/generated/es/inco/covalidator/compute/v1/server_pb.d.ts +23 -37
- package/dist/types/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +16 -0
- package/dist/types/generated/es/inco/sealingfetcher/v1/sealingfetcher_pb.d.ts +7 -0
- package/dist/types/generated/lightning.d.ts +150 -0
- package/dist/types/generated/local-node.d.ts +9 -9
- package/dist/types/handle.d.ts +72 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/kms/client.d.ts +1 -1
- package/dist/types/kms/quorumClient.d.ts +18 -12
- package/dist/types/kms/quorumConsistency.d.ts +82 -0
- package/dist/types/kms/signatureVerification.d.ts +35 -0
- package/dist/types/kms/thresholdPromises.d.ts +4 -3
- package/dist/types/lite/attested-compute.d.ts +2 -2
- package/dist/types/lite/attested-decrypt.d.ts +2 -2
- package/dist/types/lite/hadu.d.ts +1 -1
- package/dist/types/lite/index.d.ts +6 -2
- package/dist/types/lite/lightning.d.ts +96 -47
- package/dist/types/lite/types.d.ts +47 -0
- package/dist/types/lite/xwing.d.ts +33 -2
- package/dist/types/local/local-node.d.ts +18 -0
- package/dist/types/reencryption/eip712.d.ts +27 -0
- package/dist/types/reencryption/types.d.ts +24 -0
- package/dist/types/retry.d.ts +14 -0
- package/dist/types/test/mocks.d.ts +6 -1
- package/dist/types/viem.d.ts +361 -1
- package/package.json +19 -21
- package/dist/cjs/generated/abis/lightning-preview.d.ts +0 -1385
- package/dist/cjs/generated/abis/lightning-preview.js +0 -857
- package/dist/esm/generated/abis/lightning-preview.d.ts +0 -1385
- package/dist/esm/generated/abis/lightning-preview.js +0 -854
- package/dist/types/generated/abis/lightning-preview.d.ts +0 -1385
package/dist/esm/test/mocks.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { createWalletClient, http, } from 'viem';
|
|
1
|
+
import { createPublicClient, createWalletClient, fallback, http, } from 'viem';
|
|
2
2
|
import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts';
|
|
3
3
|
import { sepolia } from 'viem/chains';
|
|
4
4
|
import { vi } from 'vitest';
|
|
5
|
-
import {
|
|
6
|
-
import { DEFAULT_COVALIDATOR_SIGNER } from '../kms/client.js';
|
|
5
|
+
import { TEST_DEFAULT_COVALIDATOR_SIGNER } from '../kms/client.js';
|
|
7
6
|
import { KmsQuorumClient } from '../kms/quorumClient.js';
|
|
8
7
|
// Create a mock that satisfies our minimal interface
|
|
9
8
|
export function createMockKmsClient() {
|
|
10
9
|
return {
|
|
11
10
|
attestedCompute: vi.fn(),
|
|
12
11
|
attestedDecrypt: vi.fn(),
|
|
12
|
+
attestedReveal: vi.fn(),
|
|
13
|
+
eListAttestedDecrypt: vi.fn(),
|
|
14
|
+
eListAttestedReveal: vi.fn(),
|
|
13
15
|
key: vi.fn(),
|
|
14
16
|
reencrypt: vi.fn(),
|
|
15
17
|
};
|
|
@@ -18,7 +20,7 @@ export function createMockKmsClient() {
|
|
|
18
20
|
export function createMockQuorumClient() {
|
|
19
21
|
// Use the private constructor via type casting (similar to quorumClient.test.ts)
|
|
20
22
|
const AnyClass = KmsQuorumClient;
|
|
21
|
-
return new AnyClass([{ url: 'https://mock-kms', signer:
|
|
23
|
+
return new AnyClass([{ url: 'https://mock-kms', signer: TEST_DEFAULT_COVALIDATOR_SIGNER }], 1);
|
|
22
24
|
}
|
|
23
25
|
// Helper to set up the mock client inside the quorum client
|
|
24
26
|
export function setupMockInQuorumClient(quorumClient, mockKmsClient) {
|
|
@@ -28,14 +30,35 @@ export function setupMockInQuorumClient(quorumClient, mockKmsClient) {
|
|
|
28
30
|
anyQuorumClient.kmss[0].client = mockKmsClient;
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
|
-
// Create a
|
|
33
|
+
// Create a public client for testing (transport URL is never actually called;
|
|
34
|
+
// publicClient is required by attestedDecrypt/attestedCompute but KMS is mocked in tests)
|
|
35
|
+
export function createMockPublicClient() {
|
|
36
|
+
return createPublicClient({
|
|
37
|
+
chain: sepolia,
|
|
38
|
+
transport: http('http://localhost:8567'),
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
// Create a wallet client for testing (transport URL is never actually called;
|
|
42
|
+
// signing with a local key account does not require an RPC connection)
|
|
32
43
|
export function createTestWalletClient() {
|
|
33
44
|
const account = privateKeyToAccount(generatePrivateKey());
|
|
34
45
|
return createWalletClient({
|
|
35
46
|
chain: sepolia, // Arbitrary chain, not relevant to test
|
|
36
|
-
|
|
37
|
-
|
|
47
|
+
transport: http('http://localhost:8567'),
|
|
48
|
+
account,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
// Create a wallet client with a fallback() transport for testing that code
|
|
52
|
+
// handles non-http transports correctly (fallback has no .url property)
|
|
53
|
+
export function createFallbackWalletClient() {
|
|
54
|
+
const account = privateKeyToAccount(generatePrivateKey());
|
|
55
|
+
return createWalletClient({
|
|
56
|
+
chain: sepolia,
|
|
57
|
+
transport: fallback([
|
|
58
|
+
http('http://localhost:8567'),
|
|
59
|
+
http('http://localhost:8568'),
|
|
60
|
+
]),
|
|
38
61
|
account,
|
|
39
62
|
});
|
|
40
63
|
}
|
|
41
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
64
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9ja3MuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdGVzdC9tb2Nrcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBR0wsa0JBQWtCLEVBQ2xCLGtCQUFrQixFQUNsQixRQUFRLEVBQ1IsSUFBSSxHQUlMLE1BQU0sTUFBTSxDQUFDO0FBQ2QsT0FBTyxFQUFFLGtCQUFrQixFQUFFLG1CQUFtQixFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ3hFLE9BQU8sRUFBRSxPQUFPLEVBQUUsTUFBTSxhQUFhLENBQUM7QUFDdEMsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLFFBQVEsQ0FBQztBQUM1QixPQUFPLEVBQWEsK0JBQStCLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUM5RSxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFjekQscURBQXFEO0FBQ3JELE1BQU0sVUFBVSxtQkFBbUI7SUFDakMsT0FBTztRQUNMLGVBQWUsRUFBRSxFQUFFLENBQUMsRUFBRSxFQUFFO1FBQ3hCLGVBQWUsRUFBRSxFQUFFLENBQUMsRUFBRSxFQUFFO1FBQ3hCLGNBQWMsRUFBRSxFQUFFLENBQUMsRUFBRSxFQUFFO1FBQ3ZCLG9CQUFvQixFQUFFLEVBQUUsQ0FBQyxFQUFFLEVBQUU7UUFDN0IsbUJBQW1CLEVBQUUsRUFBRSxDQUFDLEVBQUUsRUFBRTtRQUM1QixHQUFHLEVBQUUsRUFBRSxDQUFDLEVBQUUsRUFBRTtRQUNaLFNBQVMsRUFBRSxFQUFFLENBQUMsRUFBRSxFQUFFO0tBQ2EsQ0FBQztBQUNwQyxDQUFDO0FBRUQsa0VBQWtFO0FBQ2xFLE1BQU0sVUFBVSxzQkFBc0I7SUFDcEMsaUZBQWlGO0lBQ2pGLE1BQU0sUUFBUSxHQUFRLGVBQWUsQ0FBQztJQUN0QyxPQUFPLElBQUksUUFBUSxDQUNqQixDQUFDLEVBQUUsR0FBRyxFQUFFLGtCQUFrQixFQUFFLE1BQU0sRUFBRSwrQkFBK0IsRUFBRSxDQUFDLEVBQ3RFLENBQUMsQ0FDRixDQUFDO0FBQ0osQ0FBQztBQUVELDREQUE0RDtBQUM1RCxNQUFNLFVBQVUsdUJBQXVCLENBQ3JDLFlBQTZCLEVBQzdCLGFBQTJDO0lBRTNDLG1EQUFtRDtJQUNuRCxNQUFNLGVBQWUsR0FBRyxZQUFtQixDQUFDO0lBQzVDLElBQUksZUFBZSxDQUFDLElBQUksSUFBSSxlQUFlLENBQUMsSUFBSSxDQUFDLE1BQU0sR0FBRyxDQUFDLEVBQUUsQ0FBQztRQUM1RCxlQUFlLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLE1BQU0sR0FBRyxhQUFhLENBQUM7SUFDakQsQ0FBQztBQUNILENBQUM7QUFFRCw4RUFBOEU7QUFDOUUsMEZBQTBGO0FBQzFGLE1BQU0sVUFBVSxzQkFBc0I7SUFDcEMsT0FBTyxrQkFBa0IsQ0FBQztRQUN4QixLQUFLLEVBQUUsT0FBTztRQUNkLFNBQVMsRUFBRSxJQUFJLENBQUMsdUJBQXVCLENBQUM7S0FDekMsQ0FBQyxDQUFDO0FBQ0wsQ0FBQztBQUVELDhFQUE4RTtBQUM5RSx1RUFBdUU7QUFDdkUsTUFBTSxVQUFVLHNCQUFzQjtJQUtwQyxNQUFNLE9BQU8sR0FBRyxtQkFBbUIsQ0FBQyxrQkFBa0IsRUFBRSxDQUFDLENBQUM7SUFDMUQsT0FBTyxrQkFBa0IsQ0FBQztRQUN4QixLQUFLLEVBQUUsT0FBTyxFQUFFLHdDQUF3QztRQUN4RCxTQUFTLEVBQUUsSUFBSSxDQUFDLHVCQUF1QixDQUFDO1FBQ3hDLE9BQU87S0FDUixDQUFDLENBQUM7QUFDTCxDQUFDO0FBRUQsMkVBQTJFO0FBQzNFLHdFQUF3RTtBQUN4RSxNQUFNLFVBQVUsMEJBQTBCO0lBS3hDLE1BQU0sT0FBTyxHQUFHLG1CQUFtQixDQUFDLGtCQUFrQixFQUFFLENBQUMsQ0FBQztJQUMxRCxPQUFPLGtCQUFrQixDQUFDO1FBQ3hCLEtBQUssRUFBRSxPQUFPO1FBQ2QsU0FBUyxFQUFFLFFBQVEsQ0FBQztZQUNsQixJQUFJLENBQUMsdUJBQXVCLENBQUM7WUFDN0IsSUFBSSxDQUFDLHVCQUF1QixDQUFDO1NBQzlCLENBQUM7UUFDRixPQUFPO0tBQ1IsQ0FBQyxDQUFDO0FBQ0wsQ0FBQyJ9
|
package/dist/esm/viem.d.ts
CHANGED
|
@@ -1,6 +1,356 @@
|
|
|
1
|
-
import { Chain } from 'viem';
|
|
1
|
+
import { Account, Chain, PublicClient, Transport, WalletClient } from 'viem';
|
|
2
2
|
import { Chainish } from './chain.js';
|
|
3
|
+
export type ViemClient = WalletClient<Transport, Chain, Account> | PublicClient<Transport, Chain>;
|
|
4
|
+
/** Map of supported chain short names to their viem chain objects. */
|
|
3
5
|
export declare const chains: {
|
|
6
|
+
mainnet: {
|
|
7
|
+
blockExplorers: {
|
|
8
|
+
readonly default: {
|
|
9
|
+
readonly name: "Etherscan";
|
|
10
|
+
readonly url: "https://etherscan.io";
|
|
11
|
+
readonly apiUrl: "https://api.etherscan.io/api";
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
blockTime: 12000;
|
|
15
|
+
contracts: {
|
|
16
|
+
readonly ensUniversalResolver: {
|
|
17
|
+
readonly address: "0xeeeeeeee14d718c2b47d9923deab1335e144eeee";
|
|
18
|
+
readonly blockCreated: 23085558;
|
|
19
|
+
};
|
|
20
|
+
readonly multicall3: {
|
|
21
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
22
|
+
readonly blockCreated: 14353601;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
ensTlds?: readonly string[] | undefined;
|
|
26
|
+
id: 1;
|
|
27
|
+
name: "Ethereum";
|
|
28
|
+
nativeCurrency: {
|
|
29
|
+
readonly name: "Ether";
|
|
30
|
+
readonly symbol: "ETH";
|
|
31
|
+
readonly decimals: 18;
|
|
32
|
+
};
|
|
33
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
34
|
+
rpcUrls: {
|
|
35
|
+
readonly default: {
|
|
36
|
+
readonly http: readonly ["https://eth.merkle.io"];
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
sourceId?: number | undefined | undefined;
|
|
40
|
+
testnet?: boolean | undefined | undefined;
|
|
41
|
+
custom?: Record<string, unknown> | undefined;
|
|
42
|
+
fees?: import("viem").ChainFees<undefined> | undefined;
|
|
43
|
+
formatters?: undefined;
|
|
44
|
+
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
|
|
45
|
+
};
|
|
46
|
+
base: {
|
|
47
|
+
blockExplorers: {
|
|
48
|
+
readonly default: {
|
|
49
|
+
readonly name: "Basescan";
|
|
50
|
+
readonly url: "https://basescan.org";
|
|
51
|
+
readonly apiUrl: "https://api.basescan.org/api";
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
blockTime: 2000;
|
|
55
|
+
contracts: {
|
|
56
|
+
readonly disputeGameFactory: {
|
|
57
|
+
readonly 1: {
|
|
58
|
+
readonly address: "0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e";
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
readonly l2OutputOracle: {
|
|
62
|
+
readonly 1: {
|
|
63
|
+
readonly address: "0x56315b90c40730925ec5485cf004d835058518A0";
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
readonly multicall3: {
|
|
67
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
68
|
+
readonly blockCreated: 5022;
|
|
69
|
+
};
|
|
70
|
+
readonly portal: {
|
|
71
|
+
readonly 1: {
|
|
72
|
+
readonly address: "0x49048044D57e1C92A77f79988d21Fa8fAF74E97e";
|
|
73
|
+
readonly blockCreated: 17482143;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
readonly l1StandardBridge: {
|
|
77
|
+
readonly 1: {
|
|
78
|
+
readonly address: "0x3154Cf16ccdb4C6d922629664174b904d80F2C35";
|
|
79
|
+
readonly blockCreated: 17482143;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
readonly gasPriceOracle: {
|
|
83
|
+
readonly address: "0x420000000000000000000000000000000000000F";
|
|
84
|
+
};
|
|
85
|
+
readonly l1Block: {
|
|
86
|
+
readonly address: "0x4200000000000000000000000000000000000015";
|
|
87
|
+
};
|
|
88
|
+
readonly l2CrossDomainMessenger: {
|
|
89
|
+
readonly address: "0x4200000000000000000000000000000000000007";
|
|
90
|
+
};
|
|
91
|
+
readonly l2Erc721Bridge: {
|
|
92
|
+
readonly address: "0x4200000000000000000000000000000000000014";
|
|
93
|
+
};
|
|
94
|
+
readonly l2StandardBridge: {
|
|
95
|
+
readonly address: "0x4200000000000000000000000000000000000010";
|
|
96
|
+
};
|
|
97
|
+
readonly l2ToL1MessagePasser: {
|
|
98
|
+
readonly address: "0x4200000000000000000000000000000000000016";
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
ensTlds?: readonly string[] | undefined;
|
|
102
|
+
id: 8453;
|
|
103
|
+
name: "Base";
|
|
104
|
+
nativeCurrency: {
|
|
105
|
+
readonly name: "Ether";
|
|
106
|
+
readonly symbol: "ETH";
|
|
107
|
+
readonly decimals: 18;
|
|
108
|
+
};
|
|
109
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
110
|
+
rpcUrls: {
|
|
111
|
+
readonly default: {
|
|
112
|
+
readonly http: readonly ["https://mainnet.base.org"];
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
sourceId: 1;
|
|
116
|
+
testnet?: boolean | undefined | undefined;
|
|
117
|
+
custom?: Record<string, unknown> | undefined;
|
|
118
|
+
fees?: import("viem").ChainFees<undefined> | undefined;
|
|
119
|
+
formatters: {
|
|
120
|
+
readonly block: {
|
|
121
|
+
exclude: [] | undefined;
|
|
122
|
+
format: (args: import("viem/chains").OpStackRpcBlock, action?: string | undefined) => {
|
|
123
|
+
baseFeePerGas: bigint | null;
|
|
124
|
+
blobGasUsed: bigint;
|
|
125
|
+
difficulty: bigint;
|
|
126
|
+
excessBlobGas: bigint;
|
|
127
|
+
extraData: import("viem").Hex;
|
|
128
|
+
gasLimit: bigint;
|
|
129
|
+
gasUsed: bigint;
|
|
130
|
+
hash: `0x${string}` | null;
|
|
131
|
+
logsBloom: `0x${string}` | null;
|
|
132
|
+
miner: import("viem").Address;
|
|
133
|
+
mixHash: import("viem").Hash;
|
|
134
|
+
nonce: `0x${string}` | null;
|
|
135
|
+
number: bigint | null;
|
|
136
|
+
parentBeaconBlockRoot?: `0x${string}` | undefined;
|
|
137
|
+
parentHash: import("viem").Hash;
|
|
138
|
+
receiptsRoot: import("viem").Hex;
|
|
139
|
+
sealFields: import("viem").Hex[];
|
|
140
|
+
sha3Uncles: import("viem").Hash;
|
|
141
|
+
size: bigint;
|
|
142
|
+
stateRoot: import("viem").Hash;
|
|
143
|
+
timestamp: bigint;
|
|
144
|
+
totalDifficulty: bigint | null;
|
|
145
|
+
transactions: `0x${string}`[] | import("viem/chains").OpStackTransaction<boolean>[];
|
|
146
|
+
transactionsRoot: import("viem").Hash;
|
|
147
|
+
uncles: import("viem").Hash[];
|
|
148
|
+
withdrawals?: import("viem").Withdrawal[] | undefined | undefined;
|
|
149
|
+
withdrawalsRoot?: `0x${string}` | undefined;
|
|
150
|
+
} & {};
|
|
151
|
+
type: "block";
|
|
152
|
+
};
|
|
153
|
+
readonly transaction: {
|
|
154
|
+
exclude: [] | undefined;
|
|
155
|
+
format: (args: import("viem/chains").OpStackRpcTransaction, action?: string | undefined) => ({
|
|
156
|
+
blockHash: `0x${string}` | null;
|
|
157
|
+
blockNumber: bigint | null;
|
|
158
|
+
from: import("viem").Address;
|
|
159
|
+
gas: bigint;
|
|
160
|
+
hash: import("viem").Hash;
|
|
161
|
+
input: import("viem").Hex;
|
|
162
|
+
nonce: number;
|
|
163
|
+
r: import("viem").Hex;
|
|
164
|
+
s: import("viem").Hex;
|
|
165
|
+
to: import("viem").Address | null;
|
|
166
|
+
transactionIndex: number | null;
|
|
167
|
+
typeHex: import("viem").Hex | null;
|
|
168
|
+
v: bigint;
|
|
169
|
+
value: bigint;
|
|
170
|
+
yParity: number;
|
|
171
|
+
gasPrice?: undefined | undefined;
|
|
172
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
173
|
+
maxFeePerGas: bigint;
|
|
174
|
+
maxPriorityFeePerGas: bigint;
|
|
175
|
+
isSystemTx?: boolean;
|
|
176
|
+
mint?: bigint | undefined | undefined;
|
|
177
|
+
sourceHash: import("viem").Hex;
|
|
178
|
+
type: "deposit";
|
|
179
|
+
} | {
|
|
180
|
+
r: import("viem").Hex;
|
|
181
|
+
s: import("viem").Hex;
|
|
182
|
+
v: bigint;
|
|
183
|
+
value: bigint;
|
|
184
|
+
gas: bigint;
|
|
185
|
+
to: import("viem").Address | null;
|
|
186
|
+
from: import("viem").Address;
|
|
187
|
+
nonce: number;
|
|
188
|
+
blockHash: `0x${string}` | null;
|
|
189
|
+
blockNumber: bigint | null;
|
|
190
|
+
transactionIndex: number | null;
|
|
191
|
+
hash: import("viem").Hash;
|
|
192
|
+
input: import("viem").Hex;
|
|
193
|
+
typeHex: import("viem").Hex | null;
|
|
194
|
+
accessList?: undefined | undefined;
|
|
195
|
+
authorizationList?: undefined | undefined;
|
|
196
|
+
blobVersionedHashes?: undefined | undefined;
|
|
197
|
+
chainId?: number | undefined;
|
|
198
|
+
yParity?: undefined | undefined;
|
|
199
|
+
type: "legacy";
|
|
200
|
+
gasPrice: bigint;
|
|
201
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
202
|
+
maxFeePerGas?: undefined | undefined;
|
|
203
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
204
|
+
isSystemTx?: undefined | undefined;
|
|
205
|
+
mint?: undefined | undefined;
|
|
206
|
+
sourceHash?: undefined | undefined;
|
|
207
|
+
} | {
|
|
208
|
+
blockHash: `0x${string}` | null;
|
|
209
|
+
blockNumber: bigint | null;
|
|
210
|
+
from: import("viem").Address;
|
|
211
|
+
gas: bigint;
|
|
212
|
+
hash: import("viem").Hash;
|
|
213
|
+
input: import("viem").Hex;
|
|
214
|
+
nonce: number;
|
|
215
|
+
r: import("viem").Hex;
|
|
216
|
+
s: import("viem").Hex;
|
|
217
|
+
to: import("viem").Address | null;
|
|
218
|
+
transactionIndex: number | null;
|
|
219
|
+
typeHex: import("viem").Hex | null;
|
|
220
|
+
v: bigint;
|
|
221
|
+
value: bigint;
|
|
222
|
+
yParity: number;
|
|
223
|
+
accessList: import("viem").AccessList;
|
|
224
|
+
authorizationList?: undefined | undefined;
|
|
225
|
+
blobVersionedHashes?: undefined | undefined;
|
|
226
|
+
chainId: number;
|
|
227
|
+
type: "eip2930";
|
|
228
|
+
gasPrice: bigint;
|
|
229
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
230
|
+
maxFeePerGas?: undefined | undefined;
|
|
231
|
+
maxPriorityFeePerGas?: undefined | undefined;
|
|
232
|
+
isSystemTx?: undefined | undefined;
|
|
233
|
+
mint?: undefined | undefined;
|
|
234
|
+
sourceHash?: undefined | undefined;
|
|
235
|
+
} | {
|
|
236
|
+
blockHash: `0x${string}` | null;
|
|
237
|
+
blockNumber: bigint | null;
|
|
238
|
+
from: import("viem").Address;
|
|
239
|
+
gas: bigint;
|
|
240
|
+
hash: import("viem").Hash;
|
|
241
|
+
input: import("viem").Hex;
|
|
242
|
+
nonce: number;
|
|
243
|
+
r: import("viem").Hex;
|
|
244
|
+
s: import("viem").Hex;
|
|
245
|
+
to: import("viem").Address | null;
|
|
246
|
+
transactionIndex: number | null;
|
|
247
|
+
typeHex: import("viem").Hex | null;
|
|
248
|
+
v: bigint;
|
|
249
|
+
value: bigint;
|
|
250
|
+
yParity: number;
|
|
251
|
+
accessList: import("viem").AccessList;
|
|
252
|
+
authorizationList?: undefined | undefined;
|
|
253
|
+
blobVersionedHashes?: undefined | undefined;
|
|
254
|
+
chainId: number;
|
|
255
|
+
type: "eip1559";
|
|
256
|
+
gasPrice?: undefined | undefined;
|
|
257
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
258
|
+
maxFeePerGas: bigint;
|
|
259
|
+
maxPriorityFeePerGas: bigint;
|
|
260
|
+
isSystemTx?: undefined | undefined;
|
|
261
|
+
mint?: undefined | undefined;
|
|
262
|
+
sourceHash?: undefined | undefined;
|
|
263
|
+
} | {
|
|
264
|
+
blockHash: `0x${string}` | null;
|
|
265
|
+
blockNumber: bigint | null;
|
|
266
|
+
from: import("viem").Address;
|
|
267
|
+
gas: bigint;
|
|
268
|
+
hash: import("viem").Hash;
|
|
269
|
+
input: import("viem").Hex;
|
|
270
|
+
nonce: number;
|
|
271
|
+
r: import("viem").Hex;
|
|
272
|
+
s: import("viem").Hex;
|
|
273
|
+
to: import("viem").Address | null;
|
|
274
|
+
transactionIndex: number | null;
|
|
275
|
+
typeHex: import("viem").Hex | null;
|
|
276
|
+
v: bigint;
|
|
277
|
+
value: bigint;
|
|
278
|
+
yParity: number;
|
|
279
|
+
accessList: import("viem").AccessList;
|
|
280
|
+
authorizationList?: undefined | undefined;
|
|
281
|
+
blobVersionedHashes: readonly import("viem").Hex[];
|
|
282
|
+
chainId: number;
|
|
283
|
+
type: "eip4844";
|
|
284
|
+
gasPrice?: undefined | undefined;
|
|
285
|
+
maxFeePerBlobGas: bigint;
|
|
286
|
+
maxFeePerGas: bigint;
|
|
287
|
+
maxPriorityFeePerGas: bigint;
|
|
288
|
+
isSystemTx?: undefined | undefined;
|
|
289
|
+
mint?: undefined | undefined;
|
|
290
|
+
sourceHash?: undefined | undefined;
|
|
291
|
+
} | {
|
|
292
|
+
blockHash: `0x${string}` | null;
|
|
293
|
+
blockNumber: bigint | null;
|
|
294
|
+
from: import("viem").Address;
|
|
295
|
+
gas: bigint;
|
|
296
|
+
hash: import("viem").Hash;
|
|
297
|
+
input: import("viem").Hex;
|
|
298
|
+
nonce: number;
|
|
299
|
+
r: import("viem").Hex;
|
|
300
|
+
s: import("viem").Hex;
|
|
301
|
+
to: import("viem").Address | null;
|
|
302
|
+
transactionIndex: number | null;
|
|
303
|
+
typeHex: import("viem").Hex | null;
|
|
304
|
+
v: bigint;
|
|
305
|
+
value: bigint;
|
|
306
|
+
yParity: number;
|
|
307
|
+
accessList: import("viem").AccessList;
|
|
308
|
+
authorizationList: import("viem").SignedAuthorizationList;
|
|
309
|
+
blobVersionedHashes?: undefined | undefined;
|
|
310
|
+
chainId: number;
|
|
311
|
+
type: "eip7702";
|
|
312
|
+
gasPrice?: undefined | undefined;
|
|
313
|
+
maxFeePerBlobGas?: undefined | undefined;
|
|
314
|
+
maxFeePerGas: bigint;
|
|
315
|
+
maxPriorityFeePerGas: bigint;
|
|
316
|
+
isSystemTx?: undefined | undefined;
|
|
317
|
+
mint?: undefined | undefined;
|
|
318
|
+
sourceHash?: undefined | undefined;
|
|
319
|
+
}) & {};
|
|
320
|
+
type: "transaction";
|
|
321
|
+
};
|
|
322
|
+
readonly transactionReceipt: {
|
|
323
|
+
exclude: [] | undefined;
|
|
324
|
+
format: (args: import("viem/chains").OpStackRpcTransactionReceipt, action?: string | undefined) => {
|
|
325
|
+
blobGasPrice?: bigint | undefined;
|
|
326
|
+
blobGasUsed?: bigint | undefined;
|
|
327
|
+
blockHash: import("viem").Hash;
|
|
328
|
+
blockNumber: bigint;
|
|
329
|
+
contractAddress: import("viem").Address | null | undefined;
|
|
330
|
+
cumulativeGasUsed: bigint;
|
|
331
|
+
effectiveGasPrice: bigint;
|
|
332
|
+
from: import("viem").Address;
|
|
333
|
+
gasUsed: bigint;
|
|
334
|
+
logs: import("viem").Log<bigint, number, false>[];
|
|
335
|
+
logsBloom: import("viem").Hex;
|
|
336
|
+
root?: `0x${string}` | undefined;
|
|
337
|
+
status: "success" | "reverted";
|
|
338
|
+
to: import("viem").Address | null;
|
|
339
|
+
transactionHash: import("viem").Hash;
|
|
340
|
+
transactionIndex: number;
|
|
341
|
+
type: import("viem").TransactionType;
|
|
342
|
+
l1GasPrice: bigint | null;
|
|
343
|
+
l1GasUsed: bigint | null;
|
|
344
|
+
l1Fee: bigint | null;
|
|
345
|
+
l1FeeScalar: number | null;
|
|
346
|
+
} & {};
|
|
347
|
+
type: "transactionReceipt";
|
|
348
|
+
};
|
|
349
|
+
};
|
|
350
|
+
serializers: {
|
|
351
|
+
readonly transaction: typeof import("viem/chains").serializeTransactionOpStack;
|
|
352
|
+
};
|
|
353
|
+
};
|
|
4
354
|
sepolia: {
|
|
5
355
|
blockExplorers: {
|
|
6
356
|
readonly default: {
|
|
@@ -778,4 +1128,14 @@ export declare const chains: {
|
|
|
778
1128
|
readonly network: "worldchain-sepolia";
|
|
779
1129
|
};
|
|
780
1130
|
};
|
|
1131
|
+
/**
|
|
1132
|
+
* Resolves a {@link Chainish} value to a viem {@link Chain} object.
|
|
1133
|
+
*
|
|
1134
|
+
* Accepts a chain ID (`number` or `bigint`), an object with an `id` field,
|
|
1135
|
+
* or a chain short name (e.g. `"baseSepolia"`).
|
|
1136
|
+
*
|
|
1137
|
+
* @param chainish - The chain identifier to resolve.
|
|
1138
|
+
* @returns The matching `viem` chain object.
|
|
1139
|
+
* @throws If no supported chain matches the given identifier.
|
|
1140
|
+
*/
|
|
781
1141
|
export declare function getViemChain(chainish: Chainish): Chain;
|
package/dist/esm/viem.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { anvil, baseSepolia, monadTestnet, plasmaTestnet, sepolia, worldchainSepolia, } from 'viem/chains';
|
|
1
|
+
import { anvil, base, baseSepolia, mainnet, monadTestnet, plasmaTestnet, sepolia, worldchainSepolia, } from 'viem/chains';
|
|
2
2
|
import { getSupportedChain } from './chain.js';
|
|
3
|
+
/** Map of supported chain short names to their viem chain objects. */
|
|
3
4
|
export const chains = {
|
|
5
|
+
mainnet,
|
|
6
|
+
base,
|
|
4
7
|
sepolia,
|
|
5
8
|
baseSepolia,
|
|
6
9
|
monadTestnet,
|
|
@@ -8,6 +11,16 @@ export const chains = {
|
|
|
8
11
|
anvil,
|
|
9
12
|
worldchainSepolia,
|
|
10
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Resolves a {@link Chainish} value to a viem {@link Chain} object.
|
|
16
|
+
*
|
|
17
|
+
* Accepts a chain ID (`number` or `bigint`), an object with an `id` field,
|
|
18
|
+
* or a chain short name (e.g. `"baseSepolia"`).
|
|
19
|
+
*
|
|
20
|
+
* @param chainish - The chain identifier to resolve.
|
|
21
|
+
* @returns The matching `viem` chain object.
|
|
22
|
+
* @throws If no supported chain matches the given identifier.
|
|
23
|
+
*/
|
|
11
24
|
export function getViemChain(chainish) {
|
|
12
25
|
const { name } = getSupportedChain(chainish);
|
|
13
26
|
const chain = chains[name];
|
|
@@ -16,4 +29,4 @@ export function getViemChain(chainish) {
|
|
|
16
29
|
}
|
|
17
30
|
return chain;
|
|
18
31
|
}
|
|
19
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmllbS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy92aWVtLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFDTCxLQUFLLEVBQ0wsSUFBSSxFQUNKLFdBQVcsRUFDWCxPQUFPLEVBQ1AsWUFBWSxFQUNaLGFBQWEsRUFDYixPQUFPLEVBQ1AsaUJBQWlCLEdBQ2xCLE1BQU0sYUFBYSxDQUFDO0FBQ3JCLE9BQU8sRUFBWSxpQkFBaUIsRUFBRSxNQUFNLFlBQVksQ0FBQztBQU16RCxzRUFBc0U7QUFDdEUsTUFBTSxDQUFDLE1BQU0sTUFBTSxHQUFHO0lBQ3BCLE9BQU87SUFDUCxJQUFJO0lBQ0osT0FBTztJQUNQLFdBQVc7SUFDWCxZQUFZO0lBQ1osYUFBYTtJQUNiLEtBQUs7SUFDTCxpQkFBaUI7Q0FDbEIsQ0FBQztBQUVGOzs7Ozs7Ozs7R0FTRztBQUNILE1BQU0sVUFBVSxZQUFZLENBQUMsUUFBa0I7SUFDN0MsTUFBTSxFQUFFLElBQUksRUFBRSxHQUFHLGlCQUFpQixDQUFDLFFBQVEsQ0FBQyxDQUFDO0lBQzdDLE1BQU0sS0FBSyxHQUFHLE1BQU0sQ0FBQyxJQUFJLENBQUMsQ0FBQztJQUMzQixJQUFJLENBQUMsS0FBSyxFQUFFLENBQUM7UUFDWCxNQUFNLElBQUksS0FBSyxDQUFDLDZCQUE2QixJQUFJLEVBQUUsQ0FBQyxDQUFDO0lBQ3ZELENBQUM7SUFDRCxPQUFPLEtBQUssQ0FBQztBQUNmLENBQUMifQ==
|
|
@@ -4,7 +4,7 @@ import { DecryptionAttestation, EncryptedDecryptionAttestation } from '../attest
|
|
|
4
4
|
import { SupportedChainId } from '../chain.js';
|
|
5
5
|
import { EncryptionScheme, SupportedFheType } from '../encryption/encryption.js';
|
|
6
6
|
import { HexString } from '../index.js';
|
|
7
|
-
import type
|
|
7
|
+
import { type XwingKeypair } from '../lite/xwing.js';
|
|
8
8
|
import { BackoffConfig } from '../retry.js';
|
|
9
9
|
import type { AllowanceVoucher, AllowanceVoucherWithSig } from './types.js';
|
|
10
10
|
import { AttestedComputeOP } from '../attestedcompute/types.js';
|
|
@@ -42,8 +42,8 @@ export interface SessionKeyAttestedComputeArgs {
|
|
|
42
42
|
rhsPlaintext: bigint | boolean;
|
|
43
43
|
requesterArgData?: Hex | undefined;
|
|
44
44
|
backoffConfig?: Partial<BackoffConfig> | undefined;
|
|
45
|
-
ethClient
|
|
46
|
-
executorAddress
|
|
45
|
+
ethClient: PublicClient<Transport, Chain>;
|
|
46
|
+
executorAddress: HexString;
|
|
47
47
|
reencryptPubKey?: Uint8Array | undefined;
|
|
48
48
|
reencryptKeypair?: XwingKeypair | undefined;
|
|
49
49
|
}
|
|
@@ -58,8 +58,8 @@ export interface SessionKeyAttestedDecryptArgs {
|
|
|
58
58
|
backoffConfig?: Partial<BackoffConfig> | undefined;
|
|
59
59
|
reencryptPubKey?: Uint8Array | undefined;
|
|
60
60
|
reencryptKeypair?: XwingKeypair | undefined;
|
|
61
|
-
ethClient
|
|
62
|
-
executorAddress
|
|
61
|
+
ethClient: PublicClient<Transport, Chain>;
|
|
62
|
+
executorAddress: HexString;
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
65
|
* Performs attested decrypts using a voucher-backed session key.
|
|
@@ -4,11 +4,10 @@ import { HexString } from '../binary.js';
|
|
|
4
4
|
import { SupportedChainId } from '../chain.js';
|
|
5
5
|
import type { EncryptionScheme, SupportedFheType } from '../encryption/encryption.js';
|
|
6
6
|
import { KmsQuorumClient } from '../kms/quorumClient.js';
|
|
7
|
-
import type
|
|
7
|
+
import { type XwingKeypair } from '../lite/xwing.js';
|
|
8
8
|
import type { BackoffConfig } from '../retry.js';
|
|
9
9
|
import { AttestedComputeOP } from './types.js';
|
|
10
10
|
export declare const ATTESTED_COMPUTE_DOMAIN_NAME = "IncoAttestedCompute";
|
|
11
|
-
export declare const DEFAULT_ATTESTED_COMPUTE_DOMAIN_VERSION = "2";
|
|
12
11
|
/**
|
|
13
12
|
* Arguments for creating an attested compute.
|
|
14
13
|
*/
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import type { Account, Chain,
|
|
1
|
+
import type { Account, Chain, Transport, WalletClient } from 'viem';
|
|
2
2
|
import { type HexString } from '../binary.js';
|
|
3
3
|
import { type SupportedChainId } from '../chain.js';
|
|
4
4
|
import { EncryptionScheme, type SupportedFheType } from '../encryption/encryption.js';
|
|
5
|
+
import { type HandleWithProof } from '../generated/es/inco/kms/lite/v1/types_pb.js';
|
|
6
|
+
import { validateHandle } from '../handle.js';
|
|
5
7
|
import { KmsQuorumClient } from '../kms/quorumClient.js';
|
|
6
8
|
import type { XwingKeypair } from '../lite/xwing.js';
|
|
7
9
|
import type { BackoffConfig } from '../retry.js';
|
|
8
10
|
import { type DecryptionAttestation, type EncryptedDecryptionAttestation } from './types.js';
|
|
11
|
+
export { validateHandle };
|
|
9
12
|
export declare const ATTESTED_DECRYPT_DOMAIN_NAME = "IncoAttestedDecrypt";
|
|
10
|
-
export declare const DEFAULT_ATTESTED_DECRYPT_DOMAIN_VERSION = "2";
|
|
11
|
-
export declare const TEST_RPC_URL = "UNUSED IN TEST";
|
|
12
13
|
/**
|
|
13
14
|
* Arguments for creating an attested decrypt request.
|
|
14
15
|
*/
|
|
@@ -20,21 +21,6 @@ export interface IncoLiteAttestedDecryptorArgs {
|
|
|
20
21
|
/** The chain ID to use */
|
|
21
22
|
chainId: SupportedChainId;
|
|
22
23
|
}
|
|
23
|
-
/**
|
|
24
|
-
* Decrypt multiple handles in a single attested request without wallet authentication.
|
|
25
|
-
* Returns an array of attestations aligned with the response ordering.
|
|
26
|
-
*
|
|
27
|
-
* @param args - The arguments for creating the attested decrypt function
|
|
28
|
-
* @returns A function that can decrypt handles and return an attestation
|
|
29
|
-
* @throws {AttestedDecryptError} If the creation fails
|
|
30
|
-
*/
|
|
31
|
-
export declare function attestedDecrypt({ handles, backoffConfig, chainId, kmsQuorumClient, executorAddress, }: {
|
|
32
|
-
handles: HexString[];
|
|
33
|
-
backoffConfig?: Partial<BackoffConfig> | undefined;
|
|
34
|
-
chainId: SupportedChainId;
|
|
35
|
-
kmsQuorumClient: KmsQuorumClient;
|
|
36
|
-
executorAddress: HexString;
|
|
37
|
-
}): Promise<Array<DecryptionAttestation<EncryptionScheme, SupportedFheType>>>;
|
|
38
24
|
/**
|
|
39
25
|
* Decrypt multiple handles in a single attested request.
|
|
40
26
|
* Returns an array of attestations aligned with the response ordering.
|
|
@@ -71,29 +57,5 @@ export declare function attestedDecrypt({ handles, backoffConfig, walletClient,
|
|
|
71
57
|
kmsQuorumClient: KmsQuorumClient;
|
|
72
58
|
executorAddress: HexString;
|
|
73
59
|
}): Promise<Array<EncryptedDecryptionAttestation<EncryptionScheme, SupportedFheType>>>;
|
|
74
|
-
|
|
75
|
-
* Decrypt multiple handles in a single attested request.
|
|
76
|
-
* Returns an array of attestations aligned with the response ordering.
|
|
77
|
-
*
|
|
78
|
-
* @param args - The arguments for creating the attested decrypt function
|
|
79
|
-
* @returns A function that can decrypt handles and return an attestation
|
|
80
|
-
* @throws {AttestedDecryptError} If the creation fails
|
|
81
|
-
*/
|
|
82
|
-
export declare function attestedDecrypt({ handles, backoffConfig, walletClient, chainId, kmsQuorumClient, executorAddress, }: {
|
|
83
|
-
handles: HexString[];
|
|
84
|
-
backoffConfig?: Partial<BackoffConfig> | undefined;
|
|
85
|
-
walletClient: WalletClient<Transport, Chain, Account>;
|
|
86
|
-
chainId: SupportedChainId;
|
|
87
|
-
reencryptPubKey?: never;
|
|
88
|
-
reencryptKeypair?: never;
|
|
89
|
-
kmsQuorumClient: KmsQuorumClient;
|
|
90
|
-
executorAddress: HexString;
|
|
91
|
-
}): Promise<Array<DecryptionAttestation<EncryptionScheme, SupportedFheType>>>;
|
|
92
|
-
export declare function fetchEip712DomainVersion(executorAddress: HexString | undefined, defaultVersion: string, walletClient?: WalletClient<Transport, Chain, Account> | PublicClient<Transport, Chain>): Promise<string>;
|
|
60
|
+
export declare function buildHandlesWithProofs(handles: HexString[]): Array<HandleWithProof>;
|
|
93
61
|
export declare function decryptEncryptedAttestations(attestations: Array<DecryptionAttestation<EncryptionScheme, SupportedFheType> | EncryptedDecryptionAttestation<EncryptionScheme, SupportedFheType>>, reencryptKeypair: XwingKeypair): Promise<Array<DecryptionAttestation<EncryptionScheme, SupportedFheType>>>;
|
|
94
|
-
/**
|
|
95
|
-
* Validates a handle format.
|
|
96
|
-
* @param handle - The handle to validate
|
|
97
|
-
* @throws {AttestedDecryptError} If the handle format is invalid
|
|
98
|
-
*/
|
|
99
|
-
export declare function validateHandle(handle: HexString): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Chain, PublicClient, Transport } from 'viem';
|
|
2
|
+
import type { DecryptionAttestation } from '../attesteddecrypt/types.js';
|
|
3
|
+
import type { HexString } from '../binary.js';
|
|
4
|
+
import type { EncryptionScheme, SupportedFheType } from '../encryption/encryption.js';
|
|
5
|
+
import type { KmsQuorumClient } from '../kms/quorumClient.js';
|
|
6
|
+
import type { BackoffConfig } from '../retry.js';
|
|
7
|
+
/**
|
|
8
|
+
* Reveal multiple handles in a single attested request without wallet authentication.
|
|
9
|
+
* Returns an array of plaintext attestations aligned with the response ordering.
|
|
10
|
+
*
|
|
11
|
+
* @param args - The arguments for the attested reveal request
|
|
12
|
+
* @returns An array of decryption attestations
|
|
13
|
+
* @throws {AttestedRevealError} If the reveal fails
|
|
14
|
+
*/
|
|
15
|
+
export declare function attestedReveal({ handles, kmsQuorumClient, executorAddress, publicClient, backoffConfig, }: {
|
|
16
|
+
handles: HexString[];
|
|
17
|
+
kmsQuorumClient: KmsQuorumClient;
|
|
18
|
+
executorAddress: HexString;
|
|
19
|
+
publicClient: PublicClient<Transport, Chain>;
|
|
20
|
+
backoffConfig?: Partial<BackoffConfig> | undefined;
|
|
21
|
+
}): Promise<Array<DecryptionAttestation<EncryptionScheme, SupportedFheType>>>;
|