Skip to content
This repository has been archived by the owner on May 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #56 from rnsdomains/develop
Browse files Browse the repository at this point in the history
v1.4.1
  • Loading branch information
ilanolkies authored Mar 25, 2020
2 parents 764f991 + e97cae0 commit d3ba923
Show file tree
Hide file tree
Showing 12 changed files with 98 additions and 199 deletions.
152 changes: 7 additions & 145 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rsksmart/rns",
"version": "1.4.0",
"version": "1.4.1",
"description": "RIF Name Service library.",
"keywords": [
"rsk",
Expand Down Expand Up @@ -37,6 +37,7 @@
"js-sha3": "^0.8.0",
"rskjs-util": "^1.0.3",
"web3": "^1.2.5",
"web3-eth": "^1.2.6",
"web3-eth-contract": "^1.2.6",
"web3-utils": "^1.2.6"
},
Expand Down
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Web3 from 'web3';
import { TransactionReceipt } from 'web3-eth';
import {
RNS, Contracts, Options, ChainId, Utils,
} from './types';
Expand Down Expand Up @@ -77,7 +78,7 @@ export = class extends Composer implements RNS {
* @param domain - Domain to set resolution
* @param addr - Address to be set as the resolution of the given domain
*/
setAddr(domain: string, addr: string): Promise<void> {
setAddr(domain: string, addr: string): Promise<TransactionReceipt> {
return this._resolutions.setAddr(domain, addr);
}

Expand All @@ -92,7 +93,7 @@ export = class extends Composer implements RNS {
* @param domain - Domain to set resolver
* @param resolver - Address to be set as the resolver of the given domain
*/
setResolver(domain: string, resolver: string): Promise<void> {
setResolver(domain: string, resolver: string): Promise<TransactionReceipt> {
return this._resolutions.setResolver(domain, resolver);
}

Expand Down
9 changes: 5 additions & 4 deletions src/resolutions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Web3 from 'web3';
import { Contract } from 'web3-eth-contract';
import { TransactionReceipt } from 'web3-eth';
import { createAddrResolver, createChainAddrResolver, createNameResolver } from './factories';
import {
ZERO_ADDRESS, ADDR_INTERFACE, ERC165_INTERFACE,
Expand Down Expand Up @@ -157,7 +158,7 @@ export default class extends Composer implements Resolutions {
* @param domain - Domain to set resolution
* @param addr - Address to be set as the resolution of the given domain
*/
async setAddr(domain: string, addr: string): Promise<void> {
async setAddr(domain: string, addr: string): Promise<TransactionReceipt> {
await this.compose();

if (!await hasAccounts(this.web3)) {
Expand All @@ -177,7 +178,7 @@ export default class extends Composer implements Resolutions {

const accounts = await this.web3.eth.getAccounts();

await resolver
return resolver
.methods
.setAddr(
node,
Expand All @@ -196,7 +197,7 @@ export default class extends Composer implements Resolutions {
* @param domain - Domain to set resolver
* @param resolver - Address to be set as the resolver of the given domain
*/
async setResolver(domain: string, resolver: string): Promise<void> {
async setResolver(domain: string, resolver: string): Promise<TransactionReceipt> {
await this.compose();

if (!await hasAccounts(this.web3)) {
Expand All @@ -214,7 +215,7 @@ export default class extends Composer implements Resolutions {

const accounts = await this.web3.eth.getAccounts();

await this._contracts.registry
return this._contracts.registry
.methods
.setResolver(node, resolver)
.send({ from: accounts[0] });
Expand Down
Loading

0 comments on commit d3ba923

Please sign in to comment.