@inco/js 0.6.8 → 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 (140) hide show
  1. package/README.md +8 -8
  2. package/dist/cjs/advancedacl/session-key.d.ts +39 -19
  3. package/dist/cjs/advancedacl/session-key.js +59 -108
  4. package/dist/cjs/attestedcompute/attested-compute.d.ts +6 -6
  5. package/dist/cjs/attestedcompute/attested-compute.js +5 -28
  6. package/dist/cjs/attesteddecrypt/attested-decrypt.d.ts +68 -16
  7. package/dist/cjs/attesteddecrypt/attested-decrypt.js +108 -66
  8. package/dist/cjs/attesteddecrypt/types.d.ts +8 -3
  9. package/dist/cjs/attesteddecrypt/types.js +1 -1
  10. package/dist/cjs/encryption/encryption.d.ts +8 -10
  11. package/dist/cjs/encryption/encryption.js +6 -6
  12. package/dist/cjs/generated/abis/add-two.d.ts +1 -1
  13. package/dist/cjs/generated/abis/add-two.js +1 -1
  14. package/dist/cjs/generated/abis/lightning-preview.d.ts +40 -0
  15. package/dist/cjs/generated/abis/lightning-preview.js +29 -1
  16. package/dist/cjs/generated/abis/lightning.d.ts +1 -1
  17. package/dist/cjs/generated/abis/lightning.js +1 -1
  18. package/dist/cjs/generated/abis/verifier.d.ts +126 -67
  19. package/dist/cjs/generated/abis/verifier.js +108 -54
  20. package/dist/cjs/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +15 -1
  21. package/dist/cjs/generated/es/inco/covalidator/compute/v1/types_pb.js +1 -1
  22. package/dist/cjs/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +87 -132
  23. package/dist/cjs/generated/es/inco/kms/lite/v1/kms_service_pb.js +21 -27
  24. package/dist/cjs/generated/lightning.d.ts +40 -32
  25. package/dist/cjs/generated/lightning.js +43 -33
  26. package/dist/cjs/generated/local-node.d.ts +11 -11
  27. package/dist/cjs/generated/local-node.js +28 -12
  28. package/dist/cjs/kms/client.d.ts +8 -4
  29. package/dist/cjs/kms/client.js +9 -4
  30. package/dist/cjs/kms/quorumClient.d.ts +58 -0
  31. package/dist/cjs/kms/quorumClient.js +378 -0
  32. package/dist/cjs/kms/thresholdPromises.d.ts +7 -0
  33. package/dist/cjs/kms/thresholdPromises.js +52 -0
  34. package/dist/cjs/lite/deployments.d.ts +20 -2
  35. package/dist/cjs/lite/deployments.js +1 -1
  36. package/dist/cjs/lite/index.d.ts +1 -2
  37. package/dist/cjs/lite/index.js +1 -2
  38. package/dist/cjs/lite/lightning.d.ts +109 -77
  39. package/dist/cjs/lite/lightning.js +279 -112
  40. package/dist/cjs/local/local-node.d.ts +1 -2
  41. package/dist/cjs/local/local-node.js +2 -3
  42. package/dist/cjs/test/mocks.d.ts +15 -0
  43. package/dist/cjs/test/mocks.js +45 -0
  44. package/dist/cjs/viem.d.ts +1 -1
  45. package/dist/esm/advancedacl/session-key.d.ts +39 -19
  46. package/dist/esm/advancedacl/session-key.js +52 -100
  47. package/dist/esm/attestedcompute/attested-compute.d.ts +6 -6
  48. package/dist/esm/attestedcompute/attested-compute.js +6 -29
  49. package/dist/esm/attesteddecrypt/attested-decrypt.d.ts +68 -16
  50. package/dist/esm/attesteddecrypt/attested-decrypt.js +109 -68
  51. package/dist/esm/attesteddecrypt/types.d.ts +8 -3
  52. package/dist/esm/attesteddecrypt/types.js +1 -1
  53. package/dist/esm/encryption/encryption.d.ts +8 -10
  54. package/dist/esm/encryption/encryption.js +6 -6
  55. package/dist/esm/generated/abis/add-two.d.ts +1 -1
  56. package/dist/esm/generated/abis/add-two.js +1 -1
  57. package/dist/esm/generated/abis/lightning-preview.d.ts +40 -0
  58. package/dist/esm/generated/abis/lightning-preview.js +29 -1
  59. package/dist/esm/generated/abis/lightning.d.ts +1 -1
  60. package/dist/esm/generated/abis/lightning.js +1 -1
  61. package/dist/esm/generated/abis/verifier.d.ts +126 -67
  62. package/dist/esm/generated/abis/verifier.js +108 -54
  63. package/dist/esm/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +15 -1
  64. package/dist/esm/generated/es/inco/covalidator/compute/v1/types_pb.js +1 -1
  65. package/dist/esm/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +87 -132
  66. package/dist/esm/generated/es/inco/kms/lite/v1/kms_service_pb.js +19 -25
  67. package/dist/esm/generated/lightning.d.ts +40 -32
  68. package/dist/esm/generated/lightning.js +43 -33
  69. package/dist/esm/generated/local-node.d.ts +11 -11
  70. package/dist/esm/generated/local-node.js +28 -12
  71. package/dist/esm/kms/client.d.ts +8 -4
  72. package/dist/esm/kms/client.js +8 -4
  73. package/dist/esm/kms/quorumClient.d.ts +58 -0
  74. package/dist/esm/kms/quorumClient.js +374 -0
  75. package/dist/esm/kms/thresholdPromises.d.ts +7 -0
  76. package/dist/esm/kms/thresholdPromises.js +49 -0
  77. package/dist/esm/lite/deployments.d.ts +20 -2
  78. package/dist/esm/lite/deployments.js +1 -1
  79. package/dist/esm/lite/index.d.ts +1 -2
  80. package/dist/esm/lite/index.js +1 -2
  81. package/dist/esm/lite/lightning.d.ts +109 -77
  82. package/dist/esm/lite/lightning.js +278 -111
  83. package/dist/esm/local/local-node.d.ts +1 -2
  84. package/dist/esm/local/local-node.js +2 -3
  85. package/dist/esm/test/mocks.d.ts +15 -0
  86. package/dist/esm/test/mocks.js +39 -0
  87. package/dist/esm/viem.d.ts +1 -1
  88. package/dist/types/advancedacl/session-key.d.ts +39 -19
  89. package/dist/types/attestedcompute/attested-compute.d.ts +6 -6
  90. package/dist/types/attesteddecrypt/attested-decrypt.d.ts +68 -16
  91. package/dist/types/attesteddecrypt/types.d.ts +8 -3
  92. package/dist/types/encryption/encryption.d.ts +8 -10
  93. package/dist/types/generated/abis/add-two.d.ts +1 -1
  94. package/dist/types/generated/abis/lightning-preview.d.ts +40 -0
  95. package/dist/types/generated/abis/lightning.d.ts +1 -1
  96. package/dist/types/generated/abis/verifier.d.ts +126 -67
  97. package/dist/types/generated/es/inco/covalidator/compute/v1/types_pb.d.ts +15 -1
  98. package/dist/types/generated/es/inco/kms/lite/v1/kms_service_pb.d.ts +87 -132
  99. package/dist/types/generated/lightning.d.ts +40 -32
  100. package/dist/types/generated/local-node.d.ts +11 -11
  101. package/dist/types/kms/client.d.ts +8 -4
  102. package/dist/types/kms/quorumClient.d.ts +58 -0
  103. package/dist/types/kms/thresholdPromises.d.ts +7 -0
  104. package/dist/types/lite/deployments.d.ts +20 -2
  105. package/dist/types/lite/index.d.ts +1 -2
  106. package/dist/types/lite/lightning.d.ts +109 -77
  107. package/dist/types/local/local-node.d.ts +1 -2
  108. package/dist/types/test/mocks.d.ts +15 -0
  109. package/dist/types/viem.d.ts +1 -1
  110. package/package.json +3 -3
  111. package/dist/cjs/attestedreveal/attested-reveal.d.ts +0 -21
  112. package/dist/cjs/attestedreveal/attested-reveal.js +0 -67
  113. package/dist/cjs/attestedreveal/index.d.ts +0 -1
  114. package/dist/cjs/attestedreveal/index.js +0 -18
  115. package/dist/cjs/attestedreveal/types.d.ts +0 -7
  116. package/dist/cjs/attestedreveal/types.js +0 -16
  117. package/dist/cjs/generated/es/cosmos_proto/cosmos_pb.d.ts +0 -174
  118. package/dist/cjs/generated/es/cosmos_proto/cosmos_pb.js +0 -118
  119. package/dist/cjs/generated/es/inco/fhe/v1/types_pb.d.ts +0 -419
  120. package/dist/cjs/generated/es/inco/fhe/v1/types_pb.js +0 -136
  121. package/dist/cjs/lite/reencrypt.d.ts +0 -23
  122. package/dist/cjs/lite/reencrypt.js +0 -131
  123. package/dist/esm/attestedreveal/attested-reveal.d.ts +0 -21
  124. package/dist/esm/attestedreveal/attested-reveal.js +0 -64
  125. package/dist/esm/attestedreveal/index.d.ts +0 -1
  126. package/dist/esm/attestedreveal/index.js +0 -2
  127. package/dist/esm/attestedreveal/types.d.ts +0 -7
  128. package/dist/esm/attestedreveal/types.js +0 -12
  129. package/dist/esm/generated/es/cosmos_proto/cosmos_pb.d.ts +0 -174
  130. package/dist/esm/generated/es/cosmos_proto/cosmos_pb.js +0 -115
  131. package/dist/esm/generated/es/inco/fhe/v1/types_pb.d.ts +0 -419
  132. package/dist/esm/generated/es/inco/fhe/v1/types_pb.js +0 -133
  133. package/dist/esm/lite/reencrypt.d.ts +0 -23
  134. package/dist/esm/lite/reencrypt.js +0 -122
  135. package/dist/types/attestedreveal/attested-reveal.d.ts +0 -21
  136. package/dist/types/attestedreveal/index.d.ts +0 -1
  137. package/dist/types/attestedreveal/types.d.ts +0 -7
  138. package/dist/types/generated/es/cosmos_proto/cosmos_pb.d.ts +0 -174
  139. package/dist/types/generated/es/inco/fhe/v1/types_pb.d.ts +0 -419
  140. package/dist/types/lite/reencrypt.d.ts +0 -23
@@ -1,122 +0,0 @@
1
- import { create } from '@bufbuild/protobuf';
2
- import { createClient } from '@connectrpc/connect';
3
- import { createConnectTransport } from '@connectrpc/connect-web';
4
- import { bytesToHex, hexToBytes, } from 'viem';
5
- import { bytesToBigInt } from '../binary.js';
6
- import { getSupportedChain } from '../chain.js';
7
- import { bigintToPlaintext, encryptionSchemes, } from '../encryption/encryption.js';
8
- import { KmsService, ReencryptRequestSchema, } from '../generated/es/inco/kms/lite/v1/kms_service_pb.js';
9
- import { HandleWithProofSchema } from '../generated/es/inco/kms/lite/v1/types_pb.js';
10
- import { getHandleType } from '../handle.js';
11
- import { createEIP712Payload } from '../reencryption/eip712.js';
12
- import { retryWithBackoff } from '../retry.js';
13
- import { decrypt, generateSecp256k1Keypair, } from './ecies.js';
14
- // The domain constants used for basic reencrypts.
15
- // Note: for advanced ACL, since the signature is checked on-chain, the domain
16
- // and version must match the ones used in the contract. For basic ones, we use
17
- // a domain different than the one used on-chain
18
- const BASIC_REENCRYPT_DOMAIN = {
19
- name: 'IncoReencryption',
20
- version: '0.1.0',
21
- };
22
- // Create an EIP712 payload for the Inco Lite basic reencrypt.
23
- export function reencryptEIP712(chainId, ephemeralPubKey) {
24
- return createEIP712Payload({
25
- chainId,
26
- primaryType: 'ReencryptionRequest',
27
- primaryTypeFields: [{ name: 'publicKey', type: 'bytes' }],
28
- message: {
29
- publicKey: bytesToHex(ephemeralPubKey),
30
- },
31
- domainName: BASIC_REENCRYPT_DOMAIN.name,
32
- domainVersion: BASIC_REENCRYPT_DOMAIN.version,
33
- });
34
- }
35
- // Returns the Inco Lite Reencryptor, which can reencrypt a handle using the
36
- // Basic ACL.
37
- export async function incoLiteReencryptor({ kmsConnectRpcEndpointOrClient, chainId, walletClient, ephemeralKeypair, }) {
38
- const kmsClient = getKmsClient(kmsConnectRpcEndpointOrClient ||
39
- defaultCovalidatorGrpc(getSupportedChain(chainId)));
40
- if (!ephemeralKeypair) {
41
- ephemeralKeypair = await generateSecp256k1Keypair();
42
- }
43
- // Sign the EIP712 attesting that the user has access to the private key
44
- // corresponding to the ephemeral public key.
45
- const eip712Payload = reencryptEIP712(chainId, ephemeralKeypair.encodePublicKey());
46
- // Using browser extensions, this step will prompt the user to sign the
47
- // payload.
48
- const eip712Signature = await walletClient.signTypedData(eip712Payload);
49
- return async function reencrypt({ handle }, backoffConfig) {
50
- const ephemeralPubKey = ephemeralKeypair.encodePublicKey();
51
- const reencryptRequest = create(ReencryptRequestSchema, {
52
- userAddress: walletClient.account.address,
53
- ephemeralPubKey,
54
- eip712Signature: hexToBytes(eip712Signature),
55
- handlesWithProofs: [
56
- create(HandleWithProofSchema, {
57
- handle,
58
- aclProof: {
59
- proof: {
60
- case: 'incoLiteBasicAclProof',
61
- value: {},
62
- },
63
- },
64
- }),
65
- ],
66
- });
67
- try {
68
- return await retryWithBackoff(async () => {
69
- const response = await kmsClient.reencrypt(reencryptRequest);
70
- return decryptGrpcResponse(response, ephemeralKeypair, handle);
71
- }, backoffConfig);
72
- }
73
- catch (error) {
74
- console.log(error);
75
- throw error;
76
- }
77
- };
78
- }
79
- // Helper function to get a KMS client from a string or a Client instance.
80
- export function getKmsClient(kmsConnectRpcEndpointOrClient) {
81
- if (typeof kmsConnectRpcEndpointOrClient === 'string') {
82
- const transport = createConnectTransport({
83
- baseUrl: kmsConnectRpcEndpointOrClient,
84
- });
85
- return createClient(KmsService, transport);
86
- }
87
- return kmsConnectRpcEndpointOrClient;
88
- }
89
- // Decrypt using ECIES the ciphertext in the response.
90
- // Even though the proto specifies a list of ciphertexts, our JS SDK
91
- // currently only supports a single ciphertext.
92
- export async function decryptGrpcResponse(response, ephemeralKeypair, handle) {
93
- const reencryptedCt = response.payload?.userCiphertexts[0];
94
- if (!reencryptedCt) {
95
- throw new Error('No reencrypted ciphertext in the response');
96
- }
97
- const plaintextBytes = await decrypt(ephemeralKeypair, reencryptedCt.ciphertext);
98
- const plaintext = bytesToBigInt(plaintextBytes);
99
- return bigintToPlaintext(encryptionSchemes.ecies, getHandleType(handle), plaintext);
100
- }
101
- // Helper function to return the default gRPC endpoint for the covalidator.
102
- // Currently, this returns the covalidator for the Inco Lightning public testnet.
103
- export function defaultCovalidatorGrpc(chain) {
104
- return lightningTestnetCovalidatorGrpc(chain);
105
- }
106
- // Helper function to get the devnet gRPC endpoint for the Inco Lightning covalidator.
107
- export function lightningDevnetCovalidatorGrpc(chain) {
108
- return getCovalidatorGrpcHelper(chain, 'devnet', 'lightning');
109
- }
110
- // Helper function to get the testnet gRPC endpoint for the Inco Lightning covalidator.
111
- export function lightningTestnetCovalidatorGrpc(chain) {
112
- return getCovalidatorGrpcHelper(chain, 'testnet', 'lightning');
113
- }
114
- // Convert camelCase to dash-case.
115
- function camelToDashCase(str) {
116
- return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
117
- }
118
- // Small helper, as our GCP covalidator URLs are in a specific format.
119
- function getCovalidatorGrpcHelper(chain, network, cluster) {
120
- return `https://grpc.${camelToDashCase(chain.name)}.${cluster}.${network}.inco.org`;
121
- }
122
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVlbmNyeXB0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpdGUvcmVlbmNyeXB0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3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QStCLENBQUMsS0FBSyxDQUFDLENBQUM7QUFDaEQsQ0FBQztBQUVELHNGQUFzRjtBQUN0RixNQUFNLFVBQVUsOEJBQThCLENBQUMsS0FBcUI7SUFDbEUsT0FBTyx3QkFBd0IsQ0FBQyxLQUFLLEVBQUUsUUFBUSxFQUFFLFdBQVcsQ0FBQyxDQUFDO0FBQ2hFLENBQUM7QUFFRCx1RkFBdUY7QUFDdkYsTUFBTSxVQUFVLCtCQUErQixDQUFDLEtBQXFCO0lBQ25FLE9BQU8sd0JBQXdCLENBQUMsS0FBSyxFQUFFLFNBQVMsRUFBRSxXQUFXLENBQUMsQ0FBQztBQUNqRSxDQUFDO0FBRUQsa0NBQWtDO0FBQ2xDLFNBQVMsZUFBZSxDQUFDLEdBQVc7SUFDbEMsT0FBTyxHQUFHLENBQUMsT0FBTyxDQUFDLGlCQUFpQixFQUFFLE9BQU8sQ0FBQyxDQUFDLFdBQVcsRUFBRSxDQUFDO0FBQy9ELENBQUM7QUFFRCxzRUFBc0U7QUFDdEUsU0FBUyx3QkFBd0IsQ0FDL0IsS0FBcUIsRUFDckIsT0FBNkIsRUFDN0IsT0FBb0I7SUFFcEIsT0FBTyxnQkFBZ0IsZUFBZSxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsSUFBSSxPQUFPLElBQUksT0FBTyxXQUFXLENBQUM7QUFDdEYsQ0FBQyJ9
@@ -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>;