Skip to content

Commit

Permalink
chore: added prod misc file
Browse files Browse the repository at this point in the history
  • Loading branch information
ignaciosantise committed Sep 9, 2024
1 parent 91a55ed commit 6e43594
Show file tree
Hide file tree
Showing 10 changed files with 122 additions and 26 deletions.
11 changes: 7 additions & 4 deletions dapps/W3MWagmi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
"version": "0.0.1",
"private": true,
"scripts": {
"android": "./scripts/copy-variant-files.sh 'debug' && react-native run-android --appId com.walletconnect.web3modal.rnsample.debug",
"android:build": "cd android && ./gradlew clean && ./gradlew assembleRelease",
"android:build:internal": "./scripts/copy-variant-files.sh 'internal' && cd android && ./gradlew clean && ./gradlew assembleInternal",
"android": "yarn run copy:debug && react-native run-android --appId com.walletconnect.web3modal.rnsample.debug",
"android:build": "yarn run copy:production && cd android && ./gradlew clean && ./gradlew assembleRelease",
"android:build:internal": "yarn run copy:internal && cd android && ./gradlew clean && ./gradlew assembleInternal",
"ios": "react-native run-ios",
"ios:internal": "react-native run-ios --scheme 'W3MWagmi Internal' ",
"lint": "eslint .",
"start": "react-native start",
"test": "jest"
"test": "jest",
"copy:debug": "./scripts/copy-variant-files.sh 'debug'",
"copy:internal": "./scripts/copy-variant-files.sh 'internal'",
"copy:production": "./scripts/copy-variant-files.sh 'production'"
},
"dependencies": {
"@coinbase/wallet-mobile-sdk": "1.0.13",
Expand Down
8 changes: 6 additions & 2 deletions dapps/W3MWagmi/scripts/copy-variant-files.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#!/bin/bash

if [ "$1" == "debug" ]; then
cp scripts/misc_debug.ts src/utils/misc.ts
fi

if [ "$1" == "internal" ]; then
cp scripts/misc_internal.ts src/utils/misc.ts
fi

if [ "$1" == "debug" ]; then
cp scripts/misc_debug.ts src/utils/misc.ts
if [ "$1" == "production" ]; then
cp scripts/misc_prod.ts src/utils/misc.ts
fi
14 changes: 6 additions & 8 deletions dapps/W3MWagmi/scripts/misc_debug.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// If you are updating this file, please update src/utils/misc.ts as well

import {Platform} from 'react-native';

export const getMetadata = () => {
return {
name: 'AppKit + wagmi',
description: 'AppKit + wagmi',
name: 'AppKit + wagmi (debug)',
description: 'AppKit + wagmi (debug)',
url: 'https://walletconnect.com',
icons: ['https://github.com/avatars/u/37784886'],
redirect: {
Expand All @@ -19,20 +17,20 @@ export const getMetadata = () => {
export const getCustomWallets = () => {
const wallets = [
{
id: 'rn-wallet',
id: 'rn-wallet-debug',
name: 'Wallet (RN debug)',
image_url:
'https://docs.walletconnect.com/assets/images/web3walletLogo-54d3b546146931ceaf47a3500868a73a.png',
mobile_link: 'rn-web3wallet-debug://',
link_mode: 'https://lab.web3modal.com/rn_walletkit_debug',
link_mode: 'https://dev.lab.web3modal.com/rn_walletkit_debug',
},
{
id: 'rn-wallet',
id: 'rn-wallet-internal',
name: 'Wallet (RN internal)',
image_url:
'https://docs.walletconnect.com/assets/images/web3walletLogo-54d3b546146931ceaf47a3500868a73a.png',
mobile_link: 'rn-web3wallet-internal://',
link_mode: 'https://lab.web3modal.com/rn_walletkit_internal',
link_mode: 'https://dev.lab.web3modal.com/rn_walletkit_internal',
},
{
id: 'flutter-wallet-internal',
Expand Down
8 changes: 3 additions & 5 deletions dapps/W3MWagmi/scripts/misc_internal.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// If you are updating this file, please update src/utils/misc.ts as well

import {Platform} from 'react-native';

export const getMetadata = () => {
return {
name: 'AppKit + wagmi',
description: 'AppKit + wagmi',
name: 'AppKit + wagmi (internal)',
description: 'AppKit + wagmi (internal)',
url: 'https://walletconnect.com',
icons: ['https://github.com/avatars/u/37784886'],
redirect: {
Expand All @@ -19,7 +17,7 @@ export const getMetadata = () => {
export const getCustomWallets = () => {
const wallets = [
{
id: 'rn-wallet',
id: 'rn-wallet-internal',
name: 'Wallet (RN internal)',
image_url:
'https://docs.walletconnect.com/assets/images/web3walletLogo-54d3b546146931ceaf47a3500868a73a.png',
Expand Down
59 changes: 59 additions & 0 deletions dapps/W3MWagmi/scripts/misc_prod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import {Platform} from 'react-native';

export const getMetadata = () => {
return {
name: 'AppKit + wagmi',
description: 'AppKit + wagmi',
url: 'https://walletconnect.com',
icons: ['https://github.com/avatars/u/37784886'],
redirect: {
native: 'w3mwagmisample://',
universal: 'https://lab.web3modal.com/rn_appkit',
linkMode: true,
},
};
};

export const getCustomWallets = () => {
const wallets = [
{
id: 'rn-wallet',
name: 'Wallet(RN)',
image_url:
'https://docs.walletconnect.com/assets/images/web3walletLogo-54d3b546146931ceaf47a3500868a73a.png',
mobile_link: 'rn-web3wallet://',
link_mode: 'https://lab.web3modal.com/rn_walletkit',
},
{
id: 'flutter-wallet',
name: 'Wallet(Flutter)',
image_url:
'https://docs.walletconnect.com/assets/images/web3walletLogo-54d3b546146931ceaf47a3500868a73a.png',
mobile_link: 'wcflutterwallet://',
link_mode: undefined,
},
];

if (Platform.OS === 'android') {
wallets.push({
id: 'android-wallet',
name: 'Wallet(Android)',
image_url:
'https://docs.walletconnect.com/assets/images/web3walletLogo-54d3b546146931ceaf47a3500868a73a.png',
mobile_link: 'kotlin-web3wallet://',
link_mode:
'https://web3modal-laboratory-git-chore-kotlin-assetlinks-walletconnect1.vercel.app/wallet',
});
} else if (Platform.OS === 'ios') {
wallets.push({
id: 'ios-wallet',
name: 'Wallet(iOS)',
image_url:
'https://docs.walletconnect.com/assets/images/web3walletLogo-54d3b546146931ceaf47a3500868a73a.png',
mobile_link: 'walletapp://',
link_mode: 'https://lab.web3modal.com/wallet',
});
}

return wallets;
};
2 changes: 0 additions & 2 deletions dapps/W3MWagmi/src/utils/misc.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// If you are updating this file, please update scripts/misc_internal.ts as well

import {Platform} from 'react-native';

export const getMetadata = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,22 @@
</EnvironmentBuildable>
</ActionContent>
</ExecutionAction>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Copy misc file"
scriptText = "cp &quot;${PROJECT_DIR}/../scripts/misc_prod.ts&quot; &quot;${PROJECT_DIR}/../src/utils/misc.ts&quot;&#10;">
<EnvironmentBuildable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "RNWallet.app"
BlueprintName = "RNWallet"
ReferencedContainer = "container:RNWeb3Wallet.xcodeproj">
</BuildableReference>
</EnvironmentBuildable>
</ActionContent>
</ExecutionAction>
</PreActions>
<BuildActionEntries>
<BuildActionEntry
Expand Down
9 changes: 6 additions & 3 deletions wallets/rn_cli_wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"version": "0.0.2",
"private": true,
"scripts": {
"android": "./scripts/copy-variant-files.sh 'debug' && react-native run-android --mode=debug --appId com.walletconnect.web3wallet.rnsample.debug",
"android:build": "cd android && ./gradlew clean && ./gradlew assembleRelease",
"android:build:internal": "./scripts/copy-variant-files.sh 'internal' && cd android && ./gradlew clean && ./gradlew assembleInternal",
"android": "yarn run copy:debug && react-native run-android --mode=debug --appId com.walletconnect.web3wallet.rnsample.debug",
"android:build": "yarn run copy:production cd android && ./gradlew clean && ./gradlew assembleRelease",
"android:build:internal": "yarn run copy:internal && cd android && ./gradlew clean && ./gradlew assembleInternal",
"ios": "react-native run-ios --scheme 'RNWallet-Debug'",
"ios:internal": "react-native run-ios --scheme 'RNWallet-Internal'",
"bundle:ios": "react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios'",
Expand All @@ -15,6 +15,9 @@
"e2e": "maestro test ../../.maestro",
"e2e:studio": "maestro studio",
"e2e:upload": "maestro cloud ./android/app/build/outputs/apk/release/app-release.apk .maestro",
"copy:debug": "./scripts/copy-variant-files.sh 'debug'",
"copy:internal": "./scripts/copy-variant-files.sh 'internal'",
"copy:production": "./scripts/copy-variant-files.sh 'production'",
"postinstall": "patch-package"
},
"dependencies": {
Expand Down
8 changes: 6 additions & 2 deletions wallets/rn_cli_wallet/scripts/copy-variant-files.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#!/bin/bash

if [ "$1" == "debug" ]; then
cp scripts/misc_debug.ts src/utils/misc.ts
fi

if [ "$1" == "internal" ]; then
cp scripts/misc_internal.ts src/utils/misc.ts
fi

if [ "$1" == "debug" ]; then
cp scripts/misc_debug.ts src/utils/misc.ts
if [ "$1" == "production" ]; then
cp scripts/misc_prod.ts src/utils/misc.ts
fi
13 changes: 13 additions & 0 deletions wallets/rn_cli_wallet/scripts/misc_prod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export const getMetadata = () => {
return {
name: 'React Native Wallet Example',
description: 'React Native Wallet for WalletConnect',
url: 'https://walletconnect.com/',
icons: ['https://github.com/avatars/u/37784886'],
redirect: {
native: 'rn-web3wallet://',
universal: 'https://dev.lab.web3modal.com/rn_walletkit',
linkMode: true,
},
};
};

0 comments on commit 6e43594

Please sign in to comment.