@@ -123,6 +123,37 @@ var StonfiSwapStraw = Straw[BubbleJettonSwap]{
123
123
},
124
124
}
125
125
126
+ var StonfiV1PTONStraw = Straw [BubbleJettonTransfer ]{
127
+ CheckFuncs : []bubbleCheck {IsTx , HasInterface (abi .JettonWallet ), HasOperation (abi .JettonTransferMsgOp )},
128
+ Builder : func (newAction * BubbleJettonTransfer , bubble * Bubble ) error {
129
+ tx := bubble .Info .(BubbleTx )
130
+ newAction .master , _ = tx .additionalInfo .JettonMaster (tx .account .Address )
131
+ newAction .senderWallet = tx .account .Address
132
+ newAction .sender = tx .inputFrom
133
+ body := tx .decodedBody .Value .(abi.JettonTransferMsgBody )
134
+ newAction .amount = body .Amount
135
+ newAction .isWrappedTon = true
136
+ recipient , err := ton .AccountIDFromTlb (body .Destination )
137
+ if err == nil && recipient != nil {
138
+ newAction .recipient = & Account {Address : * recipient }
139
+ bubble .Accounts = append (bubble .Accounts , * recipient )
140
+ }
141
+ return nil
142
+ },
143
+ SingleChild : & Straw [BubbleJettonTransfer ]{
144
+ CheckFuncs : []bubbleCheck {IsTx , HasOperation (abi .JettonNotifyMsgOp )},
145
+ Builder : func (newAction * BubbleJettonTransfer , bubble * Bubble ) error {
146
+ tx := bubble .Info .(BubbleTx )
147
+ newAction .success = true
148
+ body := tx .decodedBody .Value .(abi.JettonNotifyMsgBody )
149
+ newAction .amount = body .Amount
150
+ newAction .payload = body .ForwardPayload .Value
151
+ newAction .recipient = & tx .account
152
+ return nil
153
+ },
154
+ },
155
+ }
156
+
126
157
var StonfiV2PTONStraw = Straw [BubbleJettonTransfer ]{
127
158
CheckFuncs : []bubbleCheck {IsTx , HasInterface (abi .JettonWallet ), HasOperation (abi .PtonTonTransferMsgOp )},
128
159
Builder : func (newAction * BubbleJettonTransfer , bubble * Bubble ) error {
@@ -153,6 +184,34 @@ var StonfiV2PTONStraw = Straw[BubbleJettonTransfer]{
153
184
},
154
185
}
155
186
187
+ var StonfiV2PTONStrawReverse = Straw [BubbleJettonTransfer ]{
188
+ CheckFuncs : []bubbleCheck {IsTx , HasInterface (abi .JettonWallet ), HasOperation (abi .JettonTransferMsgOp )},
189
+ Builder : func (newAction * BubbleJettonTransfer , bubble * Bubble ) error {
190
+ tx := bubble .Info .(BubbleTx )
191
+ newAction .master , _ = tx .additionalInfo .JettonMaster (tx .account .Address )
192
+ newAction .senderWallet = tx .account .Address
193
+ newAction .sender = tx .inputFrom
194
+ body := tx .decodedBody .Value .(abi.JettonTransferMsgBody )
195
+ newAction .amount = body .Amount
196
+ newAction .isWrappedTon = true
197
+ newAction .payload = body .ForwardPayload .Value
198
+ recipient , err := ton .AccountIDFromTlb (body .Destination )
199
+ if err == nil {
200
+ newAction .recipient = & Account {Address : * recipient }
201
+ }
202
+ return nil
203
+ },
204
+ SingleChild : & Straw [BubbleJettonTransfer ]{
205
+ CheckFuncs : []bubbleCheck {IsTx , HasOperation (abi .PtonTonTransferMsgOp )},
206
+ Builder : func (newAction * BubbleJettonTransfer , bubble * Bubble ) error {
207
+ tx := bubble .Info .(BubbleTx )
208
+ newAction .success = true
209
+ newAction .recipient = & tx .account
210
+ return nil
211
+ },
212
+ },
213
+ }
214
+
156
215
var StonfiSwapV2Straw = Straw [BubbleJettonSwap ]{
157
216
CheckFuncs : []bubbleCheck {func (bubble * Bubble ) bool {
158
217
jettonTx , ok := bubble .Info .(BubbleJettonTransfer )
0 commit comments