@inco/js 0.6.9 → 0.7.0

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.
Files changed (105) hide show
  1. package/README.md +8 -8
  2. package/dist/cjs/advancedacl/session-key.d.ts +39 -26
  3. package/dist/cjs/advancedacl/session-key.js +53 -136
  4. package/dist/cjs/attestedcompute/attested-compute.d.ts +6 -6
  5. package/dist/cjs/attestedcompute/attested-compute.js +5 -35
  6. package/dist/cjs/attesteddecrypt/attested-decrypt.d.ts +36 -21
  7. package/dist/cjs/attesteddecrypt/attested-decrypt.js +107 -108
  8. package/dist/cjs/attesteddecrypt/types.d.ts +4 -4
  9. package/dist/cjs/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +15 -1
  10. package/dist/cjs/generated/es/inco/covalidator/compute/v1/types_pb.js +1 -1
  11. package/dist/cjs/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +13 -5
  12. package/dist/cjs/generated/es/inco/kms/lite/v1/kms_service_pb.js +3 -4
  13. package/dist/cjs/generated/lightning.d.ts +40 -0
  14. package/dist/cjs/generated/lightning.js +43 -1
  15. package/dist/cjs/generated/local-node.d.ts +11 -7
  16. package/dist/cjs/generated/local-node.js +28 -8
  17. package/dist/cjs/kms/client.d.ts +8 -4
  18. package/dist/cjs/kms/client.js +9 -4
  19. package/dist/cjs/kms/quorumClient.d.ts +58 -0
  20. package/dist/cjs/kms/quorumClient.js +378 -0
  21. package/dist/cjs/kms/thresholdPromises.d.ts +7 -0
  22. package/dist/cjs/kms/thresholdPromises.js +52 -0
  23. package/dist/cjs/lite/index.d.ts +0 -1
  24. package/dist/cjs/lite/index.js +1 -2
  25. package/dist/cjs/lite/lightning.d.ts +87 -67
  26. package/dist/cjs/lite/lightning.js +231 -100
  27. package/dist/cjs/local/local-node.d.ts +1 -2
  28. package/dist/cjs/local/local-node.js +2 -3
  29. package/dist/cjs/test/mocks.d.ts +3 -0
  30. package/dist/cjs/test/mocks.js +19 -1
  31. package/dist/esm/advancedacl/session-key.d.ts +39 -26
  32. package/dist/esm/advancedacl/session-key.js +44 -126
  33. package/dist/esm/attestedcompute/attested-compute.d.ts +6 -6
  34. package/dist/esm/attestedcompute/attested-compute.js +6 -36
  35. package/dist/esm/attesteddecrypt/attested-decrypt.d.ts +36 -21
  36. package/dist/esm/attesteddecrypt/attested-decrypt.js +106 -108
  37. package/dist/esm/attesteddecrypt/types.d.ts +4 -4
  38. package/dist/esm/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +15 -1
  39. package/dist/esm/generated/es/inco/covalidator/compute/v1/types_pb.js +1 -1
  40. package/dist/esm/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +13 -5
  41. package/dist/esm/generated/es/inco/kms/lite/v1/kms_service_pb.js +2 -3
  42. package/dist/esm/generated/lightning.d.ts +40 -0
  43. package/dist/esm/generated/lightning.js +43 -1
  44. package/dist/esm/generated/local-node.d.ts +11 -7
  45. package/dist/esm/generated/local-node.js +28 -8
  46. package/dist/esm/kms/client.d.ts +8 -4
  47. package/dist/esm/kms/client.js +8 -4
  48. package/dist/esm/kms/quorumClient.d.ts +58 -0
  49. package/dist/esm/kms/quorumClient.js +374 -0
  50. package/dist/esm/kms/thresholdPromises.d.ts +7 -0
  51. package/dist/esm/kms/thresholdPromises.js +49 -0
  52. package/dist/esm/lite/index.d.ts +0 -1
  53. package/dist/esm/lite/index.js +1 -2
  54. package/dist/esm/lite/lightning.d.ts +87 -67
  55. package/dist/esm/lite/lightning.js +234 -103
  56. package/dist/esm/local/local-node.d.ts +1 -2
  57. package/dist/esm/local/local-node.js +2 -3
  58. package/dist/esm/test/mocks.d.ts +3 -0
  59. package/dist/esm/test/mocks.js +17 -1
  60. package/dist/types/advancedacl/session-key.d.ts +39 -26
  61. package/dist/types/attestedcompute/attested-compute.d.ts +6 -6
  62. package/dist/types/attesteddecrypt/attested-decrypt.d.ts +36 -21
  63. package/dist/types/attesteddecrypt/types.d.ts +4 -4
  64. package/dist/types/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +15 -1
  65. package/dist/types/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +13 -5
  66. package/dist/types/generated/lightning.d.ts +40 -0
  67. package/dist/types/generated/local-node.d.ts +11 -7
  68. package/dist/types/kms/client.d.ts +8 -4
  69. package/dist/types/kms/quorumClient.d.ts +58 -0
  70. package/dist/types/kms/thresholdPromises.d.ts +7 -0
  71. package/dist/types/lite/index.d.ts +0 -1
  72. package/dist/types/lite/lightning.d.ts +87 -67
  73. package/dist/types/local/local-node.d.ts +1 -2
  74. package/dist/types/test/mocks.d.ts +3 -0
  75. package/package.json +2 -2
  76. package/dist/cjs/attestedreveal/attested-reveal.d.ts +0 -21
  77. package/dist/cjs/attestedreveal/attested-reveal.js +0 -69
  78. package/dist/cjs/attestedreveal/index.d.ts +0 -1
  79. package/dist/cjs/attestedreveal/index.js +0 -18
  80. package/dist/cjs/attestedreveal/types.d.ts +0 -7
  81. package/dist/cjs/attestedreveal/types.js +0 -16
  82. package/dist/cjs/generated/es/cosmos_proto/cosmos_pb.d.ts +0 -174
  83. package/dist/cjs/generated/es/cosmos_proto/cosmos_pb.js +0 -118
  84. package/dist/cjs/generated/es/inco/fhe/v1/types_pb.d.ts +0 -419
  85. package/dist/cjs/generated/es/inco/fhe/v1/types_pb.js +0 -136
  86. package/dist/cjs/lite/reencrypt.d.ts +0 -21
  87. package/dist/cjs/lite/reencrypt.js +0 -141
  88. package/dist/esm/attestedreveal/attested-reveal.d.ts +0 -21
  89. package/dist/esm/attestedreveal/attested-reveal.js +0 -66
  90. package/dist/esm/attestedreveal/index.d.ts +0 -1
  91. package/dist/esm/attestedreveal/index.js +0 -2
  92. package/dist/esm/attestedreveal/types.d.ts +0 -7
  93. package/dist/esm/attestedreveal/types.js +0 -12
  94. package/dist/esm/generated/es/cosmos_proto/cosmos_pb.d.ts +0 -174
  95. package/dist/esm/generated/es/cosmos_proto/cosmos_pb.js +0 -115
  96. package/dist/esm/generated/es/inco/fhe/v1/types_pb.d.ts +0 -419
  97. package/dist/esm/generated/es/inco/fhe/v1/types_pb.js +0 -133
  98. package/dist/esm/lite/reencrypt.d.ts +0 -21
  99. package/dist/esm/lite/reencrypt.js +0 -131
  100. package/dist/types/attestedreveal/attested-reveal.d.ts +0 -21
  101. package/dist/types/attestedreveal/index.d.ts +0 -1
  102. package/dist/types/attestedreveal/types.d.ts +0 -7
  103. package/dist/types/generated/es/cosmos_proto/cosmos_pb.d.ts +0 -174
  104. package/dist/types/generated/es/inco/fhe/v1/types_pb.d.ts +0 -419
  105. package/dist/types/lite/reencrypt.d.ts +0 -21
@@ -1,131 +0,0 @@
1
- import { create } from '@bufbuild/protobuf';
2
- import { createClient } from '@connectrpc/connect';
3
- import { createConnectTransport } from '@connectrpc/connect-web';
4
- import { attestedDecrypt } from '../attesteddecrypt/attested-decrypt.js';
5
- import { bytesToBigInt } from '../binary.js';
6
- import { getSupportedChain } from '../chain.js';
7
- import { bigintToPlaintext, encryptionSchemes, } from '../encryption/encryption.js';
8
- import { AttestedDecryptResponseSchema, DecryptionAttestationSchema, KmsService, PlaintextSchema, } from '../generated/es/inco/kms/lite/v1/kms_service_pb.js';
9
- import { getHandleType } from '../handle.js';
10
- import { decrypt, generateSecp256k1Keypair, } from './ecies.js';
11
- // Returns the Inco Lite Reencryptor, which can reencrypt a handle using the
12
- // Basic ACL.
13
- export async function incoLiteReencryptor({ kmsConnectRpcEndpointOrClient, chainId, walletClient, ephemeralKeypair, }) {
14
- const kmsClient = getKmsClient(kmsConnectRpcEndpointOrClient ||
15
- defaultCovalidatorGrpc(getSupportedChain(chainId)));
16
- if (!ephemeralKeypair) {
17
- ephemeralKeypair = await generateSecp256k1Keypair();
18
- }
19
- return async function reencrypt({ handle }, backoffConfig) {
20
- const ephemeralPubKey = ephemeralKeypair.encodePublicKey();
21
- const response = await attestedDecrypt({
22
- chainId: getSupportedChain(chainId).id,
23
- walletClient,
24
- kmsConnectRpcEndpointOrClient: kmsClient,
25
- handles: [handle],
26
- backoffConfig,
27
- reencryptPubKey: ephemeralPubKey,
28
- reencryptKeypair: ephemeralKeypair,
29
- });
30
- if (response.length !== 1) {
31
- throw new Error(`Expected 1 result, got ${response.length}`);
32
- }
33
- return response[0].plaintext;
34
- };
35
- }
36
- // Helper function to get a KMS client from a string or a Client instance.
37
- export function getKmsClient(kmsConnectRpcEndpointOrClient) {
38
- if (typeof kmsConnectRpcEndpointOrClient === 'string') {
39
- const transport = createConnectTransport({
40
- baseUrl: kmsConnectRpcEndpointOrClient,
41
- });
42
- return createClient(KmsService, transport);
43
- }
44
- return kmsConnectRpcEndpointOrClient;
45
- }
46
- // Decrypt using ECIES the ciphertext in the response.
47
- // Even though the proto specifies a list of ciphertexts, our JS SDK
48
- // currently only supports a single ciphertext.
49
- export async function decryptGrpcResponse(response, ephemeralKeypair, handle) {
50
- if (response.decryptionAttestations.length === 0) {
51
- throw new Error('No decryption attestations in the response');
52
- }
53
- const att = response.decryptionAttestations[0];
54
- if (att.value === undefined) {
55
- throw new Error('No value in attestation');
56
- }
57
- if (att.value.case !== 'reencryption') {
58
- throw new Error(`Unexpected attestation type: ${att.value.case}, expected 'reencryption'`);
59
- }
60
- const reencryption = att.value.value;
61
- const reencryptedCt = reencryption.userCiphertext;
62
- if (!reencryptedCt) {
63
- throw new Error('No reencrypted ciphertext in the response');
64
- }
65
- const plaintextBytes = await decrypt(ephemeralKeypair, reencryptedCt.ciphertext);
66
- const plaintext = bytesToBigInt(plaintextBytes);
67
- return bigintToPlaintext(encryptionSchemes.ecies, getHandleType(handle), plaintext);
68
- }
69
- // A helper function that takes in a DecryptionAttestation message containing reencryption,
70
- // decrypts it using the provided reencryptKeypair, and returns a DecryptionAttestation message containing a plaintext.
71
- export async function decryptGrpcDecryptionAttestation(attestation, reencryptKeypair) {
72
- if (attestation.value === undefined) {
73
- throw new Error('No value in attestation');
74
- }
75
- if (attestation.value.case !== 'reencryption') {
76
- return Promise.resolve(attestation);
77
- }
78
- const reencryption = attestation.value.value;
79
- const reencryptedCt = reencryption.userCiphertext;
80
- if (!reencryptedCt) {
81
- throw new Error('No reencrypted ciphertext in the response');
82
- }
83
- const plaintextBytes = await decrypt(reencryptKeypair, reencryptedCt.ciphertext);
84
- return create(DecryptionAttestationSchema, {
85
- handle: attestation.handle,
86
- value: {
87
- case: 'plaintext',
88
- value: create(PlaintextSchema, {
89
- value: plaintextBytes,
90
- }),
91
- },
92
- signature: attestation.signature,
93
- });
94
- }
95
- // A helper function that takes in an AttestedDecryptResponse message containing reencryption attestations,
96
- // decrypts them using the provided reencryptKeypair, and returns an AttestedDecryptResponse message containing plaintext attestations.
97
- export async function decryptGrpcDecryptResponse(response, reencryptKeypair) {
98
- if (response.decryptionAttestations.length === 0) {
99
- throw new Error('No decryption attestations in the response');
100
- }
101
- // For each attestation in the response, decrypt it
102
- const decryptedAttestations = await Promise.all(response.decryptionAttestations.map(async (attestation) => {
103
- return await decryptGrpcDecryptionAttestation(attestation, reencryptKeypair);
104
- }));
105
- // Return new response with decrypted attestations
106
- return create(AttestedDecryptResponseSchema, {
107
- decryptionAttestations: decryptedAttestations,
108
- });
109
- }
110
- // Helper function to return the default gRPC endpoint for the covalidator.
111
- // Currently, this returns the covalidator for the Inco Lightning public testnet.
112
- export function defaultCovalidatorGrpc(chain) {
113
- return lightningTestnetCovalidatorGrpc(chain);
114
- }
115
- // Helper function to get the devnet gRPC endpoint for the Inco Lightning covalidator.
116
- export function lightningDevnetCovalidatorGrpc(chain) {
117
- return getCovalidatorGrpcHelper(chain, 'devnet', 'lightning');
118
- }
119
- // Helper function to get the testnet gRPC endpoint for the Inco Lightning covalidator.
120
- export function lightningTestnetCovalidatorGrpc(chain) {
121
- return getCovalidatorGrpcHelper(chain, 'testnet', 'lightning');
122
- }
123
- // Convert camelCase to dash-case.
124
- function camelToDashCase(str) {
125
- return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
126
- }
127
- // Small helper, as our GCP covalidator URLs are in a specific format.
128
- function getCovalidatorGrpcHelper(chain, network, cluster) {
129
- return `https://grpc.${camelToDashCase(chain.name)}.${cluster}.${network}.inco.org`;
130
- }
131
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVlbmNyeXB0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpdGUvcmVlbmNyeXB0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUM1QyxPQUFPLEVBQVUsWUFBWSxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDM0QsT0FBTyxFQUFFLHNCQUFzQixFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFFakUsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLHdDQUF3QyxDQUFDO0FBQ3pFLE9BQU8sRUFBRSxhQUFhLEVBQWEsTUFBTSxjQUFjLENBQUM7QUFDeEQsT0FBTyxFQUFFLGlCQUFpQixFQUFrQixNQUFNLGFBQWEsQ0FBQztBQUNoRSxPQUFPLEVBQ0wsaUJBQWlCLEVBRWpCLGlCQUFpQixHQUdsQixNQUFNLDZCQUE2QixDQUFDO0FBQ3JDLE9BQU8sRUFFTCw2QkFBNkIsRUFFN0IsMkJBQTJCLEVBQzNCLFVBQVUsRUFDVixlQUFlLEdBRWhCLE1BQU0sb0RBQW9ELENBQUM7QUFDNUQsT0FBTyxFQUFFLGFBQWEsRUFBVSxNQUFNLGNBQWMsQ0FBQztBQU9yRCxPQUFPLEVBQ0wsT0FBTyxFQUNQLHdCQUF3QixHQUV6QixNQUFNLFlBQVksQ0FBQztBQWlCcEIsNEVBQTRFO0FBQzVFLGFBQWE7QUFDYixNQUFNLENBQUMsS0FBSyxVQUFVLG1CQUFtQixDQUFDLEVBQ3hDLDZCQUE2QixFQUM3QixPQUFPLEVBQ1AsWUFBWSxFQUNaLG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MsQ0FBQztBQUNMLENBQUM7QUFFRCwyRUFBMkU7QUFDM0UsaUZBQWlGO0FBQ2pGLE1BQU0sVUFBVSxzQkFBc0IsQ0FBQyxLQUFxQjtJQUMxRCxPQUFPLCtCQUErQixDQUFDLEtBQUssQ0FBQyxDQUFDO0FBQ2hELENBQUM7QUFFRCxzRkFBc0Y7QUFDdEYsTUFBTSxVQUFVLDhCQUE4QixDQUFDLEtBQXFCO0lBQ2xFLE9BQU8sd0JBQXdCLENBQUMsS0FBSyxFQUFFLFFBQVEsRUFBRSxXQUFXLENBQUMsQ0FBQztBQUNoRSxDQUFDO0FBRUQsdUZBQXVGO0FBQ3ZGLE1BQU0sVUFBVSwrQkFBK0IsQ0FBQyxLQUFxQjtJQUNuRSxPQUFPLHdCQUF3QixDQUFDLEtBQUssRUFBRSxTQUFTLEVBQUUsV0FBVyxDQUFDLENBQUM7QUFDakUsQ0FBQztBQUVELGtDQUFrQztBQUNsQyxTQUFTLGVBQWUsQ0FBQyxHQUFXO0lBQ2xDLE9BQU8sR0FBRyxDQUFDLE9BQU8sQ0FBQyxpQkFBaUIsRUFBRSxPQUFPLENBQUMsQ0FBQyxXQUFXLEVBQUUsQ0FBQztBQUMvRCxDQUFDO0FBRUQsc0VBQXNFO0FBQ3RFLFNBQVMsd0JBQXdCLENBQy9CLEtBQXFCLEVBQ3JCLE9BQTZCLEVBQzdCLE9BQW9CO0lBRXBCLE9BQU8sZ0JBQWdCLGVBQWUsQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLElBQUksT0FBTyxJQUFJLE9BQU8sV0FBVyxDQUFDO0FBQ3RGLENBQUMifQ==
@@ -1,21 +0,0 @@
1
- import { DecryptionAttestation } 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 +0,0 @@
1
- export * from './types.js';
@@ -1,7 +0,0 @@
1
- /**
2
- * Custom error class for attested reveal operations.
3
- */
4
- export declare class AttestedRevealError extends Error {
5
- readonly cause?: unknown | undefined;
6
- constructor(message: string, cause?: unknown | undefined);
7
- }
@@ -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>;