Compare commits

...

3 Commits

Author SHA1 Message Date
Adw8
8ff441a794 Add event listener for iframe message 2024-11-06 16:18:45 +05:30
b94fd22c76 Add laconicd testnet-2 as default network (#17)
Part of [Service provider auctions for web deployments](https://www.notion.so/Service-provider-auctions-for-web-deployments-104a6b22d47280dbad51d28aa3a91d75)

Co-authored-by: Shreerang Kale <shreerangkale@gmail.com>
Reviewed-on: cerc-io/laconic-wallet-web#17
2024-10-28 12:13:13 +00:00
657c39e5ed Add config for wallet connect verify code (#16)
Part of [Service provider auctions for web deployments](https://www.notion.so/Service-provider-auctions-for-web-deployments-104a6b22d47280dbad51d28aa3a91d75)

Reviewed-on: cerc-io/laconic-wallet-web#16
Co-authored-by: Nabarun <nabarun@deepstacksoft.com>
Co-committed-by: Nabarun <nabarun@deepstacksoft.com>
2024-10-25 13:50:11 +00:00
7 changed files with 59 additions and 5 deletions

View File

@ -2,4 +2,4 @@ REACT_APP_WALLET_CONNECT_PROJECT_ID=
REACT_APP_DEFAULT_GAS_PRICE=0.025 REACT_APP_DEFAULT_GAS_PRICE=0.025
# Reference: https://github.com/cosmos/cosmos-sdk/issues/16020 # Reference: https://github.com/cosmos/cosmos-sdk/issues/16020
REACT_APP_GAS_ADJUSTMENT=2 REACT_APP_GAS_ADJUSTMENT=2
REACT_APP_LACONICD_RPC_URL=https://laconicd.laconic.com REACT_APP_LACONICD_RPC_URL=https://laconicd-sapo.laconic.com

View File

@ -18,6 +18,35 @@ import { createTheme, ThemeProvider } from "@mui/material";
globalThis.Buffer = Buffer; globalThis.Buffer = Buffer;
window.addEventListener('message', (event: MessageEvent) => {
if (event.origin !== 'http://localhost:3001') return;
if (event.data.type === 'REQUEST_LOCAL_STORAGE') {
try {
const data = localStorage.getItem('accounts/cosmos:laconic-testnet-2/0');
if (!data) {
event.source?.postMessage({
type: 'ERROR',
message: 'Data not found in local storage'
});
return;
}
(event.source as Window)?.postMessage({
type: 'LOCAL_STORAGE_DATA',
data
}, 'http://localhost:3001');
} catch (error) {
(event.source as Window)?.postMessage({
type: 'ERROR',
message: 'Error accessing local storage'
}, 'http://localhost:3001');
}
}
});
const linking = { const linking = {
prefixes: ["https://wallet.laconic.com"], prefixes: ["https://wallet.laconic.com"],
}; };

View File

@ -288,7 +288,7 @@ const styles = StyleSheet.create({
fontSize: 18, fontSize: 18,
fontWeight: "bold", fontWeight: "bold",
marginBottom: 3, marginBottom: 3,
color: "black", color: "white",
}, },
dataBox: { dataBox: {
borderWidth: 1, borderWidth: 1,

View File

@ -5,17 +5,29 @@ export const EIP155 = 'eip155';
export const COSMOS = 'cosmos'; export const COSMOS = 'cosmos';
export const DEFAULT_NETWORKS = [ export const DEFAULT_NETWORKS = [
{ {
chainId: 'laconic_9000-1', chainId: 'laconic-testnet-2',
networkName: 'laconicd', networkName: 'laconicd testnet-2',
namespace: COSMOS, namespace: COSMOS,
rpcUrl: process.env.REACT_APP_LACONICD_RPC_URL!, rpcUrl: process.env.REACT_APP_LACONICD_RPC_URL!,
blockExplorerUrl: '', blockExplorerUrl: '',
nativeDenom: 'alnt', nativeDenom: 'alnt',
addressPrefix: 'laconic', addressPrefix: 'laconic',
coinType: '118', coinType: '118',
gasPrice: '1', gasPrice: '0.001',
isDefault: true, isDefault: true,
}, },
{
chainId: 'laconic_9000-1',
networkName: 'laconicd',
namespace: COSMOS,
rpcUrl: "https://laconicd.laconic.com",
blockExplorerUrl: '',
nativeDenom: 'alnt',
addressPrefix: 'laconic',
coinType: '118',
gasPrice: '1',
isDefault: false,
},
{ {
chainId: '1', chainId: '1',
networkName: EIP155_CHAINS['eip155:1'].name, networkName: EIP155_CHAINS['eip155:1'].name,

View File

@ -6,6 +6,7 @@ services:
environment: environment:
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG} CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
WALLET_CONNECT_ID: ${WALLET_CONNECT_ID} WALLET_CONNECT_ID: ${WALLET_CONNECT_ID}
WALLET_CONNECT_VERIFY_CODE: ${WALLET_CONNECT_VERIFY_CODE}
CERC_DEFAULT_GAS_PRICE: ${CERC_DEFAULT_GAS_PRICE:-0.025} CERC_DEFAULT_GAS_PRICE: ${CERC_DEFAULT_GAS_PRICE:-0.025}
CERC_GAS_ADJUSTMENT: ${CERC_GAS_ADJUSTMENT:-2} CERC_GAS_ADJUSTMENT: ${CERC_GAS_ADJUSTMENT:-2}
CERC_LACONICD_RPC_URL: ${CERC_LACONICD_RPC_URL:-https://laconicd.laconic.com} CERC_LACONICD_RPC_URL: ${CERC_LACONICD_RPC_URL:-https://laconicd.laconic.com}

View File

@ -18,4 +18,13 @@ REACT_APP_GAS_ADJUSTMENT=$CERC_GAS_ADJUSTMENT \
REACT_APP_LACONICD_RPC_URL=$CERC_LACONICD_RPC_URL \ REACT_APP_LACONICD_RPC_URL=$CERC_LACONICD_RPC_URL \
yarn build yarn build
# Define the directory and file path
FILE_PATH="/app/build/.well-known/walletconnect.txt"
# Create the directory if it doesn't exist
mkdir -p "$(dirname "$FILE_PATH")"
# Write verification code to the file
echo "$WALLET_CONNECT_VERIFY_CODE" > "$FILE_PATH"
# Serve build dir
http-server --proxy http://localhost:80? -p 80 /app/build http-server --proxy http://localhost:80? -p 80 /app/build

View File

@ -51,6 +51,9 @@ Instructions for running the `laconic-wallet-web` using [laconic-so](https://git
# Optional # Optional
# WalletConnect code for hostname verification
WALLET_CONNECT_VERIFY_CODE=
# Default gas price for txs (default: 0.025) # Default gas price for txs (default: 0.025)
CERC_DEFAULT_GAS_PRICE= CERC_DEFAULT_GAS_PRICE=