From a7c6be703110c834b7bc2c539f5ccb18cd38345f Mon Sep 17 00:00:00 2001 From: jeffyanta Date: Fri, 10 Jul 2026 11:15:32 -0400 Subject: [PATCH] Update OCP integrations to reflect changes for currency launches --- antispam/integration.go | 12 ------------ go.mod | 4 ++-- go.sum | 8 ++++---- swap/integration.go | 5 +---- 4 files changed, 7 insertions(+), 22 deletions(-) diff --git a/antispam/integration.go b/antispam/integration.go index 09076ff..b702dc2 100644 --- a/antispam/integration.go +++ b/antispam/integration.go @@ -76,18 +76,6 @@ func (i *Integration) AllowDistribution(_ context.Context, _ *ocp_common.Account } func (i *Integration) AllowSwap(_ context.Context, _ swap.Kind, _ swap.FundingSource, _, _, _ *ocp_common.Account, swapAmount, feeAmount uint64, initializesMint bool) (bool, string, error) { - if !initializesMint { - return true, "", nil - } - - if swapAmount != account.DefaultNewCurrencyPurchaseAmount { - return false, "invalid initial purchase amount for currency launch", nil - } - - if feeAmount != account.DefaultNewCurrencyFeeAmount { - return false, "invalid fee amount for currency launch", nil - } - return true, "", nil } diff --git a/go.mod b/go.mod index bba7089..8dad381 100644 --- a/go.mod +++ b/go.mod @@ -14,8 +14,8 @@ require ( github.com/aws/smithy-go v1.27.1 github.com/buckket/go-blurhash v1.1.0 github.com/code-payments/flipcash2-protobuf-api v1.16.0 - github.com/code-payments/ocp-protobuf-api v1.13.2-0.20260610171241-de46af911053 - github.com/code-payments/ocp-server v1.20.0 + github.com/code-payments/ocp-protobuf-api v1.14.0 + github.com/code-payments/ocp-server v1.20.1-0.20260710131716-f60d692f1340 github.com/devsisters/go-applereceipt v0.0.0-20240805020915-fa22a0160fc2 github.com/forPelevin/gomoji v1.4.1 github.com/georgysavva/scany/v2 v2.1.4 diff --git a/go.sum b/go.sum index 313f08a..eb6eada 100644 --- a/go.sum +++ b/go.sum @@ -80,10 +80,10 @@ github.com/code-payments/code-vm-indexer v1.2.0 h1:rSHpBMiT9BKgmKcXg/VIoi/h0t7jN github.com/code-payments/code-vm-indexer v1.2.0/go.mod h1:vn91YN2qNqb+gGJeZe2+l+TNxVmEEiRHXXnIn2Y40h8= github.com/code-payments/flipcash2-protobuf-api v1.16.0 h1:EtSXEfWxCjmWDkz+CWzEeEdgAStkN8TLskaTfJN4VpM= github.com/code-payments/flipcash2-protobuf-api v1.16.0/go.mod h1:s/1pOsb4FTRD+LcvRKGjfmm6ygRS/m1ep34EIW0fuDs= -github.com/code-payments/ocp-protobuf-api v1.13.2-0.20260610171241-de46af911053 h1:0B96K7/z7TpFbAJeyzP43A0eM58Ie/KRuu5U6PUrses= -github.com/code-payments/ocp-protobuf-api v1.13.2-0.20260610171241-de46af911053/go.mod h1:tw6BooY5a8l6CtSZnKOruyKII0W04n89pcM4BizrgG8= -github.com/code-payments/ocp-server v1.20.0 h1:8tsKUNsODfBUaUANO1iLd9nqVocd9TiP4KF+CAi2CBI= -github.com/code-payments/ocp-server v1.20.0/go.mod h1:C/yDoEdhbOb/F3SyWicRiKsonB4sDjkVTUGRDQxlf2Y= +github.com/code-payments/ocp-protobuf-api v1.14.0 h1:Q0IqyF4q31Mf+wvOILz+BM6P+xOnrPVAm/85/YolKDk= +github.com/code-payments/ocp-protobuf-api v1.14.0/go.mod h1:tw6BooY5a8l6CtSZnKOruyKII0W04n89pcM4BizrgG8= +github.com/code-payments/ocp-server v1.20.1-0.20260710131716-f60d692f1340 h1:qfopb0uxuqg6Bs/7frHf5avtSU5i99aEA7ka8692GH4= +github.com/code-payments/ocp-server v1.20.1-0.20260710131716-f60d692f1340/go.mod h1:sPxPVMAxXMRSxCgTNOsmBvLUoitBekR4nx4Hl7YXvJg= github.com/containerd/continuity v0.4.3 h1:6HVkalIp+2u1ZLH1J/pYX2oBVXlJZvh1X1A7bEZ9Su8= github.com/containerd/continuity v0.4.3/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= diff --git a/swap/integration.go b/swap/integration.go index f9c5fcf..3f8c159 100644 --- a/swap/integration.go +++ b/swap/integration.go @@ -99,10 +99,7 @@ func (i *Integration) OnSwapSubmitted(ctx context.Context, owner *common.Account return nil } -func (i *Integration) OnSwapFinalized(ctx context.Context, owner *ocp_common.Account, isBuy bool, mint *ocp_common.Account, currencyName string, region ocp_currency_lib.Code, amountReceived float64, isMintInit bool) error { - if isMintInit { - return nil - } +func (i *Integration) OnSwapFinalized(ctx context.Context, owner *ocp_common.Account, isBuy bool, mint *ocp_common.Account, currencyName string, region ocp_currency_lib.Code, amountReceived float64) error { i.notifyCurrencyBoughtOrSold(ctx, owner, isBuy, mint, currencyName, region, amountReceived) if isBuy && i.enableGainPushes { i.notifyHoldersOfGain(ctx, mint, currencyName, owner)