Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
]
},
"dependencies": {
"@gnosis.pm/safe-apps-sdk": "4.3.0-next.2",
"@gnosis.pm/safe-apps-sdk": "6.1.0",
"@gnosis.pm/safe-apps-sdk-v1": "npm:@gnosis.pm/safe-apps-sdk@0.4.2",
"@gnosis.pm/safe-core-sdk": "^0.3.1",
"@gnosis.pm/safe-deployments": "^1.2.0",
Expand Down
21 changes: 20 additions & 1 deletion src/routes/safe/components/Apps/components/AppFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ import { INTERFACE_MESSAGES, Transaction, LowercaseNetworks } from '@gnosis.pm/s
import Web3 from 'web3'

import { currentSafe } from 'src/logic/safe/store/selectors'
import { getNetworkName, getSafeAppsRpcServiceUrl, getTxServiceUrl } from 'src/config'
import {
getNetworkName,
getSafeAppsRpcServiceUrl,
getTxServiceUrl,
getShortChainNameById,
getNetworkInfo,
} from 'src/config'
import { isSameURL } from 'src/utils/url'
import { useAnalytics, SAFE_EVENTS } from 'src/utils/googleAnalytics'
import { LoadingContainer } from 'src/components/LoaderContainer/index'
Expand Down Expand Up @@ -235,6 +241,19 @@ const AppFrame = ({ appUrl }: Props): ReactElement => {

openSignMessageModal(message, msg.data.id)
})

communicator?.on(Methods.getChainInfo, async () => {
const { nativeCoin } = getNetworkInfo()
const chainId = parseInt(networkId, 10)
const network = getNetworkName()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iamacook in your chains PR, do these functions still exist?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current issues regarding using Redux likely affect every change I have made so far, so I can take the opportunity to start again with these changes included.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are aware of that and we are planning to change this in @iamacook PR. Once this one is unblocked we will push this changed to his PR

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @iamacook has a selector or something that we can use

Copy link
Contributor

@iamacook iamacook Nov 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this gets merged prior, it would be a lot easier for me to handle. Either way, I'll be happy to help fix any merge conflicts.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we are going to merge this tomorrow or on monday at the latest I think


return {
chainName: network,
chainId,
shortName: getShortChainNameById(networkId),
nativeCurrency: nativeCoin,
}
})
}, [communicator, openConfirmationModal, safeAddress, owners, threshold, openSignMessageModal, networkId])

const onUserTxConfirm = (safeTxHash: string, requestId: RequestId) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RequestId, calculateMessageHash } from '@gnosis.pm/safe-apps-sdk'
import { RequestId } from '@gnosis.pm/safe-apps-sdk'
import { ReactElement } from 'react'

import { getWeb3ReadOnly } from 'src/logic/wallets/getWeb3'
Expand Down Expand Up @@ -44,7 +44,7 @@ export const SignMessageModal = ({ message, isOpen, ...rest }: SignMessageModalP
const web3 = getWeb3ReadOnly()
const txRecipient = getSignMessageLibAddress(networkId) || ZERO_ADDRESS
const txData = getSignMessageLibContractInstance(web3, networkId)
.methods.signMessage(calculateMessageHash(message))
.methods.signMessage(web3.eth.accounts.hashMessage(message))
.encodeABI()

const readableData = convertToHumanReadableMessage(message)
Expand Down
20 changes: 14 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2127,13 +2127,14 @@
resolved "https://registry.yarnpkg.com/@gnosis.pm/safe-apps-sdk/-/safe-apps-sdk-3.0.0.tgz#0f90185c3693f2683322d275e796e61ff99ce87d"
integrity sha512-dLCSlniYnxEqCglx4XdhByvi7KKuSYRWJKm1lVXAc4oJqwwVkoCwp0bFIejLZ/dnf7cQSBUUVsTGWhvSda511w==

"@gnosis.pm/safe-apps-sdk@4.3.0-next.2":
version "4.3.0-next.2"
resolved "https://registry.yarnpkg.com/@gnosis.pm/safe-apps-sdk/-/safe-apps-sdk-4.3.0-next.2.tgz#90cd433c3183cee0f6cb4de5e5337e24f884caf6"
integrity sha512-1bNVRh2K5NP0sRj1URU4z6mF4chyeCGdr871yXqLLOv99zBrFQgDv8gBnSzva3hzth46YBb+zSAFGQHkmcpH0Q==
"@gnosis.pm/safe-apps-sdk@6.1.0":
version "6.1.0"
resolved "https://registry.yarnpkg.com/@gnosis.pm/safe-apps-sdk/-/safe-apps-sdk-6.1.0.tgz#b1b07504ed43d034e0b94c7fe274e908d62988a8"
integrity sha512-2NEd1CKoHTSkiQfdw8GJXtc/GfWogNHpRGeRmM2X1kvzlqIAheEhefM4BtyP/Nwo95/vvfwePi3ANuc6S6aUKQ==
dependencies:
"@changesets/cli" "^2.16.0"
ethers "^5.4.5"
"@gnosis.pm/safe-react-gateway-sdk" "^2.5.6"
ethers "^5.4.7"

"@gnosis.pm/safe-core-sdk-types@^0.1.1":
version "0.1.1"
Expand Down Expand Up @@ -2167,6 +2168,13 @@
dependencies:
isomorphic-unfetch "^3.1.0"

"@gnosis.pm/safe-react-gateway-sdk@^2.5.6":
version "2.5.6"
resolved "https://registry.yarnpkg.com/@gnosis.pm/safe-react-gateway-sdk/-/safe-react-gateway-sdk-2.5.6.tgz#7b8713bb16a542c4af27d6e1f2d8925a21aaeb51"
integrity sha512-flM/i80oFwSRlW0U8HE7QurwwPpNTUjBv7gZNAjgOpGhub51r7Uf1LtSm89Mnxnh2mtj4Whl8ZC4RMoXdV3yvw==
dependencies:
isomorphic-unfetch "^3.1.0"

"@hapi/address@2.x.x":
version "2.1.4"
resolved "https://registry.yarnpkg.com/@hapi/address/-/address-2.1.4.tgz#5d67ed43f3fd41a69d4b9ff7b56e7c0d1d0a81e5"
Expand Down Expand Up @@ -10210,7 +10218,7 @@ ethers@4.0.47:
uuid "2.0.1"
xmlhttprequest "1.8.0"

ethers@^5.0.13, ethers@^5.0.31, ethers@^5.4.5, ethers@^5.4.7:
ethers@^5.0.13, ethers@^5.0.31, ethers@^5.4.7:
version "5.5.1"
resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.5.1.tgz#d3259a95a42557844aa543906c537106c0406fbf"
integrity sha512-RodEvUFZI+EmFcE6bwkuJqpCYHazdzeR1nMzg+YWQSmQEsNtfl1KHGfp/FWZYl48bI/g7cgBeP2IlPthjiVngw==
Expand Down