Skip to content

Commit 2110a3e

Browse files
committed
chore(client-utils): Codegen
1 parent 8684526 commit 2110a3e

File tree

5 files changed

+1303
-77
lines changed

5 files changed

+1303
-77
lines changed

packages/client-utils/src/codegen/agoric/swingset/msgs.rpc.msg.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { BinaryReader } from '../../binary.js';
44
import {
55
MsgInstallBundle,
66
MsgInstallBundleResponse,
7+
MsgSendChunk,
8+
MsgSendChunkResponse,
79
MsgDeliverInbound,
810
MsgDeliverInboundResponse,
911
MsgWalletAction,
@@ -19,6 +21,8 @@ import {
1921
export interface Msg {
2022
/** Install a JavaScript sources bundle on the chain's SwingSet controller. */
2123
installBundle(request: MsgInstallBundle): Promise<MsgInstallBundleResponse>;
24+
/** Send a chunk of a bundle to tolerate RPC message size limits. */
25+
sendChunk(request: MsgSendChunk): Promise<MsgSendChunkResponse>;
2226
/** Send inbound messages. */
2327
deliverInbound(
2428
request: MsgDeliverInbound,
@@ -39,6 +43,7 @@ export class MsgClientImpl implements Msg {
3943
constructor(rpc: Rpc) {
4044
this.rpc = rpc;
4145
this.installBundle = this.installBundle.bind(this);
46+
this.sendChunk = this.sendChunk.bind(this);
4247
this.deliverInbound = this.deliverInbound.bind(this);
4348
this.walletAction = this.walletAction.bind(this);
4449
this.walletSpendAction = this.walletSpendAction.bind(this);
@@ -56,6 +61,13 @@ export class MsgClientImpl implements Msg {
5661
MsgInstallBundleResponse.decode(new BinaryReader(data)),
5762
);
5863
}
64+
sendChunk(request: MsgSendChunk): Promise<MsgSendChunkResponse> {
65+
const data = MsgSendChunk.encode(request).finish();
66+
const promise = this.rpc.request('agoric.swingset.Msg', 'SendChunk', data);
67+
return promise.then(data =>
68+
MsgSendChunkResponse.decode(new BinaryReader(data)),
69+
);
70+
}
5971
deliverInbound(
6072
request: MsgDeliverInbound,
6173
): Promise<MsgDeliverInboundResponse> {

0 commit comments

Comments
 (0)