@@ -4,6 +4,8 @@ import { BinaryReader } from '../../binary.js';
44import {
55 MsgInstallBundle ,
66 MsgInstallBundleResponse ,
7+ MsgSendChunk ,
8+ MsgSendChunkResponse ,
79 MsgDeliverInbound ,
810 MsgDeliverInboundResponse ,
911 MsgWalletAction ,
@@ -19,6 +21,8 @@ import {
1921export 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