@@ -151,6 +151,31 @@ 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
+ Symbol : meta .Symbol ,
166
+ Decimals : meta .Decimals ,
167
+ Image : meta .Image ,
168
+ },
169
+ })
170
+ simplePreview := oas.ActionSimplePreview {
171
+ Name : "Extra Currency Transfer" ,
172
+ Description : "" , // TODO: add description
173
+ Accounts : distinctAccounts (viewer , h .addressBook , & t .Sender , & t .Recipient ),
174
+ // TODO: add value
175
+ }
176
+ return action , simplePreview
177
+ }
178
+
154
179
func (h * Handler ) convertActionNftTransfer (t * bath.NftTransferAction , acceptLanguage string , viewer * tongo.AccountID ) (oas.OptNftItemTransferAction , oas.ActionSimplePreview ) {
155
180
var action oas.OptNftItemTransferAction
156
181
action .SetTo (oas.NftItemTransferAction {
@@ -428,6 +453,8 @@ func (h *Handler) convertAction(ctx context.Context, viewer *tongo.AccountID, a
428
453
switch a .Type {
429
454
case bath .TonTransfer :
430
455
action .TonTransfer , action .SimplePreview = h .convertActionTonTransfer (a .TonTransfer , acceptLanguage .Value , viewer )
456
+ case bath .ExtraCurrencyTransfer :
457
+ action .ExtraCurrencyTransfer , action .SimplePreview = h .convertActionExtraCurrencyTransfer (a .ExtraCurrencyTransfer , acceptLanguage .Value , viewer )
431
458
case bath .NftItemTransfer :
432
459
action .NftItemTransfer , action .SimplePreview = h .convertActionNftTransfer (a .NftItemTransfer , acceptLanguage .Value , viewer )
433
460
case bath .JettonTransfer :
0 commit comments