(tokenAddress: Address)
| 34 | |
| 35 | // Helper for hardcoded tokens |
| 36 | static fromAddress(tokenAddress: Address): StaticToken | null { |
| 37 | let staticDefinitions = this.getStaticTokens(); |
| 38 | let tokenAddressHex = tokenAddress.toHexString(); |
| 39 | |
| 40 | // Search the definition using the address |
| 41 | for (let i = 0; i < staticDefinitions.length; i++) { |
| 42 | let staticDefinition = staticDefinitions[i]; |
| 43 | if (staticDefinition.address.toHexString() == tokenAddressHex) { |
| 44 | return staticDefinition; |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | // If not found, return null |
| 49 | return null; |
| 50 | } |
| 51 | } |
no test coverage detected