Skip to content

Commit

Permalink
Merge branch 'dev' into stage
Browse files Browse the repository at this point in the history
  • Loading branch information
JavidHaji-zada committed Dec 1, 2023
1 parent 073f2b2 commit e72cb9f
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 45 deletions.
13 changes: 9 additions & 4 deletions src/components/modular/TokenLogo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,31 @@ export const TokenLogo = (props: TokenLogoProps) => {
return <AirdaoWhiteIcon scale={scale} />;
}
return <AirdaoBlueIcon scale={scale} />;
case AirDAODictTypes.Code.ETH:
case AirDAODictTypes.Code.ETH.toLowerCase():
case 'ethereum':
return <EthTokenIcon scale={scale} />;
case AirDAODictTypes.Code.BUSD:
case AirDAODictTypes.Code.BUSD.toLowerCase():
case 'busd token':
return <BusdIcon scale={scale} />;
case AirDAODictTypes.Code.USDC:
case AirDAODictTypes.Code.USDC.toLowerCase():
case 'usd coin':
return <UsdcIcon scale={scale} />;
case AirDAODictTypes.Code.Tether:
case AirDAODictTypes.Code.Tether.toLowerCase():
case 'tether usd':
return <TetherIcon scale={scale} />;
case AirDAODictTypes.Code.GanymedePoolToken.toLowerCase():
case 'ganymede pool token':
return <GanymedeIcon scale={scale} />;
case AirDAODictTypes.Code.PlutusPoolToken.toLowerCase():
case 'plutus pool token':
return <PlutusIcon scale={scale} />;
case AirDAODictTypes.Code.HeraPoolToken.toLowerCase():
case 'hera pool token':
return <HeraPoolIcon scale={scale} />;
case AirDAODictTypes.Code.FirepotLp.toLowerCase():
case 'firepot-lp-token':
return <FirepotIcon scale={scale} />;
case AirDAODictTypes.Code.Bond.toLowerCase():
case 'airbond':
return <AirBondIcon scale={scale} />;
default:
Expand Down
9 changes: 8 additions & 1 deletion src/hooks/query/useTokensAndTransactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,20 @@ export function useTokensAndTransactions(
return false;
});

const txMap = new Map<string, boolean>();
const transactions =
data && data.pages
? (data.pages
.map((page) =>
page.data.transactions.map((t) => {
const transaction = new Transaction(t);
transaction.isSent = t.from === address;
/**
* When user sends from account to the same account we receive 2 transactions with the same transaction hash.
* */
const isTransactionDuplicate = txMap.get(transaction.hash);
transaction.isSent =
t.from === address && !isTransactionDuplicate;
txMap.set(transaction.hash, true);
return transaction;
})
)
Expand Down
10 changes: 1 addition & 9 deletions src/lib/crypto/TransferDispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,7 @@ class TransferDispatcher {
) {
// @ts-ignore
const tokenContract = new this.web3.eth.Contract(erc20.ERC20, tokenAddress);
let decimals = 18;
try {
decimals = await tokenContract.methods.decimals().call();
} catch (error) {
// ignore
}
const amountInBaseUnits = this.web3.utils
.toBN(parseFloat(amountInEther) * Math.pow(10, decimals))
.toString();
const amountInBaseUnits = this.web3.utils.toWei(amountInEther);
return {
to: tokenAddress,
data: tokenContract.methods
Expand Down
15 changes: 2 additions & 13 deletions src/localization/locales/English.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,22 +162,11 @@
"asset.your.balance": "Your balance",

"transaction.modal": {
"amount": "Amount",
"buttons": {
"explorer": "View on Explorer",
"share": "Share",
"confirm": "Ok, got it"
"share": "Share"
},
"completed": "Completed",
"date": "Date",
"estimated.fee": "Estimated fee",
"from": "From",
"recipient": "Recipient",
"sending": "Transaction in progress",
"sending.to": "Sending to",
"sent": "Sent",
"status": "Status",
"title": "You will receive a notification when the transaction is complete"
"estimated.fee": "Estimated fee"
},

"receive.funds": "Receive funds",
Expand Down
22 changes: 5 additions & 17 deletions src/localization/locales/Turkish.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"common.address.with.count": "{{count}} adres",
"common.address.with.count_plural": "{{count}} adres",
"common.copied": "Kopyalandı!",
"common.copy": "Panoya kopyalandı",
"common.copy": "Panoya kopyala",
"common.date": "Tarih",
"common.done": "Tamamlandı",
"common.field.required": "Zorunlu alan",
Expand All @@ -115,11 +115,11 @@
"common.transaction": "İşlem",
"common.transaction.amount": "Miktar",
"common.transaction.details": "İşlem detayları",
"common.transaction.from": "Buradan",
"common.transaction.from": "Gönderen",
"common.transaction.received": "Alındı",
"common.transaction.sent": "Gönderildi",
"common.transaction.status.SUCCESS": "Tamamlandı",
"common.transaction.to": "Buraya",
"common.transaction.to": "Alan",
"common.transaction_plural": "İşlem",
"common.transactions": "İşlemler",
"common.yesterday": "Dün",
Expand Down Expand Up @@ -162,22 +162,10 @@
"asset.your.balance": "Bakiyeniz",

"transaction.modal": {
"amount": "Miktar",
"buttons": {
"explorer": "Gezginde görüntüle",
"share": "Paylaş",
"confirm": "Anladım"
},
"completed": "Tamamlandı",
"date": "Tarih",
"estimated.fee": "Tahmini ücret",
"from": "Kimden",
"recipient": "Kime",
"sending": "İşlem devam ediyor",
"sending.to": "Gönderiliyor",
"sent": "Gönderildi",
"status": "Durum",
"title": "İşleminiz gerçekleştiğinde bildirim alacaksınız"
"share": "Paylaş"
}
},

"receive.funds": "Varlık al",
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const SettingsScreen = () => {
<View style={styles.innerContainer}>
{SETTINGS_MENU_ITEMS.map(renderMenu)}
</View>
{isStage && <Text style={{ margin: 20 }}>Build: 1.1.5.19</Text>}
{isStage && <Text style={{ margin: 20 }}>Build: 1.1.5.20</Text>}
</View>
);
};

0 comments on commit e72cb9f

Please sign in to comment.