@agoric/client-utils 0.2.0-upgrade-22-dev-76082f5.0.76082f5 → 0.2.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 (62) hide show
  1. package/dist/bundle-utils.d.ts +95 -0
  2. package/dist/bundle-utils.d.ts.map +1 -0
  3. package/dist/bundle-utils.js +219 -0
  4. package/dist/bundle-utils.js.map +1 -0
  5. package/dist/codegen/cosmos/benchmark/v1/tx.rpc.msg.d.ts +14 -0
  6. package/dist/codegen/cosmos/benchmark/v1/tx.rpc.msg.d.ts.map +1 -0
  7. package/dist/codegen/cosmos/benchmark/v1/tx.rpc.msg.js +18 -0
  8. package/dist/codegen/cosmos/benchmark/v1/tx.rpc.msg.js.map +1 -0
  9. package/dist/codegen/cosmos/counter/v1/query.rpc.Query.d.ts +17 -0
  10. package/dist/codegen/cosmos/counter/v1/query.rpc.Query.d.ts.map +1 -0
  11. package/dist/codegen/cosmos/counter/v1/query.rpc.Query.js +25 -0
  12. package/dist/codegen/cosmos/counter/v1/query.rpc.Query.js.map +1 -0
  13. package/dist/codegen/cosmos/counter/v1/tx.rpc.msg.d.ts +14 -0
  14. package/dist/codegen/cosmos/counter/v1/tx.rpc.msg.d.ts.map +1 -0
  15. package/dist/codegen/cosmos/counter/v1/tx.rpc.msg.js +18 -0
  16. package/dist/codegen/cosmos/counter/v1/tx.rpc.msg.js.map +1 -0
  17. package/dist/codegen/cosmos/epochs/v1beta1/query.rpc.Query.d.ts +21 -0
  18. package/dist/codegen/cosmos/epochs/v1beta1/query.rpc.Query.d.ts.map +1 -0
  19. package/dist/codegen/cosmos/epochs/v1beta1/query.rpc.Query.js +34 -0
  20. package/dist/codegen/cosmos/epochs/v1beta1/query.rpc.Query.js.map +1 -0
  21. package/dist/codegen/cosmos/protocolpool/v1/query.rpc.Query.d.ts +29 -0
  22. package/dist/codegen/cosmos/protocolpool/v1/query.rpc.Query.d.ts.map +1 -0
  23. package/dist/codegen/cosmos/protocolpool/v1/query.rpc.Query.js +52 -0
  24. package/dist/codegen/cosmos/protocolpool/v1/query.rpc.Query.js.map +1 -0
  25. package/dist/codegen/cosmos/protocolpool/v1/tx.rpc.msg.d.ts +42 -0
  26. package/dist/codegen/cosmos/protocolpool/v1/tx.rpc.msg.d.ts.map +1 -0
  27. package/dist/codegen/cosmos/protocolpool/v1/tx.rpc.msg.js +42 -0
  28. package/dist/codegen/cosmos/protocolpool/v1/tx.rpc.msg.js.map +1 -0
  29. package/dist/codegen/ibc/core/channel/v2/query.rpc.Query.d.ts +45 -0
  30. package/dist/codegen/ibc/core/channel/v2/query.rpc.Query.d.ts.map +1 -0
  31. package/dist/codegen/ibc/core/channel/v2/query.rpc.Query.js +88 -0
  32. package/dist/codegen/ibc/core/channel/v2/query.rpc.Query.js.map +1 -0
  33. package/dist/codegen/ibc/core/channel/v2/tx.rpc.msg.d.ts +23 -0
  34. package/dist/codegen/ibc/core/channel/v2/tx.rpc.msg.d.ts.map +1 -0
  35. package/dist/codegen/ibc/core/channel/v2/tx.rpc.msg.js +36 -0
  36. package/dist/codegen/ibc/core/channel/v2/tx.rpc.msg.js.map +1 -0
  37. package/dist/codegen/ibc/core/client/v2/query.rpc.Query.d.ts +21 -0
  38. package/dist/codegen/ibc/core/client/v2/query.rpc.Query.d.ts.map +1 -0
  39. package/dist/codegen/ibc/core/client/v2/query.rpc.Query.js +34 -0
  40. package/dist/codegen/ibc/core/client/v2/query.rpc.Query.js.map +1 -0
  41. package/dist/codegen/ibc/core/client/v2/tx.rpc.msg.d.ts +17 -0
  42. package/dist/codegen/ibc/core/client/v2/tx.rpc.msg.d.ts.map +1 -0
  43. package/dist/codegen/ibc/core/client/v2/tx.rpc.msg.js +24 -0
  44. package/dist/codegen/ibc/core/client/v2/tx.rpc.msg.js.map +1 -0
  45. package/dist/sequence-manager.d.ts +18 -0
  46. package/dist/sequence-manager.d.ts.map +1 -0
  47. package/dist/sequence-manager.js +40 -0
  48. package/dist/sequence-manager.js.map +1 -0
  49. package/dist/smart-wallet-utils.d.ts +26 -0
  50. package/dist/smart-wallet-utils.d.ts.map +1 -0
  51. package/dist/smart-wallet-utils.js +180 -0
  52. package/dist/smart-wallet-utils.js.map +1 -0
  53. package/dist/smart-wallet-with-sequence.d.ts +18 -0
  54. package/dist/smart-wallet-with-sequence.d.ts.map +1 -0
  55. package/dist/smart-wallet-with-sequence.js +139 -0
  56. package/dist/smart-wallet-with-sequence.js.map +1 -0
  57. package/dist/tsconfig.build.tsbuildinfo +1 -1
  58. package/dist/wallet-store.d.ts +79 -0
  59. package/dist/wallet-store.d.ts.map +1 -0
  60. package/dist/wallet-store.js +100 -0
  61. package/dist/wallet-store.js.map +1 -0
  62. package/package.json +8 -8
@@ -0,0 +1,95 @@
1
+ import type { EncodeObject, GeneratedType } from '@cosmjs/proto-signing';
2
+ import { Registry } from '@cosmjs/proto-signing';
3
+ import type { DeliverTxResponse } from '@cosmjs/stargate';
4
+ import type { ChunkedArtifact, ChunkInfo } from '@agoric/cosmic-proto/codegen/agoric/swingset/swingset.js';
5
+ export interface BundleJson {
6
+ moduleFormat: 'endoZipBase64';
7
+ endoZipBase64: string;
8
+ endoZipBase64Sha512: string;
9
+ [key: string]: unknown;
10
+ }
11
+ export type Sha512 = (bytes: Uint8Array) => Promise<Uint8Array>;
12
+ export type Gzip = (bytes: Uint8Array) => Promise<Uint8Array>;
13
+ export declare const bundleRegistryTypes: [string, GeneratedType][];
14
+ export declare const makeBundleRegistry: (baseTypes?: readonly [string, GeneratedType][]) => Registry;
15
+ export declare const encodeBundle: (bundleJson: string) => Uint8Array<ArrayBuffer>;
16
+ export declare const defaultSha512: Sha512;
17
+ export declare const getSha512Hex: (bytes: Uint8Array, { sha512 }?: {
18
+ sha512?: Sha512;
19
+ }) => Promise<string>;
20
+ export declare const validateBundleJson: (bundleString: string) => BundleJson;
21
+ export declare const chunkBundle: (bytes: Uint8Array, chunkSizeLimit: number, { sha512 }?: {
22
+ sha512?: Sha512;
23
+ }) => Promise<{
24
+ chunks: Uint8Array<ArrayBufferLike>[];
25
+ manifest: {
26
+ sha512: string;
27
+ sizeBytes: bigint;
28
+ chunks: ChunkInfo[];
29
+ };
30
+ }>;
31
+ export interface MsgInstallArgs {
32
+ uncompressedSize: bigint;
33
+ compressedBundle?: Uint8Array;
34
+ chunkedArtifact?: ChunkedArtifact;
35
+ submitter: string;
36
+ }
37
+ export declare const makeInstallBundleMsg: ({ compressedBundle, uncompressedSize, chunkedArtifact, submitter, }: MsgInstallArgs) => EncodeObject;
38
+ export interface MsgSendChunkArgs {
39
+ chunkedArtifactId: bigint;
40
+ chunkIndex: bigint;
41
+ chunkData: Uint8Array;
42
+ submitter: string;
43
+ }
44
+ export declare const makeSendChunkMsg: ({ chunkedArtifactId, chunkIndex, chunkData, submitter, }: MsgSendChunkArgs) => EncodeObject;
45
+ export type InstallBundleProgress = {
46
+ type: 'preflight';
47
+ bundleHash: string;
48
+ uncompressedSize: number;
49
+ compressedSize: number;
50
+ chunked: boolean;
51
+ chunkCount?: number;
52
+ } | {
53
+ type: 'bundle-submitted';
54
+ bundleHash: string;
55
+ height: number;
56
+ } | {
57
+ type: 'manifest-submitted';
58
+ bundleHash: string;
59
+ height: number;
60
+ chunkCount: number;
61
+ chunkedArtifactId: bigint;
62
+ } | {
63
+ type: 'chunk-submitted';
64
+ bundleHash: string;
65
+ height: number;
66
+ index: number;
67
+ total: number;
68
+ } | {
69
+ type: 'watching';
70
+ bundleHash: string;
71
+ height: number;
72
+ };
73
+ export interface InstallBundleParams {
74
+ bundleJson: string;
75
+ chunkSizeLimit: number;
76
+ submitter: string;
77
+ gzip: Gzip;
78
+ signAndBroadcast: (msg: EncodeObject) => Promise<DeliverTxResponse | undefined>;
79
+ sha512?: Sha512;
80
+ makeInstallBundleMsg?: (args: MsgInstallArgs) => EncodeObject;
81
+ makeSendChunkMsg?: (args: MsgSendChunkArgs) => EncodeObject;
82
+ watchBundle?: (bundleHash: string, height: number) => Promise<void>;
83
+ onProgress?: (event: InstallBundleProgress) => void;
84
+ }
85
+ export interface InstallBundleResult {
86
+ bundleHash: string;
87
+ blockHeight: number;
88
+ chunked: boolean;
89
+ chunkCount?: number;
90
+ compressedSize: number;
91
+ uncompressedSize: number;
92
+ chunkedArtifactId?: bigint;
93
+ }
94
+ export declare const installBundle: (params: InstallBundleParams) => Promise<InstallBundleResult>;
95
+ //# sourceMappingURL=bundle-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundle-utils.d.ts","sourceRoot":"","sources":["../src/bundle-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAM1D,OAAO,KAAK,EACV,eAAe,EACf,SAAS,EACV,MAAM,0DAA0D,CAAC;AAElE,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,eAAe,CAAC;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,MAAM,MAAM,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;AAChE,MAAM,MAAM,IAAI,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;AAE9D,eAAO,MAAM,mBAAmB,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC,EAGxD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,YAAW,SAAS,CAAC,MAAM,EAAE,aAAa,CAAC,EAAyB,aACb,CAAC;AAE1D,eAAO,MAAM,YAAY,GAAI,YAAY,MAAM,4BACT,CAAC;AAEvC,eAAO,MAAM,aAAa,EAAE,MAO3B,CAAC;AAE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BAAmB,CAqL7B,CAAC"}
@@ -0,0 +1,219 @@
1
+ import { fromBech32, toHex } from '@cosmjs/encoding';
2
+ import { Registry } from '@cosmjs/proto-signing';
3
+ import { defaultRegistryTypes } from '@cosmjs/stargate';
4
+ import { MsgInstallBundle, MsgInstallBundleResponse, MsgSendChunk, } from '@agoric/cosmic-proto/codegen/agoric/swingset/msgs.js';
5
+ export const bundleRegistryTypes = [
6
+ [MsgInstallBundle.typeUrl, MsgInstallBundle],
7
+ [MsgSendChunk.typeUrl, MsgSendChunk],
8
+ ];
9
+ export const makeBundleRegistry = (baseTypes = defaultRegistryTypes) => new Registry([...baseTypes, ...bundleRegistryTypes]);
10
+ export const encodeBundle = (bundleJson) => new TextEncoder().encode(bundleJson);
11
+ export const defaultSha512 = async (bytes) => {
12
+ const subtle = globalThis.crypto?.subtle;
13
+ if (!subtle) {
14
+ throw new Error('crypto.subtle is required; provide a sha512 function');
15
+ }
16
+ const digest = await subtle.digest('SHA-512', bytes);
17
+ return new Uint8Array(digest);
18
+ };
19
+ export const getSha512Hex = async (bytes, { sha512 = defaultSha512 } = {}) => {
20
+ const digest = await sha512(bytes);
21
+ return toHex(digest);
22
+ };
23
+ export const validateBundleJson = (bundleString) => {
24
+ let bundleObject;
25
+ try {
26
+ bundleObject = JSON.parse(bundleString);
27
+ }
28
+ catch (error) {
29
+ throw new Error(`The submitted file is not in the expected format, not parsable as JSON: ${error instanceof Error ? error.message : String(error)}`);
30
+ }
31
+ const { moduleFormat, endoZipBase64, endoZipBase64Sha512 } = bundleObject;
32
+ if (moduleFormat !== 'endoZipBase64') {
33
+ throw new Error(`The submitted file does not have the expected moduleFormat value of endoZipBase64, got: ${moduleFormat}`);
34
+ }
35
+ if (typeof endoZipBase64 !== 'string') {
36
+ throw new Error('The submitted file does not have the expected endoZipBase64 property');
37
+ }
38
+ if (typeof endoZipBase64Sha512 !== 'string') {
39
+ throw new Error('The submitted file does not have the expected endoZipBase64Sha512 property');
40
+ }
41
+ return bundleObject;
42
+ };
43
+ export const chunkBundle = async (bytes, chunkSizeLimit, { sha512 = defaultSha512 } = {}) => {
44
+ if (!Number.isSafeInteger(chunkSizeLimit) || chunkSizeLimit <= 0) {
45
+ throw new Error(`chunkSizeLimit must be a positive safe integer, got ${chunkSizeLimit}`);
46
+ }
47
+ const bundleSha512Hex = await getSha512Hex(bytes, { sha512 });
48
+ const chunks = [];
49
+ const info = [];
50
+ for (let i = 0; i < bytes.byteLength; i += chunkSizeLimit) {
51
+ const chunk = bytes.subarray(i, Math.min(bytes.byteLength, i + chunkSizeLimit));
52
+ const chunkSha512Hex = await getSha512Hex(chunk, { sha512 });
53
+ chunks.push(chunk);
54
+ info.push({
55
+ sha512: chunkSha512Hex,
56
+ sizeBytes: BigInt(chunk.byteLength),
57
+ state: 0,
58
+ });
59
+ }
60
+ return {
61
+ chunks,
62
+ manifest: {
63
+ sha512: bundleSha512Hex,
64
+ sizeBytes: BigInt(bytes.byteLength),
65
+ chunks: info,
66
+ },
67
+ };
68
+ };
69
+ export const makeInstallBundleMsg = ({ compressedBundle, uncompressedSize, chunkedArtifact, submitter, }) => ({
70
+ typeUrl: MsgInstallBundle.typeUrl,
71
+ value: {
72
+ uncompressedSize,
73
+ submitter: fromBech32(submitter).data,
74
+ ...(compressedBundle ? { compressedBundle } : {}),
75
+ ...(chunkedArtifact ? { chunkedArtifact } : {}),
76
+ },
77
+ });
78
+ export const makeSendChunkMsg = ({ chunkedArtifactId, chunkIndex, chunkData, submitter, }) => ({
79
+ typeUrl: MsgSendChunk.typeUrl,
80
+ value: {
81
+ chunkedArtifactId,
82
+ chunkIndex,
83
+ chunkData,
84
+ submitter: fromBech32(submitter).data,
85
+ },
86
+ });
87
+ export const installBundle = async (params) => {
88
+ const { bundleJson, chunkSizeLimit, submitter, gzip, signAndBroadcast, sha512, makeInstallBundleMsg: makeInstallBundleMsgParam = makeInstallBundleMsg, makeSendChunkMsg: makeSendChunkMsgParam = makeSendChunkMsg, watchBundle, onProgress, } = params;
89
+ const bundleObject = validateBundleJson(bundleJson);
90
+ const { endoZipBase64Sha512 } = bundleObject;
91
+ const uncompressedBundleBytes = encodeBundle(bundleJson);
92
+ const compressedBundleBytes = await gzip(uncompressedBundleBytes);
93
+ const compressedSize = compressedBundleBytes.byteLength;
94
+ const uncompressedSize = uncompressedBundleBytes.byteLength;
95
+ const shouldChunk = compressedBundleBytes.byteLength > chunkSizeLimit;
96
+ onProgress?.({
97
+ type: 'preflight',
98
+ bundleHash: endoZipBase64Sha512,
99
+ uncompressedSize,
100
+ compressedSize,
101
+ chunked: shouldChunk,
102
+ chunkCount: shouldChunk
103
+ ? Math.ceil(compressedBundleBytes.byteLength / chunkSizeLimit)
104
+ : undefined,
105
+ });
106
+ let blockHeight;
107
+ let chunkedArtifactId;
108
+ if (!shouldChunk) {
109
+ const txMsg = makeInstallBundleMsgParam({
110
+ compressedBundle: compressedBundleBytes,
111
+ uncompressedSize: BigInt(uncompressedSize),
112
+ submitter,
113
+ });
114
+ try {
115
+ const txResponse = await signAndBroadcast(txMsg);
116
+ if (!txResponse) {
117
+ throw new Error('no response for bundle');
118
+ }
119
+ blockHeight = txResponse.height;
120
+ onProgress?.({
121
+ type: 'bundle-submitted',
122
+ bundleHash: endoZipBase64Sha512,
123
+ height: blockHeight,
124
+ });
125
+ }
126
+ catch (error) {
127
+ throw new Error(`Transaction failed to submit bundle to chain: ${error instanceof Error ? error.message : String(error)}`);
128
+ }
129
+ }
130
+ else {
131
+ const { chunks, manifest } = await chunkBundle(compressedBundleBytes, chunkSizeLimit, { sha512 });
132
+ const txMsg = makeInstallBundleMsgParam({
133
+ uncompressedSize: BigInt(uncompressedSize),
134
+ submitter,
135
+ chunkedArtifact: manifest,
136
+ });
137
+ try {
138
+ const txResponse = await signAndBroadcast(txMsg);
139
+ if (!txResponse) {
140
+ throw new Error(`No transaction response for attempt to submit manifest for bundle ${endoZipBase64Sha512}`);
141
+ }
142
+ blockHeight = txResponse.height;
143
+ const installBundleResponse = txResponse.msgResponses.find(response => response.typeUrl === MsgInstallBundleResponse.typeUrl);
144
+ if (!installBundleResponse) {
145
+ throw new Error(`No install bundle response found in manifest submission transaction response for bundle ${endoZipBase64Sha512}. This is a software defect. Please report.`);
146
+ }
147
+ const { chunkedArtifactId: decodedChunkedArtifactId } = MsgInstallBundleResponse.decode(installBundleResponse.value);
148
+ if (decodedChunkedArtifactId === null ||
149
+ decodedChunkedArtifactId === undefined ||
150
+ decodedChunkedArtifactId === 0n ||
151
+ decodedChunkedArtifactId === 0) {
152
+ throw new Error(`No chunked artifact identifier found in manifest submission transaction response for bundle ${endoZipBase64Sha512}. This is a software defect. Please report.`);
153
+ }
154
+ chunkedArtifactId = BigInt(decodedChunkedArtifactId);
155
+ onProgress?.({
156
+ type: 'manifest-submitted',
157
+ bundleHash: endoZipBase64Sha512,
158
+ height: blockHeight,
159
+ chunkCount: chunks.length,
160
+ chunkedArtifactId,
161
+ });
162
+ }
163
+ catch (error) {
164
+ throw new Error(`Transaction failed to submit bundle manifest to chain for bundle ${endoZipBase64Sha512}: ${error instanceof Error ? error.message : String(error)}`);
165
+ }
166
+ if (chunkedArtifactId === undefined || chunkedArtifactId === 0n) {
167
+ throw new Error(`No chunked artifact identifier found in manifest submission transaction response for bundle ${endoZipBase64Sha512}. This is a software defect. Please report.`);
168
+ }
169
+ for (let i = 0; i < chunks.length; i += 1) {
170
+ const chunk = chunks[i];
171
+ const chunkMsg = makeSendChunkMsgParam({
172
+ chunkedArtifactId,
173
+ chunkIndex: BigInt(i),
174
+ chunkData: chunk,
175
+ submitter,
176
+ });
177
+ try {
178
+ const txResponse = await signAndBroadcast(chunkMsg);
179
+ if (!txResponse) {
180
+ throw new Error('no transaction response');
181
+ }
182
+ blockHeight = txResponse.height;
183
+ onProgress?.({
184
+ type: 'chunk-submitted',
185
+ bundleHash: endoZipBase64Sha512,
186
+ height: blockHeight,
187
+ index: i,
188
+ total: chunks.length,
189
+ });
190
+ }
191
+ catch (error) {
192
+ throw new Error(`Transaction failed to submit bundle chunk ${i} of bundle ${endoZipBase64Sha512} to chain: ${error instanceof Error ? error.message : String(error)}`);
193
+ }
194
+ }
195
+ }
196
+ if (blockHeight === undefined) {
197
+ throw new Error('Bundle submitted but transaction response did not provide a block height. This should not occur. Please report.');
198
+ }
199
+ onProgress?.({
200
+ type: 'watching',
201
+ bundleHash: endoZipBase64Sha512,
202
+ height: blockHeight,
203
+ });
204
+ if (watchBundle) {
205
+ await watchBundle(endoZipBase64Sha512, blockHeight);
206
+ }
207
+ return {
208
+ bundleHash: endoZipBase64Sha512,
209
+ blockHeight,
210
+ chunked: shouldChunk,
211
+ chunkCount: shouldChunk
212
+ ? Math.ceil(compressedBundleBytes.byteLength / chunkSizeLimit)
213
+ : undefined,
214
+ compressedSize,
215
+ uncompressedSize,
216
+ chunkedArtifactId,
217
+ };
218
+ };
219
+ //# sourceMappingURL=bundle-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundle-utils.js","sourceRoot":"","sources":["../src/bundle-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,YAAY,GACb,MAAM,sDAAsD,CAAC;AAgB9D,MAAM,CAAC,MAAM,mBAAmB,GAA8B;IAC5D,CAAC,gBAAgB,CAAC,OAAO,EAAE,gBAAiC,CAAC;IAC7D,CAAC,YAAY,CAAC,OAAO,EAAE,YAA6B,CAAC;CACtD,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,YAAgD,oBAAoB,EACpE,EAAE,CAAC,IAAI,QAAQ,CAAC,CAAC,GAAG,SAAS,EAAE,GAAG,mBAAmB,CAAC,CAAC,CAAC;AAE1D,MAAM,CAAC,MAAM,YAAY,GAAG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,MAAM,CAAC;gBAChC,UAAU,EAAE,CAAC;oBACX,IAAI,EAAE,iBAAiB;oBACvB,UAAU,EAAE,mBAAmB;oBAC/B,MAAM,EAAE,WAAW;oBACnB,KAAK,EAAE,CAAC;oBACR,KAAK,EAAE,MAAM,CAAC,MAAM;iBACrB,CAAC,CAAC;YACL,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CACb,6CAA6C,CAAC,cAAc,mBAAmB,cAC7E,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CACvD,EAAE,CACH,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CACb,iHAAiH,CAClH,CAAC;IACJ,CAAC;IAED,UAAU,EAAE,CAAC;QACX,IAAI,EAAE,UAAU;QAChB,UAAU,EAAE,mBAAmB;QAC/B,MAAM,EAAE,WAAW;KACpB,CAAC,CAAC;IACH,IAAI,WAAW,EAAE,CAAC;QAChB,MAAM,WAAW,CAAC,mBAAmB,EAAE,WAAW,CAAC,CAAC;IACtD,CAAC;IAED,OAAO;QACL,UAAU,EAAE,mBAAmB;QAC/B,WAAW;QACX,OAAO,EAAE,WAAW;QACpB,UAAU,EAAE,WAAW;YACrB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,UAAU,GAAG,cAAc,CAAC;YAC9D,CAAC,CAAC,SAAS;QACb,cAAc;QACd,gBAAgB;QAChB,iBAAiB;KAClB,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { TxRpc } from '@agoric/cosmic-proto/codegen/types.js';
2
+ import { MsgLoadTest, MsgLoadTestResponse } from '@agoric/cosmic-proto/codegen/cosmos/benchmark/v1/tx.js';
3
+ /** Msg defines the benchmark Msg service. */
4
+ export interface Msg {
5
+ /** LoadTest defines a method for executing a sequence of load test operations. */
6
+ loadTest(request: MsgLoadTest): Promise<MsgLoadTestResponse>;
7
+ }
8
+ export declare class MsgClientImpl implements Msg {
9
+ private readonly rpc;
10
+ constructor(rpc: TxRpc);
11
+ loadTest(request: MsgLoadTest): Promise<MsgLoadTestResponse>;
12
+ }
13
+ export declare const createClientImpl: (rpc: TxRpc) => MsgClientImpl;
14
+ //# sourceMappingURL=tx.rpc.msg.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tx.rpc.msg.d.ts","sourceRoot":"","sources":["../../../../../src/codegen/cosmos/benchmark/v1/tx.rpc.msg.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uCAAuC,CAAC;AAEnE,OAAO,EACL,WAAW,EACX,mBAAmB,EACpB,MAAM,wDAAwD,CAAC;AAChE,6CAA6C;AAC7C,MAAM,WAAW,GAAG;IAClB,kFAAkF;IAClF,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC9D;AACD,qBAAa,aAAc,YAAW,GAAG;IACvC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;gBAChB,GAAG,EAAE,KAAK;IAItB,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAW7D;AACD,eAAO,MAAM,gBAAgB,GAAI,KAAK,KAAK,kBAE1C,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { BinaryReader } from '@agoric/cosmic-proto/codegen/binary.js';
2
+ import { MsgLoadTest, MsgLoadTestResponse, } from '@agoric/cosmic-proto/codegen/cosmos/benchmark/v1/tx.js';
3
+ export class MsgClientImpl {
4
+ rpc;
5
+ constructor(rpc) {
6
+ this.rpc = rpc;
7
+ this.loadTest = this.loadTest.bind(this);
8
+ }
9
+ loadTest(request) {
10
+ const data = MsgLoadTest.encode(request).finish();
11
+ const promise = this.rpc.request('cosmos.benchmark.v1.Msg', 'LoadTest', data);
12
+ return promise.then(data => MsgLoadTestResponse.decode(new BinaryReader(data)));
13
+ }
14
+ }
15
+ export const createClientImpl = (rpc) => {
16
+ return new MsgClientImpl(rpc);
17
+ };
18
+ //# sourceMappingURL=tx.rpc.msg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tx.rpc.msg.js","sourceRoot":"","sources":["../../../../../src/codegen/cosmos/benchmark/v1/tx.rpc.msg.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EACL,WAAW,EACX,mBAAmB,GACpB,MAAM,wDAAwD,CAAC;AAMhE,MAAM,OAAO,aAAa;IACP,GAAG,CAAQ;IAC5B,YAAY,GAAU;QACpB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IACD,QAAQ,CAAC,OAAoB;QAC3B,MAAM,IAAI,GAAG,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;QAClD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAC9B,yBAAyB,EACzB,UAAU,EACV,IAAI,CACL,CAAC;QACF,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACzB,mBAAmB,CAAC,MAAM,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,CACnD,CAAC;IACJ,CAAC;CACF;AACD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,GAAU,EAAE,EAAE;IAC7C,OAAO,IAAI,aAAa,CAAC,GAAG,CAAC,CAAC;AAChC,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { Rpc } from '@agoric/cosmic-proto/codegen/helpers.js';
2
+ import { QueryClient } from '@cosmjs/stargate';
3
+ import { QueryGetCountRequest, QueryGetCountResponse } from '@agoric/cosmic-proto/codegen/cosmos/counter/v1/query.js';
4
+ /** Query defines the gRPC querier service. */
5
+ export interface Query {
6
+ /** GetCount queries the parameters of x/Counter module. */
7
+ getCount(request?: QueryGetCountRequest): Promise<QueryGetCountResponse>;
8
+ }
9
+ export declare class QueryClientImpl implements Query {
10
+ private readonly rpc;
11
+ constructor(rpc: Rpc);
12
+ getCount(request?: QueryGetCountRequest): Promise<QueryGetCountResponse>;
13
+ }
14
+ export declare const createRpcQueryExtension: (base: QueryClient) => {
15
+ getCount(request?: QueryGetCountRequest): Promise<QueryGetCountResponse>;
16
+ };
17
+ //# sourceMappingURL=query.rpc.Query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.rpc.Query.d.ts","sourceRoot":"","sources":["../../../../../src/codegen/cosmos/counter/v1/query.rpc.Query.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,yCAAyC,CAAC;AAEnE,OAAO,EAAE,WAAW,EAA2B,MAAM,kBAAkB,CAAC;AACxE,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,yDAAyD,CAAC;AACjE,8CAA8C;AAC9C,MAAM,WAAW,KAAK;IACpB,2DAA2D;IAC3D,QAAQ,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;CAC1E;AACD,qBAAa,eAAgB,YAAW,KAAK;IAC3C,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAM;gBACd,GAAG,EAAE,GAAG;IAIpB,QAAQ,CAAC,OAAO,GAAE,oBAAyB,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAW7E;AACD,eAAO,MAAM,uBAAuB,GAAI,MAAM,WAAW;uBAIlC,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAI3E,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { BinaryReader } from '@agoric/cosmic-proto/codegen/binary.js';
2
+ import { QueryClient, createProtobufRpcClient } from '@cosmjs/stargate';
3
+ import { QueryGetCountRequest, QueryGetCountResponse, } from '@agoric/cosmic-proto/codegen/cosmos/counter/v1/query.js';
4
+ export class QueryClientImpl {
5
+ rpc;
6
+ constructor(rpc) {
7
+ this.rpc = rpc;
8
+ this.getCount = this.getCount.bind(this);
9
+ }
10
+ getCount(request = {}) {
11
+ const data = QueryGetCountRequest.encode(request).finish();
12
+ const promise = this.rpc.request('cosmos.counter.v1.Query', 'GetCount', data);
13
+ return promise.then(data => QueryGetCountResponse.decode(new BinaryReader(data)));
14
+ }
15
+ }
16
+ export const createRpcQueryExtension = (base) => {
17
+ const rpc = createProtobufRpcClient(base);
18
+ const queryService = new QueryClientImpl(rpc);
19
+ return {
20
+ getCount(request) {
21
+ return queryService.getCount(request);
22
+ },
23
+ };
24
+ };
25
+ //# sourceMappingURL=query.rpc.Query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.rpc.Query.js","sourceRoot":"","sources":["../../../../../src/codegen/cosmos/counter/v1/query.rpc.Query.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EACL,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,yDAAyD,CAAC;AAMjE,MAAM,OAAO,eAAe;IACT,GAAG,CAAM;IAC1B,YAAY,GAAQ;QAClB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IACD,QAAQ,CAAC,UAAgC,EAAE;QACzC,MAAM,IAAI,GAAG,oBAAoB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;QAC3D,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAC9B,yBAAyB,EACzB,UAAU,EACV,IAAI,CACL,CAAC;QACF,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACzB,qBAAqB,CAAC,MAAM,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,CACrD,CAAC;IACJ,CAAC;CACF;AACD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,IAAiB,EAAE,EAAE;IAC3D,MAAM,GAAG,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,YAAY,GAAG,IAAI,eAAe,CAAC,GAAG,CAAC,CAAC;IAC9C,OAAO;QACL,QAAQ,CAAC,OAA8B;YACrC,OAAO,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACxC,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { TxRpc } from '@agoric/cosmic-proto/codegen/types.js';
2
+ import { MsgIncreaseCounter, MsgIncreaseCountResponse } from '@agoric/cosmic-proto/codegen/cosmos/counter/v1/tx.js';
3
+ /** Msg defines the counter Msg service. */
4
+ export interface Msg {
5
+ /** IncreaseCount increments the counter by the specified amount. */
6
+ increaseCount(request: MsgIncreaseCounter): Promise<MsgIncreaseCountResponse>;
7
+ }
8
+ export declare class MsgClientImpl implements Msg {
9
+ private readonly rpc;
10
+ constructor(rpc: TxRpc);
11
+ increaseCount(request: MsgIncreaseCounter): Promise<MsgIncreaseCountResponse>;
12
+ }
13
+ export declare const createClientImpl: (rpc: TxRpc) => MsgClientImpl;
14
+ //# sourceMappingURL=tx.rpc.msg.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tx.rpc.msg.d.ts","sourceRoot":"","sources":["../../../../../src/codegen/cosmos/counter/v1/tx.rpc.msg.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uCAAuC,CAAC;AAEnE,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACzB,MAAM,sDAAsD,CAAC;AAC9D,2CAA2C;AAC3C,MAAM,WAAW,GAAG;IAClB,oEAAoE;IACpE,aAAa,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;CAC/E;AACD,qBAAa,aAAc,YAAW,GAAG;IACvC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;gBAChB,GAAG,EAAE,KAAK;IAItB,aAAa,CACX,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,wBAAwB,CAAC;CAWrC;AACD,eAAO,MAAM,gBAAgB,GAAI,KAAK,KAAK,kBAE1C,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { BinaryReader } from '@agoric/cosmic-proto/codegen/binary.js';
2
+ import { MsgIncreaseCounter, MsgIncreaseCountResponse, } from '@agoric/cosmic-proto/codegen/cosmos/counter/v1/tx.js';
3
+ export class MsgClientImpl {
4
+ rpc;
5
+ constructor(rpc) {
6
+ this.rpc = rpc;
7
+ this.increaseCount = this.increaseCount.bind(this);
8
+ }
9
+ increaseCount(request) {
10
+ const data = MsgIncreaseCounter.encode(request).finish();
11
+ const promise = this.rpc.request('cosmos.counter.v1.Msg', 'IncreaseCount', data);
12
+ return promise.then(data => MsgIncreaseCountResponse.decode(new BinaryReader(data)));
13
+ }
14
+ }
15
+ export const createClientImpl = (rpc) => {
16
+ return new MsgClientImpl(rpc);
17
+ };
18
+ //# sourceMappingURL=tx.rpc.msg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tx.rpc.msg.js","sourceRoot":"","sources":["../../../../../src/codegen/cosmos/counter/v1/tx.rpc.msg.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EACL,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,sDAAsD,CAAC;AAM9D,MAAM,OAAO,aAAa;IACP,GAAG,CAAQ;IAC5B,YAAY,GAAU;QACpB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrD,CAAC;IACD,aAAa,CACX,OAA2B;QAE3B,MAAM,IAAI,GAAG,kBAAkB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;QACzD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAC9B,uBAAuB,EACvB,eAAe,EACf,IAAI,CACL,CAAC;QACF,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACzB,wBAAwB,CAAC,MAAM,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,CACxD,CAAC;IACJ,CAAC;CACF;AACD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,GAAU,EAAE,EAAE;IAC7C,OAAO,IAAI,aAAa,CAAC,GAAG,CAAC,CAAC;AAChC,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { Rpc } from '@agoric/cosmic-proto/codegen/helpers.js';
2
+ import { QueryClient } from '@cosmjs/stargate';
3
+ import { QueryEpochInfosRequest, QueryEpochInfosResponse, QueryCurrentEpochRequest, QueryCurrentEpochResponse } from '@agoric/cosmic-proto/codegen/cosmos/epochs/v1beta1/query.js';
4
+ /** Query defines the gRPC querier service. */
5
+ export interface Query {
6
+ /** EpochInfos provide running epochInfos */
7
+ epochInfos(request?: QueryEpochInfosRequest): Promise<QueryEpochInfosResponse>;
8
+ /** CurrentEpoch provide current epoch of specified identifier */
9
+ currentEpoch(request: QueryCurrentEpochRequest): Promise<QueryCurrentEpochResponse>;
10
+ }
11
+ export declare class QueryClientImpl implements Query {
12
+ private readonly rpc;
13
+ constructor(rpc: Rpc);
14
+ epochInfos(request?: QueryEpochInfosRequest): Promise<QueryEpochInfosResponse>;
15
+ currentEpoch(request: QueryCurrentEpochRequest): Promise<QueryCurrentEpochResponse>;
16
+ }
17
+ export declare const createRpcQueryExtension: (base: QueryClient) => {
18
+ epochInfos(request?: QueryEpochInfosRequest): Promise<QueryEpochInfosResponse>;
19
+ currentEpoch(request: QueryCurrentEpochRequest): Promise<QueryCurrentEpochResponse>;
20
+ };
21
+ //# sourceMappingURL=query.rpc.Query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.rpc.Query.d.ts","sourceRoot":"","sources":["../../../../../src/codegen/cosmos/epochs/v1beta1/query.rpc.Query.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,yCAAyC,CAAC;AAEnE,OAAO,EAAE,WAAW,EAA2B,MAAM,kBAAkB,CAAC;AACxE,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,6DAA6D,CAAC;AACrE,8CAA8C;AAC9C,MAAM,WAAW,KAAK;IACpB,4CAA4C;IAC5C,UAAU,CACR,OAAO,CAAC,EAAE,sBAAsB,GAC/B,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACpC,iEAAiE;IACjE,YAAY,CACV,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,yBAAyB,CAAC,CAAC;CACvC;AACD,qBAAa,eAAgB,YAAW,KAAK;IAC3C,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAM;gBACd,GAAG,EAAE,GAAG;IAKpB,UAAU,CACR,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,uBAAuB,CAAC;IAWnC,YAAY,CACV,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,yBAAyB,CAAC;CAWtC;AACD,eAAO,MAAM,uBAAuB,GAAI,MAAM,WAAW;yBAKzC,sBAAsB,GAC/B,OAAO,CAAC,uBAAuB,CAAC;0BAIxB,wBAAwB,GAChC,OAAO,CAAC,yBAAyB,CAAC;CAIxC,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { BinaryReader } from '@agoric/cosmic-proto/codegen/binary.js';
2
+ import { QueryClient, createProtobufRpcClient } from '@cosmjs/stargate';
3
+ import { QueryEpochInfosRequest, QueryEpochInfosResponse, QueryCurrentEpochRequest, QueryCurrentEpochResponse, } from '@agoric/cosmic-proto/codegen/cosmos/epochs/v1beta1/query.js';
4
+ export class QueryClientImpl {
5
+ rpc;
6
+ constructor(rpc) {
7
+ this.rpc = rpc;
8
+ this.epochInfos = this.epochInfos.bind(this);
9
+ this.currentEpoch = this.currentEpoch.bind(this);
10
+ }
11
+ epochInfos(request = {}) {
12
+ const data = QueryEpochInfosRequest.encode(request).finish();
13
+ const promise = this.rpc.request('cosmos.epochs.v1beta1.Query', 'EpochInfos', data);
14
+ return promise.then(data => QueryEpochInfosResponse.decode(new BinaryReader(data)));
15
+ }
16
+ currentEpoch(request) {
17
+ const data = QueryCurrentEpochRequest.encode(request).finish();
18
+ const promise = this.rpc.request('cosmos.epochs.v1beta1.Query', 'CurrentEpoch', data);
19
+ return promise.then(data => QueryCurrentEpochResponse.decode(new BinaryReader(data)));
20
+ }
21
+ }
22
+ export const createRpcQueryExtension = (base) => {
23
+ const rpc = createProtobufRpcClient(base);
24
+ const queryService = new QueryClientImpl(rpc);
25
+ return {
26
+ epochInfos(request) {
27
+ return queryService.epochInfos(request);
28
+ },
29
+ currentEpoch(request) {
30
+ return queryService.currentEpoch(request);
31
+ },
32
+ };
33
+ };
34
+ //# sourceMappingURL=query.rpc.Query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.rpc.Query.js","sourceRoot":"","sources":["../../../../../src/codegen/cosmos/epochs/v1beta1/query.rpc.Query.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,6DAA6D,CAAC;AAYrE,MAAM,OAAO,eAAe;IACT,GAAG,CAAM;IAC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AAO,CAAC,CAAC;QAC1C,CAAC;QACD,YAAY,CACV,OAAiC;YAEjC,OAAO,YAAY,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAC5C,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { Rpc } from '@agoric/cosmic-proto/codegen/helpers.js';
2
+ import { QueryClient } from '@cosmjs/stargate';
3
+ import { QueryCommunityPoolRequest, QueryCommunityPoolResponse, QueryContinuousFundRequest, QueryContinuousFundResponse, QueryContinuousFundsRequest, QueryContinuousFundsResponse, QueryParamsRequest, QueryParamsResponse } from '@agoric/cosmic-proto/codegen/cosmos/protocolpool/v1/query.js';
4
+ /** Query defines the gRPC querier service for community pool module. */
5
+ export interface Query {
6
+ /** CommunityPool queries the community pool coins. */
7
+ communityPool(request?: QueryCommunityPoolRequest): Promise<QueryCommunityPoolResponse>;
8
+ /** ContinuousFund queries a continuous fund by the recipient is is associated with. */
9
+ continuousFund(request: QueryContinuousFundRequest): Promise<QueryContinuousFundResponse>;
10
+ /** ContinuousFunds queries all continuous funds in the store. */
11
+ continuousFunds(request?: QueryContinuousFundsRequest): Promise<QueryContinuousFundsResponse>;
12
+ /** Params returns the total set of x/protocolpool parameters. */
13
+ params(request?: QueryParamsRequest): Promise<QueryParamsResponse>;
14
+ }
15
+ export declare class QueryClientImpl implements Query {
16
+ private readonly rpc;
17
+ constructor(rpc: Rpc);
18
+ communityPool(request?: QueryCommunityPoolRequest): Promise<QueryCommunityPoolResponse>;
19
+ continuousFund(request: QueryContinuousFundRequest): Promise<QueryContinuousFundResponse>;
20
+ continuousFunds(request?: QueryContinuousFundsRequest): Promise<QueryContinuousFundsResponse>;
21
+ params(request?: QueryParamsRequest): Promise<QueryParamsResponse>;
22
+ }
23
+ export declare const createRpcQueryExtension: (base: QueryClient) => {
24
+ communityPool(request?: QueryCommunityPoolRequest): Promise<QueryCommunityPoolResponse>;
25
+ continuousFund(request: QueryContinuousFundRequest): Promise<QueryContinuousFundResponse>;
26
+ continuousFunds(request?: QueryContinuousFundsRequest): Promise<QueryContinuousFundsResponse>;
27
+ params(request?: QueryParamsRequest): Promise<QueryParamsResponse>;
28
+ };
29
+ //# sourceMappingURL=query.rpc.Query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.rpc.Query.d.ts","sourceRoot":"","sources":["../../../../../src/codegen/cosmos/protocolpool/v1/query.rpc.Query.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,yCAAyC,CAAC;AAEnE,OAAO,EAAE,WAAW,EAA2B,MAAM,kBAAkB,CAAC;AACxE,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC1B,2BAA2B,EAC3B,2BAA2B,EAC3B,4BAA4B,EAC5B,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,8DAA8D,CAAC;AACtE,wEAAwE;AACxE,MAAM,WAAW,KAAK;IACpB,sDAAsD;IACtD,aAAa,CACX,OAAO,CAAC,EAAE,yBAAyB,GAClC,OAAO,CAAC,0BAA0B,CAAC,CAAC;IACvC,uFAAuF;IACvF,cAAc,CACZ,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACxC,iEAAiE;IACjE,eAAe,CACb,OAAO,CAAC,EAAE,2BAA2B,GACpC,OAAO,CAAC,4BAA4B,CAAC,CAAC;IACzC,iEAAiE;IACjE,MAAM,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACpE;AACD,qBAAa,eAAgB,YAAW,KAAK;IAC3C,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAM;gBACd,GAAG,EAAE,GAAG;IAOpB,aAAa,CACX,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,0BAA0B,CAAC;IAWtC,cAAc,CACZ,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,2BAA2B,CAAC;IAWvC,eAAe,CACb,OAAO,GAAE,2BAAgC,GACxC,OAAO,CAAC,4BAA4B,CAAC;IAWxC,MAAM,CAAC,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAWvE;AACD,eAAO,MAAM,uBAAuB,GAAI,MAAM,WAAW;4BAKzC,yBAAyB,GAClC,OAAO,CAAC,0BAA0B,CAAC;4BAI3B,0BAA0B,GAClC,OAAO,CAAC,2BAA2B,CAAC;8BAI3B,2BAA2B,GACpC,OAAO,CAAC,4BAA4B,CAAC;qBAGvB,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAIrE,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { BinaryReader } from '@agoric/cosmic-proto/codegen/binary.js';
2
+ import { QueryClient, createProtobufRpcClient } from '@cosmjs/stargate';
3
+ import { QueryCommunityPoolRequest, QueryCommunityPoolResponse, QueryContinuousFundRequest, QueryContinuousFundResponse, QueryContinuousFundsRequest, QueryContinuousFundsResponse, QueryParamsRequest, QueryParamsResponse, } from '@agoric/cosmic-proto/codegen/cosmos/protocolpool/v1/query.js';
4
+ export class QueryClientImpl {
5
+ rpc;
6
+ constructor(rpc) {
7
+ this.rpc = rpc;
8
+ this.communityPool = this.communityPool.bind(this);
9
+ this.continuousFund = this.continuousFund.bind(this);
10
+ this.continuousFunds = this.continuousFunds.bind(this);
11
+ this.params = this.params.bind(this);
12
+ }
13
+ communityPool(request = {}) {
14
+ const data = QueryCommunityPoolRequest.encode(request).finish();
15
+ const promise = this.rpc.request('cosmos.protocolpool.v1.Query', 'CommunityPool', data);
16
+ return promise.then(data => QueryCommunityPoolResponse.decode(new BinaryReader(data)));
17
+ }
18
+ continuousFund(request) {
19
+ const data = QueryContinuousFundRequest.encode(request).finish();
20
+ const promise = this.rpc.request('cosmos.protocolpool.v1.Query', 'ContinuousFund', data);
21
+ return promise.then(data => QueryContinuousFundResponse.decode(new BinaryReader(data)));
22
+ }
23
+ continuousFunds(request = {}) {
24
+ const data = QueryContinuousFundsRequest.encode(request).finish();
25
+ const promise = this.rpc.request('cosmos.protocolpool.v1.Query', 'ContinuousFunds', data);
26
+ return promise.then(data => QueryContinuousFundsResponse.decode(new BinaryReader(data)));
27
+ }
28
+ params(request = {}) {
29
+ const data = QueryParamsRequest.encode(request).finish();
30
+ const promise = this.rpc.request('cosmos.protocolpool.v1.Query', 'Params', data);
31
+ return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data)));
32
+ }
33
+ }
34
+ export const createRpcQueryExtension = (base) => {
35
+ const rpc = createProtobufRpcClient(base);
36
+ const queryService = new QueryClientImpl(rpc);
37
+ return {
38
+ communityPool(request) {
39
+ return queryService.communityPool(request);
40
+ },
41
+ continuousFund(request) {
42
+ return queryService.continuousFund(request);
43
+ },
44
+ continuousFunds(request) {
45
+ return queryService.continuousFunds(request);
46
+ },
47
+ params(request) {
48
+ return queryService.params(request);
49
+ },
50
+ };
51
+ };
52
+ //# sourceMappingURL=query.rpc.Query.js.map