Compare commits

...

4 Commits

3 changed files with 8 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "web-wallet",
"version": "0.1.2",
"version": "0.1.3",
"private": true,
"dependencies": {
"@cerc-io/registry-sdk": "^0.2.5",

View File

@ -23,7 +23,11 @@ const useGetOrCreateAccounts = () => {
accountsData = await getAccountsData(event.data.chainId);
}
sendMessage(event.source as Window, 'WALLET_ACCOUNTS_DATA', accountsData, event.origin);
sendMessage(
event.source as Window, 'WALLET_ACCOUNTS_DATA',
accountsData.map(account => account.address),
event.origin
);
};
window.addEventListener('message', handleCreateAccounts);
@ -31,7 +35,7 @@ const useGetOrCreateAccounts = () => {
return () => {
window.removeEventListener('message', handleCreateAccounts);
};
}, [networksData, getAccountsData ]);
}, [networksData, getAccountsData]);
};
export default useGetOrCreateAccounts;

View File

@ -88,6 +88,7 @@ export const WalletEmbed = () => {
throw new Error('Requested network not supported.');
}
console.log({ network, fromAddress, chainId, toAddress, amount });
const account = await retrieveSingleAccount(network.namespace, network.chainId, fromAddress);
if (!account) {
throw new Error('Account not found for the requested address.');