Skip to content

Commit b997c6c

Browse files
Merge pull request #78 from iulianpascalau/rc/v1.4
Rc/v1.4
2 parents 6feb460 + 0b1274b commit b997c6c

138 files changed

Lines changed: 176 additions & 11658 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/check-contract-build.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/rs-tests.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ data/
3131
logs/
3232
.idea/
3333
epoch-proxy-server
34+
contracts/

Jenkinsfile-crypto-prod

Lines changed: 0 additions & 24 deletions
This file was deleted.

Jenkinsfile-crypto-staging

Lines changed: 0 additions & 24 deletions
This file was deleted.
File renamed without changes.

frontend/src/Dashboard.tsx

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useEffect, useState } from 'react';
22
import { getAccessKey, clearAuth, getUserInfo, parseJwt, type User as AuthUser } from './auth';
33
import { useNavigate } from 'react-router-dom';
4-
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';
4+
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';
55
import axios from 'axios';
66

77

@@ -29,15 +29,15 @@ interface UserDetails {
2929
interface CryptoPaymentState {
3030
isServiceAvailable: boolean;
3131
isPaused: boolean;
32-
requestsPerEGLD: number;
32+
creditsPerEGLD: number;
3333
walletURL: string;
3434
explorerURL: string;
3535
contractAddress: string;
3636
minimumBalance: number;
3737

3838
paymentId: number | null;
3939
depositAddress: string | null;
40-
numberOfRequests: number;
40+
credits: number;
4141

4242
isLoading: boolean;
4343
error: string | null;
@@ -111,14 +111,14 @@ export const Dashboard = () => {
111111
const [cryptoState, setCryptoState] = useState<CryptoPaymentState>({
112112
isServiceAvailable: false,
113113
isPaused: false,
114-
requestsPerEGLD: 10000,
114+
creditsPerEGLD: 10000,
115115
walletURL: 'https://devnet-wallet.multiversx.com',
116116
explorerURL: 'https://devnet-explorer.multiversx.com',
117117
contractAddress: 'erd1qqqqqqqqqqqqqpgqc6u0p4kfkr5ekcrae86m6knx46gr36khrqqqhf96zw',
118118
minimumBalance: 0,
119119
paymentId: null,
120120
depositAddress: null,
121-
numberOfRequests: 0,
121+
credits: 0,
122122
isLoading: false,
123123
error: null
124124
});
@@ -141,7 +141,7 @@ export const Dashboard = () => {
141141
const newState = {
142142
isServiceAvailable: config.isAvailable,
143143
isPaused: config.isPaused,
144-
requestsPerEGLD: config.requestsPerEGLD,
144+
creditsPerEGLD: config.creditsPerEGLD,
145145
walletURL: ensureProtocol(config.walletURL),
146146
explorerURL: ensureProtocol(config.explorerURL),
147147
contractAddress: config.contractAddress,
@@ -164,7 +164,7 @@ export const Dashboard = () => {
164164
...prev,
165165
paymentId: accountRes.data.paymentId,
166166
depositAddress: accountRes.data.address,
167-
numberOfRequests: accountRes.data.numberOfRequests
167+
credits: accountRes.data.credits
168168
}));
169169
}
170170
} catch (accErr: any) {
@@ -177,7 +177,7 @@ export const Dashboard = () => {
177177
...prev,
178178
paymentId: null,
179179
depositAddress: null,
180-
numberOfRequests: 0
180+
credits: 0
181181
}));
182182
}
183183
}
@@ -191,7 +191,7 @@ export const Dashboard = () => {
191191
isServiceAvailable: false,
192192
isPaused: false, // Ensure paused state is cleared if service is down
193193
isLoading: false,
194-
requestsPerEGLD: 0, // Reset rate
194+
creditsPerEGLD: 0, // Reset rate
195195
error: err.response?.data?.error || "Crypto service unavailable"
196196
}));
197197
}
@@ -217,7 +217,7 @@ export const Dashboard = () => {
217217
...prev,
218218
paymentId: accountRes.data.paymentId,
219219
depositAddress: accountRes.data.address,
220-
numberOfRequests: accountRes.data.numberOfRequests,
220+
credits: accountRes.data.credits,
221221
isLoading: false
222222
}));
223223
// Also refresh the main user data to ensure all views are in sync
@@ -636,7 +636,7 @@ export const Dashboard = () => {
636636
</p>
637637
<div className="flex flex-wrap gap-2 mb-6">
638638
<span className="bg-white/5 px-2 py-1 rounded text-xs text-slate-300">
639-
Rate: {cryptoState.requestsPerEGLD ? cryptoState.requestsPerEGLD.toLocaleString() : '-'} req / 1 EGLD
639+
Rate: {cryptoState.creditsPerEGLD ? cryptoState.creditsPerEGLD.toLocaleString() : '-'} credits / 1 EGLD
640640
</span>
641641
<span className="bg-white/5 px-2 py-1 rounded text-xs text-slate-300">Activation: under 3 minutes</span>
642642
</div>
@@ -727,7 +727,7 @@ export const Dashboard = () => {
727727
</div>
728728
<div>
729729
<label className="text-xs text-slate-500 block mb-1">Current Rate</label>
730-
<div className="text-slate-200">{cryptoState.requestsPerEGLD ? cryptoState.requestsPerEGLD.toLocaleString() : '-'} req/EGLD</div>
730+
<div className="text-slate-200">{cryptoState.creditsPerEGLD ? cryptoState.creditsPerEGLD.toLocaleString() : '-'} credits/EGLD</div>
731731
</div>
732732
<div className="col-span-2 mt-1">
733733
<div className="text-[10px] text-amber-500/80 font-medium flex items-center gap-1.5 uppercase tracking-wide">
@@ -1180,8 +1180,28 @@ export const Dashboard = () => {
11801180
<ExternalLink size={18} />
11811181
</a>
11821182
<div className="text-center w-full border-t border-white/5 pt-6">
1183-
<p style={{ fontSize: '0.8rem' }} className="text-slate-500">
1184-
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>
1183+
<p style={{ fontSize: '0.8rem' }} className="text-slate-500 flex items-center justify-center gap-1">
1184+
Build {appInfo.version} |
1185+
<div className="relative group inline-block ml-1">
1186+
<button className="hover:text-slate-300 underline decoration-slate-600 underline-offset-2 flex items-center gap-1 transition-colors">
1187+
Source Code <ChevronUp size={12} />
1188+
</button>
1189+
<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">
1190+
<div className="px-4 py-2 border-b border-white/5 text-[10px] uppercase font-bold text-slate-500 tracking-wider">
1191+
Repositories
1192+
</div>
1193+
<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">
1194+
<span className="w-1.5 h-1.5 rounded-full bg-indigo-500"></span> Epoch Proxy (Go)
1195+
</a>
1196+
<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">
1197+
<span className="w-1.5 h-1.5 rounded-full bg-emerald-500"></span> Crypto Payments (Go)
1198+
</a>
1199+
<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">
1200+
<span className="w-1.5 h-1.5 rounded-full bg-amber-500"></span> Credits Contract (Rust)
1201+
</a>
1202+
<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>
1203+
</div>
1204+
</div>
11851205
</p>
11861206
</div>
11871207

frontend/src/Login.tsx

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useState, useEffect } from 'react';
22
import { setAuth } from './auth';
33
import { useNavigate, Link, useLocation } from 'react-router-dom';
4-
import { Lock, User } from 'lucide-react';
4+
import { Lock, User, ChevronUp } from 'lucide-react';
55

66
export const Login = () => {
77
const [username, setUsername] = useState('');
@@ -121,8 +121,28 @@ export const Login = () => {
121121
</form>
122122

123123
<div className="mt-6 text-center">
124-
<p style={{ fontSize: '0.8rem' }} className="text-slate-500">
125-
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>
124+
<p style={{ fontSize: '0.8rem' }} className="text-slate-500 flex items-center justify-center gap-1">
125+
Build {version} |
126+
<div className="relative group inline-block ml-1">
127+
<button className="hover:text-slate-300 underline decoration-slate-600 underline-offset-2 flex items-center gap-1 transition-colors">
128+
Source Code <ChevronUp size={12} />
129+
</button>
130+
<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">
131+
<div className="px-4 py-2 border-b border-white/5 text-[10px] uppercase font-bold text-slate-500 tracking-wider">
132+
Repositories
133+
</div>
134+
<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">
135+
<span className="w-1.5 h-1.5 rounded-full bg-indigo-500"></span> Epoch Proxy (Go)
136+
</a>
137+
<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">
138+
<span className="w-1.5 h-1.5 rounded-full bg-emerald-500"></span> Crypto Payments (Go)
139+
</a>
140+
<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">
141+
<span className="w-1.5 h-1.5 rounded-full bg-amber-500"></span> Credits Contract (Rust)
142+
</a>
143+
<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>
144+
</div>
145+
</div>
126146
</p>
127147
</div>
128148
</div>

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ toolchain go1.24.11
66

77
require (
88
github.com/dchest/captcha v1.1.0
9-
github.com/gin-gonic/gin v1.10.0
109
github.com/golang-jwt/jwt/v5 v5.3.0
10+
github.com/iulianpascalau/mx-crypto-payments-go v1.0.9
1111
github.com/joho/godotenv v1.5.1
1212
github.com/mattn/go-sqlite3 v1.14.33
1313
github.com/multiversx/mx-chain-core-go v1.4.1
@@ -50,6 +50,7 @@ require (
5050
github.com/gin-contrib/cors v1.6.0 // indirect
5151
github.com/gin-contrib/pprof v1.4.0 // indirect
5252
github.com/gin-contrib/sse v0.1.0 // indirect
53+
github.com/gin-gonic/gin v1.10.0 // indirect
5354
github.com/go-logr/logr v1.4.2 // indirect
5455
github.com/go-logr/stdr v1.2.2 // indirect
5556
github.com/go-ole/go-ole v1.2.6 // indirect

0 commit comments

Comments
 (0)