Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
365a6f5
- removed contract, adjusted code changes to integrate the contract
iulianpascalau Feb 1, 2026
f000933
- added contracts downloader, completed the renaming from requests to…
iulianpascalau Feb 1, 2026
9632490
Merge pull request #77 from iulianpascalau/remove-contracts-reference…
iulianpascalau Feb 1, 2026
522cc41
- added query contract error treated as paused
iulianpascalau Feb 1, 2026
b8e1a58
Merge branch 'rc/v1.4' into remove-contracts-reference-and-code
iulianpascalau Feb 1, 2026
1f044bf
Merge pull request #79 from iulianpascalau/remove-contracts-reference…
iulianpascalau Feb 1, 2026
b58f96c
- removed the crypto payments service
iulianpascalau Feb 1, 2026
09e0ae0
Merge branch 'rc/v1.4' into removes-crypto-payments-service
iulianpascalau Feb 1, 2026
abe781d
- bump crypto-payments to v1.0.5
iulianpascalau Feb 1, 2026
f2fb043
Merge pull request #80 from iulianpascalau/removes-crypto-payments-se…
iulianpascalau Feb 1, 2026
55018d1
- crypto-payments repo update to v1.0.7
iulianpascalau Feb 1, 2026
782d768
- changed the solution link on the frontend to point to the 3 repos
iulianpascalau Feb 1, 2026
71ba193
Merge pull request #81 from iulianpascalau/crypto-payments-renaming
iulianpascalau Feb 1, 2026
01cede1
- integrated crypto-payment v1.0.9 with credits contract v1.0.1
iulianpascalau Feb 6, 2026
62d666e
Merge branch 'rc/v1.4' into integrate-xrypto-payment-1-0-9
iulianpascalau Feb 6, 2026
0b1274b
Merge pull request #82 from iulianpascalau/integrate-xrypto-payment-1…
iulianpascalau Feb 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions .github/workflows/check-contract-build.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/rs-tests.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ data/
logs/
.idea/
epoch-proxy-server
contracts/
24 changes: 0 additions & 24 deletions Jenkinsfile-crypto-prod

This file was deleted.

24 changes: 0 additions & 24 deletions Jenkinsfile-crypto-staging

This file was deleted.

File renamed without changes.
File renamed without changes.
48 changes: 34 additions & 14 deletions frontend/src/Dashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect, useState } from 'react';
import { getAccessKey, clearAuth, getUserInfo, parseJwt, type User as AuthUser } from './auth';
import { useNavigate } from 'react-router-dom';
import { LogOut, Key, Users, Copy, Trash2, Shield, Loader, Plus, User, Pencil, RotateCcw, ChevronLeft, ChevronRight, ArrowUpDown, ArrowUp, ArrowDown, Check, X as XIcon, UserCog, BookOpen, ExternalLink, Zap, AlertTriangle, CreditCard, Wallet } from 'lucide-react';
import { LogOut, Key, Users, Copy, Trash2, Shield, Loader, Plus, User, Pencil, RotateCcw, ChevronLeft, ChevronRight, ChevronUp, ArrowUpDown, ArrowUp, ArrowDown, Check, X as XIcon, UserCog, BookOpen, ExternalLink, Zap, AlertTriangle, CreditCard, Wallet } from 'lucide-react';
import axios from 'axios';


Expand Down Expand Up @@ -29,15 +29,15 @@ interface UserDetails {
interface CryptoPaymentState {
isServiceAvailable: boolean;
isPaused: boolean;
requestsPerEGLD: number;
creditsPerEGLD: number;
walletURL: string;
explorerURL: string;
contractAddress: string;
minimumBalance: number;

paymentId: number | null;
depositAddress: string | null;
numberOfRequests: number;
credits: number;

isLoading: boolean;
error: string | null;
Expand Down Expand Up @@ -111,14 +111,14 @@ export const Dashboard = () => {
const [cryptoState, setCryptoState] = useState<CryptoPaymentState>({
isServiceAvailable: false,
isPaused: false,
requestsPerEGLD: 10000,
creditsPerEGLD: 10000,
walletURL: 'https://devnet-wallet.multiversx.com',
explorerURL: 'https://devnet-explorer.multiversx.com',
contractAddress: 'erd1qqqqqqqqqqqqqpgqc6u0p4kfkr5ekcrae86m6knx46gr36khrqqqhf96zw',
minimumBalance: 0,
paymentId: null,
depositAddress: null,
numberOfRequests: 0,
credits: 0,
isLoading: false,
error: null
});
Expand All @@ -141,7 +141,7 @@ export const Dashboard = () => {
const newState = {
isServiceAvailable: config.isAvailable,
isPaused: config.isPaused,
requestsPerEGLD: config.requestsPerEGLD,
creditsPerEGLD: config.creditsPerEGLD,
walletURL: ensureProtocol(config.walletURL),
explorerURL: ensureProtocol(config.explorerURL),
contractAddress: config.contractAddress,
Expand All @@ -164,7 +164,7 @@ export const Dashboard = () => {
...prev,
paymentId: accountRes.data.paymentId,
depositAddress: accountRes.data.address,
numberOfRequests: accountRes.data.numberOfRequests
credits: accountRes.data.credits
}));
}
} catch (accErr: any) {
Expand All @@ -177,7 +177,7 @@ export const Dashboard = () => {
...prev,
paymentId: null,
depositAddress: null,
numberOfRequests: 0
credits: 0
}));
}
}
Expand All @@ -191,7 +191,7 @@ export const Dashboard = () => {
isServiceAvailable: false,
isPaused: false, // Ensure paused state is cleared if service is down
isLoading: false,
requestsPerEGLD: 0, // Reset rate
creditsPerEGLD: 0, // Reset rate
error: err.response?.data?.error || "Crypto service unavailable"
}));
}
Expand All @@ -217,7 +217,7 @@ export const Dashboard = () => {
...prev,
paymentId: accountRes.data.paymentId,
depositAddress: accountRes.data.address,
numberOfRequests: accountRes.data.numberOfRequests,
credits: accountRes.data.credits,
isLoading: false
}));
// Also refresh the main user data to ensure all views are in sync
Expand Down Expand Up @@ -636,7 +636,7 @@ export const Dashboard = () => {
</p>
<div className="flex flex-wrap gap-2 mb-6">
<span className="bg-white/5 px-2 py-1 rounded text-xs text-slate-300">
Rate: {cryptoState.requestsPerEGLD ? cryptoState.requestsPerEGLD.toLocaleString() : '-'} req / 1 EGLD
Rate: {cryptoState.creditsPerEGLD ? cryptoState.creditsPerEGLD.toLocaleString() : '-'} credits / 1 EGLD
</span>
<span className="bg-white/5 px-2 py-1 rounded text-xs text-slate-300">Activation: under 3 minutes</span>
</div>
Expand Down Expand Up @@ -727,7 +727,7 @@ export const Dashboard = () => {
</div>
<div>
<label className="text-xs text-slate-500 block mb-1">Current Rate</label>
<div className="text-slate-200">{cryptoState.requestsPerEGLD ? cryptoState.requestsPerEGLD.toLocaleString() : '-'} req/EGLD</div>
<div className="text-slate-200">{cryptoState.creditsPerEGLD ? cryptoState.creditsPerEGLD.toLocaleString() : '-'} credits/EGLD</div>
</div>
<div className="col-span-2 mt-1">
<div className="text-[10px] text-amber-500/80 font-medium flex items-center gap-1.5 uppercase tracking-wide">
Expand Down Expand Up @@ -1180,8 +1180,28 @@ export const Dashboard = () => {
<ExternalLink size={18} />
</a>
<div className="text-center w-full border-t border-white/5 pt-6">
<p style={{ fontSize: '0.8rem' }} className="text-slate-500">
Build {appInfo.version} | <a href="https://github.com/iulianpascalau/mx-epoch-proxy-go" className="hover:text-slate-400 underline decoration-slate-600 underline-offset-2" target="_blank" rel="noopener noreferrer">Solution</a>
<p style={{ fontSize: '0.8rem' }} className="text-slate-500 flex items-center justify-center gap-1">
Build {appInfo.version} |
<div className="relative group inline-block ml-1">
<button className="hover:text-slate-300 underline decoration-slate-600 underline-offset-2 flex items-center gap-1 transition-colors">
Source Code <ChevronUp size={12} />
</button>
<div className="absolute bottom-full left-1/2 -translate-x-1/2 mb-2 w-56 bg-slate-900/95 border border-slate-700/50 backdrop-blur-xl rounded-lg shadow-2xl opacity-0 invisible group-hover:visible group-hover:opacity-100 transition-all duration-200 transform origin-bottom z-50 flex flex-col">
<div className="px-4 py-2 border-b border-white/5 text-[10px] uppercase font-bold text-slate-500 tracking-wider">
Repositories
</div>
<a href="https://github.com/iulianpascalau/mx-epoch-proxy-go" target="_blank" rel="noopener noreferrer" className="px-4 py-3 hover:bg-indigo-500/10 hover:text-indigo-300 text-slate-300 text-xs text-left transition-colors flex items-center gap-2">
<span className="w-1.5 h-1.5 rounded-full bg-indigo-500"></span> Epoch Proxy (Go)
</a>
<a href="https://github.com/iulianpascalau/mx-crypto-payments" target="_blank" rel="noopener noreferrer" className="px-4 py-3 hover:bg-emerald-500/10 hover:text-emerald-300 text-slate-300 text-xs text-left transition-colors flex items-center gap-2">
<span className="w-1.5 h-1.5 rounded-full bg-emerald-500"></span> Crypto Payments (Go)
</a>
<a href="https://github.com/iulianpascalau/mx-credits-contract-rs" target="_blank" rel="noopener noreferrer" className="px-4 py-3 hover:bg-amber-500/10 hover:text-amber-300 text-slate-300 text-xs text-left transition-colors flex items-center gap-2 rounded-b-lg">
<span className="w-1.5 h-1.5 rounded-full bg-amber-500"></span> Credits Contract (Rust)
</a>
<div className="absolute -bottom-1 left-1/2 -translate-x-1/2 w-2 h-2 bg-slate-900 border-r border-b border-slate-700/50 transform rotate-45"></div>
</div>
</div>
</p>
</div>

Expand Down
26 changes: 23 additions & 3 deletions frontend/src/Login.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState, useEffect } from 'react';
import { setAuth } from './auth';
import { useNavigate, Link, useLocation } from 'react-router-dom';
import { Lock, User } from 'lucide-react';
import { Lock, User, ChevronUp } from 'lucide-react';

export const Login = () => {
const [username, setUsername] = useState('');
Expand Down Expand Up @@ -121,8 +121,28 @@ export const Login = () => {
</form>

<div className="mt-6 text-center">
<p style={{ fontSize: '0.8rem' }} className="text-slate-500">
Build {version} | <a href="https://github.com/iulianpascalau/mx-epoch-proxy-go" className="hover:text-slate-400 underline decoration-slate-600 underline-offset-2" target="_blank" rel="noopener noreferrer">Solution</a>
<p style={{ fontSize: '0.8rem' }} className="text-slate-500 flex items-center justify-center gap-1">
Build {version} |
<div className="relative group inline-block ml-1">
<button className="hover:text-slate-300 underline decoration-slate-600 underline-offset-2 flex items-center gap-1 transition-colors">
Source Code <ChevronUp size={12} />
</button>
<div className="absolute bottom-full left-1/2 -translate-x-1/2 mb-2 w-56 bg-slate-900/95 border border-slate-700/50 backdrop-blur-xl rounded-lg shadow-2xl opacity-0 invisible group-hover:visible group-hover:opacity-100 transition-all duration-200 transform origin-bottom z-50 flex flex-col">
<div className="px-4 py-2 border-b border-white/5 text-[10px] uppercase font-bold text-slate-500 tracking-wider">
Repositories
</div>
<a href="https://github.com/iulianpascalau/mx-epoch-proxy-go" target="_blank" rel="noopener noreferrer" className="px-4 py-3 hover:bg-indigo-500/10 hover:text-indigo-300 text-slate-300 text-xs text-left transition-colors flex items-center gap-2">
<span className="w-1.5 h-1.5 rounded-full bg-indigo-500"></span> Epoch Proxy (Go)
</a>
<a href="https://github.com/iulianpascalau/mx-crypto-payments" target="_blank" rel="noopener noreferrer" className="px-4 py-3 hover:bg-emerald-500/10 hover:text-emerald-300 text-slate-300 text-xs text-left transition-colors flex items-center gap-2">
<span className="w-1.5 h-1.5 rounded-full bg-emerald-500"></span> Crypto Payments (Go)
</a>
<a href="https://github.com/iulianpascalau/mx-credits-contract-rs" target="_blank" rel="noopener noreferrer" className="px-4 py-3 hover:bg-amber-500/10 hover:text-amber-300 text-slate-300 text-xs text-left transition-colors flex items-center gap-2 rounded-b-lg">
<span className="w-1.5 h-1.5 rounded-full bg-amber-500"></span> Credits Contract (Rust)
</a>
<div className="absolute -bottom-1 left-1/2 -translate-x-1/2 w-2 h-2 bg-slate-900 border-r border-b border-slate-700/50 transform rotate-45"></div>
</div>
</div>
</p>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ toolchain go1.24.11

require (
github.com/dchest/captcha v1.1.0
github.com/gin-gonic/gin v1.10.0
github.com/golang-jwt/jwt/v5 v5.3.0
github.com/iulianpascalau/mx-crypto-payments-go v1.0.9
github.com/joho/godotenv v1.5.1
github.com/mattn/go-sqlite3 v1.14.33
github.com/multiversx/mx-chain-core-go v1.4.1
Expand Down Expand Up @@ -50,6 +50,7 @@ require (
github.com/gin-contrib/cors v1.6.0 // indirect
github.com/gin-contrib/pprof v1.4.0 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/gin-gonic/gin v1.10.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ github.com/ipfs/go-test v0.0.4 h1:DKT66T6GBB6PsDFLoO56QZPrOmzJkqU1FZH5C9ySkew=
github.com/ipfs/go-test v0.0.4/go.mod h1:qhIM1EluEfElKKM6fnWxGn822/z9knUGM1+I/OAQNKI=
github.com/ipld/go-ipld-prime v0.21.0 h1:n4JmcpOlPDIxBcY037SVfpd1G+Sj1nKZah0m6QH9C2E=
github.com/ipld/go-ipld-prime v0.21.0/go.mod h1:3RLqy//ERg/y5oShXXdx5YIp50cFGOanyMctpPjsvxQ=
github.com/iulianpascalau/mx-crypto-payments-go v1.0.9 h1:w5KmBFzrx4XxeJ2t56crTGcDthH9veMKtYt7ltN3WHY=
github.com/iulianpascalau/mx-crypto-payments-go v1.0.9/go.mod h1:W7bSzZiEQaG3iAAMMBP/5y5PWpIlXeY7d724Xa5SvGs=
github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus=
github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc=
github.com/jbenet/go-cienv v0.1.0/go.mod h1:TqNnHUmJgXau0nCzC7kXWeotg3J9W34CUv5Djy1+FlA=
Expand Down
19 changes: 13 additions & 6 deletions integrationTests/go/e2e_test.go → integrationTests/e2e_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package _go
package integrationTests

import (
"context"
Expand All @@ -8,23 +8,30 @@ import (
"testing"
"time"

"github.com/iulianpascalau/mx-epoch-proxy-go/integrationTests/go/framework"
cryptoPaymentsFramework "github.com/iulianpascalau/mx-crypto-payments-go/integrationTests/framework"
"github.com/iulianpascalau/mx-epoch-proxy-go/integrationTests/framework"
"github.com/multiversx/mx-chain-core-go/data/transaction"
logger "github.com/multiversx/mx-chain-logger-go"
"github.com/stretchr/testify/require"
)

var log = logger.GetOrCreate("integrationTests")

func TestCreateFreeUserAndCreateKeyAndTestRequestsAreThrottledThenSwitchToPremium(t *testing.T) {
if !framework.IsChainSimulatorIsRunning() {
t.Skip("No chain simulator instance running found. Skipping slow test")
}

framework.EnsureTestContracts(t)

proxyService := framework.NewProxyService(t)
cryptoPaymentService := framework.NewCryptoPaymentService(t)
cryptoPaymentService := cryptoPaymentsFramework.NewCryptoPaymentService(t)

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

proxyService.Setup(ctx)
cryptoPaymentService.Setup(ctx, 100)
cryptoPaymentService.Setup(ctx, 100, framework.GetContractPath("credits"))

defer proxyService.TearDown()
defer cryptoPaymentService.TearDown()
Expand Down Expand Up @@ -87,7 +94,7 @@ func TestCreateFreeUserAndCreateKeyAndTestRequestsAreThrottledThenSwitchToPremiu
// Value: 0.5 EGLD = 0.5 * 10^18 = 500000000000000000
value := "500000000000000000"

receiverAddr := framework.NewMvxAddressFromBech32(t, session.GetDepositAddress())
receiverAddr := cryptoPaymentsFramework.NewMvxAddressFromBech32(t, session.GetDepositAddress())

// Send Tx
hash, _, status := cryptoPaymentService.ChainSimulator.SendTx(ctx, senderSk, receiverAddr, value, 500000, []byte{})
Expand All @@ -103,7 +110,7 @@ func TestCreateFreeUserAndCreateKeyAndTestRequestsAreThrottledThenSwitchToPremiu
// Generate a block to ensure any pending txs (from balanceProcessor) are processed
cryptoPaymentService.ChainSimulator.GenerateBlocks(ctx, 1)

reqs := session.GetNumberOfRequests()
reqs := session.GetCredits()
return reqs >= 50
}, 2*time.Minute, 1*time.Second)
log.Info("Done ✓")
Expand Down
Loading