function resolveAddress(target): string | Promise<string>

Resolves to an address for the target, which may be any supported address type, an Addressable or a Promise which resolves to an address.

Parameters

ParameterTypeDescription
targetAddressLikeThe target to resolve to an address.

Returns

string | Promise<string>

The resolved address.

Example

addr = '0x6B175474E89094C44Da98b954EedeAC495271d0F';

// Addresses are return synchronously
resolveAddress(addr, provider);

// Address promises are resolved asynchronously
resolveAddress(Promise.resolve(addr));

// Addressable objects are resolved asynchronously
contract = new Contract(addr, []);
resolveAddress(contract, provider);

Source

address/checks.ts:87