Skip to content

Commit

Permalink
Aztec
Browse files Browse the repository at this point in the history
  • Loading branch information
dmihal committed Sep 6, 2021
1 parent b307f63 commit d8c226a
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 5 deletions.
13 changes: 8 additions & 5 deletions components/Flags.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
import React from 'react';
import { Info } from 'react-feather';
import incognito from './icons/incognito.svg';
import speedometer from './icons/speedometer.svg';

const SpeedometerIcon: React.FC = () => (
<div className="speedometer">
const makeIcon = (image: string) => (): React.FC => (
<div className="icon">
<style jsx>{`
.speedometer {
background: url('${speedometer}');
.icon {
background: url('${image}');
height: 18px;
width: 18px;
margin-right: 2px;
flex: 0 0 18px;
background-size: contain;
}
`}</style>
</div>
);

const icons: { [id: string]: React.ComponentType } = {
throtle: SpeedometerIcon,
throtle: makeIcon(speedometer),
info: Info,
private: makeIcon(incognito),
}

interface FlagsProps {
Expand Down
3 changes: 3 additions & 0 deletions components/icons/incognito.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions data/adapters/aztec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Context } from '@cryptostats/sdk';

export function setup(sdk: Context) {
const getFeeForTransfer = async () => {
const feeData = await sdk.http.get('https://api.aztec.network/falafel-mainnet/status');

return feeData.txFees[1].baseFeeQuotes[0].fee / 1e18;
}

sdk.register({
id: 'aztec',
queries: {
feeTransferEth: getFeeForTransfer,
feeTransferERC20: getFeeForTransfer,
},
metadata: {
icon: sdk.ipfs.getDataURILoader('QmaaYiAtFKGPeHRR629yQqkDAqzcpywfbEjun5KmhE6QH1', 'image/svg+xml'),
category: 'l2',
name: 'Aztec Protocol',
description: 'Hermez is an open-source ZK-Rollup that provides both scalable and private token transfers.',
l2BeatSlug: 'aztec',
website: 'https://aztec.network',
flags: {
private: 'Transactions on Aztec are private.',
},
},
});
}
2 changes: 2 additions & 0 deletions data/adapters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import sdk from '../sdk';

import { setup as setupEthereum } from './ethereum';
import { setup as setupArbitrum } from './arbitrum';
import { setup as setupAztec } from './aztec';
import { setup as setupHermez } from './hermez';
import { setup as setupLoopring } from './loopring';
import { setup as setupOptimism } from './optimism';
Expand All @@ -11,6 +12,7 @@ const feesList = sdk.getList('fees');

feesList.addAdaptersWithSetupFunction(setupEthereum);
feesList.addAdaptersWithSetupFunction(setupArbitrum);
feesList.addAdaptersWithSetupFunction(setupAztec)
feesList.addAdaptersWithSetupFunction(setupHermez);
feesList.addAdaptersWithSetupFunction(setupLoopring)
feesList.addAdaptersWithSetupFunction(setupOptimism);
Expand Down

0 comments on commit d8c226a

Please sign in to comment.