From 5f94a54ebc143ec3cbb18f15775ec5abae103df7 Mon Sep 17 00:00:00 2001 From: Tomek Marciniak Date: Sat, 29 Jun 2024 19:33:38 +0200 Subject: [PATCH] feat(staking): add validators list --- CONTRIBUTING.md | 2 +- README.md | 2 +- apps/extension/.env.example | 4 +- apps/extension/package.json | 2 +- apps/extension/public/pallad_rpc.js | 41 ++++++------- packages/features/package.json | 3 +- .../src/common/assets/placeholder.svg | 1 + .../features/src/components/menu-drawer.tsx | 8 +++ .../components/block-producer-tile.tsx | 58 ++++++++++++++----- .../src/staking/components/delegate-form.tsx | 14 ++++- .../features/src/staking/index.stories.tsx | 14 ++++- .../src/staking/routes/block-producers.tsx | 25 ++++---- packages/features/src/staking/types.ts | 7 +++ .../src/staking/views/block-producers.tsx | 22 ++++--- .../account-info-provider.test.ts | 2 +- .../chain-history-provider.test.ts | 3 +- .../node-status-provider.test.ts | 2 +- .../submit-tx-provider.test.ts | 2 +- .../account-info-provider.test.ts | 2 +- .../unified-provider.test.ts | 2 +- packages/vault/src/network-info/default.ts | 4 +- pallad_icon.svg | 2 +- pnpm-lock.yaml | 9 +++ 23 files changed, 150 insertions(+), 81 deletions(-) create mode 100644 packages/features/src/common/assets/placeholder.svg create mode 100644 packages/features/src/staking/types.ts diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7fa99cdc..bf78df6e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -64,7 +64,7 @@ Project maintainers may be able to provide more clarification on what is a repre ### Enforcement Instances of abusive, harassing, -or otherwise unacceptable behavior should be reported to the project team at team@pallad.xyz. +or otherwise unacceptable behavior should be reported to the project team at team@palladians.xyz. All complaints will be reviewed, investigated, and we will respond to the circumstances. The project team is obligated to maintain confidentiality concerning the reporter of an incident. diff --git a/README.md b/README.md index c314f2ff..7be73ff2 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,7 @@ We specified contributing guidelines. Please refer to them before starting contr ## Links 🌍 -[pallad.xyz - The official website of Pallad](https://pallad.xyz/) +[pallad.co - The official website of Pallad](https://get.pallad.co/website) [Ladle](https://palladians.github.io/pallad/) diff --git a/apps/extension/.env.example b/apps/extension/.env.example index 4b6c58d0..7b46d0eb 100644 --- a/apps/extension/.env.example +++ b/apps/extension/.env.example @@ -1,6 +1,6 @@ VITE_APP_MODE=web VITE_APP_DEFAULT_NETWORK=Devnet -VITE_APP_MINA_PROXY_MAINNET_URL=https://api.minascan.io/node/mainnet/v1/graphql +VITE_APP_MINA_PROXY_MAINNET_URL=https://pallad.co/api/obscura/mainnet.json -VITE_APP_MINA_PROXY_DEVNET_URL=https://api.minascan.io/node/devnet/v1/graphql +VITE_APP_MINA_PROXY_DEVNET_URL=https://pallad.co/api/obscura/devnet.json diff --git a/apps/extension/package.json b/apps/extension/package.json index 5f2e3179..df322f2c 100644 --- a/apps/extension/package.json +++ b/apps/extension/package.json @@ -1,6 +1,6 @@ { "name": "@palladxyz/extension", - "version": "0.5.3", + "version": "0.5.4", "type": "module", "scripts": { "dev": "vite", diff --git a/apps/extension/public/pallad_rpc.js b/apps/extension/public/pallad_rpc.js index 8e6a983b..075caa00 100644 --- a/apps/extension/public/pallad_rpc.js +++ b/apps/extension/public/pallad_rpc.js @@ -36,11 +36,13 @@ const callPalladAsync = ({ method, payload }) => }) const debouncedCall = debounce(callPalladAsync, 300, false) const init = () => { - window.mina = { - wallet: { - name: "Pallad", - icon: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTY1IiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDE2NSAyMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik04Mi4zNTMgMTg4LjIzNkM4Mi4zNTMgMTg4LjIzNiAxNTIuOTQxIDE1Mi45NDIgMTUyLjk0MSAxMDAuMDAxVjM4LjIzNjJMODIuMzUzIDExLjc2NTZMMTEuNzY0OCAzOC4yMzYyVjEwMC4wMDFDMT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w5MCAyMTBaIiBmaWxsPSIjMjUyMzNBIi8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDBfMTk4XzI0Njk1Ij4KPHJlY3Qgd2lkdGg9IjMwMCIgaGVpZ2h0PSIzMDAiIHJ4PSI0MCIgZmlsbD0id2hpdGUiLz4KPC9jbGlwUGF0aD4KPC9kZWZzPgo8L3N2Zz4K", + rdns: "co.pallad.wallet", + } + const provider = { request: async ({ method, params }) => debouncedCall({ method, @@ -59,9 +61,6 @@ const init = () => { payload: { origin: window.location.origin }, }) }, - otherOn: async () => { - return "hello world!" - }, /* Note: `listenerId` is used as a placeholder to identify listener functions. Since functions can't be serialized over postMessage, you need to implement @@ -76,20 +75,6 @@ const init = () => { payload: { event, listenerId }, }) }, - /*once: async (event, listenerId) => { - const response = await debouncedCall({ - method: 'once', - payload: { event, listenerId } - }) - return response - }, - removeListener: async (event, listenerId) => { - const response = await debouncedCall({ - method: 'removeListener', - payload: { event, listenerId } - }) - return response - },*/ off: async (event, listenerId) => { return debouncedCall({ method: "off", @@ -97,5 +82,17 @@ const init = () => { }) }, } + window.mina = provider + const announceProvider = () => { + window.dispatchEvent( + new CustomEvent("mina:announceProvider", { + detail: Object.freeze({ info, provider }), + }), + ) + } + window.addEventListener("mina:requestProvider", (event) => { + announceProvider() + }) + announceProvider() } init() diff --git a/packages/features/package.json b/packages/features/package.json index 4e543d39..638da6e4 100644 --- a/packages/features/package.json +++ b/packages/features/package.json @@ -1,6 +1,6 @@ { "name": "@palladxyz/features", - "version": "0.5.3", + "version": "0.5.4", "description": "", "type": "module", "module": "dist/index.js", @@ -43,6 +43,7 @@ "@palladxyz/persistence": "workspace:*", "@palladxyz/vault": "workspace:*", "@total-typescript/ts-reset": "^0.5.1", + "array-shuffle": "^3.0.0", "class-variance-authority": "^0.7.0", "clsx": "^2.1.0", "cmdk": "^0.2.0", diff --git a/packages/features/src/common/assets/placeholder.svg b/packages/features/src/common/assets/placeholder.svg new file mode 100644 index 00000000..aa87f867 --- /dev/null +++ b/packages/features/src/common/assets/placeholder.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/features/src/components/menu-drawer.tsx b/packages/features/src/components/menu-drawer.tsx index b6d016c5..cd46e031 100644 --- a/packages/features/src/components/menu-drawer.tsx +++ b/packages/features/src/components/menu-drawer.tsx @@ -58,6 +58,14 @@ export const MenuDrawer = () => {
+ ) } diff --git a/packages/features/src/staking/components/delegate-form.tsx b/packages/features/src/staking/components/delegate-form.tsx index f5616296..f52b9900 100644 --- a/packages/features/src/staking/components/delegate-form.tsx +++ b/packages/features/src/staking/components/delegate-form.tsx @@ -1,7 +1,7 @@ import { zodResolver } from "@hookform/resolvers/zod" import { useEffect } from "react" import { useForm } from "react-hook-form" -import { useLocation, useNavigate } from "react-router-dom" +import { Link, useLocation, useNavigate } from "react-router-dom" import { TransactionFee } from "@/common/lib/const" import { useTransactionStore } from "@/common/store/transaction" @@ -10,6 +10,7 @@ import { FormError } from "@/components/form-error" import { FeePicker, TransactionFeeShort } from "@/components/fee-picker" import type { SendFormSchemaProps } from "@/send/components/send-form.schema" import { TransactionType } from "@palladxyz/mina-core" +import { ExternalLinkIcon } from "lucide-react" import { DelegateFormSchema } from "./delegate-form.schema" type DelegateFormProps = { @@ -58,7 +59,16 @@ export const DelegateForm = ({ advanced, setAdvanced }: DelegateFormProps) => { className="flex flex-col flex-1 gap-4 px-8 pb-8 items-center" onSubmit={handleSubmit(onSubmit)} > -

New Stake

+

Select a validator

+ +

Find a validator

+
+ +
+
= ({ advanced }) => ( export const Producers = () => ( console.log("go back")} /> diff --git a/packages/features/src/staking/routes/block-producers.tsx b/packages/features/src/staking/routes/block-producers.tsx index 8231df44..cdb106a8 100644 --- a/packages/features/src/staking/routes/block-producers.tsx +++ b/packages/features/src/staking/routes/block-producers.tsx @@ -1,28 +1,23 @@ import { useNavigate } from "react-router-dom" +import { fetcher } from "@/common/lib/fetch" +import useSWR from "swr" +import type { BlockProducer } from "../types" import { BlockProducersView } from "../views/block-producers" -const MOCKED_PRODUCERS = [ - { - name: "Pallad", - publicKey: "B62qkYa1o6Mj6uTTjDQCob7FYZspuhkm4RRQhgJg9j4koEBWiSrTQrS", - stake: 24000, - delegatorsCount: 6000, - }, - { - name: "Pallad 2", - publicKey: "B62qkYa1o6Mj6uTTjDQCob7FYZspuhkm4RRQhgJg9j4koEBWiSrTQrS", - stake: 12000, - delegatorsCount: 3000, - }, -] +const STAKEPOOLS_URL = "https://pallad.co/api/stakepools.json" + +type StakePoolsResponse = { + content: BlockProducer[] +} export const BlockProducersRoute = () => { + const { data } = useSWR(STAKEPOOLS_URL, fetcher) const navigate = useNavigate() return ( navigate(-1)} - blockProducers={MOCKED_PRODUCERS} + blockProducers={data?.content ?? []} /> ) } diff --git a/packages/features/src/staking/types.ts b/packages/features/src/staking/types.ts new file mode 100644 index 00000000..28438b01 --- /dev/null +++ b/packages/features/src/staking/types.ts @@ -0,0 +1,7 @@ +export type BlockProducer = { + name?: string + pk: string + delegators: number + amountStaked: number + img?: string +} diff --git a/packages/features/src/staking/views/block-producers.tsx b/packages/features/src/staking/views/block-producers.tsx index 15818762..25696b15 100644 --- a/packages/features/src/staking/views/block-producers.tsx +++ b/packages/features/src/staking/views/block-producers.tsx @@ -1,13 +1,10 @@ import { AppLayout } from "@/components/app-layout" +import { MenuBar } from "@/components/menu-bar" +import arrayShuffle from "array-shuffle" +import { take } from "rambda" import { BlockProducerTile } from "../components/block-producer-tile" - -type BlockProducer = { - name: string - publicKey: string - stake: number - delegatorsCount: number -} +import type { BlockProducer } from "../types" type BlockProducersViewProps = { onGoBack: () => void @@ -18,14 +15,15 @@ export const BlockProducersView = ({ onGoBack, blockProducers, }: BlockProducersViewProps) => { + const randomTwentyProducers = arrayShuffle(take(20, blockProducers)) return ( -
- {blockProducers.map((producer, i) => ( - // biome-ignore lint: hardcoded for now - + +
+

Select a validator

+ {randomTwentyProducers.map((producer) => ( + ))} -
) diff --git a/packages/providers/test/mina-node/l1-mina-node/individual-providers/account-info-provider.test.ts b/packages/providers/test/mina-node/l1-mina-node/individual-providers/account-info-provider.test.ts index b198715f..729e55e2 100644 --- a/packages/providers/test/mina-node/l1-mina-node/individual-providers/account-info-provider.test.ts +++ b/packages/providers/test/mina-node/l1-mina-node/individual-providers/account-info-provider.test.ts @@ -3,7 +3,7 @@ import type { TokenIdMap } from "@palladxyz/mina-core" import { MinaNode } from "../../../../src" const nodeUrl = - process.env.NODE_URL || "https://api.minascan.io/node/devnet/v1/graphql" + process.env.NODE_URL || "https://pallad.co/api/obscura/devnet.json" const publicKey = process.env.PUBLIC_KEY || "B62qkAqbeE4h1M5hop288jtVYxK1MsHVMMcBpaWo8qdsAztgXaHH1xq" diff --git a/packages/providers/test/mina-node/l1-mina-node/individual-providers/chain-history-provider.test.ts b/packages/providers/test/mina-node/l1-mina-node/individual-providers/chain-history-provider.test.ts index 013cff7c..1fa301e6 100644 --- a/packages/providers/test/mina-node/l1-mina-node/individual-providers/chain-history-provider.test.ts +++ b/packages/providers/test/mina-node/l1-mina-node/individual-providers/chain-history-provider.test.ts @@ -2,8 +2,7 @@ import type { Mina } from "@palladxyz/mina-core" import { MinaNode } from "../../../../src" const nodeUrl = - process.env.ARCHIVE_NODE_URL || - "https://api.minascan.io/node/devnet/v1/graphql" + process.env.ARCHIVE_NODE_URL || "https://pallad.co/api/obscura/devnet.json" const publicKey = process.env.PUBLIC_KEY || "B62qjsV6WQwTeEWrNrRRBP6VaaLvQhwWTnFi4WP4LQjGvpfZEumXzxb" diff --git a/packages/providers/test/mina-node/l1-mina-node/individual-providers/node-status-provider.test.ts b/packages/providers/test/mina-node/l1-mina-node/individual-providers/node-status-provider.test.ts index 83e2d232..b7b09887 100644 --- a/packages/providers/test/mina-node/l1-mina-node/individual-providers/node-status-provider.test.ts +++ b/packages/providers/test/mina-node/l1-mina-node/individual-providers/node-status-provider.test.ts @@ -1,7 +1,7 @@ import { MinaNode } from "../../../../src" const nodeUrl = - process.env.NODE_URL || "https://api.minascan.io/node/devnet/v1/graphql" + process.env.NODE_URL || "https://pallad.co/api/obscura/devnet.json" // TODO: change this to local network describe("Blockberry Node Status Provider (Functional)", () => { diff --git a/packages/providers/test/mina-node/l1-mina-node/individual-providers/submit-tx-provider.test.ts b/packages/providers/test/mina-node/l1-mina-node/individual-providers/submit-tx-provider.test.ts index cade3afa..a75ba515 100644 --- a/packages/providers/test/mina-node/l1-mina-node/individual-providers/submit-tx-provider.test.ts +++ b/packages/providers/test/mina-node/l1-mina-node/individual-providers/submit-tx-provider.test.ts @@ -13,7 +13,7 @@ import type { import { MinaNode } from "../../../../src" const nodeUrl = - process.env.NODE_URL || "https://api.minascan.io/node/devnet/v1/graphql" + process.env.NODE_URL || "https://pallad.co/api/obscura/devnet.json" const publicKey = process.env.PUBLIC_KEY || "B62qjsV6WQwTeEWrNrRRBP6VaaLvQhwWTnFi4WP4LQjGvpfZEumXzxb" diff --git a/packages/providers/test/unified-providers/individual-providers/account-info-provider.test.ts b/packages/providers/test/unified-providers/individual-providers/account-info-provider.test.ts index 94014036..6f2c5e9a 100644 --- a/packages/providers/test/unified-providers/individual-providers/account-info-provider.test.ts +++ b/packages/providers/test/unified-providers/individual-providers/account-info-provider.test.ts @@ -3,7 +3,7 @@ import type { TokenIdMap } from "@palladxyz/mina-core" import { type ProviderConfig, createAccountInfoProvider } from "../../../src" const minaNodeApiUrl = - process.env.NODE_URL || "https://api.minascan.io/node/devnet/v1/graphql" + process.env.NODE_URL || "https://pallad.co/api/obscura/devnet.json" const obscuraUrl = process.env.OBSCURA_URL || "https://pallad.co/api/obscura/devnet.json" const publicKey = diff --git a/packages/providers/test/unified-providers/unified-provider.test.ts b/packages/providers/test/unified-providers/unified-provider.test.ts index 44a517e9..d1b846fb 100644 --- a/packages/providers/test/unified-providers/unified-provider.test.ts +++ b/packages/providers/test/unified-providers/unified-provider.test.ts @@ -6,7 +6,7 @@ import { type ProviderConfig, createChainProvider } from "../../src" const explorerUrl = process.env.EXPLORER_URL || "https://minascan.io/devnet/api/" const nodeUrl = - process.env.NODE_URL || "https://api.minascan.io/node/devnet/v1/graphql" + process.env.NODE_URL || "https://pallad.co/api/obscura/devnet.json" const publicKey = process.env.PUBLIC_KEY || "B62qjsV6WQwTeEWrNrRRBP6VaaLvQhwWTnFi4WP4LQjGvpfZEumXzxb" diff --git a/packages/vault/src/network-info/default.ts b/packages/vault/src/network-info/default.ts index 7f38ae62..47fe46ec 100644 --- a/packages/vault/src/network-info/default.ts +++ b/packages/vault/src/network-info/default.ts @@ -10,7 +10,7 @@ export const DEFAULT_NETWORK_INFO: Record = { Devnet: { nodeEndpoint: { providerName: "mina-node", - url: "https://api.minascan.io/node/devnet/v1/graphql", + url: "https://pallad.co/api/obscura/devnet.json", }, archiveNodeEndpoint: { providerName: "mina-scan", @@ -23,7 +23,7 @@ export const DEFAULT_NETWORK_INFO: Record = { /*Mainnet: { nodeEndpoint: { providerName: 'mina-node', - url: 'https://api.minascan.io/node/mainnet/v1/graphql' + url: 'https://pallad.co/api/obscura/mainnet.json' }, archiveNodeEndpoint: { providerName: 'mina-node', diff --git a/pallad_icon.svg b/pallad_icon.svg index 860e6200..d1d0d627 100644 --- a/pallad_icon.svg +++ b/pallad_icon.svg @@ -1,4 +1,4 @@ - + diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0de35f61..6625b679 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -233,6 +233,9 @@ importers: '@total-typescript/ts-reset': specifier: ^0.5.1 version: 0.5.1 + array-shuffle: + specifier: ^3.0.0 + version: 3.0.0 class-variance-authority: specifier: ^0.7.0 version: 0.7.0 @@ -2978,6 +2981,10 @@ packages: resolution: {integrity: sha512-Q6VPTLMsmXZ47ENG3V+wQyZS1ZxXMxFyYzA+Z/GMrJ6yIutAIEf9wTyroTzmGjNfox9/h3GdGBCVh43GVFx4Uw==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + array-shuffle@3.0.0: + resolution: {integrity: sha512-rogEGxHOQPhslOhpg12LJkB+bbAl484/s2AJq0BxtzQDQfKl76fS2u9zWgg3p3b9ENcuvE7K8A7l5ddiPjCRnw==} + engines: {node: '>=12.20'} + array-union@2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} @@ -10184,6 +10191,8 @@ snapshots: array-differ@4.0.0: {} + array-shuffle@3.0.0: {} + array-union@2.1.0: {} array-union@3.0.1: {}