Convert the nym into unym
This commit is contained in:
parent
08af9ba20d
commit
acf0d1fc17
@ -82,6 +82,10 @@ export const useWebViewHandler = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
const unymAmount = chainSpecs.chainId === 'nyx'
|
||||||
|
? Math.round(parseFloat(amount) * 1_000_000).toString()
|
||||||
|
: amount;
|
||||||
|
|
||||||
// Get all accounts
|
// Get all accounts
|
||||||
const chainAccounts = await retrieveAccountsForNetwork(
|
const chainAccounts = await retrieveAccountsForNetwork(
|
||||||
`${chainSpecs.namespace}:${chainSpecs.chainId}`,
|
`${chainSpecs.namespace}:${chainSpecs.chainId}`,
|
||||||
@ -96,10 +100,9 @@ export const useWebViewHandler = () => {
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const chainAccount = chainAccounts[0]; // Use the first account
|
const chainAccount = chainAccounts[0]; // Use the first account
|
||||||
|
|
||||||
const path = `/transfer/${chainSpecs.namespace}/${chainSpecs.chainId}/${chainAccount.address}/${to}/${amount}`;
|
const path = `/transfer/${chainSpecs.namespace}/${chainSpecs.chainId}/${chainAccount.address}/${to}/${unymAmount}`;
|
||||||
|
|
||||||
navigation.reset({
|
navigation.reset({
|
||||||
index: 0,
|
index: 0,
|
||||||
@ -113,7 +116,7 @@ export const useWebViewHandler = () => {
|
|||||||
transaction: {
|
transaction: {
|
||||||
from: chainAccount.address,
|
from: chainAccount.address,
|
||||||
to: to,
|
to: to,
|
||||||
value: amount,
|
value: unymAmount,
|
||||||
data: ''
|
data: ''
|
||||||
},
|
},
|
||||||
accountInfo: chainAccount,
|
accountInfo: chainAccount,
|
||||||
|
Loading…
Reference in New Issue
Block a user