@inco/js 0.6.9 → 0.7.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 +8 -8
- package/dist/cjs/advancedacl/session-key.d.ts +39 -26
- package/dist/cjs/advancedacl/session-key.js +53 -136
- package/dist/cjs/attestedcompute/attested-compute.d.ts +6 -6
- package/dist/cjs/attestedcompute/attested-compute.js +5 -35
- package/dist/cjs/attesteddecrypt/attested-decrypt.d.ts +36 -21
- package/dist/cjs/attesteddecrypt/attested-decrypt.js +107 -108
- package/dist/cjs/attesteddecrypt/types.d.ts +4 -4
- package/dist/cjs/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +15 -1
- package/dist/cjs/generated/es/inco/covalidator/compute/v1/types_pb.js +1 -1
- package/dist/cjs/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +13 -5
- package/dist/cjs/generated/es/inco/kms/lite/v1/kms_service_pb.js +3 -4
- package/dist/cjs/generated/lightning.d.ts +40 -0
- package/dist/cjs/generated/lightning.js +43 -1
- package/dist/cjs/generated/local-node.d.ts +11 -7
- package/dist/cjs/generated/local-node.js +28 -8
- package/dist/cjs/kms/client.d.ts +8 -4
- package/dist/cjs/kms/client.js +9 -4
- package/dist/cjs/kms/quorumClient.d.ts +58 -0
- package/dist/cjs/kms/quorumClient.js +378 -0
- package/dist/cjs/kms/thresholdPromises.d.ts +7 -0
- package/dist/cjs/kms/thresholdPromises.js +52 -0
- package/dist/cjs/lite/ecies.d.ts +2 -0
- package/dist/cjs/lite/ecies.js +5 -2
- package/dist/cjs/lite/index.d.ts +0 -1
- package/dist/cjs/lite/index.js +1 -2
- package/dist/cjs/lite/lightning.d.ts +110 -74
- package/dist/cjs/lite/lightning.js +272 -127
- package/dist/cjs/local/local-node.d.ts +1 -2
- package/dist/cjs/local/local-node.js +2 -3
- package/dist/cjs/test/mocks.d.ts +3 -0
- package/dist/cjs/test/mocks.js +19 -1
- package/dist/cjs/viem.d.ts +2 -4
- package/dist/cjs/viem.js +6 -2
- package/dist/esm/advancedacl/session-key.d.ts +39 -26
- package/dist/esm/advancedacl/session-key.js +44 -126
- package/dist/esm/attestedcompute/attested-compute.d.ts +6 -6
- package/dist/esm/attestedcompute/attested-compute.js +6 -36
- package/dist/esm/attesteddecrypt/attested-decrypt.d.ts +36 -21
- package/dist/esm/attesteddecrypt/attested-decrypt.js +106 -108
- package/dist/esm/attesteddecrypt/types.d.ts +4 -4
- package/dist/esm/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +15 -1
- package/dist/esm/generated/es/inco/covalidator/compute/v1/types_pb.js +1 -1
- package/dist/esm/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +13 -5
- package/dist/esm/generated/es/inco/kms/lite/v1/kms_service_pb.js +2 -3
- package/dist/esm/generated/lightning.d.ts +40 -0
- package/dist/esm/generated/lightning.js +43 -1
- package/dist/esm/generated/local-node.d.ts +11 -7
- package/dist/esm/generated/local-node.js +28 -8
- package/dist/esm/kms/client.d.ts +8 -4
- package/dist/esm/kms/client.js +8 -4
- package/dist/esm/kms/quorumClient.d.ts +58 -0
- package/dist/esm/kms/quorumClient.js +374 -0
- package/dist/esm/kms/thresholdPromises.d.ts +7 -0
- package/dist/esm/kms/thresholdPromises.js +49 -0
- package/dist/esm/lite/ecies.d.ts +2 -0
- package/dist/esm/lite/ecies.js +4 -2
- package/dist/esm/lite/index.d.ts +0 -1
- package/dist/esm/lite/index.js +1 -2
- package/dist/esm/lite/lightning.d.ts +110 -74
- package/dist/esm/lite/lightning.js +276 -131
- package/dist/esm/local/local-node.d.ts +1 -2
- package/dist/esm/local/local-node.js +2 -3
- package/dist/esm/test/mocks.d.ts +3 -0
- package/dist/esm/test/mocks.js +17 -1
- package/dist/esm/viem.d.ts +2 -4
- package/dist/esm/viem.js +6 -2
- package/dist/types/advancedacl/session-key.d.ts +39 -26
- package/dist/types/attestedcompute/attested-compute.d.ts +6 -6
- package/dist/types/attesteddecrypt/attested-decrypt.d.ts +36 -21
- package/dist/types/attesteddecrypt/types.d.ts +4 -4
- package/dist/types/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +15 -1
- package/dist/types/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +13 -5
- package/dist/types/generated/lightning.d.ts +40 -0
- package/dist/types/generated/local-node.d.ts +11 -7
- package/dist/types/kms/client.d.ts +8 -4
- package/dist/types/kms/quorumClient.d.ts +58 -0
- package/dist/types/kms/thresholdPromises.d.ts +7 -0
- package/dist/types/lite/ecies.d.ts +2 -0
- package/dist/types/lite/index.d.ts +0 -1
- package/dist/types/lite/lightning.d.ts +110 -74
- package/dist/types/local/local-node.d.ts +1 -2
- package/dist/types/test/mocks.d.ts +3 -0
- package/dist/types/viem.d.ts +2 -4
- package/package.json +6 -3
- package/dist/cjs/attestedreveal/attested-reveal.d.ts +0 -21
- package/dist/cjs/attestedreveal/attested-reveal.js +0 -69
- package/dist/cjs/attestedreveal/index.d.ts +0 -1
- package/dist/cjs/attestedreveal/index.js +0 -18
- package/dist/cjs/attestedreveal/types.d.ts +0 -7
- package/dist/cjs/attestedreveal/types.js +0 -16
- package/dist/cjs/generated/es/cosmos_proto/cosmos_pb.d.ts +0 -174
- package/dist/cjs/generated/es/cosmos_proto/cosmos_pb.js +0 -118
- package/dist/cjs/generated/es/inco/fhe/v1/types_pb.d.ts +0 -419
- package/dist/cjs/generated/es/inco/fhe/v1/types_pb.js +0 -136
- package/dist/cjs/lite/reencrypt.d.ts +0 -21
- package/dist/cjs/lite/reencrypt.js +0 -141
- package/dist/esm/attestedreveal/attested-reveal.d.ts +0 -21
- package/dist/esm/attestedreveal/attested-reveal.js +0 -66
- package/dist/esm/attestedreveal/index.d.ts +0 -1
- package/dist/esm/attestedreveal/index.js +0 -2
- package/dist/esm/attestedreveal/types.d.ts +0 -7
- package/dist/esm/attestedreveal/types.js +0 -12
- package/dist/esm/generated/es/cosmos_proto/cosmos_pb.d.ts +0 -174
- package/dist/esm/generated/es/cosmos_proto/cosmos_pb.js +0 -115
- package/dist/esm/generated/es/inco/fhe/v1/types_pb.d.ts +0 -419
- package/dist/esm/generated/es/inco/fhe/v1/types_pb.js +0 -133
- package/dist/esm/lite/reencrypt.d.ts +0 -21
- package/dist/esm/lite/reencrypt.js +0 -131
- package/dist/types/attestedreveal/attested-reveal.d.ts +0 -21
- package/dist/types/attestedreveal/index.d.ts +0 -1
- package/dist/types/attestedreveal/types.d.ts +0 -7
- package/dist/types/generated/es/cosmos_proto/cosmos_pb.d.ts +0 -174
- package/dist/types/generated/es/inco/fhe/v1/types_pb.d.ts +0 -419
- package/dist/types/lite/reencrypt.d.ts +0 -21
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.incoLiteReencryptor = incoLiteReencryptor;
|
|
4
|
-
exports.getKmsClient = getKmsClient;
|
|
5
|
-
exports.decryptGrpcResponse = decryptGrpcResponse;
|
|
6
|
-
exports.decryptGrpcDecryptionAttestation = decryptGrpcDecryptionAttestation;
|
|
7
|
-
exports.decryptGrpcDecryptResponse = decryptGrpcDecryptResponse;
|
|
8
|
-
exports.defaultCovalidatorGrpc = defaultCovalidatorGrpc;
|
|
9
|
-
exports.lightningDevnetCovalidatorGrpc = lightningDevnetCovalidatorGrpc;
|
|
10
|
-
exports.lightningTestnetCovalidatorGrpc = lightningTestnetCovalidatorGrpc;
|
|
11
|
-
const protobuf_1 = require("@bufbuild/protobuf");
|
|
12
|
-
const connect_1 = require("@connectrpc/connect");
|
|
13
|
-
const connect_web_1 = require("@connectrpc/connect-web");
|
|
14
|
-
const attested_decrypt_js_1 = require("../attesteddecrypt/attested-decrypt.js");
|
|
15
|
-
const binary_js_1 = require("../binary.js");
|
|
16
|
-
const chain_js_1 = require("../chain.js");
|
|
17
|
-
const encryption_js_1 = require("../encryption/encryption.js");
|
|
18
|
-
const kms_service_pb_js_1 = require("../generated/es/inco/kms/lite/v1/kms_service_pb.js");
|
|
19
|
-
const handle_js_1 = require("../handle.js");
|
|
20
|
-
const ecies_js_1 = require("./ecies.js");
|
|
21
|
-
// Returns the Inco Lite Reencryptor, which can reencrypt a handle using the
|
|
22
|
-
// Basic ACL.
|
|
23
|
-
async function incoLiteReencryptor({ kmsConnectRpcEndpointOrClient, chainId, walletClient, ephemeralKeypair, }) {
|
|
24
|
-
const kmsClient = getKmsClient(kmsConnectRpcEndpointOrClient ||
|
|
25
|
-
defaultCovalidatorGrpc((0, chain_js_1.getSupportedChain)(chainId)));
|
|
26
|
-
if (!ephemeralKeypair) {
|
|
27
|
-
ephemeralKeypair = await (0, ecies_js_1.generateSecp256k1Keypair)();
|
|
28
|
-
}
|
|
29
|
-
return async function reencrypt({ handle }, backoffConfig) {
|
|
30
|
-
const ephemeralPubKey = ephemeralKeypair.encodePublicKey();
|
|
31
|
-
const response = await (0, attested_decrypt_js_1.attestedDecrypt)({
|
|
32
|
-
chainId: (0, chain_js_1.getSupportedChain)(chainId).id,
|
|
33
|
-
walletClient,
|
|
34
|
-
kmsConnectRpcEndpointOrClient: kmsClient,
|
|
35
|
-
handles: [handle],
|
|
36
|
-
backoffConfig,
|
|
37
|
-
reencryptPubKey: ephemeralPubKey,
|
|
38
|
-
reencryptKeypair: ephemeralKeypair,
|
|
39
|
-
});
|
|
40
|
-
if (response.length !== 1) {
|
|
41
|
-
throw new Error(`Expected 1 result, got ${response.length}`);
|
|
42
|
-
}
|
|
43
|
-
return response[0].plaintext;
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
// Helper function to get a KMS client from a string or a Client instance.
|
|
47
|
-
function getKmsClient(kmsConnectRpcEndpointOrClient) {
|
|
48
|
-
if (typeof kmsConnectRpcEndpointOrClient === 'string') {
|
|
49
|
-
const transport = (0, connect_web_1.createConnectTransport)({
|
|
50
|
-
baseUrl: kmsConnectRpcEndpointOrClient,
|
|
51
|
-
});
|
|
52
|
-
return (0, connect_1.createClient)(kms_service_pb_js_1.KmsService, transport);
|
|
53
|
-
}
|
|
54
|
-
return kmsConnectRpcEndpointOrClient;
|
|
55
|
-
}
|
|
56
|
-
// Decrypt using ECIES the ciphertext in the response.
|
|
57
|
-
// Even though the proto specifies a list of ciphertexts, our JS SDK
|
|
58
|
-
// currently only supports a single ciphertext.
|
|
59
|
-
async function decryptGrpcResponse(response, ephemeralKeypair, handle) {
|
|
60
|
-
if (response.decryptionAttestations.length === 0) {
|
|
61
|
-
throw new Error('No decryption attestations in the response');
|
|
62
|
-
}
|
|
63
|
-
const att = response.decryptionAttestations[0];
|
|
64
|
-
if (att.value === undefined) {
|
|
65
|
-
throw new Error('No value in attestation');
|
|
66
|
-
}
|
|
67
|
-
if (att.value.case !== 'reencryption') {
|
|
68
|
-
throw new Error(`Unexpected attestation type: ${att.value.case}, expected 'reencryption'`);
|
|
69
|
-
}
|
|
70
|
-
const reencryption = att.value.value;
|
|
71
|
-
const reencryptedCt = reencryption.userCiphertext;
|
|
72
|
-
if (!reencryptedCt) {
|
|
73
|
-
throw new Error('No reencrypted ciphertext in the response');
|
|
74
|
-
}
|
|
75
|
-
const plaintextBytes = await (0, ecies_js_1.decrypt)(ephemeralKeypair, reencryptedCt.ciphertext);
|
|
76
|
-
const plaintext = (0, binary_js_1.bytesToBigInt)(plaintextBytes);
|
|
77
|
-
return (0, encryption_js_1.bigintToPlaintext)(encryption_js_1.encryptionSchemes.ecies, (0, handle_js_1.getHandleType)(handle), plaintext);
|
|
78
|
-
}
|
|
79
|
-
// A helper function that takes in a DecryptionAttestation message containing reencryption,
|
|
80
|
-
// decrypts it using the provided reencryptKeypair, and returns a DecryptionAttestation message containing a plaintext.
|
|
81
|
-
async function decryptGrpcDecryptionAttestation(attestation, reencryptKeypair) {
|
|
82
|
-
if (attestation.value === undefined) {
|
|
83
|
-
throw new Error('No value in attestation');
|
|
84
|
-
}
|
|
85
|
-
if (attestation.value.case !== 'reencryption') {
|
|
86
|
-
return Promise.resolve(attestation);
|
|
87
|
-
}
|
|
88
|
-
const reencryption = attestation.value.value;
|
|
89
|
-
const reencryptedCt = reencryption.userCiphertext;
|
|
90
|
-
if (!reencryptedCt) {
|
|
91
|
-
throw new Error('No reencrypted ciphertext in the response');
|
|
92
|
-
}
|
|
93
|
-
const plaintextBytes = await (0, ecies_js_1.decrypt)(reencryptKeypair, reencryptedCt.ciphertext);
|
|
94
|
-
return (0, protobuf_1.create)(kms_service_pb_js_1.DecryptionAttestationSchema, {
|
|
95
|
-
handle: attestation.handle,
|
|
96
|
-
value: {
|
|
97
|
-
case: 'plaintext',
|
|
98
|
-
value: (0, protobuf_1.create)(kms_service_pb_js_1.PlaintextSchema, {
|
|
99
|
-
value: plaintextBytes,
|
|
100
|
-
}),
|
|
101
|
-
},
|
|
102
|
-
signature: attestation.signature,
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
// A helper function that takes in an AttestedDecryptResponse message containing reencryption attestations,
|
|
106
|
-
// decrypts them using the provided reencryptKeypair, and returns an AttestedDecryptResponse message containing plaintext attestations.
|
|
107
|
-
async function decryptGrpcDecryptResponse(response, reencryptKeypair) {
|
|
108
|
-
if (response.decryptionAttestations.length === 0) {
|
|
109
|
-
throw new Error('No decryption attestations in the response');
|
|
110
|
-
}
|
|
111
|
-
// For each attestation in the response, decrypt it
|
|
112
|
-
const decryptedAttestations = await Promise.all(response.decryptionAttestations.map(async (attestation) => {
|
|
113
|
-
return await decryptGrpcDecryptionAttestation(attestation, reencryptKeypair);
|
|
114
|
-
}));
|
|
115
|
-
// Return new response with decrypted attestations
|
|
116
|
-
return (0, protobuf_1.create)(kms_service_pb_js_1.AttestedDecryptResponseSchema, {
|
|
117
|
-
decryptionAttestations: decryptedAttestations,
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
// Helper function to return the default gRPC endpoint for the covalidator.
|
|
121
|
-
// Currently, this returns the covalidator for the Inco Lightning public testnet.
|
|
122
|
-
function defaultCovalidatorGrpc(chain) {
|
|
123
|
-
return lightningTestnetCovalidatorGrpc(chain);
|
|
124
|
-
}
|
|
125
|
-
// Helper function to get the devnet gRPC endpoint for the Inco Lightning covalidator.
|
|
126
|
-
function lightningDevnetCovalidatorGrpc(chain) {
|
|
127
|
-
return getCovalidatorGrpcHelper(chain, 'devnet', 'lightning');
|
|
128
|
-
}
|
|
129
|
-
// Helper function to get the testnet gRPC endpoint for the Inco Lightning covalidator.
|
|
130
|
-
function lightningTestnetCovalidatorGrpc(chain) {
|
|
131
|
-
return getCovalidatorGrpcHelper(chain, 'testnet', 'lightning');
|
|
132
|
-
}
|
|
133
|
-
// Convert camelCase to dash-case.
|
|
134
|
-
function camelToDashCase(str) {
|
|
135
|
-
return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
|
136
|
-
}
|
|
137
|
-
// Small helper, as our GCP covalidator URLs are in a specific format.
|
|
138
|
-
function getCovalidatorGrpcHelper(chain, network, cluster) {
|
|
139
|
-
return `https://grpc.${camelToDashCase(chain.name)}.${cluster}.${network}.inco.org`;
|
|
140
|
-
}
|
|
141
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVlbmNyeXB0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpdGUvcmVlbmNyeXB0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBcURBLGtEQW9DQztBQUdELG9DQVdDO0FBS0Qsa0RBb0NDO0FBSUQsNEVBaUNDO0FBSUQsZ0VBcUJDO0FBSUQsd0RBRUM7QUFHRCx3RUFFQztBQUdELDBFQUVDO0FBOU5ELGlEQUE0QztBQUM1QyxpREFBMkQ7QUFDM0QseURBQWlFO0FBRWpFLGdGQUF5RTtBQUN6RSw0Q0FBd0Q7QUFDeEQsMENBQWdFO0FBQ2hFLCtEQU1xQztBQUNyQywwRkFRNEQ7QUFDNUQsNENBQXFEO0FBT3JELHlDQUlvQjtBQWlCcEIsNEVBQTRFO0FBQzVFLGFBQW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} from '../attesteddecrypt/types.js';
|
|
2
|
-
import { HexString } from '../binary.js';
|
|
3
|
-
import { SupportedChainId } from '../chain.js';
|
|
4
|
-
import { EciesScheme, SupportedFheType } from '../encryption/encryption.js';
|
|
5
|
-
import type { KmsClient } from '../kms/client.js';
|
|
6
|
-
import type { BackoffConfig } from '../retry.js';
|
|
7
|
-
/**
|
|
8
|
-
* Just like attestedDecrypt, attestedReveal multiple revealed handles in a single attested request.
|
|
9
|
-
* Returns an array of attestations aligned with the response ordering.
|
|
10
|
-
* Handles must be revealed ahead of time using the .reveal() on-chain call.
|
|
11
|
-
*
|
|
12
|
-
* @param args - The arguments for creating the attested reveal function
|
|
13
|
-
* @returns A function that can reveal handles and return an attestation
|
|
14
|
-
* @throws {AttestedRevealError} If the creation fails
|
|
15
|
-
*/
|
|
16
|
-
export declare function attestedReveal({ handles, backoffConfig, chainId, kmsConnectRpcEndpointOrClient, }: {
|
|
17
|
-
handles: HexString[];
|
|
18
|
-
backoffConfig?: Partial<BackoffConfig> | undefined;
|
|
19
|
-
chainId: SupportedChainId;
|
|
20
|
-
kmsConnectRpcEndpointOrClient?: string | KmsClient;
|
|
21
|
-
}): Promise<Array<DecryptionAttestation<EciesScheme, SupportedFheType>>>;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { create } from '@bufbuild/protobuf';
|
|
2
|
-
import { bytesToBigInt } from '../binary.js';
|
|
3
|
-
import { getSupportedChain } from '../chain.js';
|
|
4
|
-
import { bigintToPlaintext, encryptionSchemes, } from '../encryption/encryption.js';
|
|
5
|
-
import { AttestedRevealRequestSchema, } from '../generated/es/inco/kms/lite/v1/kms_service_pb.js';
|
|
6
|
-
import { getHandleType } from '../handle.js';
|
|
7
|
-
import { defaultCovalidatorGrpc, getKmsClient } from '../kms/client.js';
|
|
8
|
-
import { retryWithBackoff } from '../retry.js';
|
|
9
|
-
import { AttestedRevealError } from './types.js';
|
|
10
|
-
/**
|
|
11
|
-
* Validates a handle format.
|
|
12
|
-
* @param handle - The handle to validate
|
|
13
|
-
* @throws {AttestedRevealError} If the handle format is invalid
|
|
14
|
-
*/
|
|
15
|
-
function validateHandle(handle) {
|
|
16
|
-
if (!handle.startsWith('0x') || handle.length !== 2 + 2 * 32) {
|
|
17
|
-
throw new AttestedRevealError('Invalid handle format: must be a 32-byte hex string with 0x prefix');
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Just like attestedDecrypt, attestedReveal multiple revealed handles in a single attested request.
|
|
22
|
-
* Returns an array of attestations aligned with the response ordering.
|
|
23
|
-
* Handles must be revealed ahead of time using the .reveal() on-chain call.
|
|
24
|
-
*
|
|
25
|
-
* @param args - The arguments for creating the attested reveal function
|
|
26
|
-
* @returns A function that can reveal handles and return an attestation
|
|
27
|
-
* @throws {AttestedRevealError} If the creation fails
|
|
28
|
-
*/
|
|
29
|
-
export async function attestedReveal({ handles, backoffConfig, chainId, kmsConnectRpcEndpointOrClient, }) {
|
|
30
|
-
try {
|
|
31
|
-
handles.forEach(validateHandle);
|
|
32
|
-
const kmsClient = getKmsClient(kmsConnectRpcEndpointOrClient ||
|
|
33
|
-
defaultCovalidatorGrpc(getSupportedChain(chainId)));
|
|
34
|
-
const attestedRevealRequest = create(AttestedRevealRequestSchema, {
|
|
35
|
-
handles: handles,
|
|
36
|
-
});
|
|
37
|
-
const response = await retryWithBackoff(async () => {
|
|
38
|
-
return await kmsClient.attestedReveal(attestedRevealRequest);
|
|
39
|
-
}, backoffConfig);
|
|
40
|
-
if (response.decryptionAttestations.length !== handles.length) {
|
|
41
|
-
throw new AttestedRevealError(`Expected ${handles.length} decryption attestations in response, got ${response.decryptionAttestations.length}`);
|
|
42
|
-
}
|
|
43
|
-
const results = response.decryptionAttestations.map((att) => {
|
|
44
|
-
if (att.value === undefined) {
|
|
45
|
-
throw new AttestedRevealError('No value in attestation');
|
|
46
|
-
}
|
|
47
|
-
const plaintext = att.value.value;
|
|
48
|
-
const h = att.handle;
|
|
49
|
-
const handleType = getHandleType(h);
|
|
50
|
-
const bigIntValue = bytesToBigInt(plaintext.value);
|
|
51
|
-
return {
|
|
52
|
-
handle: h,
|
|
53
|
-
plaintext: bigintToPlaintext(encryptionSchemes.ecies, handleType, bigIntValue),
|
|
54
|
-
covalidatorSignature: att.signature,
|
|
55
|
-
};
|
|
56
|
-
});
|
|
57
|
-
return results;
|
|
58
|
-
}
|
|
59
|
-
catch (error) {
|
|
60
|
-
if (error instanceof AttestedRevealError) {
|
|
61
|
-
throw error;
|
|
62
|
-
}
|
|
63
|
-
throw new AttestedRevealError('Failed to reveal handles', error);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXR0ZXN0ZWQtcmV2ZWFsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2F0dGVzdGVkcmV2ZWFsL2F0dGVzdGVkLXJldmVhbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsTUFBTSxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFFNUMsT0FBTyxFQUFFLGFBQWEsRUFBYSxNQUFNLGNBQWMsQ0FBQztBQUN4RCxPQUFPLEVBQUUsaUJBQWlCLEVBQW9CLE1BQU0sYUFBYSxDQUFDO0FBQ2xFLE9BQU8sRUFDTCxpQkFBaUIsRUFFakIsaUJBQWlCLEdBRWxCLE1BQU0sNkJBQTZCLENBQUM7QUFDckMsT0FBTyxFQUVMLDJCQUEyQixHQUU1QixNQUFNLG9EQUFvRCxDQUFDO0FBQzVELE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxjQUFjLENBQUM7QUFFN0MsT0FBTyxFQUFFLHNCQUFzQixFQUFFLFlBQVksRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBRXhFLE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLGF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FDO1FBQ2QsQ0FBQztRQUNELE1BQU0sSUFBSSxtQkFBbUIsQ0FBQywwQkFBMEIsRUFBRSxLQUFLLENBQUMsQ0FBQztJQUNuRSxDQUFDO0FBQ0gsQ0FBQyJ9
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './types.js';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Custom error class for attested reveal operations.
|
|
3
|
-
*/
|
|
4
|
-
export class AttestedRevealError extends Error {
|
|
5
|
-
cause;
|
|
6
|
-
constructor(message, cause) {
|
|
7
|
-
super(message);
|
|
8
|
-
this.cause = cause;
|
|
9
|
-
this.name = 'AttestedRevealError';
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYXR0ZXN0ZWRyZXZlYWwvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFDSCxNQUFNLE9BQU8sbUJBQW9CLFNBQVEsS0FBSztJQUcxQjtJQUZsQixZQUNFLE9BQWUsRUFDQyxLQUFlO1FBRS9CLEtBQUssQ0FBQyxPQUFPLENBQUMsQ0FBQztRQUZDLFVBQUssR0FBTCxLQUFLLENBQVU7UUFHL0IsSUFBSSxDQUFDLElBQUksR0FBRyxxQkFBcUIsQ0FBQztJQUNwQyxDQUFDO0NBQ0YifQ==
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import type { GenEnum, GenExtension, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
|
|
2
|
-
import type { FieldOptions, FileOptions, MessageOptions, MethodOptions } from "@bufbuild/protobuf/wkt";
|
|
3
|
-
import type { Message } from "@bufbuild/protobuf";
|
|
4
|
-
/**
|
|
5
|
-
* Describes the file cosmos_proto/cosmos.proto.
|
|
6
|
-
*/
|
|
7
|
-
export declare const file_cosmos_proto_cosmos: GenFile;
|
|
8
|
-
/**
|
|
9
|
-
* InterfaceDescriptor describes an interface type to be used with
|
|
10
|
-
* accepts_interface and implements_interface and declared by declare_interface.
|
|
11
|
-
*
|
|
12
|
-
* @generated from message cosmos_proto.InterfaceDescriptor
|
|
13
|
-
*/
|
|
14
|
-
export type InterfaceDescriptor = Message<"cosmos_proto.InterfaceDescriptor"> & {
|
|
15
|
-
/**
|
|
16
|
-
* name is the name of the interface. It should be a short-name (without
|
|
17
|
-
* a period) such that the fully qualified name of the interface will be
|
|
18
|
-
* package.name, ex. for the package a.b and interface named C, the
|
|
19
|
-
* fully-qualified name will be a.b.C.
|
|
20
|
-
*
|
|
21
|
-
* @generated from field: string name = 1;
|
|
22
|
-
*/
|
|
23
|
-
name: string;
|
|
24
|
-
/**
|
|
25
|
-
* description is a human-readable description of the interface and its
|
|
26
|
-
* purpose.
|
|
27
|
-
*
|
|
28
|
-
* @generated from field: string description = 2;
|
|
29
|
-
*/
|
|
30
|
-
description: string;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* Describes the message cosmos_proto.InterfaceDescriptor.
|
|
34
|
-
* Use `create(InterfaceDescriptorSchema)` to create a new message.
|
|
35
|
-
*/
|
|
36
|
-
export declare const InterfaceDescriptorSchema: GenMessage<InterfaceDescriptor>;
|
|
37
|
-
/**
|
|
38
|
-
* ScalarDescriptor describes an scalar type to be used with
|
|
39
|
-
* the scalar field option and declared by declare_scalar.
|
|
40
|
-
* Scalars extend simple protobuf built-in types with additional
|
|
41
|
-
* syntax and semantics, for instance to represent big integers.
|
|
42
|
-
* Scalars should ideally define an encoding such that there is only one
|
|
43
|
-
* valid syntactical representation for a given semantic meaning,
|
|
44
|
-
* i.e. the encoding should be deterministic.
|
|
45
|
-
*
|
|
46
|
-
* @generated from message cosmos_proto.ScalarDescriptor
|
|
47
|
-
*/
|
|
48
|
-
export type ScalarDescriptor = Message<"cosmos_proto.ScalarDescriptor"> & {
|
|
49
|
-
/**
|
|
50
|
-
* name is the name of the scalar. It should be a short-name (without
|
|
51
|
-
* a period) such that the fully qualified name of the scalar will be
|
|
52
|
-
* package.name, ex. for the package a.b and scalar named C, the
|
|
53
|
-
* fully-qualified name will be a.b.C.
|
|
54
|
-
*
|
|
55
|
-
* @generated from field: string name = 1;
|
|
56
|
-
*/
|
|
57
|
-
name: string;
|
|
58
|
-
/**
|
|
59
|
-
* description is a human-readable description of the scalar and its
|
|
60
|
-
* encoding format. For instance a big integer or decimal scalar should
|
|
61
|
-
* specify precisely the expected encoding format.
|
|
62
|
-
*
|
|
63
|
-
* @generated from field: string description = 2;
|
|
64
|
-
*/
|
|
65
|
-
description: string;
|
|
66
|
-
/**
|
|
67
|
-
* field_type is the type of field with which this scalar can be used.
|
|
68
|
-
* Scalars can be used with one and only one type of field so that
|
|
69
|
-
* encoding standards and simple and clear. Currently only string and
|
|
70
|
-
* bytes fields are supported for scalars.
|
|
71
|
-
*
|
|
72
|
-
* @generated from field: repeated cosmos_proto.ScalarType field_type = 3;
|
|
73
|
-
*/
|
|
74
|
-
fieldType: ScalarType[];
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* Describes the message cosmos_proto.ScalarDescriptor.
|
|
78
|
-
* Use `create(ScalarDescriptorSchema)` to create a new message.
|
|
79
|
-
*/
|
|
80
|
-
export declare const ScalarDescriptorSchema: GenMessage<ScalarDescriptor>;
|
|
81
|
-
/**
|
|
82
|
-
* @generated from enum cosmos_proto.ScalarType
|
|
83
|
-
*/
|
|
84
|
-
export declare enum ScalarType {
|
|
85
|
-
/**
|
|
86
|
-
* @generated from enum value: SCALAR_TYPE_UNSPECIFIED = 0;
|
|
87
|
-
*/
|
|
88
|
-
UNSPECIFIED = 0,
|
|
89
|
-
/**
|
|
90
|
-
* @generated from enum value: SCALAR_TYPE_STRING = 1;
|
|
91
|
-
*/
|
|
92
|
-
STRING = 1,
|
|
93
|
-
/**
|
|
94
|
-
* @generated from enum value: SCALAR_TYPE_BYTES = 2;
|
|
95
|
-
*/
|
|
96
|
-
BYTES = 2
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Describes the enum cosmos_proto.ScalarType.
|
|
100
|
-
*/
|
|
101
|
-
export declare const ScalarTypeSchema: GenEnum<ScalarType>;
|
|
102
|
-
/**
|
|
103
|
-
* method_added_in is used to indicate from which version the method was added.
|
|
104
|
-
*
|
|
105
|
-
* @generated from extension: string method_added_in = 93001;
|
|
106
|
-
*/
|
|
107
|
-
export declare const method_added_in: GenExtension<MethodOptions, string>;
|
|
108
|
-
/**
|
|
109
|
-
* implements_interface is used to indicate the type name of the interface
|
|
110
|
-
* that a message implements so that it can be used in google.protobuf.Any
|
|
111
|
-
* fields that accept that interface. A message can implement multiple
|
|
112
|
-
* interfaces. Interfaces should be declared using a declare_interface
|
|
113
|
-
* file option.
|
|
114
|
-
*
|
|
115
|
-
* @generated from extension: repeated string implements_interface = 93001;
|
|
116
|
-
*/
|
|
117
|
-
export declare const implements_interface: GenExtension<MessageOptions, string[]>;
|
|
118
|
-
/**
|
|
119
|
-
* message_added_in is used to indicate from which version the message was added.
|
|
120
|
-
*
|
|
121
|
-
* @generated from extension: string message_added_in = 93002;
|
|
122
|
-
*/
|
|
123
|
-
export declare const message_added_in: GenExtension<MessageOptions, string>;
|
|
124
|
-
/**
|
|
125
|
-
* accepts_interface is used to annotate that a google.protobuf.Any
|
|
126
|
-
* field accepts messages that implement the specified interface.
|
|
127
|
-
* Interfaces should be declared using a declare_interface file option.
|
|
128
|
-
*
|
|
129
|
-
* @generated from extension: string accepts_interface = 93001;
|
|
130
|
-
*/
|
|
131
|
-
export declare const accepts_interface: GenExtension<FieldOptions, string>;
|
|
132
|
-
/**
|
|
133
|
-
* scalar is used to indicate that this field follows the formatting defined
|
|
134
|
-
* by the named scalar which should be declared with declare_scalar. Code
|
|
135
|
-
* generators may choose to use this information to map this field to a
|
|
136
|
-
* language-specific type representing the scalar.
|
|
137
|
-
*
|
|
138
|
-
* @generated from extension: string scalar = 93002;
|
|
139
|
-
*/
|
|
140
|
-
export declare const scalar: GenExtension<FieldOptions, string>;
|
|
141
|
-
/**
|
|
142
|
-
* field_added_in is used to indicate from which version the field was added.
|
|
143
|
-
*
|
|
144
|
-
* @generated from extension: string field_added_in = 93003;
|
|
145
|
-
*/
|
|
146
|
-
export declare const field_added_in: GenExtension<FieldOptions, string>;
|
|
147
|
-
/**
|
|
148
|
-
* declare_interface declares an interface type to be used with
|
|
149
|
-
* accepts_interface and implements_interface. Interface names are
|
|
150
|
-
* expected to follow the following convention such that their declaration
|
|
151
|
-
* can be discovered by tools: for a given interface type a.b.C, it is
|
|
152
|
-
* expected that the declaration will be found in a protobuf file named
|
|
153
|
-
* a/b/interfaces.proto in the file descriptor set.
|
|
154
|
-
*
|
|
155
|
-
* @generated from extension: repeated cosmos_proto.InterfaceDescriptor declare_interface = 793021;
|
|
156
|
-
*/
|
|
157
|
-
export declare const declare_interface: GenExtension<FileOptions, InterfaceDescriptor[]>;
|
|
158
|
-
/**
|
|
159
|
-
* declare_scalar declares a scalar type to be used with
|
|
160
|
-
* the scalar field option. Scalar names are
|
|
161
|
-
* expected to follow the following convention such that their declaration
|
|
162
|
-
* can be discovered by tools: for a given scalar type a.b.C, it is
|
|
163
|
-
* expected that the declaration will be found in a protobuf file named
|
|
164
|
-
* a/b/scalars.proto in the file descriptor set.
|
|
165
|
-
*
|
|
166
|
-
* @generated from extension: repeated cosmos_proto.ScalarDescriptor declare_scalar = 793022;
|
|
167
|
-
*/
|
|
168
|
-
export declare const declare_scalar: GenExtension<FileOptions, ScalarDescriptor[]>;
|
|
169
|
-
/**
|
|
170
|
-
* file_added_in is used to indicate from which the version the file was added.
|
|
171
|
-
*
|
|
172
|
-
* @generated from extension: string file_added_in = 793023;
|
|
173
|
-
*/
|
|
174
|
-
export declare const file_added_in: GenExtension<FileOptions, string>;
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
// @generated by protoc-gen-es v2.10.0 with parameter "target=ts"
|
|
2
|
-
// @generated from file cosmos_proto/cosmos.proto (package cosmos_proto, syntax proto3)
|
|
3
|
-
/* eslint-disable */
|
|
4
|
-
import { enumDesc, extDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2";
|
|
5
|
-
import { file_google_protobuf_descriptor } from "@bufbuild/protobuf/wkt";
|
|
6
|
-
/**
|
|
7
|
-
* Describes the file cosmos_proto/cosmos.proto.
|
|
8
|
-
*/
|
|
9
|
-
export const file_cosmos_proto_cosmos = /*@__PURE__*/ fileDesc("Chljb3Ntb3NfcHJvdG8vY29zbW9zLnByb3RvEgxjb3Ntb3NfcHJvdG8iOAoTSW50ZXJmYWNlRGVzY3JpcHRvchIMCgRuYW1lGAEgASgJEhMKC2Rlc2NyaXB0aW9uGAIgASgJImMKEFNjYWxhckRlc2NyaXB0b3ISDAoEbmFtZRgBIAEoCRITCgtkZXNjcmlwdGlvbhgCIAEoCRIsCgpmaWVsZF90eXBlGAMgAygOMhguY29zbW9zX3Byb3RvLlNjYWxhclR5cGUqWAoKU2NhbGFyVHlwZRIbChdTQ0FMQVJfVFlQRV9VTlNQRUNJRklFRBAAEhYKElNDQUxBUl9UWVBFX1NUUklORxABEhUKEVNDQUxBUl9UWVBFX0JZVEVTEAI6SAoPbWV0aG9kX2FkZGVkX2luEh4uZ29vZ2xlLnByb3RvYnVmLk1ldGhvZE9wdGlvbnMYydYFIAEoCVINbWV0aG9kQWRkZWRJbjpUChRpbXBsZW1lbnRzX2ludGVyZmFjZRIfLmdvb2dsZS5wcm90b2J1Zi5NZXNzYWdlT3B0aW9ucxjJ1gUgAygJUhNpbXBsZW1lbnRzSW50ZXJmYWNlOksKEG1lc3NhZ2VfYWRkZWRfaW4SHy5nb29nbGUucHJvdG9idWYuTWVzc2FnZU9wdGlvbnMYytYFIAEoCVIObWVzc2FnZUFkZGVkSW46TAoRYWNjZXB0c19pbnRlcmZhY2USHS5nb29nbGUucHJvdG9idWYuRmllbGRPcHRpb25zGMnWBSABKAlSEGFjY2VwdHNJbnRlcmZhY2U6NwoGc2NhbGFyEh0uZ29vZ2xlLnByb3RvYnVmLkZpZWxkT3B0aW9ucxjK1gUgASgJUgZzY2FsYXI6RQoOZmllbGRfYWRkZWRfaW4SHS5nb29nbGUucHJvdG9idWYuRmllbGRPcHRpb25zGMvWBSABKAlSDGZpZWxkQWRkZWRJbjpuChFkZWNsYXJlX2ludGVyZmFjZRIcLmdvb2dsZS5wcm90b2J1Zi5GaWxlT3B0aW9ucxi9szAgAygLMiEuY29zbW9zX3Byb3RvLkludGVyZmFjZURlc2NyaXB0b3JSEGRlY2xhcmVJbnRlcmZhY2U6ZQoOZGVjbGFyZV9zY2FsYXISHC5nb29nbGUucHJvdG9idWYuRmlsZU9wdGlvbnMYvrMwIAMoCzIeLmNvc21vc19wcm90by5TY2FsYXJEZXNjcmlwdG9yUg1kZWNsYXJlU2NhbGFyOkIKDWZpbGVfYWRkZWRfaW4SHC5nb29nbGUucHJvdG9idWYuRmlsZU9wdGlvbnMYv7MwIAEoCVILZmlsZUFkZGVkSW5CLVorZ2l0aHViLmNvbS9jb3Ntb3MvY29zbW9zLXByb3RvO2Nvc21vc19wcm90b2IGcHJvdG8z", [file_google_protobuf_descriptor]);
|
|
10
|
-
/**
|
|
11
|
-
* Describes the message cosmos_proto.InterfaceDescriptor.
|
|
12
|
-
* Use `create(InterfaceDescriptorSchema)` to create a new message.
|
|
13
|
-
*/
|
|
14
|
-
export const InterfaceDescriptorSchema = /*@__PURE__*/ messageDesc(file_cosmos_proto_cosmos, 0);
|
|
15
|
-
/**
|
|
16
|
-
* Describes the message cosmos_proto.ScalarDescriptor.
|
|
17
|
-
* Use `create(ScalarDescriptorSchema)` to create a new message.
|
|
18
|
-
*/
|
|
19
|
-
export const ScalarDescriptorSchema = /*@__PURE__*/ messageDesc(file_cosmos_proto_cosmos, 1);
|
|
20
|
-
/**
|
|
21
|
-
* @generated from enum cosmos_proto.ScalarType
|
|
22
|
-
*/
|
|
23
|
-
export var ScalarType;
|
|
24
|
-
(function (ScalarType) {
|
|
25
|
-
/**
|
|
26
|
-
* @generated from enum value: SCALAR_TYPE_UNSPECIFIED = 0;
|
|
27
|
-
*/
|
|
28
|
-
ScalarType[ScalarType["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
29
|
-
/**
|
|
30
|
-
* @generated from enum value: SCALAR_TYPE_STRING = 1;
|
|
31
|
-
*/
|
|
32
|
-
ScalarType[ScalarType["STRING"] = 1] = "STRING";
|
|
33
|
-
/**
|
|
34
|
-
* @generated from enum value: SCALAR_TYPE_BYTES = 2;
|
|
35
|
-
*/
|
|
36
|
-
ScalarType[ScalarType["BYTES"] = 2] = "BYTES";
|
|
37
|
-
})(ScalarType || (ScalarType = {}));
|
|
38
|
-
/**
|
|
39
|
-
* Describes the enum cosmos_proto.ScalarType.
|
|
40
|
-
*/
|
|
41
|
-
export const ScalarTypeSchema = /*@__PURE__*/ enumDesc(file_cosmos_proto_cosmos, 0);
|
|
42
|
-
/**
|
|
43
|
-
* method_added_in is used to indicate from which version the method was added.
|
|
44
|
-
*
|
|
45
|
-
* @generated from extension: string method_added_in = 93001;
|
|
46
|
-
*/
|
|
47
|
-
export const method_added_in = /*@__PURE__*/ extDesc(file_cosmos_proto_cosmos, 0);
|
|
48
|
-
/**
|
|
49
|
-
* implements_interface is used to indicate the type name of the interface
|
|
50
|
-
* that a message implements so that it can be used in google.protobuf.Any
|
|
51
|
-
* fields that accept that interface. A message can implement multiple
|
|
52
|
-
* interfaces. Interfaces should be declared using a declare_interface
|
|
53
|
-
* file option.
|
|
54
|
-
*
|
|
55
|
-
* @generated from extension: repeated string implements_interface = 93001;
|
|
56
|
-
*/
|
|
57
|
-
export const implements_interface = /*@__PURE__*/ extDesc(file_cosmos_proto_cosmos, 1);
|
|
58
|
-
/**
|
|
59
|
-
* message_added_in is used to indicate from which version the message was added.
|
|
60
|
-
*
|
|
61
|
-
* @generated from extension: string message_added_in = 93002;
|
|
62
|
-
*/
|
|
63
|
-
export const message_added_in = /*@__PURE__*/ extDesc(file_cosmos_proto_cosmos, 2);
|
|
64
|
-
/**
|
|
65
|
-
* accepts_interface is used to annotate that a google.protobuf.Any
|
|
66
|
-
* field accepts messages that implement the specified interface.
|
|
67
|
-
* Interfaces should be declared using a declare_interface file option.
|
|
68
|
-
*
|
|
69
|
-
* @generated from extension: string accepts_interface = 93001;
|
|
70
|
-
*/
|
|
71
|
-
export const accepts_interface = /*@__PURE__*/ extDesc(file_cosmos_proto_cosmos, 3);
|
|
72
|
-
/**
|
|
73
|
-
* scalar is used to indicate that this field follows the formatting defined
|
|
74
|
-
* by the named scalar which should be declared with declare_scalar. Code
|
|
75
|
-
* generators may choose to use this information to map this field to a
|
|
76
|
-
* language-specific type representing the scalar.
|
|
77
|
-
*
|
|
78
|
-
* @generated from extension: string scalar = 93002;
|
|
79
|
-
*/
|
|
80
|
-
export const scalar = /*@__PURE__*/ extDesc(file_cosmos_proto_cosmos, 4);
|
|
81
|
-
/**
|
|
82
|
-
* field_added_in is used to indicate from which version the field was added.
|
|
83
|
-
*
|
|
84
|
-
* @generated from extension: string field_added_in = 93003;
|
|
85
|
-
*/
|
|
86
|
-
export const field_added_in = /*@__PURE__*/ extDesc(file_cosmos_proto_cosmos, 5);
|
|
87
|
-
/**
|
|
88
|
-
* declare_interface declares an interface type to be used with
|
|
89
|
-
* accepts_interface and implements_interface. Interface names are
|
|
90
|
-
* expected to follow the following convention such that their declaration
|
|
91
|
-
* can be discovered by tools: for a given interface type a.b.C, it is
|
|
92
|
-
* expected that the declaration will be found in a protobuf file named
|
|
93
|
-
* a/b/interfaces.proto in the file descriptor set.
|
|
94
|
-
*
|
|
95
|
-
* @generated from extension: repeated cosmos_proto.InterfaceDescriptor declare_interface = 793021;
|
|
96
|
-
*/
|
|
97
|
-
export const declare_interface = /*@__PURE__*/ extDesc(file_cosmos_proto_cosmos, 6);
|
|
98
|
-
/**
|
|
99
|
-
* declare_scalar declares a scalar type to be used with
|
|
100
|
-
* the scalar field option. Scalar names are
|
|
101
|
-
* expected to follow the following convention such that their declaration
|
|
102
|
-
* can be discovered by tools: for a given scalar type a.b.C, it is
|
|
103
|
-
* expected that the declaration will be found in a protobuf file named
|
|
104
|
-
* a/b/scalars.proto in the file descriptor set.
|
|
105
|
-
*
|
|
106
|
-
* @generated from extension: repeated cosmos_proto.ScalarDescriptor declare_scalar = 793022;
|
|
107
|
-
*/
|
|
108
|
-
export const declare_scalar = /*@__PURE__*/ extDesc(file_cosmos_proto_cosmos, 7);
|
|
109
|
-
/**
|
|
110
|
-
* file_added_in is used to indicate from which the version the file was added.
|
|
111
|
-
*
|
|
112
|
-
* @generated from extension: string file_added_in = 793023;
|
|
113
|
-
*/
|
|
114
|
-
export const file_added_in = /*@__PURE__*/ extDesc(file_cosmos_proto_cosmos, 8);
|
|
115
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29zbW9zX3BiLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vc3JjL2dlbmVyYXRlZC9lcy9jb3Ntb3NfcHJvdG8vY29zbW9zX3BiLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGlFQUFpRTtBQUNqRSx1RkFBdUY7QUFDdkYsb0JBQW9CO0FBR3BCLE9BQU8sRUFBRSxRQUFRLEVBQUUsT0FBTyxFQUFFLFFBQVEsRUFBRSxXQUFXLEVBQUUsTUFBTSw4QkFBOEIsQ0FBQztBQUV4RixPQUFPLEVBQUUsK0JBQStCLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUd6RTs7R0FFRztBQUNILE1BQU0sQ0FBQyxNQUFNLHdCQUF3QixHQUFZLGFBQWEsQ0FDNUQsUUFBUSxDQUFDLHM1Q0FBczVDLEVBQUUsQ0FBQywrQkFBK0IsQ0FBQyxDQUFDLENBQUM7QUE0QnQ4Qzs7O0dBR0c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