@@ -256,38 +256,18 @@ export function EthereumProvider(props: EthereumProviderProps) {
256256 if ( isNaN ( totalUsdsDeposited ) ) throw new Error ( 'Invalid totalUsdsDeposited' ) ;
257257
258258 const ethUsdFeed = new web3 . eth . Contract ( PRICE_FEED_ABI , ETH_CONTRACTS . ethUsdPriceFeed ) ;
259- // const daiUsdFeed = new web3.eth.Contract(PRICE_FEED_ABI, ETH_CONTRACTS.daiUsdPriceFeed);
260- // const usdUsdSFeed = new web3.eth.Contract(PRICE_FEED_ABI, ETH_CONTRACTS.usdsUsdPriceFeed);
261259
262260 const ethUsdPriceData = await ethUsdFeed . methods . latestRoundData ( ) . call ( ) ;
263- // const daiUsdPriceData = await daiUsdFeed.methods.latestRoundData().call();
264261
265262 const ethUsdPrice = ( ethUsdPriceData as any ) . answer / BigInt ( Math . pow ( 10 , 8 ) ) ;
266- // const daiUsdPrice = (daiUsdPriceData as any).answer / BigInt(Math.pow(10, 8));
267263 const daiUsdPrice = 1 ;
268264 const usdsUsdPrice = 1 ;
269265
270- // console.log('ethUsdPrice');
271- // console.log(ethUsdPrice);
272- // console.log('daiUsdPrice');
273- // console.log(daiUsdPrice);
274- // console.log('usdsUsdPrice')
275- // console.log(usdsUsdPrice)
276-
277266 const usdStEthValue = BigInt ( Math . floor ( totalStEthDeposited ) ) * BigInt ( ethUsdPrice ) ;
278267 const usdDaiValue = BigInt ( Math . floor ( totalDaiDeposited ) ) * BigInt ( daiUsdPrice ) ;
279268 const usdUsdsValue = BigInt ( Math . floor ( totalUsdsDeposited ) ) * BigInt ( usdsUsdPrice ) ;
280269 const usdTotal = usdStEthValue + usdDaiValue + usdUsdsValue ;
281270
282- // console.log('usdStEthValue')
283- // console.log(usdStEthValue)
284- // console.log('usdDaiValue')
285- // console.log(usdDaiValue)
286- // console.log('usdUsdsValue')
287- // console.log(usdUsdsValue)
288- // console.log('usdTotal')
289- // console.log(usdTotal)
290-
291271 setTotalDeposited ( {
292272 stEth : { value : totalStEthDeposited , display : formatDisplayAmount ( totalStEthDeposited , 2 ) } ,
293273 dai : { value : totalDaiDeposited , display : formatDisplayAmount ( totalDaiDeposited , 2 ) } ,
@@ -300,78 +280,6 @@ export function EthereumProvider(props: EthereumProviderProps) {
300280 } ) ( ) ;
301281 } , [ ] ) ;
302282
303- // async function sendMessage(msg, key) {
304- // function createDataItemSigner(wallet) {
305- // const signer = async ({ data, tags, target, anchor }) => {
306- // const dataItem = createData(data, key, { tags, target, anchor });
307- // return dataItem.sign(key).then(async () => ({
308- // id: await dataItem.id,
309- // raw: await dataItem.getRaw(),
310- // }));
311- // };
312-
313- // return signer;
314- // }
315-
316- // const signer = createDataItemSigner(key);
317- // const message = await connect().message({
318- // process: AO_MINT,
319- // signer,
320- // data: msg.Data || Date.now().toString(),
321- // tags: msg.Tags,
322- // });
323- // return await connect().result({ process: AO_MINT, message });
324- // }
325-
326- // const connector = config.connectors.find((c) => c.name === 'MetaMask');
327-
328- // const provider = {
329- // getSigner: () => ({
330- // signMessage: async (message: any) => {
331- // const arg = message instanceof String ? message : { raw: message };
332-
333- // const ethAccount = getAccount(config);
334-
335- // return await signMessage(config, {
336- // message: arg as any,
337- // account: ethAccount.address,
338- // connector: connector,
339- // });
340- // },
341- // }),
342- // };
343-
344- // const signer = new InjectedEthereumSigner(provider as any);
345- // signer.setPublicKey = async () => {
346- // const message = 'Sign this message to connect';
347- // const ethAccount = getAccount(config);
348-
349- // const signature = await signMessage(config, {
350- // message: message,
351- // account: ethAccount.address,
352- // connector: connector,
353- // });
354- // const hash = await hashMessage(message);
355- // const recoveredKey = await recoverPublicKey({
356- // hash,
357- // signature,
358- // });
359- // signer.publicKey = Buffer.from(toBytes(recoveredKey));
360- // };
361-
362- // React.useEffect(() => {
363- // (async function () {
364- // await signer.setPublicKey();
365- // const TResult = await sendMessage({
366- // Tags: [
367- // { name: 'Action', value: 'User.Get-Tokens' },
368- // // { name: 'Token', value: 'DAI' },
369- // ],
370- // }, signer);
371- // console.log('SendMessage Result:', TResult);
372- // })();
373- // }, []);
374-
375283 /* StETH - DAI Balance and Deposited */
376284 React . useEffect ( ( ) => {
377285 ( async function ( ) {
0 commit comments