web3-domain-resolver
Version:
Web3 Library that enable with just one function to resolve domains on multiple web3 providers such as ENS, UnstoppableDomains and Freename
30 lines (29 loc) • 856 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.ContractConnection = void 0;
const ethers_1 = require("ethers");
class ContractConnection {
constructor(connection, address, abi) {
this._connection = connection;
this._address = address;
this._provider = new ethers_1.ethers.providers.JsonRpcProvider(connection.rpcUrl);
this._abi = abi;
this._contract = new ethers_1.ethers.Contract(address, abi, this._provider);
}
get connection() {
return this._connection;
}
get address() {
return this._address;
}
get provider() {
return this._provider;
}
get contract() {
return this._contract;
}
get network() {
return this._connection.networkName;
}
}
exports.ContractConnection = ContractConnection;
;