From f2cd368a491fd868b063e4023bba1dc2b395b387 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 30 May 2017 10:42:39 +0200 Subject: Add TokenMetadata type --- src/contract_wrappers/token_registry_wrapper.ts | 4 ++-- src/types.ts | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/contract_wrappers/token_registry_wrapper.ts b/src/contract_wrappers/token_registry_wrapper.ts index 431b0303d..8dd79171e 100644 --- a/src/contract_wrappers/token_registry_wrapper.ts +++ b/src/contract_wrappers/token_registry_wrapper.ts @@ -1,6 +1,6 @@ import * as _ from 'lodash'; import {Web3Wrapper} from '../web3_wrapper'; -import {Token, TokenRegistryContract} from '../types'; +import {Token, TokenRegistryContract, TokenMetadata} from '../types'; import {assert} from '../utils/assert'; import {ContractWrapper} from './contract_wrapper'; import * as TokenRegistryArtifacts from '../artifacts/TokenRegistry.json'; @@ -14,7 +14,7 @@ export class TokenRegistryWrapper extends ContractWrapper { const tokenRegistryContract = contractInstance as TokenRegistryContract; const addresses = await tokenRegistryContract.getTokenAddresses.call(); - const tokenMetadataPromises: Array> = _.map( + const tokenMetadataPromises: Array> = _.map( addresses, (address: string) => (tokenRegistryContract.getTokenMetaData.call(address)), ); diff --git a/src/types.ts b/src/types.ts index 273389480..57ffcd44b 100644 --- a/src/types.ts +++ b/src/types.ts @@ -41,6 +41,9 @@ export const SolidityTypes = strEnum([ ]); export type SolidityTypes = keyof typeof SolidityTypes; +// [address, name, symbol, projectUrl, decimals, ipfsHash, swarmHash] +export type TokenMetadata = [string, string, string, string, BigNumber.BigNumber, string, string]; + export interface Token { name: string; address: string; -- cgit