Skip to content

Commit 03c41b8

Browse files
committed
Expand Geyser integration to include currency name on deposit
1 parent a936fee commit 03c41b8

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

pkg/code/async/geyser/external_deposit.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,17 @@ func processPotentialExternalDepositIntoVm(ctx context.Context, data code_data.P
375375

376376
syncedDepositCache.Insert(cacheKey, true, 1)
377377

378+
currencyName := common.CoreMintName
379+
if !common.IsCoreMint(mint) {
380+
currencyMetadata, err := data.GetCurrencyMetadata(ctx, mint.PublicKey().ToBase58())
381+
if err != nil {
382+
return nil
383+
}
384+
currencyName = currencyMetadata.Name
385+
}
386+
378387
// Best-effort processing for notification back to the user
379-
integration.OnDepositReceived(ctx, ownerAccount, mint, uint64(deltaQuarksIntoOmnibus), usdMarketValue)
388+
integration.OnDepositReceived(ctx, ownerAccount, mint, currencyName, uint64(deltaQuarksIntoOmnibus), usdMarketValue)
380389

381390
return nil
382391
default:

pkg/code/async/geyser/integration.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ import (
88

99
// Integration allows for notifications based on events processed by Geyser
1010
type Integration interface {
11-
OnDepositReceived(ctx context.Context, owner, mint *common.Account, quarksReceived uint64, usdMarketValue float64) error
11+
OnDepositReceived(ctx context.Context, owner, mint *common.Account, currencyName string, quarksReceived uint64, usdMarketValue float64) error
1212
}

0 commit comments

Comments
 (0)