Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix enable #456

Merged
merged 2 commits into from
Dec 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rns-manager-react",
"version": "2.1.8",
"version": "2.1.9",
"private": true,
"license": "MIT",
"homepage": ".",
Expand Down
6 changes: 3 additions & 3 deletions src/app/auth/operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const saveDomainToLocalStorage = async (domain) => {
storedDomains[process.env.REACT_APP_ENVIRONMENT] = [];
}

const accounts = await window.rLogin.enable();
const accounts = await window.rLogin.request({ method: 'eth_accounts' });
const newDomain = {
domain,
owner: accounts[0],
Expand Down Expand Up @@ -175,7 +175,7 @@ const startWithRLogin = callback => (dispatch) => {

dispatch(requestEnable());

window.rLogin.enable()
window.rLogin.request({ method: 'eth_accounts' })
.then((accounts) => {
window.rLogin.request({ method: 'eth_chainId' })
.then(chainId => parseInt(chainId))
Expand Down Expand Up @@ -244,6 +244,6 @@ export const start = (callback, callbackError) => (dispatch) => {
};

export const autoLogin = domain => async (dispatch) => {
const accounts = await window.rLogin.enable();
const accounts = await window.rLogin.request({ method: 'eth_accounts' });
dispatch(authenticate(domain, accounts[0]));
};
6 changes: 3 additions & 3 deletions src/app/tabs/newAdmin/addresses/operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const getIndexById = chainId => networks.find(net => net.id === chainId).
* @param {address} address to resolve to
*/
const setPublicAddress = (domain, address, isNew) => async (dispatch) => {
const accounts = await window.rLogin.enable();
const accounts = await window.rLogin.request({ method: 'eth_accounts' });
const currentAddress = accounts[0];
const hash = namehash(domain);

Expand Down Expand Up @@ -85,7 +85,7 @@ const setMultiChainAddress = (domain, chainId, address, isNew) => async (dispatc
const chainName = getChainNameById(chainId);
dispatch(requestSetChainAddress(chainName));

const accounts = await window.rLogin.enable();
const accounts = await window.rLogin.request({ method: 'eth_accounts' });
const currentAddress = accounts[0];
const hash = namehash(domain);

Expand Down Expand Up @@ -146,7 +146,7 @@ const setDefinitiveAddress = (domain, chainId, address, isNew) => async (dispatc
dispatch(requestSetChainAddress(chainName));

const chainIndex = getIndexById(chainId);
const accounts = await window.rLogin.enable();
const accounts = await window.rLogin.request({ method: 'eth_accounts' });
const currentAddress = accounts[0];

// encode value if it is not empty:
Expand Down
6 changes: 3 additions & 3 deletions src/app/tabs/newAdmin/domainInfo/operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const renewDomain = (domain, rifCost, duration) => async (dispatch) => {
const durationBN = new web3.utils.BN(duration);

const weiValue = rifCost * (10 ** 18);
const accounts = await window.rLogin.enable();
const accounts = await window.rLogin.request({ method: 'eth_accounts' });
const currentAddress = accounts[0];

const data = getRenewData(domain, durationBN);
Expand Down Expand Up @@ -223,7 +223,7 @@ export const setRegistryOwner = (domain, address, currentValue) => async (dispat
}

const label = namehash(domain);
const accounts = await window.rLogin.enable();
const accounts = await window.rLogin.request({ method: 'eth_accounts' });
const currentAddress = accounts[0].toLowerCase();

const web3 = new Web3(window.rLogin);
Expand Down Expand Up @@ -266,7 +266,7 @@ export const reclaimDomain = domain => async (dispatch) => {
dispatch(requestReclaimDomain(domain));

const label = `0x${sha3(domain.split('.')[0])}`;
const accounts = await window.rLogin.enable();
const accounts = await window.rLogin.request({ method: 'eth_accounts' });
const currentAddress = accounts[0].toLowerCase();
const web3 = new Web3(window.rLogin);
const rskOwner = new web3.eth.Contract(
Expand Down
4 changes: 2 additions & 2 deletions src/app/tabs/newAdmin/operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { getDomainResolver } from './resolver/operations';
export const checkIfTokenOwner = domain => async (dispatch) => {
const label = domain.split('.')[0];

const accounts = await window.rLogin.enable();
const accounts = await window.rLogin.request({ method: 'eth_accounts' });
const currentAddress = accounts[0];

dispatch(requestCheckTokenOwner());
Expand Down Expand Up @@ -61,7 +61,7 @@ export const checkIfTokenOwner = domain => async (dispatch) => {
*/
export const checkIfRegistryOwner = domain => async (dispatch) => {
const label = namehash(domain);
const accounts = await window.rLogin.enable();
const accounts = await window.rLogin.request({ method: 'eth_accounts' });
const currentAddress = accounts[0];

const web3 = new Web3(window.rLogin);
Expand Down
8 changes: 4 additions & 4 deletions src/app/tabs/newAdmin/resolver/operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export const setDomainResolver = (domain, resolverAddress) => async (dispatch) =
dispatch(requestSetResolver());
const lowerResolverAddress = resolverAddress.toLowerCase();

const accounts = await window.rLogin.enable();
const accounts = await window.rLogin.request({ method: 'eth_accounts' });
const currentAddress = accounts[0];
const hash = namehash(domain);

Expand Down Expand Up @@ -295,7 +295,7 @@ const setContentBytes = (resolverAddress, domain, input) => async (dispatch) =>
resolverAbi, resolverAddress, { gasPrice: defaultGasPrice },
);

const accounts = await window.rLogin.enable();
const accounts = await window.rLogin.request({ method: 'eth_accounts' });
const currentAddress = accounts[0];
const method = resolver.methods.setContent(namehash(domain), value);

Expand Down Expand Up @@ -407,7 +407,7 @@ const setContractAbi = (resolverAddress, domain, value) => async (dispatch) => {
}

// make the multicall
const accounts = await window.rLogin.enable();
const accounts = await window.rLogin.request({ method: 'eth_accounts' });
const currentAddress = accounts[0];
return definitiveResolver.methods.multicall(multiCallMethods)
.send({ from: currentAddress }, (e, result) => {
Expand Down Expand Up @@ -461,7 +461,7 @@ export const setDomainResolverAndMigrate = (
domain, chainAddresses, contentBytes, understandWarning,
) => async (dispatch) => {
dispatch(requestMigrateAddresses());
const accounts = await window.rLogin.enable();
const accounts = await window.rLogin.request({ method: 'eth_accounts' });
const currentAddress = accounts[0];
const hash = namehash(domain);

Expand Down
2 changes: 1 addition & 1 deletion src/app/tabs/newAdmin/reverse/operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const getReverse = address => (dispatch) => {
* @param {string} value value to be set
*/
export const setReverse = value => async (dispatch) => {
const accounts = await window.rLogin.enable();
const accounts = await window.rLogin.request({ method: 'eth_accounts' });
const currentAddress = accounts[0];

dispatch(requestSetReverseResolver());
Expand Down
2 changes: 1 addition & 1 deletion src/app/tabs/newAdmin/subdomains/operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export const setSubdomainOwner = (
return;
}

const accounts = await window.rLogin.enable();
const accounts = await window.rLogin.request({ method: 'eth_accounts' });
const currentAddress = accounts[0];
const label = `0x${sha3(subdomain)}`;
const node = namehash(parentDomain);
Expand Down
6 changes: 3 additions & 3 deletions src/app/tabs/registrar/operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const commit = (domain, duration, rifCost, setupAddr) => async (dispatch)
const strSalt = Array.from(randomBytes).map(byte => byte.toString(16)).join('');
const salt = `0x${strSalt.padEnd(64, '0')}`;

const accounts = await window.rLogin.enable();
const accounts = await window.rLogin.request({ method: 'eth_accounts' });
const currentAddress = accounts[0];

const web3 = new Web3(window.rLogin);
Expand Down Expand Up @@ -187,7 +187,7 @@ export const checkIfAlreadyCommitted = domain => async (dispatch) => {

dispatch(requestCheckCommitRegistrar());

const accounts = await window.rLogin.enable();
const accounts = await window.rLogin.request({ method: 'eth_accounts' });
const currentAddress = accounts[0];

const abi = (contract === FIFS_ADDR_REGISTRER) ? fifsAddrRegistrarAbi : fifsRegistrarAbi;
Expand Down Expand Up @@ -226,7 +226,7 @@ export const revealCommit = domain => async (dispatch) => {

const web3 = new Web3(window.rLogin);
const weiValue = rifCost * (10 ** 18);
const accounts = await window.rLogin.enable();
const accounts = await window.rLogin.request({ method: 'eth_accounts' });
const currentAddress = accounts[0];
const durationBN = new web3.utils.BN(duration);

Expand Down