Skip to content

Commit

Permalink
Merge pull request #64 from leapwallet/release-20240410-145055
Browse files Browse the repository at this point in the history
Release release-20240410-145055
  • Loading branch information
baryon2 authored Apr 10, 2024
2 parents e093fbc + e9fe6bb commit 180e959
Show file tree
Hide file tree
Showing 153 changed files with 4,770 additions and 804 deletions.
11 changes: 9 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# This is a comment.

# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in

# the repo. Unless a later match takes precedence,

# @global-owner1 and @global-owner2 will be requested for

# review when someone opens a pull request.
* @baryon2

- @baryon2

# The CODEOWNERS file restricts approval capabilities to a subset

# of contributors.
.github/CODEOWNERS @baryon2

.github/CODEOWNERS @baryon2
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ apps/extension/.env.production
apps/extension/.env.development
apps/extension/.env.production.compass
apps/extension/.env.development.compass
apps/extension/staging-builds
.zed
.zed
apps/extension/staging-builds
1 change: 0 additions & 1 deletion .yarnrc

This file was deleted.

2 changes: 1 addition & 1 deletion apps/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"dependencies": {
"@leapwallet/cosmos-wallet-hooks": "*",
"@leapwallet/cosmos-wallet-sdk": "*",
"@leapwallet/leap-ui": "0.1.9",
"@leapwallet/leap-ui": "0.1.35",
"bignumber.js": "9.0.2",
"classnames": "2.3.1",
"dayjs": "1.11.5",
Expand Down
2 changes: 2 additions & 0 deletions apps/extension/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ yalc.lock
.env.canary
.env.development
.env.production.compass
.env.canary
.env.canary.compass
builds
canary-builds
canary-builds.zip
builds.zip
coverage
8 changes: 6 additions & 2 deletions apps/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@
"typecheck:watch": "tsc --watch --noEmit",
"build:_production": "cross-env NODE_ENV=production webpack",
"build:_compass": "cross-env NODE_ENV=production APP=compass webpack",
"build:_canary": "cross-env NODE_ENV=canary webpack",
"build:_canary-compass": "cross-env NODE_ENV=canary APP=compass webpack",
"build:_staging": "webpack --env staging=true",
"build": "run-p typecheck build:_production",
"build:compass": "run-p typecheck build:_compass",
"build:staging": "run-p typecheck build:_staging",
"build:canary": "run-p typecheck build:_canary",
"build:canary-compass": "run-p typecheck build:_canary-compass",
"start:watcher": "node ./scripts/watcher.mjs",
"start:_development": "cross-env NODE_ENV=development webpack",
"start:_dev:compass": "cross-env APP=compass webpack",
"start:_dev:compass": "cross-env NODE_ENV=development APP=compass webpack",
"start": "run-p start:watcher typecheck:watch start:_development",
"start:compass": "run-p start:watcher typecheck:watch start:_dev:compass",
"format": "prettier --write 'src/**/*.{js,jsx,ts,tsx,css,md,json}' --config ./.prettierrc",
Expand Down Expand Up @@ -90,7 +94,7 @@
"react-range": "1.8.14",
"react-router": "6.3.0",
"react-router-dom": "6.3.0",
"reaviz": "14.7.4",
"reaviz": "14.9.7",
"recoil": "0.7.3",
"remark-gfm": "3.0.1",
"semver": "7.5.4",
Expand Down
2 changes: 1 addition & 1 deletion apps/extension/public/base_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "__NAME__",
"description": "__DESCRIPTION__",
"version": "0.11.2",
"version": "0.11.4",
"options_page": "index.html",
"web_accessible_resources": [
{
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions apps/extension/public/compass-canary/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta content="width=device-width, initial-scale=1, user-scalable=no" name="viewport" />
<link href="./favicon.ico" rel="icon" />
<link href="https://fonts.googleapis.com/icon?family=Material+Icons+Round" rel="stylesheet" />
<script src="./hcaptcha.js" type="application/javascript"></script>

<title>Compass CANARY BUILD</title>
</head>

<body>
<!-- <img alt="Logo" class="leap-logo" src="icons/icon-word.svg" />
<a
href="https://leapwallet.notion.site/leapwallet/Leap-Wallet-Help-Center-b132ca245d6243f9be7f3c83d30b1fdc"
target="blank"
class="support"
><img alt="support" src="support.svg"
/></a> -->

<div id="root"></div>

<!-- <div id="pro-tip"></div> -->
</body>
</html>
46 changes: 46 additions & 0 deletions apps/extension/public/compass-canary/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"manifest_version": 3,
"name": "Compass CANARY BUILD",
"description": "THIS IS THE CANARY DISTRIBUTION OF THE COMPASS EXTENSION, INTENDED FOR DEVELOPERS.",
"version": "0.11.1",
"options_page": "index.html",
"web_accessible_resources": [
{
"resources": ["injectLeap.js"],
"matches": ["<all_urls>"]
}
],
"action": {
"default_icon": {
"128": "/icons/icon-128.png"
},
"default_popup": "index.html"
},
"icons": {
"16": "/icons/icon-16.png",
"48": "/icons/icon-48.png",
"128": "/icons/icon-128.png"
},
"background": {
"service_worker": "background.js"
},
"content_scripts": [
{
"matches": ["https://*/*", "http://*/*"],
"js": ["contentScripts.js"],
"run_at": "document_start",
"all_frames": true
}
],
"commands": {
"_execute_action": {
"suggested_key": {
"default": "Ctrl+Shift+L"
}
}
},
"permissions": ["storage"],
"content_security_policy": {
"extension_pages": "object-src 'none'; script-src 'self' 'wasm-unsafe-eval'; img-src * 'self' data: https:; font-src https://fonts.gstatic.com; style-src 'self' https://fonts.googleapis.com data: 'unsafe-inline'; connect-src * data: blob: filesystem:; media-src * data: blob: filesystem:; form-action 'self'; frame-ancestors 'none';frame-src https://newassets.hcaptcha.com https://www.google.com/; base-uri 'self'; default-src 'none'"
}
}
5 changes: 5 additions & 0 deletions apps/extension/public/compass-canary/support.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion apps/extension/public/compass/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "Compass Wallet for Sei",
"description": "A crypto wallet for Sei Blockchain, brought to you by the Leap Wallet team.",
"version": "0.11.2",
"version": "0.11.4",
"options_page": "index.html",
"web_accessible_resources": [
{
Expand Down
6 changes: 3 additions & 3 deletions apps/extension/public/leap-cosmos/manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"manifest_version": 3,
"name": "Leap Cosmos Wallet",
"description": "A crypto wallet for Cosmos blockchains.",
"version": "0.11.2",
"name": "Leap Cosmos Wallet DEVELOPMENT BUILD",
"description": "THIS IS THE DEVELOPMENT DISTRIBUTION OF THE LEAP COSMOS EXTENSION, INTENDED FOR LOCAL DEVELOPMENT.",
"version": "0.11.4",
"options_page": "index.html",
"web_accessible_resources": [
{
Expand Down
11 changes: 10 additions & 1 deletion apps/extension/src/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const OnboardingSuccess = React.lazy(() => import('pages/onboarding/success'))
const AddSecretToken = React.lazy(() => import('pages/secret/addSecretToken'))
const Send = React.lazy(() => import('pages/send-v2'))
const Sign = React.lazy(() => import('pages/sign/sign-transaction'))
const SignSeiEvm = React.lazy(() => import('pages/sign-sei-evm/SignSeiEvmTransaction'))
const Stake = React.lazy(() => import('pages/stake'))
const CancelUndelegationPage = React.lazy(() => import('pages/stake/cancelUndelegation'))
const ChooseValidator = React.lazy(() => import('pages/stake/chooseValidator'))
Expand Down Expand Up @@ -90,7 +91,7 @@ export default function AppRoutes(): JSX.Element {
if (activeWallet) {
fetchAirdropsData()
}
}, [activeWallet?.id])
}, [activeWallet, activeWallet?.id, fetchAirdropsData])

return (
<Suspense fallback={<AppInitLoader />}>
Expand Down Expand Up @@ -262,6 +263,14 @@ export default function AppRoutes(): JSX.Element {
</RequireAuth>
}
/>
<Route
path='signSeiEvm'
element={
<RequireAuth hideBorder={true}>
<SignSeiEvm />
</RequireAuth>
}
/>
<Route
path='suggestChain'
element={
Expand Down
29 changes: 18 additions & 11 deletions apps/extension/src/components/action-input-with-preview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ interface ActionInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
className?: string
preview?: React.ReactNode | undefined
invalid?: boolean
warning?: boolean
rightElement?: React.ReactNode
disabled?: boolean
}
Expand All @@ -34,6 +35,7 @@ export const ActionInputWithPreview = React.forwardRef(
className = '',
preview,
invalid = false,
warning = false,
rightElement,
disabled = false,
...props
Expand Down Expand Up @@ -70,11 +72,15 @@ export const ActionInputWithPreview = React.forwardRef(
animate={{ opacity: 1 }}
transition={{ duration: 0.2, ease: 'linear' }}
exit={{ opacity: 0.9 }}
className={`border rounded-lg transition bg-gray-50 dark:bg-gray-800 outline-none text-gray-800 caret-gray-800 dark:text-white-100 w-full pl-4 pr-12 py-2 ${
invalid
? 'border-red-300 dark:border-red-300'
: 'border-gray-300 dark:border-gray-800 focus:border-gray-400 dark:focus:border-gray-500'
}'}`}
className={classNames(
'border rounded-lg transition bg-gray-50 dark:bg-gray-800 outline-none text-gray-800 caret-gray-800 dark:text-white-100 w-full pl-4 pr-12 py-2',
{
'border-red-300 dark:border-red-300': invalid,
'border-yellow-600 dark:border-yellow-600': warning,
'border-gray-300 dark:border-gray-800 focus:border-gray-400 dark:focus:border-gray-500':
!invalid && !warning,
},
)}
onClick={() => setShowPreview(false)}
>
{preview}
Expand All @@ -90,13 +96,14 @@ export const ActionInputWithPreview = React.forwardRef(
ref={ref}
className={classNames(
className,
'border rounded-lg transition bg-white-30 dark:bg-black-50 outline-none text-gray-800 caret-gray-800 dark:text-white-100 dark:caret-white-100 disabled:cursor-not-allowed',
`w-full pl-4 py-2 ${
invalid
? 'border-red-300 dark:border-red-300'
: 'border-gray-300 dark:border-gray-800 focus:border-gray-400 dark:focus:border-gray-500'
}}`,
'border rounded-lg transition bg-white-30 dark:bg-black-50 outline-none text-gray-800 caret-gray-800 dark:text-white-100 dark:caret-white-100 disabled:cursor-not-allowed w-full pl-4 py-2',
`${!rightElement && disabled ? 'pr-4' : 'pr-12'}`,
{
'border-red-300 dark:border-red-300': invalid,
'border-yellow-600 dark:border-yellow-600': warning,
'border-gray-300 dark:border-gray-800 focus:border-gray-400 dark:focus:border-gray-500':
!invalid && !warning,
},
)}
value={value}
onChange={onChange}
Expand Down
40 changes: 15 additions & 25 deletions apps/extension/src/components/bottom-nav/BottomNav.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
/* eslint-disable no-unused-vars */
import {
useChainsStore,
useFeatureFlags,
useSelectedNetwork,
} from '@leapwallet/cosmos-wallet-hooks'
import { useChainsStore, useFeatureFlags } from '@leapwallet/cosmos-wallet-hooks'
import { ThemeName, useTheme } from '@leapwallet/leap-ui'
import classNames from 'classnames'
import { useActiveChain } from 'hooks/settings/useActiveChain'
Expand Down Expand Up @@ -34,24 +30,20 @@ export default function BottomNav({ label, disabled: disabledAll }: BottomNavPro
const activeChain = useActiveChain()
const { chains } = useChainsStore()
const activeChainInfo = chains[activeChain]
const selectedNetwork = useSelectedNetwork()
const { data: featureFlags } = useFeatureFlags()
const { theme } = useTheme()
const isDark = theme === ThemeName.DARK
const walletCtaDisabled = activeChain === 'nomic'

const govRedirectHandler = useCallback(() => {
const redirectUrl = `https://cosmos.leapwallet.io/portfolio/gov?chain=${activeChainInfo?.key}`
window.open(redirectUrl, '_blank')
}, [activeChainInfo?.key])

const airdropRedirectHandler = useCallback(() => {
const redirectUrl = `https://cosmos.leapwallet.io/airdrops`
window.open(redirectUrl, '_blank')
}, [])

const bottomNavItems = useMemo(
() => [
const bottomNavItems = useMemo(() => {
const isSwapDisabled =
featureFlags?.swaps?.extension === 'disabled' || ['nomic', 'seiDevnet'].includes(activeChain)

return [
{
label: BottomNavLabel.Home,
icon: 'account_balance_wallet',
Expand All @@ -70,7 +62,7 @@ export default function BottomNav({ label, disabled: disabledAll }: BottomNavPro
icon: 'sync_alt',
path: '/swap',
show: true,
disabled: featureFlags?.swaps?.extension === 'disabled' || walletCtaDisabled,
disabled: isSwapDisabled,
},
{
label: BottomNavLabel.NFTs,
Expand All @@ -92,16 +84,14 @@ export default function BottomNav({ label, disabled: disabledAll }: BottomNavPro
path: '/activity',
show: true,
},
],
[
activeChainInfo?.disableStaking,
featureFlags?.swaps?.extension,
featureFlags?.airdrops?.extension,
govRedirectHandler,
selectedNetwork,
walletCtaDisabled,
],
)
]
}, [
activeChainInfo?.disableStaking,
featureFlags?.swaps?.extension,
featureFlags?.airdrops?.extension,
activeChain,
airdropRedirectHandler,
])

return (
<div className='flex absolute justify-around bottom-0 h-[65px] w-full rounded-b-lg z-[0] shadow-[0_-8px_20px_0px_rgba(0,0,0,0.04)] dark:shadow-[0_-8px_20px_0px_rgba(0,0,0,0.26)]'>
Expand Down
2 changes: 1 addition & 1 deletion apps/extension/src/components/clickable-icons/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type ClickableIconProps = ComponentPropsWithoutRef<'button'> & {
}

const ClickableIcon = forwardRef<HTMLButtonElement, ClickableIconProps>(
({ type, image, darker, disabled, ...rest }, ref) => {
({ type, image, disabled, ...rest }, ref) => {
const { theme } = useTheme()
const isDark = theme === ThemeName.DARK

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ export function EthCopyWalletAddress({
const copyIconSrc: string =
useTheme().theme === ThemeName.DARK ? Images.Misc.CopyGray200 : Images.Misc.CopyGray600

const redirectOnboarding = () => {
window.open(browser.runtime.getURL('index.html#/onboardEvmLedger'))
}

const handleClick: MouseEventHandler<HTMLDivElement | HTMLButtonElement> = async (event) => {
if (!text) {
event.stopPropagation()
Expand All @@ -47,10 +51,6 @@ export function EthCopyWalletAddress({
onCopy && (await onCopy())
}

const redirectOnboarding = () => {
window.open(browser.runtime.getURL('index.html#/onboardEvmLedger'))
}

const handleTextClick: MouseEventHandler<HTMLDivElement> = (event) => {
if (onTextClick) {
event.stopPropagation()
Expand Down
Loading

0 comments on commit 180e959

Please sign in to comment.