monero: price fetch, fix atomicToXmr, add balance chart from tx history
This commit is contained in:
@@ -186,6 +186,7 @@ export type MoneroRpcRequests = {
|
||||
moneroCreateSubaddress: { params: { accountIndex: number; label?: string }; response: { index: number; address: string } }
|
||||
moneroGetTransferDetails: { params: { txid: string }; response: MoneroTransferDetails | null }
|
||||
moneroGetFeeEstimate: { params: {}; response: MoneroFeeEstimate | null }
|
||||
fetchMoneroPrice: { params: {}; response: { usd: string } | null }
|
||||
}
|
||||
|
||||
export type RPC = {
|
||||
|
||||
@@ -17,8 +17,8 @@ export const moneroNetwork = {
|
||||
|
||||
export const atomicToXmr = (atomic: string): string => {
|
||||
const n = BigInt(atomic)
|
||||
const whole = n / 10_000_000_000_000n
|
||||
const frac = (n % 10_000_000_000_000n)
|
||||
const whole = n / 1_000_000_000_000n
|
||||
const frac = (n % 1_000_000_000_000n)
|
||||
.toString()
|
||||
.padStart(12, '0')
|
||||
.replace(/0+$/, '')
|
||||
|
||||
Reference in New Issue
Block a user