Skip to content
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
3 changes: 3 additions & 0 deletions libs/remix-ui/run-tab/src/lib/actions/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ export const delegationAuthorization = async (contractAddress: string, plugin: R
}

export const createSmartAccount = async (plugin: RunTab, dispatch: React.Dispatch<any>) => {
plugin.call('notification', 'toast', `Preparing tx to sign...`)
const { chainId } = plugin.REACT_API
const chain = chains[aaSupportedNetworks[chainId].name]
const PUBLIC_NODE_URL = aaSupportedNetworks[chainId].publicNodeUrl
Expand Down Expand Up @@ -254,6 +255,7 @@ export const createSmartAccount = async (plugin: RunTab, dispatch: React.Dispatc
value: 0
}]
})
plugin.call('notification', 'toast', `Waiting for tx confirmation, can take 5-10 seconds...`)
await saClient.waitForUserOperationReceipt({ hash: useropHash })

// To verify creation, check if there is a contract code at this address
Expand All @@ -270,6 +272,7 @@ export const createSmartAccount = async (plugin: RunTab, dispatch: React.Dispatc
const smartAccountsObj = JSON.parse(smartAccountsStr)
smartAccountsObj[chainId] = plugin.REACT_API.smartAccounts
localStorage.setItem(aaLocalStorageKey, JSON.stringify(smartAccountsObj))
await fillAccountsList(plugin, dispatch)
_paq.push(['trackEvent', 'udapp', 'safeSmartAccount', 'createdSuccessfully'])
return plugin.call('notification', 'toast', `Safe account ${safeAccount.address} created for owner ${account}`)
} catch (error) {
Expand Down
1 change: 0 additions & 1 deletion libs/remix-ui/run-tab/src/lib/components/account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ export function AccountUI(props: AccountProps) {
() => {
_paq.push(['trackEvent', 'udapp', 'safeSmartAccount', 'createClicked'])
props.createNewSmartAccount()
_paq.push(['trackEvent', 'udapp', 'safeSmartAccount', 'create'])
},
intl.formatMessage({ id: 'udapp.cancel' }),
() => {
Expand Down