diff --git a/src/utils/staticTokenDefinition.ts b/src/utils/staticTokenDefinition.ts index 897b84cd..9b220eeb 100644 --- a/src/utils/staticTokenDefinition.ts +++ b/src/utils/staticTokenDefinition.ts @@ -1,37 +1,27 @@ -import { - Address, - BigInt, -} from "@graphprotocol/graph-ts" - +import { Address, BigInt } from '@graphprotocol/graph-ts' + // Initialize a Token Definition with the attributes export class StaticTokenDefinition { - address : Address + address: Address symbol: string name: string decimals: BigInt - // Initialize a Token Definition with its attributes - constructor(address: Address, symbol: string, name: string, decimals: BigInt) { - this.address = address - this.symbol = symbol - this.name = name - this.decimals = decimals - } - // Get all tokens with a static defintion static getStaticDefinitions(): Array { - return new Array(6) + const staticDefinitions: Array = [] + return staticDefinitions } // Helper for hardcoded tokens - static fromAddress(tokenAddress: Address) : StaticTokenDefinition | null { + static fromAddress(tokenAddress: Address): StaticTokenDefinition | null { const staticDefinitions = this.getStaticDefinitions() const tokenAddressHex = tokenAddress.toHexString() // Search the definition using the address for (let i = 0; i < staticDefinitions.length; i++) { const def = staticDefinitions[i] - if(def.address.toHexString() == tokenAddressHex) { + if (def.address.toHexString() == tokenAddressHex) { return def } } @@ -39,5 +29,4 @@ export class StaticTokenDefinition { // If not found, return null return null } - -} \ No newline at end of file +}