Skip to content

Commit

Permalink
more logs and try with web3fromSource
Browse files Browse the repository at this point in the history
  • Loading branch information
clangenb committed Oct 4, 2024
1 parent 9a70414 commit 1d9f356
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1653,6 +1653,7 @@ const fetchIncogniteeBalance = async () => {
const injector = accountStore.isInjected ? accountStore.injected : null
console.log(`fetching incognitee balance: injector ${JSON.stringify(injector)}}`);
console.log(`fetching incognitee balance: injector ${JSON.stringify(injector?.signer)}}`);
incogniteeStore.api
.getBalanceGetter(accountStore.account, incogniteeStore.shard, injector?.signer)
Expand Down Expand Up @@ -1712,7 +1713,7 @@ const copyOwnAddressToClipboard = () => {
),
);
};
import { web3Accounts, web3Enable, web3FromAddress } from '@polkadot/extension-dapp';
import {web3Accounts, web3Enable, web3FromAddress, web3FromSource} from '@polkadot/extension-dapp';
let allInjected;
let allAccounts;
Expand Down Expand Up @@ -1744,6 +1745,7 @@ onMounted(async () => {
accountStore.setAccount(injectedAddress.toString());
const injected = await web3FromAddress(accountStore.getAddress)
console.log(`setting injected: ${JSON.stringify(injected)}`)
console.log(`setting injected: ${JSON.stringify(injected.signer)}`)
accountStore.setInjected(injected);
} else {
console.log("no seed found in url. Will try to inject from extensions");
Expand All @@ -1757,15 +1759,16 @@ onMounted(async () => {
allAccounts = await web3Accounts();
console.log(`All webAccounts: ${JSON.stringify(allAccounts)}`);
const firstAddress = allAccounts[0].address;
const firstAddress = allAccounts[1].address;
console.log(`first address: ${firstAddress}`)
accountStore.setAccount(firstAddress);
const injected = await web3FromAddress(accountStore.getAddress)
console.log(`setting injected: ${injected}`)
const injector = await web3FromSource(allAccounts[1].meta.source);
console.log(`setting injected: ${JSON.stringify(injector)}`)
console.log(`setting injected: ${JSON.stringify(injector.signer)}`)
accountStore.setInjected(injected);
accountStore.setInjected(injector);
cryptoWaitReady().then(() => {
console.log(`First injected address: ${firstAddress}`);
Expand Down

0 comments on commit 1d9f356

Please sign in to comment.