Sub-Adapters 1
Preview and test each sub adapter.
Aztec Network (aztec-network)
Metadata
- ID
- aztec-network
- icon
- category
"l2"
- name
"Aztec Network"
- description
"Aztec is an open source layer 2 network that aims to bring scalability and privacy to Ethereum based on ZK-SNARKS."
- l2BeatSlug
"aztec"
- website
"https://aztec.network/"
Queries
Adapter Code
Check the entire code written for the Adapter.
Source code
Showing TS source.
1export const name = 'Aztec Protocol Transaction Fees';
2export const version = '0.2.1';
3export const license = 'MIT';
4export const changelog = 'adding aztec logo';
5
6const aztec_status_url = 'https://api.aztec.network/falafel-mainnet/status'
7enum AssetId {
8 ETH,
9 DAI,
10 renBTC
11};
12
13enum TxType {
14 DEPOSIT,
15 TRANSFER,
16 WITHDRAW_TO_WALLET,
17 WITHDAW_TO_CONTRACT,
18 ACCOUNT
19};
20
21export function setup(sdk: Context) {
22 const getFeeTransferEth = async () => {
23 const response = await sdk.http.get(aztec_status_url);
24 const ethPrice = await sdk.coinGecko.getCurrentPrice('ethereum');
25 return response.txFees[AssetId.ETH].feeConstants[TxType.TRANSFER] / 1e18 * ethPrice;
26 };
27 const getFeeTransferERC20 = async () => {
28 const response = await sdk.http.get(aztec_status_url);
29 const daiPrice = await sdk.coinGecko.getCurrentPrice('dai');
30 return response.txFees[AssetId.DAI].feeConstants[TxType.TRANSFER] / 1e18 * daiPrice;
31 };
32
33 sdk.register({
34 id: 'aztec-network',
35 queries: {
36 feeTransferEth: getFeeTransferEth,
37 feeTransferERC20: getFeeTransferERC20,
38 // feeSwap: getFeeForSwap,
39 },
40 metadata: {
41 icon: sdk.ipfs.getDataURILoader('QmaaYiAtFKGPeHRR629yQqkDAqzcpywfbEjun5KmhE6QH1', 'image/svg+xml'),
42 category: 'l2',
43 name: 'Aztec Network',
44 description: 'Aztec is an open source layer 2 network that aims to bring scalability and privacy to Ethereum based on ZK-SNARKS.',
45 l2BeatSlug: 'aztec',
46 website: 'https://aztec.network/',
47 },
48 });
49}
It's something off?
Report it to the discussion board on Discord, we will take care of it.