diff --git a/spaceward/package.json b/spaceward/package.json index ac1b03a9d..ce2eccfe3 100644 --- a/spaceward/package.json +++ b/spaceward/package.json @@ -81,7 +81,7 @@ "js-sha256": "^0.10.1", "localforage": "^1.10.0", "long": "^5.2.3", - "lucide-react": "^0.279.0", + "lucide-react": "^0.368.0", "match-sorter": "^6.3.1", "next": "^14.1.0", "next-themes": "^0.2.1", diff --git a/spaceward/pnpm-lock.yaml b/spaceward/pnpm-lock.yaml index a5d340d55..e1b62affd 100644 --- a/spaceward/pnpm-lock.yaml +++ b/spaceward/pnpm-lock.yaml @@ -220,8 +220,8 @@ importers: specifier: ^5.2.3 version: 5.2.3 lucide-react: - specifier: ^0.279.0 - version: 0.279.0(react@18.2.0) + specifier: ^0.368.0 + version: 0.368.0(react@18.2.0) match-sorter: specifier: ^6.3.1 version: 6.3.4 @@ -6791,8 +6791,8 @@ packages: resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} engines: {node: '>=10'} - lucide-react@0.279.0: - resolution: {integrity: sha512-LJ8g66+Bxc3t3x9vKTeK3wn3xucrOQGfJ9ou9GsBwCt2offsrT2BB90XrTrIzE1noYYDe2O8jZaRHi6sAHXNxw==} + lucide-react@0.368.0: + resolution: {integrity: sha512-soryVrCjheZs8rbXKdINw9B8iPi5OajBJZMJ1HORig89ljcOcEokKKAgGbg3QWxSXel7JwHOfDFUdDHAKyUAMw==} peerDependencies: react: ^16.5.1 || ^17.0.0 || ^18.0.0 @@ -18572,7 +18572,7 @@ snapshots: dependencies: yallist: 4.0.0 - lucide-react@0.279.0(react@18.2.0): + lucide-react@0.368.0(react@18.2.0): dependencies: react: 18.2.0 diff --git a/spaceward/public/logos/osmosis.svg b/spaceward/public/logos/osmosis.svg new file mode 100644 index 000000000..d7b352de7 --- /dev/null +++ b/spaceward/public/logos/osmosis.svg @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/spaceward/public/no-space-bg.svg b/spaceward/public/no-space-bg.svg new file mode 100644 index 000000000..12c9075ad --- /dev/null +++ b/spaceward/public/no-space-bg.svg @@ -0,0 +1,442 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/spaceward/src/App.tsx b/spaceward/src/App.tsx index 61ef7eb3e..c55f600f7 100644 --- a/spaceward/src/App.tsx +++ b/spaceward/src/App.tsx @@ -3,6 +3,8 @@ import { wardenprotocoldevnetAssets, wardenprotocollocal, wardenprotocollocalAssets, + wardenprotocolbuenavista, + wardenprotocolbuenavistaAssets, } from "@/config/chains"; import { ChainProvider } from "@cosmos-kit/react"; import { @@ -110,11 +112,13 @@ function App() { ...chains, wardenprotocollocal, wardenprotocoldevnet, + wardenprotocolbuenavista, ]} assetLists={[ ...assets, wardenprotocollocalAssets, wardenprotocoldevnetAssets, + wardenprotocolbuenavistaAssets, ]} wallets={supportedWallets} walletConnectOptions={{ diff --git a/spaceward/src/assets/main.css b/spaceward/src/assets/main.css index 4c58d72d2..aa5b5f8ed 100644 --- a/spaceward/src/assets/main.css +++ b/spaceward/src/assets/main.css @@ -91,6 +91,7 @@ body { /* @apply bg-background text-foreground font-sans bg-cover bg-fixed dark:bg-[url("/bg.svg")]; */ + /* @apply bg-background text-foreground font-sans bg-cover bg-center bg-fixed dark:bg-[url("/no-space-bg.svg")]; */ @apply bg-background text-foreground font-sans; } @@ -104,6 +105,10 @@ } } +.no-space { + /* @apply bg-background text-foreground font-sans bg-cover bg-no-repeat bg-center dark:bg-[url("/no-space-bg.svg")]; */ +} + .svg-animation { position: absolute; left: -8px; diff --git a/spaceward/src/components/AddressUnit.tsx b/spaceward/src/components/AddressUnit.tsx index 0a9276d2e..9960ac926 100644 --- a/spaceward/src/components/AddressUnit.tsx +++ b/spaceward/src/components/AddressUnit.tsx @@ -1,4 +1,6 @@ +import { XIcon } from "lucide-react"; import AddressAvatar from "./AddressAvatar"; +import { Copy } from "./ui/copy"; const AddressUnit = ({ address, @@ -15,11 +17,11 @@ const AddressUnit = ({
{/* {intent.address.slice(0, 4)}...{intent.address.slice(-4)} */} - {"..." + address.slice(-8)} +
); diff --git a/spaceward/src/components/ConnectWallet.tsx b/spaceward/src/components/ConnectWallet.tsx index 47b1ebc6f..8bd0a1dff 100644 --- a/spaceward/src/components/ConnectWallet.tsx +++ b/spaceward/src/components/ConnectWallet.tsx @@ -32,10 +32,10 @@ export function ConnectWallet() { asChild variant="outline" role="combobox" - className="justify-between cursor-pointer bg-card h-16 pl-0 md:pl-6 rounded-none gap-4 min-w-0 hover:bg-card hover:text-foreground border-0 pr-0" + className="justify-between w-80 cursor-pointer rounded-xl bg-card h-16 px-0 md:px-6 gap-4 min-w-0 hover:bg-card hover:text-foreground border-0" >
-
+
-
+
- {"..." + address.slice(-8)} + {"..." + address.slice(-12)} + {/* + {"..." + address.slice(-8)} + */} {ward.toFixed(2)} WARD @@ -79,7 +82,7 @@ export function ConnectWallet() { {address ? ( - +
@@ -96,7 +99,7 @@ export function ConnectWallet() { />
-
+
Wallet {activeWallet?.name || ""} diff --git a/spaceward/src/components/ThemeToggle.tsx b/spaceward/src/components/ThemeToggle.tsx index 8a1099dac..a7890349d 100644 --- a/spaceward/src/components/ThemeToggle.tsx +++ b/spaceward/src/components/ThemeToggle.tsx @@ -12,7 +12,7 @@ export function ThemeToggle() { size="icon" onClick={() => setTheme(theme === "light" ? "dark" : "light")} className={ - "h-20 w-20 rounded-none border-0 hover:bg-transparent flex items-center place-content-center group" + "h-16 w-16 rounded-none border-0 hover:bg-transparent flex items-center place-content-center group" } >
diff --git a/spaceward/src/components/ui/copy.tsx b/spaceward/src/components/ui/copy.tsx index 3905c457f..502ed2cf1 100644 --- a/spaceward/src/components/ui/copy.tsx +++ b/spaceward/src/components/ui/copy.tsx @@ -51,7 +51,7 @@ const Copy = React.forwardRef( {variant === "icon" ? ( ) : split ? ( - value?.slice(0, 8) + "..." + value?.slice(-8) + "..." + value?.slice(-8) ) : ( value )} diff --git a/spaceward/src/config/chains.ts b/spaceward/src/config/chains.ts index 392e3789b..e8e60f0a8 100644 --- a/spaceward/src/config/chains.ts +++ b/spaceward/src/config/chains.ts @@ -2,233 +2,349 @@ import { Chain, AssetList } from "@chain-registry/types"; import { env } from "@/env"; export const wardenprotocollocal: Chain = { - chain_name: "wardenprotocollocal", - status: "live", - network_type: "testnet", - pretty_name: "Warden Protocol (local)", - chain_id: "wardenprotocol", - bech32_prefix: "warden", - daemon_name: "wardend", - node_home: "$HOME/.warden", - key_algos: ["secp256k1"], - slip44: 118, - fees: { - fee_tokens: [ - { - denom: "uward", - fixed_min_gas_price: 0.005, - low_gas_price: 0.01, - average_gas_price: 0.025, - high_gas_price: 0.03, - }, - ], - }, - staking: { - staking_tokens: [ - { - denom: "uward", - }, - ], - }, - codebase: { - git_repo: "https://github.com/warden-protocol/wardenprotocol", - recommended_version: "v0.1.0", - compatible_versions: ["v0.1.0"], - cosmos_sdk_version: "0.50", - consensus: { - type: "cometbft", - version: "0.38", - }, - cosmwasm_enabled: false, - genesis: { - genesis_url: - "https://raw.githubusercontent.com/warden-protocol/networks/main/testnet-alfama/genesis.json", - }, - versions: [ - { - name: "v0.1.0", - recommended_version: "v0.1.0", - compatible_versions: ["v0.1.0"], - cosmos_sdk_version: "0.50", - consensus: { - type: "cometbft", - version: "0.38", - }, - cosmwasm_enabled: false, - }, - ], - }, - apis: { - rpc: [ - { - address: env.rpcURL, - provider: "Warden Protocol", - }, - ], - rest: [ - { - address: env.apiURL, - provider: "Warden Protocol", - }, - ], - grpc: [], - }, - logo_URIs: { - png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.png", - }, - keywords: ["local"], - images: [ - { - png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.png", - }, - ], + chain_name: "wardenprotocollocal", + status: "live", + network_type: "testnet", + pretty_name: "Warden Protocol (local)", + chain_id: "wardenprotocol", + bech32_prefix: "warden", + daemon_name: "wardend", + node_home: "$HOME/.warden", + key_algos: ["secp256k1"], + slip44: 118, + fees: { + fee_tokens: [ + { + denom: "uward", + fixed_min_gas_price: 0.005, + low_gas_price: 0.01, + average_gas_price: 0.025, + high_gas_price: 0.03, + }, + ], + }, + staking: { + staking_tokens: [ + { + denom: "uward", + }, + ], + }, + codebase: { + git_repo: "https://github.com/warden-protocol/wardenprotocol", + recommended_version: "v0.1.0", + compatible_versions: ["v0.1.0"], + cosmos_sdk_version: "0.50", + consensus: { + type: "cometbft", + version: "0.38", + }, + cosmwasm_enabled: false, + genesis: { + genesis_url: + "https://raw.githubusercontent.com/warden-protocol/networks/main/testnet-alfama/genesis.json", + }, + versions: [ + { + name: "v0.1.0", + recommended_version: "v0.1.0", + compatible_versions: ["v0.1.0"], + cosmos_sdk_version: "0.50", + consensus: { + type: "cometbft", + version: "0.38", + }, + cosmwasm_enabled: false, + }, + ], + }, + apis: { + rpc: [ + { + address: env.rpcURL, + provider: "Warden Protocol", + }, + ], + rest: [ + { + address: env.apiURL, + provider: "Warden Protocol", + }, + ], + grpc: [], + }, + logo_URIs: { + png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.png", + }, + keywords: ["local"], + images: [ + { + png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.png", + }, + ], }; export const wardenprotocollocalAssets: AssetList = { - chain_name: "wardenprotocollocal", - assets: [ - { - description: "The native token of Warden Protocol Testnet", - denom_units: [ - { - denom: "uward", - exponent: 0, - }, - { - denom: "ward", - exponent: 6, - }, - ], - base: "uward", - name: "Ward", - display: "ward", - symbol: "WARD", - logo_URIs: { - png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.png", - svg: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.svg", - }, - images: [ - { - png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.png", - svg: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.svg", - }, - ], - }, - ], + chain_name: "wardenprotocollocal", + assets: [ + { + description: "The native token of Warden Protocol Testnet", + denom_units: [ + { + denom: "uward", + exponent: 0, + }, + { + denom: "ward", + exponent: 6, + }, + ], + base: "uward", + name: "Ward", + display: "ward", + symbol: "WARD", + logo_URIs: { + png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.png", + svg: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.svg", + }, + images: [ + { + png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.png", + svg: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.svg", + }, + ], + }, + ], }; export const wardenprotocoldevnet: Chain = { - chain_name: "wardenprotocoldevnet", - status: "live", - network_type: "testnet", - pretty_name: "Warden Protocol (devnet)", - chain_id: "wardenprotocol", - bech32_prefix: "warden", - daemon_name: "wardend", - node_home: "$HOME/.warden", - key_algos: ["secp256k1"], - slip44: 118, - fees: { - fee_tokens: [ - { - denom: "uward", - fixed_min_gas_price: 0.005, - low_gas_price: 0.01, - average_gas_price: 0.025, - high_gas_price: 0.03, - }, - ], - }, - staking: { - staking_tokens: [ - { - denom: "uward", - }, - ], - }, - codebase: { - git_repo: "https://github.com/warden-protocol/wardenprotocol", - recommended_version: "v0.1.0", - compatible_versions: ["v0.1.0"], - cosmos_sdk_version: "0.50", - consensus: { - type: "cometbft", - version: "0.38", - }, - cosmwasm_enabled: false, - genesis: { - genesis_url: - "https://raw.githubusercontent.com/warden-protocol/networks/main/testnet-alfama/genesis.json", - }, - versions: [ - { - name: "v0.1.0", - recommended_version: "v0.1.0", - compatible_versions: ["v0.1.0"], - cosmos_sdk_version: "0.50", - consensus: { - type: "cometbft", - version: "0.38", - }, - cosmwasm_enabled: false, - }, - ], - }, - apis: { - rpc: [ - { - address: env.rpcURL, - provider: "Warden Protocol", - }, - ], - rest: [ - { - address: env.apiURL, - provider: "Warden Protocol", - }, - ], - grpc: [], - }, - logo_URIs: { - png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.png", - }, - keywords: ["local"], - images: [ - { - png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.png", - }, - ], + chain_name: "wardenprotocoldevnet", + status: "live", + network_type: "testnet", + pretty_name: "Warden Protocol (devnet)", + chain_id: "wardenprotocol", + bech32_prefix: "warden", + daemon_name: "wardend", + node_home: "$HOME/.warden", + key_algos: ["secp256k1"], + slip44: 118, + fees: { + fee_tokens: [ + { + denom: "uward", + fixed_min_gas_price: 0.005, + low_gas_price: 0.01, + average_gas_price: 0.025, + high_gas_price: 0.03, + }, + ], + }, + staking: { + staking_tokens: [ + { + denom: "uward", + }, + ], + }, + codebase: { + git_repo: "https://github.com/warden-protocol/wardenprotocol", + recommended_version: "v0.1.0", + compatible_versions: ["v0.1.0"], + cosmos_sdk_version: "0.50", + consensus: { + type: "cometbft", + version: "0.38", + }, + cosmwasm_enabled: false, + genesis: { + genesis_url: + "https://raw.githubusercontent.com/warden-protocol/networks/main/testnet-alfama/genesis.json", + }, + versions: [ + { + name: "v0.1.0", + recommended_version: "v0.1.0", + compatible_versions: ["v0.1.0"], + cosmos_sdk_version: "0.50", + consensus: { + type: "cometbft", + version: "0.38", + }, + cosmwasm_enabled: false, + }, + ], + }, + apis: { + rpc: [ + { + address: env.rpcURL, + provider: "Warden Protocol", + }, + ], + rest: [ + { + address: env.apiURL, + provider: "Warden Protocol", + }, + ], + grpc: [], + }, + logo_URIs: { + png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.png", + }, + keywords: ["local"], + images: [ + { + png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.png", + }, + ], }; export const wardenprotocoldevnetAssets: AssetList = { - chain_name: "wardenprotocoldevnet", - assets: [ - { - description: "The native token of Warden Protocol Testnet", - denom_units: [ - { - denom: "uward", - exponent: 0, - }, - { - denom: "ward", - exponent: 6, - }, - ], - base: "uward", - name: "Ward", - display: "ward", - symbol: "WARD", - logo_URIs: { - png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.png", - svg: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.svg", - }, - images: [ - { - png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.png", - svg: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.svg", - }, - ], - }, - ], + chain_name: "wardenprotocoldevnet", + assets: [ + { + description: "The native token of Warden Protocol Testnet", + denom_units: [ + { + denom: "uward", + exponent: 0, + }, + { + denom: "ward", + exponent: 6, + }, + ], + base: "uward", + name: "Ward", + display: "ward", + symbol: "WARD", + logo_URIs: { + png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.png", + svg: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.svg", + }, + images: [ + { + png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.png", + svg: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.svg", + }, + ], + }, + ], +}; + +export const wardenprotocolbuenavista: Chain = { + chain_name: "wardenprotocolbuenavista", + status: "live", + network_type: "testnet", + pretty_name: "Warden Protocol Buenavista Testnet", + chain_id: "buenavista", + bech32_prefix: "warden", + daemon_name: "wardend", + node_home: "$HOME/.warden", + key_algos: ["secp256k1"], + slip44: 118, + fees: { + fee_tokens: [ + { + denom: "uward", + fixed_min_gas_price: 0.005, + low_gas_price: 0.01, + average_gas_price: 0.025, + high_gas_price: 0.03, + }, + ], + }, + staking: { + staking_tokens: [ + { + denom: "uward", + }, + ], + }, + codebase: { + git_repo: "https://github.com/warden-protocol/wardenprotocol", + recommended_version: "v0.1.0", + compatible_versions: ["v0.1.0"], + cosmos_sdk_version: "0.50", + consensus: { + type: "cometbft", + version: "0.38", + }, + cosmwasm_enabled: false, + genesis: { + genesis_url: + "https://raw.githubusercontent.com/warden-protocol/networks/main/testnet-alfama/genesis.json", + }, + versions: [ + { + name: "v0.1.0", + recommended_version: "v0.1.0", + compatible_versions: ["v0.1.0"], + cosmos_sdk_version: "0.50", + consensus: { + type: "cometbft", + version: "0.38", + }, + cosmwasm_enabled: false, + }, + ], + }, + apis: { + rpc: [ + { + address: env.rpcURL, + provider: "Warden Protocol", + }, + ], + rest: [ + { + address: env.apiURL, + provider: "Warden Protocol", + }, + ], + grpc: [], + }, + logo_URIs: { + png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.png", + }, + keywords: ["local"], + images: [ + { + png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.png", + }, + ], +}; + +export const wardenprotocolbuenavistaAssets: AssetList = { + chain_name: "wardenprotocolbuenavista", + assets: [ + { + description: "The native token of Warden Protocol Testnet", + denom_units: [ + { + denom: "uward", + exponent: 0, + }, + { + denom: "ward", + exponent: 6, + }, + ], + base: "uward", + name: "Ward", + display: "ward", + symbol: "WARD", + logo_URIs: { + png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.png", + svg: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.svg", + }, + images: [ + { + png: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.png", + svg: "https://raw.githubusercontent.com/cosmos/chain-registry/master/wardenprotocol/images/ward.svg", + }, + ], + }, + ], }; diff --git a/spaceward/src/features/actions/Actions.tsx b/spaceward/src/features/actions/Actions.tsx index b493ba0b8..3602a6498 100644 --- a/spaceward/src/features/actions/Actions.tsx +++ b/spaceward/src/features/actions/Actions.tsx @@ -7,7 +7,7 @@ import { } from "@/components/ui/accordion"; import { useAddressContext } from "@/hooks/useAddressContext"; import useWardenIntent from "@/hooks/useWardenIntent"; -import { Action as ActionModel } from "@wardenprotocol/wardjs/dist/codegen/warden/intent/action"; +import { Action as ActionModel } from "warden-protocol-wardenprotocol-client-ts/lib/warden.intent/rest"; import { prettyActionStatus } from "@/utils/formatting"; export function Actions() { diff --git a/spaceward/src/features/apps/Apps.tsx b/spaceward/src/features/apps/Apps.tsx index 6c6422c1f..a071c651d 100644 --- a/spaceward/src/features/apps/Apps.tsx +++ b/spaceward/src/features/apps/Apps.tsx @@ -16,10 +16,18 @@ const apps = [ description: "Squid allows any token to be swapped between blockchains, and unlocks access to apps across chains in a single click.", }, + { + name: "Osmosis", + url: "https://testnet.osmosis.zone/?to=ATOM&from=OSMO", + logo: "/logos/osmosis.svg", + description: + "Swap, earn, and build on the leading decentralized Cosmos exchange.", + badge: "COSMOS", + }, { name: "PancakeSwap", url: "https://pancakeswap.finance/swap?chain=sepolia", - logo: "/logos/pancakeswap.svg", + // logo: "/logos/pancakeswap.svg", description: "Trade, earn, and own crypto on the all-in-one multichain DEX.", }, @@ -37,13 +45,13 @@ const apps = [ description: "CoW Protocol finds the lowest price for your trade across all exchanges and aggregators.", }, - { - name: "Hedgy", - url: "https://app.hedgey.finance/", - // logo: "/logos/hedgy.svg", - description: - "Token vesting, lockups, grants and distributions for your team, investors and community.", - }, + // { + // name: "Hedgy", + // url: "https://app.hedgey.finance/", + // // logo: "/logos/hedgy.svg", + // description: + // "Token vesting, lockups, grants and distributions for your team, investors and community.", + // }, ]; export function Apps() { @@ -67,7 +75,9 @@ export function Apps() { {app.description} - EVM + + {app.badge ? app.badge : "EVM"} +
))} diff --git a/spaceward/src/features/home/HomeApps.tsx b/spaceward/src/features/home/HomeApps.tsx index cb289c941..7933ee4cd 100644 --- a/spaceward/src/features/home/HomeApps.tsx +++ b/spaceward/src/features/home/HomeApps.tsx @@ -16,12 +16,20 @@ const apps = [ description: "Squid allows any token to be swapped between blockchains, and unlocks access to apps across chains in a single click.", }, + // { + // name: "PancakeSwap", + // url: "https://pancakeswap.finance/swap?chain=sepolia", + // logo: "/logos/pancakeswap.svg", + // description: + // "Trade, earn, and own crypto on the all-in-one multichain DEX.", + // }, { - name: "PancakeSwap", - url: "https://pancakeswap.finance/swap?chain=sepolia", - logo: "/logos/pancakeswap.svg", + name: "Osmosis", + url: "https://testnet.osmosis.zone/?to=ATOM&from=OSMO", + logo: "/logos/osmosis.svg", description: - "Trade, earn, and own crypto on the all-in-one multichain DEX.", + "Swap, earn, and build on the leading decentralized Cosmos exchange.", + badge: "COSMOS", }, ]; @@ -29,8 +37,8 @@ export function HomeApps() { return (
{apps.map((app) => ( - -
+ +
{app.logo && (
{app.description} - EVM + + {app.badge ? app.badge : "EVM"} +
))} diff --git a/spaceward/src/features/home/HomeAssets.tsx b/spaceward/src/features/home/HomeAssets.tsx index 3eab472d2..049c003d0 100644 --- a/spaceward/src/features/home/HomeAssets.tsx +++ b/spaceward/src/features/home/HomeAssets.tsx @@ -52,7 +52,7 @@ export function HomeAssets() { if (query.data?.keys?.length === 0) { return (
- + No keys found in this space Add a key to start receiving assets @@ -65,7 +65,7 @@ export function HomeAssets() { return ( <> {query.data?.keys?.map((key) => ( -
+
{key.addresses?.map((addr) => { @@ -86,10 +86,7 @@ export function HomeAssets() { } const isCosmosWallet = (type?: AddressType) => - type && - [AddressType.ADDRESS_TYPE_OSMOSIS].includes( - type, - ); + type && [AddressType.ADDRESS_TYPE_OSMOSIS].includes(type); function Address({ address, @@ -127,10 +124,7 @@ function Address({
{type === AddressType.ADDRESS_TYPE_ETHEREUM ? ( - + ) : isCosmosWallet(type) ? ( ) : null} @@ -200,5 +194,5 @@ function Sepolia({ address, keyId }: { address: string; keyId: Long }) { } function CosmosLike() { - return null + return null; } diff --git a/spaceward/src/features/home/TotalAssetValue.tsx b/spaceward/src/features/home/TotalAssetValue.tsx index c9063f7b5..4f7b53986 100644 --- a/spaceward/src/features/home/TotalAssetValue.tsx +++ b/spaceward/src/features/home/TotalAssetValue.tsx @@ -71,11 +71,11 @@ export function TotalAssetValue() { return (
-

Total asset value

+

Total asset value

{isPending ? ( ) : ( - + {currency === "usd" ? USDollar.format( parseFloat(formatEther(totalBalance)) * 2940, diff --git a/spaceward/src/features/intents/AddPersonModal.tsx b/spaceward/src/features/intents/AddPersonModal.tsx index 71b5b365f..0aa41e2b0 100644 --- a/spaceward/src/features/intents/AddPersonModal.tsx +++ b/spaceward/src/features/intents/AddPersonModal.tsx @@ -44,8 +44,8 @@ const AddPersonModal = ({
-
- Add a person +
+ Add an approver
Enter an address
@@ -100,7 +100,7 @@ const AddPersonModal = ({ `opacity-[0.3] pointer-events-none`, )} > - Add Person + Add Approver
diff --git a/spaceward/src/features/intents/ChangePersonModal.tsx b/spaceward/src/features/intents/ChangePersonModal.tsx index b90341e8a..3dab5ef4f 100644 --- a/spaceward/src/features/intents/ChangePersonModal.tsx +++ b/spaceward/src/features/intents/ChangePersonModal.tsx @@ -39,7 +39,7 @@ const ChangePersonModal = ({
- Select the persons + Select the approvers
Who should approve the transactions
@@ -51,7 +51,7 @@ const ChangePersonModal = ({ }} className="px-5 hover:text-white transition-all duration-200" > - Add Person + Add an approver {addresses.length ? (
-
+
Select an approval condition
-
How will transactions be approved in the Space
+
How will transactions be approved
-
+

Joint approval

-

- Each person must approve the transaction +

+ Each approver must approve the transaction

@@ -64,15 +65,15 @@ const CreateIntentModal = ({ }} className="flex items-center gap-3 py-5 cursor-pointer" > -
+

Approval by certain amount

-

- Set amount of persons should approve the +

+ Set how many approvers should approve the transaction

@@ -87,15 +88,15 @@ const CreateIntentModal = ({ }} className="flex items-center gap-3 py-5 cursor-pointer" > -
+

Approval by anyone

-

- Any person can approve the transaction +

+ Any approver can approve the transaction

diff --git a/spaceward/src/features/intents/Intent.tsx b/spaceward/src/features/intents/Intent.tsx index 06987489d..bc6bd8dba 100644 --- a/spaceward/src/features/intents/Intent.tsx +++ b/spaceward/src/features/intents/Intent.tsx @@ -5,6 +5,7 @@ import CreateIntentModal from "./CreateIntentModal"; import IntentCondition from "./IntentCondition"; import Portal from "@/components/ui/portal"; import AddressAvatar from "@/components/AddressAvatar"; +import { X, XIcon } from "lucide-react"; const IntentComponent = ({ intent: _intent, @@ -75,26 +76,20 @@ const IntentComponent = ({ return (
{isEditState ? ( -
- {intent.name} -
- ) : ( { setDiff((prev) => ({ @@ -103,6 +98,10 @@ const IntentComponent = ({ })); }} /> + ) : ( +
+ {intent.name} +
)}
@@ -338,7 +337,7 @@ const IntentComponent = ({
) : ( -
+
{intent.addresses.slice(0, 2).map((address, key) => (
@@ -382,7 +381,7 @@ const IntentComponent = ({ }} className="absolute top-8 right-8 opacity-[0.5] hover:opacity-[100%] transition-all" > - +
@@ -390,7 +389,8 @@ const IntentComponent = ({ Approve the Intent in your wallet
- Open the browser extension if it didn't. + Open the browser extension if it didn't + open automatically.
diff --git a/spaceward/src/features/intents/IntentCondition.tsx b/spaceward/src/features/intents/IntentCondition.tsx index 45cf0c8b9..2b8e4bc8f 100644 --- a/spaceward/src/features/intents/IntentCondition.tsx +++ b/spaceward/src/features/intents/IntentCondition.tsx @@ -57,7 +57,7 @@ const IntentCondition = ({
)}
-
+
{type == "joint" ? `Joint approval` : type == "anyone" @@ -78,7 +78,7 @@ const IntentCondition = ({
-
+
{type == "joint" ? ( `Each person must approve the transaction` ) : type == "anyone" ? ( @@ -160,7 +160,7 @@ const IntentCondition = ({ ) : ( )} - Add Persons + Add approver
diff --git a/spaceward/src/features/intents/IntentNotifications.tsx b/spaceward/src/features/intents/IntentNotifications.tsx deleted file mode 100644 index e69de29bb..000000000 diff --git a/spaceward/src/features/intents/NewIntentButton.tsx b/spaceward/src/features/intents/NewIntentButton.tsx index ed97a6442..48ce70e83 100644 --- a/spaceward/src/features/intents/NewIntentButton.tsx +++ b/spaceward/src/features/intents/NewIntentButton.tsx @@ -40,7 +40,7 @@ export function NewIntentButton({ onClick }: { onClick: () => void }) { return ( -
-
- {/* {address.slice(0, 4)}...{address.slice(-4)} */} - {"..." + address.slice(-8)} -
+
{"..." + address.slice(-8)}
{isSelected ? ( diff --git a/spaceward/src/features/keys/Keys.tsx b/spaceward/src/features/keys/Keys.tsx index ead75199a..bdf464b16 100644 --- a/spaceward/src/features/keys/Keys.tsx +++ b/spaceward/src/features/keys/Keys.tsx @@ -116,12 +116,12 @@ function Key({
- + {/* - + */}
diff --git a/spaceward/src/features/metamask/MetaMaskRequests.tsx b/spaceward/src/features/metamask/MetaMaskRequests.tsx index 22493b375..221dc49f9 100644 --- a/spaceward/src/features/metamask/MetaMaskRequests.tsx +++ b/spaceward/src/features/metamask/MetaMaskRequests.tsx @@ -220,10 +220,10 @@ export function MetaMaskRequests() { size="icon" aria-label="Update dimensions" className={cn( - "h-20 w-20 rounded-none border-0 hover:bg-transparent flex items-center place-content-center group", + "h-16 w-16 rounded-none border-0 hover:bg-transparent flex items-center place-content-center group", )} > -
+
setOpen(false)} >
-
+
-
+
Notifications
diff --git a/spaceward/src/features/spaces/NoActiveSpace.tsx b/spaceward/src/features/spaces/NoActiveSpace.tsx deleted file mode 100644 index f5e4e61ad..000000000 --- a/spaceward/src/features/spaces/NoActiveSpace.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import { Button } from "@/components/ui/button"; -import { useAddressContext } from "@/hooks/useAddressContext"; -import { useClient } from "@/hooks/useClient"; -import { monitorTx } from "@/hooks/keplr"; -import { useToast } from "@/components/ui/use-toast"; - -export function NoActiveSpace() { - const { address } = useAddressContext(); - const { toast } = useToast(); - const client = useClient(); - const sendMsgNewSpace = client.WardenWardenV1Beta2.tx.sendMsgNewSpace; - return ( -
-

No Active Space

-

- You have no active spaces, use the button below to create one. -

- -
- ); -} diff --git a/spaceward/src/features/spaces/NoSpaces.tsx b/spaceward/src/features/spaces/NoSpaces.tsx new file mode 100644 index 000000000..7aab780c2 --- /dev/null +++ b/spaceward/src/features/spaces/NoSpaces.tsx @@ -0,0 +1,59 @@ +import { Button } from "@/components/ui/button"; +import { useAddressContext } from "@/hooks/useAddressContext"; +import { useClient } from "@/hooks/useClient"; +import { monitorTx } from "@/hooks/keplr"; +import { useToast } from "@/components/ui/use-toast"; +import { useAsset } from "@/hooks/useAsset"; +import FaucetButton from "@/components/FaucetButton"; + +export function NoSpaces() { + const { address } = useAddressContext(); + const { toast } = useToast(); + const client = useClient(); + const sendMsgNewSpace = client.WardenWardenV1Beta2.tx.sendMsgNewSpace; + const { balance } = useAsset("uward"); + const ward = parseInt(balance?.amount || "0") / 10 ** 6; + return ( +
+ {ward > 0 ? ( + <> +

+ Create your first space +

+

+ A space functions as a management hub for a collection + of keys, assets and intents. +

+ + + ) : ( + <> +

Get WARD Token

+

+ To use SpaceWard you need some WARD tokens. You can get + using the faucet below. +

+
+ +
+ + )} +
+ ); +} diff --git a/spaceward/src/features/spaces/SpaceSelector.tsx b/spaceward/src/features/spaces/SpaceSelector.tsx new file mode 100644 index 000000000..5ee3660ce --- /dev/null +++ b/spaceward/src/features/spaces/SpaceSelector.tsx @@ -0,0 +1,231 @@ +import { Button } from "@/components/ui/button"; +import { ChevronsUpDown } from "lucide-react"; +import { + Popover, + PopoverContent, + PopoverTrigger, +} from "@/components/ui/popover"; +import AddressAvatar from "@/components/AddressAvatar"; +import { useAddressContext } from "@/hooks/useAddressContext"; +import useWardenWardenV1Beta2 from "@/hooks/useWardenWardenV1Beta2"; +import { useSpaceId } from "@/hooks/useSpaceId"; +import { monitorTx } from "@/hooks/keplr"; +import { useClient } from "@/hooks/useClient"; +import { useToast } from "@/components/ui/use-toast"; +import cn from "clsx"; +import { Plus } from "lucide-react"; +import { TxMsgData } from "cosmjs-types/cosmos/base/abci/v1beta1/abci"; +import { + MsgNewKeyRequestResponse, + MsgNewSpaceResponse, +} from "warden-protocol-wardenprotocol-client-ts/lib/warden.warden.v1beta2/module"; +import { MsgActionCreated } from "warden-protocol-wardenprotocol-client-ts/lib/warden.intent/module"; +// import { MsgNewSpace } from "warden-protocol-wardenprotocol-client-ts/lib/warden.warden.v1beta2/module"; + +interface SpacesQueryResult { + pageParam: number; + pagination?: + | { next_key?: string | undefined; total?: string | undefined } + | undefined; + spaces?: + | { + id?: string | undefined; + creator?: string | undefined; + owners?: string[] | undefined; + admin_intent_id?: string | undefined; + sign_intent_id?: string | undefined; + }[] + | undefined; +} +function sleep(ms: number) { + return new Promise((resolve) => setTimeout(resolve, ms)); +} + +async function handleCreateSpace( + address: string, + client: any, + sendMsgNewSpace: any, + toast: any, +) { + try { + const res = await monitorTx( + sendMsgNewSpace({ + value: { + creator: address, + signIntentId: 0, + adminIntentId: 0, + additionalOwners: [], + }, + }), + toast, + ); + + if (!res) { + throw new Error("failed to broadcast tx"); + } + + if (res.tx_response?.code !== 0 || !res.tx_response.data) { + throw new Error(`tx failed: ${JSON.stringify(res)}`); + } + + // // parse tx msg response + // const bytes = Uint8Array.from( + // res.tx_response.data + // .match(/.{1,2}/g) + // ?.map((byte) => parseInt(byte, 16)) || [], + // ); + // const msgData = TxMsgData.decode(bytes); + // const actionCreated = MsgActionCreated.decode( + // msgData.msgResponses[0].value, + // ); + // const actionId = actionCreated.action?.id; + + // console.log(actionCreated); + + // // wait for action to be completed + // // setState(KeyRequesterState.AWAITING_APPROVALS); + // let spaceRequestId = null; + // while (true) { + // const res = await client.WardenIntent.query.queryActionById({ + // id: `${actionId}`, + // }); + // if ( + // res.data.action?.status !== "ACTION_STATUS_PENDING" && + // res.data.action?.status !== "ACTION_STATUS_COMPLETED" + // ) { + // throw new Error( + // `action failed: ${JSON.stringify(res.data.action)}`, + // ); + // } + + // spaceRequestId = ( + // res.data.action?.result as MsgNewSpaceResponse | null + // )?.id; + + // if (spaceRequestId) { + // break; + // } + + // await sleep(1000); + // } + } catch (error) { + console.error(error); + } +} + +export function SpaceSelector() { + const { address } = useAddressContext(); + const { spaceId, setSpaceId } = useSpaceId(); + + const { toast } = useToast(); + const client = useClient(); + const sendMsgNewSpace = client.WardenWardenV1Beta2.tx.sendMsgNewSpace; + + const { QuerySpacesByOwner } = useWardenWardenV1Beta2(); + const { data: spacesQuery } = QuerySpacesByOwner( + { owner: address }, + { enabled: !!address }, + 100, + ); + const count = + ((spacesQuery as any)?.pages[0] as SpacesQueryResult | undefined) + ?.spaces?.length || 0; + + return count && count > 0 ? ( + + + + + + +
+ {count && count > 0 ? ( +
+ {( + (spacesQuery as any)?.pages[0] as + | SpacesQueryResult + | undefined + )?.spaces?.map((space) => ( +
setSpaceId(space.id || null)} + className="flex flex-row items-center space-x-4 cursor-pointer" + > +
+ +
+
+ {"Space #" + space.id} +
+
+ ))} +
+ ) : null} +
+ +
+
+
+
+ ) : null; +} diff --git a/spaceward/src/features/spaces/index.ts b/spaceward/src/features/spaces/index.ts index 17f25e015..776ae63c5 100644 --- a/spaceward/src/features/spaces/index.ts +++ b/spaceward/src/features/spaces/index.ts @@ -1,2 +1,3 @@ export * from "./Spaces"; -export * from "./NoActiveSpace"; +export * from "./NoSpaces"; +export * from "./SpaceSelector"; diff --git a/spaceward/src/features/wallet/Connect.tsx b/spaceward/src/features/wallet/Connect.tsx index 7a8fea12c..2b37c2b9e 100644 --- a/spaceward/src/features/wallet/Connect.tsx +++ b/spaceward/src/features/wallet/Connect.tsx @@ -2,61 +2,61 @@ import { MouseEventHandler } from "react"; import { Button as UIButton } from "@/components/ui/button"; export type ButtonProps = { - text?: string; - disabled?: boolean; - onClick?: MouseEventHandler; + text?: string; + disabled?: boolean; + onClick?: MouseEventHandler; }; export type ConnectProps = Pick; function noop() { - return false; + return false; } export function Button({ text, disabled, onClick = noop }: ButtonProps) { - return ( - - {text} - - ); + return ( + + {text} + + ); } export const ButtonConnect = ({ - text = "Connect", - onClick = noop, + text = "Connect", + onClick = noop, }: ConnectProps) =>
-
-
+
*/} +
- + {/*
+
*/} +
+
-
+
{spaceNavItems.map((item) => ( {item.icon} @@ -309,8 +301,8 @@ export function Sidebar() {
- -
+ +
{globalNavItems.map((item) => ( {item.icon} diff --git a/spaceward/src/layouts/site-header.tsx b/spaceward/src/layouts/site-header.tsx index cf15ac738..6039d7a41 100644 --- a/spaceward/src/layouts/site-header.tsx +++ b/spaceward/src/layouts/site-header.tsx @@ -7,6 +7,7 @@ import { Button } from "@/components/ui/button"; import { MenuIcon } from "lucide-react"; import { MobileNav } from "./mobile-nav"; import { WalletConnect } from "../features/walletconnect/WalletConnect"; +import { SpaceSelector } from "@/features/spaces"; export function SiteHeader() { const [open, setOpen] = useState(false); @@ -18,8 +19,8 @@ export function SiteHeader() { }, [location]); return ( -
-
+
+
{/* Mobile Nav */}
- - - - -
diff --git a/spaceward/src/pages/Actions.tsx b/spaceward/src/pages/Actions.tsx index ba6730890..d3fbbd4a2 100644 --- a/spaceward/src/pages/Actions.tsx +++ b/spaceward/src/pages/Actions.tsx @@ -5,17 +5,17 @@ export function ActionsPage() { const { address } = useAddressContext(); if (!address) { return ( -
+

Your actions

Connect your wallet to see your actions

); } return ( -
-
+
+
-

Actions

+

Actions

diff --git a/spaceward/src/pages/Apps.tsx b/spaceward/src/pages/Apps.tsx index 692fba242..126be5889 100644 --- a/spaceward/src/pages/Apps.tsx +++ b/spaceward/src/pages/Apps.tsx @@ -3,9 +3,9 @@ import { Apps } from "@/features/apps"; export function AppsPage() { return (
-
+
-

Apps

+

dApps

diff --git a/spaceward/src/pages/AppsOpen.tsx b/spaceward/src/pages/AppsOpen.tsx index 5c2723c3f..a75ad30c6 100644 --- a/spaceward/src/pages/AppsOpen.tsx +++ b/spaceward/src/pages/AppsOpen.tsx @@ -3,8 +3,14 @@ export function AppsOpenPage() { const url = queryParameters.get("url") || ""; return ( -
-
+
+
+
+

dApps

+

+
+
+