File tree Expand file tree Collapse file tree
components/@molecules/TransactionDialogManager/stage Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ import {
2626import { getReadableError } from '@app/utils/errors'
2727import { createAccessList } from '@app/utils/query/createAccessList'
2828import { wagmiConfig } from '@app/utils/query/wagmi'
29- import { connectorIsMetaMask , hasParaConnection } from '@app/utils/utils'
29+ import { connectorIsMetaMask , connectorIsPhantom , hasParaConnection } from '@app/utils/utils'
3030
3131export const getUniqueTransaction = ( {
3232 txKey,
@@ -213,6 +213,8 @@ export const createTransactionRequestUnsafe = async ({
213213
214214 if ( connectorIsMetaMask ( connections , connectorClient ) ) {
215215 ; ( request as any ) . __is_metamask = true
216+ } else if ( connectorIsPhantom ( connections , connectorClient ) ) {
217+ request . accessList = request . accessList ?. map ( ( v ) => [ v . address , v . storageKeys ] ) as any
216218 }
217219
218220 return {
Original file line number Diff line number Diff line change @@ -243,3 +243,14 @@ export const connectorIsMetaMask = (
243243 connection . accounts . some ( ( a ) => a === connectorClient . account . address ) ,
244244 )
245245}
246+
247+ export const connectorIsPhantom = (
248+ connections : Connection [ ] ,
249+ connectorClient : ConnectorClientWithEns ,
250+ ) => {
251+ return connections ?. some (
252+ ( connection ) =>
253+ connection ?. connector ?. id === 'app.phantom' &&
254+ connection . accounts . some ( ( a ) => a === connectorClient . account . address ) ,
255+ )
256+ }
You can’t perform that action at this time.
0 commit comments