fix: replace all BigInt with bigint type
**Motivations :** - Uniformiser l'utilisation de bigint au lieu du type BigInt TypeScript - Corriger les erreurs de comparaison entre bigint et BigInt **Modifications :** - Changer toutes les références BigInt en bigint - Utiliser 0n au lieu de BigInt(0) - Utiliser 10n au lieu de BigInt(10) **Pages affectées :** - src/services/service.ts (types BigInt -> bigint, constantes)
This commit is contained in:
parent
6f54d8ad51
commit
4418f805ef
@ -794,7 +794,7 @@ export default class Services {
|
|||||||
|
|
||||||
private async ensureSufficientAmount(): Promise<void> {
|
private async ensureSufficientAmount(): Promise<void> {
|
||||||
const availableAmt = this.getAmount();
|
const availableAmt = this.getAmount();
|
||||||
const target: BigInt = DEFAULTAMOUNT * BigInt(10);
|
const target: bigint = DEFAULTAMOUNT * 10n;
|
||||||
|
|
||||||
console.log(`💰 Current amount: ${availableAmt}, target: ${target}`);
|
console.log(`💰 Current amount: ${availableAmt}, target: ${target}`);
|
||||||
|
|
||||||
@ -850,7 +850,7 @@ export default class Services {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async waitForAmount(target: BigInt): Promise<BigInt> {
|
private async waitForAmount(target: bigint): Promise<bigint> {
|
||||||
let attempts = 20; // Increased attempts for blockchain confirmation
|
let attempts = 20; // Increased attempts for blockchain confirmation
|
||||||
|
|
||||||
while (attempts > 0) {
|
while (attempts > 0) {
|
||||||
@ -877,7 +877,7 @@ export default class Services {
|
|||||||
const newAmount = this.getAmount();
|
const newAmount = this.getAmount();
|
||||||
console.log(`💰 Amount after transaction scan: ${newAmount}`);
|
console.log(`💰 Amount after transaction scan: ${newAmount}`);
|
||||||
|
|
||||||
if (newAmount > BigInt(0)) {
|
if (newAmount > 0n) {
|
||||||
this.updateUserStatus(`💰 Found ${newAmount} tokens in wallet!`);
|
this.updateUserStatus(`💰 Found ${newAmount} tokens in wallet!`);
|
||||||
} else {
|
} else {
|
||||||
this.updateUserStatus('⏳ Transaction processed, waiting for confirmation...');
|
this.updateUserStatus('⏳ Transaction processed, waiting for confirmation...');
|
||||||
@ -1328,7 +1328,7 @@ export default class Services {
|
|||||||
console.log(`💰 Amount after block scan: ${updatedAmount}`);
|
console.log(`💰 Amount after block scan: ${updatedAmount}`);
|
||||||
|
|
||||||
// Update user with scan results
|
// Update user with scan results
|
||||||
if (updatedAmount > BigInt(0)) {
|
if (updatedAmount > 0n) {
|
||||||
this.updateUserStatus(`💰 Wallet updated! Found ${updatedAmount} tokens`);
|
this.updateUserStatus(`💰 Wallet updated! Found ${updatedAmount} tokens`);
|
||||||
} else {
|
} else {
|
||||||
this.updateUserStatus('⏳ Transaction processed, waiting for confirmation...');
|
this.updateUserStatus('⏳ Transaction processed, waiting for confirmation...');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user