@@ -11,7 +11,7 @@ import { union, compact } from 'lodash';
1111import { Context } from './Context' ;
1212import { getInjectedProvider } from './browserUtils' ;
1313import { ErrorCode , TransactionSpeed } from './types' ;
14- import { Erc20TokenBalance , SecurityToken } from './entities' ;
14+ import { Erc20TokenBalance , SecurityToken , Wallet } from './entities' ;
1515import { ReserveSecurityToken } from './procedures' ;
1616import { PolymathError } from './PolymathError' ;
1717import { PolymathBase } from './PolymathBase' ;
@@ -280,40 +280,14 @@ export class Polymath {
280280 } ;
281281
282282 /**
283- * Get the balance of ETH in a wallet
283+ * Retrieve a Wallet by address
284284 *
285- * @param walletAddress wallet to check for balance
285+ * @param address wallet address
286286 */
287- public getEthBalance = async ( args : { walletAddress : string } ) => {
288- const { walletAddress } = args ;
289-
290- return this . context . contractWrappers . getBalance ( { address : walletAddress } ) ;
291- } ;
292-
293- /**
294- * Get the balance of a specific ERC20 token in a wallet
295- *
296- * @param tokenAddress address of the ERC20 token
297- * @param walletAddress wallet to check for balance
298- */
299- public getErc20TokenBalance = async (
300- args :
301- | {
302- tokenAddress : string ;
303- walletAddress : string ;
304- }
305- | string
306- ) => {
307- let uid : string ;
308-
309- // fetch by UUID
310- if ( typeof args === 'string' ) {
311- uid = args ;
312- } else {
313- uid = Erc20TokenBalance . generateId ( args ) ;
314- }
287+ public getWallet = ( args : { address : string } ) : Wallet => {
288+ const { address } = args ;
315289
316- return this . context . factories . erc20TokenBalanceFactory . fetch ( uid ) ;
290+ return new Wallet ( { address } , this . context ) ;
317291 } ;
318292
319293 /**
0 commit comments