diff --git a/ocp/worker/swap/integration.go b/ocp/worker/swap/integration.go index 998e51c..cdbe800 100644 --- a/ocp/worker/swap/integration.go +++ b/ocp/worker/swap/integration.go @@ -3,11 +3,11 @@ package swap import ( "context" - "github.com/code-payments/ocp-server/ocp/common" "github.com/code-payments/ocp-server/currency" + "github.com/code-payments/ocp-server/ocp/common" ) // Integration allows for notifications based on events processed by the swap worker type Integration interface { - OnSwapFinalized(ctx context.Context, owner, mint *common.Account, currencyName string, region currency.Code, nativeAmount float64) error + OnSwapFinalized(ctx context.Context, owner, fromMint, toMint *common.Account, currencyName string, region currency.Code, valueReceived float64) error } diff --git a/ocp/worker/swap/util.go b/ocp/worker/swap/util.go index 7d95282..1be047f 100644 --- a/ocp/worker/swap/util.go +++ b/ocp/worker/swap/util.go @@ -242,11 +242,11 @@ func (p *runtime) notifySwapFinalized(ctx context.Context, swapRecord *swap.Reco return err } - amountReceived := fundingIntentRecord.SendPublicPaymentMetadata.NativeAmount + valueReceived := fundingIntentRecord.SendPublicPaymentMetadata.NativeAmount if !common.IsCoreMint(fromMint) { - amountReceived = 0.99 * amountReceived + valueReceived = 0.99 * valueReceived } - return p.integration.OnSwapFinalized(ctx, owner, toMint, currencyName, fundingIntentRecord.SendPublicPaymentMetadata.ExchangeCurrency, amountReceived) + return p.integration.OnSwapFinalized(ctx, owner, fromMint, toMint, currencyName, fundingIntentRecord.SendPublicPaymentMetadata.ExchangeCurrency, valueReceived) } func (p *runtime) markNonceReleasedDueToSubmittedTransaction(ctx context.Context, record *swap.Record) error {