-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(data): new l1 subgraph now correctly formats numbers (#88)
- Loading branch information
Showing
36 changed files
with
220 additions
and
332 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
export const dailyBurnedMock = { | ||
response: { | ||
id: '1627446407', | ||
value: '5954277455094130661333214', | ||
totalDebt: '5954277455094130661333214', | ||
value: '5954277.455094130661333214', | ||
totalDebt: '5954277.455094130661333214', | ||
}, | ||
formatted: { | ||
id: '1627446407', | ||
value: '5954277.455094130661333214', | ||
totalDebt: '5954277.455094130661333214', | ||
value: 5954277.455094130661333214, | ||
totalDebt: 5954277.455094130661333214, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
export const dailyIssuedMock = { | ||
response: { | ||
id: '1627446407', | ||
value: '5954277455094130661333214', | ||
totalDebt: '5954277455094130661333214', | ||
value: '5954277.455094130661333214', | ||
totalDebt: '5954277.455094130661333214', | ||
}, | ||
formatted: { | ||
id: '1627446407', | ||
value: '5954277.455094130661333214', | ||
totalDebt: '5954277.455094130661333214', | ||
value: 5954277.455094130661333214, | ||
totalDebt: 5954277.455094130661333214, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
export const snxHolderMock = { | ||
response: { | ||
balanceOf: '68069683028764', | ||
balanceOf: '0.000068069683028764', | ||
block: '10108119', | ||
claims: null, | ||
collateral: '68069683028764', | ||
debtEntryAtIndex: '1000000000000000000000000000', | ||
claims: '5', | ||
collateral: '0.000068069683028764', | ||
debtEntryAtIndex: '22152845382348635959243347', | ||
id: '0x0000000000000000000000000000000000000001', | ||
initialDebtOwnership: '0', | ||
mints: null, | ||
mints: '6', | ||
timestamp: '1590049259', | ||
transferable: '68069683028764', | ||
transferable: '0.000068069683028764', | ||
}, | ||
formatted: { | ||
balanceOf: '0.000068069683028764', | ||
balanceOf: 0.000068069683028764, | ||
block: 10108119, | ||
claims: null, | ||
collateral: '0.000068069683028764', | ||
debtEntryAtIndex: '1000000000.0', | ||
claims: 5, | ||
collateral: 0.000068069683028764, | ||
debtEntryAtIndex: '22152845382348635959243347', | ||
id: '0x0000000000000000000000000000000000000001', | ||
initialDebtOwnership: '0.0', | ||
mints: null, | ||
initialDebtOwnership: 0, | ||
mints: 6, | ||
timestamp: 1590049259000, | ||
transferable: '0.000068069683028764', | ||
transferable: 0.000068069683028764, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,6 @@ export const snxPriceMock = { | |
}, | ||
formatted: { | ||
id: '18712', | ||
averagePrice: '16.48', | ||
averagePrice: 16.48, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,39 @@ | ||
export const synthExchangesMockL1 = { | ||
export const synthExchangesMock = { | ||
response: { | ||
account: '0x60d4f28f407121bca015d47cdc9b9b4546b5a9c7', | ||
block: '12116438', | ||
feesInUSD: '747549034706154047462', | ||
feesInUSD: '747.549034706154047462', | ||
from: '0x0eb59acd1f0b73970e5b2fd095bf373ce569e4a9', | ||
fromAmount: '249183011568718006275302', | ||
fromAmountInUSD: '249183011568718006275302', | ||
fromAmount: '249183.011568718006275302', | ||
fromAmountInUSD: '249183.011568718006275302', | ||
fromCurrencyKey: '0x7355534400000000000000000000000000000000000000000000000000000000', | ||
fromSynth: 'sUSD', | ||
gasPrice: '142100000000', | ||
id: '0x5771afba4755d73e1becf5b58640b48b999b01ac267c4d39334916ee90285088-232', | ||
timestamp: '1616785448', | ||
toAddress: '0x60d4f28f407121bca015d47cdc9b9b4546b5a9c7', | ||
toAmount: '4628088422134899435', | ||
toAmountInUSD: '248435462534011852227840', | ||
toAmount: '4.628088422134899435', | ||
toAmountInUSD: '248435.46253401185222784', | ||
toCurrencyKey: '0x7342544300000000000000000000000000000000000000000000000000000000', | ||
toSynth: 'sBTC', | ||
}, | ||
formatted: { | ||
account: '0x60d4f28f407121bca015d47cdc9b9b4546b5a9c7', | ||
block: 12116438, | ||
feesInUSD: '747.549034706154047462', | ||
feesInUSD: 747.549034706154047462, | ||
from: '0x0eb59acd1f0b73970e5b2fd095bf373ce569e4a9', | ||
fromAmount: '249183.011568718006275302', | ||
fromAmountInUSD: '249183.011568718006275302', | ||
fromAmount: 249183.011568718006275302, | ||
fromAmountInUSD: 249183.011568718006275302, | ||
fromCurrencyKey: 'sUSD', | ||
fromSynth: 'sUSD', | ||
gasPrice: '142100000000', | ||
gasPrice: 142100000000, | ||
id: '0x5771afba4755d73e1becf5b58640b48b999b01ac267c4d39334916ee90285088-232', | ||
timestamp: 1616785448000, | ||
toAddress: '0x60d4f28f407121bca015d47cdc9b9b4546b5a9c7', | ||
toAmount: '4.628088422134899435', | ||
toAmountInUSD: '248435.46253401185222784', | ||
toAmount: 4.628088422134899435, | ||
toAmountInUSD: 248435.46253401185222784, | ||
toCurrencyKey: 'sBTC', | ||
toSynth: 'sBTC', | ||
hash: '0x5771afba4755d73e1becf5b58640b48b999b01ac267c4d39334916ee90285088', | ||
}, | ||
}; | ||
|
||
export const synthExchangesMockL2 = { | ||
response: { | ||
...synthExchangesMockL1.response, | ||
fromAmount: '249183.011568718006275302', | ||
toAmount: '4.628088422134899435', | ||
fromAmountInUSD: '249183.011568718006275302', | ||
toAmountInUSD: '248435.462534011852227840', | ||
feesInUSD: '747.549034706154047462', | ||
}, | ||
formatted: { | ||
...synthExchangesMockL1.formatted, | ||
fromAmount: '249183.011568718006275302', | ||
toAmount: '4.628088422134899435', | ||
fromAmountInUSD: '249183.01', | ||
toAmountInUSD: '248435.46', | ||
feesInUSD: '747.55', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
import { DailyBurned } from '../../generated/graphql'; | ||
import { formatEther } from '../../src/utils'; | ||
|
||
export const parseDailyBurned = ({ id, value, totalDebt }: DailyBurned): DailyBurned => ({ | ||
id, | ||
value: formatEther(value), | ||
totalDebt: formatEther(totalDebt), | ||
value: Number(value), | ||
totalDebt: Number(totalDebt), | ||
}); |
Oops, something went wrong.