Created
May 29, 2023 17:37
-
-
Save drewstone/b09de22a27441c7948f90bf078a9fd7b to your computer and use it in GitHub Desktop.
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
Here is a TypeScript API class for the specified queries: | |
```typescript | |
interface Bridge { | |
bridgeId: string; | |
network: string; | |
} | |
interface TransactionData { | |
amount: string; | |
depositing: string; | |
destination: string; | |
time: string; | |
txHash: string; | |
} | |
class BlockchainGraphAPI { | |
async getTVL(bridges: Bridge[]): Promise<string> { /* implementation */ } | |
async getTVLforBridge(bridge: Bridge): Promise<string> { /* implementation */ } | |
async getTVLforBridgeSide(bridge: Bridge): Promise<string> { /* implementation */ } | |
async getTVLforSetOfBridgesSide(bridges: Bridge[], network: string): Promise<string> { /* implementation */ } | |
async getTVLforTokenOnBridge(token: string, bridge: Bridge): Promise<string> { /* implementation */ } | |
async getTVLforTokenOnBridgeSide(token: string, bridge: Bridge): Promise<string> { /* implementation */ } | |
async getTotalVolume24hr(bridges: Bridge[]): Promise<string> { /* implementation */ } | |
async getTotalVolume24hrForBridge(bridge: Bridge): Promise<string> { /* implementation */ } | |
async getTotalVolume24hrForBridgeSide(bridge: Bridge): Promise<string> { /* implementation */ } | |
async getTotalVolume24hrForAllBridgesSide(bridges: Bridge[], network: string): Promise<string> { /* implementation */ } | |
async getTotalVolume24hrForTokenOnBridge(token: string, bridge: Bridge): Promise<string> { /* implementation */ } | |
async getTotalVolume24hrForTokenOnBridgeSide(token: string, bridge: Bridge): Promise<string> { /* implementation */ } | |
async getTotalFees(bridges: Bridge[]): Promise<string> { /* implementation */ } | |
async getTotalFeesForBridge(bridge: Bridge): Promise<string> { /* implementation */ } | |
async getTotalFeesForBridgeSide(bridge: Bridge): Promise<string> { /* implementation */ } | |
async getTotalFeesForAllBridgesSide(bridges: Bridge[], network: string): Promise<string> { /* implementation */ } | |
async getTotalFeesForTokenOnBridge(token: string, bridge: Bridge): Promise<string> { /* implementation */ } | |
async getTotalFeesForTokenOnBridgeSide(token: string, bridge: Bridge): Promise<string> { /* implementation */ } | |
async getTokenComposition(bridges: Bridge[]): Promise<Map<string, string>> { /* implementation */ } | |
async getTokenCompositionForBridge(bridge: Bridge): Promise<Map<string, string>> { /* implementation */ } | |
async getTokenCompositionForBridgeSide(bridge: Bridge): Promise<Map<string, string>> { /* implementation */ } | |
async getTokenCompositionForAllBridgesSide(bridges: Bridge[], network: string): Promise<Map<string, string>> { /* implementation */ } | |
async getNumberOfDeposits(bridges: Bridge[]): Promise<number> { /* implementation */ } | |
async getNumberOfDepositsForBridge(bridge: Bridge): Promise<number> { /* implementation */ } | |
async getNumberOfDepositsForBridgeSide(bridge: Bridge): Promise<number> { /* implementation */ } | |
async getNumberOfDepositsForAllBridgesSide(bridges: Bridge[], network: string): Promise<number> { /* implementation */ } | |
async getAverageDepositAmount(bridges: Bridge[]): Promise<string> { /* implementation */ } | |
async getAverageDepositAmountForBridge(bridge: Bridge): Promise<string> { /* implementation */ } | |
async getAverageDepositAmountForBridgeSide(bridge: Bridge): Promise<string> { /* implementation */ } | |
async getAverageDepositAmountForAllBridgesSide(bridges: Bridge[], network: string): Promise<string> { /* implementation */ } | |
async getDepositTransactionData(bridges: Bridge[]): Promise<TransactionData[]> { /* implementation */ } | |
async getDepositTransactionDataForBridge(bridge: Bridge): Promise<TransactionData[]> { /* implementation */ } | |
async getDepositTransactionDataForBridgeSide(bridge: Bridge): Promise<TransactionData[]> { /* implementation */ } | |
async getWithdrawTransactionData(bridges: Bridge[]): Promise<TransactionData[]> { /* implementation */ } | |
async getWithdrawTransactionDataForBridge(bridge: Bridge): Promise<TransactionData[]> { /* implementation */ } | |
async getWithdrawTransactionDataForBridgeSide(bridge: Bridge): Promise<TransactionData[]> { /* implementation */ } | |
async getTransferTransactionData(bridges: Bridge[]): Promise<TransactionData[]> { /* implementation */ } | |
async getTransferTransactionDataForBridge(bridge: Bridge): Promise<TransactionData[]> { /* implementation */ } | |
async getTransferTransactionDataForBridgeSide(bridge: Bridge): Promise<TransactionData[]> { /* implementation */ } | |
} | |
``` | |
This TypeScript API class defines the required methods to handle all specified queries. Please note that the class methods have the `/* implementation */` comment as a placeholder |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is a TypeScript API class for the specified queries:
This TypeScript API class defines the required methods to handle all specified queries. Please note that the class methods have the
/* implementation */
comment as a placeholder