Skip to content

Commit 34f3e42

Browse files
1.29.0-0.4.3: [feature] Detail how to access Gnosis Safe Apps (#615)
* feat: detail how to access Gnosis Safe Apps * Update format/aesthetic * version bump Co-authored-by: Taylor Dawson <taylorjdawson@gmail.com>
1 parent 76658e6 commit 34f3e42

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bnc-onboard",
3-
"version": "1.29.0-0.4.2",
3+
"version": "1.29.0-0.4.3",
44
"description": "Onboard users to web3 by allowing them to select a wallet, get that wallet ready to transact and have access to synced wallet state.",
55
"keywords": [
66
"ethereum",

src/interfaces.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,13 @@ export interface LedgerOptions extends CommonWalletOptions {
251251
customNetwork?: HardwareWalletCustomNetwork
252252
}
253253

254+
export interface GnosisOptions extends CommonWalletOptions {
255+
// For default apps (cf. https://github.com/gnosis/safe-apps-list/issues/new/choose)
256+
appName?: string
257+
// For other apps, give the URL needed to add a custom app
258+
appUrl?: string
259+
}
260+
254261
//#region torus
255262

256263
interface VerifierStatus {

src/modules/select/wallets/gnosis.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type SafeAppsSDK from '@gnosis.pm/safe-apps-sdk'
22
import type { SafeInfo } from '@gnosis.pm/safe-apps-sdk'
3-
import { CommonWalletOptions, Helpers, WalletModule } from '../../../interfaces'
3+
import { GnosisOptions, Helpers, WalletModule } from '../../../interfaces'
44
import gnosisWalletIcon from '../wallet-icons/icon-gnosis'
55

66
const getSafe = (sdk: SafeAppsSDK): Promise<SafeInfo | undefined> =>
@@ -20,11 +20,16 @@ export const checkGnosisSafeContext = async (selectWallet: () => void) =>
2020
!!(await getSafe(new (await import('@gnosis.pm/safe-apps-sdk')).default())) &&
2121
selectWallet()
2222

23-
function gnosis(options: CommonWalletOptions): WalletModule {
23+
function gnosis(options: GnosisOptions): WalletModule {
2424
const { preferred, label, iconSrc, svg, networkId } = options
2525

2626
const network = networkId === 4 ? 'rinkeby.' : ''
2727
const link = `https://${network}gnosis-safe.io/app`
28+
const safeAppMessage = options.appName
29+
? `Then go to APPS and select <b>${options.appName}</b>.`
30+
: options.appUrl
31+
? `Then go to APPS and add a custom app with the URL:<br /><b>${options.appUrl}</b>`
32+
: ''
2833

2934
return {
3035
name: label || 'Gnosis Safe',
@@ -51,7 +56,8 @@ function gnosis(options: CommonWalletOptions): WalletModule {
5156
link,
5257
installMessage: () => `
5358
<p style="font-size: 0.889rem; font-family: inherit; margin: 0.889rem 0;">
54-
Click the button below to open the Gnosis Safe interface.
59+
Click the button below to open the Gnosis Safe interface.<br />
60+
${safeAppMessage}
5561
</p>
5662
`,
5763
desktop: true,

0 commit comments

Comments
 (0)