-
Notifications
You must be signed in to change notification settings - Fork 430
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into timestamps-events
- Loading branch information
Showing
5 changed files
with
320 additions
and
195 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Wallet } from "@/types/enums"; | ||
import type { Keplr } from "@keplr-wallet/types"; | ||
|
||
export function getWalletFromType(wallet: string): Keplr { | ||
switch (wallet) { | ||
case Wallet.Keplr: | ||
return window.keplr; | ||
case Wallet.Cosmostation: | ||
return window.cosmostation.providers.keplr; | ||
case Wallet.Leap: | ||
return window.leap; | ||
default: | ||
throw new Error("Wallet not supported"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,32 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Get Google Maps API key from .env file (trim double quotes) | ||
# Get Google Maps API key, Rollbar access token and environment from .env file (trim double quotes) | ||
GOOGLE_MAPS_API_KEY=$(grep GOOGLE_MAPS_API_KEY .env | cut -d '=' -f2 | sed 's/"//g') | ||
ROLLBAR_ACCESS_TOKEN=$(grep ROLLBAR_ACCESS_TOKEN .env | cut -d '=' -f2 | sed 's/"//g') | ||
ENVIRONMENT=$(grep ENVIRONMENT .env | cut -d '=' -f2 | sed 's/"//g') | ||
|
||
# Replace $KEY in src/mappings/mappingHandlers.ts with Google Maps API key | ||
# Replace $GOOGLE_MAPS_API_KEY, $ROLLBAR_ACCESS_TOKEN and $ENVIRONMENT in src/mappings/mappingHandlers.ts | ||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then | ||
sed -i "s/\$KEY/$GOOGLE_MAPS_API_KEY/g" ./src/mappings/mappingHandlers.ts | ||
sed -i "s/\$GOOGLE_MAPS_API_KEY/$GOOGLE_MAPS_API_KEY/g" ./src/mappings/mappingHandlers.ts | ||
sed -i "s/\$ROLLBAR_ACCESS_TOKEN/$ROLLBAR_ACCESS_TOKEN/g" ./src/mappings/mappingHandlers.ts | ||
sed -i "s/\$ENVIRONMENT/$ENVIRONMENT/g" ./src/mappings/mappingHandlers.ts | ||
elif [[ "$OSTYPE" == "darwin"* ]]; then | ||
sed -i '' "s/\$KEY/$GOOGLE_MAPS_API_KEY/g" ./src/mappings/mappingHandlers.ts | ||
sed -i '' "s/\$GOOGLE_MAPS_API_KEY/$GOOGLE_MAPS_API_KEY/g" ./src/mappings/mappingHandlers.ts | ||
sed -i '' "s/\$ROLLBAR_ACCESS_TOKEN/$ROLLBAR_ACCESS_TOKEN/g" ./src/mappings/mappingHandlers.ts | ||
sed -i '' "s/\$ENVIRONMENT/$ENVIRONMENT/g" ./src/mappings/mappingHandlers.ts | ||
fi | ||
|
||
# Build project | ||
subql build | ||
|
||
# Restore original mappingHandlers.ts | ||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then | ||
sed -i "s/$GOOGLE_MAPS_API_KEY/\$KEY/g" ./src/mappings/mappingHandlers.ts | ||
sed -i "s/$GOOGLE_MAPS_API_KEY/\$GOOGLE_MAPS_API_KEY/g" ./src/mappings/mappingHandlers.ts | ||
sed -i "s/$ROLLBAR_ACCESS_TOKEN/\$ROLLBAR_ACCESS_TOKEN/g" ./src/mappings/mappingHandlers.ts | ||
sed -i "s/$ENVIRONMENT/\$ENVIRONMENT/g" ./src/mappings/mappingHandlers.ts | ||
elif [[ "$OSTYPE" == "darwin"* ]]; then | ||
sed -i '' "s/$GOOGLE_MAPS_API_KEY/\$KEY/g" ./src/mappings/mappingHandlers.ts | ||
sed -i '' "s/$GOOGLE_MAPS_API_KEY/\$GOOGLE_MAPS_API_KEY/g" ./src/mappings/mappingHandlers.ts | ||
sed -i '' "s/$ROLLBAR_ACCESS_TOKEN/\$ROLLBAR_ACCESS_TOKEN/g" ./src/mappings/mappingHandlers.ts | ||
sed -i '' "s/$ENVIRONMENT/\$ENVIRONMENT/g" ./src/mappings/mappingHandlers.ts | ||
fi |
Oops, something went wrong.