import { Signer } from 'redspot/provider/signer' ; import Contract from '@redspot/patract/contract' ; export type Account = Signer | Contract | string ; export function isSigner ( account ) { return account instanceof Signer ; } export function isContract ( account ) { return account instanceof Contract ; } export function isAddress ( account ) { return typeof account === 'string' ; } export async function getAddressOf ( account ) { if ( isSigner ( account ) ) { return account . address ; } else if ( isContract ( account ) ) { return account . signer ; } else if ( isAddress ( account ) ) { return account ; } throw new TypeError ( 'Could not get the address of the account' ) ; }