@@ -151,6 +151,38 @@ func (h *Handler) convertActionTonTransfer(t *bath.TonTransferAction, acceptLang
151
151
return action , simplePreview
152
152
}
153
153
154
+ func (h * Handler ) convertActionExtraCurrencyTransfer (t * bath.ExtraCurrencyTransferAction , acceptLanguage string , viewer * tongo.AccountID ) (oas.OptExtraCurrencyTransferAction , oas.ActionSimplePreview ) {
155
+ var action oas.OptExtraCurrencyTransferAction
156
+ amount := big .Int (t .Amount )
157
+ meta := references .GetExtraCurrencyMeta (t .CurrencyID )
158
+ action .SetTo (oas.ExtraCurrencyTransferAction {
159
+ Amount : amount .String (),
160
+ Comment : g .Opt (t .Comment ),
161
+ Recipient : convertAccountAddress (t .Recipient , h .addressBook ),
162
+ Sender : convertAccountAddress (t .Sender , h .addressBook ),
163
+ EncryptedComment : convertEncryptedComment (t .EncryptedComment ),
164
+ Currency : oas.EcPreview {
165
+ Name : meta .Name ,
166
+ Symbol : meta .Symbol ,
167
+ Decimals : meta .Decimals ,
168
+ Image : meta .Image ,
169
+ },
170
+ })
171
+ if t .Refund != nil {
172
+ action .Value .Refund .SetTo (oas.Refund {
173
+ Type : oas .RefundType (t .Refund .Type ),
174
+ Origin : t .Refund .Origin ,
175
+ })
176
+ }
177
+ simplePreview := oas.ActionSimplePreview {
178
+ Name : "Extra Currency Transfer" ,
179
+ Description : "" , // TODO: add description
180
+ Accounts : distinctAccounts (viewer , h .addressBook , & t .Sender , & t .Recipient ),
181
+ // TODO: add value
182
+ }
183
+ return action , simplePreview
184
+ }
185
+
154
186
func (h * Handler ) convertActionNftTransfer (t * bath.NftTransferAction , acceptLanguage string , viewer * tongo.AccountID ) (oas.OptNftItemTransferAction , oas.ActionSimplePreview ) {
155
187
var action oas.OptNftItemTransferAction
156
188
action .SetTo (oas.NftItemTransferAction {
@@ -428,6 +460,8 @@ func (h *Handler) convertAction(ctx context.Context, viewer *tongo.AccountID, a
428
460
switch a .Type {
429
461
case bath .TonTransfer :
430
462
action .TonTransfer , action .SimplePreview = h .convertActionTonTransfer (a .TonTransfer , acceptLanguage .Value , viewer )
463
+ case bath .ExtraCurrencyTransfer :
464
+ action .ExtraCurrencyTransfer , action .SimplePreview = h .convertActionExtraCurrencyTransfer (a .ExtraCurrencyTransfer , acceptLanguage .Value , viewer )
431
465
case bath .NftItemTransfer :
432
466
action .NftItemTransfer , action .SimplePreview = h .convertActionNftTransfer (a .NftItemTransfer , acceptLanguage .Value , viewer )
433
467
case bath .JettonTransfer :
0 commit comments