Compare commits
4 Commits
main
...
ng-debug-a
| Author | SHA1 | Date | |
|---|---|---|---|
| 1f9842f1d5 | |||
| 5c0162fcb4 | |||
| 24bae4d811 | |||
| 86b9e379c9 |
@ -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",
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -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.');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user