@@ -8,7 +8,7 @@ import type {
88 StringKeyOf ,
99} from "../types.js" ;
1010import type { UnwrapResult } from "./result.js" ;
11- import type { GenericInkDescriptors } from "./types.js" ;
11+ import type { ContractAddress , GenericInkDescriptors } from "./types.js" ;
1212
1313type StorageReadInstruction = BaseInstruction < "read-storage" > & {
1414 path : string ;
@@ -36,6 +36,7 @@ type MessageSendInstruction = BaseInstruction<"send-message"> & {
3636 [ Str : string ] : unknown ;
3737 }
3838 | undefined ;
39+ origin : ContractAddress | undefined ;
3940 at : Finality | undefined ;
4041} ;
4142
@@ -196,18 +197,19 @@ export class InkQuery<
196197 > extends never
197198 ? [
198199 body : TDescriptor [ "__types" ] [ "messages" ] [ TName ] [ "message" ] ,
199- options ?: { at ?: Finality } ,
200+ options ?: { origin ?: ContractAddress ; at ?: Finality } ,
200201 ]
201202 : [
202203 body ?: TDescriptor [ "__types" ] [ "messages" ] [ TName ] [ "message" ] ,
203- options ?: { at ?: Finality } ,
204+ options ?: { origin ?: ContractAddress ; at ?: Finality } ,
204205 ]
205206 ) {
206207 return this . #append( {
207208 instruction : "send-message" ,
208209 // TODO: this is needed for some reason
209210 name : name as typeof name ,
210211 body : bodyAndOptions [ 0 ] as any ,
212+ origin : bodyAndOptions [ 1 ] ?. origin ,
211213 at : bodyAndOptions [ 1 ] ?. at ,
212214 } satisfies MessageSendInstruction ) ;
213215 }
@@ -221,7 +223,7 @@ export class InkQuery<
221223 > (
222224 name : TName ,
223225 bodies : Array < TDescriptor [ "__types" ] [ "messages" ] [ TName ] [ "message" ] > ,
224- options ?: { at ?: Finality ; stream ?: TStream } ,
226+ options ?: { origin ?: ContractAddress ; at ?: Finality ; stream ?: TStream } ,
225227 ) {
226228 return this . #append( {
227229 instruction : "send-message" ,
@@ -232,6 +234,7 @@ export class InkQuery<
232234 // TODO: this is needed for some reason
233235 name : name as typeof name ,
234236 bodies,
237+ origin : options ?. origin ,
235238 at : options ?. at ,
236239 } satisfies MultiMessageSendInstruction ) ;
237240 }
0 commit comments