@@ -80,15 +80,8 @@ export type SignFrameActionFunc<
8080 actionContext : SignerStateActionContext < TSignerStorageType , TFrameContextType >
8181) => Promise < SignedFrameAction < TFrameActionBodyType > > ;
8282
83- export type UseFetchFrameSignFrameActionFunction = ( arg : {
84- actionContext : SignerStateActionContext ;
85- /**
86- * @defaultValue false
87- */
88- forceRealSigner ?: boolean ;
89- } ) => Promise < SignedFrameAction > ;
90-
9183export type UseFetchFrameOptions = {
84+ dangerousSkipSigning : boolean ;
9285 stackAPI : FrameStackAPI ;
9386 /**
9487 * URL or path to the frame proxy handling GET requests.
@@ -102,7 +95,6 @@ export type UseFetchFrameOptions = {
10295 * Extra payload to be sent with the POST request.
10396 */
10497 extraButtonRequestPayload ?: Record < string , unknown > ;
105- signFrameAction : UseFetchFrameSignFrameActionFunction ;
10698 /**
10799 * Called after transaction data has been returned from the server and user needs to approve the transaction.
108100 */
@@ -195,10 +187,25 @@ export type UseFetchFrameOptions = {
195187 onTransactionProcessingError ?: ( error : Error ) => void ;
196188} ;
197189
190+ export type ResolveFrameActionContextArgumentAction =
191+ | { type : "composer" }
192+ | { type : "cast" }
193+ | {
194+ type : "frame" ;
195+ /**
196+ * Current parse result that is active
197+ */
198+ parseResult : ParseFramesWithReportsResult ;
199+ /**
200+ * Specification that is currently active
201+ */
202+ specification : SupportedParsingSpecification ;
203+ } ;
204+
198205export type ResolveFrameActionContextArgument = {
199- readonly dangerouslySkipSigning : boolean ;
200206 readonly frameStack : FramesStack ;
201207 readonly specifications : SupportedParsingSpecification [ ] ;
208+ readonly action : ResolveFrameActionContextArgumentAction ;
202209} ;
203210
204211export type ResolveFrameActionContextResult = {
@@ -420,19 +427,25 @@ export type FramePOSTRequest =
420427 source ?: never ;
421428 frameButton : FrameButtonPost | FrameButtonTx ;
422429 signerStateActionContext : SignerStateActionContext ;
430+ signerState : SignerStateInstance < any , any , any > ;
423431 isDangerousSkipSigning : boolean ;
424432 /**
425433 * The frame that was the source of the button press.
426434 */
427435 sourceFrame : Frame ;
436+ sourceParseResult : ParseFramesWithReportsResult ;
437+ specification : SupportedParsingSpecification ;
428438 }
429439 | {
430440 method : "POST" ;
431441 source : "cast-action" | "composer-action" ;
432442 frameButton : FrameButtonPost | FrameButtonTx ;
433443 signerStateActionContext : SignerStateActionContext ;
444+ signerState : SignerStateInstance < any , any , any > ;
434445 isDangerousSkipSigning : boolean ;
435446 sourceFrame : undefined ;
447+ sourceParseResult : undefined ;
448+ specification : undefined ;
436449 } ;
437450
438451export type FrameRequest = FrameGETRequest | FramePOSTRequest ;
@@ -541,12 +554,13 @@ export type FrameReducerActions =
541554 homeframeUrl : string ;
542555 } ;
543556
544- export type ButtonPressFunction = (
545- frame : Frame ,
546- frameButton : FrameButton ,
547- index : number ,
548- fetchFrameOverride ?: FetchFrameFunction
549- ) => void | Promise < void > ;
557+ export type ButtonPressFunction = ( arg : {
558+ frameButton : FrameButton ;
559+ parseResult : ParseFramesWithReportsResult ;
560+ specification : SupportedParsingSpecification ;
561+ index : number ;
562+ fetchFrameOverride ?: FetchFrameFunction ;
563+ } ) => void | Promise < void > ;
550564
551565type CastActionButtonPressFunctionArg = {
552566 castAction : CastActionResponse & {
@@ -581,7 +595,12 @@ export type ComposerActionButtonPressFunction = (
581595
582596export type CastActionRequest = Omit <
583597 FramePOSTRequest ,
584- "method" | "frameButton" | "sourceFrame" | "signerStateActionContext"
598+ | "method"
599+ | "frameButton"
600+ | "specification"
601+ | "sourceFrame"
602+ | "sourceParseResult"
603+ | "signerStateActionContext"
585604> & {
586605 method : "CAST_ACTION" ;
587606 action : CastActionResponse & {
@@ -595,7 +614,12 @@ export type CastActionRequest = Omit<
595614
596615export type ComposerActionRequest = Omit <
597616 FramePOSTRequest ,
598- "method" | "frameButton" | "sourceFrame" | "signerStateActionContext"
617+ | "method"
618+ | "frameButton"
619+ | "specification"
620+ | "sourceFrame"
621+ | "sourceParseResult"
622+ | "signerStateActionContext"
599623> & {
600624 method : "COMPOSER_ACTION" ;
601625 action : CastActionResponse & {
0 commit comments