Compare commits

...

4 Commits

3 changed files with 8 additions and 3 deletions

View File

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

View File

@ -23,7 +23,11 @@ const useGetOrCreateAccounts = () => {
accountsData = await getAccountsData(event.data.chainId); 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); window.addEventListener('message', handleCreateAccounts);
@ -31,7 +35,7 @@ const useGetOrCreateAccounts = () => {
return () => { return () => {
window.removeEventListener('message', handleCreateAccounts); window.removeEventListener('message', handleCreateAccounts);
}; };
}, [networksData, getAccountsData ]); }, [networksData, getAccountsData]);
}; };
export default useGetOrCreateAccounts; export default useGetOrCreateAccounts;

View File

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