diff --git a/.browserslistrc b/.browserslistrc
new file mode 100644
index 0000000000..92bf34cff3
--- /dev/null
+++ b/.browserslistrc
@@ -0,0 +1,11 @@
+[production]
+last 2 major versions and >0.2%
+Firefox ESR
+not dead
+not ie 11
+not op_mini all
+
+[development]
+last 1 chrome version
+last 1 firefox version
+last 1 safari version
diff --git a/.eslintrc.json b/.eslintrc.json
index bb842cb7a7..31e2dbeca4 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -24,16 +24,9 @@
"react/react-in-jsx-scope": 0,
"react/display-name": 0,
"react/prop-types": 0,
- "@typescript-eslint/explicit-function-return-type": 0,
- "@typescript-eslint/explicit-module-boundary-types": 0,
- "@typescript-eslint/explicit-member-accessibility": 0,
- "@typescript-eslint/indent": 0,
- "@typescript-eslint/member-delimiter-style": 0,
- "@typescript-eslint/ban-ts-comment": 0,
"@typescript-eslint/no-non-null-assertion": 0,
- "@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-var-requires": 0,
- "@typescript-eslint/no-use-before-define": 0,
+ "@typescript-eslint/ban-ts-comment": 0,
"@typescript-eslint/no-unused-vars": [
2,
{
diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml
deleted file mode 100644
index ab46c7107f..0000000000
--- a/.github/workflows/pull-request.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-on:
- pull_request:
- types: [opened, synchronize]
-
-jobs:
- test:
- name: yarn test-all
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - uses: actions/setup-node@v2
- with:
- node-version: lts/*
- cache: yarn
- - run: yarn install
- - run: yarn test-all
diff --git a/.gitignore b/.gitignore
index 6f921c7f24..f4cc61e3f6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -33,5 +33,10 @@ yarn-error.log*
# vercel
.vercel
+# visual studio
+.vscode
+
+.npmrc
+.env
# TypeScript cache
*.tsbuildinfo
diff --git a/.prettierrc b/.prettierrc
index b2095be81e..9e4c08afed 100644
--- a/.prettierrc
+++ b/.prettierrc
@@ -1,4 +1,5 @@
{
- "semi": false,
- "singleQuote": true
+ "semi": true,
+ "singleQuote": true,
+ "trailingComma": "all"
}
diff --git a/.vscode/settings.json b/.vscode/settings.json
deleted file mode 100644
index bf6b9c08ba..0000000000
--- a/.vscode/settings.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "typescript.tsdk": "node_modules/typescript/lib",
- "cSpell.words": ["Addin", "blockworks", "solana"]
-}
diff --git a/@types/buffer-layout.d.ts b/@types/buffer-layout.d.ts
index a9dd43d306..31445e0cfc 100644
--- a/@types/buffer-layout.d.ts
+++ b/@types/buffer-layout.d.ts
@@ -1,90 +1,90 @@
declare module 'buffer-layout' {
export class Layout {
- span: number
- property?: string
+ span: number;
+ property?: string;
- constructor(span: number, property?: string)
+ constructor(span: number, property?: string);
- decode(b: Buffer, offset?: number): T
- encode(src: T, b: Buffer, offset?: number): number
- getSpan(b: Buffer, offset?: number): number
- replicate(name: string): this
+ decode(b: Buffer, offset?: number): T;
+ encode(src: T, b: Buffer, offset?: number): number;
+ getSpan(b: Buffer, offset?: number): number;
+ replicate(name: string): this;
}
export interface EnumLayout extends Layout {
- registry: Record>
+ registry: Record>;
}
export class Structure extends Layout {
- span: any
+ span: any;
}
export function greedy(
elementSpan?: number,
- property?: string
- ): Layout
+ property?: string,
+ ): Layout;
export function offset(
layout: Layout,
offset?: number,
- property?: string
- ): Layout
- export function u8(property?: string): Layout
- export function u16(property?: string): Layout
- export function u24(property?: string): Layout
- export function u32(property?: string): Layout
- export function u40(property?: string): Layout
- export function u48(property?: string): Layout
- export function nu64(property?: string): Layout
- export function u16be(property?: string): Layout
- export function u24be(property?: string): Layout
- export function u32be(property?: string): Layout
- export function u40be(property?: string): Layout
- export function u48be(property?: string): Layout
- export function nu64be(property?: string): Layout
- export function s8(property?: string): Layout
- export function s16(property?: string): Layout
- export function s24(property?: string): Layout
- export function s32(property?: string): Layout
- export function s40(property?: string): Layout
- export function s48(property?: string): Layout
- export function ns64(property?: string): Layout
- export function s16be(property?: string): Layout
- export function s24be(property?: string): Layout
- export function s32be(property?: string): Layout
- export function s40be(property?: string): Layout
- export function s48be(property?: string): Layout
- export function ns64be(property?: string): Layout
- export function f32(property?: string): Layout
- export function f32be(property?: string): Layout
- export function f64(property?: string): Layout
- export function f64be(property?: string): Layout
+ property?: string,
+ ): Layout;
+ export function u8(property?: string): Layout;
+ export function u16(property?: string): Layout;
+ export function u24(property?: string): Layout;
+ export function u32(property?: string): Layout;
+ export function u40(property?: string): Layout;
+ export function u48(property?: string): Layout;
+ export function nu64(property?: string): Layout;
+ export function u16be(property?: string): Layout;
+ export function u24be(property?: string): Layout;
+ export function u32be(property?: string): Layout;
+ export function u40be(property?: string): Layout;
+ export function u48be(property?: string): Layout;
+ export function nu64be(property?: string): Layout;
+ export function s8(property?: string): Layout;
+ export function s16(property?: string): Layout;
+ export function s24(property?: string): Layout;
+ export function s32(property?: string): Layout;
+ export function s40(property?: string): Layout;
+ export function s48(property?: string): Layout;
+ export function ns64(property?: string): Layout;
+ export function s16be(property?: string): Layout;
+ export function s24be(property?: string): Layout;
+ export function s32be(property?: string): Layout;
+ export function s40be(property?: string): Layout;
+ export function s48be(property?: string): Layout;
+ export function ns64be(property?: string): Layout;
+ export function f32(property?: string): Layout;
+ export function f32be(property?: string): Layout;
+ export function f64(property?: string): Layout;
+ export function f64be(property?: string): Layout;
export function struct(
fields: Layout[],
property?: string,
- decodePrefixes?: boolean
- ): Layout
+ decodePrefixes?: boolean,
+ ): Layout;
export function bits(
word: Layout,
msb?: boolean,
- property?: string
- ): any
+ property?: string,
+ ): any;
export function seq(
elementLayout: Layout,
count: number | Layout,
- property?: string
- ): Layout
+ property?: string,
+ ): Layout;
export function union(
discr: Layout,
defaultLayout?: any,
- property?: string
- ): any
+ property?: string,
+ ): any;
export function unionLayoutDiscriminator(
layout: Layout,
- property?: string
- ): any
+ property?: string,
+ ): any;
export function blob(
length: number | Layout,
- property?: string
- ): Layout
- export function cstr(property?: string): Layout
- export function utf8(maxSpan: number, property?: string): Layout
+ property?: string,
+ ): Layout;
+ export function cstr(property?: string): Layout;
+ export function utf8(maxSpan: number, property?: string): Layout;
}
diff --git a/@types/index.d.ts b/@types/index.d.ts
index 9b9471da0d..091d25e210 100644
--- a/@types/index.d.ts
+++ b/@types/index.d.ts
@@ -1,4 +1,4 @@
declare module '*.svg' {
- const content: any
- export default content
+ const content: any;
+ export default content;
}
diff --git a/@types/types.ts b/@types/types.ts
index a9c06fd276..34444e3080 100644
--- a/@types/types.ts
+++ b/@types/types.ts
@@ -1,12 +1,12 @@
-import type { AccountInfo, PublicKey } from '@solana/web3.js'
+import type { AccountInfo, PublicKey } from '@solana/web3.js';
export interface EndpointInfo {
- name: string
- url: string
+ name: string;
+ url: string;
}
export interface TokenAccount {
- pubkey: PublicKey
- account: AccountInfo | null
- effectiveMint: PublicKey
+ pubkey: PublicKey;
+ account: AccountInfo | null;
+ effectiveMint: PublicKey;
}
diff --git a/Strategies/components/CreateRefLink.tsx b/Strategies/components/CreateRefLink.tsx
index 90539bacb5..982ec2770f 100644
--- a/Strategies/components/CreateRefLink.tsx
+++ b/Strategies/components/CreateRefLink.tsx
@@ -4,74 +4,74 @@ import {
makeRegisterReferrerIdInstruction,
MangoGroup,
INFO_LEN,
-} from '@blockworks-foundation/mango-client'
-import Button, { LinkButton } from '@components/Button'
-import Input from '@components/inputs/Input'
-import Tooltip from '@components/Tooltip'
-import { DuplicateIcon } from '@heroicons/react/outline'
-import useGovernanceAssets from '@hooks/useGovernanceAssets'
-import { PublicKey, Transaction } from '@solana/web3.js'
-import { notify } from '@utils/notifications'
-import { sendTransaction } from '@utils/send'
-import { useState, useEffect } from 'react'
-import useWalletStore from 'stores/useWalletStore'
-import { tryGetMangoAccount } from 'Strategies/protocols/mango/tools'
-import { MarketStore } from 'Strategies/store/marketStore'
-const minMngoToCreateLink = 10000
+} from '@blockworks-foundation/mango-client';
+import Button, { LinkButton } from '@components/Button';
+import Input from '@components/inputs/Input';
+import Tooltip from '@components/Tooltip';
+import { DuplicateIcon } from '@heroicons/react/outline';
+import useGovernanceAssets from '@hooks/useGovernanceAssets';
+import { PublicKey, Transaction } from '@solana/web3.js';
+import { notify } from '@utils/notifications';
+import { sendTransaction } from '@utils/send';
+import { useState, useEffect } from 'react';
+import useWalletStore from 'stores/useWalletStore';
+import { tryGetMangoAccount } from 'Strategies/protocols/mango/tools';
+import { MarketStore } from 'Strategies/store/marketStore';
+const minMngoToCreateLink = 10000;
const CreateRefForm = ({
selectedMangoAccount,
market,
mint,
}: {
- selectedMangoAccount: MangoAccount
- market: MarketStore
- mint: PublicKey
+ selectedMangoAccount: MangoAccount;
+ market: MarketStore;
+ mint: PublicKey;
}) => {
- const connection = useWalletStore((s) => s.connection)
+ const connection = useWalletStore((s) => s.connection);
const link =
connection.cluster === 'devnet'
? `http://devnet.mango.markets/?ref=`
- : `https://trade.mango.markets/?ref`
+ : `https://trade.mango.markets/?ref`;
const depositIndex = market.group!.tokens.findIndex(
- (x) => x.mint.toBase58() === mint.toBase58()
- )
- const { canUseTransferInstruction } = useGovernanceAssets()
+ (x) => x.mint.toBase58() === mint.toBase58(),
+ );
+ const { canUseTransferInstruction } = useGovernanceAssets();
- const wallet = useWalletStore((s) => s.current)
+ const wallet = useWalletStore((s) => s.current);
const currentPosition = selectedMangoAccount
.getUiDeposit(
market.cache!.rootBankCache[depositIndex],
market.group!,
- depositIndex
+ depositIndex,
)
- .toNumber()
- const [existingLinks, setExistingLinks] = useState([])
- const [linkGenerated, setLinkGenerated] = useState(false)
- const [linkName, setLinkName] = useState('')
- const connected = useWalletStore((s) => s.connected)
+ .toNumber();
+ const [existingLinks, setExistingLinks] = useState([]);
+ const [linkGenerated, setLinkGenerated] = useState(false);
+ const [linkName, setLinkName] = useState('');
+ const connected = useWalletStore((s) => s.connected);
const handleCreateLink = async () => {
- setLinkGenerated(false)
+ setLinkGenerated(false);
try {
- const signers = []
- const programId = market.client!.programId
- const mangoGroup = market.group
+ const signers = [];
+ const programId = market.client!.programId;
+ const mangoGroup = market.group;
const { referrerPda, encodedReferrerId } = await getReferrerPda(
mangoGroup!,
linkName,
- programId
- )
+ programId,
+ );
const instruction = makeRegisterReferrerIdInstruction(
programId,
mangoGroup!.publicKey,
selectedMangoAccount!.publicKey,
referrerPda,
wallet!.publicKey!,
- encodedReferrerId
- )
+ encodedReferrerId,
+ );
- const transaction = new Transaction()
- transaction.add(instruction)
+ const transaction = new Transaction();
+ transaction.add(instruction);
await sendTransaction({
transaction,
wallet,
@@ -79,29 +79,29 @@ const CreateRefForm = ({
signers,
sendingMessage: 'Creating ref link',
successMessage: 'Ref link created',
- })
- setLinkGenerated(true)
+ });
+ setLinkGenerated(true);
} catch (e) {
- setLinkGenerated(false)
- notify({ type: 'error', message: "Can't generate link" })
+ setLinkGenerated(false);
+ notify({ type: 'error', message: "Can't generate link" });
}
- }
+ };
const getReferrerPda = async (
mangoGroup: MangoGroup,
referrerId: string,
- programId: PublicKey
+ programId: PublicKey,
): Promise<{ referrerPda: PublicKey; encodedReferrerId: Buffer }> => {
- const encoded = Buffer.from(referrerId, 'utf8')
+ const encoded = Buffer.from(referrerId, 'utf8');
if (encoded.length > INFO_LEN) {
throw new Error(
- `info string too long. Must be less than or equal to ${INFO_LEN} bytes`
- )
+ `info string too long. Must be less than or equal to ${INFO_LEN} bytes`,
+ );
}
const encodedReferrerId = Buffer.concat([
encoded,
Buffer.alloc(INFO_LEN - encoded.length, 0),
- ])
+ ]);
// Generate the PDA pubkey
const [referrerIdRecordPk] = await PublicKey.findProgramAddress(
@@ -110,30 +110,32 @@ const CreateRefForm = ({
new Buffer('ReferrerIdRecord', 'utf-8'),
encodedReferrerId,
],
- programId
- )
+ programId,
+ );
- return { referrerPda: referrerIdRecordPk, encodedReferrerId }
- }
+ return { referrerPda: referrerIdRecordPk, encodedReferrerId };
+ };
useEffect(() => {
const getRefLinks = async () => {
- const client = market.client
- const mangoAccountPk = selectedMangoAccount!.publicKey
- const account = await tryGetMangoAccount(market, mangoAccountPk)
+ const client = market.client;
+ const mangoAccountPk = selectedMangoAccount!.publicKey;
+ const account = await tryGetMangoAccount(market, mangoAccountPk);
if (account) {
- const referrerIds = await client?.getReferrerIdsForMangoAccount(account)
+ const referrerIds = await client?.getReferrerIdsForMangoAccount(
+ account,
+ );
if (referrerIds) {
- setExistingLinks(referrerIds)
+ setExistingLinks(referrerIds);
}
}
- }
+ };
if (selectedMangoAccount) {
- getRefLinks()
+ getRefLinks();
} else {
- setExistingLinks([])
+ setExistingLinks([]);
}
- setLinkName('')
- }, [selectedMangoAccount])
+ setLinkName('');
+ }, [selectedMangoAccount]);
return (
{
- navigator.clipboard.writeText(`${link}${linkName}`)
+ navigator.clipboard.writeText(`${link}${linkName}`);
}}
>
@@ -203,7 +205,7 @@ const CreateRefForm = ({
{
- navigator.clipboard.writeText(`${link}${x.referrerId}`)
+ navigator.clipboard.writeText(`${link}${x.referrerId}`);
}}
>
@@ -214,7 +216,7 @@ const CreateRefForm = ({
) : null}
- )
-}
+ );
+};
-export default CreateRefForm
+export default CreateRefForm;
diff --git a/Strategies/components/Delegate.tsx b/Strategies/components/Delegate.tsx
index 62843358f5..967cdd034d 100644
--- a/Strategies/components/Delegate.tsx
+++ b/Strategies/components/Delegate.tsx
@@ -1,101 +1,101 @@
import {
MangoAccount,
makeSetDelegateInstruction,
-} from '@blockworks-foundation/mango-client'
-import AdditionalProposalOptions from '@components/AdditionalProposalOptions'
-import Button from '@components/Button'
-import Input from '@components/inputs/Input'
-import Loading from '@components/Loading'
-import Tooltip from '@components/Tooltip'
-import useCreateProposal from '@hooks/useCreateProposal'
-import useGovernanceAssets from '@hooks/useGovernanceAssets'
-import useQueryContext from '@hooks/useQueryContext'
-import useRealm from '@hooks/useRealm'
+} from '@blockworks-foundation/mango-client';
+import AdditionalProposalOptions from '@components/AdditionalProposalOptions';
+import Button from '@components/Button';
+import Input from '@components/inputs/Input';
+import Loading from '@components/Loading';
+import Tooltip from '@components/Tooltip';
+import useCreateProposal from '@hooks/useCreateProposal';
+import useGovernanceAssets from '@hooks/useGovernanceAssets';
+import useQueryContext from '@hooks/useQueryContext';
+import useRealm from '@hooks/useRealm';
import {
ProgramAccount,
Governance,
getInstructionDataFromBase64,
serializeInstructionToBase64,
-} from '@solana/spl-governance'
-import { PublicKey } from '@solana/web3.js'
-import { abbreviateAddress } from '@utils/formatting'
-import { validateInstruction } from '@utils/instructionTools'
-import { notify } from '@utils/notifications'
-import { getValidatedPublickKey } from '@utils/validations'
-import { InstructionDataWithHoldUpTime } from 'actions/createProposal'
-import { useRouter } from 'next/router'
-import { useState } from 'react'
-import { MarketStore } from 'Strategies/store/marketStore'
-import * as yup from 'yup'
+} from '@solana/spl-governance';
+import { PublicKey } from '@solana/web3.js';
+import { abbreviateAddress } from '@utils/formatting';
+import { validateInstruction } from '@utils/instructionTools';
+import { notify } from '@utils/notifications';
+import { getValidatedPublickKey } from '@utils/validations';
+import { InstructionDataWithHoldUpTime } from 'actions/createProposal';
+import { useRouter } from 'next/router';
+import { useState } from 'react';
+import { MarketStore } from 'Strategies/store/marketStore';
+import * as yup from 'yup';
const DelegateForm = ({
selectedMangoAccount,
governance,
market,
}: {
- selectedMangoAccount: MangoAccount
- governance: ProgramAccount
- market: MarketStore
+ selectedMangoAccount: MangoAccount;
+ governance: ProgramAccount;
+ market: MarketStore;
}) => {
- const router = useRouter()
- const { symbol } = useRealm()
- const { fmtUrlWithCluster } = useQueryContext()
- const { handleCreateProposal } = useCreateProposal()
- const { canUseTransferInstruction } = useGovernanceAssets()
- const groupConfig = market.groupConfig!
- const [voteByCouncil, setVoteByCouncil] = useState(false)
- const [isLoading, setIsLoading] = useState(false)
+ const router = useRouter();
+ const { symbol } = useRealm();
+ const { fmtUrlWithCluster } = useQueryContext();
+ const { handleCreateProposal } = useCreateProposal();
+ const { canUseTransferInstruction } = useGovernanceAssets();
+ const groupConfig = market.groupConfig!;
+ const [voteByCouncil, setVoteByCouncil] = useState(false);
+ const [isLoading, setIsLoading] = useState(false);
const [form, setForm] = useState({
title: '',
description: '',
delegateAddress: '',
- })
- const [formErrors, setFormErrors] = useState({})
+ });
+ const [formErrors, setFormErrors] = useState({});
const proposalTitle = `Set delegate for MNGO account: ${abbreviateAddress(
- selectedMangoAccount?.publicKey
- )}`
+ selectedMangoAccount?.publicKey,
+ )}`;
const handleSetForm = ({ propertyName, value }) => {
- setFormErrors({})
- setForm({ ...form, [propertyName]: value })
- }
+ setFormErrors({});
+ setForm({ ...form, [propertyName]: value });
+ };
const handleProposeDelegate = async () => {
- const isValid = await validateInstruction({ schema, form, setFormErrors })
+ const isValid = await validateInstruction({ schema, form, setFormErrors });
if (!isValid) {
- return
+ return;
}
- setIsLoading(true)
+ setIsLoading(true);
const delegateMangoAccount = makeSetDelegateInstruction(
groupConfig.mangoProgramId,
groupConfig.publicKey,
selectedMangoAccount!.publicKey,
governance!.pubkey,
- new PublicKey(form.delegateAddress)
- )
+ new PublicKey(form.delegateAddress),
+ );
try {
const instructionData: InstructionDataWithHoldUpTime = {
data: getInstructionDataFromBase64(
- serializeInstructionToBase64(delegateMangoAccount)
+ serializeInstructionToBase64(delegateMangoAccount),
),
holdUpTime: governance!.account!.config.minInstructionHoldUpTime,
prerequisiteInstructions: [],
- }
+ };
const proposalAddress = await handleCreateProposal({
title: form.title || proposalTitle,
description: form.description,
instructionsData: [instructionData],
governance: governance!,
voteByCouncil,
- })
+ });
const url = fmtUrlWithCluster(
- `/dao/${symbol}/proposal/${proposalAddress}`
- )
- router.push(url)
+ `/dao/${symbol}/proposal/${proposalAddress}`,
+ );
+ router.push(url);
} catch (e) {
- console.log(e)
- notify({ type: 'error', message: "Can't create proposal" })
+ console.error(e);
+ notify({ type: 'error', message: "Can't create proposal" });
}
- }
+ };
const schema = yup.object().shape({
delegateAddress: yup
.string()
@@ -105,21 +105,21 @@ const DelegateForm = ({
function (val: string) {
if (val) {
try {
- return !!getValidatedPublickKey(val)
+ return !!getValidatedPublickKey(val);
} catch (e) {
- console.log(e)
+ console.error(e);
return this.createError({
message: `${e}`,
- })
+ });
}
} else {
return this.createError({
message: `Delegate address is required`,
- })
+ });
}
- }
+ },
),
- })
+ });
return (
- )
-}
+ );
+};
-export default DelegateForm
+export default DelegateForm;
diff --git a/Strategies/components/DepositModal.tsx b/Strategies/components/DepositModal.tsx
index 7d3943adfc..fa6008a4b8 100644
--- a/Strategies/components/DepositModal.tsx
+++ b/Strategies/components/DepositModal.tsx
@@ -1,7 +1,7 @@
-import Modal from '@components/Modal'
-import ModalHeader from './ModalHeader'
-import MangoDeposit from './MangoDepositComponent'
-import BigNumber from 'bignumber.js'
+import Modal from '@components/Modal';
+import ModalHeader from './ModalHeader';
+import MangoDeposit from './MangoDepositComponent';
+import BigNumber from 'bignumber.js';
const DepositModal = ({
onClose,
@@ -18,8 +18,8 @@ const DepositModal = ({
governedTokenAccount,
}) => {
const currentPositionFtm = new BigNumber(
- currentPosition.toFixed(0)
- ).toFormat()
+ currentPosition.toFixed(0),
+ ).toFormat();
return (
) : null}
- )
-}
+ );
+};
-export default DepositModal
+export default DepositModal;
diff --git a/Strategies/components/MangoDepositComponent.tsx b/Strategies/components/MangoDepositComponent.tsx
index 4f4307c8cc..36701a1278 100644
--- a/Strategies/components/MangoDepositComponent.tsx
+++ b/Strategies/components/MangoDepositComponent.tsx
@@ -2,51 +2,51 @@ import {
MangoAccount,
MangoAccountLayout,
PublicKey,
-} from '@blockworks-foundation/mango-client'
-import Button, { LinkButton } from '@components/Button'
-import Input from '@components/inputs/Input'
-import Loading from '@components/Loading'
-import Tooltip from '@components/Tooltip'
-import useGovernanceAssets from '@hooks/useGovernanceAssets'
-import useQueryContext from '@hooks/useQueryContext'
-import useRealm from '@hooks/useRealm'
-import { getProgramVersionForRealm } from '@models/registry/api'
-import { BN } from '@project-serum/anchor'
+} from '@blockworks-foundation/mango-client';
+import Button, { LinkButton } from '@components/Button';
+import Input from '@components/inputs/Input';
+import Loading from '@components/Loading';
+import Tooltip from '@components/Tooltip';
+import useGovernanceAssets from '@hooks/useGovernanceAssets';
+import useQueryContext from '@hooks/useQueryContext';
+import useRealm from '@hooks/useRealm';
+import { getProgramVersionForRealm } from '@models/registry/api';
import {
getNativeTreasuryAddress,
RpcContext,
withCreateNativeTreasury,
-} from '@solana/spl-governance'
-import { SystemProgram, TransactionInstruction } from '@solana/web3.js'
+} from '@solana/spl-governance';
+import { SystemProgram, TransactionInstruction } from '@solana/web3.js';
import {
fmtMintAmount,
getMintDecimalAmount,
getMintMinAmountAsDecimal,
parseMintNaturalAmountFromDecimal,
-} from '@tools/sdk/units'
-import { abbreviateAddress, precision } from '@utils/formatting'
-import tokenService from '@utils/services/token'
-import { GovernedTokenAccount } from '@utils/tokens'
-import BigNumber from 'bignumber.js'
-import { useRouter } from 'next/router'
-import { useEffect, useState } from 'react'
-import useWalletStore from 'stores/useWalletStore'
-import useMarketStore, { MarketStore } from 'Strategies/store/marketStore'
-import { HandleCreateProposalWithStrategy } from 'Strategies/types/types'
-import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore'
-import ButtonGroup from '@components/ButtonGroup'
-import Switch from '@components/Switch'
-import Select from '@components/inputs/Select'
-import CreateRefForm from './CreateRefLink'
-import DelegateForm from './Delegate'
-import AdditionalProposalOptions from '@components/AdditionalProposalOptions'
-import { validateInstruction } from '@utils/instructionTools'
-import * as yup from 'yup'
-import { getValidatedPublickKey } from '@utils/validations'
+} from '@tools/sdk/units';
+import { abbreviateAddress, precision } from '@utils/formatting';
+import tokenService from '@utils/services/token';
+import { GovernedTokenAccount } from '@utils/tokens';
+import BigNumber from 'bignumber.js';
+import { useRouter } from 'next/router';
+import { useEffect, useState } from 'react';
+import useWalletStore from 'stores/useWalletStore';
+import useMarketStore, { MarketStore } from 'Strategies/store/marketStore';
+import { HandleCreateProposalWithStrategy } from 'Strategies/types/types';
+import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore';
+import ButtonGroup from '@components/ButtonGroup';
+import Switch from '@components/Switch';
+import Select from '@components/inputs/Select';
+import CreateRefForm from './CreateRefLink';
+import DelegateForm from './Delegate';
+import AdditionalProposalOptions from '@components/AdditionalProposalOptions';
+import { validateInstruction } from '@utils/instructionTools';
+import * as yup from 'yup';
+import { getValidatedPublickKey } from '@utils/validations';
+import { BN_ZERO } from '@utils/helpers';
-const DEPOSIT = 'Deposit'
-const CREATE_REF_LINK = 'Create Referral Link'
-const DELEGATE_ACCOUNT = 'Delegate'
+const DEPOSIT = 'Deposit';
+const CREATE_REF_LINK = 'Create Referral Link';
+const DELEGATE_ACCOUNT = 'Delegate';
const MangoDepositComponent = ({
handledMint,
@@ -55,14 +55,14 @@ const MangoDepositComponent = ({
mangoAccounts,
governedTokenAccount,
}: {
- handledMint: string
- currentPositionFtm: string
- createProposalFcn: HandleCreateProposalWithStrategy
- mangoAccounts: MangoAccount[]
- governedTokenAccount: GovernedTokenAccount
+ handledMint: string;
+ currentPositionFtm: string;
+ createProposalFcn: HandleCreateProposalWithStrategy;
+ mangoAccounts: MangoAccount[];
+ governedTokenAccount: GovernedTokenAccount;
}) => {
- const router = useRouter()
- const { fmtUrlWithCluster } = useQueryContext()
+ const router = useRouter();
+ const { fmtUrlWithCluster } = useQueryContext();
const {
proposals,
realmInfo,
@@ -71,139 +71,139 @@ const MangoDepositComponent = ({
mint,
councilMint,
symbol,
- } = useRealm()
- const [isDepositing, setIsDepositing] = useState(false)
+ } = useRealm();
+ const [isDepositing, setIsDepositing] = useState(false);
const [
selectedMangoAccount,
setSelectedMangoAccount,
] = useState(
- mangoAccounts.length ? mangoAccounts[0] : null
- )
- const [voteByCouncil, setVoteByCouncil] = useState(false)
- const client = useVoteStakeRegistryClientStore((s) => s.state.client)
- const market = useMarketStore((s) => s)
- const connection = useWalletStore((s) => s.connection)
- const wallet = useWalletStore((s) => s.current)
- const tokenInfo = tokenService.getTokenInfo(handledMint)
- const { canUseTransferInstruction } = useGovernanceAssets()
+ mangoAccounts.length ? mangoAccounts[0] : null,
+ );
+ const [voteByCouncil, setVoteByCouncil] = useState(false);
+ const client = useVoteStakeRegistryClientStore((s) => s.state.client);
+ const market = useMarketStore((s) => s);
+ const connection = useWalletStore((s) => s.connection);
+ const wallet = useWalletStore((s) => s.current);
+ const tokenInfo = tokenService.getTokenInfo(handledMint);
+ const { canUseTransferInstruction } = useGovernanceAssets();
const treasuryAmount = governedTokenAccount?.token
? governedTokenAccount.token.account.amount
- : new BN(0)
- const mintInfo = governedTokenAccount?.mint?.account
+ : BN_ZERO;
+ const mintInfo = governedTokenAccount?.mint?.account;
const [form, setForm] = useState({
title: '',
description: '',
delegateAddress: '',
delegateDeposit: false,
amount: '',
- })
- const [formErrors, setFormErrors] = useState({})
+ });
+ const [formErrors, setFormErrors] = useState({});
const proposalTitle = `Deposit ${form.amount} ${
tokenService.getTokenInfo(governedTokenAccount.mint!.publicKey.toBase58())
?.symbol || 'tokens'
- } to Mango account`
+ } to Mango account`;
const handleSetForm = ({ propertyName, value }) => {
- setFormErrors({})
- setForm({ ...form, [propertyName]: value })
- }
- const [proposalType, setProposalType] = useState('Deposit')
- const mintMinAmount = mintInfo ? getMintMinAmountAsDecimal(mintInfo) : 1
+ setFormErrors({});
+ setForm({ ...form, [propertyName]: value });
+ };
+ const [proposalType, setProposalType] = useState('Deposit');
+ const mintMinAmount = mintInfo ? getMintMinAmountAsDecimal(mintInfo) : 1;
const maxAmount = mintInfo
? getMintDecimalAmount(mintInfo, treasuryAmount)
- : new BigNumber(0)
- const maxAmountFtm = fmtMintAmount(mintInfo, treasuryAmount)
- const currentPrecision = precision(mintMinAmount)
- const group = market!.group!
+ : new BigNumber(0);
+ const maxAmountFtm = fmtMintAmount(mintInfo, treasuryAmount);
+ const currentPrecision = precision(mintMinAmount);
+ const group = market!.group!;
const depositIndex = group.tokens.findIndex(
- (x) => x.mint.toBase58() === handledMint
- )
+ (x) => x.mint.toBase58() === handledMint,
+ );
const tabs = [
{ val: DEPOSIT, isVisible: true },
{ val: CREATE_REF_LINK, isVisible: selectedMangoAccount !== null },
{ val: DELEGATE_ACCOUNT, isVisible: selectedMangoAccount !== null },
]
.filter((x) => x.isVisible)
- .map((x) => x.val)
+ .map((x) => x.val);
const validateAmountOnBlur = () => {
handleSetForm({
propertyName: 'amount',
value: parseFloat(
Math.max(
Number(mintMinAmount),
- Math.min(Number(Number.MAX_SAFE_INTEGER), Number(form.amount))
- ).toFixed(currentPrecision)
+ Math.min(Number(Number.MAX_SAFE_INTEGER), Number(form.amount)),
+ ).toFixed(currentPrecision),
),
- })
- }
+ });
+ };
useEffect(() => {
if (selectedMangoAccount === null) {
- setProposalType(DEPOSIT)
+ setProposalType(DEPOSIT);
}
- }, [selectedMangoAccount])
+ }, [selectedMangoAccount]);
const handleSolPayment = async () => {
- const instructions: TransactionInstruction[] = []
+ const instructions: TransactionInstruction[] = [];
const toAddress = await getNativeTreasuryAddress(
realm!.owner,
- governedTokenAccount!.governance!.pubkey
- )
+ governedTokenAccount!.governance!.pubkey,
+ );
const hasSolAccount = await connection.current.getParsedAccountInfo(
- toAddress
- )
+ toAddress,
+ );
if (!hasSolAccount.value) {
await withCreateNativeTreasury(
instructions,
realm!.owner,
governedTokenAccount!.governance!.pubkey,
- wallet!.publicKey!
- )
+ wallet!.publicKey!,
+ );
}
const minRentAmount = await connection.current.getMinimumBalanceForRentExemption(
- MangoAccountLayout.span
- )
+ MangoAccountLayout.span,
+ );
const transferIx = SystemProgram.transfer({
fromPubkey: wallet!.publicKey!,
toPubkey: toAddress,
lamports: minRentAmount,
- })
- instructions.push(transferIx)
- return instructions
- }
+ });
+ instructions.push(transferIx);
+ return instructions;
+ };
const handleDeposit = async () => {
- const isValid = await validateInstruction({ schema, form, setFormErrors })
+ const isValid = await validateInstruction({ schema, form, setFormErrors });
if (!isValid) {
- return
+ return;
}
try {
- setIsDepositing(true)
- const prerequisiteInstructions: TransactionInstruction[] = []
- const mangoAccountPk = selectedMangoAccount?.publicKey || null
+ setIsDepositing(true);
+ const prerequisiteInstructions: TransactionInstruction[] = [];
+ const mangoAccountPk = selectedMangoAccount?.publicKey || null;
if (!mangoAccountPk) {
- const solAccountInstruction = await handleSolPayment()
- prerequisiteInstructions.push(...solAccountInstruction)
+ const solAccountInstruction = await handleSolPayment();
+ prerequisiteInstructions.push(...solAccountInstruction);
}
const rpcContext = new RpcContext(
new PublicKey(realm!.owner.toString()),
getProgramVersionForRealm(realmInfo!),
wallet!,
connection.current,
- connection.endpoint
- )
+ connection.endpoint,
+ );
const mintAmount = parseMintNaturalAmountFromDecimal(
form.amount!,
- governedTokenAccount!.mint!.account.decimals
- )
+ governedTokenAccount!.mint!.account.decimals,
+ );
const ownTokenRecord = ownVoterWeight.getTokenRecordToCreateProposal(
- governedTokenAccount!.governance!.account.config
- )
+ governedTokenAccount!.governance!.account.config,
+ );
const defaultProposalMint = voteByCouncil
? realm?.account.config.councilMint
: !mint?.supply.isZero()
? realm!.account.communityMint
: !councilMint?.supply.isZero()
? realm!.account.config.councilMint
- : undefined
+ : undefined;
const proposalAddress = await createProposalFcn(
rpcContext,
handledMint,
@@ -222,17 +222,17 @@ const MangoDepositComponent = ({
prerequisiteInstructions,
false,
market,
- client
- )
+ client,
+ );
const url = fmtUrlWithCluster(
- `/dao/${symbol}/proposal/${proposalAddress}`
- )
- router.push(url)
+ `/dao/${symbol}/proposal/${proposalAddress}`,
+ );
+ router.push(url);
} catch (e) {
- console.log(e)
+ console.error(e);
}
- setIsDepositing(false)
- }
+ setIsDepositing(false);
+ };
const schema = yup.object().shape({
delegateAddress: yup
.string()
@@ -241,26 +241,26 @@ const MangoDepositComponent = ({
'Delegate address validation error',
function (val: string) {
if (!form.delegateDeposit) {
- return true
+ return true;
}
if (val) {
try {
- return !!getValidatedPublickKey(val)
+ return !!getValidatedPublickKey(val);
} catch (e) {
- console.log(e)
+ console.error(e);
return this.createError({
message: `${e}`,
- })
+ });
}
} else {
return this.createError({
message: `Delegate address is required`,
- })
+ });
}
- }
+ },
),
amount: yup.number().required('Amount is required').min(mintMinAmount),
- })
+ });
return (
- )
-}
+ );
+};
-export default MangoDepositComponent
+export default MangoDepositComponent;
const MangoAccountItem = ({
value,
market,
depositIndex,
}: {
- value: MangoAccount | null
- market: MarketStore
- depositIndex: number
+ value: MangoAccount | null;
+ market: MarketStore;
+ depositIndex: number;
}) => {
- const group = market!.group!
+ const group = market!.group!;
return value ? (
{abbreviateAddress(value.publicKey)}
@@ -461,9 +461,9 @@ const MangoAccountItem = ({
.getUiDeposit(
market.cache!.rootBankCache[depositIndex],
group,
- depositIndex
+ depositIndex,
)
- .toNumber()
+ .toNumber(),
).toFormat(2)}
{value.delegate.toBase58() && (
@@ -472,5 +472,5 @@ const MangoAccountItem = ({
) : (
Create new account
- )
-}
+ );
+};
diff --git a/Strategies/components/ModalHeader.tsx b/Strategies/components/ModalHeader.tsx
index 83a011cb47..3c5f1e749c 100644
--- a/Strategies/components/ModalHeader.tsx
+++ b/Strategies/components/ModalHeader.tsx
@@ -15,7 +15,7 @@ const ModalHeader = ({
- )
-}
+ );
+};
-export default ModalHeader
+export default ModalHeader;
diff --git a/Strategies/protocols/mango/tools.ts b/Strategies/protocols/mango/tools.ts
index da19f60061..e71a09d069 100644
--- a/Strategies/protocols/mango/tools.ts
+++ b/Strategies/protocols/mango/tools.ts
@@ -5,25 +5,25 @@ import {
BN,
makeSetDelegateInstruction,
MangoAccount,
-} from '@blockworks-foundation/mango-client'
+} from '@blockworks-foundation/mango-client';
import {
getInstructionDataFromBase64,
getNativeTreasuryAddress,
serializeInstructionToBase64,
-} from '@solana/spl-governance'
-import { fmtMintAmount } from '@tools/sdk/units'
-import { ConnectionContext } from '@utils/connection'
-import tokenService from '@utils/services/token'
+} from '@solana/spl-governance';
+import { fmtMintAmount } from '@tools/sdk/units';
+import { ConnectionContext } from '@utils/connection';
+import tokenService from '@utils/services/token';
import {
createProposal,
InstructionDataWithHoldUpTime,
-} from 'actions/createProposal'
-import axios from 'axios'
-import { MarketStore } from 'Strategies/store/marketStore'
+} from 'actions/createProposal';
+import axios from 'axios';
+import { MarketStore } from 'Strategies/store/marketStore';
import {
TreasuryStrategy,
HandleCreateProposalWithStrategy,
-} from 'Strategies/types/types'
+} from 'Strategies/types/types';
//Symbol, coingeckoId
export const tokenList = {
@@ -41,55 +41,56 @@ export const tokenList = {
BNB: 'binance-coin',
AVAX: 'avalanche',
LUNA: 'terra-luna',
-}
-export const MANGO = 'Mango'
-export const MANGO_MINT = 'MangoCzJ36AjZyKwVj3VnYU4GTonjfVEnJmvvWaxLac'
-export const MANGO_MINT_DEVNET = 'Bb9bsTQa1bGEtQ5KagGkvSHyuLqDWumFUcRqFusFNJWC'
+};
+export const MANGO = 'Mango';
+export const MANGO_MINT = 'MangoCzJ36AjZyKwVj3VnYU4GTonjfVEnJmvvWaxLac';
+export const MANGO_MINT_DEVNET = 'Bb9bsTQa1bGEtQ5KagGkvSHyuLqDWumFUcRqFusFNJWC';
export const tokenListFilter = Object.keys(tokenList).map((x) => {
return {
name: x,
val: x,
- }
-})
+ };
+});
const endpoint =
- 'https://mango-stats-v3.herokuapp.com/spot?mangoGroup=mainnet.1'
+ 'https://mango-stats-v3.herokuapp.com/spot?mangoGroup=mainnet.1';
// Very inefficient
function findClosestToDate(values, date) {
- let min = values[0]
+ let min = values[0];
for (const val of values) {
- const valDate = new Date(val.time).getTime()
- const minDate = new Date(min.time).getTime()
+ const valDate = new Date(val.time).getTime();
+ const minDate = new Date(min.time).getTime();
if (Math.abs(valDate - date) < Math.abs(minDate - date)) {
- min = val
+ min = val;
}
}
if (Math.abs(new Date(min.time).getTime() - date) > 24 * 3600 * 1000) {
return {
totalDeposits: 0,
totalBorrows: 0,
- }
+ };
}
- return min
+ return min;
}
//method to fetch mango strategies
export async function tvl(timestamp, connection: ConnectionContext) {
- const protocolInfo = await tokenService.getTokenInfo(MANGO_MINT)
- const balances: TreasuryStrategy[] = []
- const stats = await axios.get(endpoint)
- const date = new Date(timestamp * 1000).getTime()
+ const protocolInfo = await tokenService.getTokenInfo(MANGO_MINT);
+ const balances: TreasuryStrategy[] = [];
+ const stats = await axios.get(endpoint);
+ const date = new Date(timestamp * 1000).getTime();
for (const [mangoId, mangoTokens] of Object.entries(tokenList)) {
- const assetDeposits = stats.data.filter((s) => s.name === mangoId)
+ const assetDeposits = stats.data.filter((s) => s.name === mangoId);
if (assetDeposits.length > 0) {
- const info = tokenService.getTokenInfoFromCoingeckoId(mangoTokens)
+ const info = tokenService.getTokenInfoFromCoingeckoId(mangoTokens);
const handledMint =
- (info?.address === MANGO_MINT && connection.cluster === 'devnet'
+ (info?.mint.equals(new PublicKey(MANGO_MINT)) &&
+ connection.cluster === 'devnet'
? MANGO_MINT_DEVNET
- : info?.address) || ''
- const closestVal = findClosestToDate(assetDeposits, date)
+ : info?.mint.toBase58()) || '';
+ const closestVal = findClosestToDate(assetDeposits, date);
balances.push({
liquidity:
(closestVal.totalDeposits - closestVal.totalBorrows) *
@@ -108,27 +109,27 @@ export async function tvl(timestamp, connection: ConnectionContext) {
strategyDescription: 'Description',
isGenericItem: false,
createProposalFcn: HandleMangoDeposit,
- })
+ });
}
}
- return balances
+ return balances;
}
export const calculateAllDepositsInMangoAccountsForMint = (
accounts: MangoAccount[],
mint: PublicKey,
- market: MarketStore
+ market: MarketStore,
) => {
- let deposited = 0
- const group = market!.group!
+ let deposited = 0;
+ const group = market!.group!;
const depositIndex = group.tokens.findIndex(
- (x) => x.mint.toBase58() === mint.toBase58()
- )
+ (x) => x.mint.toBase58() === mint.toBase58(),
+ );
if (accounts?.length) {
const depositsWithAmountHiherThenZero = accounts
.map((x) => x.deposits[depositIndex])
- .filter((x) => !x.isZero())
+ .filter((x) => !x.isZero());
if (depositsWithAmountHiherThenZero.length) {
const currentDepositAmount = accounts
.map((x) =>
@@ -136,16 +137,16 @@ export const calculateAllDepositsInMangoAccountsForMint = (
?.getUiDeposit(
market.cache!.rootBankCache[depositIndex],
group,
- depositIndex
+ depositIndex,
)
- .toNumber()
+ .toNumber(),
)
- .reduce((prev, next) => (prev += next), 0)
- deposited += currentDepositAmount ? currentDepositAmount : 0
+ .reduce((prev, next) => (prev += next), 0);
+ deposited += currentDepositAmount ? currentDepositAmount : 0;
}
}
- return deposited
-}
+ return deposited;
+};
const HandleMangoDeposit: HandleCreateProposalWithStrategy = async (
rpcContext,
@@ -159,21 +160,21 @@ const HandleMangoDeposit: HandleCreateProposalWithStrategy = async (
prerequisiteInstructions,
isDraft,
market,
- client
+ client,
) => {
const fmtAmount = fmtMintAmount(
matchedTreasury.mint?.account,
- new BN(form.mintAmount)
- )
- const group = market!.group!
- const groupConfig = market!.groupConfig!
+ new BN(form.mintAmount),
+ );
+ const group = market!.group!;
+ const groupConfig = market!.groupConfig!;
const rootBank = group.tokens.find(
- (x) => x.mint.toBase58() === matchedTreasury.mint?.publicKey.toBase58()
- )?.rootBank
+ (x) => x.mint.toBase58() === matchedTreasury.mint?.publicKey.toBase58(),
+ )?.rootBank;
const quoteRootBank =
- group.rootBankAccounts[group.getRootBankIndex(rootBank!)]
- const quoteNodeBank = quoteRootBank?.nodeBankAccounts[0]
- const nextAccNumb = new BN(form.proposalCount)
+ group.rootBankAccounts[group.getRootBankIndex(rootBank!)];
+ const quoteNodeBank = quoteRootBank?.nodeBankAccounts[0];
+ const nextAccNumb = new BN(form.proposalCount);
const mangoAccountPk =
form.mangoAccountPk ||
(
@@ -183,14 +184,14 @@ const HandleMangoDeposit: HandleCreateProposalWithStrategy = async (
matchedTreasury.governance!.pubkey.toBytes(),
nextAccNumb.toArrayLike(Buffer, 'le', 8),
],
- groupConfig.mangoProgramId
+ groupConfig.mangoProgramId,
)
- )[0]
+ )[0];
const solAddress = await getNativeTreasuryAddress(
realm!.owner,
- matchedTreasury!.governance!.pubkey
- )
+ matchedTreasury!.governance!.pubkey,
+ );
const depositMangoAccountInsObj = {
data: getInstructionDataFromBase64(
@@ -205,16 +206,16 @@ const HandleMangoDeposit: HandleCreateProposalWithStrategy = async (
quoteNodeBank!.publicKey,
quoteNodeBank!.vault,
matchedTreasury.transferAddress!,
- new BN(form.mintAmount)
- )
- )
+ new BN(form.mintAmount),
+ ),
+ ),
),
holdUpTime: matchedTreasury.governance!.account!.config
.minInstructionHoldUpTime,
prerequisiteInstructions: [],
chunkSplitByDefault: true,
- }
- const insts: InstructionDataWithHoldUpTime[] = []
+ };
+ const insts: InstructionDataWithHoldUpTime[] = [];
if (!form.mangoAccountPk) {
const createMangoAccountIns = makeCreateMangoAccountInstruction(
groupConfig.mangoProgramId,
@@ -222,18 +223,18 @@ const HandleMangoDeposit: HandleCreateProposalWithStrategy = async (
mangoAccountPk,
matchedTreasury.governance!.pubkey,
nextAccNumb,
- solAddress
- )
+ solAddress,
+ );
const instructionData = {
data: getInstructionDataFromBase64(
- serializeInstructionToBase64(createMangoAccountIns)
+ serializeInstructionToBase64(createMangoAccountIns),
),
holdUpTime: matchedTreasury.governance!.account!.config
.minInstructionHoldUpTime,
prerequisiteInstructions: [...prerequisiteInstructions],
splitToChunkByDefault: true,
- }
- insts.push(instructionData)
+ };
+ insts.push(instructionData);
}
if (form.delegateAddress && form.delegateDeposit) {
const delegateMangoAccount = makeSetDelegateInstruction(
@@ -241,20 +242,20 @@ const HandleMangoDeposit: HandleCreateProposalWithStrategy = async (
groupConfig.publicKey,
mangoAccountPk,
matchedTreasury.governance!.pubkey,
- new PublicKey(form.delegateAddress)
- )
+ new PublicKey(form.delegateAddress),
+ );
const instructionData = {
data: getInstructionDataFromBase64(
- serializeInstructionToBase64(delegateMangoAccount)
+ serializeInstructionToBase64(delegateMangoAccount),
),
holdUpTime: matchedTreasury.governance!.account!.config
.minInstructionHoldUpTime,
prerequisiteInstructions: [],
splitToChunkByDefault: true,
- }
- insts.push(instructionData)
+ };
+ insts.push(instructionData);
}
- insts.push(depositMangoAccountInsObj)
+ insts.push(depositMangoAccountInsObj);
const proposalAddress = await createProposal(
rpcContext,
realm,
@@ -270,37 +271,37 @@ const HandleMangoDeposit: HandleCreateProposalWithStrategy = async (
proposalIndex,
insts,
isDraft,
- client
- )
- return proposalAddress
-}
+ client,
+ );
+ return proposalAddress;
+};
export const tryGetMangoAccount = async (
market: MarketStore,
- mangoAccountPk: PublicKey
+ mangoAccountPk: PublicKey,
) => {
try {
const account = await market.client?.getMangoAccount(
mangoAccountPk,
- market.group!.dexProgramId
- )
- return account
+ market.group!.dexProgramId,
+ );
+ return account;
} catch (e) {
- return null
+ return null;
}
-}
+};
export const tryGetMangoAccountsForOwner = async (
market: MarketStore,
- ownerPk: PublicKey
+ ownerPk: PublicKey,
) => {
try {
const accounts = await market.client?.getMangoAccountsForOwner(
market.group!,
- ownerPk
- )
- return accounts
+ ownerPk,
+ );
+ return accounts;
} catch (e) {
- return null
+ return null;
}
-}
+};
diff --git a/Strategies/store/marketStore.tsx b/Strategies/store/marketStore.tsx
index 8ac694b606..d8b5608b51 100644
--- a/Strategies/store/marketStore.tsx
+++ b/Strategies/store/marketStore.tsx
@@ -1,4 +1,4 @@
-import create, { State } from 'zustand'
+import create, { State } from 'zustand';
import {
Config,
getMarketIndexBySymbol,
@@ -11,61 +11,61 @@ import {
PerpMarketInfo,
RootBank,
TokenInfo,
-} from '@blockworks-foundation/mango-client'
-import { ConnectionContext } from '@utils/connection'
+} from '@blockworks-foundation/mango-client';
+import { ConnectionContext } from '@utils/connection';
export interface MarketStore extends State {
- groupConfig?: GroupConfig
- marketConfig?: PerpMarketConfig
- cache?: MangoCache
- client?: MangoClient
- group?: MangoGroup
- info?: PerpMarketInfo
- market?: PerpMarket
- indexPrice?: number
- quoteCurrency?: TokenInfo
- quoteRootBank?: RootBank
- loadMarket: (connection: ConnectionContext, cluster: string) => void
+ groupConfig?: GroupConfig;
+ marketConfig?: PerpMarketConfig;
+ cache?: MangoCache;
+ client?: MangoClient;
+ group?: MangoGroup;
+ info?: PerpMarketInfo;
+ market?: PerpMarket;
+ indexPrice?: number;
+ quoteCurrency?: TokenInfo;
+ quoteRootBank?: RootBank;
+ loadMarket: (connection: ConnectionContext, cluster: string) => void;
}
const useMarketStore = create((set, _get) => ({
loadMarket: async (connection: ConnectionContext, cluster: string) => {
- const GROUP = cluster === 'devnet' ? 'devnet.2' : 'mainnet.1'
- const groupConfig = Config.ids().getGroupWithName(GROUP)!
- const DEFAULT_MARKET = 'SOL'
+ const GROUP = cluster === 'devnet' ? 'devnet.2' : 'mainnet.1';
+ const groupConfig = Config.ids().getGroupWithName(GROUP)!;
+ const DEFAULT_MARKET = 'SOL';
const DEFAULT_MARKET_INDEX = getMarketIndexBySymbol(
groupConfig,
- DEFAULT_MARKET
- )
- const marketConfig = groupConfig?.perpMarkets[DEFAULT_MARKET_INDEX]
+ DEFAULT_MARKET,
+ );
+ const marketConfig = groupConfig?.perpMarkets[DEFAULT_MARKET_INDEX];
const client = new MangoClient(
connection.current,
- groupConfig.mangoProgramId
- )
- const group = await client.getMangoGroup(groupConfig.publicKey)
+ groupConfig.mangoProgramId,
+ );
+ const group = await client.getMangoGroup(groupConfig.publicKey);
const [perpMarket] = await Promise.all([
group.loadPerpMarket(
connection.current,
marketConfig.marketIndex,
marketConfig.baseDecimals,
- marketConfig.quoteDecimals
+ marketConfig.quoteDecimals,
),
group.loadRootBanks(connection.current),
- ])
+ ]);
- const cache = await group.loadCache(connection.current)
- const indexPrice = group.getPriceUi(marketConfig.marketIndex, cache)
+ const cache = await group.loadCache(connection.current);
+ const indexPrice = group.getPriceUi(marketConfig.marketIndex, cache);
set((s: MarketStore) => {
- s.groupConfig = groupConfig
- s.marketConfig = marketConfig
- s.market = perpMarket
- s.client = client
- s.group = group
- s.info = group.perpMarkets[marketConfig.marketIndex]
- s.cache = cache
- s.indexPrice = indexPrice
- })
+ s.groupConfig = groupConfig;
+ s.marketConfig = marketConfig;
+ s.market = perpMarket;
+ s.client = client;
+ s.group = group;
+ s.info = group.perpMarkets[marketConfig.marketIndex];
+ s.cache = cache;
+ s.indexPrice = indexPrice;
+ });
},
-}))
+}));
-export default useMarketStore
+export default useMarketStore;
diff --git a/Strategies/store/useStrategiesStore.tsx b/Strategies/store/useStrategiesStore.tsx
index e3499d6803..79d7e8699c 100644
--- a/Strategies/store/useStrategiesStore.tsx
+++ b/Strategies/store/useStrategiesStore.tsx
@@ -1,13 +1,13 @@
-import { ConnectionContext } from '@utils/connection'
-import { notify } from '@utils/notifications'
-import { tvl } from 'Strategies/protocols/mango/tools'
-import { TreasuryStrategy } from 'Strategies/types/types'
-import create, { State } from 'zustand'
+import { ConnectionContext } from '@utils/connection';
+import { notify } from '@utils/notifications';
+import { tvl } from 'Strategies/protocols/mango/tools';
+import { TreasuryStrategy } from 'Strategies/types/types';
+import create, { State } from 'zustand';
interface StrategiesStore extends State {
- strategies: TreasuryStrategy[]
- strategiesLoading: boolean
- getStrategies: (connection: ConnectionContext) => void
+ strategies: TreasuryStrategy[];
+ strategiesLoading: boolean;
+ getStrategies: (connection: ConnectionContext) => void;
}
const useStrategiesStore = create((set, _get) => ({
@@ -15,23 +15,23 @@ const useStrategiesStore = create((set, _get) => ({
strategiesLoading: false,
getStrategies: async (connection: ConnectionContext) => {
set((s) => {
- s.strategiesLoading = true
- })
+ s.strategiesLoading = true;
+ });
try {
- const mango = await tvl(Date.now() / 1000, connection)
+ const mango = await tvl(Date.now() / 1000, connection);
//add fetch functions for your protocol in promise.all
- const strategies: TreasuryStrategy[] = [...mango]
+ const strategies: TreasuryStrategy[] = [...mango];
set((s) => {
- s.strategies = strategies
- })
+ s.strategies = strategies;
+ });
} catch (e) {
- console.log(e)
- notify({ type: 'error', message: "Can't fetch MNGO strategies" })
+ console.error(e);
+ notify({ type: 'error', message: "Can't fetch MNGO strategies" });
}
set((s) => {
- s.strategiesLoading = false
- })
+ s.strategiesLoading = false;
+ });
},
-}))
+}));
-export default useStrategiesStore
+export default useStrategiesStore;
diff --git a/Strategies/types/types.ts b/Strategies/types/types.ts
index 6c67ff5080..1249fe68c1 100644
--- a/Strategies/types/types.ts
+++ b/Strategies/types/types.ts
@@ -1,28 +1,28 @@
-import { MangoAccount } from '@blockworks-foundation/mango-client'
-import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client'
-import { ProgramAccount, Realm, RpcContext } from '@solana/spl-governance'
-import { PublicKey, TransactionInstruction } from '@solana/web3.js'
-import { GovernedTokenAccount } from '@utils/tokens'
-import { MarketStore } from 'Strategies/store/marketStore'
+import { MangoAccount } from '@blockworks-foundation/mango-client';
+import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client';
+import { ProgramAccount, Realm, RpcContext } from '@solana/spl-governance';
+import { PublicKey, TransactionInstruction } from '@solana/web3.js';
+import { GovernedTokenAccount } from '@utils/tokens';
+import { MarketStore } from 'Strategies/store/marketStore';
export interface TreasuryStrategy {
//liquidity in $
- liquidity: number
- protocolSymbol: string
- apy: string
- protocolName: string
- handledMint: string
- handledTokenSymbol: string
- handledTokenImgSrc: string
- protocolLogoSrc: string
- strategyName: string
- strategyDescription: string
+ liquidity: number;
+ protocolSymbol: string;
+ apy: string;
+ protocolName: string;
+ handledMint: string;
+ handledTokenSymbol: string;
+ handledTokenImgSrc: string;
+ protocolLogoSrc: string;
+ strategyName: string;
+ strategyDescription: string;
//if you want to use custom component set this to false and add your custom
//item and modal to strategywrapper component based on generic components
- isGenericItem?: boolean
+ isGenericItem?: boolean;
//async function that pass all props needed to create proposal
// if promise is successfully resolved it will automatically redirect to created proposal
- createProposalFcn: HandleCreateProposalWithStrategy
+ createProposalFcn: HandleCreateProposalWithStrategy;
}
export type HandleCreateProposalWithStrategy = (
@@ -37,21 +37,21 @@ export type HandleCreateProposalWithStrategy = (
prerequisiteInstructions: TransactionInstruction[],
isDraft: boolean,
market?: MarketStore,
- client?: VsrClient
-) => Promise
+ client?: VsrClient,
+) => Promise;
export interface NameVal {
- name: string
- val: string | null
+ name: string;
+ val: string | null;
}
export type MNGODepositForm = {
- mintAmount: number
- delegateDeposit: boolean
- delegateAddress: string
- mangoAccountPk: PublicKey | null
- mangoAccounts: MangoAccount[]
- title: string
- description: string
- proposalCount: number
-}
+ mintAmount: number;
+ delegateDeposit: boolean;
+ delegateAddress: string;
+ mangoAccountPk: PublicKey | null;
+ mangoAccounts: MangoAccount[];
+ title: string;
+ description: string;
+ proposalCount: number;
+};
diff --git a/VoteStakeRegistry/actions/closeDeposit.ts b/VoteStakeRegistry/actions/closeDeposit.ts
index 1a9a86e2aa..2923e96c6a 100644
--- a/VoteStakeRegistry/actions/closeDeposit.ts
+++ b/VoteStakeRegistry/actions/closeDeposit.ts
@@ -3,11 +3,11 @@ import {
PublicKey,
Transaction,
TransactionInstruction,
-} from '@solana/web3.js'
-import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client'
-import { RpcContext } from '@solana/spl-governance'
-import { sendTransaction } from '@utils/send'
-import { getRegistrarPDA, getVoterPDA } from 'VoteStakeRegistry/sdk/accounts'
+} from '@solana/web3.js';
+import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client';
+import { RpcContext } from '@solana/spl-governance';
+import { sendTransaction } from '@utils/send';
+import { getRegistrarPDA, getVoterPDA } from 'VoteStakeRegistry/sdk/accounts';
export const closeDeposit = async ({
rpcContext,
@@ -16,38 +16,38 @@ export const closeDeposit = async ({
communityMintPk,
client,
}: {
- rpcContext: RpcContext
- realmPk: PublicKey
- communityMintPk: PublicKey
- depositIndex: number
- client?: VsrClient
+ rpcContext: RpcContext;
+ realmPk: PublicKey;
+ communityMintPk: PublicKey;
+ depositIndex: number;
+ client?: VsrClient;
}) => {
- const signers: Keypair[] = []
- const { wallet, connection } = rpcContext
- const instructions: TransactionInstruction[] = []
- const clientProgramId = client!.program.programId
+ const signers: Keypair[] = [];
+ const { wallet, connection } = rpcContext;
+ const instructions: TransactionInstruction[] = [];
+ const clientProgramId = client!.program.programId;
const { registrar } = await getRegistrarPDA(
realmPk,
communityMintPk,
- client!.program.programId
- )
+ client!.program.programId,
+ );
const { voter } = await getVoterPDA(
registrar,
wallet!.publicKey!,
- clientProgramId
- )
+ clientProgramId,
+ );
instructions.push(
client!.program.instruction.closeDepositEntry(depositIndex, {
accounts: {
voter: voter,
voterAuthority: wallet!.publicKey!,
},
- })
- )
+ }),
+ );
- const transaction = new Transaction()
- transaction.add(...instructions)
+ const transaction = new Transaction();
+ transaction.add(...instructions);
await sendTransaction({
transaction,
@@ -56,5 +56,5 @@ export const closeDeposit = async ({
signers,
sendingMessage: `Closing deposit`,
successMessage: `Deposit closed successful`,
- })
-}
+ });
+};
diff --git a/VoteStakeRegistry/actions/getClawbackInstruction.ts b/VoteStakeRegistry/actions/getClawbackInstruction.ts
index d8ce258d95..a6e0bf53bf 100644
--- a/VoteStakeRegistry/actions/getClawbackInstruction.ts
+++ b/VoteStakeRegistry/actions/getClawbackInstruction.ts
@@ -1,12 +1,12 @@
-import { PublicKey } from '@solana/web3.js'
+import { PublicKey } from '@solana/web3.js';
-import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client'
-import { getRegistrarPDA, getVoterPDA } from 'VoteStakeRegistry/sdk/accounts'
+import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client';
+import { getRegistrarPDA, getVoterPDA } from 'VoteStakeRegistry/sdk/accounts';
import {
ASSOCIATED_TOKEN_PROGRAM_ID,
Token,
TOKEN_PROGRAM_ID,
-} from '@solana/spl-token'
+} from '@solana/spl-token';
export const getClawbackInstruction = async ({
realmPk,
@@ -18,34 +18,34 @@ export const getClawbackInstruction = async ({
realmCommunityMintPk,
client,
}: {
- realmPk: PublicKey
- realmAuthority: PublicKey
- voterWalletAddress: PublicKey
- destination: PublicKey
- voterDepositIndex: number
- grantMintPk: PublicKey
- realmCommunityMintPk: PublicKey
- client?: VsrClient
+ realmPk: PublicKey;
+ realmAuthority: PublicKey;
+ voterWalletAddress: PublicKey;
+ destination: PublicKey;
+ voterDepositIndex: number;
+ grantMintPk: PublicKey;
+ realmCommunityMintPk: PublicKey;
+ client?: VsrClient;
}) => {
- const clientProgramId = client!.program.programId
+ const clientProgramId = client!.program.programId;
const { registrar } = await getRegistrarPDA(
realmPk,
realmCommunityMintPk,
- clientProgramId
- )
+ clientProgramId,
+ );
const { voter } = await getVoterPDA(
registrar,
voterWalletAddress,
- clientProgramId
- )
+ clientProgramId,
+ );
const voterATAPk = await Token.getAssociatedTokenAddress(
ASSOCIATED_TOKEN_PROGRAM_ID,
TOKEN_PROGRAM_ID,
grantMintPk,
- voter
- )
+ voter,
+ );
const clawbackIx = client?.program.instruction.clawback(voterDepositIndex, {
accounts: {
@@ -56,6 +56,6 @@ export const getClawbackInstruction = async ({
destination,
tokenProgram: TOKEN_PROGRAM_ID,
},
- })
- return clawbackIx
-}
+ });
+ return clawbackIx;
+};
diff --git a/VoteStakeRegistry/actions/getGrantInstruction.ts b/VoteStakeRegistry/actions/getGrantInstruction.ts
index 58a0945c96..aac3341380 100644
--- a/VoteStakeRegistry/actions/getGrantInstruction.ts
+++ b/VoteStakeRegistry/actions/getGrantInstruction.ts
@@ -1,18 +1,18 @@
-import { PublicKey, SystemProgram, SYSVAR_RENT_PUBKEY } from '@solana/web3.js'
+import { PublicKey, SystemProgram, SYSVAR_RENT_PUBKEY } from '@solana/web3.js';
-import { BN } from '@project-serum/anchor'
-import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client'
+import { BN } from '@project-serum/anchor';
+import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client';
import {
getRegistrarPDA,
getVoterPDA,
getVoterWeightPDA,
LockupType,
-} from 'VoteStakeRegistry/sdk/accounts'
+} from 'VoteStakeRegistry/sdk/accounts';
import {
ASSOCIATED_TOKEN_PROGRAM_ID,
Token,
TOKEN_PROGRAM_ID,
-} from '@solana/spl-token'
+} from '@solana/spl-token';
export const getGrantInstruction = async ({
fromPk,
@@ -28,45 +28,45 @@ export const getGrantInstruction = async ({
grantAuthority,
client,
}: {
- fromPk: PublicKey
- realmMint: PublicKey
- grantMintPk: PublicKey
- communityMintPk: PublicKey
- toPk: PublicKey
- realmPk: PublicKey
- grantAuthority: PublicKey
- amount: number
+ fromPk: PublicKey;
+ realmMint: PublicKey;
+ grantMintPk: PublicKey;
+ communityMintPk: PublicKey;
+ toPk: PublicKey;
+ realmPk: PublicKey;
+ grantAuthority: PublicKey;
+ amount: number;
//days or months in case of monthly vesting lockup type
- lockupPeriod: number
- lockupKind: LockupType
- startTime: number
- allowClawback: boolean
- client?: VsrClient
+ lockupPeriod: number;
+ lockupKind: LockupType;
+ startTime: number;
+ allowClawback: boolean;
+ client?: VsrClient;
}) => {
- const systemProgram = SystemProgram.programId
- const clientProgramId = client!.program.programId
+ const systemProgram = SystemProgram.programId;
+ const clientProgramId = client!.program.programId;
const { registrar } = await getRegistrarPDA(
realmPk,
communityMintPk,
- clientProgramId
- )
+ clientProgramId,
+ );
const { voter, voterBump } = await getVoterPDA(
registrar,
toPk,
- clientProgramId
- )
+ clientProgramId,
+ );
const { voterWeightPk, voterWeightBump } = await getVoterWeightPDA(
registrar,
toPk,
- clientProgramId
- )
+ clientProgramId,
+ );
const voterATAPk = await Token.getAssociatedTokenAddress(
ASSOCIATED_TOKEN_PROGRAM_ID,
TOKEN_PROGRAM_ID,
grantMintPk,
- voter
- )
+ voter,
+ );
const grantIx = client?.program.instruction.grant(
voterBump,
@@ -93,7 +93,7 @@ export const getGrantInstruction = async ({
associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID,
rent: SYSVAR_RENT_PUBKEY,
},
- }
- )
- return grantIx
-}
+ },
+ );
+ return grantIx;
+};
diff --git a/VoteStakeRegistry/actions/voteRegistryDepositWithoutLockup.ts b/VoteStakeRegistry/actions/voteRegistryDepositWithoutLockup.ts
index 229e236d67..d39393863e 100644
--- a/VoteStakeRegistry/actions/voteRegistryDepositWithoutLockup.ts
+++ b/VoteStakeRegistry/actions/voteRegistryDepositWithoutLockup.ts
@@ -3,13 +3,13 @@ import {
PublicKey,
Transaction,
TransactionInstruction,
-} from '@solana/web3.js'
-import { RpcContext } from '@solana/spl-governance'
-import { sendTransaction } from 'utils/send'
+} from '@solana/web3.js';
+import { RpcContext } from '@solana/spl-governance';
+import { sendTransaction } from 'utils/send';
-import { BN } from '@project-serum/anchor'
-import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client'
-import { withVoteRegistryDeposit } from '../sdk/withVoteRegistryDeposit'
+import { BN } from '@project-serum/anchor';
+import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client';
+import { withVoteRegistryDeposit } from '../sdk/withVoteRegistryDeposit';
export const voteRegistryDepositWithoutLockup = async ({
rpcContext,
@@ -22,22 +22,22 @@ export const voteRegistryDepositWithoutLockup = async ({
tokenOwnerRecordPk,
client,
}: {
- rpcContext: RpcContext
+ rpcContext: RpcContext;
//from where we deposit our founds
- fromPk: PublicKey
- mintPk: PublicKey
- communityMintPk: PublicKey
- realmPk: PublicKey
- programId: PublicKey
- amount: BN
- tokenOwnerRecordPk: PublicKey | null
- client?: VsrClient
+ fromPk: PublicKey;
+ mintPk: PublicKey;
+ communityMintPk: PublicKey;
+ realmPk: PublicKey;
+ programId: PublicKey;
+ amount: BN;
+ tokenOwnerRecordPk: PublicKey | null;
+ client?: VsrClient;
}) => {
- const lockUpPeriodInDays = 0
- const lockupKind = 'none'
- const signers: Keypair[] = []
- const { wallet, connection } = rpcContext
- const instructions: TransactionInstruction[] = []
+ const lockUpPeriodInDays = 0;
+ const lockupKind = 'none';
+ const signers: Keypair[] = [];
+ const { wallet, connection } = rpcContext;
+ const instructions: TransactionInstruction[] = [];
await withVoteRegistryDeposit({
instructions,
walletPk: rpcContext.walletPubkey,
@@ -51,10 +51,10 @@ export const voteRegistryDepositWithoutLockup = async ({
communityMintPk,
lockupKind,
client,
- })
+ });
- const transaction = new Transaction()
- transaction.add(...instructions)
+ const transaction = new Transaction();
+ transaction.add(...instructions);
await sendTransaction({
transaction,
@@ -63,5 +63,5 @@ export const voteRegistryDepositWithoutLockup = async ({
signers,
sendingMessage: `Depositing`,
successMessage: `Deposit successful`,
- })
-}
+ });
+};
diff --git a/VoteStakeRegistry/actions/voteRegistryLockDeposit.ts b/VoteStakeRegistry/actions/voteRegistryLockDeposit.ts
index 162a4dda1b..9dfe7eb575 100644
--- a/VoteStakeRegistry/actions/voteRegistryLockDeposit.ts
+++ b/VoteStakeRegistry/actions/voteRegistryLockDeposit.ts
@@ -3,15 +3,15 @@ import {
PublicKey,
Transaction,
TransactionInstruction,
-} from '@solana/web3.js'
-import { RpcContext, TOKEN_PROGRAM_ID } from '@solana/spl-governance'
-import { sendTransaction } from 'utils/send'
+} from '@solana/web3.js';
+import { RpcContext, TOKEN_PROGRAM_ID } from '@solana/spl-governance';
+import { sendTransaction } from 'utils/send';
-import { BN } from '@project-serum/anchor'
-import { LockupType } from 'VoteStakeRegistry/sdk/accounts'
-import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client'
-import { withCreateNewDeposit } from '../sdk/withCreateNewDeposit'
-import { getPeriod } from 'VoteStakeRegistry/tools/deposits'
+import { BN } from '@project-serum/anchor';
+import { LockupType } from 'VoteStakeRegistry/sdk/accounts';
+import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client';
+import { withCreateNewDeposit } from '../sdk/withCreateNewDeposit';
+import { getPeriod } from 'VoteStakeRegistry/tools/deposits';
export const voteRegistryLockDeposit = async ({
rpcContext,
@@ -28,33 +28,33 @@ export const voteRegistryLockDeposit = async ({
sourceTokenAccount,
communityMintPk,
}: {
- rpcContext: RpcContext
- mintPk: PublicKey
- realmPk: PublicKey
- programId: PublicKey
+ rpcContext: RpcContext;
+ mintPk: PublicKey;
+ realmPk: PublicKey;
+ programId: PublicKey;
//amount that will be taken from vote registry deposit
- amountFromVoteRegistryDeposit: BN
- totalTransferAmount: BN
- lockUpPeriodInDays: number
- lockupKind: LockupType
- sourceDepositIdx: number
- tokenOwnerRecordPk: PublicKey | null
- sourceTokenAccount: PublicKey
- communityMintPk: PublicKey
- client?: VsrClient
+ amountFromVoteRegistryDeposit: BN;
+ totalTransferAmount: BN;
+ lockUpPeriodInDays: number;
+ lockupKind: LockupType;
+ sourceDepositIdx: number;
+ tokenOwnerRecordPk: PublicKey | null;
+ sourceTokenAccount: PublicKey;
+ communityMintPk: PublicKey;
+ client?: VsrClient;
}) => {
- const signers: Keypair[] = []
- const { wallet, connection } = rpcContext
+ const signers: Keypair[] = [];
+ const { wallet, connection } = rpcContext;
if (!client) {
- throw 'no vote registry plugin'
+ throw 'no vote registry plugin';
}
if (!wallet.publicKey) {
- throw 'no wallet connected'
+ throw 'no wallet connected';
}
const fromWalletTransferAmount = totalTransferAmount.sub(
- amountFromVoteRegistryDeposit
- )
- const instructions: TransactionInstruction[] = []
+ amountFromVoteRegistryDeposit,
+ );
+ const instructions: TransactionInstruction[] = [];
const {
depositIdx,
voter,
@@ -71,7 +71,7 @@ export const voteRegistryLockDeposit = async ({
lockupKind,
communityMintPk,
client,
- })
+ });
if (!amountFromVoteRegistryDeposit.isZero()) {
const internalTransferUnlockedInstruction = client?.program.instruction.internalTransferUnlocked(
@@ -84,10 +84,10 @@ export const voteRegistryLockDeposit = async ({
voter: voter,
voterAuthority: wallet!.publicKey,
},
- }
- )
+ },
+ );
- instructions.push(internalTransferUnlockedInstruction)
+ instructions.push(internalTransferUnlockedInstruction);
}
if (!fromWalletTransferAmount.isZero() && !fromWalletTransferAmount.isNeg()) {
@@ -103,13 +103,13 @@ export const voteRegistryLockDeposit = async ({
depositAuthority: wallet!.publicKey!,
tokenProgram: TOKEN_PROGRAM_ID,
},
- }
- )
- instructions.push(depositInstruction)
+ },
+ );
+ instructions.push(depositInstruction);
}
if (!amountFromVoteRegistryDeposit.isZero()) {
- const period = getPeriod(lockUpPeriodInDays, lockupKind)
+ const period = getPeriod(lockUpPeriodInDays, lockupKind);
const resetLockup = client?.program.instruction.resetLockup(
depositIdx,
{ [lockupKind]: {} },
@@ -120,14 +120,14 @@ export const voteRegistryLockDeposit = async ({
voter: voter,
voterAuthority: wallet!.publicKey,
},
- }
- )
+ },
+ );
- instructions.push(resetLockup)
+ instructions.push(resetLockup);
}
- const transaction = new Transaction()
- transaction.add(...instructions)
+ const transaction = new Transaction();
+ transaction.add(...instructions);
await sendTransaction({
transaction,
@@ -136,5 +136,5 @@ export const voteRegistryLockDeposit = async ({
signers,
sendingMessage: `Depositing`,
successMessage: `Deposit successful`,
- })
-}
+ });
+};
diff --git a/VoteStakeRegistry/actions/voteRegistryStartUnlock.ts b/VoteStakeRegistry/actions/voteRegistryStartUnlock.ts
index 7a3b1be730..b90821326e 100644
--- a/VoteStakeRegistry/actions/voteRegistryStartUnlock.ts
+++ b/VoteStakeRegistry/actions/voteRegistryStartUnlock.ts
@@ -3,13 +3,13 @@ import {
PublicKey,
Transaction,
TransactionInstruction,
-} from '@solana/web3.js'
-import { RpcContext } from '@solana/spl-governance'
-import { sendTransaction } from 'utils/send'
+} from '@solana/web3.js';
+import { RpcContext } from '@solana/spl-governance';
+import { sendTransaction } from 'utils/send';
-import { BN } from '@project-serum/anchor'
-import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client'
-import { withCreateNewDeposit } from '../sdk/withCreateNewDeposit'
+import { BN } from '@project-serum/anchor';
+import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client';
+import { withCreateNewDeposit } from '../sdk/withCreateNewDeposit';
export const voteRegistryStartUnlock = async ({
rpcContext,
@@ -24,32 +24,32 @@ export const voteRegistryStartUnlock = async ({
client,
tokenOwnerRecordPk,
}: {
- rpcContext: RpcContext
- mintPk: PublicKey
- realmPk: PublicKey
- programId: PublicKey
- communityMintPk: PublicKey
- transferAmount: BN
+ rpcContext: RpcContext;
+ mintPk: PublicKey;
+ realmPk: PublicKey;
+ programId: PublicKey;
+ communityMintPk: PublicKey;
+ transferAmount: BN;
//amount left in deposit after operation
- amountAfterOperation: BN
- lockUpPeriodInDays: number
- sourceDepositIdx: number
- tokenOwnerRecordPk: PublicKey | null
- client?: VsrClient
+ amountAfterOperation: BN;
+ lockUpPeriodInDays: number;
+ sourceDepositIdx: number;
+ tokenOwnerRecordPk: PublicKey | null;
+ client?: VsrClient;
}) => {
//adding one day to lockupPeriod when unlocking to avoid difference in front/backend calculation of period
//period have to be same or higher then deposit has that we unlock
- const period = lockUpPeriodInDays + 1
- const lockupKind = 'cliff'
- const signers: Keypair[] = []
- const { wallet, connection } = rpcContext
+ const period = lockUpPeriodInDays + 1;
+ const lockupKind = 'cliff';
+ const signers: Keypair[] = [];
+ const { wallet, connection } = rpcContext;
if (!client) {
- throw 'no vote registry plugin'
+ throw 'no vote registry plugin';
}
if (!wallet.publicKey) {
- throw 'no wallet connected'
+ throw 'no wallet connected';
}
- const instructions: TransactionInstruction[] = []
+ const instructions: TransactionInstruction[] = [];
const { depositIdx, voter, registrar } = await withCreateNewDeposit({
instructions,
walletPk: rpcContext.walletPubkey,
@@ -61,7 +61,7 @@ export const voteRegistryStartUnlock = async ({
lockupKind,
communityMintPk,
client,
- })
+ });
const internalTransferInst = client?.program.instruction.internalTransferLocked(
sourceDepositIdx,
@@ -73,9 +73,9 @@ export const voteRegistryStartUnlock = async ({
voter,
voterAuthority: wallet.publicKey,
},
- }
- )
- instructions.push(internalTransferInst)
+ },
+ );
+ instructions.push(internalTransferInst);
if (amountAfterOperation && amountAfterOperation?.isZero()) {
const close = client.program.instruction.closeDepositEntry(
@@ -85,13 +85,13 @@ export const voteRegistryStartUnlock = async ({
voter: voter,
voterAuthority: wallet.publicKey,
},
- }
- )
- instructions.push(close)
+ },
+ );
+ instructions.push(close);
}
- const transaction = new Transaction()
- transaction.add(...instructions)
+ const transaction = new Transaction();
+ transaction.add(...instructions);
await sendTransaction({
transaction,
@@ -100,5 +100,5 @@ export const voteRegistryStartUnlock = async ({
signers,
sendingMessage: `Depositing`,
successMessage: `Deposit successful`,
- })
-}
+ });
+};
diff --git a/VoteStakeRegistry/actions/voteRegistryWithdraw.ts b/VoteStakeRegistry/actions/voteRegistryWithdraw.ts
index a72a7eeac9..7efbb98724 100644
--- a/VoteStakeRegistry/actions/voteRegistryWithdraw.ts
+++ b/VoteStakeRegistry/actions/voteRegistryWithdraw.ts
@@ -3,12 +3,12 @@ import {
PublicKey,
Transaction,
TransactionInstruction,
-} from '@solana/web3.js'
-import { BN } from '@project-serum/anchor'
-import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client'
-import { withVoteRegistryWithdraw } from '../sdk/withVoteRegistryWithdraw'
-import { RpcContext } from '@solana/spl-governance'
-import { sendTransaction } from '@utils/send'
+} from '@solana/web3.js';
+import { BN } from '@project-serum/anchor';
+import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client';
+import { withVoteRegistryWithdraw } from '../sdk/withVoteRegistryWithdraw';
+import { RpcContext } from '@solana/spl-governance';
+import { sendTransaction } from '@utils/send';
export const voteRegistryWithdraw = async ({
rpcContext,
@@ -21,20 +21,20 @@ export const voteRegistryWithdraw = async ({
communityMintPk,
client,
}: {
- rpcContext: RpcContext
- mintPk: PublicKey
- realmPk: PublicKey
- communityMintPk: PublicKey
- amount: BN
- tokenOwnerRecordPubKey: PublicKey
- depositIndex: number
+ rpcContext: RpcContext;
+ mintPk: PublicKey;
+ realmPk: PublicKey;
+ communityMintPk: PublicKey;
+ amount: BN;
+ tokenOwnerRecordPubKey: PublicKey;
+ depositIndex: number;
//if we want to close deposit after doing operation we need to fill this because we can close only deposits that have 0 tokens inside
- closeDepositAfterOperation?: boolean
- client?: VsrClient
+ closeDepositAfterOperation?: boolean;
+ client?: VsrClient;
}) => {
- const signers: Keypair[] = []
- const { wallet, connection } = rpcContext
- const instructions: TransactionInstruction[] = []
+ const signers: Keypair[] = [];
+ const { wallet, connection } = rpcContext;
+ const instructions: TransactionInstruction[] = [];
await withVoteRegistryWithdraw({
instructions,
walletPk: wallet!.publicKey!,
@@ -47,10 +47,10 @@ export const voteRegistryWithdraw = async ({
communityMintPk,
connection,
client,
- })
+ });
- const transaction = new Transaction()
- transaction.add(...instructions)
+ const transaction = new Transaction();
+ transaction.add(...instructions);
await sendTransaction({
transaction,
@@ -59,5 +59,5 @@ export const voteRegistryWithdraw = async ({
signers,
sendingMessage: `Withdrawing`,
successMessage: `Withdraw successful`,
- })
-}
+ });
+};
diff --git a/VoteStakeRegistry/components/Account/Account.tsx b/VoteStakeRegistry/components/Account/Account.tsx
index 8a3843ec86..b4557d6b40 100644
--- a/VoteStakeRegistry/components/Account/Account.tsx
+++ b/VoteStakeRegistry/components/Account/Account.tsx
@@ -1,10 +1,10 @@
-import PreviousRouteBtn from '@components/PreviousRouteBtn'
-import { LinkIcon } from '@heroicons/react/outline'
-import MyProposalsBtn from 'pages/dao/[symbol]/proposal/components/MyProposalsBtn'
-import useWalletStore from 'stores/useWalletStore'
+import PreviousRouteBtn from '@components/PreviousRouteBtn';
+import { LinkIcon } from '@heroicons/react/outline';
+import MyProposalsBtn from 'pages/dao/[symbol]/proposal/components/MyProposalsBtn';
+import useWalletStore from 'stores/useWalletStore';
const Account = ({ withHeader = true }: { withHeader?: boolean }) => {
- const connected = useWalletStore((s) => s.connected)
+ const connected = useWalletStore((s) => s.connected);
return (
{withHeader && (
@@ -29,7 +29,7 @@ const Account = ({ withHeader = true }: { withHeader?: boolean }) => {
)}
- )
-}
+ );
+};
-export default Account
+export default Account;
diff --git a/VoteStakeRegistry/components/Account/DepositCard.tsx b/VoteStakeRegistry/components/Account/DepositCard.tsx
index f9ebbe7c0a..124f813a59 100644
--- a/VoteStakeRegistry/components/Account/DepositCard.tsx
+++ b/VoteStakeRegistry/components/Account/DepositCard.tsx
@@ -1,42 +1,42 @@
-import Button from '@components/Button'
-import useRealm from '@hooks/useRealm'
-import { getProgramVersionForRealm } from '@models/registry/api'
-import { RpcContext } from '@solana/spl-governance'
-import { fmtMintAmount, getMintDecimalAmount } from '@tools/sdk/units'
-import useWalletStore from 'stores/useWalletStore'
-import { voteRegistryWithdraw } from 'VoteStakeRegistry/actions/voteRegistryWithdraw'
+import Button from '@components/Button';
+import useRealm from '@hooks/useRealm';
+import { getProgramVersionForRealm } from '@models/registry/api';
+import { RpcContext } from '@solana/spl-governance';
+import { fmtMintAmount, getMintDecimalAmount } from '@tools/sdk/units';
+import useWalletStore from 'stores/useWalletStore';
+import { voteRegistryWithdraw } from 'VoteStakeRegistry/actions/voteRegistryWithdraw';
import {
DepositWithMintAccount,
LockupType,
-} from 'VoteStakeRegistry/sdk/accounts'
-import useDepositStore from 'VoteStakeRegistry/stores/useDepositStore'
-import tokenService from '@utils/services/token'
-import LockTokensModal from './LockTokensModal'
-import { useState } from 'react'
+} from 'VoteStakeRegistry/sdk/accounts';
+import useDepositStore from 'VoteStakeRegistry/stores/useDepositStore';
+import tokenService from '@utils/services/token';
+import LockTokensModal from './LockTokensModal';
+import { useState } from 'react';
import {
getMinDurationFmt,
getTimeLeftFromNowFmt,
-} from 'VoteStakeRegistry/tools/dateTools'
-import { closeDeposit } from 'VoteStakeRegistry/actions/closeDeposit'
-import { abbreviateAddress } from '@utils/formatting'
-import { notify } from '@utils/notifications'
-import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore'
-import dayjs from 'dayjs'
+} from 'VoteStakeRegistry/tools/dateTools';
+import { closeDeposit } from 'VoteStakeRegistry/actions/closeDeposit';
+import { abbreviateAddress } from '@utils/formatting';
+import { notify } from '@utils/notifications';
+import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore';
+import dayjs from 'dayjs';
const DepositCard = ({ deposit }: { deposit: DepositWithMintAccount }) => {
- const { getOwnedDeposits } = useDepositStore()
- const { realm, realmInfo, tokenRecords, ownTokenRecord } = useRealm()
- const client = useVoteStakeRegistryClientStore((s) => s.state.client)
- const wallet = useWalletStore((s) => s.current)
- const connection = useWalletStore((s) => s.connection.current)
- const endpoint = useWalletStore((s) => s.connection.endpoint)
- const [isUnlockModalOpen, setIsUnlockModalOpen] = useState(false)
+ const { getOwnedDeposits } = useDepositStore();
+ const { realm, realmInfo, tokenRecords, ownTokenRecord } = useRealm();
+ const client = useVoteStakeRegistryClientStore((s) => s.state.client);
+ const wallet = useWalletStore((s) => s.current);
+ const connection = useWalletStore((s) => s.connection.current);
+ const endpoint = useWalletStore((s) => s.connection.endpoint);
+ const [isUnlockModalOpen, setIsUnlockModalOpen] = useState(false);
const { fetchRealm, fetchWalletTokenAccounts } = useWalletStore(
- (s) => s.actions
- )
+ (s) => s.actions,
+ );
const handleWithDrawFromDeposit = async (
- depositEntry: DepositWithMintAccount
+ depositEntry: DepositWithMintAccount,
) => {
if (
ownTokenRecord!.account!.unrelinquishedVotesCount &&
@@ -47,16 +47,16 @@ const DepositCard = ({ deposit }: { deposit: DepositWithMintAccount }) => {
type: 'error',
message:
"You can't withdraw community tokens when you have active proposals",
- })
- return
+ });
+ return;
}
const rpcContext = new RpcContext(
realm!.owner,
getProgramVersionForRealm(realmInfo!),
wallet!,
connection,
- endpoint
- )
+ endpoint,
+ );
await voteRegistryWithdraw({
rpcContext,
mintPk: depositEntry!.mint.publicKey,
@@ -68,64 +68,66 @@ const DepositCard = ({ deposit }: { deposit: DepositWithMintAccount }) => {
.pubkey!,
depositIndex: depositEntry.index,
client: client,
- })
+ });
await getOwnedDeposits({
realmPk: realm!.pubkey,
communityMintPk: realm!.account.communityMint,
walletPk: wallet!.publicKey!,
client: client!,
connection,
- })
- await fetchWalletTokenAccounts()
- await fetchRealm(realmInfo!.programId, realmInfo!.realmId)
- }
+ });
+ await fetchWalletTokenAccounts();
+ await fetchRealm(realmInfo!.programId, realmInfo!.realmId);
+ };
const handleStartUnlock = () => {
- setIsUnlockModalOpen(true)
- }
+ setIsUnlockModalOpen(true);
+ };
const handleCloseDeposit = async () => {
const rpcContext = new RpcContext(
realm!.owner,
getProgramVersionForRealm(realmInfo!),
wallet!,
connection,
- endpoint
- )
+ endpoint,
+ );
await closeDeposit({
rpcContext,
realmPk: realm!.pubkey!,
depositIndex: deposit.index,
communityMintPk: realm!.account.communityMint,
client,
- })
+ });
await getOwnedDeposits({
realmPk: realm!.pubkey,
communityMintPk: realm!.account.communityMint,
walletPk: wallet!.publicKey!,
client: client!,
connection,
- })
- }
+ });
+ };
const lockedTokens = fmtMintAmount(
deposit.mint.account,
- deposit.currentlyLocked.add(deposit.available)
- )
- const type = Object.keys(deposit.lockup.kind)[0] as LockupType
- const typeName = type !== 'monthly' ? type : 'Vested'
- const isVest = type === 'monthly'
+ deposit.currentlyLocked.add(deposit.available),
+ );
+ const type = Object.keys(deposit.lockup.kind)[0] as LockupType;
+ const typeName = type !== 'monthly' ? type : 'Vested';
+ const isVest = type === 'monthly';
const isRealmCommunityMint =
deposit.mint.publicKey.toBase58() ===
- realm?.account.communityMint.toBase58()
- const isConstant = type === 'constant'
+ realm?.account.communityMint.toBase58();
+ const isConstant = type === 'constant';
const CardLabel = ({ label, value }) => {
return (
- )
- }
- const tokenInfo = tokenService.getTokenInfo(deposit.mint.publicKey.toBase58())
+ );
+ };
+ const tokenInfo = tokenService.getTokenInfo(
+ deposit.mint.publicKey.toBase58(),
+ );
return (
@@ -154,7 +156,7 @@ const DepositCard = ({ deposit }: { deposit: DepositWithMintAccount }) => {
label="Initial Amount"
value={fmtMintAmount(
deposit.mint.account,
- deposit.amountInitiallyLockedNative
+ deposit.amountInitiallyLockedNative,
)}
/>
)}
@@ -165,7 +167,7 @@ const DepositCard = ({ deposit }: { deposit: DepositWithMintAccount }) => {
deposit.vestingRate &&
`${getMintDecimalAmount(
deposit.mint.account,
- deposit.vestingRate
+ deposit.vestingRate,
).toFormat(2)} p/mo`
}
/>
@@ -174,7 +176,7 @@ const DepositCard = ({ deposit }: { deposit: DepositWithMintAccount }) => {
)}
@@ -231,7 +233,7 @@ const DepositCard = ({ deposit }: { deposit: DepositWithMintAccount }) => {
>
)}
- )
-}
+ );
+};
-export default DepositCard
+export default DepositCard;
diff --git a/VoteStakeRegistry/components/Account/LockTokensAccount.tsx b/VoteStakeRegistry/components/Account/LockTokensAccount.tsx
index 246e2b4a4f..124b4f1475 100644
--- a/VoteStakeRegistry/components/Account/LockTokensAccount.tsx
+++ b/VoteStakeRegistry/components/Account/LockTokensAccount.tsx
@@ -1,76 +1,77 @@
-import Button from '@components/Button'
-import useRealm from '@hooks/useRealm'
+import Button from '@components/Button';
+import useRealm from '@hooks/useRealm';
import {
fmtMintAmount,
getMintDecimalAmountFromNatural,
-} from '@tools/sdk/units'
-import { useEffect, useMemo, useState } from 'react'
-import LockTokensModal from './LockTokensModal'
-import DepositCommunityTokensBtn from '../TokenBalance/DepositCommunityTokensBtn'
-import WithDrawCommunityTokens from '../TokenBalance/WithdrawCommunityTokensBtn'
-import DepositCard from './DepositCard'
-import PreviousRouteBtn from '@components/PreviousRouteBtn'
-import VotingPowerBox from '../TokenBalance/VotingPowerBox'
-import { PublicKey } from '@solana/web3.js'
-import { MintInfo } from '@solana/spl-token'
-import { BN } from '@project-serum/anchor'
-import tokenService from '@utils/services/token'
-import useWalletStore from 'stores/useWalletStore'
-import { getDeposits } from 'VoteStakeRegistry/tools/deposits'
-import { DepositWithMintAccount } from 'VoteStakeRegistry/sdk/accounts'
-import useDepositStore from 'VoteStakeRegistry/stores/useDepositStore'
-import { notify } from '@utils/notifications'
-import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore'
-import { getTokenOwnerRecordAddress } from '@solana/spl-governance'
-import InlineNotification from '@components/InlineNotification'
+} from '@tools/sdk/units';
+import { useEffect, useMemo, useState } from 'react';
+import LockTokensModal from './LockTokensModal';
+import DepositCommunityTokensBtn from '../TokenBalance/DepositCommunityTokensBtn';
+import WithDrawCommunityTokens from '../TokenBalance/WithdrawCommunityTokensBtn';
+import DepositCard from './DepositCard';
+import PreviousRouteBtn from '@components/PreviousRouteBtn';
+import VotingPowerBox from '../TokenBalance/VotingPowerBox';
+import { PublicKey } from '@solana/web3.js';
+import { MintInfo } from '@solana/spl-token';
+import { BN } from '@project-serum/anchor';
+import tokenService from '@utils/services/token';
+import useWalletStore from 'stores/useWalletStore';
+import { getDeposits } from 'VoteStakeRegistry/tools/deposits';
+import { DepositWithMintAccount } from 'VoteStakeRegistry/sdk/accounts';
+import useDepositStore from 'VoteStakeRegistry/stores/useDepositStore';
+import { notify } from '@utils/notifications';
+import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore';
+import { getTokenOwnerRecordAddress } from '@solana/spl-governance';
+import InlineNotification from '@components/InlineNotification';
import {
LightningBoltIcon,
LinkIcon,
LockClosedIcon,
-} from '@heroicons/react/outline'
-import { getMintMetadata } from '@components/instructions/programs/splToken'
-import Account from './Account'
-import { abbreviateAddress } from '@utils/formatting'
+} from '@heroicons/react/outline';
+import { getMintMetadata } from '@components/instructions/programs/splToken';
+import Account from './Account';
+import { abbreviateAddress } from '@utils/formatting';
+import { BN_ZERO } from '@utils/helpers';
interface DepositBox {
- mintPk: PublicKey
- mint: MintInfo
- currentAmount: BN
- lockUpKind: string
+ mintPk: PublicKey;
+ mint: MintInfo;
+ currentAmount: BN;
+ lockUpKind: string;
}
-const unlockedTypes = ['none']
+const unlockedTypes = ['none'];
const LockTokensAccount = ({ tokenOwnerRecordPk }) => {
- const { realm, realmInfo, mint, tokenRecords, councilMint } = useRealm()
- const [isLockModalOpen, setIsLockModalOpen] = useState(false)
- const client = useVoteStakeRegistryClientStore((s) => s.state.client)
- const [reducedDeposits, setReducedDeposits] = useState
([])
- const ownDeposits = useDepositStore((s) => s.state.deposits)
- const [deposits, setDeposits] = useState([])
- const [votingPower, setVotingPower] = useState(new BN(0))
+ const { realm, realmInfo, mint, tokenRecords, councilMint } = useRealm();
+ const [isLockModalOpen, setIsLockModalOpen] = useState(false);
+ const client = useVoteStakeRegistryClientStore((s) => s.state.client);
+ const [reducedDeposits, setReducedDeposits] = useState([]);
+ const ownDeposits = useDepositStore((s) => s.state.deposits);
+ const [deposits, setDeposits] = useState([]);
+ const [votingPower, setVotingPower] = useState(BN_ZERO);
const [votingPowerFromDeposits, setVotingPowerFromDeposits] = useState(
- new BN(0)
- )
- const [isOwnerOfDeposits, setIsOwnerOfDeposits] = useState(true)
+ BN_ZERO,
+ );
+ const [isOwnerOfDeposits, setIsOwnerOfDeposits] = useState(true);
const tokenOwnerRecordWalletPk = Object.keys(tokenRecords)?.find(
- (key) => tokenRecords[key]?.pubkey?.toBase58() === tokenOwnerRecordPk
- )
- const [isLoading, setIsLoading] = useState(false)
- const connection = useWalletStore((s) => s.connection.current)
- const wallet = useWalletStore((s) => s.current)
- const connected = useWalletStore((s) => s.connected)
- const mainBoxesClasses = 'bg-bkg-1 col-span-1 p-4 rounded-md'
+ (key) => tokenRecords[key]?.pubkey?.toBase58() === tokenOwnerRecordPk,
+ );
+ const [isLoading, setIsLoading] = useState(false);
+ const connection = useWalletStore((s) => s.connection.current);
+ const wallet = useWalletStore((s) => s.current);
+ const connected = useWalletStore((s) => s.connected);
+ const mainBoxesClasses = 'bg-bkg-1 col-span-1 p-4 rounded-md';
const isNextSameRecord = (x, next) => {
- const nextType = Object.keys(next.lockup.kind)[0]
+ const nextType = Object.keys(next.lockup.kind)[0];
return (
x.mintPk.toBase58() === next.mint.publicKey.toBase58() &&
((!unlockedTypes.includes(x.lockUpKind) &&
!unlockedTypes.includes(nextType)) ||
(unlockedTypes.includes(x.lockUpKind) &&
unlockedTypes.includes(nextType)))
- )
- }
+ );
+ };
const handleGetDeposits = async () => {
- setIsLoading(true)
+ setIsLoading(true);
try {
if (
realm?.account.config.useCommunityVoterWeightAddin &&
@@ -90,13 +91,13 @@ const LockTokensAccount = ({ tokenOwnerRecordPk }) => {
: wallet.publicKey,
client: client!,
connection: connection,
- })
+ });
const reducedDeposits = deposits.reduce((curr, next) => {
- const nextType = Object.keys(next.lockup.kind)[0]
- const isUnlockedType = unlockedTypes.includes(nextType)
+ const nextType = Object.keys(next.lockup.kind)[0];
+ const isUnlockedType = unlockedTypes.includes(nextType);
const currentValue = curr.find((x) => {
- return isNextSameRecord(x, next)
- })
+ return isNextSameRecord(x, next);
+ });
if (typeof currentValue === 'undefined') {
curr.push({
mintPk: next.mint.publicKey,
@@ -105,75 +106,75 @@ const LockTokensAccount = ({ tokenOwnerRecordPk }) => {
? next.available
: next.currentlyLocked,
lockUpKind: nextType,
- })
+ });
} else {
curr.map((x) => {
if (isNextSameRecord(x, next)) {
x.currentAmount = x.currentAmount.add(
unlockedTypes.includes(x.lockUpKind)
? next.available
- : next.currentlyLocked
- )
+ : next.currentlyLocked,
+ );
}
- return x
- })
+ return x;
+ });
}
- return curr
- }, [] as DepositBox[])
- setVotingPowerFromDeposits(votingPowerFromDeposits)
- setVotingPower(votingPower)
- setDeposits(deposits)
- setReducedDeposits(reducedDeposits)
+ return curr;
+ }, [] as DepositBox[]);
+ setVotingPowerFromDeposits(votingPowerFromDeposits);
+ setVotingPower(votingPower);
+ setDeposits(deposits);
+ setReducedDeposits(reducedDeposits);
} else if (!wallet?.connected) {
- setVotingPowerFromDeposits(new BN(0))
- setVotingPower(new BN(0))
- setDeposits([])
- setReducedDeposits([])
+ setVotingPowerFromDeposits(BN_ZERO);
+ setVotingPower(BN_ZERO);
+ setDeposits([]);
+ setReducedDeposits([]);
}
} catch (e) {
notify({
type: 'error',
message: "Can't fetch deposits",
- })
+ });
}
- setIsLoading(false)
- }
+ setIsLoading(false);
+ };
useEffect(() => {
if (
JSON.stringify(ownDeposits) !== JSON.stringify(deposits) &&
isOwnerOfDeposits
) {
- handleGetDeposits()
+ handleGetDeposits();
}
- }, [JSON.stringify(ownDeposits), ownDeposits.length])
+ }, [JSON.stringify(ownDeposits), ownDeposits.length]);
useEffect(() => {
- handleGetDeposits()
- }, [isOwnerOfDeposits, client])
+ handleGetDeposits();
+ }, [isOwnerOfDeposits, client]);
useEffect(() => {
const getTokenOwnerRecord = async () => {
const defaultMint = !mint?.supply.isZero()
? realm!.account.communityMint
: !councilMint?.supply.isZero()
? realm!.account.config.councilMint
- : undefined
+ : undefined;
const tokenOwnerRecordAddress = await getTokenOwnerRecordAddress(
realm!.owner,
realm!.pubkey,
defaultMint!,
- wallet!.publicKey!
- )
+ wallet!.publicKey!,
+ );
setIsOwnerOfDeposits(
- tokenOwnerRecordAddress.toBase58() === tokenOwnerRecordPk
- )
- }
+ tokenOwnerRecordAddress.toBase58() === tokenOwnerRecordPk,
+ );
+ };
if (realm && wallet?.connected) {
- getTokenOwnerRecord()
+ getTokenOwnerRecord();
}
- }, [realm?.pubkey.toBase58(), wallet?.connected, tokenOwnerRecordPk])
+ }, [realm?.pubkey.toBase58(), wallet?.connected, tokenOwnerRecordPk]);
const hasLockedTokens = useMemo(() => {
- return reducedDeposits.find((d) => d.lockUpKind !== 'none')
- }, [reducedDeposits])
+ return reducedDeposits.find((d) => d.lockUpKind !== 'none');
+ }, [reducedDeposits]);
const lockedTokens = useMemo(() => {
return (
@@ -189,11 +190,11 @@ const LockTokensAccount = ({ tokenOwnerRecordPk }) => {
realm?.account.communityMint.toBase58() &&
depo.isUsed &&
!depo.allowClawback &&
- depo.isUsed
- )?.index
+ depo.isUsed,
+ )?.index,
)
- )
- }, [deposits])
+ );
+ }, [deposits]);
return (
@@ -246,21 +247,21 @@ const LockTokensAccount = ({ tokenOwnerRecordPk }) => {
{reducedDeposits?.map((x, idx) => {
const availableTokens = fmtMintAmount(
x.mint,
- x.currentAmount
- )
+ x.currentAmount,
+ );
const price =
getMintDecimalAmountFromNatural(
x.mint,
- x.currentAmount
+ x.currentAmount,
).toNumber() *
- tokenService.getUSDTokenPrice(x.mintPk.toBase58())
+ tokenService.getUSDTokenPrice(x.mintPk.toBase58());
const tokenName =
getMintMetadata(x.mintPk)?.name ||
tokenService.getTokenInfo(x.mintPk.toBase58())?.name ||
- abbreviateAddress(x.mintPk)
+ abbreviateAddress(x.mintPk);
const formatter = Intl.NumberFormat('en', {
notation: 'compact',
- })
+ });
return (
@@ -278,7 +279,7 @@ const LockTokensAccount = ({ tokenOwnerRecordPk }) => {
) : null}
- )
+ );
})}
{reducedDeposits.length === 0 ? (
@@ -314,8 +315,8 @@ const LockTokensAccount = ({ tokenOwnerRecordPk }) => {
realm?.account.communityMint.toBase58() &&
depo.isUsed &&
!depo.allowClawback &&
- depo.isUsed
- )?.index
+ depo.isUsed,
+ )?.index,
)
?.map((x, idx) => (
@@ -363,7 +364,7 @@ const LockTokensAccount = ({ tokenOwnerRecordPk }) => {
{connected &&
}
- )
-}
+ );
+};
-export default LockTokensAccount
+export default LockTokensAccount;
diff --git a/VoteStakeRegistry/components/Account/LockTokensModal.tsx b/VoteStakeRegistry/components/Account/LockTokensModal.tsx
index 453bf6874d..8ca4619896 100644
--- a/VoteStakeRegistry/components/Account/LockTokensModal.tsx
+++ b/VoteStakeRegistry/components/Account/LockTokensModal.tsx
@@ -1,32 +1,32 @@
-import Button, { LinkButton, SecondaryButton } from '@components/Button'
-import Input from '@components/inputs/Input'
-import { getMintMetadata } from '@components/instructions/programs/splToken'
-import Modal from '@components/Modal'
-import { QuestionMarkCircleIcon } from '@heroicons/react/outline'
-import useRealm from '@hooks/useRealm'
-import { getProgramVersionForRealm } from '@models/registry/api'
-import { BN } from '@project-serum/anchor'
-import { RpcContext } from '@solana/spl-governance'
+import Button, { LinkButton, SecondaryButton } from '@components/Button';
+import Input from '@components/inputs/Input';
+import { getMintMetadata } from '@components/instructions/programs/splToken';
+import Modal from '@components/Modal';
+import { QuestionMarkCircleIcon } from '@heroicons/react/outline';
+import useRealm from '@hooks/useRealm';
+import { getProgramVersionForRealm } from '@models/registry/api';
+import { BN } from '@project-serum/anchor';
+import { RpcContext } from '@solana/spl-governance';
import {
fmtMintAmount,
getMintDecimalAmount,
getMintMinAmountAsDecimal,
getMintNaturalAmountFromDecimalAsBN,
-} from '@tools/sdk/units'
-import { precision } from '@utils/formatting'
-import { useEffect, useState } from 'react'
-import useWalletStore from 'stores/useWalletStore'
-import { voteRegistryLockDeposit } from 'VoteStakeRegistry/actions/voteRegistryLockDeposit'
-import { DepositWithMintAccount } from 'VoteStakeRegistry/sdk/accounts'
+} from '@tools/sdk/units';
+import { precision } from '@utils/formatting';
+import { useEffect, useState } from 'react';
+import useWalletStore from 'stores/useWalletStore';
+import { voteRegistryLockDeposit } from 'VoteStakeRegistry/actions/voteRegistryLockDeposit';
+import { DepositWithMintAccount } from 'VoteStakeRegistry/sdk/accounts';
import {
yearsToDays,
daysToMonths,
getMinDurationInDays,
SECS_PER_DAY,
getFormattedStringFromDays,
-} from 'VoteStakeRegistry/tools/dateTools'
-import useDepositStore from 'VoteStakeRegistry/stores/useDepositStore'
-import { voteRegistryStartUnlock } from 'VoteStakeRegistry/actions/voteRegistryStartUnlock'
+} from 'VoteStakeRegistry/tools/dateTools';
+import useDepositStore from 'VoteStakeRegistry/stores/useDepositStore';
+import { voteRegistryStartUnlock } from 'VoteStakeRegistry/actions/voteRegistryStartUnlock';
import {
LockupKind,
lockupTypes,
@@ -35,39 +35,46 @@ import {
Period,
VestingPeriod,
vestingPeriods,
-} from 'VoteStakeRegistry/tools/types'
-import BigNumber from 'bignumber.js'
-import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore'
-import { calcMintMultiplier } from 'VoteStakeRegistry/tools/deposits'
-import ButtonGroup from '@components/ButtonGroup'
-import InlineNotification from '@components/InlineNotification'
-import Tooltip from '@components/Tooltip'
+} from 'VoteStakeRegistry/tools/types';
+import BigNumber from 'bignumber.js';
+import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore';
+import { calcMintMultiplier } from 'VoteStakeRegistry/tools/deposits';
+import ButtonGroup from '@components/ButtonGroup';
+import InlineNotification from '@components/InlineNotification';
+import Tooltip from '@components/Tooltip';
+import { BN_ZERO } from '@utils/helpers';
-const YES = 'Yes'
-const NO = 'No'
+const YES = 'Yes';
+const NO = 'No';
const LockTokensModal = ({
onClose,
isOpen,
depositToUnlock,
}: {
- onClose: () => void
- isOpen: boolean
- depositToUnlock?: DepositWithMintAccount | null
+ onClose: () => void;
+ isOpen: boolean;
+ depositToUnlock?: DepositWithMintAccount | null;
}) => {
- const { getOwnedDeposits } = useDepositStore()
- const { mint, realm, realmTokenAccount, realmInfo, tokenRecords } = useRealm()
- const client = useVoteStakeRegistryClientStore((s) => s.state.client)
+ const { getOwnedDeposits } = useDepositStore();
+ const {
+ mint,
+ realm,
+ realmTokenAccount,
+ realmInfo,
+ tokenRecords,
+ } = useRealm();
+ const client = useVoteStakeRegistryClientStore((s) => s.state.client);
const communityMintRegistrar = useVoteStakeRegistryClientStore(
- (s) => s.state.communityMintRegistrar
- )
- const connection = useWalletStore((s) => s.connection.current)
- const endpoint = useWalletStore((s) => s.connection.endpoint)
- const wallet = useWalletStore((s) => s.current)
- const deposits = useDepositStore((s) => s.state.deposits)
+ (s) => s.state.communityMintRegistrar,
+ );
+ const connection = useWalletStore((s) => s.connection.current);
+ const endpoint = useWalletStore((s) => s.connection.endpoint);
+ const wallet = useWalletStore((s) => s.current);
+ const deposits = useDepositStore((s) => s.state.deposits);
const { fetchRealm, fetchWalletTokenAccounts } = useWalletStore(
- (s) => s.actions
- )
+ (s) => s.actions,
+ );
const lockupPeriods: Period[] = [
{
@@ -97,131 +104,131 @@ const LockTokensModal = ({
].filter((x) =>
depositToUnlock
? getMinDurationInDays(depositToUnlock) <= x.defaultValue
- : true
- )
+ : true,
+ );
const maxNonCustomDaysLockup = lockupPeriods
.map((x) => x.defaultValue)
.reduce((prev, current) => {
- return prev > current ? prev : current
- })
+ return prev > current ? prev : current;
+ });
const maxMultiplier = calcMintMultiplier(
maxNonCustomDaysLockup * SECS_PER_DAY,
communityMintRegistrar,
- realm
- )
+ realm,
+ );
const depositRecord = deposits.find(
(x) =>
x.mint.publicKey.toBase58() === realm!.account.communityMint.toBase58() &&
- x.lockup.kind.none
- )
- const [lockupPeriodDays, setLockupPeriodDays] = useState(0)
- const [lockupPeriod, setLockupPeriod] = useState(lockupPeriods[0])
- const [amount, setAmount] = useState()
+ x.lockup.kind.none,
+ );
+ const [lockupPeriodDays, setLockupPeriodDays] = useState(0);
+ const [lockupPeriod, setLockupPeriod] = useState(lockupPeriods[0]);
+ const [amount, setAmount] = useState();
const [lockMoreThenDeposited, setLockMoreThenDeposited] = useState(
- YES
- )
- const [lockupType, setLockupType] = useState(lockupTypes[0])
+ YES,
+ );
+ const [lockupType, setLockupType] = useState(lockupTypes[0]);
const [
vestingPeriod,
// setVestingPeriod
- ] = useState(vestingPeriods[0])
- const [currentStep, setCurrentStep] = useState(0)
- const [showLockupTypeInfo, setShowLockupTypeInfo] = useState(false)
+ ] = useState(vestingPeriods[0]);
+ const [currentStep, setCurrentStep] = useState(0);
+ const [showLockupTypeInfo, setShowLockupTypeInfo] = useState(false);
const depositedTokens = depositRecord
? fmtMintAmount(mint, depositRecord.amountDepositedNative)
- : '0'
- const mintMinAmount = mint ? getMintMinAmountAsDecimal(mint) : 1
- const hasMoreTokensInWallet = !realmTokenAccount?.account.amount.isZero()
- const wantToLockMoreThenDeposited = lockMoreThenDeposited === 'Yes'
- const currentPrecision = precision(mintMinAmount)
+ : '0';
+ const mintMinAmount = mint ? getMintMinAmountAsDecimal(mint) : 1;
+ const hasMoreTokensInWallet = !realmTokenAccount?.account.amount.isZero();
+ const wantToLockMoreThenDeposited = lockMoreThenDeposited === 'Yes';
+ const currentPrecision = precision(mintMinAmount);
const maxAmountToUnlock = depositToUnlock
? getMintDecimalAmount(
depositToUnlock.mint.account,
- depositToUnlock?.amountInitiallyLockedNative
+ depositToUnlock?.amountInitiallyLockedNative,
)
- : 0
+ : 0;
const maxAmountToLock =
depositRecord && mint
? wantToLockMoreThenDeposited
? getMintDecimalAmount(
mint,
depositRecord?.amountDepositedNative.add(
- new BN(realmTokenAccount!.account.amount)
- )
+ new BN(realmTokenAccount!.account.amount),
+ ),
)
: getMintDecimalAmount(mint, depositRecord?.amountDepositedNative)
- : 0
- const maxAmount = depositToUnlock ? maxAmountToUnlock : maxAmountToLock
+ : 0;
+ const maxAmount = depositToUnlock ? maxAmountToUnlock : maxAmountToLock;
const maxAmountToLockFmt =
depositRecord && mint
? wantToLockMoreThenDeposited
? fmtMintAmount(
mint,
depositRecord?.amountDepositedNative.add(
- new BN(realmTokenAccount!.account.amount)
- )
+ new BN(realmTokenAccount!.account.amount),
+ ),
)
: fmtMintAmount(mint, depositRecord?.amountDepositedNative)
- : 0
+ : 0;
const maxAmountToUnlockFmt = depositToUnlock
? fmtMintAmount(
depositToUnlock.mint.account,
- depositToUnlock?.amountInitiallyLockedNative
+ depositToUnlock?.amountInitiallyLockedNative,
)
- : 0
+ : 0;
const maxAmountFmt = depositToUnlock
? maxAmountToUnlockFmt
- : maxAmountToLockFmt
+ : maxAmountToLockFmt;
const tokenName = mint
? getMintMetadata(realm?.account.communityMint)?.name || 'tokens'
- : ''
+ : '';
const currentMultiplier = calcMintMultiplier(
lockupPeriodDays * SECS_PER_DAY,
communityMintRegistrar,
- realm
- )
+ realm,
+ );
const currentPercentOfMaxMultiplier =
- (100 * currentMultiplier) / maxMultiplier
+ (100 * currentMultiplier) / maxMultiplier;
const handleNextStep = () => {
- setCurrentStep(currentStep + 1)
- }
+ setCurrentStep(currentStep + 1);
+ };
const goToStep = (val: number) => {
- setCurrentStep(val)
- }
+ setCurrentStep(val);
+ };
const validateAmountOnBlur = () => {
const val = parseFloat(
Math.max(
Number(mintMinAmount),
- Math.min(Number(maxAmount), Number(amount))
- ).toFixed(currentPrecision)
- )
- setAmount(val)
- }
+ Math.min(Number(maxAmount), Number(amount)),
+ ).toFixed(currentPrecision),
+ );
+ setAmount(val);
+ };
const handleSaveLock = async () => {
const rpcContext = new RpcContext(
realm!.owner,
getProgramVersionForRealm(realmInfo!),
wallet!,
connection,
- endpoint
- )
+ endpoint,
+ );
const totalAmountToLock = getMintNaturalAmountFromDecimalAsBN(
amount!,
- mint!.decimals
- )
+ mint!.decimals,
+ );
const totalAmountInDeposit =
- depositRecord?.amountDepositedNative || new BN(0)
+ depositRecord?.amountDepositedNative || BN_ZERO;
const whatWillBeLeftInsideDeposit = totalAmountInDeposit.sub(
- totalAmountToLock
- )
+ totalAmountToLock,
+ );
const amountFromDeposit = whatWillBeLeftInsideDeposit.isNeg()
? totalAmountInDeposit
- : totalAmountToLock
+ : totalAmountToLock;
await voteRegistryLockDeposit({
rpcContext,
mintPk: realm!.account.communityMint!,
@@ -237,40 +244,40 @@ const LockTokensModal = ({
tokenOwnerRecordPk:
tokenRecords[wallet!.publicKey!.toBase58()]?.pubkey || null,
client: client,
- })
+ });
await getOwnedDeposits({
realmPk: realm!.pubkey,
communityMintPk: realm!.account.communityMint,
walletPk: wallet!.publicKey!,
client: client!,
connection,
- })
- fetchWalletTokenAccounts()
- fetchRealm(realmInfo!.programId, realmInfo!.realmId)
- onClose()
- }
+ });
+ fetchWalletTokenAccounts();
+ fetchRealm(realmInfo!.programId, realmInfo!.realmId);
+ onClose();
+ };
const handleSaveUnlock = async () => {
if (!depositToUnlock) {
- throw 'No deposit to unlock selected'
+ throw 'No deposit to unlock selected';
}
const rpcContext = new RpcContext(
realm!.owner,
getProgramVersionForRealm(realmInfo!),
wallet!,
connection,
- endpoint
- )
+ endpoint,
+ );
const totalAmountToUnlock = getMintNaturalAmountFromDecimalAsBN(
amount!,
- depositToUnlock!.mint.account.decimals
- )
+ depositToUnlock!.mint.account.decimals,
+ );
- const totalAmountInDeposit = depositToUnlock.currentlyLocked
+ const totalAmountInDeposit = depositToUnlock.currentlyLocked;
const whatWillBeLeftInsideDeposit = totalAmountInDeposit.sub(
- totalAmountToUnlock
- )
+ totalAmountToUnlock,
+ );
await voteRegistryStartUnlock({
rpcContext,
@@ -285,18 +292,18 @@ const LockTokensModal = ({
tokenOwnerRecordPk:
tokenRecords[wallet!.publicKey!.toBase58()]?.pubkey || null,
client: client,
- })
+ });
await getOwnedDeposits({
realmPk: realm!.pubkey,
communityMintPk: realm!.account.communityMint,
walletPk: wallet!.publicKey!,
client: client!,
connection,
- })
+ });
- onClose()
- }
- const labelClasses = 'mb-2 text-fgd-2 text-sm'
+ onClose();
+ };
+ const labelClasses = 'mb-2 text-fgd-2 text-sm';
const DoYouWantToDepositMoreComponent = () => (
@@ -310,7 +317,7 @@ const LockTokensModal = ({
values={[YES, NO]}
/>
- )
+ );
const getCurrentStep = () => {
switch (currentStep) {
case 0:
@@ -334,7 +341,7 @@ const LockTokensModal = ({
onChange={(type) =>
setLockupType(
//@ts-ignore
- lockupTypes.find((t) => t.displayName === type)
+ lockupTypes.find((t) => t.displayName === type),
)
}
values={lockupTypes.map((type) => type.displayName)}
@@ -382,7 +389,7 @@ const LockTokensModal = ({
onChange={(period) =>
setLockupPeriod(
//@ts-ignore
- lockupPeriods.find((p) => p.display === period)
+ lockupPeriods.find((p) => p.display === period),
)
}
values={lockupPeriods.map((p) => p.display)}
@@ -463,7 +470,7 @@ const LockTokensModal = ({
>
- )
+ );
case 1:
return (
@@ -484,29 +491,29 @@ const LockTokensModal = ({
Locking tokens can’t be undone.
)}
- )
+ );
default:
- return 'Unknown step'
+ return 'Unknown step';
}
- }
+ };
useEffect(() => {
if (amount) {
- validateAmountOnBlur()
+ validateAmountOnBlur();
}
- }, [lockMoreThenDeposited])
+ }, [lockMoreThenDeposited]);
useEffect(() => {
- setLockupPeriod(lockupPeriods[0])
- }, [communityMintRegistrar])
+ setLockupPeriod(lockupPeriods[0]);
+ }, [communityMintRegistrar]);
useEffect(() => {
if (depositToUnlock) {
- goToStep(0)
+ goToStep(0);
}
- }, [depositToUnlock])
+ }, [depositToUnlock]);
useEffect(() => {
- setLockupPeriodDays(lockupPeriod.defaultValue)
- }, [lockupPeriod.defaultValue])
+ setLockupPeriodDays(lockupPeriod.defaultValue);
+ }, [lockupPeriod.defaultValue]);
// const isMainBtnVisible = !hasMoreTokensInWallet || currentStep !== 0
- const isTitleVisible = currentStep !== 3
+ const isTitleVisible = currentStep !== 3;
const getCurrentBtnForStep = () => {
switch (currentStep) {
case 0:
@@ -523,7 +530,7 @@ const LockTokensModal = ({
>
{depositToUnlock ? 'Start unlock' : 'Lock Tokens'}
- )
+ );
case 1:
return (
- )
+ );
default:
return (
- )
+ );
}
- }
+ };
return (
{currentStep !== 1 ? (
@@ -587,7 +594,7 @@ const LockTokensModal = ({
>
)}
- )
-}
+ );
+};
-export default LockTokensModal
+export default LockTokensModal;
diff --git a/VoteStakeRegistry/components/TokenBalance/DepositCommunityTokensBtn.tsx b/VoteStakeRegistry/components/TokenBalance/DepositCommunityTokensBtn.tsx
index 08614881b9..4d8d023eab 100644
--- a/VoteStakeRegistry/components/TokenBalance/DepositCommunityTokensBtn.tsx
+++ b/VoteStakeRegistry/components/TokenBalance/DepositCommunityTokensBtn.tsx
@@ -1,46 +1,46 @@
-import Button from '@components/Button'
-import Loading from '@components/Loading'
-import useRealm from '@hooks/useRealm'
-import { getProgramVersionForRealm } from '@models/registry/api'
-import { BN } from '@project-serum/anchor'
-import { RpcContext } from '@solana/spl-governance'
-import { notify } from '@utils/notifications'
-import { useState } from 'react'
-import useWalletStore from 'stores/useWalletStore'
-import { voteRegistryDepositWithoutLockup } from 'VoteStakeRegistry/actions/voteRegistryDepositWithoutLockup'
-import useDepositStore from 'VoteStakeRegistry/stores/useDepositStore'
-import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore'
+import Button from '@components/Button';
+import Loading from '@components/Loading';
+import useRealm from '@hooks/useRealm';
+import { getProgramVersionForRealm } from '@models/registry/api';
+import { RpcContext } from '@solana/spl-governance';
+import { BN_ZERO } from '@utils/helpers';
+import { notify } from '@utils/notifications';
+import { useState } from 'react';
+import useWalletStore from 'stores/useWalletStore';
+import { voteRegistryDepositWithoutLockup } from 'VoteStakeRegistry/actions/voteRegistryDepositWithoutLockup';
+import useDepositStore from 'VoteStakeRegistry/stores/useDepositStore';
+import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore';
const DepositCommunityTokensBtn = ({ className = '' }) => {
- const { getOwnedDeposits } = useDepositStore()
- const { realm, realmInfo, realmTokenAccount, tokenRecords } = useRealm()
- const client = useVoteStakeRegistryClientStore((s) => s.state.client)
- const [isLoading, setIsLoading] = useState(false)
- const wallet = useWalletStore((s) => s.current)
- const connected = useWalletStore((s) => s.connected)
- const connection = useWalletStore((s) => s.connection.current)
- const endpoint = useWalletStore((s) => s.connection.endpoint)
+ const { getOwnedDeposits } = useDepositStore();
+ const { realm, realmInfo, realmTokenAccount, tokenRecords } = useRealm();
+ const client = useVoteStakeRegistryClientStore((s) => s.state.client);
+ const [isLoading, setIsLoading] = useState(false);
+ const wallet = useWalletStore((s) => s.current);
+ const connected = useWalletStore((s) => s.connected);
+ const connection = useWalletStore((s) => s.connection.current);
+ const endpoint = useWalletStore((s) => s.connection.endpoint);
const { fetchRealm, fetchWalletTokenAccounts } = useWalletStore(
- (s) => s.actions
- )
+ (s) => s.actions,
+ );
const depositAllTokens = async function () {
if (!realm) {
- throw 'No realm selected'
+ throw 'No realm selected';
}
- setIsLoading(true)
- const currentTokenOwnerRecord = tokenRecords[wallet!.publicKey!.toBase58()]
+ setIsLoading(true);
+ const currentTokenOwnerRecord = tokenRecords[wallet!.publicKey!.toBase58()];
const tokenOwnerRecordPk =
typeof currentTokenOwnerRecord !== 'undefined'
? currentTokenOwnerRecord.pubkey
- : null
+ : null;
const rpcContext = new RpcContext(
realm.owner,
getProgramVersionForRealm(realmInfo!),
wallet!,
connection,
- endpoint
- )
+ endpoint,
+ );
try {
await voteRegistryDepositWithoutLockup({
rpcContext,
@@ -52,31 +52,31 @@ const DepositCommunityTokensBtn = ({ className = '' }) => {
tokenOwnerRecordPk,
client: client,
communityMintPk: realm.account.communityMint,
- })
+ });
await getOwnedDeposits({
realmPk: realm!.pubkey,
communityMintPk: realm!.account.communityMint,
walletPk: wallet!.publicKey!,
client: client!,
connection,
- })
- await fetchWalletTokenAccounts()
- await fetchRealm(realmInfo!.programId, realmInfo!.realmId)
+ });
+ await fetchWalletTokenAccounts();
+ await fetchRealm(realmInfo!.programId, realmInfo!.realmId);
} catch (e) {
- console.log(e)
- notify({ message: `Something went wrong ${e}`, type: 'error' })
+ console.error(e);
+ notify({ message: `Something went wrong ${e}`, type: 'error' });
}
- setIsLoading(false)
- }
+ setIsLoading(false);
+ };
const hasTokensInWallet =
- realmTokenAccount && realmTokenAccount.account.amount.gt(new BN(0))
+ realmTokenAccount && realmTokenAccount.account.amount.gt(BN_ZERO);
const depositTooltipContent = !connected
? 'Connect your wallet to deposit'
: !hasTokensInWallet
? "You don't have any governance tokens in your wallet to deposit."
- : ''
+ : '';
return (
- )
-}
+ );
+};
-export default DepositCommunityTokensBtn
+export default DepositCommunityTokensBtn;
diff --git a/VoteStakeRegistry/components/TokenBalance/LockPluginTokenBalanceCard.tsx b/VoteStakeRegistry/components/TokenBalance/LockPluginTokenBalanceCard.tsx
index 489b9fe14e..88acf6029a 100644
--- a/VoteStakeRegistry/components/TokenBalance/LockPluginTokenBalanceCard.tsx
+++ b/VoteStakeRegistry/components/TokenBalance/LockPluginTokenBalanceCard.tsx
@@ -1,53 +1,54 @@
-import { MintInfo } from '@solana/spl-token'
-import { PublicKey } from '@solana/web3.js'
-import BN from 'bn.js'
-import useRealm from '@hooks/useRealm'
-import { getTokenOwnerRecordAddress, Proposal } from '@solana/spl-governance'
-import useWalletStore from '../../../stores/useWalletStore'
-import { Option } from '@tools/core/option'
-import { GoverningTokenType } from '@solana/spl-governance'
-import { fmtMintAmount } from '@tools/sdk/units'
-import { getMintMetadata } from '@components/instructions/programs/splToken'
-import useQueryContext from '@hooks/useQueryContext'
-import DepositCommunityTokensBtn from './DepositCommunityTokensBtn'
-import WithDrawCommunityTokens from './WithdrawCommunityTokensBtn'
-import useDepositStore from 'VoteStakeRegistry/stores/useDepositStore'
-import VotingPowerBox from './VotingPowerBox'
-import { useRouter } from 'next/router'
-import { useEffect, useState } from 'react'
-import { ChevronRightIcon } from '@heroicons/react/solid'
-import InlineNotification from '@components/InlineNotification'
-import { LinkButton } from '@components/Button'
+import { MintInfo } from '@solana/spl-token';
+import { PublicKey } from '@solana/web3.js';
+import useRealm from '@hooks/useRealm';
+import { getTokenOwnerRecordAddress, Proposal } from '@solana/spl-governance';
+import useWalletStore from '../../../stores/useWalletStore';
+import { Option } from '@tools/core/option';
+import { GoverningTokenType } from '@solana/spl-governance';
+import { fmtMintAmount } from '@tools/sdk/units';
+import { getMintMetadata } from '@components/instructions/programs/splToken';
+import useQueryContext from '@hooks/useQueryContext';
+import DepositCommunityTokensBtn from './DepositCommunityTokensBtn';
+import WithDrawCommunityTokens from './WithdrawCommunityTokensBtn';
+import useDepositStore from 'VoteStakeRegistry/stores/useDepositStore';
+import VotingPowerBox from './VotingPowerBox';
+import { useRouter } from 'next/router';
+import { useEffect, useState } from 'react';
+import { ChevronRightIcon } from '@heroicons/react/solid';
+import InlineNotification from '@components/InlineNotification';
+import { LinkButton } from '@components/Button';
+import { BN_ZERO } from '@utils/helpers';
const LockPluginTokenBalanceCard = ({
proposal,
}: {
- proposal?: Option
+ proposal?: Option;
}) => {
- const router = useRouter()
- const { fmtUrlWithCluster } = useQueryContext()
- const { councilMint, mint, realm, symbol } = useRealm()
- const [tokenOwnerRecordPk, setTokenOwneRecordPk] = useState('')
- const connected = useWalletStore((s) => s.connected)
- const wallet = useWalletStore((s) => s.current)
+ const router = useRouter();
+ const { fmtUrlWithCluster } = useQueryContext();
+ const { councilMint, mint, realm, symbol } = useRealm();
+ const [tokenOwnerRecordPk, setTokenOwneRecordPk] = useState('');
+ const connected = useWalletStore((s) => s.connected);
+ const wallet = useWalletStore((s) => s.current);
const isDepositVisible = (
depositMint: MintInfo | undefined,
- realmMint: PublicKey | undefined
+ realmMint: PublicKey | undefined,
) =>
depositMint &&
(!proposal ||
(proposal.isSome() &&
- proposal.value.governingTokenMint.toBase58() === realmMint?.toBase58()))
+ proposal.value.governingTokenMint.toBase58() ===
+ realmMint?.toBase58()));
const communityDepositVisible =
// If there is no council then community deposit is the only option to show
!realm?.account.config.councilMint ||
- isDepositVisible(mint, realm?.account.communityMint)
+ isDepositVisible(mint, realm?.account.communityMint);
const councilDepositVisible = isDepositVisible(
councilMint,
- realm?.account.config.councilMint
- )
+ realm?.account.config.councilMint,
+ );
useEffect(() => {
const getTokenOwnerRecord = async () => {
@@ -55,21 +56,21 @@ const LockPluginTokenBalanceCard = ({
? realm!.account.communityMint
: !councilMint?.supply.isZero()
? realm!.account.config.councilMint
- : undefined
+ : undefined;
const tokenOwnerRecordAddress = await getTokenOwnerRecordAddress(
realm!.owner,
realm!.pubkey,
defaultMint!,
- wallet!.publicKey!
- )
- setTokenOwneRecordPk(tokenOwnerRecordAddress.toBase58())
- }
+ wallet!.publicKey!,
+ );
+ setTokenOwneRecordPk(tokenOwnerRecordAddress.toBase58());
+ };
if (realm && wallet?.connected) {
- getTokenOwnerRecord()
+ getTokenOwnerRecord();
}
- }, [realm?.pubkey.toBase58(), wallet?.connected])
+ }, [realm?.pubkey.toBase58(), wallet?.connected]);
- const hasLoaded = mint || councilMint
+ const hasLoaded = mint || councilMint;
return (
@@ -82,9 +83,9 @@ const LockPluginTokenBalanceCard = ({
}`}
onClick={() => {
const url = fmtUrlWithCluster(
- `/dao/${symbol}/account/${tokenOwnerRecordPk}`
- )
- router.push(url)
+ `/dao/${symbol}/account/${tokenOwnerRecordPk}`,
+ );
+ router.push(url);
}}
>
Manage
@@ -117,82 +118,82 @@ const LockPluginTokenBalanceCard = ({
>
)}
- )
-}
+ );
+};
const TokenDeposit = ({
mint,
tokenType,
}: {
- mint: MintInfo | undefined
- tokenType: GoverningTokenType
- councilVote?: boolean
+ mint: MintInfo | undefined;
+ tokenType: GoverningTokenType;
+ councilVote?: boolean;
}) => {
- const { realm, realmTokenAccount, councilTokenAccount } = useRealm()
- const connected = useWalletStore((s) => s.connected)
- const deposits = useDepositStore((s) => s.state.deposits)
- const votingPower = useDepositStore((s) => s.state.votingPower)
+ const { realm, realmTokenAccount, councilTokenAccount } = useRealm();
+ const connected = useWalletStore((s) => s.connected);
+ const deposits = useDepositStore((s) => s.state.deposits);
+ const votingPower = useDepositStore((s) => s.state.votingPower);
const votingPowerFromDeposits = useDepositStore(
- (s) => s.state.votingPowerFromDeposits
- )
+ (s) => s.state.votingPowerFromDeposits,
+ );
const lockedTokensAmount = deposits
.filter(
(x) =>
typeof x.lockup.kind['none'] === 'undefined' &&
- x.mint.publicKey.toBase58() === realm?.account.communityMint.toBase58()
+ x.mint.publicKey.toBase58() === realm?.account.communityMint.toBase58(),
)
- .reduce((curr, next) => curr.add(next.currentlyLocked), new BN(0))
+ .reduce((curr, next) => curr.add(next.currentlyLocked), BN_ZERO);
const depositRecord = deposits.find(
(x) =>
x.mint.publicKey.toBase58() === realm!.account.communityMint.toBase58() &&
- x.lockup.kind.none
- )
+ x.lockup.kind.none,
+ );
// Do not show deposits for mints with zero supply because nobody can deposit anyway
if (!mint || mint.supply.isZero()) {
- return null
+ return null;
}
const depositTokenAccount =
tokenType === GoverningTokenType.Community
? realmTokenAccount
- : councilTokenAccount
+ : councilTokenAccount;
const depositMint =
tokenType === GoverningTokenType.Community
? realm?.account.communityMint
- : realm?.account.config.councilMint
+ : realm?.account.config.councilMint;
- const tokenName = getMintMetadata(depositMint)?.name ?? realm?.account.name
+ const tokenName = getMintMetadata(depositMint)?.name ?? realm?.account.name;
const depositTokenName = `${tokenName} ${
tokenType === GoverningTokenType.Community ? '' : 'Council'
- }`
+ }`;
const hasTokensInWallet =
- depositTokenAccount && depositTokenAccount.account.amount.gt(new BN(0))
+ depositTokenAccount && depositTokenAccount.account.amount.gt(BN_ZERO);
const hasTokensDeposited =
- depositRecord && depositRecord.amountDepositedNative.gt(new BN(0))
+ depositRecord && depositRecord.amountDepositedNative.gt(BN_ZERO);
const lockTokensFmt =
- lockedTokensAmount && mint ? fmtMintAmount(mint, lockedTokensAmount) : '0'
+ lockedTokensAmount && mint ? fmtMintAmount(mint, lockedTokensAmount) : '0';
const availableTokens =
depositRecord && mint
? fmtMintAmount(mint, depositRecord.amountDepositedNative)
- : '0'
+ : '0';
const canShowAvailableTokensMessage =
- !hasTokensDeposited && hasTokensInWallet && connected
- const canExecuteAction = !hasTokensDeposited ? 'deposit' : 'withdraw'
- const canDepositToken = !hasTokensDeposited && hasTokensInWallet
+ !hasTokensDeposited && hasTokensInWallet && connected;
+ const canExecuteAction = !hasTokensDeposited ? 'deposit' : 'withdraw';
+ const canDepositToken = !hasTokensDeposited && hasTokensInWallet;
const tokensToShow =
canDepositToken && depositTokenAccount
? fmtMintAmount(mint, depositTokenAccount.account.amount)
: canDepositToken
? availableTokens
- : 0
+ : 0;
return (
<>
@@ -237,7 +238,7 @@ const TokenDeposit = ({
>
- )
-}
+ );
+};
-export default LockPluginTokenBalanceCard
+export default LockPluginTokenBalanceCard;
diff --git a/VoteStakeRegistry/components/TokenBalance/VotingPowerBox.tsx b/VoteStakeRegistry/components/TokenBalance/VotingPowerBox.tsx
index 8e78f69584..9923a286a6 100644
--- a/VoteStakeRegistry/components/TokenBalance/VotingPowerBox.tsx
+++ b/VoteStakeRegistry/components/TokenBalance/VotingPowerBox.tsx
@@ -1,8 +1,8 @@
-import { BN } from '@project-serum/anchor'
-import { MintInfo } from '@solana/spl-token'
-import { fmtMintAmount } from '@tools/sdk/units'
-import { LightningBoltIcon } from '@heroicons/react/solid'
-import Tooltip from '@components/Tooltip'
+import { BN } from '@project-serum/anchor';
+import { MintInfo } from '@solana/spl-token';
+import { fmtMintAmount } from '@tools/sdk/units';
+import { LightningBoltIcon } from '@heroicons/react/solid';
+import Tooltip from '@components/Tooltip';
const VotingPowerBox = ({
votingPower,
@@ -11,14 +11,14 @@ const VotingPowerBox = ({
className = '',
style,
}: {
- votingPower: BN
- mint: MintInfo
- votingPowerFromDeposits: BN
- className?: string
- style?: any
+ votingPower: BN;
+ mint: MintInfo;
+ votingPowerFromDeposits: BN;
+ className?: string;
+ style?: any;
}) => {
const votingPowerFmt =
- votingPower && mint ? fmtMintAmount(mint, votingPower) : '0'
+ votingPower && mint ? fmtMintAmount(mint, votingPower) : '0';
return (
@@ -37,7 +37,7 @@ const VotingPowerBox = ({
)}
- )
-}
+ );
+};
-export default VotingPowerBox
+export default VotingPowerBox;
diff --git a/VoteStakeRegistry/components/TokenBalance/WithdrawCommunityTokensBtn.tsx b/VoteStakeRegistry/components/TokenBalance/WithdrawCommunityTokensBtn.tsx
index da70614aa5..65d558d831 100644
--- a/VoteStakeRegistry/components/TokenBalance/WithdrawCommunityTokensBtn.tsx
+++ b/VoteStakeRegistry/components/TokenBalance/WithdrawCommunityTokensBtn.tsx
@@ -1,28 +1,27 @@
-import Button from '@components/Button'
-import useRealm from '@hooks/useRealm'
-import { getUnrelinquishedVoteRecords } from '@models/api'
-import { BN } from '@project-serum/anchor'
+import Button from '@components/Button';
+import useRealm from '@hooks/useRealm';
+import { getUnrelinquishedVoteRecords } from '@models/api';
import {
getProposal,
ProposalState,
withFinalizeVote,
withRelinquishVote,
-} from '@solana/spl-governance'
-import { Transaction, TransactionInstruction } from '@solana/web3.js'
-import { chunks } from '@utils/helpers'
-import { sendTransaction } from '@utils/send'
-import useWalletStore from 'stores/useWalletStore'
-import { withVoteRegistryWithdraw } from 'VoteStakeRegistry/sdk/withVoteRegistryWithdraw'
-import useDepositStore from 'VoteStakeRegistry/stores/useDepositStore'
-import { getProgramVersionForRealm } from '@models/registry/api'
-import { notify } from '@utils/notifications'
-import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore'
-import { useState } from 'react'
-import Loading from '@components/Loading'
+} from '@solana/spl-governance';
+import { Transaction, TransactionInstruction } from '@solana/web3.js';
+import { BN_ZERO, chunks } from '@utils/helpers';
+import { sendTransaction } from '@utils/send';
+import useWalletStore from 'stores/useWalletStore';
+import { withVoteRegistryWithdraw } from 'VoteStakeRegistry/sdk/withVoteRegistryWithdraw';
+import useDepositStore from 'VoteStakeRegistry/stores/useDepositStore';
+import { getProgramVersionForRealm } from '@models/registry/api';
+import { notify } from '@utils/notifications';
+import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore';
+import { useState } from 'react';
+import Loading from '@components/Loading';
const WithDrawCommunityTokens = () => {
- const { getOwnedDeposits } = useDepositStore()
- const client = useVoteStakeRegistryClientStore((s) => s.state.client)
+ const { getOwnedDeposits } = useDepositStore();
+ const client = useVoteStakeRegistryClientStore((s) => s.state.client);
const {
realm,
realmInfo,
@@ -32,69 +31,66 @@ const WithDrawCommunityTokens = () => {
tokenRecords,
toManyCommunityOutstandingProposalsForUser,
toManyCouncilOutstandingProposalsForUse,
- } = useRealm()
- const [isLoading, setIsLoading] = useState(false)
- const wallet = useWalletStore((s) => s.current)
- const connected = useWalletStore((s) => s.connected)
- const connection = useWalletStore((s) => s.connection.current)
- const deposits = useDepositStore((s) => s.state.deposits)
+ } = useRealm();
+ const [isLoading, setIsLoading] = useState(false);
+ const wallet = useWalletStore((s) => s.current);
+ const connected = useWalletStore((s) => s.connected);
+ const connection = useWalletStore((s) => s.connection.current);
+ const deposits = useDepositStore((s) => s.state.deposits);
const { fetchRealm, fetchWalletTokenAccounts } = useWalletStore(
- (s) => s.actions
- )
+ (s) => s.actions,
+ );
const depositRecord = deposits.find(
(x) =>
x.mint.publicKey.toBase58() === realm!.account.communityMint.toBase58() &&
- x.lockup.kind.none
- )
+ x.lockup.kind.none,
+ );
const withdrawAllTokens = async function () {
- setIsLoading(true)
- const instructions: TransactionInstruction[] = []
+ setIsLoading(true);
+ const instructions: TransactionInstruction[] = [];
// If there are unrelinquished votes for the voter then let's release them in the same instruction as convenience
if (ownTokenRecord!.account!.unrelinquishedVotesCount > 0) {
const voteRecords = await getUnrelinquishedVoteRecords(
connection,
realmInfo!.programId,
- ownTokenRecord!.account!.governingTokenOwner
- )
-
- console.log('Vote Records', voteRecords)
+ ownTokenRecord!.account!.governingTokenOwner,
+ );
for (const voteRecord of Object.values(voteRecords)) {
- let proposal = proposals[voteRecord.account.proposal.toBase58()]
+ let proposal = proposals[voteRecord.account.proposal.toBase58()];
if (!proposal) {
- continue
+ continue;
}
if (proposal.account.state === ProposalState.Voting) {
// If the Proposal is in Voting state refetch it to make sure we have the latest state to avoid false positives
- proposal = await getProposal(connection, proposal.pubkey)
+ proposal = await getProposal(connection, proposal.pubkey);
if (proposal.account.state === ProposalState.Voting) {
const governance =
- governances[proposal.account.governance.toBase58()]
+ governances[proposal.account.governance.toBase58()];
if (proposal.account.getTimeToVoteEnd(governance.account) > 0) {
- setIsLoading(false)
+ setIsLoading(false);
// Note: It's technically possible to withdraw the vote here but I think it would be confusing and people would end up unconsciously withdrawing their votes
notify({
type: 'error',
message: `Can't withdraw tokens while Proposal ${proposal.account.name} is being voted on. Please withdraw your vote first`,
- })
- throw new Error(
- `Can't withdraw tokens while Proposal ${proposal.account.name} is being voted on. Please withdraw your vote first`
- )
- } else {
- // finalize proposal before withdrawing tokens so we don't stop the vote from succeeding
- await withFinalizeVote(
- instructions,
- realmInfo!.programId,
- getProgramVersionForRealm(realmInfo!),
- realm!.pubkey,
- proposal.account.governance,
- proposal.pubkey,
- proposal.account.tokenOwnerRecord,
- proposal.account.governingTokenMint
- )
+ });
+
+ return;
}
+
+ // finalize proposal before withdrawing tokens so we don't stop the vote from succeeding
+ await withFinalizeVote(
+ instructions,
+ realmInfo!.programId,
+ getProgramVersionForRealm(realmInfo!),
+ realm!.pubkey,
+ proposal.account.governance,
+ proposal.pubkey,
+ proposal.account.tokenOwnerRecord,
+ proposal.account.governingTokenMint,
+ );
}
}
@@ -110,8 +106,8 @@ const WithDrawCommunityTokens = () => {
proposal.account.governingTokenMint,
voteRecord.pubkey,
ownTokenRecord!.account.governingTokenOwner,
- wallet!.publicKey!
- )
+ wallet!.publicKey!,
+ );
}
}
@@ -127,14 +123,14 @@ const WithDrawCommunityTokens = () => {
depositIndex: depositRecord!.index,
connection,
client: client,
- })
+ });
try {
// use chunks of 8 here since we added finalize,
// because previously 9 withdraws used to fit into one tx
- const ixChunks = chunks(instructions, 8)
+ const ixChunks = chunks(instructions, 8);
for (const [index, chunk] of ixChunks.entries()) {
- const transaction = new Transaction().add(...chunk)
+ const transaction = new Transaction().add(...chunk);
await sendTransaction({
connection,
wallet,
@@ -147,27 +143,27 @@ const WithDrawCommunityTokens = () => {
index == ixChunks.length - 1
? 'Tokens have been withdrawn'
: `Released tokens (${index}/${ixChunks.length - 2})`,
- })
+ });
}
- await fetchRealm(realmInfo!.programId, realmInfo!.realmId)
- await fetchWalletTokenAccounts()
+ await fetchRealm(realmInfo!.programId, realmInfo!.realmId);
+ await fetchWalletTokenAccounts();
await getOwnedDeposits({
realmPk: realm!.pubkey,
communityMintPk: realm!.account.communityMint,
walletPk: wallet!.publicKey!,
client: client!,
connection,
- })
+ });
} catch (ex) {
console.error(
"Can't withdraw tokens, go to my proposals in account view to check outstanding proposals",
- ex
- )
+ ex,
+ );
}
- setIsLoading(false)
- }
+ setIsLoading(false);
+ };
const hasTokensDeposited =
- depositRecord && depositRecord.amountDepositedNative.gt(new BN(0))
+ depositRecord && depositRecord.amountDepositedNative.gt(BN_ZERO);
const withdrawTooltipContent = !connected
? 'Connect your wallet to withdraw'
: !hasTokensDeposited
@@ -175,7 +171,7 @@ const WithDrawCommunityTokens = () => {
: toManyCouncilOutstandingProposalsForUse ||
toManyCommunityOutstandingProposalsForUser
? "You don't have any governance tokens to withdraw."
- : ''
+ : '';
return (
- )
-}
+ );
+};
-export default WithDrawCommunityTokens
+export default WithDrawCommunityTokens;
diff --git a/VoteStakeRegistry/components/instructions/Clawback.tsx b/VoteStakeRegistry/components/instructions/Clawback.tsx
index 799afeb537..06040b8982 100644
--- a/VoteStakeRegistry/components/instructions/Clawback.tsx
+++ b/VoteStakeRegistry/components/instructions/Clawback.tsx
@@ -1,72 +1,72 @@
-import React, { useContext, useEffect, useState } from 'react'
-import useRealm from '@hooks/useRealm'
-import { TransactionInstruction } from '@solana/web3.js'
-import useWalletStore from 'stores/useWalletStore'
-import { GovernedMultiTypeAccount, tryGetMint } from '@utils/tokens'
+import React, { useContext, useEffect, useState } from 'react';
+import useRealm from '@hooks/useRealm';
+import { TransactionInstruction } from '@solana/web3.js';
+import useWalletStore from 'stores/useWalletStore';
+import { tryGetMint } from '@utils/tokens';
import {
ClawbackForm,
- UiInstruction,
-} from '@utils/uiTypes/proposalCreationTypes'
-import useGovernanceAssets from '@hooks/useGovernanceAssets'
+ FormInstructionData,
+} from '@utils/uiTypes/proposalCreationTypes';
+import useGovernanceAssets from '@hooks/useGovernanceAssets';
import {
Governance,
serializeInstructionToBase64,
-} from '@solana/spl-governance'
-import { ProgramAccount } from '@solana/spl-governance'
-import { validateInstruction } from '@utils/instructionTools'
-import { NewProposalContext } from 'pages/dao/[symbol]/proposal/new'
-import GovernedAccountSelect from 'pages/dao/[symbol]/proposal/components/GovernedAccountSelect'
-import * as yup from 'yup'
+} from '@solana/spl-governance';
+import { ProgramAccount } from '@solana/spl-governance';
+import { validateInstruction } from '@utils/instructionTools';
+import { NewProposalContext } from 'pages/dao/[symbol]/proposal/new';
+import GovernedAccountSelect from 'pages/dao/[symbol]/proposal/components/GovernedAccountSelect';
+import * as yup from 'yup';
import {
Deposit,
DepositWithMintAccount,
getRegistrarPDA,
unusedMintPk,
Voter,
-} from 'VoteStakeRegistry/sdk/accounts'
-import Select from '@components/inputs/Select'
-import { tryGetRegistrar } from 'VoteStakeRegistry/sdk/api'
-import { fmtMintAmount } from '@tools/sdk/units'
-import tokenService from '@utils/services/token'
-import { getClawbackInstruction } from 'VoteStakeRegistry/actions/getClawbackInstruction'
-import { abbreviateAddress } from '@utils/formatting'
-import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore'
+} from 'VoteStakeRegistry/sdk/accounts';
+import Select from '@components/inputs/Select';
+import { tryGetRegistrar } from 'VoteStakeRegistry/sdk/api';
+import { fmtMintAmount } from '@tools/sdk/units';
+import tokenService from '@utils/services/token';
+import { getClawbackInstruction } from 'VoteStakeRegistry/actions/getClawbackInstruction';
+import { abbreviateAddress } from '@utils/formatting';
+import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore';
const Clawback = ({
index,
governance,
}: {
- index: number
- governance: ProgramAccount | null
+ index: number;
+ governance: ProgramAccount | null;
}) => {
- const client = useVoteStakeRegistryClientStore((s) => s.state.client)
- const connection = useWalletStore((s) => s.connection)
- const { realm } = useRealm()
+ const client = useVoteStakeRegistryClientStore((s) => s.state.client);
+ const connection = useWalletStore((s) => s.connection);
+ const { realm } = useRealm();
const {
governedTokenAccountsWithoutNfts,
governancesArray,
- } = useGovernanceAssets()
- const shouldBeGoverned = index !== 0 && governance
- const [voters, setVoters] = useState([])
- const [deposits, setDeposits] = useState([])
+ } = useGovernanceAssets();
+ const shouldBeGoverned = index !== 0 && governance;
+ const [voters, setVoters] = useState([]);
+ const [deposits, setDeposits] = useState([]);
const [form, setForm] = useState({
governedTokenAccount: undefined,
voter: null,
deposit: null,
- })
+ });
const [governedAccount, setGovernedAccount] = useState<
ProgramAccount | undefined
- >(undefined)
- const [formErrors, setFormErrors] = useState({})
- const { handleSetInstructions } = useContext(NewProposalContext)
+ >(undefined);
+ const [formErrors, setFormErrors] = useState({});
+ const { handleSetInstruction } = useContext(NewProposalContext);
const handleSetForm = ({ propertyName, value }) => {
- setFormErrors({})
- setForm({ ...form, [propertyName]: value })
- }
- async function getInstruction(): Promise {
- const isValid = await validateInstruction({ schema, form, setFormErrors })
- let serializedInstruction = ''
- const prerequisiteInstructions: TransactionInstruction[] = []
+ setFormErrors({});
+ setForm({ ...form, [propertyName]: value });
+ };
+ async function getInstruction(): Promise {
+ const isValid = await validateInstruction({ schema, form, setFormErrors });
+ let serializedInstruction = '';
+ const prerequisiteInstructions: TransactionInstruction[] = [];
if (
isValid &&
form.governedTokenAccount?.token?.publicKey &&
@@ -76,8 +76,8 @@ const Clawback = ({
form.deposit
) {
const clawbackDestination =
- form.governedTokenAccount.token?.account.address
- const voterWalletAddress = form.voter.voterAuthority
+ form.governedTokenAccount.token?.account.address;
+ const voterWalletAddress = form.voter.voterAuthority;
const clawbackIx = await getClawbackInstruction({
realmPk: realm!.pubkey,
realmAuthority: realm!.account.authority!,
@@ -87,41 +87,41 @@ const Clawback = ({
grantMintPk: form.deposit.mint.publicKey,
realmCommunityMintPk: realm!.account.communityMint,
client,
- })
- serializedInstruction = serializeInstructionToBase64(clawbackIx!)
+ });
+ serializedInstruction = serializeInstructionToBase64(clawbackIx!);
}
- const obj: UiInstruction = {
+ const obj: FormInstructionData = {
serializedInstruction,
isValid,
governance: governancesArray.find(
- (x) => x.pubkey.toBase58() === realm?.account.authority?.toBase58()
+ (x) => x.pubkey.toBase58() === realm?.account.authority?.toBase58(),
),
prerequisiteInstructions: prerequisiteInstructions,
chunkSplitByDefault: true,
- }
- return obj
+ };
+ return obj;
}
useEffect(() => {
- handleSetInstructions(
+ handleSetInstruction(
{ governedAccount: governedAccount, getInstruction },
- index
- )
- }, [form])
+ index,
+ );
+ }, [form]);
useEffect(() => {
setGovernedAccount(
governancesArray.find(
- (x) => x.pubkey.toBase58() === realm?.account.authority?.toBase58()
- )
- )
- }, [form.governedTokenAccount])
+ (x) => x.pubkey.toBase58() === realm?.account.authority?.toBase58(),
+ ),
+ );
+ }, [form.governedTokenAccount]);
useEffect(() => {
const getVoters = async () => {
const { registrar } = await getRegistrarPDA(
realm!.pubkey,
realm!.account.communityMint,
- client!.program.programId
- )
+ client!.program.programId,
+ );
const resp = await client?.program.account.voter.all([
{
memcmp: {
@@ -129,38 +129,38 @@ const Clawback = ({
bytes: registrar.toString(),
},
},
- ])
+ ]);
const voters =
resp
?.filter(
(x) =>
(x.account.deposits as Deposit[]).filter(
- (depo) => depo.allowClawback
- ).length
+ (depo) => depo.allowClawback,
+ ).length,
)
- .map((x) => x.account as Voter) || []
+ .map((x) => x.account as Voter) || [];
- setVoters([...voters])
- }
+ setVoters([...voters]);
+ };
if (client) {
- getVoters()
+ getVoters();
}
- }, [client])
+ }, [client]);
useEffect(() => {
const getOwnedDepositsInfo = async () => {
const { registrar } = await getRegistrarPDA(
realm!.pubkey,
realm!.account.communityMint,
- client!.program.programId
- )
- const existingRegistrar = await tryGetRegistrar(registrar, client!)
- const mintCfgs = existingRegistrar?.votingMints
- const mints = {}
+ client!.program.programId,
+ );
+ const existingRegistrar = await tryGetRegistrar(registrar, client!);
+ const mintCfgs = existingRegistrar?.votingMints;
+ const mints = {};
if (mintCfgs) {
for (const i of mintCfgs) {
if (i.mint.toBase58() !== unusedMintPk) {
- const mint = await tryGetMint(connection.current, i.mint)
- mints[i.mint.toBase58()] = mint
+ const mint = await tryGetMint(connection.current, i.mint);
+ mints[i.mint.toBase58()] = mint;
}
}
}
@@ -171,46 +171,46 @@ const Clawback = ({
index,
mint: mints[mintCfgs![depo.votingMintConfigIdx].mint.toBase58()],
//warning no currentlyLocked, available, vestingrate props
- } as DepositWithMintAccount
- }) || []
- setDeposits(deposits)
- }
+ } as DepositWithMintAccount;
+ }) || [];
+ setDeposits(deposits);
+ };
if (form.voter) {
- getOwnedDepositsInfo()
+ getOwnedDepositsInfo();
} else {
- setDeposits([])
+ setDeposits([]);
}
- setForm({ ...form, deposit: null, governedTokenAccount: undefined })
- }, [form.voter])
+ setForm({ ...form, deposit: null, governedTokenAccount: undefined });
+ }, [form.voter]);
useEffect(() => {
- setForm({ ...form, governedTokenAccount: undefined })
- }, [form.deposit])
+ setForm({ ...form, governedTokenAccount: undefined });
+ }, [form.deposit]);
const schema = yup.object().shape({
governedTokenAccount: yup
.object()
.required('Clawback destination required'),
voter: yup.object().nullable().required('Voter required'),
deposit: yup.object().nullable().required('Deposit required'),
- })
+ });
const getOwnedDepositsLabel = (deposit: DepositWithMintAccount | null) => {
const symbol = deposit
? tokenService.getTokenInfo(deposit.mint.publicKey.toBase58())?.symbol ||
''
- : null
+ : null;
return deposit
? `${fmtMintAmount(
deposit.mint.account,
- deposit.amountDepositedNative
+ deposit.amountDepositedNative,
)} ${symbol ? symbol : abbreviateAddress(deposit.mint.publicKey)}`
- : null
- }
+ : null;
+ };
return (
<>
- x.mint?.publicKey.toBase58() ===
- form.deposit?.mint.publicKey.toBase58()
- ) as GovernedMultiTypeAccount[]
- }
+ governedAccounts={governedTokenAccountsWithoutNfts.filter(
+ (x) =>
+ x.mint?.publicKey.toBase58() ===
+ form.deposit?.mint.publicKey.toBase58(),
+ )}
onChange={(value) => {
- handleSetForm({ value, propertyName: 'governedTokenAccount' })
+ handleSetForm({ value, propertyName: 'governedTokenAccount' });
}}
value={form.governedTokenAccount}
error={formErrors['governedTokenAccount']}
- shouldBeGoverned={shouldBeGoverned}
+ shouldBeGoverned={!!shouldBeGoverned}
governance={governance}
- >
+ />
>
- )
-}
+ );
+};
-export default Clawback
+export default Clawback;
diff --git a/VoteStakeRegistry/components/instructions/Grant.tsx b/VoteStakeRegistry/components/instructions/Grant.tsx
index c6f840b053..82caa4e2bb 100644
--- a/VoteStakeRegistry/components/instructions/Grant.tsx
+++ b/VoteStakeRegistry/components/instructions/Grant.tsx
@@ -1,62 +1,61 @@
-import React, { useContext, useEffect, useState } from 'react'
-import Input from '@components/inputs/Input'
-import useRealm from '@hooks/useRealm'
-import { AccountInfo } from '@solana/spl-token'
+import React, { useContext, useEffect, useState } from 'react';
+import Input from '@components/inputs/Input';
+import useRealm from '@hooks/useRealm';
+import { AccountInfo } from '@solana/spl-token';
import {
getMintMinAmountAsDecimal,
parseMintNaturalAmountFromDecimal,
-} from '@tools/sdk/units'
-import { PublicKey, TransactionInstruction } from '@solana/web3.js'
-import { precision } from '@utils/formatting'
-import { tryParseKey } from '@tools/validators/pubkey'
-import useWalletStore from 'stores/useWalletStore'
+} from '@tools/sdk/units';
+import { PublicKey, TransactionInstruction } from '@solana/web3.js';
+import { precision } from '@utils/formatting';
+import { tryParseKey } from '@tools/validators/pubkey';
+import useWalletStore from 'stores/useWalletStore';
+import { TokenProgramAccount, tryGetTokenAccount } from '@utils/tokens';
import {
- GovernedMultiTypeAccount,
- TokenProgramAccount,
- tryGetTokenAccount,
-} from '@utils/tokens'
-import { GrantForm, UiInstruction } from '@utils/uiTypes/proposalCreationTypes'
-import { getAccountName } from '@components/instructions/tools'
-import { debounce } from '@utils/debounce'
-import { getTokenTransferSchema } from '@utils/validations'
-import useGovernanceAssets from '@hooks/useGovernanceAssets'
+ GrantForm,
+ FormInstructionData,
+} from '@utils/uiTypes/proposalCreationTypes';
+import { getAccountName } from '@components/instructions/tools';
+import { debounce } from '@utils/debounce';
+import { getTokenTransferSchema } from '@utils/validations';
+import useGovernanceAssets from '@hooks/useGovernanceAssets';
import {
Governance,
serializeInstructionToBase64,
withCreateTokenOwnerRecord,
-} from '@solana/spl-governance'
-import { ProgramAccount } from '@solana/spl-governance'
-import { validateInstruction } from '@utils/instructionTools'
-import { NewProposalContext } from 'pages/dao/[symbol]/proposal/new'
-import GovernedAccountSelect from 'pages/dao/[symbol]/proposal/components/GovernedAccountSelect'
-import { lockupTypes } from 'VoteStakeRegistry/tools/types'
-import Select from '@components/inputs/Select'
-import Switch from '@components/Switch'
-import { getFormattedStringFromDays } from 'VoteStakeRegistry/tools/dateTools'
-import * as yup from 'yup'
-import { getGrantInstruction } from 'VoteStakeRegistry/actions/getGrantInstruction'
-import { getRegistrarPDA } from 'VoteStakeRegistry/sdk/accounts'
-import { tryGetRegistrar } from 'VoteStakeRegistry/sdk/api'
-import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore'
-import dayjs from 'dayjs'
+} from '@solana/spl-governance';
+import { ProgramAccount } from '@solana/spl-governance';
+import { validateInstruction } from '@utils/instructionTools';
+import { NewProposalContext } from 'pages/dao/[symbol]/proposal/new';
+import GovernedAccountSelect from 'pages/dao/[symbol]/proposal/components/GovernedAccountSelect';
+import { lockupTypes } from 'VoteStakeRegistry/tools/types';
+import Select from '@components/inputs/Select';
+import Switch from '@components/Switch';
+import { getFormattedStringFromDays } from 'VoteStakeRegistry/tools/dateTools';
+import * as yup from 'yup';
+import { getGrantInstruction } from 'VoteStakeRegistry/actions/getGrantInstruction';
+import { getRegistrarPDA } from 'VoteStakeRegistry/sdk/accounts';
+import { tryGetRegistrar } from 'VoteStakeRegistry/sdk/api';
+import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore';
+import dayjs from 'dayjs';
const Grant = ({
index,
governance,
}: {
- index: number
- governance: ProgramAccount | null
+ index: number;
+ governance: ProgramAccount | null;
}) => {
- const client = useVoteStakeRegistryClientStore((s) => s.state.client)
- const dateNow = dayjs().unix()
- const connection = useWalletStore((s) => s.connection)
- const wallet = useWalletStore((s) => s.current)
- const { realm, tokenRecords } = useRealm()
- const { governedTokenAccountsWithoutNfts } = useGovernanceAssets()
- const shouldBeGoverned = index !== 0 && governance
- const [startDate, setStartDate] = useState(dayjs().format('DD-MM-YYYY'))
- const [endDate, setEndDate] = useState('')
- const [useableGrantMints, setUseableGrantMints] = useState([])
+ const client = useVoteStakeRegistryClientStore((s) => s.state.client);
+ const dateNow = dayjs().unix();
+ const connection = useWalletStore((s) => s.connection);
+ const wallet = useWalletStore((s) => s.current);
+ const { realm, tokenRecords } = useRealm();
+ const { governedTokenAccountsWithoutNfts } = useGovernanceAssets();
+ const shouldBeGoverned = index !== 0 && governance;
+ const [startDate, setStartDate] = useState(dayjs().format('DD-MM-YYYY'));
+ const [endDate, setEndDate] = useState('');
+ const [useableGrantMints, setUseableGrantMints] = useState([]);
const [form, setForm] = useState({
destinationAccount: '',
// No default transfer amount
@@ -67,64 +66,64 @@ const Grant = ({
periods: 0,
allowClawback: true,
lockupKind: lockupTypes[0],
- })
+ });
const [governedAccount, setGovernedAccount] = useState<
ProgramAccount | undefined
- >(undefined)
+ >(undefined);
const [
destinationAccount,
setDestinationAccount,
- ] = useState | null>(null)
- const [formErrors, setFormErrors] = useState({})
+ ] = useState | null>(null);
+ const [formErrors, setFormErrors] = useState({});
const mintMinAmount = form.mintInfo
? getMintMinAmountAsDecimal(form.mintInfo)
- : 1
- const currentPrecision = precision(mintMinAmount)
- const { handleSetInstructions } = useContext(NewProposalContext)
+ : 1;
+ const currentPrecision = precision(mintMinAmount);
+ const { handleSetInstruction } = useContext(NewProposalContext);
const handleSetForm = ({ propertyName, value }) => {
- setFormErrors({})
- setForm({ ...form, [propertyName]: value })
- }
+ setFormErrors({});
+ setForm({ ...form, [propertyName]: value });
+ };
const setMintInfo = (value) => {
- setForm({ ...form, mintInfo: value })
- }
+ setForm({ ...form, mintInfo: value });
+ };
const setAmount = (event) => {
- const value = event.target.value
+ const value = event.target.value;
handleSetForm({
value: value,
propertyName: 'amount',
- })
- }
+ });
+ };
const validateAmountOnBlur = () => {
- const value = form.amount
+ const value = form.amount;
handleSetForm({
value: parseFloat(
Math.max(
Number(mintMinAmount),
- Math.min(Number(Number.MAX_SAFE_INTEGER), Number(value))
- ).toFixed(currentPrecision)
+ Math.min(Number(Number.MAX_SAFE_INTEGER), Number(value)),
+ ).toFixed(currentPrecision),
),
propertyName: 'amount',
- })
- }
- async function getInstruction(): Promise {
- const isValid = await validateInstruction({ schema, form, setFormErrors })
- let serializedInstruction = ''
- const prerequisiteInstructions: TransactionInstruction[] = []
+ });
+ };
+ async function getInstruction(): Promise {
+ const isValid = await validateInstruction({ schema, form, setFormErrors });
+ let serializedInstruction = '';
+ const prerequisiteInstructions: TransactionInstruction[] = [];
if (
isValid &&
form.governedTokenAccount?.token?.publicKey &&
form.governedTokenAccount?.token &&
form.governedTokenAccount?.mint?.account
) {
- const sourceAccount = form.governedTokenAccount.token?.account.address
- const destinationAccount = new PublicKey(form.destinationAccount)
+ const sourceAccount = form.governedTokenAccount.token?.account.address;
+ const destinationAccount = new PublicKey(form.destinationAccount);
const mintAmount = parseMintNaturalAmountFromDecimal(
form.amount!,
- form.governedTokenAccount.mint.account.decimals
- )
- const currentTokenOwnerRecord = tokenRecords[form.destinationAccount]
+ form.governedTokenAccount.mint.account.decimals,
+ );
+ const currentTokenOwnerRecord = tokenRecords[form.destinationAccount];
if (!currentTokenOwnerRecord) {
await withCreateTokenOwnerRecord(
prerequisiteInstructions,
@@ -132,8 +131,8 @@ const Grant = ({
realm!.pubkey,
destinationAccount,
realm!.account.communityMint,
- wallet!.publicKey!
- )
+ wallet!.publicKey!,
+ );
}
const grantIx = await getGrantInstruction({
fromPk: sourceAccount,
@@ -149,32 +148,32 @@ const Grant = ({
lockupKind: form.lockupKind.value,
allowClawback: form.allowClawback,
client: client!,
- })
- serializedInstruction = serializeInstructionToBase64(grantIx!)
+ });
+ serializedInstruction = serializeInstructionToBase64(grantIx!);
}
- const obj: UiInstruction = {
+ const obj: FormInstructionData = {
serializedInstruction,
isValid,
governance: form.governedTokenAccount?.governance,
prerequisiteInstructions: prerequisiteInstructions,
chunkSplitByDefault: true,
- }
- return obj
+ };
+ return obj;
}
const handleChangeStartDate = (e) => {
- const value = e.target.value
- setStartDate(value)
- const unixDate = dayjs(value).unix()
+ const value = e.target.value;
+ setStartDate(value);
+ const unixDate = dayjs(value).unix();
handleSetForm({
value: !isNaN(unixDate) ? unixDate : 0,
propertyName: 'startDateUnixSeconds',
- })
- }
+ });
+ };
const handleChangeEndDate = (e) => {
- const value = e.target.value
- setEndDate(value)
- }
+ const value = e.target.value;
+ setEndDate(value);
+ };
useEffect(() => {
if (
startDate &&
@@ -182,45 +181,45 @@ const Grant = ({
dayjs(startDate).isValid() &&
dayjs(endDate).isValid()
) {
- const daysDifference = dayjs(endDate).diff(dayjs(startDate), 'days')
- const monthsDifference = dayjs(endDate).diff(dayjs(startDate), 'months')
+ const daysDifference = dayjs(endDate).diff(dayjs(startDate), 'days');
+ const monthsDifference = dayjs(endDate).diff(dayjs(startDate), 'months');
const periods =
- form.lockupKind.value !== 'monthly' ? daysDifference : monthsDifference
+ form.lockupKind.value !== 'monthly' ? daysDifference : monthsDifference;
handleSetForm({
value: periods > 0 ? periods : 0,
propertyName: 'periods',
- })
+ });
}
- }, [startDate, endDate, form.lockupKind.value])
+ }, [startDate, endDate, form.lockupKind.value]);
useEffect(() => {
if (form.destinationAccount) {
debounce.debounceFcn(async () => {
- const pubKey = tryParseKey(form.destinationAccount)
+ const pubKey = tryParseKey(form.destinationAccount);
if (pubKey) {
- const account = await tryGetTokenAccount(connection.current, pubKey)
- setDestinationAccount(account ? account : null)
+ const account = await tryGetTokenAccount(connection.current, pubKey);
+ setDestinationAccount(account ? account : null);
} else {
- setDestinationAccount(null)
+ setDestinationAccount(null);
}
- })
+ });
} else {
- setDestinationAccount(null)
+ setDestinationAccount(null);
}
- }, [form.destinationAccount])
+ }, [form.destinationAccount]);
useEffect(() => {
- handleSetInstructions(
+ handleSetInstruction(
{ governedAccount: governedAccount, getInstruction },
- index
- )
- }, [form])
+ index,
+ );
+ }, [form]);
useEffect(() => {
- setGovernedAccount(form.governedTokenAccount?.governance)
- setMintInfo(form.governedTokenAccount?.mint?.account)
- }, [form.governedTokenAccount])
+ setGovernedAccount(form.governedTokenAccount?.governance);
+ setMintInfo(form.governedTokenAccount?.mint?.account);
+ }, [form.governedTokenAccount]);
const destinationAccountName =
destinationAccount?.publicKey &&
- getAccountName(destinationAccount?.account.address)
+ getAccountName(destinationAccount?.account.address);
const schema = getTokenTransferSchema({ form, connection }).concat(
yup.object().shape({
startDateUnixSeconds: yup
@@ -231,33 +230,33 @@ const Grant = ({
.number()
.required('End date required')
.min(1, 'End date cannot be prior to start date'),
- })
- )
+ }),
+ );
useEffect(() => {
const getGrantMints = async () => {
- const clientProgramId = client!.program.programId
+ const clientProgramId = client!.program.programId;
const { registrar } = await getRegistrarPDA(
realm!.pubkey,
realm!.account.communityMint,
- clientProgramId
- )
- const existingRegistrar = await tryGetRegistrar(registrar, client!)
+ clientProgramId,
+ );
+ const existingRegistrar = await tryGetRegistrar(registrar, client!);
if (existingRegistrar) {
setUseableGrantMints(
- existingRegistrar.votingMints.map((x) => x.mint.toBase58())
- )
+ existingRegistrar.votingMints.map((x) => x.mint.toBase58()),
+ );
}
- }
+ };
if (client) {
- getGrantMints()
+ getGrantMints();
}
- }, [client])
+ }, [client]);
return (
<>
{form.lockupKind.info}
- x.mint && useableGrantMints.includes(x.mint.publicKey.toBase58())
- ) as GovernedMultiTypeAccount[]
- }
+ governedAccounts={governedTokenAccountsWithoutNfts.filter(
+ (x) =>
+ x.mint && useableGrantMints.includes(x.mint.publicKey.toBase58()),
+ )}
onChange={(value) => {
- handleSetForm({ value, propertyName: 'governedTokenAccount' })
+ handleSetForm({ value, propertyName: 'governedTokenAccount' });
}}
value={form.governedTokenAccount}
error={formErrors['governedTokenAccount']}
- shouldBeGoverned={shouldBeGoverned}
+ shouldBeGoverned={!!shouldBeGoverned}
governance={governance}
- >
+ />
Allow dao to clawback
@@ -326,7 +323,7 @@ const Grant = ({
handleSetForm({
value: e.target.value,
propertyName: 'periods',
- })
+ });
}}
error={formErrors['periods']}
>
@@ -381,7 +378,7 @@ const Grant = ({
Vesting rate: {(form.amount / form.periods).toFixed(2)} p/m
)}
>
- )
-}
+ );
+};
-export default Grant
+export default Grant;
diff --git a/VoteStakeRegistry/hooks/useVoteRegistry.ts b/VoteStakeRegistry/hooks/useVoteRegistry.ts
index e125ca4fb5..35c44da277 100644
--- a/VoteStakeRegistry/hooks/useVoteRegistry.ts
+++ b/VoteStakeRegistry/hooks/useVoteRegistry.ts
@@ -1,27 +1,27 @@
-import { useEffect } from 'react'
-import useWalletStore from 'stores/useWalletStore'
-import useRealm from '@hooks/useRealm'
-import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore'
+import { useEffect } from 'react';
+import useWalletStore from 'stores/useWalletStore';
+import useRealm from '@hooks/useRealm';
+import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore';
export function useVoteRegistry() {
- const { realm } = useRealm()
+ const { realm } = useRealm();
const {
handleSetRegistrar,
handleSetClient,
- } = useVoteStakeRegistryClientStore()
- const wallet = useWalletStore((s) => s.current)
- const connection = useWalletStore((s) => s.connection)
- const client = useVoteStakeRegistryClientStore((s) => s.state.client)
+ } = useVoteStakeRegistryClientStore();
+ const wallet = useWalletStore((s) => s.current);
+ const connection = useWalletStore((s) => s.connection);
+ const client = useVoteStakeRegistryClientStore((s) => s.state.client);
useEffect(() => {
if (wallet?.connected) {
- handleSetClient(wallet, connection)
+ handleSetClient(wallet, connection);
}
- }, [connection.endpoint, wallet?.connected, realm?.pubkey])
+ }, [connection.endpoint, wallet?.connected, realm?.pubkey]);
useEffect(() => {
if (realm && client) {
- handleSetRegistrar(client, realm)
+ handleSetRegistrar(client, realm);
}
- }, [realm?.pubkey, client])
+ }, [realm?.pubkey, client]);
}
diff --git a/VoteStakeRegistry/sdk/accounts.tsx b/VoteStakeRegistry/sdk/accounts.tsx
index 37f6716e11..fa74795a3c 100644
--- a/VoteStakeRegistry/sdk/accounts.tsx
+++ b/VoteStakeRegistry/sdk/accounts.tsx
@@ -1,101 +1,101 @@
-import { BN } from '@project-serum/anchor'
-import { MintInfo } from '@solana/spl-token'
-import { PublicKey } from '@solana/web3.js'
-import { TokenProgramAccount } from '@utils/tokens'
+import { BN } from '@project-serum/anchor';
+import { MintInfo } from '@solana/spl-token';
+import { PublicKey } from '@solana/web3.js';
+import { TokenProgramAccount } from '@utils/tokens';
export interface Voter {
- deposits: Deposit[]
- voterAuthority: PublicKey
- registrar: PublicKey
+ deposits: Deposit[];
+ voterAuthority: PublicKey;
+ registrar: PublicKey;
//there are more fields but no use for them on ui yet
}
export interface votingMint {
- baselineVoteWeightScaledFactor: BN
- digitShift: number
- grantAuthority: PublicKey
- lockupSaturationSecs: BN
- maxExtraLockupVoteWeightScaledFactor: BN
- mint: PublicKey
+ baselineVoteWeightScaledFactor: BN;
+ digitShift: number;
+ grantAuthority: PublicKey;
+ lockupSaturationSecs: BN;
+ maxExtraLockupVoteWeightScaledFactor: BN;
+ mint: PublicKey;
}
-export type LockupType = 'none' | 'monthly' | 'cliff' | 'constant' | 'daily' //there is also daily type but not used on ui yet
+export type LockupType = 'none' | 'monthly' | 'cliff' | 'constant' | 'daily'; //there is also daily type but not used on ui yet
export interface Registrar {
- governanceProgramId: PublicKey
- realm: PublicKey
- realmAuthority: PublicKey
- realmGoverningTokenMint: PublicKey
- votingMints: votingMint[]
+ governanceProgramId: PublicKey;
+ realm: PublicKey;
+ realmAuthority: PublicKey;
+ realmGoverningTokenMint: PublicKey;
+ votingMints: votingMint[];
//there are more fields but no use for them on ui yet
}
interface LockupKind {
- none: object
- daily: object
- monthly: object
- cliff: object
- constant: object
+ none: object;
+ daily: object;
+ monthly: object;
+ cliff: object;
+ constant: object;
}
interface Lockup {
- endTs: BN
- kind: LockupKind
- startTs: BN
+ endTs: BN;
+ kind: LockupKind;
+ startTs: BN;
}
export interface Deposit {
- allowClawback: boolean
- amountDepositedNative: BN
- amountInitiallyLockedNative: BN
- isUsed: boolean
- lockup: Lockup
- votingMintConfigIdx: number
+ allowClawback: boolean;
+ amountDepositedNative: BN;
+ amountInitiallyLockedNative: BN;
+ isUsed: boolean;
+ lockup: Lockup;
+ votingMintConfigIdx: number;
}
export interface DepositWithMintAccount extends Deposit {
- mint: TokenProgramAccount
- index: number
- available: BN
- vestingRate: BN | null
- currentlyLocked: BN
- nextVestingTimestamp: BN | null
- votingPower: BN
- votingPowerBaseline: BN
+ mint: TokenProgramAccount;
+ index: number;
+ available: BN;
+ vestingRate: BN | null;
+ currentlyLocked: BN;
+ nextVestingTimestamp: BN | null;
+ votingPower: BN;
+ votingPowerBaseline: BN;
}
-export const unusedMintPk = '11111111111111111111111111111111'
+export const unusedMintPk = '11111111111111111111111111111111';
export const getRegistrarPDA = async (
realmPk: PublicKey,
mint: PublicKey,
- clientProgramId: PublicKey
+ clientProgramId: PublicKey,
) => {
const [registrar, registrarBump] = await PublicKey.findProgramAddress(
[realmPk.toBuffer(), Buffer.from('registrar'), mint.toBuffer()],
- clientProgramId
- )
+ clientProgramId,
+ );
return {
registrar,
registrarBump,
- }
-}
+ };
+};
export const getVoterPDA = async (
registrar: PublicKey,
walletPk: PublicKey,
- clientProgramId: PublicKey
+ clientProgramId: PublicKey,
) => {
const [voter, voterBump] = await PublicKey.findProgramAddress(
[registrar.toBuffer(), Buffer.from('voter'), walletPk.toBuffer()],
- clientProgramId
- )
+ clientProgramId,
+ );
return {
voter,
voterBump,
- }
-}
+ };
+};
export const getVoterWeightPDA = async (
registrar: PublicKey,
walletPk: PublicKey,
- clientProgramId: PublicKey
+ clientProgramId: PublicKey,
) => {
const [voterWeightPk, voterWeightBump] = await PublicKey.findProgramAddress(
[
@@ -103,11 +103,11 @@ export const getVoterWeightPDA = async (
Buffer.from('voter-weight-record'),
walletPk.toBuffer(),
],
- clientProgramId
- )
+ clientProgramId,
+ );
return {
voterWeightPk,
voterWeightBump,
- }
-}
+ };
+};
diff --git a/VoteStakeRegistry/sdk/api.ts b/VoteStakeRegistry/sdk/api.ts
index 36ae0f89e4..3cab16be05 100644
--- a/VoteStakeRegistry/sdk/api.ts
+++ b/VoteStakeRegistry/sdk/api.ts
@@ -1,40 +1,40 @@
-import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client'
-import { PublicKey } from '@solana/web3.js'
-import { Registrar, Voter } from './accounts'
+import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client';
+import { PublicKey } from '@solana/web3.js';
+import { Registrar, Voter } from './accounts';
export const tryGetVoter = async (voterPk: PublicKey, client: VsrClient) => {
try {
- const voter = await client?.program.account.voter.fetch(voterPk)
- return voter as Voter
+ const voter = await client?.program.account.voter.fetch(voterPk);
+ return voter as Voter;
} catch (e) {
- return null
+ return null;
}
-}
+};
export const tryGetRegistrar = async (
registrarPk: PublicKey,
- client: VsrClient
+ client: VsrClient,
) => {
try {
const existingRegistrar = await client.program.account.registrar.fetch(
- registrarPk
- )
- return existingRegistrar as Registrar
+ registrarPk,
+ );
+ return existingRegistrar as Registrar;
} catch (e) {
- return null
+ return null;
}
-}
+};
export const getMintCfgIdx = async (
registrarPk: PublicKey,
mintPK: PublicKey,
- client: VsrClient
+ client: VsrClient,
) => {
- const existingRegistrar = await tryGetRegistrar(registrarPk, client)
+ const existingRegistrar = await tryGetRegistrar(registrarPk, client);
const mintCfgIdx = existingRegistrar?.votingMints.findIndex(
- (x) => x.mint.toBase58() === mintPK.toBase58()
- )
+ (x) => x.mint.toBase58() === mintPK.toBase58(),
+ );
if (mintCfgIdx === null || mintCfgIdx === -1) {
- throw 'mint not configured to use'
+ throw 'mint not configured to use';
}
- return mintCfgIdx
-}
+ return mintCfgIdx;
+};
diff --git a/VoteStakeRegistry/sdk/withCreateNewDeposit.ts b/VoteStakeRegistry/sdk/withCreateNewDeposit.ts
index e056cc6c86..b26388fd43 100644
--- a/VoteStakeRegistry/sdk/withCreateNewDeposit.ts
+++ b/VoteStakeRegistry/sdk/withCreateNewDeposit.ts
@@ -4,23 +4,23 @@ import {
SYSVAR_INSTRUCTIONS_PUBKEY,
SYSVAR_RENT_PUBKEY,
TransactionInstruction,
-} from '@solana/web3.js'
-import { withCreateTokenOwnerRecord } from '@solana/spl-governance'
+} from '@solana/web3.js';
+import { withCreateTokenOwnerRecord } from '@solana/spl-governance';
import {
ASSOCIATED_TOKEN_PROGRAM_ID,
Token,
TOKEN_PROGRAM_ID,
-} from '@solana/spl-token'
-import { BN } from '@project-serum/anchor'
+} from '@solana/spl-token';
+import { BN } from '@project-serum/anchor';
import {
getRegistrarPDA,
getVoterPDA,
getVoterWeightPDA,
LockupType,
-} from 'VoteStakeRegistry/sdk/accounts'
-import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client'
-import { getMintCfgIdx, tryGetVoter } from './api'
-import { getPeriod } from 'VoteStakeRegistry/tools/deposits'
+} from 'VoteStakeRegistry/sdk/accounts';
+import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client';
+import { getMintCfgIdx, tryGetVoter } from './api';
+import { getPeriod } from 'VoteStakeRegistry/tools/deposits';
export const withCreateNewDeposit = async ({
instructions,
@@ -34,47 +34,47 @@ export const withCreateNewDeposit = async ({
lockupKind,
client,
}: {
- instructions: TransactionInstruction[]
- walletPk: PublicKey
- mintPk: PublicKey
- communityMintPk: PublicKey
- realmPk: PublicKey
- programId: PublicKey
- tokenOwnerRecordPk: PublicKey | null
- lockUpPeriodInDays: number
- lockupKind: LockupType
- client?: VsrClient
+ instructions: TransactionInstruction[];
+ walletPk: PublicKey;
+ mintPk: PublicKey;
+ communityMintPk: PublicKey;
+ realmPk: PublicKey;
+ programId: PublicKey;
+ tokenOwnerRecordPk: PublicKey | null;
+ lockUpPeriodInDays: number;
+ lockupKind: LockupType;
+ client?: VsrClient;
}) => {
if (!client) {
- throw 'no vote registry plugin'
+ throw 'no vote registry plugin';
}
- const systemProgram = SystemProgram.programId
- const clientProgramId = client!.program.programId
- let tokenOwnerRecordPubKey = tokenOwnerRecordPk
+ const systemProgram = SystemProgram.programId;
+ const clientProgramId = client!.program.programId;
+ let tokenOwnerRecordPubKey = tokenOwnerRecordPk;
const { registrar } = await getRegistrarPDA(
realmPk,
communityMintPk,
- clientProgramId
- )
+ clientProgramId,
+ );
const { voter, voterBump } = await getVoterPDA(
registrar,
walletPk,
- clientProgramId
- )
+ clientProgramId,
+ );
const { voterWeightPk, voterWeightBump } = await getVoterWeightPDA(
registrar,
walletPk,
- clientProgramId
- )
- const existingVoter = await tryGetVoter(voter, client)
+ clientProgramId,
+ );
+ const existingVoter = await tryGetVoter(voter, client);
const voterATAPk = await Token.getAssociatedTokenAddress(
ASSOCIATED_TOKEN_PROGRAM_ID,
TOKEN_PROGRAM_ID,
mintPk,
- voter
- )
+ voter,
+ );
//spl governance tokenownerrecord pubkey
if (!tokenOwnerRecordPubKey) {
@@ -84,8 +84,8 @@ export const withCreateNewDeposit = async ({
realmPk,
walletPk,
mintPk,
- walletPk
- )
+ walletPk,
+ );
}
if (!existingVoter) {
instructions.push(
@@ -100,10 +100,10 @@ export const withCreateNewDeposit = async ({
rent: SYSVAR_RENT_PUBKEY,
instructions: SYSVAR_INSTRUCTIONS_PUBKEY,
},
- })
- )
+ }),
+ );
}
- const mintCfgIdx = await getMintCfgIdx(registrar, mintPk, client)
+ const mintCfgIdx = await getMintCfgIdx(registrar, mintPk, client);
//none type deposits are used only to store tokens that will be withdrawable immediately so there is no need to create new every time and there should be one per mint
//for other kinds of deposits we always want to create new deposit
@@ -113,25 +113,26 @@ export const withCreateNewDeposit = async ({
(x) =>
x.isUsed &&
typeof x.lockup.kind[lockupKind] !== 'undefined' &&
- x.votingMintConfigIdx === mintCfgIdx
+ x.votingMintConfigIdx === mintCfgIdx,
)
- : -1
+ : -1;
const createNewDeposit =
typeof indexOfNoneTypeDeposit === 'undefined' ||
- indexOfNoneTypeDeposit === -1
+ indexOfNoneTypeDeposit === -1;
- const firstFreeIdx = existingVoter?.deposits?.findIndex((x) => !x.isUsed) || 0
+ const firstFreeIdx =
+ existingVoter?.deposits?.findIndex((x) => !x.isUsed) || 0;
if (firstFreeIdx === -1 && createNewDeposit) {
- throw 'User has to much active deposits'
+ throw 'User has to much active deposits';
}
if (createNewDeposit) {
//in case we do monthly close up we pass months not days.
- const period = getPeriod(lockUpPeriodInDays, lockupKind)
- const allowClawback = false
- const startTime = new BN(new Date().getTime() / 1000)
+ const period = getPeriod(lockUpPeriodInDays, lockupKind);
+ const allowClawback = false;
+ const startTime = new BN(new Date().getTime() / 1000);
const createDepositEntryInstruction = client?.program.instruction.createDepositEntry(
firstFreeIdx,
{ [lockupKind]: {} },
@@ -151,12 +152,12 @@ export const withCreateNewDeposit = async ({
associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID,
vault: voterATAPk,
},
- }
- )
- instructions.push(createDepositEntryInstruction)
+ },
+ );
+ instructions.push(createDepositEntryInstruction);
}
- const depositIdx = !createNewDeposit ? indexOfNoneTypeDeposit! : firstFreeIdx
+ const depositIdx = !createNewDeposit ? indexOfNoneTypeDeposit! : firstFreeIdx;
return {
depositIdx,
registrar,
@@ -164,5 +165,5 @@ export const withCreateNewDeposit = async ({
voter,
tokenOwnerRecordPubKey,
voterWeightPk,
- }
-}
+ };
+};
diff --git a/VoteStakeRegistry/sdk/withUpdateVoterWeightRecord.ts b/VoteStakeRegistry/sdk/withUpdateVoterWeightRecord.ts
index e1a5e5500c..751a83d1ae 100644
--- a/VoteStakeRegistry/sdk/withUpdateVoterWeightRecord.ts
+++ b/VoteStakeRegistry/sdk/withUpdateVoterWeightRecord.ts
@@ -1,43 +1,43 @@
-import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client'
+import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client';
import {
ProgramAccount,
Realm,
SYSTEM_PROGRAM_ID,
-} from '@solana/spl-governance'
-import { PublicKey, TransactionInstruction } from '@solana/web3.js'
+} from '@solana/spl-governance';
+import { PublicKey, TransactionInstruction } from '@solana/web3.js';
import {
getRegistrarPDA,
getVoterPDA,
getVoterWeightPDA,
-} from 'VoteStakeRegistry/sdk/accounts'
+} from 'VoteStakeRegistry/sdk/accounts';
export const withUpdateVoterWeightRecord = async (
instructions: TransactionInstruction[],
walletPk: PublicKey,
realm: ProgramAccount,
- client?: VsrClient
+ client?: VsrClient,
) => {
//if no plugin then we dont do anything
if (!realm.account.config.useCommunityVoterWeightAddin) {
- return
+ return;
}
if (!client) {
- throw 'no vote registry plugin'
+ throw 'no vote registry plugin';
}
- const clientProgramId = client!.program.programId
+ const clientProgramId = client!.program.programId;
//TODO support both mints for now only community is supported
const { registrar } = await getRegistrarPDA(
realm.pubkey,
realm.account.communityMint,
- client!.program.programId
- )
- const { voter } = await getVoterPDA(registrar, walletPk, clientProgramId)
+ client!.program.programId,
+ );
+ const { voter } = await getVoterPDA(registrar, walletPk, clientProgramId);
const { voterWeightPk } = await getVoterWeightPDA(
registrar,
walletPk,
- clientProgramId
- )
+ clientProgramId,
+ );
instructions.push(
client.program.instruction.updateVoterWeightRecord({
@@ -47,7 +47,7 @@ export const withUpdateVoterWeightRecord = async (
voterWeightRecord: voterWeightPk,
systemProgram: SYSTEM_PROGRAM_ID,
},
- })
- )
- return voterWeightPk
-}
+ }),
+ );
+ return voterWeightPk;
+};
diff --git a/VoteStakeRegistry/sdk/withVoteRegistryDeposit.ts b/VoteStakeRegistry/sdk/withVoteRegistryDeposit.ts
index ee06657f50..7c75db6b8f 100644
--- a/VoteStakeRegistry/sdk/withVoteRegistryDeposit.ts
+++ b/VoteStakeRegistry/sdk/withVoteRegistryDeposit.ts
@@ -1,9 +1,9 @@
-import { PublicKey, TransactionInstruction } from '@solana/web3.js'
-import { TOKEN_PROGRAM_ID } from '@solana/spl-token'
-import { BN } from '@project-serum/anchor'
-import { LockupType } from 'VoteStakeRegistry/sdk/accounts'
-import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client'
-import { withCreateNewDeposit } from './withCreateNewDeposit'
+import { PublicKey, TransactionInstruction } from '@solana/web3.js';
+import { TOKEN_PROGRAM_ID } from '@solana/spl-token';
+import { BN } from '@project-serum/anchor';
+import { LockupType } from 'VoteStakeRegistry/sdk/accounts';
+import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client';
+import { withCreateNewDeposit } from './withCreateNewDeposit';
export const withVoteRegistryDeposit = async ({
instructions,
@@ -19,22 +19,22 @@ export const withVoteRegistryDeposit = async ({
communityMintPk,
client,
}: {
- instructions: TransactionInstruction[]
- walletPk: PublicKey
+ instructions: TransactionInstruction[];
+ walletPk: PublicKey;
//from where we deposit our founds
- fromPk: PublicKey
- mintPk: PublicKey
- realmPk: PublicKey
- programId: PublicKey
- amount: BN
- communityMintPk: PublicKey
- tokenOwnerRecordPk: PublicKey | null
- lockUpPeriodInDays: number
- lockupKind: LockupType
- client?: VsrClient
+ fromPk: PublicKey;
+ mintPk: PublicKey;
+ realmPk: PublicKey;
+ programId: PublicKey;
+ amount: BN;
+ communityMintPk: PublicKey;
+ tokenOwnerRecordPk: PublicKey | null;
+ lockUpPeriodInDays: number;
+ lockupKind: LockupType;
+ client?: VsrClient;
}) => {
if (!client) {
- throw 'no vote registry plugin'
+ throw 'no vote registry plugin';
}
const {
@@ -53,7 +53,7 @@ export const withVoteRegistryDeposit = async ({
lockupKind,
communityMintPk,
client,
- })
+ });
const depositInstruction = client?.program.instruction.deposit(
depositIdx,
amount,
@@ -66,7 +66,7 @@ export const withVoteRegistryDeposit = async ({
depositAuthority: walletPk,
tokenProgram: TOKEN_PROGRAM_ID,
},
- }
- )
- instructions.push(depositInstruction)
-}
+ },
+ );
+ instructions.push(depositInstruction);
+};
diff --git a/VoteStakeRegistry/sdk/withVoteRegistryWithdraw.ts b/VoteStakeRegistry/sdk/withVoteRegistryWithdraw.ts
index a79f8656ac..ac3a4bce65 100644
--- a/VoteStakeRegistry/sdk/withVoteRegistryWithdraw.ts
+++ b/VoteStakeRegistry/sdk/withVoteRegistryWithdraw.ts
@@ -1,17 +1,17 @@
-import { Connection, PublicKey, TransactionInstruction } from '@solana/web3.js'
+import { Connection, PublicKey, TransactionInstruction } from '@solana/web3.js';
import {
ASSOCIATED_TOKEN_PROGRAM_ID,
Token,
TOKEN_PROGRAM_ID,
-} from '@solana/spl-token'
-import { BN } from '@project-serum/anchor'
+} from '@solana/spl-token';
+import { BN } from '@project-serum/anchor';
import {
getRegistrarPDA,
getVoterPDA,
getVoterWeightPDA,
-} from 'VoteStakeRegistry/sdk/accounts'
-import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client'
-import { tryGetTokenAccount } from '@utils/tokens'
+} from 'VoteStakeRegistry/sdk/accounts';
+import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client';
+import { tryGetTokenAccount } from '@utils/tokens';
export const withVoteRegistryWithdraw = async ({
instructions,
@@ -26,50 +26,50 @@ export const withVoteRegistryWithdraw = async ({
client,
connection,
}: {
- instructions: TransactionInstruction[]
- walletPk: PublicKey
- mintPk: PublicKey
- realmPk: PublicKey
- communityMintPk: PublicKey
- amount: BN
- tokenOwnerRecordPubKey: PublicKey
- depositIndex: number
- connection: Connection
+ instructions: TransactionInstruction[];
+ walletPk: PublicKey;
+ mintPk: PublicKey;
+ realmPk: PublicKey;
+ communityMintPk: PublicKey;
+ amount: BN;
+ tokenOwnerRecordPubKey: PublicKey;
+ depositIndex: number;
+ connection: Connection;
//if we want to close deposit after doing operation we need to fill this because we can close only deposits that have 0 tokens inside
- closeDepositAfterOperation?: boolean
- client?: VsrClient
+ closeDepositAfterOperation?: boolean;
+ client?: VsrClient;
}) => {
if (!client) {
- throw 'no vote registry plugin'
+ throw 'no vote registry plugin';
}
- const clientProgramId = client!.program.programId
+ const clientProgramId = client!.program.programId;
const { registrar } = await getRegistrarPDA(
realmPk,
communityMintPk,
- client!.program.programId
- )
- const { voter } = await getVoterPDA(registrar, walletPk, clientProgramId)
+ client!.program.programId,
+ );
+ const { voter } = await getVoterPDA(registrar, walletPk, clientProgramId);
const { voterWeightPk } = await getVoterWeightPDA(
registrar,
walletPk,
- clientProgramId
- )
+ clientProgramId,
+ );
const voterATAPk = await Token.getAssociatedTokenAddress(
ASSOCIATED_TOKEN_PROGRAM_ID,
TOKEN_PROGRAM_ID,
mintPk,
- voter
- )
+ voter,
+ );
const ataPk = await Token.getAssociatedTokenAddress(
ASSOCIATED_TOKEN_PROGRAM_ID, // always ASSOCIATED_TOKEN_PROGRAM_ID
TOKEN_PROGRAM_ID, // always TOKEN_PROGRAM_ID
mintPk, // mint
- walletPk // owner
- )
- const isExistingAta = await tryGetTokenAccount(connection, ataPk)
+ walletPk, // owner
+ );
+ const isExistingAta = await tryGetTokenAccount(connection, ataPk);
if (!isExistingAta) {
instructions.push(
Token.createAssociatedTokenAccountInstruction(
@@ -78,9 +78,9 @@ export const withVoteRegistryWithdraw = async ({
mintPk, // mint
ataPk, // ata
walletPk, // owner of token account
- walletPk // fee payer
- )
- )
+ walletPk, // fee payer
+ ),
+ );
}
instructions.push(
@@ -95,8 +95,8 @@ export const withVoteRegistryWithdraw = async ({
destination: ataPk,
tokenProgram: TOKEN_PROGRAM_ID,
},
- })
- )
+ }),
+ );
if (closeDepositAfterOperation) {
const close = client.program.instruction.closeDepositEntry(depositIndex, {
@@ -104,7 +104,7 @@ export const withVoteRegistryWithdraw = async ({
voter: voter,
voterAuthority: walletPk,
},
- })
- instructions.push(close)
+ });
+ instructions.push(close);
}
-}
+};
diff --git a/VoteStakeRegistry/stores/useDepositStore.tsx b/VoteStakeRegistry/stores/useDepositStore.tsx
index 35182b2697..c2957846cb 100644
--- a/VoteStakeRegistry/stores/useDepositStore.tsx
+++ b/VoteStakeRegistry/stores/useDepositStore.tsx
@@ -1,17 +1,18 @@
-import create, { State } from 'zustand'
-import { DepositWithMintAccount } from 'VoteStakeRegistry/sdk/accounts'
-import { Connection, PublicKey } from '@solana/web3.js'
-import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client'
-import { BN } from '@blockworks-foundation/voter-stake-registry-client/node_modules/@project-serum/anchor'
-import { getDeposits } from 'VoteStakeRegistry/tools/deposits'
+import create, { State } from 'zustand';
+import { DepositWithMintAccount } from 'VoteStakeRegistry/sdk/accounts';
+import { Connection, PublicKey } from '@solana/web3.js';
+import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client';
+import { BN } from '@blockworks-foundation/voter-stake-registry-client/node_modules/@project-serum/anchor';
+import { getDeposits } from 'VoteStakeRegistry/tools/deposits';
+import { BN_ZERO } from '@utils/helpers';
interface DepositStore extends State {
state: {
- deposits: DepositWithMintAccount[]
- votingPower: BN
- votingPowerFromDeposits: BN
- }
- resetDepositState: () => void
+ deposits: DepositWithMintAccount[];
+ votingPower: BN;
+ votingPowerFromDeposits: BN;
+ };
+ resetDepositState: () => void;
getOwnedDeposits: ({
isUsed,
realmPk,
@@ -20,20 +21,20 @@ interface DepositStore extends State {
client,
connection,
}: {
- isUsed?: boolean | undefined
- realmPk: PublicKey
- walletPk: PublicKey
- communityMintPk: PublicKey
- client: VsrClient
- connection: Connection
- }) => Promise
+ isUsed?: boolean | undefined;
+ realmPk: PublicKey;
+ walletPk: PublicKey;
+ communityMintPk: PublicKey;
+ client: VsrClient;
+ connection: Connection;
+ }) => Promise;
}
const defaultState = {
deposits: [],
- votingPower: new BN(0),
- votingPowerFromDeposits: new BN(0),
-}
+ votingPower: BN_ZERO,
+ votingPowerFromDeposits: BN_ZERO,
+};
const useDepositStore = create((set, _get) => ({
state: {
@@ -41,8 +42,8 @@ const useDepositStore = create((set, _get) => ({
},
resetDepositState: () => {
set((s) => {
- s.state = { ...defaultState }
- })
+ s.state = { ...defaultState };
+ });
},
getOwnedDeposits: async ({
isUsed = true,
@@ -63,14 +64,14 @@ const useDepositStore = create((set, _get) => ({
communityMintPk,
client,
connection,
- })
+ });
set((s) => {
- s.state.votingPower = votingPower
- s.state.deposits = deposits
- s.state.votingPowerFromDeposits = votingPowerFromDeposits
- })
+ s.state.votingPower = votingPower;
+ s.state.deposits = deposits;
+ s.state.votingPowerFromDeposits = votingPowerFromDeposits;
+ });
},
-}))
+}));
-export default useDepositStore
+export default useDepositStore;
diff --git a/VoteStakeRegistry/stores/voteStakeRegistryClientStore.tsx b/VoteStakeRegistry/stores/voteStakeRegistryClientStore.tsx
index 2aa2795c5a..5725afa1c6 100644
--- a/VoteStakeRegistry/stores/voteStakeRegistryClientStore.tsx
+++ b/VoteStakeRegistry/stores/voteStakeRegistryClientStore.tsx
@@ -1,32 +1,32 @@
-import create, { State } from 'zustand'
-import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client'
-import { getRegistrarPDA, Registrar } from 'VoteStakeRegistry/sdk/accounts'
-import { Provider } from '@project-serum/anchor'
-import { Wallet } from '@project-serum/sol-wallet-adapter'
-import { tryGetRegistrar } from 'VoteStakeRegistry/sdk/api'
-import { SignerWalletAdapter } from '@solana/wallet-adapter-base'
-import { ConnectionContext } from '@utils/connection'
-import { ProgramAccount, Realm } from '@solana/spl-governance'
+import create, { State } from 'zustand';
+import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client';
+import { getRegistrarPDA, Registrar } from 'VoteStakeRegistry/sdk/accounts';
+import { Provider } from '@project-serum/anchor';
+import { Wallet } from '@project-serum/sol-wallet-adapter';
+import { tryGetRegistrar } from 'VoteStakeRegistry/sdk/api';
+import { SignerWalletAdapter } from '@solana/wallet-adapter-base';
+import { ConnectionContext } from '@utils/connection';
+import { ProgramAccount, Realm } from '@solana/spl-governance';
interface useVoteStakeRegistryClientStore extends State {
state: {
- client: VsrClient | undefined
- communityMintRegistrar: Registrar | null
- }
+ client: VsrClient | undefined;
+ communityMintRegistrar: Registrar | null;
+ };
handleSetClient: (
wallet: SignerWalletAdapter | undefined,
- connection: ConnectionContext
- ) => void
+ connection: ConnectionContext,
+ ) => void;
handleSetRegistrar: (
client: VsrClient,
- realm: ProgramAccount | undefined
- ) => void
+ realm: ProgramAccount | undefined,
+ ) => void;
}
const defaultState = {
client: undefined,
communityMintRegistrar: null,
-}
+};
const useVoteStakeRegistryClientStore = create(
(set, _get) => ({
@@ -34,33 +34,33 @@ const useVoteStakeRegistryClientStore = create(
...defaultState,
},
handleSetClient: async (wallet, connection) => {
- const options = Provider.defaultOptions()
+ const options = Provider.defaultOptions();
const provider = new Provider(
connection.current,
(wallet as unknown) as Wallet,
- options
- )
+ options,
+ );
const vsrClient = await VsrClient.connect(
provider,
- connection.cluster === 'devnet'
- )
+ connection.cluster === 'devnet',
+ );
set((s) => {
- s.state.client = vsrClient
- })
+ s.state.client = vsrClient;
+ });
},
handleSetRegistrar: async (client, realm) => {
- const clientProgramId = client!.program.programId
+ const clientProgramId = client!.program.programId;
const { registrar } = await getRegistrarPDA(
realm!.pubkey,
realm!.account.communityMint,
- clientProgramId
- )
- const existingRegistrar = await tryGetRegistrar(registrar, client!)
+ clientProgramId,
+ );
+ const existingRegistrar = await tryGetRegistrar(registrar, client!);
set((s) => {
- s.state.communityMintRegistrar = existingRegistrar
- })
+ s.state.communityMintRegistrar = existingRegistrar;
+ });
},
- })
-)
+ }),
+);
-export default useVoteStakeRegistryClientStore
+export default useVoteStakeRegistryClientStore;
diff --git a/VoteStakeRegistry/tools/dateTools.ts b/VoteStakeRegistry/tools/dateTools.ts
index f20e6b1777..c1c61d5d9e 100644
--- a/VoteStakeRegistry/tools/dateTools.ts
+++ b/VoteStakeRegistry/tools/dateTools.ts
@@ -1,70 +1,70 @@
-import { BN } from '@project-serum/anchor'
-import { DepositWithMintAccount } from 'VoteStakeRegistry/sdk/accounts'
+import { BN } from '@project-serum/anchor';
+import { DepositWithMintAccount } from 'VoteStakeRegistry/sdk/accounts';
-export const DAYS_PER_YEAR = 365
-export const SECS_PER_DAY = 86400
-export const DAYS_PER_MONTH = DAYS_PER_YEAR / 12
-export const SECS_PER_MONTH = DAYS_PER_MONTH * SECS_PER_DAY
-export const HOURS_PER_DAY = 24
-export const MINS_PER_HOUR = 60
+export const DAYS_PER_YEAR = 365;
+export const SECS_PER_DAY = 86400;
+export const DAYS_PER_MONTH = DAYS_PER_YEAR / 12;
+export const SECS_PER_MONTH = DAYS_PER_MONTH * SECS_PER_DAY;
+export const HOURS_PER_DAY = 24;
+export const MINS_PER_HOUR = 60;
export function getFormattedStringFromDays(
numberOfDays: number,
- fullFormat = false
+ fullFormat = false,
) {
- const years = Math.floor(numberOfDays / DAYS_PER_YEAR)
- const months = Math.floor((numberOfDays % DAYS_PER_YEAR) / DAYS_PER_MONTH)
- const days = Math.floor((numberOfDays % DAYS_PER_YEAR) % DAYS_PER_MONTH)
- const hours = (numberOfDays - Math.floor(numberOfDays)) * HOURS_PER_DAY
- const hoursInt = Math.floor(hours)
- const minutes = Math.floor((hours - hoursInt) * MINS_PER_HOUR)
- const yearSuffix = years > 1 ? 'years' : 'year'
- const monthSuffix = months > 1 ? 'months' : 'month'
- const daysSuffix = days > 1 ? 'days' : 'day'
+ const years = Math.floor(numberOfDays / DAYS_PER_YEAR);
+ const months = Math.floor((numberOfDays % DAYS_PER_YEAR) / DAYS_PER_MONTH);
+ const days = Math.floor((numberOfDays % DAYS_PER_YEAR) % DAYS_PER_MONTH);
+ const hours = (numberOfDays - Math.floor(numberOfDays)) * HOURS_PER_DAY;
+ const hoursInt = Math.floor(hours);
+ const minutes = Math.floor((hours - hoursInt) * MINS_PER_HOUR);
+ const yearSuffix = years > 1 ? 'years' : 'year';
+ const monthSuffix = months > 1 ? 'months' : 'month';
+ const daysSuffix = days > 1 ? 'days' : 'day';
const yearsDisplay =
- years > 0 ? years + ` ${fullFormat ? yearSuffix : 'y'} ` : ''
+ years > 0 ? years + ` ${fullFormat ? yearSuffix : 'y'} ` : '';
const monthsDisplay =
- months > 0 ? months + ` ${fullFormat ? monthSuffix : 'm'} ` : ''
+ months > 0 ? months + ` ${fullFormat ? monthSuffix : 'm'} ` : '';
const daysDisplay =
- days > 0 ? days + ` ${fullFormat ? daysSuffix : 'd'} ` : ''
- const hoursDisplay = hours > 0 ? ` ${hoursInt} h ${minutes} min` : ''
+ days > 0 ? days + ` ${fullFormat ? daysSuffix : 'd'} ` : '';
+ const hoursDisplay = hours > 0 ? ` ${hoursInt} h ${minutes} min` : '';
const text =
!years && !months && days <= 1
? daysDisplay + hoursDisplay
- : yearsDisplay + monthsDisplay + daysDisplay
- return text ? text : 0
+ : yearsDisplay + monthsDisplay + daysDisplay;
+ return text ? text : 0;
}
export const yearsToDays = (years: number) => {
- return DAYS_PER_YEAR * years
-}
+ return DAYS_PER_YEAR * years;
+};
export const daysToYear = (days: number) => {
- return days / DAYS_PER_YEAR
-}
+ return days / DAYS_PER_YEAR;
+};
export const yearsToSecs = (years: number) => {
- return DAYS_PER_YEAR * years * SECS_PER_DAY
-}
+ return DAYS_PER_YEAR * years * SECS_PER_DAY;
+};
export const secsToDays = (secs: number) => {
- return secs / SECS_PER_DAY
-}
+ return secs / SECS_PER_DAY;
+};
export const daysToMonths = (days: number) => {
- return days / DAYS_PER_MONTH
-}
+ return days / DAYS_PER_MONTH;
+};
export const getMinDurationFmt = (deposit: DepositWithMintAccount) => {
- return getFormattedStringFromDays(getMinDurationInDays(deposit))
-}
+ return getFormattedStringFromDays(getMinDurationInDays(deposit));
+};
export const getTimeLeftFromNowFmt = (deposit: DepositWithMintAccount) => {
- const dateNowSecTimeStampBN = new BN(new Date().getTime() / 1000)
+ const dateNowSecTimeStampBN = new BN(new Date().getTime() / 1000);
return getFormattedStringFromDays(
- deposit.lockup.endTs.sub(dateNowSecTimeStampBN).toNumber() / SECS_PER_DAY
- )
-}
+ deposit.lockup.endTs.sub(dateNowSecTimeStampBN).toNumber() / SECS_PER_DAY,
+ );
+};
export const getMinDurationInDays = (deposit: DepositWithMintAccount) => {
return (
deposit.lockup.endTs.sub(deposit.lockup.startTs).toNumber() / SECS_PER_DAY
- )
-}
+ );
+};
diff --git a/VoteStakeRegistry/tools/deposits.ts b/VoteStakeRegistry/tools/deposits.ts
index db3e1a5594..6794c082b3 100644
--- a/VoteStakeRegistry/tools/deposits.ts
+++ b/VoteStakeRegistry/tools/deposits.ts
@@ -1,15 +1,13 @@
-import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client'
-import {
- BN,
- EventParser,
-} from '@blockworks-foundation/voter-stake-registry-client/node_modules/@project-serum/anchor'
+import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client';
+import { EventParser } from '@blockworks-foundation/voter-stake-registry-client/node_modules/@project-serum/anchor';
import {
ProgramAccount,
Realm,
simulateTransaction,
-} from '@solana/spl-governance'
-import { PublicKey, Transaction, Connection } from '@solana/web3.js'
-import { tryGetMint } from '@utils/tokens'
+} from '@solana/spl-governance';
+import { PublicKey, Transaction, Connection } from '@solana/web3.js';
+import { BN_ZERO } from '@utils/helpers';
+import { tryGetMint } from '@utils/tokens';
import {
getRegistrarPDA,
getVoterPDA,
@@ -17,10 +15,10 @@ import {
DepositWithMintAccount,
LockupType,
Registrar,
-} from 'VoteStakeRegistry/sdk/accounts'
-import { tryGetVoter, tryGetRegistrar } from 'VoteStakeRegistry/sdk/api'
-import { DAYS_PER_MONTH } from './dateTools'
-import { MONTHLY } from './types'
+} from 'VoteStakeRegistry/sdk/accounts';
+import { tryGetVoter, tryGetRegistrar } from 'VoteStakeRegistry/sdk/api';
+import { DAYS_PER_MONTH } from './dateTools';
+import { MONTHLY } from './types';
export const getDeposits = async ({
isUsed = true,
@@ -30,31 +28,31 @@ export const getDeposits = async ({
client,
connection,
}: {
- isUsed?: boolean | undefined
- realmPk: PublicKey
- walletPk: PublicKey
- communityMintPk: PublicKey
- client: VsrClient
- connection: Connection
+ isUsed?: boolean | undefined;
+ realmPk: PublicKey;
+ walletPk: PublicKey;
+ communityMintPk: PublicKey;
+ client: VsrClient;
+ connection: Connection;
}) => {
- const clientProgramId = client.program.programId
+ const clientProgramId = client.program.programId;
const { registrar } = await getRegistrarPDA(
realmPk,
communityMintPk,
- clientProgramId
- )
- const { voter } = await getVoterPDA(registrar, walletPk, clientProgramId)
- const existingVoter = await tryGetVoter(voter, client)
- const existingRegistrar = await tryGetRegistrar(registrar, client)
- const mintCfgs = existingRegistrar?.votingMints || []
- const mints = {}
- let votingPower = new BN(0)
- let votingPowerFromDeposits = new BN(0)
- let deposits: DepositWithMintAccount[] = []
+ clientProgramId,
+ );
+ const { voter } = await getVoterPDA(registrar, walletPk, clientProgramId);
+ const existingVoter = await tryGetVoter(voter, client);
+ const existingRegistrar = await tryGetRegistrar(registrar, client);
+ const mintCfgs = existingRegistrar?.votingMints || [];
+ const mints = {};
+ let votingPower = BN_ZERO;
+ let votingPowerFromDeposits = BN_ZERO;
+ let deposits: DepositWithMintAccount[] = [];
for (const i of mintCfgs) {
if (i.mint.toBase58() !== unusedMintPk) {
- const mint = await tryGetMint(connection, i.mint)
- mints[i.mint.toBase58()] = mint
+ const mint = await tryGetMint(connection, i.mint);
+ mints[i.mint.toBase58()] = mint;
}
}
if (existingVoter) {
@@ -65,11 +63,11 @@ export const getDeposits = async ({
...x,
mint: mints[mintCfgs![x.votingMintConfigIdx].mint.toBase58()],
index: idx,
- } as DepositWithMintAccount)
+ } as DepositWithMintAccount),
)
- .filter((x) => typeof isUsed === 'undefined' || x.isUsed === isUsed)
- const usedDeposits = deposits.filter((x) => x.isUsed)
- const areThereAnyUsedDeposits = usedDeposits.length
+ .filter((x) => typeof isUsed === 'undefined' || x.isUsed === isUsed);
+ const usedDeposits = deposits.filter((x) => x.isUsed);
+ const areThereAnyUsedDeposits = usedDeposits.length;
if (areThereAnyUsedDeposits) {
const events = await getDepositsAdditionalInfoEvents(
@@ -77,43 +75,43 @@ export const getDeposits = async ({
usedDeposits,
connection,
registrar,
- voter
- )
- const DEPOSIT_EVENT_NAME = 'DepositEntryInfo'
- const VOTER_INFO_EVENT_NAME = 'VoterInfo'
- const depositsInfo = events.filter((x) => x.name === DEPOSIT_EVENT_NAME)
+ voter,
+ );
+ const DEPOSIT_EVENT_NAME = 'DepositEntryInfo';
+ const VOTER_INFO_EVENT_NAME = 'VoterInfo';
+ const depositsInfo = events.filter((x) => x.name === DEPOSIT_EVENT_NAME);
const votingPowerEntry = events.find(
- (x) => x.name === VOTER_INFO_EVENT_NAME
- )
+ (x) => x.name === VOTER_INFO_EVENT_NAME,
+ );
deposits = deposits.map((x) => {
const additionalInfoData = depositsInfo.find(
- (info) => info.data.depositEntryIndex === x.index
- ).data
+ (info) => info.data.depositEntryIndex === x.index,
+ ).data;
- x.currentlyLocked = additionalInfoData.locking?.amount || new BN(0)
- x.available = additionalInfoData.unlocked || new BN(0)
- x.vestingRate = additionalInfoData.locking?.vesting?.rate || new BN(0)
+ x.currentlyLocked = additionalInfoData.locking?.amount || BN_ZERO;
+ x.available = additionalInfoData.unlocked || BN_ZERO;
+ x.vestingRate = additionalInfoData.locking?.vesting?.rate || BN_ZERO;
x.nextVestingTimestamp =
- additionalInfoData.locking?.vesting?.nextTimestamp || null
- x.votingPower = additionalInfoData.votingPower || new BN(0)
+ additionalInfoData.locking?.vesting?.nextTimestamp || null;
+ x.votingPower = additionalInfoData.votingPower || BN_ZERO;
x.votingPowerBaseline =
- additionalInfoData.votingPowerBaseline || new BN(0)
- return x
- })
+ additionalInfoData.votingPowerBaseline || BN_ZERO;
+ return x;
+ });
if (
votingPowerEntry &&
!votingPowerEntry.data.votingPowerBaseline.isZero()
) {
- votingPowerFromDeposits = votingPowerEntry.data.votingPowerBaseline
+ votingPowerFromDeposits = votingPowerEntry.data.votingPowerBaseline;
}
if (votingPowerEntry && !votingPowerEntry.data.votingPower.isZero()) {
- votingPower = votingPowerEntry.data.votingPower
+ votingPower = votingPowerEntry.data.votingPower;
}
- return { votingPower, deposits, votingPowerFromDeposits }
+ return { votingPower, deposits, votingPowerFromDeposits };
}
}
- return { votingPower, deposits, votingPowerFromDeposits }
-}
+ return { votingPower, deposits, votingPowerFromDeposits };
+};
export const calcMultiplier = ({
depositScaledFactor,
@@ -121,110 +119,115 @@ export const calcMultiplier = ({
lockupSecs,
lockupSaturationSecs,
}: {
- depositScaledFactor: number
- maxExtraLockupVoteWeightScaledFactor: number
- lockupSecs: number
- lockupSaturationSecs: number
+ depositScaledFactor: number;
+ maxExtraLockupVoteWeightScaledFactor: number;
+ lockupSecs: number;
+ lockupSaturationSecs: number;
}) => {
const calc =
(depositScaledFactor +
(maxExtraLockupVoteWeightScaledFactor *
Math.min(lockupSecs, lockupSaturationSecs)) /
lockupSaturationSecs) /
- depositScaledFactor
- return depositScaledFactor !== 0 ? calc : 0
-}
+ depositScaledFactor;
+ return depositScaledFactor !== 0 ? calc : 0;
+};
export const getPeriod = (
lockUpPeriodInDays: number,
- lockupKind: LockupType
+ lockupKind: LockupType,
) => {
//in case we do monthly close up we pass months not days.
const period =
lockupKind !== MONTHLY
? lockUpPeriodInDays
- : lockUpPeriodInDays / DAYS_PER_MONTH
- const maxMonthsNumber = 72
- const daysLimit = 2190
+ : lockUpPeriodInDays / DAYS_PER_MONTH;
+ const maxMonthsNumber = 72;
+ const daysLimit = 2190;
//additional prevention of lockup being to high in case of monthly lockup 72 months as 6 years
//in case of other types 2190 days as 6 years
if (lockupKind === MONTHLY && period > maxMonthsNumber) {
- throw 'lockup period is to hight'
+ throw 'lockup period is to hight';
}
if (lockupKind !== MONTHLY && period > daysLimit) {
- throw 'lockup period is to hight'
+ throw 'lockup period is to hight';
}
- return period
-}
+ return period;
+};
export const calcMintMultiplier = (
lockupSecs: number,
registrar: Registrar | null,
- realm: ProgramAccount | undefined
+ realm: ProgramAccount | undefined,
) => {
- const mintCfgs = registrar?.votingMints
+ const mintCfgs = registrar?.votingMints;
const mintCfg = mintCfgs?.find(
- (x) => x.mint.toBase58() === realm?.account.communityMint.toBase58()
- )
+ (x) => x.mint.toBase58() === realm?.account.communityMint.toBase58(),
+ );
if (mintCfg) {
const {
lockupSaturationSecs,
baselineVoteWeightScaledFactor,
maxExtraLockupVoteWeightScaledFactor,
- } = mintCfg
- const depositScaledFactorNum = baselineVoteWeightScaledFactor.toNumber()
- const maxExtraLockupVoteWeightScaledFactorNum = maxExtraLockupVoteWeightScaledFactor.toNumber()
- const lockupSaturationSecsNum = lockupSaturationSecs.toNumber()
+ } = mintCfg;
+ const depositScaledFactorNum = baselineVoteWeightScaledFactor.toNumber();
+ const maxExtraLockupVoteWeightScaledFactorNum = maxExtraLockupVoteWeightScaledFactor.toNumber();
+ const lockupSaturationSecsNum = lockupSaturationSecs.toNumber();
//(deposit_scaled_factor + max_extra_lockup_vote_weight_scaled_factor * min(lockup_secs, lockup_saturation_secs) / lockup_saturation_secs) / deposit_scaled_factor
const calced = calcMultiplier({
depositScaledFactor: depositScaledFactorNum,
maxExtraLockupVoteWeightScaledFactor: maxExtraLockupVoteWeightScaledFactorNum,
lockupSaturationSecs: lockupSaturationSecsNum,
lockupSecs,
- })
+ });
- return parseFloat(calced.toFixed(2))
+ return parseFloat(calced.toFixed(2));
}
- return 0
-}
+ return 0;
+};
const getDepositsAdditionalInfoEvents = async (
client: VsrClient,
usedDeposits: DepositWithMintAccount[],
connection: Connection,
registrar: PublicKey,
- voter: PublicKey
+ voter: PublicKey,
) => {
// The wallet can be any existing account for the simulation
// Note: when running a local validator ensure the account is copied from devnet: --clone ENmcpFCpxN1CqyUjuog9yyUVfdXBKF3LVCwLr7grJZpk -ud
- const walletPk = new PublicKey('ENmcpFCpxN1CqyUjuog9yyUVfdXBKF3LVCwLr7grJZpk')
+ const walletPk = new PublicKey(
+ 'ENmcpFCpxN1CqyUjuog9yyUVfdXBKF3LVCwLr7grJZpk',
+ );
//because we switch wallet in here we can't use rpc from npm module
//anchor dont allow to switch wallets inside existing client
//parse events response as anchor do
- const events: any[] = []
- const parser = new EventParser(client.program.programId, client.program.coder)
- const maxRange = 8
- const itemsCount = usedDeposits.length
- const numberOfSimulations = Math.ceil(itemsCount / maxRange)
+ const events: any[] = [];
+ const parser = new EventParser(
+ client.program.programId,
+ client.program.coder,
+ );
+ const maxRange = 8;
+ const itemsCount = usedDeposits.length;
+ const numberOfSimulations = Math.ceil(itemsCount / maxRange);
for (let i = 0; i < numberOfSimulations; i++) {
- const take = maxRange
- const transaction = new Transaction({ feePayer: walletPk })
+ const take = maxRange;
+ const transaction = new Transaction({ feePayer: walletPk });
transaction.add(
client.program.instruction.logVoterInfo(maxRange * i, take, {
accounts: {
registrar,
voter,
},
- })
- )
+ }),
+ );
const batchOfDeposits = await simulateTransaction(
connection,
transaction,
- 'recent'
- )
+ 'recent',
+ );
parser.parseLogs(batchOfDeposits.value.logs!, (event) => {
- events.push(event)
- })
+ events.push(event);
+ });
}
- return events
-}
+ return events;
+};
diff --git a/VoteStakeRegistry/tools/types.ts b/VoteStakeRegistry/tools/types.ts
index 464bf9529b..4a4fb15d68 100644
--- a/VoteStakeRegistry/tools/types.ts
+++ b/VoteStakeRegistry/tools/types.ts
@@ -1,21 +1,21 @@
-import { LockupType } from 'VoteStakeRegistry/sdk/accounts'
+import { LockupType } from 'VoteStakeRegistry/sdk/accounts';
export interface Period {
- defaultValue: number
- display: string
+ defaultValue: number;
+ display: string;
}
export interface LockupKind {
- value: LockupType
- info: string[]
- displayName: string
+ value: LockupType;
+ info: string[];
+ displayName: string;
}
export interface VestingPeriod {
- value: number
- display: string
- info: string
+ value: number;
+ display: string;
+ info: string;
}
-export const MONTHLY = 'monthly'
-export const CONSTANT = 'constant'
+export const MONTHLY = 'monthly';
+export const CONSTANT = 'constant';
export const lockupTypes: LockupKind[] = [
{
value: 'cliff',
@@ -44,7 +44,7 @@ export const lockupTypes: LockupKind[] = [
'Example: You lock 12.000 tokens for one year with monthly vesting. Every month 1.000 tokens unlock. After the year, all tokens have unlocked.',
],
},
-]
+];
export const vestingPeriods: VestingPeriod[] = [
{
@@ -52,4 +52,4 @@ export const vestingPeriods: VestingPeriod[] = [
display: 'Monthly',
info: 'per month',
},
-]
+];
diff --git a/actions/cancelProposal.ts b/actions/cancelProposal.ts
index c3a345107a..d1e69abb9f 100644
--- a/actions/cancelProposal.ts
+++ b/actions/cancelProposal.ts
@@ -3,29 +3,32 @@ import {
PublicKey,
Transaction,
TransactionInstruction,
-} from '@solana/web3.js'
+} from '@solana/web3.js';
-import { getGovernanceProgramVersion, RpcContext } from '@solana/spl-governance'
-import { Proposal } from '@solana/spl-governance'
-import { ProgramAccount } from '@solana/spl-governance'
-import { sendTransaction } from 'utils/send'
-import { withCancelProposal } from '@solana/spl-governance'
+import {
+ getGovernanceProgramVersion,
+ RpcContext,
+} from '@solana/spl-governance';
+import { Proposal } from '@solana/spl-governance';
+import { ProgramAccount } from '@solana/spl-governance';
+import { sendTransaction } from 'utils/send';
+import { withCancelProposal } from '@solana/spl-governance';
export const cancelProposal = async (
{ connection, wallet, programId, walletPubkey }: RpcContext,
realmPk: PublicKey,
- proposal: ProgramAccount | undefined
+ proposal: ProgramAccount | undefined,
) => {
- const instructions: TransactionInstruction[] = []
- const signers: Keypair[] = []
- const governanceAuthority = walletPubkey
+ const instructions: TransactionInstruction[] = [];
+ const signers: Keypair[] = [];
+ const governanceAuthority = walletPubkey;
// Explicitly request the version before making RPC calls to work around race conditions in resolving
// the version for RealmInfo
const programVersion = await getGovernanceProgramVersion(
connection,
- programId
- )
+ programId,
+ );
withCancelProposal(
instructions,
@@ -35,12 +38,12 @@ export const cancelProposal = async (
proposal!.account.governance,
proposal!.pubkey,
proposal!.account.tokenOwnerRecord,
- governanceAuthority
- )
+ governanceAuthority,
+ );
- const transaction = new Transaction({ feePayer: walletPubkey })
+ const transaction = new Transaction({ feePayer: walletPubkey });
- transaction.add(...instructions)
+ transaction.add(...instructions);
await sendTransaction({
transaction,
@@ -49,5 +52,5 @@ export const cancelProposal = async (
signers,
sendingMessage: 'Cancelling proposal',
successMessage: 'Proposal cancelled',
- })
-}
+ });
+};
diff --git a/actions/castVote.ts b/actions/castVote.ts
deleted file mode 100644
index 784be04db4..0000000000
--- a/actions/castVote.ts
+++ /dev/null
@@ -1,94 +0,0 @@
-import {
- Keypair,
- PublicKey,
- Transaction,
- TransactionInstruction,
-} from '@solana/web3.js'
-import {
- ChatMessageBody,
- getGovernanceProgramVersion,
- GOVERNANCE_CHAT_PROGRAM_ID,
- Proposal,
- Realm,
- withPostChatMessage,
- YesNoVote,
-} from '@solana/spl-governance'
-import { ProgramAccount } from '@solana/spl-governance'
-import { RpcContext } from '@solana/spl-governance'
-
-import { Vote } from '@solana/spl-governance'
-
-import { withCastVote } from '@solana/spl-governance'
-import { sendTransaction } from '../utils/send'
-import { withUpdateVoterWeightRecord } from 'VoteStakeRegistry/sdk/withUpdateVoterWeightRecord'
-import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client'
-
-export async function castVote(
- { connection, wallet, programId, walletPubkey }: RpcContext,
- realm: ProgramAccount,
- proposal: ProgramAccount,
- tokeOwnerRecord: PublicKey,
- yesNoVote: YesNoVote,
- message?: ChatMessageBody | undefined,
- client?: VsrClient
-) {
- const signers: Keypair[] = []
- const instructions: TransactionInstruction[] = []
-
- const governanceAuthority = walletPubkey
- const payer = walletPubkey
-
- // Explicitly request the version before making RPC calls to work around race conditions in resolving
- // the version for RealmInfo
- const programVersion = await getGovernanceProgramVersion(
- connection,
- programId
- )
-
- //will run only if plugin is connected with realm
- const voterWeight = await withUpdateVoterWeightRecord(
- instructions,
- wallet.publicKey!,
- realm,
- client
- )
-
- await withCastVote(
- instructions,
- programId,
- programVersion,
- realm.pubkey,
- proposal.account.governance,
- proposal.pubkey,
- proposal.account.tokenOwnerRecord,
- tokeOwnerRecord,
- governanceAuthority,
- proposal.account.governingTokenMint,
- Vote.fromYesNoVote(yesNoVote),
- payer,
- voterWeight
- )
-
- if (message) {
- await withPostChatMessage(
- instructions,
- signers,
- GOVERNANCE_CHAT_PROGRAM_ID,
- programId,
- realm.pubkey,
- proposal.account.governance,
- proposal.pubkey,
- tokeOwnerRecord,
- governanceAuthority,
- payer,
- undefined,
- message,
- voterWeight
- )
- }
-
- const transaction = new Transaction()
- transaction.add(...instructions)
-
- await sendTransaction({ transaction, wallet, connection, signers })
-}
diff --git a/actions/castVotes.ts b/actions/castVotes.ts
new file mode 100644
index 0000000000..05a17c1dbd
--- /dev/null
+++ b/actions/castVotes.ts
@@ -0,0 +1,123 @@
+import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client';
+import { Keypair, Transaction, TransactionInstruction } from '@solana/web3.js';
+import { withUpdateVoterWeightRecord } from 'VoteStakeRegistry/sdk/withUpdateVoterWeightRecord';
+import {
+ ChatMessageBody,
+ getGovernanceProgramVersion,
+ GOVERNANCE_CHAT_PROGRAM_ID,
+ Proposal,
+ Realm,
+ TokenOwnerRecord,
+ withPostChatMessage,
+ YesNoVote,
+} from '@solana/spl-governance';
+import { ProgramAccount } from '@solana/spl-governance';
+import { RpcContext } from '@solana/spl-governance';
+import { Vote } from '@solana/spl-governance';
+import { withCastVote } from '@solana/spl-governance';
+import { sendTransaction } from '../utils/send';
+import { notify } from '@utils/notifications';
+
+export async function castVotes({
+ rpcContext: { connection, wallet, programId, walletPubkey },
+ vote,
+ realm,
+ proposal,
+ tokenOwnerRecordsToVoteWith,
+ message,
+ client,
+}: {
+ rpcContext: RpcContext;
+ realm: ProgramAccount;
+ proposal: ProgramAccount;
+ tokenOwnerRecordsToVoteWith: ProgramAccount[];
+ vote: YesNoVote;
+ message?: ChatMessageBody;
+ client?: VsrClient;
+}) {
+ const signers: Keypair[] = [];
+ let instructions: TransactionInstruction[] = [];
+
+ const governanceAuthority = walletPubkey;
+ const payer = walletPubkey;
+
+ // Explicitly request the version before making RPC calls to work around race conditions in resolving
+ // the version for RealmInfo
+ const programVersion = await getGovernanceProgramVersion(
+ connection,
+ programId,
+ );
+
+ //will run only if plugin is connected with realm
+ const voterWeight = await withUpdateVoterWeightRecord(
+ instructions,
+ wallet.publicKey!,
+ realm,
+ client,
+ );
+
+ // Post the message in the first transaction
+ if (message) {
+ await withPostChatMessage(
+ instructions,
+ signers,
+ GOVERNANCE_CHAT_PROGRAM_ID,
+ programId,
+ realm.pubkey,
+ proposal.account.governance,
+ proposal.pubkey,
+
+ // Use the first Token Owner Record in a completely arbitrary way
+ tokenOwnerRecordsToVoteWith[0].pubkey,
+
+ governanceAuthority,
+ payer,
+ undefined,
+ message,
+ voterWeight,
+ );
+ }
+
+ let i = 0;
+
+ for (const tokenOwnerRecord of tokenOwnerRecordsToVoteWith) {
+ await withCastVote(
+ instructions,
+ programId,
+ programVersion,
+ realm.pubkey,
+ proposal.account.governance,
+ proposal.pubkey,
+ proposal.account.tokenOwnerRecord,
+ tokenOwnerRecord.pubkey,
+ governanceAuthority,
+ proposal.account.governingTokenMint,
+ Vote.fromYesNoVote(vote),
+ payer,
+ voterWeight,
+ );
+
+ const transaction = new Transaction();
+ transaction.add(...instructions);
+
+ if (tokenOwnerRecordsToVoteWith.length > 1) {
+ notify({
+ type: 'info',
+ message: `Voting ${i + 1}/${tokenOwnerRecordsToVoteWith.length}`,
+ });
+ }
+
+ await sendTransaction({ transaction, wallet, connection, signers });
+
+ instructions = [];
+ i++;
+ }
+
+ // If there is no vote to cast but there is a message, send the transaction
+ if (!tokenOwnerRecordsToVoteWith.length && message) {
+ const transaction = new Transaction();
+ transaction.add(...instructions);
+
+ await sendTransaction({ transaction, wallet, connection, signers });
+ }
+}
diff --git a/actions/chat/postMessage.ts b/actions/chat/postMessage.ts
index bd21cdf096..8da7ae7230 100644
--- a/actions/chat/postMessage.ts
+++ b/actions/chat/postMessage.ts
@@ -3,19 +3,19 @@ import {
Keypair,
Transaction,
TransactionInstruction,
-} from '@solana/web3.js'
+} from '@solana/web3.js';
import {
GOVERNANCE_CHAT_PROGRAM_ID,
Proposal,
Realm,
-} from '@solana/spl-governance'
-import { ChatMessageBody } from '@solana/spl-governance'
-import { withPostChatMessage } from '@solana/spl-governance'
-import { ProgramAccount } from '@solana/spl-governance'
-import { RpcContext } from '@solana/spl-governance'
-import { sendTransaction } from '../../utils/send'
-import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client'
-import { withUpdateVoterWeightRecord } from 'VoteStakeRegistry/sdk/withUpdateVoterWeightRecord'
+} from '@solana/spl-governance';
+import { ChatMessageBody } from '@solana/spl-governance';
+import { withPostChatMessage } from '@solana/spl-governance';
+import { ProgramAccount } from '@solana/spl-governance';
+import { RpcContext } from '@solana/spl-governance';
+import { sendTransaction } from '../../utils/send';
+import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client';
+import { withUpdateVoterWeightRecord } from 'VoteStakeRegistry/sdk/withUpdateVoterWeightRecord';
export async function postChatMessage(
{ connection, wallet, programId, walletPubkey }: RpcContext,
@@ -24,21 +24,21 @@ export async function postChatMessage(
tokeOwnerRecord: PublicKey,
body: ChatMessageBody,
replyTo?: PublicKey,
- client?: VsrClient
+ client?: VsrClient,
) {
- const signers: Keypair[] = []
- const instructions: TransactionInstruction[] = []
+ const signers: Keypair[] = [];
+ const instructions: TransactionInstruction[] = [];
- const governanceAuthority = walletPubkey
- const payer = walletPubkey
+ const governanceAuthority = walletPubkey;
+ const payer = walletPubkey;
//will run only if plugin is connected with realm
const voterWeight = await withUpdateVoterWeightRecord(
instructions,
wallet.publicKey!,
realm,
- client
- )
+ client,
+ );
await withPostChatMessage(
instructions,
@@ -53,11 +53,11 @@ export async function postChatMessage(
payer,
replyTo,
body,
- voterWeight
- )
+ voterWeight,
+ );
- const transaction = new Transaction()
- transaction.add(...instructions)
+ const transaction = new Transaction();
+ transaction.add(...instructions);
- await sendTransaction({ transaction, wallet, connection, signers })
+ await sendTransaction({ transaction, wallet, connection, signers });
}
diff --git a/actions/createMultisigRealm.ts b/actions/createMultisigRealm.ts
deleted file mode 100644
index e6175bac87..0000000000
--- a/actions/createMultisigRealm.ts
+++ /dev/null
@@ -1,248 +0,0 @@
-import {
- getTokenOwnerRecordAddress,
- GovernanceConfig,
- MintMaxVoteWeightSource,
- SetRealmAuthorityAction,
- VoteThresholdPercentage,
- VoteTipping,
-} from '@solana/spl-governance'
-
-import { withCreateMintGovernance } from '@solana/spl-governance'
-import { withCreateRealm } from '@solana/spl-governance'
-import { withDepositGoverningTokens } from '@solana/spl-governance'
-import { withSetRealmAuthority } from '@solana/spl-governance'
-import { BN } from '@project-serum/anchor'
-import {
- Connection,
- Keypair,
- PublicKey,
- TransactionInstruction,
-} from '@solana/web3.js'
-
-import { withCreateAssociatedTokenAccount } from '@tools/sdk/splToken/withCreateAssociatedTokenAccount'
-import { withCreateMint } from '@tools/sdk/splToken/withCreateMint'
-import { withMintTo } from '@tools/sdk/splToken/withMintTo'
-import {
- getMintNaturalAmountFromDecimalAsBN,
- getTimestampFromDays,
-} from '@tools/sdk/units'
-import {
- getWalletPublicKey,
- sendTransactions,
- SequenceType,
- WalletSigner,
-} from 'utils/sendTransactions'
-import { chunks } from '@utils/helpers'
-import { MIN_COMMUNITY_TOKENS_TO_CREATE_W_0_SUPPLY } from '@tools/constants'
-
-/// Creates multisig realm with community mint with 0 supply
-/// and council mint used as multisig token
-export const createMultisigRealm = async (
- connection: Connection,
- programId: PublicKey,
- programVersion: number,
-
- name: string,
- yesVoteThreshold: number,
- councilWalletPks: PublicKey[],
-
- wallet: WalletSigner
-) => {
- const walletPk = getWalletPublicKey(wallet)
-
- const mintsSetupInstructions: TransactionInstruction[] = []
- const councilMembersInstructions: TransactionInstruction[] = []
-
- const mintsSetupSigners: Keypair[] = []
-
- // Default to 100% supply
- const communityMintMaxVoteWeightSource =
- MintMaxVoteWeightSource.FULL_SUPPLY_FRACTION
-
- // The community mint is going to have 0 supply and we arbitrarily set it to 1m
- const minCommunityTokensToCreate = MIN_COMMUNITY_TOKENS_TO_CREATE_W_0_SUPPLY
-
- // Community mint decimals
- const communityMintDecimals = 6
-
- // Create community mint
- const communityMintPk = await withCreateMint(
- connection,
- mintsSetupInstructions,
- mintsSetupSigners,
- walletPk,
- null,
- communityMintDecimals,
- walletPk
- )
-
- // Create council mint
- const councilMintPk = await withCreateMint(
- connection,
- mintsSetupInstructions,
- mintsSetupSigners,
- walletPk,
- null,
- 0,
- walletPk
- )
-
- let walletAtaPk: PublicKey | undefined
- const tokenAmount = 1
-
- for (const teamWalletPk of councilWalletPks) {
- const ataPk = await withCreateAssociatedTokenAccount(
- councilMembersInstructions,
- councilMintPk,
- teamWalletPk,
- walletPk
- )
-
- // Mint 1 council token to each team member
- await withMintTo(
- councilMembersInstructions,
- councilMintPk,
- ataPk,
- walletPk,
- tokenAmount
- )
-
- if (teamWalletPk.equals(walletPk)) {
- walletAtaPk = ataPk
- }
- }
-
- // Create realm
- const realmInstructions: TransactionInstruction[] = []
- const realmSigners: Keypair[] = []
-
- // Convert to mint natural amount
- const minCommunityTokensToCreateAsMintValue = getMintNaturalAmountFromDecimalAsBN(
- minCommunityTokensToCreate,
- communityMintDecimals
- )
-
- const realmPk = await withCreateRealm(
- realmInstructions,
- programId,
- programVersion,
- name,
- walletPk,
- communityMintPk,
- walletPk,
- councilMintPk,
- communityMintMaxVoteWeightSource,
- minCommunityTokensToCreateAsMintValue,
- undefined
- )
-
- let tokenOwnerRecordPk: PublicKey
-
- // If the current wallet is in the team then deposit the council token
- if (walletAtaPk) {
- await withDepositGoverningTokens(
- realmInstructions,
- programId,
- programVersion,
- realmPk,
- walletAtaPk,
- councilMintPk,
- walletPk,
- walletPk,
- walletPk,
- new BN(tokenAmount)
- )
-
- // TODO: return from withDepositGoverningTokens in the SDK
- tokenOwnerRecordPk = await getTokenOwnerRecordAddress(
- programId,
- realmPk,
- councilMintPk,
- walletPk
- )
- } else {
- // Let's throw for now if the current wallet isn't in the team
- // TODO: To fix it we would have to make it temp. as part of the team and then remove after the realm is created
- throw new Error('Current wallet must be in the team')
- }
-
- // Put community and council mints under the realm governance with default config
- const config = new GovernanceConfig({
- voteThresholdPercentage: new VoteThresholdPercentage({
- value: yesVoteThreshold,
- }),
- minCommunityTokensToCreateProposal: minCommunityTokensToCreateAsMintValue,
- // Do not use instruction hold up time
- minInstructionHoldUpTime: 0,
- // max voting time 3 days
- maxVotingTime: getTimestampFromDays(3),
- voteTipping: VoteTipping.Strict,
- proposalCoolOffTime: 0,
- minCouncilTokensToCreateProposal: new BN(1),
- })
-
- const communityMintGovPk = await withCreateMintGovernance(
- realmInstructions,
- programId,
- programVersion,
- realmPk,
- communityMintPk,
- config,
- walletPk,
- walletPk,
- tokenOwnerRecordPk,
- walletPk,
- walletPk
- )
-
- await withCreateMintGovernance(
- realmInstructions,
- programId,
- programVersion,
- realmPk,
- councilMintPk,
- config,
- walletPk,
- walletPk,
- tokenOwnerRecordPk,
- walletPk,
- walletPk
- )
-
- // Set the community governance as the realm authority
- withSetRealmAuthority(
- realmInstructions,
- programId,
- programVersion,
- realmPk,
- walletPk,
- communityMintGovPk,
- SetRealmAuthorityAction.SetChecked
- )
-
- try {
- const councilMembersChunks = chunks(councilMembersInstructions, 10)
- // only walletPk needs to sign the minting instructions and it's a signer by default and we don't have to include any more signers
- const councilMembersSignersChunks = Array(councilMembersChunks.length).fill(
- []
- )
-
- const tx = await sendTransactions(
- connection,
- wallet,
- [mintsSetupInstructions, ...councilMembersChunks, realmInstructions],
- [mintsSetupSigners, ...councilMembersSignersChunks, realmSigners],
- SequenceType.Sequential
- )
-
- return {
- tx,
- realmPk,
- communityMintPk,
- councilMintPk,
- }
- } catch (ex) {
- console.error(ex)
- throw ex
- }
-}
diff --git a/actions/createProposal.ts b/actions/createProposal.ts
index 543dd01754..b9b3e06002 100644
--- a/actions/createProposal.ts
+++ b/actions/createProposal.ts
@@ -3,7 +3,7 @@ import {
PublicKey,
Transaction,
TransactionInstruction,
-} from '@solana/web3.js'
+} from '@solana/web3.js';
import {
getGovernanceProgramVersion,
@@ -14,26 +14,26 @@ import {
Realm,
VoteType,
withCreateProposal,
-} from '@solana/spl-governance'
-import { withAddSignatory } from '@solana/spl-governance'
-import { RpcContext } from '@solana/spl-governance'
-import { withInsertTransaction } from '@solana/spl-governance'
-import { InstructionData } from '@solana/spl-governance'
-import { sendTransaction } from 'utils/send'
-import { withSignOffProposal } from '@solana/spl-governance'
-import { withUpdateVoterWeightRecord } from 'VoteStakeRegistry/sdk/withUpdateVoterWeightRecord'
-import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client'
-import { sendTransactions, SequenceType } from '@utils/sendTransactions'
-import { chunks } from '@utils/helpers'
-import { UiInstruction } from '@utils/uiTypes/proposalCreationTypes'
+} from '@solana/spl-governance';
+import { withAddSignatory } from '@solana/spl-governance';
+import { RpcContext } from '@solana/spl-governance';
+import { withInsertTransaction } from '@solana/spl-governance';
+import { InstructionData } from '@solana/spl-governance';
+import { sendTransaction } from 'utils/send';
+import { withSignOffProposal } from '@solana/spl-governance';
+import { withUpdateVoterWeightRecord } from 'VoteStakeRegistry/sdk/withUpdateVoterWeightRecord';
+import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client';
+import { sendTransactions, SequenceType } from '@utils/sendTransactions';
+import { chunks } from '@utils/helpers';
+import { FormInstructionData } from '@utils/uiTypes/proposalCreationTypes';
export interface InstructionDataWithHoldUpTime {
- data: InstructionData | null
- holdUpTime: number | undefined
- prerequisiteInstructions: TransactionInstruction[]
- chunkSplitByDefault?: boolean
- signers?: Keypair[]
- shouldSplitIntoSeparateTxs?: boolean | undefined
+ data: InstructionData | null;
+ holdUpTime: number | undefined;
+ prerequisiteInstructions: TransactionInstruction[];
+ chunkSplitByDefault?: boolean;
+ signers?: Keypair[];
+ shouldSplitIntoSeparateTxs?: boolean | undefined;
}
export class InstructionDataWithHoldUpTime {
@@ -41,19 +41,19 @@ export class InstructionDataWithHoldUpTime {
instruction,
governance,
}: {
- instruction: UiInstruction
- governance?: ProgramAccount
+ instruction: FormInstructionData;
+ governance?: ProgramAccount;
}) {
this.data = instruction.serializedInstruction
? getInstructionDataFromBase64(instruction.serializedInstruction)
- : null
+ : null;
this.holdUpTime =
typeof instruction.customHoldUpTime !== undefined
? instruction.customHoldUpTime
- : governance?.account?.config.minInstructionHoldUpTime
+ : governance?.account?.config.minInstructionHoldUpTime;
- this.prerequisiteInstructions = instruction.prerequisiteInstructions || []
- this.chunkSplitByDefault = instruction.chunkSplitByDefault || false
+ this.prerequisiteInstructions = instruction.prerequisiteInstructions || [];
+ this.chunkSplitByDefault = instruction.chunkSplitByDefault || false;
}
}
@@ -68,41 +68,41 @@ export const createProposal = async (
proposalIndex: number,
instructionsData: InstructionDataWithHoldUpTime[],
isDraft: boolean,
- client?: VsrClient
+ client?: VsrClient,
): Promise => {
- const instructions: TransactionInstruction[] = []
+ const instructions: TransactionInstruction[] = [];
- const governanceAuthority = walletPubkey
- const signatory = walletPubkey
- const payer = walletPubkey
- const notificationTitle = isDraft ? 'proposal draft' : 'proposal'
- const prerequisiteInstructions: TransactionInstruction[] = []
+ const governanceAuthority = walletPubkey;
+ const signatory = walletPubkey;
+ const payer = walletPubkey;
+ const notificationTitle = isDraft ? 'proposal draft' : 'proposal';
+ const prerequisiteInstructions: TransactionInstruction[] = [];
// sum up signers
- const signers: Keypair[] = instructionsData.flatMap((x) => x.signers ?? [])
+ const signers: Keypair[] = instructionsData.flatMap((x) => x.signers ?? []);
const shouldSplitIntoSeparateTxs: boolean = instructionsData
.flatMap((x) => x.shouldSplitIntoSeparateTxs)
- .some((x) => x)
+ .some((x) => x);
// Explicitly request the version before making RPC calls to work around race conditions in resolving
// the version for RealmInfo
const programVersion = await getGovernanceProgramVersion(
connection,
- programId
- )
+ programId,
+ );
// V2 Approve/Deny configuration
- const voteType = VoteType.SINGLE_CHOICE
- const options = ['Approve']
- const useDenyOption = true
+ const voteType = VoteType.SINGLE_CHOICE;
+ const options = ['Approve'];
+ const useDenyOption = true;
//will run only if plugin is connected with realm
const voterWeight = await withUpdateVoterWeightRecord(
instructions,
wallet.publicKey!,
realm,
- client
- )
+ client,
+ );
const proposalAddress = await withCreateProposal(
instructions,
@@ -120,8 +120,8 @@ export const createProposal = async (
options,
useDenyOption,
payer,
- voterWeight
- )
+ voterWeight,
+ );
await withAddSignatory(
instructions,
@@ -131,27 +131,27 @@ export const createProposal = async (
tokenOwnerRecord,
governanceAuthority,
signatory,
- payer
- )
+ payer,
+ );
// TODO: Return signatoryRecordAddress from the SDK call
const signatoryRecordAddress = await getSignatoryRecordAddress(
programId,
proposalAddress,
- signatory
- )
+ signatory,
+ );
- const insertInstructions: TransactionInstruction[] = []
+ const insertInstructions: TransactionInstruction[] = [];
const splitToChunkByDefault = instructionsData.filter(
- (x) => x.chunkSplitByDefault
- ).length
+ (x) => x.chunkSplitByDefault,
+ ).length;
for (const [index, instruction] of instructionsData
.filter((x) => x.data)
.entries()) {
if (instruction.data) {
if (instruction.prerequisiteInstructions) {
- prerequisiteInstructions.push(...instruction.prerequisiteInstructions)
+ prerequisiteInstructions.push(...instruction.prerequisiteInstructions);
}
await withInsertTransaction(
insertInstructions,
@@ -165,12 +165,12 @@ export const createProposal = async (
0,
instruction.holdUpTime || 0,
[instruction.data],
- payer
- )
+ payer,
+ );
}
}
- const insertInstructionCount = insertInstructions.length
+ const insertInstructionCount = insertInstructions.length;
if (!isDraft) {
withSignOffProposal(
@@ -182,16 +182,16 @@ export const createProposal = async (
proposalAddress,
signatory,
signatoryRecordAddress,
- undefined
- )
+ undefined,
+ );
}
if (shouldSplitIntoSeparateTxs) {
- const transaction1 = new Transaction()
- const transaction2 = new Transaction()
+ const transaction1 = new Transaction();
+ const transaction2 = new Transaction();
- transaction1.add(...prerequisiteInstructions, ...instructions)
- transaction2.add(...insertInstructions)
+ transaction1.add(...prerequisiteInstructions, ...instructions);
+ transaction2.add(...insertInstructions);
await sendTransaction({
transaction: transaction1,
@@ -200,7 +200,7 @@ export const createProposal = async (
signers,
sendingMessage: `creating ${notificationTitle}`,
successMessage: `${notificationTitle} created`,
- })
+ });
await sendTransaction({
transaction: transaction2,
@@ -209,20 +209,20 @@ export const createProposal = async (
signers: undefined,
sendingMessage: `inserting into ${notificationTitle}`,
successMessage: `inserted into ${notificationTitle}`,
- })
+ });
} else if (insertInstructionCount <= 2 && !splitToChunkByDefault) {
// This is an arbitrary threshold and we assume that up to 2 instructions can be inserted as a single Tx
// This is conservative setting and we might need to revise it if we have more empirical examples or
// reliable way to determine Tx size
- const transaction = new Transaction()
+ const transaction = new Transaction();
// We merge instructions with prerequisiteInstructions
// Prerequisite instructions can came from instructions as something we need to do before instruction can be executed
// For example we create ATAs if they don't exist as part of the proposal creation flow
transaction.add(
...prerequisiteInstructions,
...instructions,
- ...insertInstructions
- )
+ ...insertInstructions,
+ );
await sendTransaction({
transaction,
@@ -231,21 +231,21 @@ export const createProposal = async (
signers,
sendingMessage: `creating ${notificationTitle}`,
successMessage: `${notificationTitle} created`,
- })
+ });
} else {
- const insertChunks = chunks(insertInstructions, 2)
- const signerChunks = Array(insertChunks.length).fill([])
+ const insertChunks = chunks(insertInstructions, 2);
+ const signerChunks = Array(insertChunks.length).fill([]);
- console.log(`Creating proposal using ${insertChunks.length} chunks`)
+ console.info(`Creating proposal using ${insertChunks.length} chunks`);
await sendTransactions(
connection,
wallet,
[prerequisiteInstructions, instructions, ...insertChunks],
[[], [], ...signerChunks],
- SequenceType.Sequential
- )
+ SequenceType.Sequential,
+ );
}
- return proposalAddress
-}
+ return proposalAddress;
+};
diff --git a/actions/createTreasuryAccount.ts b/actions/createTreasuryAccount.ts
deleted file mode 100644
index 80fdec8f6d..0000000000
--- a/actions/createTreasuryAccount.ts
+++ /dev/null
@@ -1,97 +0,0 @@
-import {
- Keypair,
- PublicKey,
- Transaction,
- TransactionInstruction,
-} from '@solana/web3.js'
-
-import {
- getGovernanceProgramVersion,
- GovernanceConfig,
- ProgramAccount,
- Realm,
- withCreateNativeTreasury,
-} from '@solana/spl-governance'
-
-import { withCreateTokenGovernance } from '@solana/spl-governance'
-import { RpcContext } from '@solana/spl-governance'
-import { sendTransaction } from '@utils/send'
-import { withCreateSplTokenAccount } from '@models/withCreateSplTokenAccount'
-import { withUpdateVoterWeightRecord } from 'VoteStakeRegistry/sdk/withUpdateVoterWeightRecord'
-import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client'
-import { DEFAULT_NATIVE_SOL_MINT } from '@components/instructions/tools'
-
-export const createTreasuryAccount = async (
- { connection, wallet, programId, walletPubkey }: RpcContext,
- realm: ProgramAccount,
- mint: PublicKey,
- config: GovernanceConfig,
- tokenOwnerRecord: PublicKey,
- client?: VsrClient
-): Promise => {
- const instructions: TransactionInstruction[] = []
- const signers: Keypair[] = []
-
- // Explicitly request the version before making RPC calls to work around race conditions in resolving
- // the version for RealmInfo
- const programVersion = await getGovernanceProgramVersion(
- connection,
- programId
- )
-
- //will run only if plugin is connected with realm
- const voterWeight = await withUpdateVoterWeightRecord(
- instructions,
- wallet.publicKey!,
- realm,
- client
- )
-
- const tokenAccount = await withCreateSplTokenAccount(
- connection,
- wallet!,
- instructions,
- signers,
- mint
- )
-
- const governanceAuthority = walletPubkey
-
- const governanceAddress = await withCreateTokenGovernance(
- instructions,
- programId,
- programVersion,
- realm.pubkey,
- tokenAccount.tokenAccountAddress,
- config,
- true,
- walletPubkey,
- tokenOwnerRecord,
- walletPubkey,
- governanceAuthority,
- voterWeight
- )
-
- if (mint.toBase58() === DEFAULT_NATIVE_SOL_MINT) {
- await withCreateNativeTreasury(
- instructions,
- programId,
- governanceAddress,
- walletPubkey
- )
- }
-
- const transaction = new Transaction()
- transaction.add(...instructions)
-
- await sendTransaction({
- transaction,
- wallet,
- connection,
- signers,
- sendingMessage: 'Creating treasury account',
- successMessage: 'Treasury account has been created',
- })
-
- return governanceAddress
-}
diff --git a/actions/dryRunInstruction.ts b/actions/dryRunInstruction.ts
index ec35c835ba..617473b9f2 100644
--- a/actions/dryRunInstruction.ts
+++ b/actions/dryRunInstruction.ts
@@ -1,30 +1,30 @@
-import { InstructionData } from '@solana/spl-governance'
+import { InstructionData } from '@solana/spl-governance';
import {
Connection,
Transaction,
TransactionInstruction,
-} from '@solana/web3.js'
-import { simulateTransaction } from '../utils/send'
-import { WalletAdapter } from '@solana/wallet-adapter-base'
+} from '@solana/web3.js';
+import { simulateTransaction } from '../utils/send';
+import { WalletAdapter } from '@solana/wallet-adapter-base';
export async function dryRunInstruction(
connection: Connection,
wallet: WalletAdapter,
instructionData: InstructionData,
- prerequisiteInstructionsToRun?: TransactionInstruction[] | undefined
+ prerequisiteInstructionsToRun?: TransactionInstruction[] | undefined,
) {
- const transaction = new Transaction({ feePayer: wallet.publicKey })
+ const transaction = new Transaction({ feePayer: wallet.publicKey });
if (prerequisiteInstructionsToRun) {
- prerequisiteInstructionsToRun.map((x) => transaction.add(x))
+ prerequisiteInstructionsToRun.map((x) => transaction.add(x));
}
transaction.add({
keys: instructionData.accounts,
programId: instructionData.programId,
data: Buffer.from(instructionData.data),
- })
+ });
- const result = await simulateTransaction(connection, transaction, 'single')
+ const result = await simulateTransaction(connection, transaction, 'single');
- return { response: result.value, transaction }
+ return { response: result.value, transaction };
}
diff --git a/actions/executeInstructions.ts b/actions/executeInstructions.ts
index f2cb59ba4e..1d608963df 100644
--- a/actions/executeInstructions.ts
+++ b/actions/executeInstructions.ts
@@ -4,17 +4,17 @@ import {
ProposalTransaction,
RpcContext,
withExecuteTransaction,
-} from '@solana/spl-governance'
-import { Transaction, TransactionInstruction } from '@solana/web3.js'
-import { sendSignedTransaction, signTransaction } from '@utils/send'
+} from '@solana/spl-governance';
+import { Transaction, TransactionInstruction } from '@solana/web3.js';
+import { sendSignedTransaction, signTransaction } from '@utils/send';
// Merge instructions within one Transaction, sign it and execute it
export const executeInstructions = async (
{ connection, wallet, programId, programVersion }: RpcContext,
proposal: ProgramAccount,
- proposalInstructions: ProgramAccount[]
+ proposalInstructions: ProgramAccount[],
) => {
- const instructions: TransactionInstruction[] = []
+ const instructions: TransactionInstruction[] = [];
await Promise.all(
proposalInstructions.map((instruction) =>
@@ -26,26 +26,26 @@ export const executeInstructions = async (
proposal.account.governance,
proposal.pubkey,
instruction.pubkey,
- [instruction.account.getSingleInstruction()]
- )
- )
- )
+ [instruction.account.getSingleInstruction()],
+ ),
+ ),
+ );
- const transaction = new Transaction()
+ const transaction = new Transaction();
- transaction.add(...instructions)
+ transaction.add(...instructions);
const signedTransaction = await signTransaction({
transaction,
wallet,
connection,
signers: [],
- })
+ });
await sendSignedTransaction({
signedTransaction,
connection,
sendingMessage: 'Executing instruction',
successMessage: 'Execution finalized',
- })
-}
+ });
+};
diff --git a/actions/executeTransaction.ts b/actions/executeTransaction.ts
index f774452533..e80e3eec64 100644
--- a/actions/executeTransaction.ts
+++ b/actions/executeTransaction.ts
@@ -1,30 +1,31 @@
-import { Keypair, Transaction, TransactionInstruction } from '@solana/web3.js'
+import { Keypair, Transaction, TransactionInstruction } from '@solana/web3.js';
import {
getGovernanceProgramVersion,
Proposal,
ProposalTransaction,
-} from '@solana/spl-governance'
+} from '@solana/spl-governance';
-import { withExecuteTransaction } from '@solana/spl-governance'
-import { RpcContext } from '@solana/spl-governance'
-import { ProgramAccount } from '@solana/spl-governance'
-import { sendTransaction } from '@utils/send'
+import { withExecuteTransaction } from '@solana/spl-governance';
+import { RpcContext } from '@solana/spl-governance';
+import { ProgramAccount } from '@solana/spl-governance';
+import { sendTransaction } from '@utils/send';
export const executeTransaction = async (
{ connection, wallet, programId }: RpcContext,
proposal: ProgramAccount,
- instruction: ProgramAccount
+ instruction: ProgramAccount,
+ additionalSigner?: Keypair,
) => {
- const signers: Keypair[] = []
- const instructions: TransactionInstruction[] = []
+ const signers: Keypair[] = [];
+ const instructions: TransactionInstruction[] = [];
// Explicitly request the version before making RPC calls to work around race conditions in resolving
// the version for RealmInfo
const programVersion = await getGovernanceProgramVersion(
connection,
- programId
- )
+ programId,
+ );
await withExecuteTransaction(
instructions,
@@ -33,12 +34,16 @@ export const executeTransaction = async (
proposal.account.governance,
proposal.pubkey,
instruction.pubkey,
- [instruction.account.getSingleInstruction()]
- )
+ [instruction.account.getSingleInstruction()],
+ );
+
+ const transaction = new Transaction();
- const transaction = new Transaction()
+ transaction.add(...instructions);
- transaction.add(...instructions)
+ if (additionalSigner) {
+ signers.push(additionalSigner);
+ }
await sendTransaction({
transaction,
@@ -47,5 +52,5 @@ export const executeTransaction = async (
signers,
sendingMessage: 'Executing instruction',
successMessage: 'Execution finalized',
- })
-}
+ });
+};
diff --git a/actions/finalizeVotes.ts b/actions/finalizeVotes.ts
index ad85773a40..d8e8b69173 100644
--- a/actions/finalizeVotes.ts
+++ b/actions/finalizeVotes.ts
@@ -1,32 +1,32 @@
import {
getGovernanceProgramVersion,
ProgramAccount,
-} from '@solana/spl-governance'
-import { RpcContext } from '@solana/spl-governance'
+} from '@solana/spl-governance';
+import { RpcContext } from '@solana/spl-governance';
import {
Keypair,
PublicKey,
Transaction,
TransactionInstruction,
-} from '@solana/web3.js'
-import { sendTransaction } from '@utils/send'
-import { Proposal } from '@solana/spl-governance'
-import { withFinalizeVote } from '@solana/spl-governance'
+} from '@solana/web3.js';
+import { sendTransaction } from '@utils/send';
+import { Proposal } from '@solana/spl-governance';
+import { withFinalizeVote } from '@solana/spl-governance';
export const finalizeVote = async (
{ connection, wallet, programId }: RpcContext,
realm: PublicKey,
- proposal: ProgramAccount
+ proposal: ProgramAccount,
) => {
- const signers: Keypair[] = []
- const instructions: TransactionInstruction[] = []
+ const signers: Keypair[] = [];
+ const instructions: TransactionInstruction[] = [];
// Explicitly request the version before making RPC calls to work around race conditions in resolving
// the version for RealmInfo
const programVersion = await getGovernanceProgramVersion(
connection,
- programId
- )
+ programId,
+ );
await withFinalizeVote(
instructions,
@@ -36,12 +36,12 @@ export const finalizeVote = async (
proposal.account.governance,
proposal.pubkey,
proposal.account.tokenOwnerRecord,
- proposal.account.governingTokenMint
- )
+ proposal.account.governingTokenMint,
+ );
- const transaction = new Transaction()
+ const transaction = new Transaction();
- transaction.add(...instructions)
+ transaction.add(...instructions);
await sendTransaction({
transaction,
@@ -50,5 +50,5 @@ export const finalizeVote = async (
signers,
sendingMessage: 'Finalizing votes',
successMessage: 'Votes finalized',
- })
-}
+ });
+};
diff --git a/actions/flagInstructionError.ts b/actions/flagInstructionError.ts
index 665810f4e4..bbf7a7e5a9 100644
--- a/actions/flagInstructionError.ts
+++ b/actions/flagInstructionError.ts
@@ -3,31 +3,31 @@ import {
PublicKey,
Transaction,
TransactionInstruction,
-} from '@solana/web3.js'
+} from '@solana/web3.js';
-import { getGovernanceProgramVersion, Proposal } from '@solana/spl-governance'
+import { getGovernanceProgramVersion, Proposal } from '@solana/spl-governance';
-import { withFlagTransactionError } from '@solana/spl-governance'
-import { RpcContext } from '@solana/spl-governance'
-import { ProgramAccount } from '@solana/spl-governance'
-import { sendTransaction } from '@utils/send'
+import { withFlagTransactionError } from '@solana/spl-governance';
+import { RpcContext } from '@solana/spl-governance';
+import { ProgramAccount } from '@solana/spl-governance';
+import { sendTransaction } from '@utils/send';
export const flagInstructionError = async (
{ connection, wallet, programId, walletPubkey }: RpcContext,
proposal: ProgramAccount,
- proposalInstruction: PublicKey
+ proposalInstruction: PublicKey,
) => {
- const governanceAuthority = walletPubkey
+ const governanceAuthority = walletPubkey;
- const signers: Keypair[] = []
- const instructions: TransactionInstruction[] = []
+ const signers: Keypair[] = [];
+ const instructions: TransactionInstruction[] = [];
// Explicitly request the version before making RPC calls to work around race conditions in resolving
// the version for RealmInfo
const programVersion = await getGovernanceProgramVersion(
connection,
- programId
- )
+ programId,
+ );
withFlagTransactionError(
instructions,
@@ -36,12 +36,12 @@ export const flagInstructionError = async (
proposal.pubkey,
proposal.account.tokenOwnerRecord,
governanceAuthority,
- proposalInstruction
- )
+ proposalInstruction,
+ );
- const transaction = new Transaction({ feePayer: walletPubkey })
+ const transaction = new Transaction({ feePayer: walletPubkey });
- transaction.add(...instructions)
+ transaction.add(...instructions);
await sendTransaction({
transaction,
@@ -50,5 +50,5 @@ export const flagInstructionError = async (
signers,
sendingMessage: 'Flagging instruction as broken',
successMessage: 'Instruction flagged as broken',
- })
-}
+ });
+};
diff --git a/actions/registerProgramGovernance.ts b/actions/registerProgramGovernance.ts
index f6341aef15..d2d505c6e3 100644
--- a/actions/registerProgramGovernance.ts
+++ b/actions/registerProgramGovernance.ts
@@ -3,19 +3,19 @@ import {
PublicKey,
Transaction,
TransactionInstruction,
-} from '@solana/web3.js'
+} from '@solana/web3.js';
import {
getGovernanceProgramVersion,
GovernanceType,
ProgramAccount,
Realm,
-} from '@solana/spl-governance'
-import { GovernanceConfig } from '@solana/spl-governance'
-import { withCreateProgramGovernance } from '@solana/spl-governance'
-import { RpcContext } from '@solana/spl-governance'
-import { sendTransaction } from '@utils/send'
-import { withUpdateVoterWeightRecord } from 'VoteStakeRegistry/sdk/withUpdateVoterWeightRecord'
-import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client'
+} from '@solana/spl-governance';
+import { GovernanceConfig } from '@solana/spl-governance';
+import { withCreateProgramGovernance } from '@solana/spl-governance';
+import { RpcContext } from '@solana/spl-governance';
+import { sendTransaction } from '@utils/send';
+import { withUpdateVoterWeightRecord } from 'VoteStakeRegistry/sdk/withUpdateVoterWeightRecord';
+import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client';
export const registerProgramGovernance = async (
{ connection, wallet, programId, walletPubkey }: RpcContext,
@@ -25,29 +25,29 @@ export const registerProgramGovernance = async (
config: GovernanceConfig,
transferAuthority: boolean,
tokenOwnerRecord: PublicKey,
- client?: VsrClient
+ client?: VsrClient,
): Promise => {
- const instructions: TransactionInstruction[] = []
- const signers: Keypair[] = []
- let governanceAddress
- const governanceAuthority = walletPubkey
+ const instructions: TransactionInstruction[] = [];
+ const signers: Keypair[] = [];
+ let governanceAddress;
+ const governanceAuthority = walletPubkey;
// Explicitly request the version before making RPC calls to work around race conditions in resolving
// the version for RealmInfo
const programVersion = await getGovernanceProgramVersion(
connection,
- programId
- )
+ programId,
+ );
//will run only if plugin is connected with realm
const voterWeight = await withUpdateVoterWeightRecord(
instructions,
wallet.publicKey!,
realm,
- client
- )
+ client,
+ );
- console.log('VERSION', programVersion)
+ console.info('Governance Program version:', programVersion);
switch (governanceType) {
case GovernanceType.Program: {
@@ -63,17 +63,19 @@ export const registerProgramGovernance = async (
tokenOwnerRecord,
walletPubkey,
governanceAuthority,
- voterWeight
- )
- break
+ voterWeight,
+ );
+ break;
}
default: {
- throw new Error(`Governance type ${governanceType} is not supported yet.`)
+ throw new Error(
+ `Governance type ${governanceType} is not supported yet.`,
+ );
}
}
- const transaction = new Transaction()
- transaction.add(...instructions)
+ const transaction = new Transaction();
+ transaction.add(...instructions);
await sendTransaction({
transaction,
wallet,
@@ -81,7 +83,7 @@ export const registerProgramGovernance = async (
signers,
sendingMessage: 'Creating treasury account',
successMessage: 'Treasury account has been created',
- })
+ });
- return governanceAddress
-}
+ return governanceAddress;
+};
diff --git a/actions/registerRealm.ts b/actions/registerRealm.ts
index 1ae3954f58..0dc86bf79b 100644
--- a/actions/registerRealm.ts
+++ b/actions/registerRealm.ts
@@ -4,8 +4,8 @@ import {
PublicKey,
Transaction,
TransactionInstruction,
-} from '@solana/web3.js'
-import BN from 'bn.js'
+} from '@solana/web3.js';
+import BN from 'bn.js';
import {
getTokenOwnerRecordAddress,
GovernanceConfig,
@@ -13,47 +13,47 @@ import {
SetRealmAuthorityAction,
VoteThresholdPercentage,
VoteTipping,
-} from '@solana/spl-governance'
-import { withCreateRealm } from '@solana/spl-governance'
-import { sendTransaction } from '../utils/send'
+} from '@solana/spl-governance';
+import { withCreateRealm } from '@solana/spl-governance';
+import { sendTransaction } from '../utils/send';
import {
sendTransactions,
SequenceType,
WalletSigner,
-} from 'utils/sendTransactions'
-import { withCreateMint } from '@tools/sdk/splToken/withCreateMint'
-import { withCreateAssociatedTokenAccount } from '@tools/sdk/splToken/withCreateAssociatedTokenAccount'
-import { withMintTo } from '@tools/sdk/splToken/withMintTo'
-import { chunks } from '@utils/helpers'
+} from 'utils/sendTransactions';
+import { withCreateMint } from '@tools/sdk/splToken/withCreateMint';
+import { withCreateAssociatedTokenAccount } from '@tools/sdk/splToken/withCreateAssociatedTokenAccount';
+import { withMintTo } from '@tools/sdk/splToken/withMintTo';
+import { chunks, BN_ZERO } from '@utils/helpers';
import {
SignerWalletAdapter,
WalletConnectionError,
-} from '@solana/wallet-adapter-base'
-import { withDepositGoverningTokens } from '@solana/spl-governance'
+} from '@solana/wallet-adapter-base';
+import { withDepositGoverningTokens } from '@solana/spl-governance';
import {
getMintNaturalAmountFromDecimalAsBN,
getTimestampFromDays,
-} from '@tools/sdk/units'
-import { withCreateMintGovernance } from '@solana/spl-governance'
-import { withSetRealmAuthority } from '@solana/spl-governance'
-import { AccountInfo, u64 } from '@solana/spl-token'
-import { ProgramAccount } from '@project-serum/common'
-import { tryGetAta } from '@utils/validations'
-import { ConnectionContext } from '@utils/connection'
-import { MIN_COMMUNITY_TOKENS_TO_CREATE_W_0_SUPPLY } from '@tools/constants'
-import BigNumber from 'bignumber.js'
+} from '@tools/sdk/units';
+import { withCreateMintGovernance } from '@solana/spl-governance';
+import { withSetRealmAuthority } from '@solana/spl-governance';
+import { AccountInfo, u64 } from '@solana/spl-token';
+import { tryGetAta } from '@utils/validations';
+import { ConnectionContext } from '@utils/connection';
+import { MIN_COMMUNITY_TOKENS_TO_CREATE_W_0_SUPPLY } from '@tools/constants';
+import BigNumber from 'bignumber.js';
+import { TokenProgramAccount } from '@utils/tokens';
interface RegisterRealmRpc {
- connection: ConnectionContext
- wallet: SignerWalletAdapter
- walletPubkey: PublicKey
+ connection: ConnectionContext;
+ wallet: SignerWalletAdapter;
+ walletPubkey: PublicKey;
}
/**
* The default amount of decimals for the community token
*/
-export const COMMUNITY_MINT_DECIMALS = 6
+export const COMMUNITY_MINT_DECIMALS = 6;
/**
* Prepares the mint instructions
@@ -74,18 +74,18 @@ async function prepareMintInstructions(
tokenDecimals = 0,
council = false,
mintPk?: PublicKey,
- otherOwners?: PublicKey[]
+ otherOwners?: PublicKey[],
) {
- console.debug('preparing mint instructions')
+ console.debug('preparing mint instructions');
- let _mintPk: PublicKey | undefined = undefined
- let walletAtaPk: PublicKey | undefined
- const mintInstructions: TransactionInstruction[] = []
- const mintSigners: Keypair[] = []
+ let _mintPk: PublicKey | undefined = undefined;
+ let walletAtaPk: PublicKey | undefined;
+ const mintInstructions: TransactionInstruction[] = [];
+ const mintSigners: Keypair[] = [];
const councilTokenAmount = new u64(
- new BigNumber(1).shiftedBy(tokenDecimals).toString()
- )
+ new BigNumber(1).shiftedBy(tokenDecimals).toString(),
+ );
if (!council || (council && otherOwners?.length)) {
// If mintPk is undefined, then
@@ -99,19 +99,17 @@ async function prepareMintInstructions(
walletPubkey,
null,
tokenDecimals,
- walletPubkey
- ))
+ walletPubkey,
+ ));
// If the array of other owners is not empty
// then should create mints to them
if (otherOwners?.length) {
for (const ownerPk of otherOwners) {
- const ata: ProgramAccount | undefined = await tryGetAta(
- connection.current,
- ownerPk,
- _mintPk
- )
- const shouldMint = !ata?.account.amount.gt(new BN(0))
+ const ata:
+ | TokenProgramAccount
+ | undefined = await tryGetAta(connection.current, ownerPk, _mintPk);
+ const shouldMint = !ata?.account.amount.gt(BN_ZERO);
const ataPk =
ata?.publicKey ??
@@ -119,31 +117,31 @@ async function prepareMintInstructions(
mintInstructions,
_mintPk,
ownerPk,
- walletPubkey
- ))
+ walletPubkey,
+ ));
// Mint 1 token to each owner
if (shouldMint && ataPk) {
- console.debug('will mint to ', { ataPk })
+ console.debug('will mint to ', { ataPk });
await withMintTo(
mintInstructions,
_mintPk,
ataPk,
walletPubkey,
- councilTokenAmount
- )
+ councilTokenAmount,
+ );
}
if (ownerPk.equals(walletPubkey)) {
- walletAtaPk = ataPk
+ walletAtaPk = ataPk;
}
}
}
}
- const instructionChunks = chunks(mintInstructions, 10)
- const signersChunks = Array(instructionChunks.length).fill([])
- signersChunks[0] = mintSigners
+ const instructionChunks = chunks(mintInstructions, 10);
+ const signersChunks = Array(instructionChunks.length).fill([]);
+ signersChunks[0] = mintSigners;
return {
mintPk: _mintPk,
walletAtaPk,
@@ -167,7 +165,7 @@ async function prepareMintInstructions(
* Amount of tokens minted to the council members
*/
councilTokenAmount,
- }
+ };
}
/**
@@ -178,17 +176,17 @@ async function prepareMintInstructions(
function createGovernanceConfig(
yesVoteThreshold = 60,
tokenDecimals?: number,
- minCommunityTokensToCreateGovernance?: string
+ minCommunityTokensToCreateGovernance?: string,
): GovernanceConfig {
- console.debug('mounting governance config')
+ console.debug('mounting governance config');
const minCommunityTokensToCreateAsMintValue = getMintNaturalAmountFromDecimalAsBN(
minCommunityTokensToCreateGovernance &&
+minCommunityTokensToCreateGovernance > 0
? +minCommunityTokensToCreateGovernance
: MIN_COMMUNITY_TOKENS_TO_CREATE_W_0_SUPPLY,
- tokenDecimals ?? COMMUNITY_MINT_DECIMALS
- )
+ tokenDecimals ?? COMMUNITY_MINT_DECIMALS,
+ );
// Put community and council mints under the realm governance with default config
return new GovernanceConfig({
@@ -203,7 +201,7 @@ function createGovernanceConfig(
voteTipping: VoteTipping.Strict,
proposalCoolOffTime: 0,
minCouncilTokensToCreateProposal: new BN(1),
- })
+ });
}
/**
@@ -229,18 +227,18 @@ async function prepareGovernanceInstructions(
realmPk: PublicKey,
tokenOwnerRecordPk: PublicKey,
realmInstructions: TransactionInstruction[],
- transferAuthority?: boolean
+ transferAuthority?: boolean,
) {
- console.debug('Preparing governance instructions')
+ console.debug('Preparing governance instructions');
const config = createGovernanceConfig(
yesVoteThreshold,
communityTokenDecimals,
- minCommunityTokensToCreateGovernance
- )
+ minCommunityTokensToCreateGovernance,
+ );
if (transferAuthority) {
- console.debug('transfer community mint authority')
+ console.debug('transfer community mint authority');
const communityMintGovPk = await withCreateMintGovernance(
realmInstructions,
programId,
@@ -252,8 +250,8 @@ async function prepareGovernanceInstructions(
walletPubkey,
tokenOwnerRecordPk,
walletPubkey,
- walletPubkey
- )
+ walletPubkey,
+ );
// Set the community governance as the realm authority
withSetRealmAuthority(
@@ -263,8 +261,8 @@ async function prepareGovernanceInstructions(
realmPk,
walletPubkey,
communityMintGovPk,
- SetRealmAuthorityAction.SetChecked
- )
+ SetRealmAuthorityAction.SetChecked,
+ );
}
if (councilMintPk)
@@ -280,8 +278,8 @@ async function prepareGovernanceInstructions(
walletPubkey,
tokenOwnerRecordPk,
walletPubkey,
- walletPubkey
- )
+ walletPubkey,
+ );
}
/**
@@ -302,21 +300,21 @@ function sendTransactionFactory(
councilSignersChunks: Keypair[][],
realmInstructions: TransactionInstruction[],
communityMintInstructions?: TransactionInstruction[],
- communityMintSigners?: Keypair[]
+ communityMintSigners?: Keypair[],
) {
- console.debug('factoring sendtransaction')
+ console.debug('factoring sendtransaction');
- const instructions: TransactionInstruction[][] = [realmInstructions]
- const signerSets: Keypair[][] = [[]]
+ const instructions: TransactionInstruction[][] = [realmInstructions];
+ const signerSets: Keypair[][] = [[]];
if (councilMembersChunks.length) {
- instructions.unshift(...councilMembersChunks)
- signerSets.unshift(...councilSignersChunks)
+ instructions.unshift(...councilMembersChunks);
+ signerSets.unshift(...councilSignersChunks);
}
if (communityMintInstructions && communityMintSigners) {
- instructions.unshift(communityMintInstructions)
- signerSets.unshift(communityMintSigners)
+ instructions.unshift(communityMintInstructions);
+ signerSets.unshift(communityMintSigners);
}
if (instructions.length > 1) {
@@ -325,12 +323,12 @@ function sendTransactionFactory(
wallet,
instructions,
signerSets,
- SequenceType.Sequential
- )
+ SequenceType.Sequential,
+ );
} else {
- const transaction = new Transaction()
- transaction.add(...realmInstructions)
- return sendTransaction({ transaction, wallet, connection })
+ const transaction = new Transaction();
+ transaction.add(...realmInstructions);
+ return sendTransaction({ transaction, wallet, connection });
}
}
@@ -370,12 +368,12 @@ export async function registerRealm(
transferAuthority = true,
communityMintTokenDecimals?: number,
councilMintTokenDecimals?: number,
- councilWalletPks?: PublicKey[]
+ councilWalletPks?: PublicKey[],
): Promise {
- if (!wallet) throw WalletConnectionError
- console.debug('starting register realm')
+ if (!wallet) throw WalletConnectionError;
+ console.debug('starting register realm');
- const realmInstructions: TransactionInstruction[] = []
+ const realmInstructions: TransactionInstruction[] = [];
const {
mintPk: councilMintPk,
@@ -389,36 +387,36 @@ export async function registerRealm(
councilMintTokenDecimals,
true,
councilMint,
- councilWalletPks
- )
+ councilWalletPks,
+ );
let communityMintInstructions:
| TransactionInstruction[]
- | undefined = undefined
- let communityMintPk: PublicKey | undefined = communityMint
- let communityMintSigners: Keypair[] | undefined = undefined
+ | undefined = undefined;
+ let communityMintPk: PublicKey | undefined = communityMint;
+ let communityMintSigners: Keypair[] | undefined = undefined;
// If user doens't provides a community mint, we'll generate it
if (!communityMint) {
const communityDetails = await prepareMintInstructions(
connection,
walletPubkey,
- COMMUNITY_MINT_DECIMALS
- )
- communityMintInstructions = communityDetails.mintInstructions
- communityMintPk = communityDetails.mintPk
- communityMintSigners = communityDetails.mintSigners
+ COMMUNITY_MINT_DECIMALS,
+ );
+ communityMintInstructions = communityDetails.mintInstructions;
+ communityMintPk = communityDetails.mintPk;
+ communityMintSigners = communityDetails.mintSigners;
}
- if (!communityMintPk) throw new Error('Invalid community mint public key.')
+ if (!communityMintPk) throw new Error('Invalid community mint public key.');
const _minCommunityTokensToCreateGovernance = getMintNaturalAmountFromDecimalAsBN(
minCommunityTokensToCreateGovernance &&
+minCommunityTokensToCreateGovernance > 0
? +minCommunityTokensToCreateGovernance
: MIN_COMMUNITY_TOKENS_TO_CREATE_W_0_SUPPLY,
- communityMintTokenDecimals ?? COMMUNITY_MINT_DECIMALS
- )
+ communityMintTokenDecimals ?? COMMUNITY_MINT_DECIMALS,
+ );
const realmAddress = await withCreateRealm(
realmInstructions,
@@ -431,10 +429,10 @@ export async function registerRealm(
councilMintPk,
communityMintMaxVoteWeightSource,
_minCommunityTokensToCreateGovernance,
- undefined
- )
+ undefined,
+ );
- let tokenOwnerRecordPk: PublicKey | undefined = undefined
+ let tokenOwnerRecordPk: PublicKey | undefined = undefined;
// If the current wallet is in the team then deposit the council token
if (councilMintPk) {
@@ -444,8 +442,8 @@ export async function registerRealm(
programId,
realmAddress,
councilMintPk,
- walletPubkey
- )
+ walletPubkey,
+ );
await withDepositGoverningTokens(
realmInstructions,
@@ -457,12 +455,12 @@ export async function registerRealm(
walletPubkey,
walletPubkey,
walletPubkey,
- councilTokenAmount
- )
+ councilTokenAmount,
+ );
} else {
// Let's throw for now if the current wallet isn't in the team
// TODO: To fix it we would have to make it temp. as part of the team and then remove after the realm is created
- throw new Error('Current wallet must be in the team')
+ throw new Error('Current wallet must be in the team');
}
}
@@ -481,8 +479,8 @@ export async function registerRealm(
realmAddress,
tokenOwnerRecordPk,
realmInstructions,
- transferAuthority
- )
+ transferAuthority,
+ );
}
const txnToSend = sendTransactionFactory(
@@ -492,14 +490,14 @@ export async function registerRealm(
councilSignersChunks,
realmInstructions,
communityMintInstructions,
- communityMintSigners
- )
- console.debug('sending transaction')
- await txnToSend
- console.debug('transaction sent')
+ communityMintSigners,
+ );
+ console.debug('sending transaction');
+ await txnToSend;
+ console.debug('transaction sent');
console.debug({
communityMintPk,
councilMintPk,
- })
- return realmAddress
+ });
+ return realmAddress;
}
diff --git a/actions/relinquishVote.ts b/actions/relinquishVote.ts
deleted file mode 100644
index e20cf73472..0000000000
--- a/actions/relinquishVote.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import {
- Keypair,
- PublicKey,
- Transaction,
- TransactionInstruction,
-} from '@solana/web3.js'
-
-import { Proposal } from '@solana/spl-governance'
-import { RpcContext } from '@solana/spl-governance'
-import { ProgramAccount } from '@solana/spl-governance'
-import { sendTransaction } from '../utils/send'
-import { withRelinquishVote } from '@solana/spl-governance'
-
-export const relinquishVote = async (
- { connection, wallet, programId, walletPubkey }: RpcContext,
- proposal: ProgramAccount,
- tokenOwnerRecord: PublicKey,
- voteRecord: PublicKey,
- instructions: TransactionInstruction[] = []
-) => {
- const signers: Keypair[] = []
-
- const governanceAuthority = walletPubkey
- const beneficiary = walletPubkey
-
- withRelinquishVote(
- instructions,
- programId,
- proposal.account.governance,
- proposal.pubkey,
- tokenOwnerRecord,
- proposal.account.governingTokenMint,
- voteRecord,
- governanceAuthority,
- beneficiary
- )
-
- const transaction = new Transaction()
- transaction.add(...instructions)
-
- await sendTransaction({ transaction, wallet, connection, signers })
-}
diff --git a/actions/relinquishVotes.ts b/actions/relinquishVotes.ts
new file mode 100644
index 0000000000..da1eb30bf4
--- /dev/null
+++ b/actions/relinquishVotes.ts
@@ -0,0 +1,53 @@
+import {
+ Keypair,
+ PublicKey,
+ Transaction,
+ TransactionInstruction,
+} from '@solana/web3.js';
+
+import { Proposal } from '@solana/spl-governance';
+import { RpcContext } from '@solana/spl-governance';
+import { ProgramAccount } from '@solana/spl-governance';
+import { sendTransaction } from '../utils/send';
+import { withRelinquishVote } from '@solana/spl-governance';
+
+export default async ({
+ rpcContext: { connection, wallet, programId, walletPubkey },
+ proposal,
+ records,
+ instructions = [],
+}: {
+ rpcContext: RpcContext;
+ proposal: ProgramAccount;
+
+ records: {
+ tokenOwnerRecord: PublicKey;
+ voteRecord: PublicKey;
+ }[];
+
+ instructions: TransactionInstruction[];
+}) => {
+ const signers: Keypair[] = [];
+
+ const governanceAuthority = walletPubkey;
+ const beneficiary = walletPubkey;
+
+ for (const record of records) {
+ withRelinquishVote(
+ instructions,
+ programId,
+ proposal.account.governance,
+ proposal.pubkey,
+ record.tokenOwnerRecord,
+ proposal.account.governingTokenMint,
+ record.voteRecord,
+ governanceAuthority,
+ beneficiary,
+ );
+ }
+
+ const transaction = new Transaction();
+ transaction.add(...instructions);
+
+ await sendTransaction({ transaction, wallet, connection, signers });
+};
diff --git a/actions/signOffProposal.ts b/actions/signOffProposal.ts
index 551bd23270..0bed98cadf 100644
--- a/actions/signOffProposal.ts
+++ b/actions/signOffProposal.ts
@@ -3,33 +3,33 @@ import {
PublicKey,
Transaction,
TransactionInstruction,
-} from '@solana/web3.js'
+} from '@solana/web3.js';
import {
getGovernanceProgramVersion,
Proposal,
RpcContext,
-} from '@solana/spl-governance'
-import { SignatoryRecord } from '@solana/spl-governance'
-import { ProgramAccount } from '@solana/spl-governance'
-import { sendTransaction } from 'utils/send'
-import { withSignOffProposal } from '@solana/spl-governance'
+} from '@solana/spl-governance';
+import { SignatoryRecord } from '@solana/spl-governance';
+import { ProgramAccount } from '@solana/spl-governance';
+import { sendTransaction } from 'utils/send';
+import { withSignOffProposal } from '@solana/spl-governance';
export const signOffProposal = async (
{ connection, wallet, programId }: RpcContext,
realmPk: PublicKey,
proposal: ProgramAccount,
- signatoryRecord: ProgramAccount
+ signatoryRecord: ProgramAccount,
) => {
- const instructions: TransactionInstruction[] = []
- const signers: Keypair[] = []
+ const instructions: TransactionInstruction[] = [];
+ const signers: Keypair[] = [];
// Explicitly request the version before making RPC calls to work around race conditions in resolving
// the version for RealmInfo
const programVersion = await getGovernanceProgramVersion(
connection,
- programId
- )
+ programId,
+ );
withSignOffProposal(
instructions,
@@ -40,12 +40,12 @@ export const signOffProposal = async (
proposal.pubkey,
signatoryRecord.account.signatory,
signatoryRecord?.pubkey,
- undefined
- )
+ undefined,
+ );
- const transaction = new Transaction()
+ const transaction = new Transaction();
- transaction.add(...instructions)
+ transaction.add(...instructions);
await sendTransaction({
transaction,
@@ -54,5 +54,5 @@ export const signOffProposal = async (
signers,
sendingMessage: 'Signing off proposal',
successMessage: 'Proposal signed off',
- })
-}
+ });
+};
diff --git a/components/AddMemberIcon.tsx b/components/AddMemberIcon.tsx
index d29a72a6e7..ac4b9b589a 100644
--- a/components/AddMemberIcon.tsx
+++ b/components/AddMemberIcon.tsx
@@ -37,7 +37,7 @@ const AddMemberIcon = ({ className }) => {
strokeLinejoin="round"
/>
- )
-}
+ );
+};
-export default AddMemberIcon
+export default AddMemberIcon;
diff --git a/components/AdditionalProposalOptions.tsx b/components/AdditionalProposalOptions.tsx
index 00c02ccef6..9b827517a6 100644
--- a/components/AdditionalProposalOptions.tsx
+++ b/components/AdditionalProposalOptions.tsx
@@ -1,10 +1,10 @@
-import { ChevronDownIcon } from '@heroicons/react/outline'
-import useRealm from '@hooks/useRealm'
-import VoteBySwitch from 'pages/dao/[symbol]/proposal/components/VoteBySwitch'
-import { useState } from 'react'
-import { LinkButton } from './Button'
-import Input from './inputs/Input'
-import Textarea from './inputs/Textarea'
+import { ChevronDownIcon } from '@heroicons/react/outline';
+import useRealm from '@hooks/useRealm';
+import VoteBySwitch from 'pages/dao/[symbol]/proposal/components/VoteBySwitch';
+import { useState } from 'react';
+import { LinkButton } from './Button';
+import Input from './inputs/Input';
+import Textarea from './inputs/Textarea';
const AdditionalProposalOptions = ({
title,
@@ -15,16 +15,16 @@ const AdditionalProposalOptions = ({
voteByCouncil,
setVoteByCouncil,
}: {
- title: string
- description: string
- setTitle: (evt) => void
- setDescription: (evt) => void
- defaultTitle: string
- voteByCouncil: boolean
- setVoteByCouncil: (val) => void
+ title: string;
+ description: string;
+ setTitle: (evt) => void;
+ setDescription: (evt) => void;
+ defaultTitle: string;
+ voteByCouncil: boolean;
+ setVoteByCouncil: (val) => void;
}) => {
- const [showOptions, setShowOptions] = useState(false)
- const { canChooseWhoVote } = useRealm()
+ const [showOptions, setShowOptions] = useState(false);
+ const { canChooseWhoVote } = useRealm();
return (
<>
{
- setVoteByCouncil(!voteByCouncil)
+ setVoteByCouncil(!voteByCouncil);
}}
/>
)}
)}
>
- )
-}
+ );
+};
-export default AdditionalProposalOptions
+export default AdditionalProposalOptions;
diff --git a/components/ApprovalQuorum.tsx b/components/ApprovalQuorum.tsx
index 4335bd5b30..f88dc118ee 100644
--- a/components/ApprovalQuorum.tsx
+++ b/components/ApprovalQuorum.tsx
@@ -1,14 +1,14 @@
-import Tooltip from './Tooltip'
+import Tooltip from './Tooltip';
import {
CheckCircleIcon,
InformationCircleIcon,
-} from '@heroicons/react/outline'
+} from '@heroicons/react/outline';
type ApprovalProgressProps = {
- progress: number
- showBg?: boolean
- yesVotesRequired: number
-}
+ progress: number;
+ showBg?: boolean;
+ yesVotesRequired: number;
+};
const ApprovalProgress = ({
progress,
@@ -31,7 +31,7 @@ const ApprovalProgress = ({
undefined,
{
maximumFractionDigits: 0,
- }
+ },
)} ${progress > 0 ? 'more' : ''} Yes vote${
yesVotesRequired > 1 ? 's' : ''
} required`}
@@ -58,7 +58,7 @@ const ApprovalProgress = ({
{/* ) : null} */}
- )
-}
+ );
+};
-export default ApprovalProgress
+export default ApprovalProgress;
diff --git a/components/AssetsList/AssetItem.tsx b/components/AssetsList/AssetItem.tsx
index 375ed362bf..cfcc30dfe1 100644
--- a/components/AssetsList/AssetItem.tsx
+++ b/components/AssetsList/AssetItem.tsx
@@ -1,52 +1,52 @@
-import { useEffect, useState } from 'react'
-import { ExternalLinkIcon, TerminalIcon } from '@heroicons/react/outline'
-import { ProgramAccount } from '@solana/spl-governance'
-import { Governance } from '@solana/spl-governance'
-import { getProgramName } from '@components/instructions/programs/names'
-import { abbreviateAddress } from '@utils/formatting'
-import { PublicKey } from '@solana/web3.js'
-import Button, { SecondaryButton } from '@components/Button'
-import Tooltip from '@components/Tooltip'
-import useWalletStore from 'stores/useWalletStore'
-import { getProgramSlot } from '@tools/sdk/bpfUpgradeableLoader/accounts'
-import useGovernanceAssets from '@hooks/useGovernanceAssets'
-import Modal from '@components/Modal'
-import UpgradeProgram from './UpgradeProgram'
-import CloseBuffers from './CloseBuffers'
-import { getExplorerUrl } from '@components/explorer/tools'
+import { useEffect, useState } from 'react';
+import { ExternalLinkIcon, TerminalIcon } from '@heroicons/react/outline';
+import { ProgramAccount } from '@solana/spl-governance';
+import { Governance } from '@solana/spl-governance';
+import { getProgramName } from '@components/instructions/programs/names';
+import { abbreviateAddress } from '@utils/formatting';
+import { PublicKey } from '@solana/web3.js';
+import Button, { SecondaryButton } from '@components/Button';
+import Tooltip from '@components/Tooltip';
+import useWalletStore from 'stores/useWalletStore';
+import { getProgramSlot } from '@tools/sdk/bpfUpgradeableLoader/accounts';
+import useGovernanceAssets from '@hooks/useGovernanceAssets';
+import Modal from '@components/Modal';
+import UpgradeProgram from './UpgradeProgram';
+import CloseBuffers from './CloseBuffers';
+import { getExplorerUrl } from '@components/explorer/tools';
const AssetItem = ({
item,
panelView,
}: {
- item: ProgramAccount
- panelView?: boolean
+ item: ProgramAccount;
+ panelView?: boolean;
}) => {
- const { canUseProgramUpgradeInstruction } = useGovernanceAssets()
- const [slot, setSlot] = useState(0)
- const [openUpgradeModal, setOpenUpgradeModal] = useState(false)
- const [openCloseBuffersModal, setOpenCloseBuffersModal] = useState(false)
- const [loadSlot, setLoadSlot] = useState(false)
- const connection = useWalletStore((s) => s.connection)
- const name = item ? getProgramName(item.account.governedAccount) : ''
+ const { canUseProgramUpgradeInstruction } = useGovernanceAssets();
+ const [slot, setSlot] = useState(0);
+ const [openUpgradeModal, setOpenUpgradeModal] = useState(false);
+ const [openCloseBuffersModal, setOpenCloseBuffersModal] = useState(false);
+ const [loadSlot, setLoadSlot] = useState(false);
+ const connection = useWalletStore((s) => s.connection);
+ const name = item ? getProgramName(item.account.governedAccount) : '';
const governedAccount = item
? abbreviateAddress(item?.account.governedAccount as PublicKey)
- : ''
- const programId = item!.account.governedAccount.toBase58()
+ : '';
+ const programId = item!.account.governedAccount.toBase58();
useEffect(() => {
const handleSetProgramVersion = async () => {
try {
- setLoadSlot(true)
- const slot = await getProgramSlot(connection.current, programId)
- setSlot(slot)
+ setLoadSlot(true);
+ const slot = await getProgramSlot(connection.current, programId);
+ setSlot(slot);
} catch (e) {
- console.log(e)
+ console.error(e);
}
- setLoadSlot(false)
- }
- handleSetProgramVersion()
- }, [JSON.stringify(item)])
+ setLoadSlot(false);
+ };
+ handleSetProgramVersion();
+ }, [JSON.stringify(item)]);
return (
@@ -62,7 +62,7 @@ const AssetItem = ({
className="default-transition flex items-center mt-0.5 text-fgd-3 hover:text-fgd-2 text-xs"
href={getExplorerUrl(
connection.endpoint,
- item?.account.governedAccount
+ item?.account.governedAccount,
)}
target="_blank"
rel="noopener noreferrer"
@@ -122,7 +122,7 @@ const AssetItem = ({
{openUpgradeModal && (
{
- setOpenUpgradeModal(false)
+ setOpenUpgradeModal(false);
}}
isOpen={openUpgradeModal}
>
@@ -132,7 +132,7 @@ const AssetItem = ({
{openCloseBuffersModal && (
{
- setOpenCloseBuffersModal(false)
+ setOpenCloseBuffersModal(false);
}}
isOpen={openCloseBuffersModal}
>
@@ -140,7 +140,7 @@ const AssetItem = ({
)}
- )
-}
+ );
+};
-export default AssetItem
+export default AssetItem;
diff --git a/components/AssetsList/AssetsCompactWrapper.tsx b/components/AssetsList/AssetsCompactWrapper.tsx
index 384038f291..064e2b463d 100644
--- a/components/AssetsList/AssetsCompactWrapper.tsx
+++ b/components/AssetsList/AssetsCompactWrapper.tsx
@@ -1,15 +1,15 @@
-import React from 'react'
-import AssetsList from './AssetsList'
-import { ChevronRightIcon } from '@heroicons/react/solid'
-import useRealm from '@hooks/useRealm'
-import useQueryContext from '@hooks/useQueryContext'
-import { useRouter } from 'next/router'
-import { LinkButton } from '@components/Button'
+import React from 'react';
+import AssetsList from './AssetsList';
+import { ChevronRightIcon } from '@heroicons/react/solid';
+import useRealm from '@hooks/useRealm';
+import useQueryContext from '@hooks/useQueryContext';
+import { useRouter } from 'next/router';
+import { LinkButton } from '@components/Button';
const AssetsCompactWrapper = () => {
- const router = useRouter()
- const { symbol } = useRealm()
- const { fmtUrlWithCluster } = useQueryContext()
+ const router = useRouter();
+ const { symbol } = useRealm();
+ const { fmtUrlWithCluster } = useQueryContext();
return (
@@ -18,8 +18,8 @@ const AssetsCompactWrapper = () => {
{
- const url = fmtUrlWithCluster(`/dao/${symbol}/assets`)
- router.push(url)
+ const url = fmtUrlWithCluster(`/dao/${symbol}/assets`);
+ router.push(url);
}}
>
View
@@ -30,7 +30,6 @@ const AssetsCompactWrapper = () => {
- )
-}
-
-export default AssetsCompactWrapper
+ );
+};
+export default AssetsCompactWrapper;
diff --git a/components/AssetsList/AssetsList.tsx b/components/AssetsList/AssetsList.tsx
index 5bc3ca6297..60ba0cfe33 100644
--- a/components/AssetsList/AssetsList.tsx
+++ b/components/AssetsList/AssetsList.tsx
@@ -1,17 +1,17 @@
-import AssetItem from './AssetItem'
-import useGovernanceAssets from '@hooks/useGovernanceAssets'
-import { GovernanceAccountType } from '@solana/spl-governance'
+import AssetItem from './AssetItem';
+import useGovernanceAssets from '@hooks/useGovernanceAssets';
+import { GovernanceAccountType } from '@solana/spl-governance';
interface AssetsListProps {
- panelView?: boolean
+ panelView?: boolean;
}
const AssetsList = ({ panelView }: AssetsListProps) => {
- const { getGovernancesByAccountTypes } = useGovernanceAssets()
+ const { getGovernancesByAccountTypes } = useGovernanceAssets();
const programGovernances = getGovernancesByAccountTypes([
GovernanceAccountType.ProgramGovernanceV1,
GovernanceAccountType.ProgramGovernanceV2,
- ])
+ ]);
return !panelView ? (
{programGovernances.map((x) => (
@@ -24,6 +24,6 @@ const AssetsList = ({ panelView }: AssetsListProps) => {
))}
- )
-}
-export default AssetsList
+ );
+};
+export default AssetsList;
diff --git a/components/AssetsList/BaseGovernanceForm.tsx b/components/AssetsList/BaseGovernanceForm.tsx
index 96d5025417..192f17fbc9 100644
--- a/components/AssetsList/BaseGovernanceForm.tsx
+++ b/components/AssetsList/BaseGovernanceForm.tsx
@@ -1,6 +1,6 @@
-import Input from '@components/inputs/Input'
-import AmountSlider from '@components/Slider'
-import useRealm from '@hooks/useRealm'
+import Input from '@components/inputs/Input';
+import AmountSlider from '@components/Slider';
+import useRealm from '@hooks/useRealm';
import {
fmtPercentage,
getMintMinAmountAsDecimal,
@@ -8,86 +8,86 @@ import {
getMintSupplyFractionAsDecimalPercentage,
getMintSupplyPercentageAsDecimal,
parseMintNaturalAmountFromDecimal,
-} from '@tools/sdk/units'
-import BigNumber from 'bignumber.js'
-import React, { useEffect, useState } from 'react'
+} from '@tools/sdk/units';
+import BigNumber from 'bignumber.js';
+import React, { useEffect, useState } from 'react';
export interface BaseGovernanceFormFields {
- minCommunityTokensToCreateProposal: number
- minInstructionHoldUpTime: number
- maxVotingTime: number
- voteThreshold: number
+ minCommunityTokensToCreateProposal: number;
+ minInstructionHoldUpTime: number;
+ maxVotingTime: number;
+ voteThreshold: number;
}
const BaseGovernanceForm = ({ formErrors, form, setForm, setFormErrors }) => {
- const { realmInfo, mint: realmMint } = useRealm()
+ const { realmInfo, mint: realmMint } = useRealm();
const [minTokensPercentage, setMinTokensPercentage] = useState<
number | undefined
- >()
+ >();
const handleSetForm = ({ propertyName, value }) => {
- setFormErrors({})
- setForm({ ...form, [propertyName]: value })
- }
+ setFormErrors({});
+ setForm({ ...form, [propertyName]: value });
+ };
const validateMinMax = (e) => {
- const fieldName = e.target.name
- const min = e.target.min || 0
- const max = e.target.max || Number.MAX_SAFE_INTEGER
- const value = form[fieldName]
- const currentPrecision = new BigNumber(min).decimalPlaces()
+ const fieldName = e.target.name;
+ const min = e.target.min || 0;
+ const max = e.target.max || Number.MAX_SAFE_INTEGER;
+ const value = form[fieldName];
+ const currentPrecision = new BigNumber(min).decimalPlaces();
handleSetForm({
value: parseFloat(
Math.max(Number(min), Math.min(Number(max), Number(value))).toFixed(
- currentPrecision
- )
+ currentPrecision,
+ ),
),
propertyName: fieldName,
- })
- }
+ });
+ };
function parseMinTokensToCreateProposal(
value: string | number,
- mintDecimals: number
+ mintDecimals: number,
) {
return typeof value === 'string'
? parseMintNaturalAmountFromDecimal(value, mintDecimals)
- : getMintNaturalAmountFromDecimal(value, mintDecimals)
+ : getMintNaturalAmountFromDecimal(value, mintDecimals);
}
const onMinTokensChange = (minTokensToCreateProposal: number | string) => {
const minTokens = realmMint
? parseMinTokensToCreateProposal(
minTokensToCreateProposal,
- realmMint.decimals
+ realmMint.decimals,
)
- : 0
- setMinTokensPercentage(getMinTokensPercentage(minTokens))
- }
+ : 0;
+ setMinTokensPercentage(getMinTokensPercentage(minTokens));
+ };
const getMinTokensPercentage = (amount: number) =>
- realmMint ? getMintSupplyFractionAsDecimalPercentage(realmMint, amount) : 0
+ realmMint ? getMintSupplyFractionAsDecimalPercentage(realmMint, amount) : 0;
// Use 1% of mint supply as the default value for minTokensToCreateProposal and the default increment step in the input editor
const mintSupply1Percent = realmMint
? getMintSupplyPercentageAsDecimal(realmMint, 1)
- : 100
+ : 100;
const minTokenAmount = realmMint
? getMintMinAmountAsDecimal(realmMint)
- : 0.0001
+ : 0.0001;
// If the supply is small and 1% is below the minimum mint amount then coerce to the minimum value
- const minTokenStep = Math.max(mintSupply1Percent, minTokenAmount)
+ const minTokenStep = Math.max(mintSupply1Percent, minTokenAmount);
const getSupplyPercent = () => {
const hasMinTokensPercentage =
- !!minTokensPercentage && !isNaN(minTokensPercentage)
+ !!minTokensPercentage && !isNaN(minTokensPercentage);
const percent =
hasMinTokensPercentage && minTokensPercentage
? fmtPercentage(minTokensPercentage)
- : ''
- return hasMinTokensPercentage && {`${percent} of token supply`}
- }
+ : '';
+ return hasMinTokensPercentage && {`${percent} of token supply`}
;
+ };
useEffect(() => {
- onMinTokensChange(form.minCommunityTokensToCreateProposal)
- }, [form.minCommunityTokensToCreateProposal, realmInfo?.symbol])
+ onMinTokensChange(form.minCommunityTokensToCreateProposal);
+ }, [form.minCommunityTokensToCreateProposal, realmInfo?.symbol]);
return (
<>
@@ -163,12 +163,12 @@ const BaseGovernanceForm = ({ formErrors, form, setForm, setFormErrors }) => {
handleSetForm({
value: $e,
propertyName: 'voteThreshold',
- })
+ });
}}
/>
>
- )
-}
+ );
+};
-export default BaseGovernanceForm
+export default BaseGovernanceForm;
diff --git a/components/AssetsList/CloseBuffers.tsx b/components/AssetsList/CloseBuffers.tsx
index 2e5b08fcf5..6be5174720 100644
--- a/components/AssetsList/CloseBuffers.tsx
+++ b/components/AssetsList/CloseBuffers.tsx
@@ -1,65 +1,65 @@
-import { ExternalLinkIcon } from '@heroicons/react/outline'
-import { ChevronDownIcon } from '@heroicons/react/solid'
-import { AccountInfo, ParsedAccountData, PublicKey } from '@solana/web3.js'
-import useRealm from 'hooks/useRealm'
-import Input from 'components/inputs/Input'
-import Button, { LinkButton } from '@components/Button'
-import Textarea from 'components/inputs/Textarea'
-import VoteBySwitch from 'pages/dao/[symbol]/proposal/components/VoteBySwitch'
-import useWalletStore from 'stores/useWalletStore'
-import { getValidatedPublickKey } from 'utils/validations'
-import { useEffect, useState } from 'react'
-import { UiInstruction } from 'utils/uiTypes/proposalCreationTypes'
-import { serializeInstructionToBase64 } from '@solana/spl-governance'
-import { useRouter } from 'next/router'
-import { notify } from 'utils/notifications'
-import useQueryContext from 'hooks/useQueryContext'
-import { validateInstruction } from 'utils/instructionTools'
-import * as yup from 'yup'
-import { BPF_UPGRADE_LOADER_ID, GovernedProgramAccount } from '@utils/tokens'
-import Loading from '@components/Loading'
-import useCreateProposal from '@hooks/useCreateProposal'
-import { getExplorerUrl } from '@components/explorer/tools'
-import { InstructionDataWithHoldUpTime } from 'actions/createProposal'
-import { createCloseBuffer } from '@tools/sdk/bpfUpgradeableLoader/createCloseBuffer'
-import { abbreviateAddress } from '@utils/formatting'
-import useGovernanceAssets from '@hooks/useGovernanceAssets'
-import { Governance, ProgramAccount } from '@solana/spl-governance'
+import { ExternalLinkIcon } from '@heroicons/react/outline';
+import { ChevronDownIcon } from '@heroicons/react/solid';
+import { AccountInfo, ParsedAccountData, PublicKey } from '@solana/web3.js';
+import useRealm from 'hooks/useRealm';
+import Input from 'components/inputs/Input';
+import Button, { LinkButton } from '@components/Button';
+import Textarea from 'components/inputs/Textarea';
+import VoteBySwitch from 'pages/dao/[symbol]/proposal/components/VoteBySwitch';
+import useWalletStore from 'stores/useWalletStore';
+import { getValidatedPublickKey } from 'utils/validations';
+import { useEffect, useState } from 'react';
+import { FormInstructionData } from 'utils/uiTypes/proposalCreationTypes';
+import { serializeInstructionToBase64 } from '@solana/spl-governance';
+import { useRouter } from 'next/router';
+import { notify } from 'utils/notifications';
+import useQueryContext from 'hooks/useQueryContext';
+import { validateInstruction } from 'utils/instructionTools';
+import * as yup from 'yup';
+import { BPF_UPGRADE_LOADER_ID, GovernedProgramAccount } from '@utils/tokens';
+import Loading from '@components/Loading';
+import useCreateProposal from '@hooks/useCreateProposal';
+import { getExplorerUrl } from '@components/explorer/tools';
+import { InstructionDataWithHoldUpTime } from 'actions/createProposal';
+import { createCloseBuffer } from '@tools/sdk/bpfUpgradeableLoader/createCloseBuffer';
+import { abbreviateAddress } from '@utils/formatting';
+import useGovernanceAssets from '@hooks/useGovernanceAssets';
+import { Governance, ProgramAccount } from '@solana/spl-governance';
interface CloseBuffersForm {
- governedAccount: GovernedProgramAccount | undefined
- programId: string | undefined
- solReceiverAddress: string
- description: string
- title: string
+ governedAccount: GovernedProgramAccount | undefined;
+ programId: string | undefined;
+ solReceiverAddress: string;
+ description: string;
+ title: string;
}
const CloseBuffers = ({ program }: { program: ProgramAccount }) => {
- const { handleCreateProposal } = useCreateProposal()
- const { governedTokenAccountsWithoutNfts } = useGovernanceAssets()
- const router = useRouter()
- const connection = useWalletStore((s) => s.connection)
- const wallet = useWalletStore((s) => s.current)
+ const { handleCreateProposal } = useCreateProposal();
+ const { governedTokenAccountsWithoutNfts } = useGovernanceAssets();
+ const router = useRouter();
+ const connection = useWalletStore((s) => s.connection);
+ const wallet = useWalletStore((s) => s.current);
const governedAccount = {
governance: program!,
- }
- const { fmtUrlWithCluster } = useQueryContext()
- const { symbol } = router.query
- const { realmInfo, canChooseWhoVote, realm } = useRealm()
- const [isBuffersLoading, setIsBuffersLoading] = useState(false)
- const programId: PublicKey | undefined = realmInfo?.programId
+ };
+ const { fmtUrlWithCluster } = useQueryContext();
+ const { symbol } = router.query;
+ const { realmInfo, canChooseWhoVote, realm } = useRealm();
+ const [isBuffersLoading, setIsBuffersLoading] = useState(false);
+ const programId: PublicKey | undefined = realmInfo?.programId;
const [buffers, setBuffers] = useState<
{
- pubkey: PublicKey
- account: AccountInfo
+ pubkey: PublicKey;
+ account: AccountInfo;
}[]
- >([])
+ >([]);
const highestLampartsAmountInGovernedTokenAccounts = Math.max(
...governedTokenAccountsWithoutNfts
.filter((x) => x.isSol)
- .map((x) => x.solAccount!.lamports)
- )
- const solAccounts = governedTokenAccountsWithoutNfts.filter((x) => x.isSol)
+ .map((x) => x.solAccount!.lamports),
+ );
+ const solAccounts = governedTokenAccountsWithoutNfts.filter((x) => x.isSol);
const [form, setForm] = useState({
governedAccount: governedAccount,
programId: programId?.toString(),
@@ -68,7 +68,7 @@ const CloseBuffers = ({ program }: { program: ProgramAccount }) => {
.find(
(x) =>
x.solAccount?.lamports ===
- highestLampartsAmountInGovernedTokenAccounts
+ highestLampartsAmountInGovernedTokenAccounts,
)!
.transferAddress!.toBase58()
: wallet?.publicKey?.toBase58()
@@ -76,52 +76,52 @@ const CloseBuffers = ({ program }: { program: ProgramAccount }) => {
: '',
description: '',
title: '',
- })
- const [voteByCouncil, setVoteByCouncil] = useState(false)
- const [showOptions, setShowOptions] = useState(false)
- const [isLoading, setIsLoading] = useState(false)
- const [formErrors, setFormErrors] = useState({})
+ });
+ const [voteByCouncil, setVoteByCouncil] = useState(false);
+ const [showOptions, setShowOptions] = useState(false);
+ const [isLoading, setIsLoading] = useState(false);
+ const [formErrors, setFormErrors] = useState({});
const proposalTitle = `Close buffers for program ${
form.governedAccount?.governance?.account.governedAccount
? abbreviateAddress(
- form.governedAccount?.governance?.account.governedAccount
+ form.governedAccount?.governance?.account.governedAccount,
)
: ''
- }`
+ }`;
const handleSetForm = ({ propertyName, value }) => {
- setFormErrors({})
- setForm({ ...form, [propertyName]: value })
- }
+ setFormErrors({});
+ setForm({ ...form, [propertyName]: value });
+ };
const schema = yup.object().shape({
solReceiverAddress: yup
.string()
.test('accountTests', 'Account validation error', function (val: string) {
if (val) {
try {
- return !!getValidatedPublickKey(val)
+ return !!getValidatedPublickKey(val);
} catch (e) {
- console.log(e)
+ console.error(e);
return this.createError({
message: `${e}`,
- })
+ });
}
} else {
return this.createError({
message: `Retrieved SOL receiver address is required`,
- })
+ });
}
}),
governedAccount: yup
.object()
.nullable()
.required('Program governed account is required'),
- })
- async function getInstructions(): Promise {
- const isValid = await validateInstruction({ schema, form, setFormErrors })
- const instructions: UiInstruction[] = []
+ });
+ async function getInstructions(): Promise {
+ const isValid = await validateInstruction({ schema, form, setFormErrors });
+ const instructions: FormInstructionData[] = [];
for (let i = 0; i < buffers.length; i++) {
- let serializedInstruction = ''
+ let serializedInstruction = '';
if (
isValid &&
programId &&
@@ -131,27 +131,27 @@ const CloseBuffers = ({ program }: { program: ProgramAccount }) => {
const closeIx = await createCloseBuffer(
buffers[i].pubkey,
new PublicKey(form.solReceiverAddress),
- form.governedAccount.governance.pubkey
- )
- serializedInstruction = serializeInstructionToBase64(closeIx)
+ form.governedAccount.governance.pubkey,
+ );
+ serializedInstruction = serializeInstructionToBase64(closeIx);
}
- const obj: UiInstruction = {
+ const obj: FormInstructionData = {
serializedInstruction: serializedInstruction,
isValid,
governance: form.governedAccount?.governance,
- }
- instructions.push(obj)
+ };
+ instructions.push(obj);
}
- return instructions
+ return instructions;
}
const handlePropose = async () => {
- setIsLoading(true)
- const instructions: UiInstruction[] = await getInstructions()
+ setIsLoading(true);
+ const instructions: FormInstructionData[] = await getInstructions();
if (instructions.length && instructions[0].isValid) {
- const governance = form.governedAccount?.governance
+ const governance = form.governedAccount?.governance;
if (!realm) {
- setIsLoading(false)
- throw 'No realm selected'
+ setIsLoading(false);
+ throw 'No realm selected';
}
const instructionsData = instructions.map(
@@ -159,8 +159,8 @@ const CloseBuffers = ({ program }: { program: ProgramAccount }) => {
new InstructionDataWithHoldUpTime({
instruction: x,
governance,
- })
- )
+ }),
+ );
try {
const proposalAddress = await handleCreateProposal({
title: form.title ? form.title : proposalTitle,
@@ -168,30 +168,30 @@ const CloseBuffers = ({ program }: { program: ProgramAccount }) => {
voteByCouncil,
instructionsData: instructionsData,
governance: governance!,
- })
+ });
const url = fmtUrlWithCluster(
- `/dao/${symbol}/proposal/${proposalAddress}`
- )
- router.push(url)
+ `/dao/${symbol}/proposal/${proposalAddress}`,
+ );
+ router.push(url);
} catch (ex) {
- notify({ type: 'error', message: `${ex}` })
+ notify({ type: 'error', message: `${ex}` });
}
}
- setIsLoading(false)
- }
+ setIsLoading(false);
+ };
useEffect(() => {
handleSetForm({
propertyName: 'programId',
value: programId?.toString(),
- })
- }, [realmInfo?.programId])
+ });
+ }, [realmInfo?.programId]);
useEffect(() => {
const getBuffers = async () => {
try {
- setBuffers([])
- setIsBuffersLoading(true)
+ setBuffers([]);
+ setIsBuffersLoading(true);
const buffers = await connection.current.getParsedProgramAccounts(
BPF_UPGRADE_LOADER_ID,
{
@@ -203,18 +203,18 @@ const CloseBuffers = ({ program }: { program: ProgramAccount }) => {
},
},
],
- }
- )
- setBuffers(buffers)
+ },
+ );
+ setBuffers(buffers);
} catch (e) {
- notify({ type: 'error', message: "Can't fetch buffers" })
+ notify({ type: 'error', message: "Can't fetch buffers" });
}
- setIsBuffersLoading(false)
- }
+ setIsBuffersLoading(false);
+ };
if (form.governedAccount?.governance?.pubkey.toBase58()) {
- getBuffers()
+ getBuffers();
}
- }, [form.governedAccount?.governance?.pubkey.toBase58()])
+ }, [form.governedAccount?.governance?.pubkey.toBase58()]);
return (
<>
@@ -303,7 +303,7 @@ const CloseBuffers = ({ program }: { program: ProgramAccount }) => {
{
- setVoteByCouncil(!voteByCouncil)
+ setVoteByCouncil(!voteByCouncil);
}}
/>
)}
@@ -319,7 +319,7 @@ const CloseBuffers = ({ program }: { program: ProgramAccount }) => {
Propose Close {buffers.length > 1 ? 'Buffers' : 'Buffer'}
>
- )
-}
+ );
+};
-export default CloseBuffers
+export default CloseBuffers;
diff --git a/components/AssetsList/NewProgramForm.tsx b/components/AssetsList/NewProgramForm.tsx
index 73aee8ab47..492d6dd52c 100644
--- a/components/AssetsList/NewProgramForm.tsx
+++ b/components/AssetsList/NewProgramForm.tsx
@@ -1,32 +1,32 @@
-import Button from 'components/Button'
-import Input from 'components/inputs/Input'
-import PreviousRouteBtn from 'components/PreviousRouteBtn'
-import Tooltip from 'components/Tooltip'
-import useQueryContext from 'hooks/useQueryContext'
-import useRealm from 'hooks/useRealm'
-import { RpcContext } from '@solana/spl-governance'
-import { PublicKey } from '@solana/web3.js'
-import { tryParseKey } from 'tools/validators/pubkey'
-import { isFormValid } from 'utils/formValidation'
-import { getGovernanceConfig } from 'utils/GovernanceTools'
-import { notify } from 'utils/notifications'
-import { useRouter } from 'next/router'
-import React, { useEffect, useState } from 'react'
-import useWalletStore from 'stores/useWalletStore'
-import * as yup from 'yup'
+import Button from 'components/Button';
+import Input from 'components/inputs/Input';
+import PreviousRouteBtn from 'components/PreviousRouteBtn';
+import Tooltip from 'components/Tooltip';
+import useQueryContext from 'hooks/useQueryContext';
+import useRealm from 'hooks/useRealm';
+import { RpcContext } from '@solana/spl-governance';
+import { PublicKey } from '@solana/web3.js';
+import { tryParseKey } from 'tools/validators/pubkey';
+import { isFormValid } from 'utils/formValidation';
+import { getGovernanceConfig } from 'utils/GovernanceTools';
+import { notify } from 'utils/notifications';
+import { useRouter } from 'next/router';
+import React, { useEffect, useState } from 'react';
+import useWalletStore from 'stores/useWalletStore';
+import * as yup from 'yup';
import BaseGovernanceForm, {
BaseGovernanceFormFields,
-} from './BaseGovernanceForm'
-import { registerProgramGovernance } from 'actions/registerProgramGovernance'
-import { GovernanceType } from '@solana/spl-governance'
-import Switch from 'components/Switch'
-import { debounce } from '@utils/debounce'
-import { MIN_COMMUNITY_TOKENS_TO_CREATE_W_0_SUPPLY } from '@tools/constants'
-import { getProgramVersionForRealm } from '@models/registry/api'
-import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore'
+} from './BaseGovernanceForm';
+import { registerProgramGovernance } from 'actions/registerProgramGovernance';
+import { GovernanceType } from '@solana/spl-governance';
+import Switch from 'components/Switch';
+import { debounce } from '@utils/debounce';
+import { MIN_COMMUNITY_TOKENS_TO_CREATE_W_0_SUPPLY } from '@tools/constants';
+import { getProgramVersionForRealm } from '@models/registry/api';
+import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore';
interface NewProgramForm extends BaseGovernanceFormFields {
- programId: string
- transferAuthority: boolean
+ programId: string;
+ transferAuthority: boolean;
}
const defaultFormValues = {
@@ -39,60 +39,60 @@ const defaultFormValues = {
maxVotingTime: 3,
voteThreshold: 60,
transferAuthority: true,
-}
+};
const NewProgramForm = () => {
- const router = useRouter()
- const { fmtUrlWithCluster } = useQueryContext()
- const client = useVoteStakeRegistryClientStore((s) => s.state.client)
+ const router = useRouter();
+ const { fmtUrlWithCluster } = useQueryContext();
+ const client = useVoteStakeRegistryClientStore((s) => s.state.client);
const {
realmInfo,
realm,
mint: realmMint,
symbol,
ownVoterWeight,
- } = useRealm()
- const wallet = useWalletStore((s) => s.current)
- const connection = useWalletStore((s) => s.connection)
- const connected = useWalletStore((s) => s.connected)
- const { fetchRealm } = useWalletStore((s) => s.actions)
+ } = useRealm();
+ const wallet = useWalletStore((s) => s.current);
+ const connection = useWalletStore((s) => s.connection);
+ const connected = useWalletStore((s) => s.connected);
+ const { fetchRealm } = useWalletStore((s) => s.actions);
const [form, setForm] = useState({
...defaultFormValues,
- })
- const [isLoading, setIsLoading] = useState(false)
- const [formErrors, setFormErrors] = useState({})
+ });
+ const [isLoading, setIsLoading] = useState(false);
+ const [formErrors, setFormErrors] = useState({});
const tokenOwnerRecord = ownVoterWeight.canCreateGovernanceUsingCouncilTokens()
? ownVoterWeight.councilTokenRecord
: realm && ownVoterWeight.canCreateGovernanceUsingCommunityTokens(realm)
? ownVoterWeight.communityTokenRecord
- : undefined
+ : undefined;
const handleSetForm = ({ propertyName, value }) => {
- setFormErrors({})
- setForm({ ...form, [propertyName]: value })
- }
+ setFormErrors({});
+ setForm({ ...form, [propertyName]: value });
+ };
const handleCreate = async () => {
try {
if (!realm) {
- throw 'No realm selected'
+ throw 'No realm selected';
}
if (!connected) {
- throw 'Please connect your wallet'
+ throw 'Please connect your wallet';
}
if (!tokenOwnerRecord) {
- throw "You don't have enough governance power to create a new program governance"
+ throw "You don't have enough governance power to create a new program governance";
}
- const { isValid, validationErrors } = await isFormValid(schema, form)
- setFormErrors(validationErrors)
+ const { isValid, validationErrors } = await isFormValid(schema, form);
+ setFormErrors(validationErrors);
if (isValid && realmMint) {
- setIsLoading(true)
+ setIsLoading(true);
const rpcContext = new RpcContext(
new PublicKey(realm.owner.toString()),
getProgramVersionForRealm(realmInfo!),
wallet!,
connection.current,
- connection.endpoint
- )
+ connection.endpoint,
+ );
const governanceConfigValues = {
minTokensToCreateProposal: form.minCommunityTokensToCreateProposal,
@@ -100,8 +100,8 @@ const NewProgramForm = () => {
maxVotingTime: form.maxVotingTime,
voteThresholdPercentage: form.voteThreshold,
mintDecimals: realmMint.decimals,
- }
- const governanceConfig = getGovernanceConfig(governanceConfigValues)
+ };
+ const governanceConfig = getGovernanceConfig(governanceConfigValues);
await registerProgramGovernance(
rpcContext,
GovernanceType.Program,
@@ -110,11 +110,11 @@ const NewProgramForm = () => {
governanceConfig,
form.transferAuthority,
tokenOwnerRecord!.pubkey,
- client
- )
- setIsLoading(false)
- fetchRealm(realmInfo!.programId, realmInfo!.realmId)
- router.push(fmtUrlWithCluster(`/dao/${symbol}/`))
+ client,
+ );
+ setIsLoading(false);
+ fetchRealm(realmInfo!.programId, realmInfo!.realmId);
+ router.push(fmtUrlWithCluster(`/dao/${symbol}/`));
}
} catch (e) {
//TODO how do we present errors maybe something more generic ?
@@ -122,10 +122,10 @@ const NewProgramForm = () => {
type: 'error',
message: `Can't create governance`,
description: `Transaction error ${e}`,
- })
- setIsLoading(false)
+ });
+ setIsLoading(false);
}
- }
+ };
//if you altering this look at useEffect for form.programId
const schema = yup.object().shape({
programId: yup
@@ -136,44 +136,44 @@ const NewProgramForm = () => {
async function (val: string) {
if (val) {
try {
- const pubKey = tryParseKey(val)
+ const pubKey = tryParseKey(val);
if (!pubKey) {
return this.createError({
message: `Invalid account address`,
- })
+ });
}
const accountData = await connection.current.getParsedAccountInfo(
- pubKey
- )
+ pubKey,
+ );
if (!accountData || !accountData.value) {
return this.createError({
message: `Account not found`,
- })
+ });
}
- return true
+ return true;
} catch (e) {
return this.createError({
message: `Invalid account address`,
- })
+ });
}
} else {
return this.createError({
message: `Program id is required`,
- })
+ });
}
- }
+ },
),
- })
+ });
useEffect(() => {
if (form.programId) {
//now validation contains only programId if more fields come it would be good to reconsider this method.
debounce.debounceFcn(async () => {
- const { validationErrors } = await isFormValid(schema, form)
- setFormErrors(validationErrors)
- })
+ const { validationErrors } = await isFormValid(schema, form);
+ setFormErrors(validationErrors);
+ });
}
- }, [form.programId])
+ }, [form.programId]);
return (
@@ -226,7 +226,7 @@ const NewProgramForm = () => {
- )
-}
+ );
+};
-export default NewProgramForm
+export default NewProgramForm;
diff --git a/components/AssetsList/UpgradeProgram.tsx b/components/AssetsList/UpgradeProgram.tsx
index 447bcda8f3..7d75bc0bc9 100644
--- a/components/AssetsList/UpgradeProgram.tsx
+++ b/components/AssetsList/UpgradeProgram.tsx
@@ -1,57 +1,57 @@
-import { ChevronDownIcon } from '@heroicons/react/solid'
-import { PublicKey } from '@solana/web3.js'
-import useRealm from 'hooks/useRealm'
-import Input from 'components/inputs/Input'
-import Button, { LinkButton } from '@components/Button'
-import Textarea from 'components/inputs/Textarea'
-import VoteBySwitch from 'pages/dao/[symbol]/proposal/components/VoteBySwitch'
-import useWalletStore from 'stores/useWalletStore'
-import { validateBuffer } from 'utils/validations'
-import { useEffect, useState } from 'react'
+import { ChevronDownIcon } from '@heroicons/react/solid';
+import { PublicKey } from '@solana/web3.js';
+import useRealm from 'hooks/useRealm';
+import Input from 'components/inputs/Input';
+import Button, { LinkButton } from '@components/Button';
+import Textarea from 'components/inputs/Textarea';
+import VoteBySwitch from 'pages/dao/[symbol]/proposal/components/VoteBySwitch';
+import useWalletStore from 'stores/useWalletStore';
+import { validateBuffer } from 'utils/validations';
+import { useEffect, useState } from 'react';
import {
ProgramUpgradeForm,
- UiInstruction,
-} from 'utils/uiTypes/proposalCreationTypes'
+ FormInstructionData,
+} from 'utils/uiTypes/proposalCreationTypes';
import {
getInstructionDataFromBase64,
serializeInstructionToBase64,
-} from '@solana/spl-governance'
-import { RpcContext } from '@solana/spl-governance'
-import { Governance, ProgramAccount } from '@solana/spl-governance'
-import { useRouter } from 'next/router'
-import { createProposal } from 'actions/createProposal'
-import { notify } from 'utils/notifications'
-import useQueryContext from 'hooks/useQueryContext'
-import { validateInstruction } from 'utils/instructionTools'
-import * as yup from 'yup'
-import { createUpgradeInstruction } from '@tools/sdk/bpfUpgradeableLoader/createUpgradeInstruction'
-import { debounce } from '@utils/debounce'
-import { isFormValid } from '@utils/formValidation'
-import { getProgramVersionForRealm } from '@models/registry/api'
-import ProgramUpgradeInfo from 'pages/dao/[symbol]/proposal/components/instructions/bpfUpgradeableLoader/ProgramUpgradeInfo'
-import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore'
-import { getProgramName } from '@components/instructions/programs/names'
+} from '@solana/spl-governance';
+import { RpcContext } from '@solana/spl-governance';
+import { Governance, ProgramAccount } from '@solana/spl-governance';
+import { useRouter } from 'next/router';
+import { createProposal } from 'actions/createProposal';
+import { notify } from 'utils/notifications';
+import useQueryContext from 'hooks/useQueryContext';
+import { validateInstruction } from 'utils/instructionTools';
+import * as yup from 'yup';
+import { createUpgradeInstruction } from '@tools/sdk/bpfUpgradeableLoader/createUpgradeInstruction';
+import { debounce } from '@utils/debounce';
+import { isFormValid } from '@utils/formValidation';
+import { getProgramVersionForRealm } from '@models/registry/api';
+import ProgramUpgradeInfo from 'pages/dao/[symbol]/proposal/components/instructions/bpfUpgradeableLoader/ProgramUpgradeInfo';
+import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore';
+import { getProgramName } from '@components/instructions/programs/names';
interface UpgradeProgramCompactForm extends ProgramUpgradeForm {
- description: string
- title: string
+ description: string;
+ title: string;
}
const UpgradeProgram = ({
program,
}: {
- program: ProgramAccount
+ program: ProgramAccount;
}) => {
- const router = useRouter()
- const client = useVoteStakeRegistryClientStore((s) => s.state.client)
- const connection = useWalletStore((s) => s.connection)
- const wallet = useWalletStore((s) => s.current)
+ const router = useRouter();
+ const client = useVoteStakeRegistryClientStore((s) => s.state.client);
+ const connection = useWalletStore((s) => s.connection);
+ const wallet = useWalletStore((s) => s.current);
const governedAccount = {
governance: program!,
- }
- const { fmtUrlWithCluster } = useQueryContext()
- const { fetchRealmGovernance } = useWalletStore((s) => s.actions)
- const { symbol } = router.query
+ };
+ const { fmtUrlWithCluster } = useQueryContext();
+ const { fetchRealmGovernance } = useWalletStore((s) => s.actions);
+ const { symbol } = router.query;
const {
realmInfo,
canChooseWhoVote,
@@ -59,26 +59,25 @@ const UpgradeProgram = ({
realm,
ownVoterWeight,
mint,
- } = useRealm()
- const programId: PublicKey | undefined = realmInfo?.programId
+ } = useRealm();
+ const programId: PublicKey | undefined = realmInfo?.programId;
const [form, setForm] = useState({
governedAccount: governedAccount,
- programId: programId?.toString(),
bufferAddress: '',
description: '',
title: '',
- })
- const [voteByCouncil, setVoteByCouncil] = useState(false)
- const [showOptions, setShowOptions] = useState(false)
- const [isLoading, setIsLoading] = useState(false)
- const [formErrors, setFormErrors] = useState({})
- const proposalTitle = `Upgrade ${form.governedAccount?.governance?.account.governedAccount.toBase58()}`
- const name = program ? getProgramName(program.account.governedAccount) : ''
+ });
+ const [voteByCouncil, setVoteByCouncil] = useState(false);
+ const [showOptions, setShowOptions] = useState(false);
+ const [isLoading, setIsLoading] = useState(false);
+ const [formErrors, setFormErrors] = useState({});
+ const proposalTitle = `Upgrade ${form.governedAccount?.governance?.account.governedAccount.toBase58()}`;
+ const name = program ? getProgramName(program.account.governedAccount) : '';
const handleSetForm = ({ propertyName, value }) => {
- setFormErrors({})
- setForm({ ...form, [propertyName]: value })
- }
+ setFormErrors({});
+ setForm({ ...form, [propertyName]: value });
+ };
const schema = yup.object().shape({
bufferAddress: yup
.string()
@@ -88,58 +87,59 @@ const UpgradeProgram = ({
await validateBuffer(
connection,
val,
- form.governedAccount?.governance?.pubkey
- )
- return true
+ form.governedAccount?.governance?.pubkey,
+ );
+ return true;
} catch (e) {
return this.createError({
message: `${e}`,
- })
+ });
}
} else {
return this.createError({
message: `Buffer address is required`,
- })
+ });
}
}),
governedAccount: yup
.object()
.nullable()
.required('Program governed account is required'),
- })
- async function getInstruction(): Promise {
- const isValid = await validateInstruction({ schema, form, setFormErrors })
- let serializedInstruction = ''
+ });
+ async function getInstruction(): Promise {
+ const isValid = await validateInstruction({ schema, form, setFormErrors });
+ let serializedInstruction = '';
if (
isValid &&
programId &&
form.governedAccount?.governance?.account &&
- wallet?.publicKey
+ wallet?.publicKey &&
+ form.bufferAddress
) {
const upgradeIx = await createUpgradeInstruction(
form.governedAccount.governance.account.governedAccount,
new PublicKey(form.bufferAddress),
form.governedAccount.governance.pubkey,
- wallet!.publicKey
- )
- serializedInstruction = serializeInstructionToBase64(upgradeIx)
+ wallet!.publicKey,
+ );
+ serializedInstruction = serializeInstructionToBase64(upgradeIx);
}
- const obj: UiInstruction = {
+ const obj: FormInstructionData = {
serializedInstruction: serializedInstruction,
isValid,
governance: form.governedAccount?.governance,
- }
- return obj
+ };
+ return obj;
}
const handlePropose = async () => {
- setIsLoading(true)
- const instruction: UiInstruction = await getInstruction()
+ setIsLoading(true);
+ const instruction: FormInstructionData = await getInstruction();
if (instruction.isValid) {
- const governance = form.governedAccount?.governance
- let proposalAddress: PublicKey | null = null
+ const governance = form.governedAccount?.governance;
+ let proposalAddress: PublicKey | null = null;
if (!realm) {
- setIsLoading(false)
- throw 'No realm selected'
+ setIsLoading(false);
+ throw 'No realm selected';
}
const rpcContext = new RpcContext(
@@ -147,40 +147,40 @@ const UpgradeProgram = ({
getProgramVersionForRealm(realmInfo!),
wallet!,
connection.current,
- connection.endpoint
- )
+ connection.endpoint,
+ );
const instructionData = {
data: instruction.serializedInstruction
? getInstructionDataFromBase64(instruction.serializedInstruction)
: null,
holdUpTime: governance?.account?.config.minInstructionHoldUpTime,
prerequisiteInstructions: instruction.prerequisiteInstructions || [],
- }
+ };
try {
// Fetch governance to get up to date proposalCount
const selectedGovernance = (await fetchRealmGovernance(
- governance?.pubkey
- )) as ProgramAccount
+ governance?.pubkey,
+ )) as ProgramAccount;
const ownTokenRecord = ownVoterWeight.getTokenRecordToCreateProposal(
- governance!.account.config
- )
+ governance!.account.config,
+ );
const defaultProposalMint = !mint?.supply.isZero()
? realm.account.communityMint
: !councilMint?.supply.isZero()
? realm.account.config.councilMint
- : undefined
+ : undefined;
const proposalMint =
canChooseWhoVote && voteByCouncil
? realm.account.config.councilMint
- : defaultProposalMint
+ : defaultProposalMint;
if (!proposalMint) {
throw new Error(
- 'There is no suitable governing token for the proposal'
- )
+ 'There is no suitable governing token for the proposal',
+ );
}
//Description same as title
proposalAddress = await createProposal(
@@ -194,34 +194,34 @@ const UpgradeProgram = ({
selectedGovernance?.account?.proposalCount,
[instructionData],
false,
- client
- )
+ client,
+ );
const url = fmtUrlWithCluster(
- `/dao/${symbol}/proposal/${proposalAddress}`
- )
- router.push(url)
+ `/dao/${symbol}/proposal/${proposalAddress}`,
+ );
+ router.push(url);
} catch (ex) {
- notify({ type: 'error', message: `${ex}` })
+ notify({ type: 'error', message: `${ex}` });
}
}
- setIsLoading(false)
- }
+ setIsLoading(false);
+ };
useEffect(() => {
handleSetForm({
propertyName: 'programId',
value: programId?.toString(),
- })
- }, [realmInfo?.programId])
+ });
+ }, [realmInfo?.programId]);
useEffect(() => {
if (form.bufferAddress) {
debounce.debounceFcn(async () => {
- const { validationErrors } = await isFormValid(schema, form)
- setFormErrors(validationErrors)
- })
+ const { validationErrors } = await isFormValid(schema, form);
+ setFormErrors(validationErrors);
+ });
}
- }, [form.bufferAddress])
+ }, [form.bufferAddress]);
return (
<>
Upgrade {name}
@@ -287,7 +287,7 @@ const UpgradeProgram = ({
{
- setVoteByCouncil(!voteByCouncil)
+ setVoteByCouncil(!voteByCouncil);
}}
/>
)}
@@ -298,7 +298,7 @@ const UpgradeProgram = ({
Propose Upgrade
>
- )
-}
+ );
+};
-export default UpgradeProgram
+export default UpgradeProgram;
diff --git a/components/Button.tsx b/components/Button.tsx
index 8f9574a0b6..5e067bc04f 100644
--- a/components/Button.tsx
+++ b/components/Button.tsx
@@ -1,15 +1,15 @@
-import { FunctionComponent } from 'react'
-import Loading from './Loading'
-import Tooltip from './Tooltip'
+import { FunctionComponent } from 'react';
+import Loading from './Loading';
+import Tooltip from './Tooltip';
interface ButtonProps {
- className?: string
- isLoading?: boolean
- onClick?: () => void
- disabled?: boolean
- small?: boolean
- tooltipMessage?: string
- style?: any
+ className?: string;
+ isLoading?: boolean;
+ onClick?: () => void;
+ disabled?: boolean;
+ small?: boolean;
+ tooltipMessage?: string;
+ style?: any;
}
const Button: FunctionComponent = ({
@@ -39,10 +39,10 @@ const Button: FunctionComponent = ({
{isLoading ? : children}
- )
-}
+ );
+};
-export default Button
+export default Button;
export const SecondaryButton: FunctionComponent = ({
children,
@@ -67,8 +67,8 @@ export const SecondaryButton: FunctionComponent = ({
{isLoading ? : children}
- )
-}
+ );
+};
export const LinkButton: FunctionComponent = ({
children,
@@ -86,5 +86,5 @@ export const LinkButton: FunctionComponent = ({
>
{children}
- )
-}
+ );
+};
diff --git a/components/ButtonGroup.tsx b/components/ButtonGroup.tsx
index 40a9cf301a..32ea2dcbe2 100644
--- a/components/ButtonGroup.tsx
+++ b/components/ButtonGroup.tsx
@@ -1,12 +1,12 @@
-import { FunctionComponent } from 'react'
+import { FunctionComponent } from 'react';
interface ButtonGroupProps {
- activeValue: string
- className?: string
- onChange: (x) => void
- unit?: string
- values: Array
- names?: Array
+ activeValue: string;
+ className?: string;
+ onChange: (x) => void;
+ unit?: string;
+ values: Array;
+ names?: Array;
}
const ButtonGroup: FunctionComponent = ({
@@ -51,7 +51,7 @@ const ButtonGroup: FunctionComponent = ({
))}
- )
-}
+ );
+};
-export default ButtonGroup
+export default ButtonGroup;
diff --git a/components/ConnectWalletButton.tsx b/components/ConnectWalletButton.tsx
index 082a448b07..46fd2bdca5 100644
--- a/components/ConnectWalletButton.tsx
+++ b/components/ConnectWalletButton.tsx
@@ -1,130 +1,63 @@
-import { Menu } from '@headlessui/react'
-import { useMemo, useState } from 'react'
-import { CheckCircleIcon, ChevronDownIcon } from '@heroicons/react/solid'
-import styled from '@emotion/styled'
-import useWalletStore from '../stores/useWalletStore'
+import { Menu } from '@headlessui/react';
+import { useMemo } from 'react';
+import { CheckCircleIcon, ChevronDownIcon } from '@heroicons/react/solid';
+import styled from '@emotion/styled';
+import useWalletStore from '../stores/useWalletStore';
import {
getWalletProviderByUrl,
WALLET_PROVIDERS,
-} from '../utils/wallet-adapters'
-import {
- AddressImage,
- DisplayAddress,
- useAddressName,
- useWalletIdentity,
-} from '@cardinal/namespaces-components'
-import { BackspaceIcon } from '@heroicons/react/solid'
-import { UserCircleIcon } from '@heroicons/react/outline'
-import { abbreviateAddress } from '@utils/formatting'
-import { useRouter } from 'next/router'
-import TwitterIcon from './TwitterIcon'
-import Switch from './Switch'
+} from '../utils/wallet-adapters';
const StyledWalletProviderLabel = styled.p`
font-size: 0.65rem;
line-height: 1.5;
-`
+`;
const ConnectWalletButton = (props) => {
const {
connected,
current,
providerUrl,
- connection,
set: setWalletStore,
- } = useWalletStore((s) => s)
+ } = useWalletStore((s) => s);
const provider = useMemo(() => getWalletProviderByUrl(providerUrl), [
providerUrl,
- ])
-
- const [useDevnet, setUseDevnet] = useState(false)
- const router = useRouter()
- const handleToggleDevnet = () => {
- setUseDevnet(!useDevnet)
- if (useDevnet) {
- router.push(`${window.location.pathname}`)
- } else {
- router.push(`${window.location.href}?cluster=devnet`)
- }
- }
+ ]);
const handleConnectDisconnect = async () => {
try {
if (connected) {
- await current?.disconnect()
+ await current?.disconnect();
} else {
- await current?.connect()
+ await current?.connect();
}
} catch (e) {
- console.warn('handleConnectDisconnect', e)
+ console.warn('handleConnectDisconnect', e);
}
- }
-
- const { show } = useWalletIdentity()
-
- const { displayName } = useAddressName(
- connection.current,
- current?.publicKey || undefined
- )
+ };
- const walletAddressFormatted = current?.publicKey
- ? abbreviateAddress(current?.publicKey)
- : ''
+ if (!provider) {
+ return null;
+ }
return (
@@ -133,9 +66,7 @@ const ConnectWalletButton = (props) => {
- )
-}
+ );
+};
-export default ConnectWalletButton
+export default ConnectWalletButton;
diff --git a/components/DiscordIcon.tsx b/components/DiscordIcon.tsx
index 6283e77ad4..7ca6231b7a 100644
--- a/components/DiscordIcon.tsx
+++ b/components/DiscordIcon.tsx
@@ -21,7 +21,7 @@ const DiscordIcon = ({ className }) => {
mask="url(#path-1-inside-1_1901_7895)"
/>
- )
-}
+ );
+};
-export default DiscordIcon
+export default DiscordIcon;
diff --git a/components/Divider.tsx b/components/Divider.tsx
index dc854b5132..ba061a9f81 100644
--- a/components/Divider.tsx
+++ b/components/Divider.tsx
@@ -1,14 +1,14 @@
-import React from 'react'
+import React from 'react';
const Divider: React.FC<{
- className?: string
- dashed?: boolean
+ className?: string;
+ dashed?: boolean;
}> = ({ className, dashed }) => (
-)
+);
-export default Divider
+export default Divider;
diff --git a/components/DropdownBtn.tsx b/components/DropdownBtn.tsx
index c6ee09c5d5..4256964964 100644
--- a/components/DropdownBtn.tsx
+++ b/components/DropdownBtn.tsx
@@ -1,25 +1,25 @@
-import { Menu } from '@headlessui/react'
-import { ChevronDownIcon } from '@heroicons/react/solid'
-import Loading from '@components/Loading'
+import { Menu } from '@headlessui/react';
+import { ChevronDownIcon } from '@heroicons/react/solid';
+import Loading from '@components/Loading';
export interface DropdownBtnOptions {
- isDefault: boolean | undefined
- label: string
- callback: () => Promise
+ isDefault: boolean | undefined;
+ label: string;
+ callback: () => Promise;
}
const DropdownBtn = ({
options,
isLoading,
}: {
- options: DropdownBtnOptions[]
- isLoading?: boolean
+ options: DropdownBtnOptions[];
+ isLoading?: boolean;
}) => {
- const defaultFunction = options.find((x) => x.isDefault)
+ const defaultFunction = options.find((x) => x.isDefault);
if (!defaultFunction) {
- throw 'DropdownBtn must have at least one default option'
+ throw 'DropdownBtn must have at least one default option';
}
- const filtredOptions = options.filter((x) => !x.isDefault)
+ const filtredOptions = options.filter((x) => !x.isDefault);
return (
{isLoading ? (
@@ -67,7 +67,7 @@ const DropdownBtn = ({
>
)}
- )
-}
+ );
+};
-export default DropdownBtn
+export default DropdownBtn;
diff --git a/components/ErrorBoundary.tsx b/components/ErrorBoundary.tsx
index e40277189e..c0740e3ead 100644
--- a/components/ErrorBoundary.tsx
+++ b/components/ErrorBoundary.tsx
@@ -1,17 +1,17 @@
-import React from 'react'
+import React from 'react';
class ErrorBoundary extends React.Component<
any,
{ hasError: boolean; error: any }
> {
constructor(props) {
- super(props)
- this.state = { hasError: false, error: null }
+ super(props);
+ this.state = { hasError: false, error: null };
}
static getDerivedStateFromError(error) {
// Update state so the next render will show the fallback UI.
- return { hasError: true, error: error }
+ return { hasError: true, error: error };
}
componentDidCatch(error, errorInfo) {
@@ -26,9 +26,9 @@ class ErrorBoundary extends React.Component<
body: JSON.stringify({
content: `UI ERROR: ${error} : ${errorInfo?.componentStack}`,
}),
- })
+ });
} catch (err) {
- console.error('Error posting to notify webhook:', err)
+ console.error('Error posting to notify webhook:', err);
}
}
}
@@ -45,11 +45,11 @@ class ErrorBoundary extends React.Component<
{this.state.error.stack}
- )
+ );
}
- return this.props.children
+ return this.props.children;
}
}
-export default ErrorBoundary
+export default ErrorBoundary;
diff --git a/components/Footer.tsx b/components/Footer.tsx
deleted file mode 100644
index f69f81079d..0000000000
--- a/components/Footer.tsx
+++ /dev/null
@@ -1,78 +0,0 @@
-import DiscordIcon from './DiscordIcon'
-import GithubIcon from './GithubIcon'
-import TwitterIcon from './TwitterIcon'
-
-const Footer = () => {
- const { REALM } = process.env
-
- if (REALM) return null
- else
- return (
-
- )
-}
-
-export default Footer
diff --git a/components/GithubIcon.tsx b/components/GithubIcon.tsx
index ffa778eebe..9bfd5633ab 100644
--- a/components/GithubIcon.tsx
+++ b/components/GithubIcon.tsx
@@ -16,7 +16,7 @@ const GithubIcon = ({ className }) => {
strokeLinejoin="round"
/>
- )
-}
+ );
+};
-export default GithubIcon
+export default GithubIcon;
diff --git a/components/GovernedAccountsTabs.tsx b/components/GovernedAccountsTabs.tsx
index 97219f2179..271d8146c1 100644
--- a/components/GovernedAccountsTabs.tsx
+++ b/components/GovernedAccountsTabs.tsx
@@ -1,9 +1,9 @@
-import { FunctionComponent } from 'react'
+import { FunctionComponent } from 'react';
interface GovernedAccountsTabsProps {
- activeTab: any
- onChange: (x) => void
- tabs: Array
+ activeTab: any;
+ onChange: (x) => void;
+ tabs: Array;
}
const GovernedAccountsTabs: FunctionComponent = ({
@@ -18,15 +18,15 @@ const GovernedAccountsTabs: FunctionComponent = ({
style={{
transform: `translateY(${
tabs.findIndex(
- (t) => t.pubkey.toBase58() === activeTab?.pubkey.toBase58()
+ (t) => t.pubkey.toBase58() === activeTab?.pubkey.toBase58(),
) * 100
}%)`,
height: `${100 / tabs.length}%`,
}}
/>
{tabs.map((x) => {
- const pubKey = x.pubkey
- const activePubKey = activeTab?.pubkey
+ const pubKey = x.pubkey;
+ const activePubKey = activeTab?.pubkey;
return (
- )
+ );
})}
- )
-}
+ );
+};
-export default GovernedAccountsTabs
+export default GovernedAccountsTabs;
diff --git a/components/HotWallet/HotWallet.tsx b/components/HotWallet/HotWallet.tsx
new file mode 100644
index 0000000000..fe8599e5b1
--- /dev/null
+++ b/components/HotWallet/HotWallet.tsx
@@ -0,0 +1,51 @@
+import useHotWallet from '@hooks/useHotWallet';
+import { FireIcon } from '@heroicons/react/solid';
+import HotWalletName from './HotWalletName';
+import HotWalletPluginTribecaGauges from './plugins/TribecaGauges/TribecaGauges';
+import {
+ saberTribecaConfiguration,
+ sunnyTribecaConfiguration,
+} from '@tools/sdk/tribeca/configurations';
+import HotWalletPluginTokenAccounts from './plugins/TokenAccounts/TokenAccounts';
+import HotWalletPluginSaberStats from './plugins/SaberStats/SaberStats';
+import HotWalletPluginUXDStaking from './plugins/UXDStaking/UXDStaking';
+
+const HotWallet = (): JSX.Element => {
+ const { hotWalletAccount } = useHotWallet();
+
+ if (!hotWalletAccount) {
+ return <>>;
+ }
+
+ return (
+
+
+
+ Hot Wallet
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
+
+export default HotWallet;
diff --git a/components/HotWallet/HotWalletName.tsx b/components/HotWallet/HotWalletName.tsx
new file mode 100644
index 0000000000..e717ec101e
--- /dev/null
+++ b/components/HotWallet/HotWalletName.tsx
@@ -0,0 +1,41 @@
+import { getExplorerUrl } from '@components/explorer/tools';
+import { ExternalLinkIcon } from '@heroicons/react/outline';
+import { PublicKey } from '@solana/web3.js';
+import { abbreviateAddress } from '@utils/formatting';
+import { createRef } from 'react';
+import useWalletStore from 'stores/useWalletStore';
+
+const HotWalletName = ({
+ hotWalletName,
+ hotWalletAddress,
+}: {
+ hotWalletName: string;
+ hotWalletAddress: PublicKey;
+}) => {
+ const connection = useWalletStore((store) => store.connection);
+
+ const linkRef = createRef();
+
+ return (
+
+ );
+};
+
+export default HotWalletName;
diff --git a/components/HotWallet/plugins/SaberStats/SaberStat.tsx b/components/HotWallet/plugins/SaberStats/SaberStat.tsx
new file mode 100644
index 0000000000..dc3e300443
--- /dev/null
+++ b/components/HotWallet/plugins/SaberStats/SaberStat.tsx
@@ -0,0 +1,30 @@
+import { SaberStats } from '@hooks/useSaberStats';
+
+const SaberStat = ({
+ liquidityPoolName,
+ uiBalance,
+ pendingRewards,
+ mintName,
+}: SaberStats) => {
+ return (
+
+
{liquidityPoolName}
+
+ Balance
+ {`${uiBalance.toLocaleString()} ${mintName}`}
+
+
+
+ Pending Rewards
+ {pendingRewards.map(({ name, uiPendingAmount }) => (
+ {`${uiPendingAmount.toLocaleString()} ${name}`}
+ ))}
+
+
+ );
+};
+
+export default SaberStat;
diff --git a/components/HotWallet/plugins/SaberStats/SaberStats.tsx b/components/HotWallet/plugins/SaberStats/SaberStats.tsx
new file mode 100644
index 0000000000..e1544dc677
--- /dev/null
+++ b/components/HotWallet/plugins/SaberStats/SaberStats.tsx
@@ -0,0 +1,33 @@
+import useSaberStats from '@hooks/useSaberStats';
+import { SupportIcon } from '@heroicons/react/outline';
+import SaberStat from './SaberStat';
+import { HotWalletAccount } from '@hooks/useHotWallet';
+
+const HotWalletPluginSaberStats = ({
+ hotWalletAccount,
+}: {
+ hotWalletAccount: HotWalletAccount;
+}) => {
+ const { saberStats } = useSaberStats(hotWalletAccount);
+
+ if (!saberStats) {
+ return <>>;
+ }
+
+ return (
+
+
+
+ Saber Stats
+
+
+
+ {saberStats.map((saberStat) => (
+
+ ))}
+
+
+ );
+};
+
+export default HotWalletPluginSaberStats;
diff --git a/components/HotWallet/plugins/TokenAccounts/TokenAccount.tsx b/components/HotWallet/plugins/TokenAccounts/TokenAccount.tsx
new file mode 100644
index 0000000000..3b1ff112ff
--- /dev/null
+++ b/components/HotWallet/plugins/TokenAccounts/TokenAccount.tsx
@@ -0,0 +1,56 @@
+import { abbreviateAddress } from '@utils/formatting';
+import { HotWalletTokenAccounts } from '@hooks/useHotWalletPluginTokenAccounts';
+import { getExplorerUrl } from '@components/explorer/tools';
+import useWalletStore from 'stores/useWalletStore';
+import { createRef } from 'react';
+import { ExternalLinkIcon } from '@heroicons/react/outline';
+import { nativeAmountToFormattedUiAmount } from '@tools/sdk/units';
+
+const TokenAccount = ({ info }: { info: HotWalletTokenAccounts[0] }) => {
+ const connection = useWalletStore((store) => store.connection);
+
+ const linkRef = createRef();
+
+ const amountFormatted = nativeAmountToFormattedUiAmount(
+ info.amount,
+ info.decimals,
+ );
+
+ const usdTotalValueFormatted = info.usdTotalValue.isZero()
+ ? ''
+ : `$${nativeAmountToFormattedUiAmount(info.usdTotalValue, info.decimals)}`;
+
+ return (
+
+ );
+};
+
+export default TokenAccount;
diff --git a/components/HotWallet/plugins/TokenAccounts/TokenAccounts.tsx b/components/HotWallet/plugins/TokenAccounts/TokenAccounts.tsx
new file mode 100644
index 0000000000..3facd732d1
--- /dev/null
+++ b/components/HotWallet/plugins/TokenAccounts/TokenAccounts.tsx
@@ -0,0 +1,39 @@
+import { BookOpenIcon } from '@heroicons/react/solid';
+import { HotWalletAccount } from '@hooks/useHotWallet';
+import useHotWalletPluginTokenAccounts from '@hooks/useHotWalletPluginTokenAccounts';
+import TokenAccount from './TokenAccount';
+
+const HotWalletPluginTokenAccounts = ({
+ hotWalletAccount,
+}: {
+ hotWalletAccount: HotWalletAccount;
+}) => {
+ const { tokenAccounts } = useHotWalletPluginTokenAccounts(hotWalletAccount);
+
+ if (!hotWalletAccount) {
+ return <>>;
+ }
+
+ return (
+
+
+
+ Token Accounts ({tokenAccounts?.length})
+
+
+
+ {tokenAccounts?.map((tokenAccount) => (
+
+ ))}
+
+
+ );
+};
+
+export default HotWalletPluginTokenAccounts;
diff --git a/components/HotWallet/plugins/TribecaGauges/ActiveGaugeVotes.tsx b/components/HotWallet/plugins/TribecaGauges/ActiveGaugeVotes.tsx
new file mode 100644
index 0000000000..cdfc5d0a0e
--- /dev/null
+++ b/components/HotWallet/plugins/TribecaGauges/ActiveGaugeVotes.tsx
@@ -0,0 +1,37 @@
+import { ActiveGaugeVoteData } from '@hooks/useTribecaGaugesInfos';
+
+const ActiveGaugeVotes = ({
+ activeGaugeVotesData,
+}: {
+ activeGaugeVotesData?: ActiveGaugeVoteData[] | null;
+}) => {
+ return (
+
+
Vote Weight
+
+ {activeGaugeVotesData && activeGaugeVotesData.length > 0 ? (
+ activeGaugeVotesData.map(
+ ({ name, logoURI, weight, weightPercentage }) => (
+
+ {logoURI &&
}
+
+
{name}
+
+
+ {weight}{' '}
+ ({weightPercentage}%)
+
+
+ ),
+ )
+ ) : (
+
No weight repartition
+ )}
+
+ );
+};
+
+export default ActiveGaugeVotes;
diff --git a/components/HotWallet/plugins/TribecaGauges/EpochGaugeVoterData.tsx b/components/HotWallet/plugins/TribecaGauges/EpochGaugeVoterData.tsx
new file mode 100644
index 0000000000..ce37094a20
--- /dev/null
+++ b/components/HotWallet/plugins/TribecaGauges/EpochGaugeVoterData.tsx
@@ -0,0 +1,37 @@
+import type { EpochGaugeVoterData } from '@tools/sdk/tribeca/programs';
+
+const EpochGaugeVoterDataBloc = ({
+ title,
+ epochGaugeVoterData,
+}: {
+ title: string;
+ epochGaugeVoterData?: EpochGaugeVoterData | null;
+}) => {
+ return (
+
+
{title}
+
+ {epochGaugeVoterData ? (
+
+
+ Voting Power{' '}
+
+ {epochGaugeVoterData.votingPower.toNumber().toLocaleString()}
+
+
+
+
+ Allocated Power{' '}
+
+ {epochGaugeVoterData.allocatedPower.toNumber().toLocaleString()}
+
+
+
+ ) : (
+
Non-initialized epoch
+ )}
+
+ );
+};
+
+export default EpochGaugeVoterDataBloc;
diff --git a/components/HotWallet/plugins/TribecaGauges/EscrowData.tsx b/components/HotWallet/plugins/TribecaGauges/EscrowData.tsx
new file mode 100644
index 0000000000..90e6160f53
--- /dev/null
+++ b/components/HotWallet/plugins/TribecaGauges/EscrowData.tsx
@@ -0,0 +1,81 @@
+import { BN } from '@project-serum/anchor';
+import type { EscrowData } from '@tools/sdk/tribeca/programs';
+import { nativeAmountToFormattedUiAmount } from '@tools/sdk/units';
+import { tryGetTokenMint } from '@utils/tokens';
+import { useCallback, useEffect, useState } from 'react';
+import useWalletStore from 'stores/useWalletStore';
+
+function formatDate(dateInSec: BN): string {
+ if (dateInSec.isZero()) {
+ return '-';
+ }
+
+ // mul by 1000 to get ms
+ return new Date(dateInSec.mul(new BN(1000)).toNumber()).toUTCString();
+}
+
+const EscrowDataBloc = ({ escrowData }: { escrowData?: EscrowData }) => {
+ const connection = useWalletStore((s) => s.connection);
+ const [uiAmount, setUiAmount] = useState('-');
+
+ const loadUiAmount = useCallback(async (): Promise => {
+ if (!escrowData) return '-';
+
+ const tokenInfo = await tryGetTokenMint(
+ connection.current,
+ escrowData.tokens,
+ );
+
+ if (!tokenInfo) {
+ console.error(
+ 'Cannot load information about token mint related to escrow data (tribeca gauges)',
+ escrowData.tokens,
+ );
+ return '-';
+ }
+
+ return nativeAmountToFormattedUiAmount(
+ escrowData.amount,
+ tokenInfo.account.decimals,
+ );
+ }, [connection, escrowData]);
+
+ useEffect(() => {
+ loadUiAmount().then(setUiAmount);
+ }, [loadUiAmount]);
+
+ return (
+
+
Escrow Data
+
+ {escrowData ? (
+
+
+
+ Number of Locked Tokens
+ {' '}
+ {uiAmount}
+
+
+
+ Lock Date{' '}
+
+ {formatDate(escrowData.escrowStartedAt)}
+
+
+
+
+ Unlocking Date{' '}
+
+ {formatDate(escrowData.escrowEndsAt)}
+
+
+
+ ) : (
+
-
+ )}
+
+ );
+};
+
+export default EscrowDataBloc;
diff --git a/components/HotWallet/plugins/TribecaGauges/TribecaGauges.tsx b/components/HotWallet/plugins/TribecaGauges/TribecaGauges.tsx
new file mode 100644
index 0000000000..9e33619e62
--- /dev/null
+++ b/components/HotWallet/plugins/TribecaGauges/TribecaGauges.tsx
@@ -0,0 +1,50 @@
+import { AdjustmentsIcon } from '@heroicons/react/solid';
+import useTribecaGaugeInfos from '@hooks/useTribecaGaugesInfos';
+import ATribecaConfiguration from '@tools/sdk/tribeca/ATribecaConfiguration';
+import ActiveGaugeVotes from './ActiveGaugeVotes';
+import EpochGaugeVoterData from './EpochGaugeVoterData';
+import EscrowData from './EscrowData';
+import TribecaGaugesEpoch from './TribecaGaugesEpoch';
+
+const HotWalletPluginTribecaGauges = ({
+ tribecaConfiguration,
+}: {
+ tribecaConfiguration: ATribecaConfiguration;
+}) => {
+ const { infos, escrowOwner } = useTribecaGaugeInfos(tribecaConfiguration);
+
+ if (!escrowOwner) {
+ return <>>;
+ }
+
+ return (
+
+
+
+ {tribecaConfiguration.name} Tribeca Gauges
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
+
+export default HotWalletPluginTribecaGauges;
diff --git a/components/HotWallet/plugins/TribecaGauges/TribecaGaugesEpoch.tsx b/components/HotWallet/plugins/TribecaGauges/TribecaGaugesEpoch.tsx
new file mode 100644
index 0000000000..602bb0de52
--- /dev/null
+++ b/components/HotWallet/plugins/TribecaGauges/TribecaGaugesEpoch.tsx
@@ -0,0 +1,70 @@
+import { BN } from '@project-serum/anchor';
+import { useEffect, useState } from 'react';
+
+const ONE_DAY_IN_SEC = 3600 * 24;
+const ONE_HOUR_IN_SEC = 3600;
+const ONE_MIN_IN_SEC = 60;
+
+function formatNbSec(nbSec: BN) {
+ const nbDay = nbSec.div(new BN(ONE_DAY_IN_SEC));
+ nbSec = nbSec.sub(nbDay.mul(new BN(ONE_DAY_IN_SEC)));
+
+ const nbHour = nbSec.div(new BN(ONE_HOUR_IN_SEC));
+ nbSec = nbSec.sub(nbHour.mul(new BN(ONE_HOUR_IN_SEC)));
+
+ const nbMin = nbSec.div(new BN(ONE_MIN_IN_SEC));
+ nbSec = nbSec.sub(nbMin.mul(new BN(ONE_MIN_IN_SEC)));
+
+ return `${nbDay} days ${nbHour} hours ${nbMin} minutes ${nbSec} seconds`;
+}
+
+const TribecaGaugesEpoch = ({
+ nextEpoch,
+ rewardsEpoch,
+ epochDurationSeconds,
+}: {
+ nextEpoch?: BN;
+ rewardsEpoch?: number;
+ epochDurationSeconds?: number;
+}) => {
+ const [time, setTime] = useState('-');
+ const [formattedEpochDuration, setEpochDuration] = useState('-');
+
+ useEffect(() => {
+ if (!nextEpoch) {
+ setTime('-');
+ return;
+ }
+
+ const descriptor = setInterval(() => {
+ setTime(
+ formatNbSec(nextEpoch.sub(new BN(Date.now()).div(new BN(1_000)))),
+ );
+ }, 500);
+
+ return () => {
+ clearInterval(descriptor);
+ };
+ }, [nextEpoch]);
+
+ useEffect(() => {
+ setEpochDuration(
+ epochDurationSeconds ? formatNbSec(new BN(epochDurationSeconds)) : '-',
+ );
+ }, [epochDurationSeconds]);
+
+ return (
+
+
Current Epoch
+
{rewardsEpoch}
+
+
Epoch Duration
+
{formattedEpochDuration}
+
+
Next Epoch
+
{time}
+
+ );
+};
+
+export default TribecaGaugesEpoch;
diff --git a/components/HotWallet/plugins/UXDStaking/StakingCampaign.tsx b/components/HotWallet/plugins/UXDStaking/StakingCampaign.tsx
new file mode 100644
index 0000000000..51a848a7bd
--- /dev/null
+++ b/components/HotWallet/plugins/UXDStaking/StakingCampaign.tsx
@@ -0,0 +1,141 @@
+import { StakingCampaignInfo } from '@hooks/useHotWalletPluginUXDStaking';
+import { nativeAmountToFormattedUiAmount } from '@tools/sdk/units';
+import { getSplTokenNameByMint } from '@utils/splTokens';
+
+const StakingCampaign = ({
+ stakingCampaignInfo,
+}: {
+ stakingCampaignInfo: StakingCampaignInfo;
+}) => {
+ const startDate = new Date(
+ Number(stakingCampaignInfo.startTs) * 1_000,
+ ).toUTCString();
+
+ const endDate = stakingCampaignInfo.endTs
+ ? new Date(Number(stakingCampaignInfo.endTs) * 1_000).toUTCString()
+ : '-';
+
+ const options = stakingCampaignInfo.stakingOptions.length ? (
+ stakingCampaignInfo.stakingOptions
+ .filter(({ identifier }) => identifier)
+ .map(({ identifier, lockupSecs, apr }) => (
+
+
+
+ option {identifier}:
+
+
+
+ lock time
+
+ {lockupSecs.toNumber().toLocaleString()}s
+
+
+
+
+ apr
+
+ {apr.toNumber() / 100}%
+
+
+
+
+ ))
+ ) : (
+ No options
+ );
+
+ const rewardMintName = getSplTokenNameByMint(stakingCampaignInfo.rewardMint);
+ const stackedMintName = getSplTokenNameByMint(stakingCampaignInfo.stakedMint);
+
+ return (
+ <>
+ {stakingCampaignInfo.name}
+
+
+
+ starting date:
+ {startDate}
+
+
+
+ end date:
+ {endDate}
+
+
+
+ finalized:
+
+ {stakingCampaignInfo.isFinalized ? 'yes' : 'no'}
+
+
+
+
+
+
+ total campaign rewards:
+
+ {nativeAmountToFormattedUiAmount(
+ stakingCampaignInfo.initialRewardAmount,
+ stakingCampaignInfo.rewardMintDecimals,
+ )}
+ {rewardMintName}
+
+
+
+
+ unallocated campaign rewards:
+
+ {nativeAmountToFormattedUiAmount(
+ stakingCampaignInfo.remainingRewardAmount,
+ stakingCampaignInfo.rewardMintDecimals,
+ )}
+ {rewardMintName}
+
+
+
+
+ total staked amount v1:
+
+ {stakingCampaignInfo.uiStakedTokensV1
+ ? `${stakingCampaignInfo.uiStakedTokensV1.toLocaleString()} ${stackedMintName}`
+ : 'unknown'}
+
+
+
+
+ total staked amount v2:
+
+ {stakingCampaignInfo.uiStakedTokensV2
+ ? `${stakingCampaignInfo.uiStakedTokensV2.toLocaleString()} ${stackedMintName}`
+ : 'unknown'}
+
+
+
+
+ total created staking accounts:
+
+ {Number(
+ stakingCampaignInfo.totalCreatedStakingAccounts,
+ ).toLocaleString()}
+
+
+
+
+ total current staking accounts:
+
+ {Number(
+ stakingCampaignInfo.totalCurrentStakingAccounts,
+ ).toLocaleString()}
+
+
+
+
+
+ {options}
+
+ >
+ );
+};
+
+export default StakingCampaign;
diff --git a/components/HotWallet/plugins/UXDStaking/UXDStaking.tsx b/components/HotWallet/plugins/UXDStaking/UXDStaking.tsx
new file mode 100644
index 0000000000..5b6ec10697
--- /dev/null
+++ b/components/HotWallet/plugins/UXDStaking/UXDStaking.tsx
@@ -0,0 +1,44 @@
+import { DatabaseIcon } from '@heroicons/react/outline';
+import { HotWalletAccount } from '@hooks/useHotWallet';
+import useHotWalletPluginUXDStaking from '@hooks/useHotWalletPluginUXDStaking';
+import StakingCampaign from './StakingCampaign';
+
+const HotWalletPluginUXDStaking = ({
+ hotWalletAccount,
+}: {
+ hotWalletAccount: HotWalletAccount;
+}) => {
+ const { stakingCampaignsInfo } = useHotWalletPluginUXDStaking(
+ hotWalletAccount,
+ );
+
+ if (!stakingCampaignsInfo) {
+ return <>>;
+ }
+
+ return (
+
+
+
+ UXD Staking Stats
+
+
+
+ {stakingCampaignsInfo.length ? (
+ stakingCampaignsInfo.map((stakingCampaignInfo) => (
+
+ ))
+ ) : (
+
+ no configured campaign
+
+ )}
+
+
+ );
+};
+
+export default HotWalletPluginUXDStaking;
diff --git a/components/ImageTextSelection.tsx b/components/ImageTextSelection.tsx
new file mode 100644
index 0000000000..9900689136
--- /dev/null
+++ b/components/ImageTextSelection.tsx
@@ -0,0 +1,72 @@
+export type ImageTextElement = {
+ id: T;
+ name: string;
+ image?: string;
+};
+
+export default function ImageTextSelection({
+ selected,
+ className,
+ onClick,
+ imageTextElements,
+}: {
+ selected: T | null;
+ className?: string;
+ onClick: (selected: T | null) => void;
+ imageTextElements: ImageTextElement[];
+}) {
+ return (
+
+
+ {selected === null
+ ? 'All'
+ : imageTextElements.find(({ id }) => id === selected)!.name}
+
+
+
+ {imageTextElements.map(({ id, name, image }, index) => {
+ return (
+
+ {image ? (
+ // Image
+
onClick(id)}
+ />
+ ) : (
+ // Text
+
onClick(id)}
+ >
+ {name}
+
+ )}
+
+ {selected === id ? (
+ // Selected visual
+
+ ) : null}
+
+ );
+ })}
+
+
+ );
+}
diff --git a/components/ImgWithLoader.tsx b/components/ImgWithLoader.tsx
index c368664e4c..9bd6083984 100644
--- a/components/ImgWithLoader.tsx
+++ b/components/ImgWithLoader.tsx
@@ -1,8 +1,8 @@
-import { useState } from 'react'
-import { PhotographIcon } from '@heroicons/react/outline'
+import { useState } from 'react';
+import { PhotographIcon } from '@heroicons/react/outline';
const ImgWithLoader = (props) => {
- const [isLoading, setIsLoading] = useState(true)
+ const [isLoading, setIsLoading] = useState(true);
return (
{isLoading && (
@@ -10,7 +10,7 @@ const ImgWithLoader = (props) => {
)}
setIsLoading(false)} />
- )
-}
+ );
+};
-export default ImgWithLoader
+export default ImgWithLoader;
diff --git a/components/InlineNotification.tsx b/components/InlineNotification.tsx
index 9a8038c912..743f227129 100644
--- a/components/InlineNotification.tsx
+++ b/components/InlineNotification.tsx
@@ -1,15 +1,15 @@
-import { FunctionComponent } from 'react'
+import { FunctionComponent } from 'react';
import {
CheckCircleIcon,
ExclamationCircleIcon,
ExclamationIcon,
InformationCircleIcon,
-} from '@heroicons/react/outline'
+} from '@heroicons/react/outline';
interface InlineNotificationProps {
- desc?: string | (() => string)
- title?: string
- type: string
+ desc?: string | (() => string);
+ title?: string;
+ type: string;
}
const InlineNotification: FunctionComponent = ({
@@ -49,6 +49,6 @@ const InlineNotification: FunctionComponent = ({
-)
+);
-export default InlineNotification
+export default InlineNotification;
diff --git a/components/InstructionForm.tsx b/components/InstructionForm.tsx
new file mode 100644
index 0000000000..17698e1b98
--- /dev/null
+++ b/components/InstructionForm.tsx
@@ -0,0 +1,69 @@
+import { LinkButton } from '@components/Button';
+import { XCircleIcon } from '@heroicons/react/solid';
+import { InstructionType } from '@hooks/useGovernanceAssets';
+import { GovernedMultiTypeAccount } from '@utils/tokens';
+import { ComponentInstructionData } from '@utils/uiTypes/proposalCreationTypes';
+import SelectedInstruction from 'pages/dao/[symbol]/proposal/components/instructions/SelectedInstruction';
+import InstructionContentContainer from '../pages/dao/[symbol]/proposal/components/InstructionContentContainer';
+import SelectInstructionType from './SelectInstructionType';
+
+const InstructionForm = ({
+ idx,
+ availableInstructions,
+ governedAccount,
+ selectedInstruction,
+ setInstructionType,
+ removeInstruction,
+}: {
+ idx: number;
+ selectedInstruction: ComponentInstructionData;
+ governedAccount?: GovernedMultiTypeAccount;
+ availableInstructions: InstructionType[];
+
+ setInstructionType: ({
+ instructionType,
+ idx,
+ }: {
+ instructionType: InstructionType | null;
+ idx: number;
+ }) => void;
+
+ removeInstruction: (idx: number) => void;
+}) => {
+ return (
+
+
+ setInstructionType({ instructionType, idx })
+ }
+ selectedInstruction={selectedInstruction.type}
+ />
+
+
+
+ {selectedInstruction.type ? (
+
+ ) : null}
+
+
+ {idx != 0 ? (
+ removeInstruction(idx)}
+ >
+
+ Remove
+
+ ) : null}
+
+
+ );
+};
+
+export default InstructionForm;
diff --git a/components/InstructionsForm.tsx b/components/InstructionsForm.tsx
new file mode 100644
index 0000000000..d9bab25bcb
--- /dev/null
+++ b/components/InstructionsForm.tsx
@@ -0,0 +1,93 @@
+import { LinkButton } from '@components/Button';
+import { PlusCircleIcon } from '@heroicons/react/solid';
+import { InstructionType } from '@hooks/useGovernanceAssets';
+import { GovernedMultiTypeAccount } from '@utils/tokens';
+import { ComponentInstructionData } from '@utils/uiTypes/proposalCreationTypes';
+import { NewProposalContext } from 'pages/dao/[symbol]/proposal/new';
+import { useState } from 'react';
+import InstructionForm from './InstructionForm';
+
+const InstructionsForm = ({
+ availableInstructions,
+ onInstructionsChange,
+ governedAccount,
+}: {
+ availableInstructions: InstructionType[];
+ onInstructionsChange: (instructions: ComponentInstructionData[]) => void;
+ governedAccount?: GovernedMultiTypeAccount;
+}) => {
+ const [instructions, setInstructions] = useState([
+ // One empty instruction at start
+ {},
+ ]);
+
+ const handleSetInstruction = (
+ val: Partial,
+ idx: number,
+ ) => {
+ const newInstructions = [...instructions];
+ newInstructions[idx] = { ...instructions[idx], ...val };
+ setInstructions(newInstructions);
+ onInstructionsChange(newInstructions);
+ };
+
+ const setInstructionType = ({
+ instructionType,
+ idx,
+ }: {
+ instructionType: InstructionType | null;
+ idx: number;
+ }) => {
+ handleSetInstruction(
+ {
+ type: instructionType ? instructionType : undefined,
+ },
+ idx,
+ );
+ };
+
+ const addInstruction = () => {
+ setInstructions([...instructions, { type: undefined }]);
+ };
+
+ const removeInstruction = (idx: number) => {
+ setInstructions([...instructions.filter((x, index) => index !== idx)]);
+ };
+
+ return (
+ <>
+
+ Instructions
+
+ {instructions.map((instruction, idx) => (
+
+ ))}
+
+
+
+
+
+ Add instruction
+
+
+ >
+ );
+};
+
+export default InstructionsForm;
diff --git a/components/Link.tsx b/components/Link.tsx
index ab7216acc4..f66fee8546 100644
--- a/components/Link.tsx
+++ b/components/Link.tsx
@@ -1,6 +1,6 @@
-import { FunctionComponent } from 'react'
-import styled from '@emotion/styled'
-import tw from 'twin.macro'
+import { FunctionComponent } from 'react';
+import styled from '@emotion/styled';
+import tw from 'twin.macro';
const StyledButton = styled.a`
font-weight: 700;
@@ -13,7 +13,7 @@ const StyledButton = styled.a`
:disabled {
${tw`cursor-not-allowed opacity-60`}
}
-`
+`;
// default heroicon does not allow customizing stroke
const ChevronRightIcon = ({ className }) => (
@@ -26,10 +26,10 @@ const ChevronRightIcon = ({ className }) => (
>
-)
+);
interface LinkProps {
- className?: string
+ className?: string;
}
const Link: FunctionComponent = ({
@@ -47,7 +47,7 @@ const Link: FunctionComponent = ({
className={`relative stroke-3 top-1 h-4 w-4 text-fgd-1 ml-1`}
/>
- )
-}
+ );
+};
-export default Link
+export default Link;
diff --git a/components/LinkLeft.tsx b/components/LinkLeft.tsx
deleted file mode 100644
index efa1c85165..0000000000
--- a/components/LinkLeft.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-import { FunctionComponent } from 'react'
-import styled from '@emotion/styled'
-import tw from 'twin.macro'
-
-const StyledButton = styled.a`
- font-weight: 700;
- cursor: pointer;
-
- :hover {
- ${tw`underline`}
- }
-
- :disabled {
- ${tw`cursor-not-allowed opacity-60`}
- }
-`
-
-// default heroicon does not allow customizing stroke
-const ChevronRightIcon = ({ className }) => (
-
-)
-
-interface LinkLeftProps {
- className?: string
- href?: string
-}
-
-const LinkLeft: FunctionComponent = ({
- children,
- className,
- ...props
-}) => {
- return (
-
- {children}
-
-
- )
-}
-
-export default LinkLeft
diff --git a/components/LinksCompactWrapper.tsx b/components/LinksCompactWrapper.tsx
deleted file mode 100644
index be6cf630ec..0000000000
--- a/components/LinksCompactWrapper.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-import {
- CloudDownloadIcon,
- DocumentIcon,
- LinkIcon,
-} from '@heroicons/react/outline'
-
-const LinksCompactWrapper = () => {
- return (
- <>
-
-
-
-
Docs that may help you
-
-
-
-
-
-
-
-
-
- >
- )
-}
-
-export default LinksCompactWrapper
diff --git a/components/Loading.tsx b/components/Loading.tsx
index c9fe6011e1..13233d6853 100644
--- a/components/Loading.tsx
+++ b/components/Loading.tsx
@@ -1,9 +1,9 @@
-import { FunctionComponent } from 'react'
+import { FunctionComponent } from 'react';
interface LoadingProps {
- className?: string
- w?: string
- h?: string
+ className?: string;
+ w?: string;
+ h?: string;
}
const Loading: FunctionComponent = ({
@@ -34,7 +34,7 @@ const Loading: FunctionComponent = ({
>
- )
-}
+ );
+};
-export default Loading
+export default Loading;
diff --git a/components/Members/AddMemberForm.tsx b/components/Members/AddMemberForm.tsx
deleted file mode 100644
index e07ec3fb2e..0000000000
--- a/components/Members/AddMemberForm.tsx
+++ /dev/null
@@ -1,356 +0,0 @@
-import { PublicKey } from '@solana/web3.js'
-import useRealm from 'hooks/useRealm'
-import Input from 'components/inputs/Input'
-import Button, { SecondaryButton } from '@components/Button'
-import VoteBySwitch from 'pages/dao/[symbol]/proposal/components/VoteBySwitch'
-import { getMintMinAmountAsDecimal } from '@tools/sdk/units'
-import { abbreviateAddress, precision } from 'utils/formatting'
-import useWalletStore from 'stores/useWalletStore'
-import { getMintSchema } from 'utils/validations'
-import { useEffect, useState } from 'react'
-import { MintForm, UiInstruction } from 'utils/uiTypes/proposalCreationTypes'
-import useGovernanceAssets from 'hooks/useGovernanceAssets'
-import {
- getInstructionDataFromBase64,
- RpcContext,
- Governance,
- ProgramAccount,
-} from '@solana/spl-governance'
-import { useRouter } from 'next/router'
-import { createProposal } from 'actions/createProposal'
-import { notify } from 'utils/notifications'
-import useQueryContext from 'hooks/useQueryContext'
-import { getMintInstruction } from 'utils/instructionTools'
-import AddMemberIcon from '@components/AddMemberIcon'
-import { getProgramVersionForRealm } from '@models/registry/api'
-import {
- ArrowCircleDownIcon,
- ArrowCircleUpIcon,
-} from '@heroicons/react/outline'
-import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore'
-
-interface AddMemberForm extends MintForm {
- description: string
- title: string
-}
-
-const AddMemberForm = ({ close }) => {
- const [voteByCouncil, setVoteByCouncil] = useState(false)
- const [showOptions, setShowOptions] = useState(false)
- const [isLoading, setIsLoading] = useState(false)
- const [formErrors, setFormErrors] = useState({})
-
- const router = useRouter()
- const client = useVoteStakeRegistryClientStore((s) => s.state.client)
- const connection = useWalletStore((s) => s.connection)
- const wallet = useWalletStore((s) => s.current)
-
- const { fmtUrlWithCluster } = useQueryContext()
- const { fetchRealmGovernance } = useWalletStore((s) => s.actions)
- const { symbol } = router.query
- const { getMintWithGovernances } = useGovernanceAssets()
-
- const {
- realmInfo,
- canChooseWhoVote,
- councilMint,
- realm,
- ownVoterWeight,
- mint,
- } = useRealm()
-
- const programId: PublicKey | undefined = realmInfo?.programId
-
- const [form, setForm] = useState({
- destinationAccount: '',
- amount: 1,
- mintAccount: undefined,
- programId: programId?.toString(),
- description: '',
- title: '',
- })
-
- const schema = getMintSchema({ form, connection })
-
- const mintMinAmount = form.mintAccount
- ? getMintMinAmountAsDecimal(councilMint!)
- : 1
-
- const currentPrecision = precision(mintMinAmount)
-
- const proposalTitle = `Add council member ${
- form.destinationAccount
- ? abbreviateAddress(new PublicKey(form.destinationAccount))
- : ''
- }`
-
- const setAmount = (event) => {
- const value = event.target.value
-
- handleSetForm({
- value: value,
- propertyName: 'amount',
- })
- }
-
- const handleSetForm = ({ propertyName, value }) => {
- setFormErrors({})
- setForm({ ...form, [propertyName]: value })
- }
-
- const validateAmountOnBlur = () => {
- const value = form.amount
-
- handleSetForm({
- value: parseFloat(
- Math.max(
- Number(mintMinAmount),
- Math.min(Number(Number.MAX_SAFE_INTEGER), Number(value))
- ).toFixed(currentPrecision)
- ),
- propertyName: 'amount',
- })
- }
-
- const getInstruction = async (): Promise => {
- return getMintInstruction({
- schema,
- form,
- programId,
- connection,
- wallet,
- governedMintInfoAccount: form.mintAccount,
- setFormErrors,
- })
- }
-
- //TODO common handle propose
- const handlePropose = async () => {
- setIsLoading(true)
-
- const instruction: UiInstruction = await getInstruction()
-
- if (instruction.isValid && wallet && realmInfo) {
- const governance = form.mintAccount?.governance
-
- let proposalAddress: PublicKey | null = null
-
- if (!realm) {
- setIsLoading(false)
-
- throw new Error('No realm selected')
- }
-
- const rpcContext = new RpcContext(
- new PublicKey(realm.owner.toString()),
- getProgramVersionForRealm(realmInfo),
- wallet,
- connection.current,
- connection.endpoint
- )
-
- const instructionData = {
- data: instruction.serializedInstruction
- ? getInstructionDataFromBase64(instruction.serializedInstruction)
- : null,
- holdUpTime: governance?.account?.config.minInstructionHoldUpTime,
- prerequisiteInstructions: instruction.prerequisiteInstructions || [],
- }
-
- try {
- const selectedGovernance = (await fetchRealmGovernance(
- governance?.pubkey
- )) as ProgramAccount
-
- const ownTokenRecord = ownVoterWeight.getTokenRecordToCreateProposal(
- governance!.account.config
- )
-
- const defaultProposalMint = !mint?.supply.isZero()
- ? realm.account.communityMint
- : !councilMint?.supply.isZero()
- ? realm.account.config.councilMint
- : undefined
-
- const proposalMint =
- canChooseWhoVote && voteByCouncil
- ? realm.account.config.councilMint
- : defaultProposalMint
-
- if (!proposalMint) {
- throw new Error(
- 'There is no suitable governing token for the proposal'
- )
- }
-
- proposalAddress = await createProposal(
- rpcContext,
- realm,
- selectedGovernance.pubkey,
- ownTokenRecord.pubkey,
- form.title ? form.title : proposalTitle,
- form.description ? form.description : '',
- proposalMint,
- selectedGovernance?.account?.proposalCount,
- [instructionData],
- false,
- client
- )
-
- const url = fmtUrlWithCluster(
- `/dao/${symbol}/proposal/${proposalAddress}`
- )
-
- router.push(url)
- } catch (error) {
- notify({
- type: 'error',
- message: `${error}`,
- })
-
- close()
- }
- }
-
- setIsLoading(false)
- }
-
- useEffect(() => {
- const initForm = async () => {
- const response = await getMintWithGovernances()
-
- handleSetForm({
- value: response.find(
- (x) =>
- x.governance?.account.governedAccount.toBase58() ===
- realm?.account.config.councilMint?.toBase58()
- ),
- propertyName: 'mintAccount',
- })
- }
-
- initForm()
- }, [])
-
- return (
- <>
-
-
-
-
Add new member to {realmInfo?.displayName}
-
-
-
- handleSetForm({
- value: event.target.value,
- propertyName: 'destinationAccount',
- })
- }
- noMaxWidth
- error={formErrors['destinationAccount']}
- />
-
- setShowOptions(!showOptions)}
- >
- {showOptions ? (
-
- ) : (
-
- )}
-
Options
-
-
- {showOptions && (
- <>
-
- handleSetForm({
- value: event.target.value,
- propertyName: 'title',
- })
- }
- />
-
-
- handleSetForm({
- value: event.target.value,
- propertyName: 'description',
- })
- }
- />
-
-
-
- {canChooseWhoVote && (
- {
- setVoteByCouncil(!voteByCouncil)
- }}
- />
- )}
- >
- )}
-
-
- close()}
- >
- Cancel
-
-
-
-
- >
- )
-}
-
-export default AddMemberForm
diff --git a/components/Members/MemberItem.tsx b/components/Members/MemberItem.tsx
index 0206a331e7..09054d51b1 100644
--- a/components/Members/MemberItem.tsx
+++ b/components/Members/MemberItem.tsx
@@ -1,21 +1,20 @@
-import { UserCircleIcon, LogoutIcon } from '@heroicons/react/outline'
-import useRealm from '@hooks/useRealm'
-import { tryParsePublicKey } from '@tools/core/pubkey'
-import { fmtMintAmount } from '@tools/sdk/units'
-import tokenService from '@utils/services/token'
-import useMembersListStore from 'stores/useMembersStore'
-import { ViewState } from './types'
-import { useMemo } from 'react'
-import { Member } from '@utils/uiTypes/members'
-import { AddressImage, DisplayAddress } from '@cardinal/namespaces-components'
-import useWalletStore from 'stores/useWalletStore'
+import { UserCircleIcon, LogoutIcon } from '@heroicons/react/outline';
+import useRealm from '@hooks/useRealm';
+import { tryParsePublicKey } from '@tools/core/pubkey';
+import { fmtMintAmount } from '@tools/sdk/units';
+import { abbreviateAddress } from '@utils/formatting';
+import tokenService from '@utils/services/token';
+import useMembersListStore from 'stores/useMembersStore';
+import { ViewState } from './types';
+import { useMemo } from 'react';
+import { Member } from '@utils/uiTypes/members';
const MemberItem = ({ item }: { item: Member }) => {
- const { mint, councilMint, realm } = useRealm()
+ const { mint, councilMint, realm } = useRealm();
const {
setCurrentCompactView,
setCurrentCompactViewMember,
- } = useMembersListStore()
+ } = useMembersListStore();
const {
walletAddress,
councilVotes,
@@ -23,67 +22,43 @@ const MemberItem = ({ item }: { item: Member }) => {
votesCasted,
hasCouncilTokenOutsideRealm,
hasCommunityTokenOutsideRealm,
- } = item
- const { connection } = useWalletStore((s) => s)
+ } = item;
- const walletPublicKey = tryParsePublicKey(walletAddress)
+ const walletPublicKey = tryParsePublicKey(walletAddress);
const tokenName = realm
? tokenService.getTokenInfo(realm?.account.communityMint.toBase58())?.symbol
- : ''
- const totalVotes = votesCasted
+ : '';
+ const totalVotes = votesCasted;
const communityAmount =
communityVotes && !communityVotes.isZero()
? useMemo(() => fmtMintAmount(mint, communityVotes), [item.walletAddress])
- : null
+ : null;
const councilAmount =
councilVotes && !councilVotes.isZero()
? useMemo(() => fmtMintAmount(councilMint, councilVotes), [
item.walletAddress,
])
- : null
+ : null;
+
+ const walletAddressFormatted = walletPublicKey
+ ? abbreviateAddress(walletPublicKey)
+ : '-';
async function handleGoToMemberOverview() {
- setCurrentCompactView(ViewState.MemberOverview)
- setCurrentCompactViewMember(item)
+ setCurrentCompactView(ViewState.MemberOverview);
+ setCurrentCompactViewMember(item);
}
- const address = useMemo(
- () => (
- }
- />
- ),
- [item.walletAddress]
- )
-
- const addressName = useMemo(
- () => (
-
- ),
- [item.walletAddress]
- )
-
return (
- {address}
+
-
{addressName}
+
{walletAddressFormatted}
Votes cast: {totalVotes}
@@ -107,7 +82,7 @@ const MemberItem = ({ item }: { item: Member }) => {
- )
-}
+ );
+};
-export default MemberItem
+export default MemberItem;
diff --git a/components/Members/MemberOverview.tsx b/components/Members/MemberOverview.tsx
index 83363cb5b1..8cb9e653fc 100644
--- a/components/Members/MemberOverview.tsx
+++ b/components/Members/MemberOverview.tsx
@@ -1,5 +1,4 @@
-import { AddressImage, DisplayAddress } from '@cardinal/namespaces-components'
-import { getExplorerUrl } from '@components/explorer/tools'
+import { getExplorerUrl } from '@components/explorer/tools';
import {
ArrowLeftIcon,
CheckCircleIcon,
@@ -7,37 +6,42 @@ import {
LogoutIcon,
UserCircleIcon,
XCircleIcon,
-} from '@heroicons/react/outline'
-import useQueryContext from '@hooks/useQueryContext'
-import useRealm from '@hooks/useRealm'
-import { getVoteRecordsByVoterMapByProposal } from '@models/api'
-import { isYesVote } from '@models/voteRecords'
-import { GOVERNANCE_CHAT_PROGRAM_ID, VoteRecord } from '@solana/spl-governance'
-import { ChatMessage, ProgramAccount } from '@solana/spl-governance'
-import { getGovernanceChatMessagesByVoter } from '@solana/spl-governance'
+} from '@heroicons/react/outline';
+import useQueryContext from '@hooks/useQueryContext';
+import useRealm from '@hooks/useRealm';
+import { getVoteRecordsByVoterMapByProposal } from '@models/api';
+import { isYesVote } from '@models/voteRecords';
+import { GOVERNANCE_CHAT_PROGRAM_ID, VoteRecord } from '@solana/spl-governance';
+import { ChatMessage, ProgramAccount } from '@solana/spl-governance';
+import { getGovernanceChatMessagesByVoter } from '@solana/spl-governance';
-import { PublicKey } from '@solana/web3.js'
-import { tryParsePublicKey } from '@tools/core/pubkey'
-import { accountsToPubkeyMap } from '@tools/sdk/accounts'
-import { fmtMintAmount } from '@tools/sdk/units'
-import { notify } from '@utils/notifications'
-import tokenService from '@utils/services/token'
-import React, { useEffect, useMemo, useState } from 'react'
-import useMembersListStore from 'stores/useMembersStore'
-import useWalletStore from 'stores/useWalletStore'
-import { ViewState, WalletTokenRecordWithProposal } from './types'
+import { PublicKey } from '@solana/web3.js';
+import { tryParsePublicKey } from '@tools/core/pubkey';
+import { accountsToPubkeyMap } from '@tools/sdk/accounts';
+import { fmtMintAmount } from '@tools/sdk/units';
+import { notify } from '@utils/notifications';
+import { abbreviateAddress } from '@utils/formatting';
+
+import tokenService from '@utils/services/token';
+import React, { useEffect, useMemo, useState } from 'react';
+import useMembersListStore from 'stores/useMembersStore';
+import useWalletStore from 'stores/useWalletStore';
+import { ViewState, WalletTokenRecordWithProposal } from './types';
const MemberOverview = () => {
- const { realm } = useRealm()
- const member = useMembersListStore((s) => s.compact.currentMember)
- const connection = useWalletStore((s) => s.connection)
- const selectedRealm = useWalletStore((s) => s.selectedRealm)
- const { mint, councilMint, proposals, symbol } = useRealm()
- const { setCurrentCompactView, resetCompactViewState } = useMembersListStore()
- const { fmtUrlWithCluster } = useQueryContext()
+ const { realm } = useRealm();
+ const member = useMembersListStore((s) => s.compact.currentMember);
+ const connection = useWalletStore((s) => s.connection);
+ const selectedRealm = useWalletStore((s) => s.selectedRealm);
+ const { mint, councilMint, proposals, symbol } = useRealm();
+ const {
+ setCurrentCompactView,
+ resetCompactViewState,
+ } = useMembersListStore();
+ const { fmtUrlWithCluster } = useQueryContext();
const [ownVoteRecords, setOwnVoteRecords] = useState<
WalletTokenRecordWithProposal[]
- >([])
+ >([]);
const {
walletAddress,
@@ -46,94 +50,98 @@ const MemberOverview = () => {
votesCasted,
hasCommunityTokenOutsideRealm,
hasCouncilTokenOutsideRealm,
- } = member!
- const walletPublicKey = tryParsePublicKey(walletAddress)
+ } = member!;
+ const walletPublicKey = tryParsePublicKey(walletAddress);
const tokenName = realm
? tokenService.getTokenInfo(realm?.account.communityMint.toBase58())?.symbol
- : ''
- const totalVotes = votesCasted
+ : '';
+ const totalVotes = votesCasted;
const communityAmount =
communityVotes && !communityVotes.isZero()
? useMemo(() => fmtMintAmount(mint, communityVotes), [
member!.walletAddress,
])
- : null
+ : null;
const councilAmount =
councilVotes && !councilVotes.isZero()
? useMemo(() => fmtMintAmount(councilMint, councilVotes), [
member!.walletAddress,
])
- : null
+ : null;
+
+ const walletAddressFormatted = walletPublicKey
+ ? abbreviateAddress(walletPublicKey)
+ : '-';
const handleGoBackToMainView = async () => {
- setCurrentCompactView(ViewState.MainView)
- resetCompactViewState()
- }
+ setCurrentCompactView(ViewState.MainView);
+ resetCompactViewState();
+ };
const getVoteRecordsAndChatMsgs = async () => {
- let voteRecords: { [pubKey: string]: ProgramAccount } = {}
- let chatMessages: { [pubKey: string]: ProgramAccount } = {}
+ let voteRecords: { [pubKey: string]: ProgramAccount } = {};
+ let chatMessages: { [pubKey: string]: ProgramAccount } = {};
try {
const results = await Promise.all([
getVoteRecordsByVoterMapByProposal(
connection.current,
selectedRealm!.programId!,
- new PublicKey(member!.walletAddress)
+ new PublicKey(member!.walletAddress),
),
getGovernanceChatMessagesByVoter(
connection!.current,
GOVERNANCE_CHAT_PROGRAM_ID,
- new PublicKey(member!.walletAddress)
+ new PublicKey(member!.walletAddress),
),
- ])
- voteRecords = results[0]
- chatMessages = accountsToPubkeyMap(results[1])
+ ]);
+ voteRecords = results[0];
+ chatMessages = accountsToPubkeyMap(results[1]);
} catch (e) {
notify({
message: 'Unable to fetch vote records for selected wallet address',
type: 'error',
- })
+ });
}
- return { voteRecords, chat: chatMessages }
- }
+ return { voteRecords, chat: chatMessages };
+ };
useEffect(() => {
//we get voteRecords sorted by proposal date and match it with proposal name and chat msgs leaved by token holder.
const handleSetVoteRecords = async () => {
- const { voteRecords, chat } = await getVoteRecordsAndChatMsgs()
+ const { voteRecords, chat } = await getVoteRecordsAndChatMsgs();
const voteRecordsArray: WalletTokenRecordWithProposal[] = Object.keys(
- voteRecords
+ voteRecords,
)
.sort((a, b) => {
- const prevProposal = proposals[a]
- const nextProposal = proposals[b]
+ const prevProposal = proposals[a];
+ const nextProposal = proposals[b];
return (
prevProposal?.account.getStateTimestamp() -
nextProposal?.account.getStateTimestamp()
- )
+ );
})
.reverse()
.filter((x) => proposals[x])
.flatMap((x) => {
- const currentProposal = proposals[x]
+ const currentProposal = proposals[x];
const currentChatsMsgPk = Object.keys(chat).filter(
(c) =>
chat[c]?.account.proposal.toBase58() ===
- currentProposal?.pubkey.toBase58()
- )
+ currentProposal?.pubkey.toBase58(),
+ );
const currentChatMsgs = currentChatsMsgPk.map(
- (c) => chat[c].account.body.value
- )
+ (c) => chat[c].account.body.value,
+ );
return {
proposalPublicKey: x,
proposalName: currentProposal?.account.name,
chatMessages: currentChatMsgs,
...voteRecords[x],
- }
- })
+ };
+ });
- setOwnVoteRecords(voteRecordsArray)
- }
- handleSetVoteRecords()
- }, [walletAddress])
+ setOwnVoteRecords(voteRecordsArray);
+ };
+ handleSetVoteRecords();
+ }, [walletAddress]);
return (
<>
@@ -143,13 +151,7 @@ const MemberOverview = () => {
onClick={handleGoBackToMainView}
className="h-4 w-4 mr-1 text-primary-light mr-2"
/>
-
+ {walletAddressFormatted}
{
>
-
+
Votes cast: {totalVotes}
@@ -206,7 +199,7 @@ const MemberOverview = () => {
{ownVoteRecords.map((x) => (
{
))}
>
- )
-}
+ );
+};
-export default MemberOverview
+export default MemberOverview;
diff --git a/components/Members/MembersCompactWrapper.tsx b/components/Members/MembersCompactWrapper.tsx
index d7d966a6ac..8bdccb6c7b 100644
--- a/components/Members/MembersCompactWrapper.tsx
+++ b/components/Members/MembersCompactWrapper.tsx
@@ -1,50 +1,20 @@
-import useRealm from '@hooks/useRealm'
-import React, { useEffect, useState } from 'react'
-import useMembersListStore from 'stores/useMembersStore'
-import { ViewState } from './types'
-import MembersItems from './MembersItems'
-import useMembers from './useMembers'
-import MemberOverview from './MemberOverview'
-import { PlusIcon } from '@heroicons/react/outline'
-import useGovernanceAssets from '@hooks/useGovernanceAssets'
-import Tooltip from '@components/Tooltip'
-import useWalletStore from 'stores/useWalletStore'
-import Modal from '@components/Modal'
-import AddMemberForm from './AddMemberForm'
+import useRealm from '@hooks/useRealm';
+import React, { useEffect } from 'react';
+import useMembersListStore from 'stores/useMembersStore';
+import { ViewState } from './types';
+import MembersItems from './MembersItems';
+import useMembers from './useMembers';
+import MemberOverview from './MemberOverview';
const MembersCompactWrapper = () => {
- const {
- symbol,
- councilMint,
- toManyCouncilOutstandingProposalsForUse,
- toManyCommunityOutstandingProposalsForUser,
- } = useRealm()
- const { members, activeMembers } = useMembers()
- const connected = useWalletStore((s) => s.connected)
- const activeMembersCount = activeMembers.length
- const { resetCompactViewState } = useMembersListStore()
- const {
- canUseMintInstruction,
- canMintRealmCouncilToken,
- } = useGovernanceAssets()
- const currentView = useMembersListStore((s) => s.compact.currentView)
+ const { symbol } = useRealm();
+ const { members, activeMembers } = useMembers();
+ const activeMembersCount = activeMembers.length;
+ const { resetCompactViewState } = useMembersListStore();
+ const currentView = useMembersListStore((s) => s.compact.currentView);
const totalVotesCast = members.reduce((prev, current) => {
- return prev + current.votesCasted
- }, 0)
-
- const [openAddMemberModal, setOpenAddMemberModal] = useState(false)
-
- const addNewMemberTooltip = !connected
- ? 'Connect your wallet to add new council member'
- : !canMintRealmCouncilToken()
- ? 'Your realm need mint governance for council token to add new member'
- : !canUseMintInstruction
- ? "You don't have enough governance power to add new council member"
- : toManyCommunityOutstandingProposalsForUser
- ? 'You have too many community outstanding proposals. You need to finalize them before creating a new council member.'
- : toManyCouncilOutstandingProposalsForUse
- ? 'You have too many council outstanding proposals. You need to finalize them before creating a new council member.'
- : ''
+ return prev + current.votesCasted;
+ }, 0);
const getCurrentView = () => {
switch (currentView) {
@@ -53,26 +23,6 @@ const MembersCompactWrapper = () => {
<>
Members ({activeMembersCount})
- {councilMint && (
-
- setOpenAddMemberModal(!openAddMemberModal)}
- className={`bg-bkg-2 default-transition
- flex flex-col items-center justify-center
- rounded-lg hover:bg-bkg-3 ml-auto
- hover:cursor-pointer ${
- addNewMemberTooltip ? 'opacity-60 pointer-events-none' : ''
- }`}
- >
-
-
-
- )}
@@ -84,31 +34,20 @@ const MembersCompactWrapper = () => {
-
- {openAddMemberModal && (
-
setOpenAddMemberModal(false)}
- isOpen={openAddMemberModal}
- >
- setOpenAddMemberModal(false)} />
-
- )}
>
- )
+ );
case ViewState.MemberOverview:
- return
+ return
;
}
- }
+ };
useEffect(() => {
- resetCompactViewState()
- }, [symbol])
+ resetCompactViewState();
+ }, [symbol]);
return (
{getCurrentView()}
- )
-}
+ );
+};
-export default MembersCompactWrapper
+export default MembersCompactWrapper;
diff --git a/components/Members/MembersItems.tsx b/components/Members/MembersItems.tsx
index 6bd1e6c924..6ed51f2cba 100644
--- a/components/Members/MembersItems.tsx
+++ b/components/Members/MembersItems.tsx
@@ -1,22 +1,24 @@
-import PaginationComponent from '@components/Pagination'
-import { Member } from '@utils/uiTypes/members'
-import dynamic from 'next/dynamic'
-import { useEffect, useState } from 'react'
-const MemberItem = dynamic(() => import('./MemberItem'))
+import PaginationComponent from '@components/Pagination';
+import { Member } from '@utils/uiTypes/members';
+import dynamic from 'next/dynamic';
+import { useEffect, useState } from 'react';
+const MemberItem = dynamic(() => import('./MemberItem'));
const MembersItems = ({ activeMembers }: { activeMembers: Member[] }) => {
- const perPage = 7
- const [members, setMembers] = useState
([])
- const totalPages = Math.ceil(activeMembers.length / perPage)
+ const perPage = 7;
+ const [members, setMembers] = useState([]);
+ const totalPages = Math.ceil(activeMembers.length / perPage);
const onPageChange = (page) => {
- setMembers(paginateMembers(page))
- }
+ setMembers(paginateMembers(page));
+ };
+
const paginateMembers = (page) => {
- return activeMembers.slice(page * perPage, (page + 1) * perPage)
- }
+ return activeMembers.slice(page * perPage, (page + 1) * perPage);
+ };
+
useEffect(() => {
- setMembers(paginateMembers(0))
- }, [activeMembers.length])
+ setMembers(paginateMembers(0));
+ }, [activeMembers.length]);
return (
<>
@@ -32,6 +34,6 @@ const MembersItems = ({ activeMembers }: { activeMembers: Member[] }) => {
>
>
- )
-}
-export default MembersItems
+ );
+};
+export default MembersItems;
diff --git a/components/Members/types.ts b/components/Members/types.ts
index 79bea9dd17..db932f6273 100644
--- a/components/Members/types.ts
+++ b/components/Members/types.ts
@@ -1,5 +1,5 @@
-import { TokenOwnerRecord, VoteRecord } from '@solana/spl-governance'
-import { ProgramAccount } from '@solana/spl-governance'
+import { TokenOwnerRecord, VoteRecord } from '@solana/spl-governance';
+import { ProgramAccount } from '@solana/spl-governance';
export enum ViewState {
MainView,
@@ -8,14 +8,14 @@ export enum ViewState {
}
export interface TokenRecordsWithWalletAddress {
- walletAddress: string
- council?: ProgramAccount
| undefined
- community?: ProgramAccount | undefined
+ walletAddress: string;
+ council?: ProgramAccount | undefined;
+ community?: ProgramAccount | undefined;
}
export interface WalletTokenRecordWithProposal
extends ProgramAccount {
- proposalPublicKey: string
- proposalName: string
- chatMessages: string[]
+ proposalPublicKey: string;
+ proposalName: string;
+ chatMessages: string[];
}
diff --git a/components/Members/useMembers.tsx b/components/Members/useMembers.tsx
index 62ad969736..e22b78d5c5 100644
--- a/components/Members/useMembers.tsx
+++ b/components/Members/useMembers.tsx
@@ -1,109 +1,109 @@
-import { TokenRecordsWithWalletAddress } from './types'
-import useRealm from '@hooks/useRealm'
-import { useEffect, useMemo, useState } from 'react'
-import useWalletStore from 'stores/useWalletStore'
+import { TokenRecordsWithWalletAddress } from './types';
+import useRealm from '@hooks/useRealm';
+import { useEffect, useMemo, useState } from 'react';
+import useWalletStore from 'stores/useWalletStore';
import {
getMultipleAccountInfoChunked,
getTokenAccountsByMint,
parseTokenAccountData,
TokenProgramAccount,
-} from '@utils/tokens'
+} from '@utils/tokens';
import {
AccountInfo,
ASSOCIATED_TOKEN_PROGRAM_ID,
Token,
TOKEN_PROGRAM_ID,
-} from '@solana/spl-token'
-import { Member } from 'utils/uiTypes/members'
-import { BN } from '@project-serum/anchor'
-import { PublicKey } from '@solana/web3.js'
-import { usePrevious } from '@hooks/usePrevious'
-import { capitalize } from '@utils/helpers'
+} from '@solana/spl-token';
+import { Member } from 'utils/uiTypes/members';
+import { PublicKey } from '@solana/web3.js';
+import { usePrevious } from '@hooks/usePrevious';
+import { BN_ZERO, capitalize } from '@utils/helpers';
export default function useMembers() {
- const { tokenRecords, councilTokenOwnerRecords, realm } = useRealm()
- const connection = useWalletStore((s) => s.connection)
- const previousRealmPubKey = usePrevious(realm?.pubkey.toBase58()) as string
+ const { tokenRecords, councilTokenOwnerRecords, realm } = useRealm();
+ const connection = useWalletStore((s) => s.connection);
+ const previousRealmPubKey = usePrevious(realm?.pubkey.toBase58()) as string;
const fetchCouncilMembersWithTokensOutsideRealm = async () => {
if (realm?.account.config.councilMint) {
const tokenAccounts = await getTokenAccountsByMint(
connection.current,
- realm.account.config.councilMint.toBase58()
- )
- const tokenAccountsInfo: TokenProgramAccount[] = []
+ realm.account.config.councilMint.toBase58(),
+ );
+ const tokenAccountsInfo: TokenProgramAccount[] = [];
for (const acc of tokenAccounts) {
- tokenAccountsInfo.push(acc)
+ tokenAccountsInfo.push(acc);
}
//we filter out people who dont have any tokens and we filter out accounts owned by realm e.g.
//accounts that holds deposited tokens inside realm.
return tokenAccountsInfo.filter(
(x) =>
!x.account.amount.isZero() &&
- x.account.owner.toBase58() !== realm?.pubkey.toBase58()
- )
+ x.account.owner.toBase58() !== realm?.pubkey.toBase58(),
+ );
}
- return []
- }
+ return [];
+ };
//This will need to be rewritten for better performance if some realm hits more then +-5k+ members
const fetchCommunityMembersATAS = async () => {
if (realm?.account.communityMint) {
- const ATAS: PublicKey[] = []
+ const ATAS: PublicKey[] = [];
//we filter out people who never voted and has tokens inside realm
const communityTokenRecordsWallets = tokenRecordArray
.filter(
(x) =>
x.community?.account.totalVotesCount &&
x.community?.account.totalVotesCount > 0 &&
- x.community.account.governingTokenDepositAmount.isZero()
+ x.community.account.governingTokenDepositAmount.isZero(),
)
- .map((x) => x.walletAddress)
+ .map((x) => x.walletAddress);
for (const walletAddress of communityTokenRecordsWallets) {
const ata = await Token.getAssociatedTokenAddress(
ASSOCIATED_TOKEN_PROGRAM_ID, // always ASSOCIATED_TOKEN_PROGRAM_ID
TOKEN_PROGRAM_ID, // always TOKEN_PROGRAM_ID
realm!.account.communityMint, // mint
- new PublicKey(walletAddress) // owner
- )
- ATAS.push(ata)
+ new PublicKey(walletAddress), // owner
+ );
+ ATAS.push(ata);
}
const ownersAtas = await getMultipleAccountInfoChunked(
connection.current,
- ATAS
- )
+ ATAS,
+ );
const ownersAtasParsed: TokenProgramAccount[] = ownersAtas
.filter((x) => x)
.map((r) => {
- const publicKey = r!.owner
- const data = Buffer.from(r!.data)
- const account = parseTokenAccountData(r!.owner, data)
- return { publicKey, account }
- })
- return ownersAtasParsed
+ const publicKey = r!.owner;
+ // TRICK to make it compile
+ const data = Buffer.from(r!.data as any);
+ const account = parseTokenAccountData(r!.owner, data);
+ return { publicKey, account };
+ });
+ return ownersAtasParsed;
}
- return []
- }
+ return [];
+ };
const matchMembers = (
membersArray,
membersToMatch,
type,
- pushNonExisting = false
+ pushNonExisting = false,
) => {
- const votesPropoName = `${type.toLowerCase()}Votes`
- const hasVotesOutsidePropName = `has${capitalize(type)}TokenOutsideRealm`
- const members = [...membersArray]
+ const votesPropoName = `${type.toLowerCase()}Votes`;
+ const hasVotesOutsidePropName = `has${capitalize(type)}TokenOutsideRealm`;
+ const members = [...membersArray];
for (const memberToMatch of membersToMatch) {
//We match members that had deposited tokens at least once
const member = members.find(
- (x) => x.walletAddress === memberToMatch.account.owner.toBase58()
- )
+ (x) => x.walletAddress === memberToMatch.account.owner.toBase58(),
+ );
if (member) {
member[votesPropoName] = member[votesPropoName].add(
- memberToMatch.account.amount
- )
+ memberToMatch.account.amount,
+ );
if (!memberToMatch.account.amount.isZero()) {
- member[hasVotesOutsidePropName] = true
+ member[hasVotesOutsidePropName] = true;
}
} else if (pushNonExisting) {
//we add members who never deposited tokens inside realm
@@ -111,13 +111,13 @@ export default function useMembers() {
walletAddress: memberToMatch.account.owner.toBase58(),
votesCasted: 0,
[votesPropoName]: memberToMatch.account.amount,
- communityVotes: new BN(0),
+ communityVotes: BN_ZERO,
[hasVotesOutsidePropName]: true,
- })
+ });
}
}
- return members
- }
+ return members;
+ };
const tokenRecordArray: TokenRecordsWithWalletAddress[] = useMemo(
() =>
@@ -126,12 +126,12 @@ export default function useMembers() {
return {
walletAddress: x,
community: { ...tokenRecords[x] },
- }
+ };
})
: [],
- [JSON.stringify(tokenRecords)]
- )
- const [members, setMembers] = useState([])
+ [JSON.stringify(tokenRecords)],
+ );
+ const [members, setMembers] = useState([]);
const councilRecordArray: TokenRecordsWithWalletAddress[] = useMemo(
() =>
@@ -140,28 +140,28 @@ export default function useMembers() {
return {
walletAddress: x,
council: { ...councilTokenOwnerRecords[x] },
- }
+ };
})
: [],
- [JSON.stringify(councilTokenOwnerRecords)]
- )
+ [JSON.stringify(councilTokenOwnerRecords)],
+ );
//for community we exclude people who never vote
const communityAndCouncilTokenRecords = [
...tokenRecordArray.filter(
(x) =>
x.community?.account.totalVotesCount &&
- x.community?.account.totalVotesCount > 0
+ x.community?.account.totalVotesCount > 0,
),
...councilRecordArray,
- ]
+ ];
//merge community and council vote records to one big array of members
//sort them by totalVotes sum of community and council votes
const membersWithTokensDeposited = useMemo(
() =>
//remove duplicated walletAddresses
Array.from(
- new Set(communityAndCouncilTokenRecords.map((s) => s.walletAddress))
+ new Set(communityAndCouncilTokenRecords.map((s) => s.walletAddress)),
)
//deduplication
.map((walletAddress) => {
@@ -179,55 +179,56 @@ export default function useMembers() {
councilVotes: curr.council
? curr.council.account.governingTokenDepositAmount
: acc.councilVotes,
- }
+ };
if (curr.community) {
- obj['votesCasted'] += curr.community.account.totalVotesCount
+ obj['votesCasted'] +=
+ curr.community.account.totalVotesCount;
}
if (curr.council) {
- obj['votesCasted'] += curr.council.account.totalVotesCount
+ obj['votesCasted'] += curr.council.account.totalVotesCount;
}
- return obj
+ return obj;
},
{
walletAddress: '',
votesCasted: 0,
- councilVotes: new BN(0),
- communityVotes: new BN(0),
- }
+ councilVotes: BN_ZERO,
+ communityVotes: BN_ZERO,
+ },
),
- }
+ };
})
.sort((a, b) => {
- return a.votesCasted - b.votesCasted
+ return a.votesCasted - b.votesCasted;
})
.reverse(),
- [JSON.stringify(tokenRecordArray), JSON.stringify(councilRecordArray)]
- )
+ [JSON.stringify(tokenRecordArray), JSON.stringify(councilRecordArray)],
+ );
//Move to store if will be used more across application
useEffect(() => {
const handleSetMembers = async () => {
- let members = [...membersWithTokensDeposited]
- const councilMembers = await fetchCouncilMembersWithTokensOutsideRealm()
- const communityMembers = await fetchCommunityMembersATAS()
- members = matchMembers(members, councilMembers, 'council', true)
- members = matchMembers(members, communityMembers, 'community')
- setMembers(members)
- }
+ let members = [...membersWithTokensDeposited];
+ const councilMembers = await fetchCouncilMembersWithTokensOutsideRealm();
+ const communityMembers = await fetchCommunityMembersATAS();
+ members = matchMembers(members, councilMembers, 'council', true);
+ members = matchMembers(members, communityMembers, 'community');
+ setMembers(members);
+ };
if (previousRealmPubKey !== realm?.pubkey.toBase58()) {
- handleSetMembers()
+ handleSetMembers();
}
- }, [realm?.pubkey.toBase58()])
+ }, [realm?.pubkey.toBase58()]);
const activeMembers: Member[] = members.filter(
- (x) => !x.councilVotes.isZero() || !x.communityVotes.isZero()
- )
+ (x) => !x.councilVotes.isZero() || !x.communityVotes.isZero(),
+ );
return {
tokenRecordArray,
councilRecordArray,
members,
activeMembers,
- }
+ };
}
diff --git a/components/Modal.tsx b/components/Modal.tsx
index a48e1004be..070ad6e677 100644
--- a/components/Modal.tsx
+++ b/components/Modal.tsx
@@ -1,5 +1,5 @@
-import { XIcon } from '@heroicons/react/outline'
-import { Portal } from 'react-portal'
+import { XIcon } from '@heroicons/react/outline';
+import { Portal } from 'react-portal';
const Modal = ({
isOpen,
@@ -57,13 +57,13 @@ const Modal = ({
- )
-}
+ );
+};
const Header = ({ children }) => {
- return {children}
-}
+ return {children}
;
+};
-Modal.Header = Header
+Modal.Header = Header;
-export default Modal
+export default Modal;
diff --git a/components/NFTS/NFTSCompactWrapper.tsx b/components/NFTS/NFTSCompactWrapper.tsx
index e394e9bb32..453d465887 100644
--- a/components/NFTS/NFTSCompactWrapper.tsx
+++ b/components/NFTS/NFTSCompactWrapper.tsx
@@ -1,25 +1,25 @@
-import { getExplorerUrl } from '@components/explorer/tools'
-import ImgWithLoader from '@components/ImgWithLoader'
-import { DEFAULT_NFT_TREASURY_MINT } from '@components/instructions/tools'
-import { PhotographIcon } from '@heroicons/react/outline'
-import { ChevronRightIcon } from '@heroicons/react/solid'
-import useGovernanceAssets from '@hooks/useGovernanceAssets'
-import useQueryContext from '@hooks/useQueryContext'
-import useRealm from '@hooks/useRealm'
-import { useRouter } from 'next/router'
-import React from 'react'
-import useTreasuryAccountStore from 'stores/useTreasuryAccountStore'
-import useWalletStore from 'stores/useWalletStore'
-import { LinkButton } from '@components/Button'
+import { getExplorerUrl } from '@components/explorer/tools';
+import ImgWithLoader from '@components/ImgWithLoader';
+import { DEFAULT_NFT_TREASURY_MINT } from '@components/instructions/tools';
+import { PhotographIcon } from '@heroicons/react/outline';
+import { ChevronRightIcon } from '@heroicons/react/solid';
+import useGovernanceAssets from '@hooks/useGovernanceAssets';
+import useQueryContext from '@hooks/useQueryContext';
+import useRealm from '@hooks/useRealm';
+import { useRouter } from 'next/router';
+import React from 'react';
+import useTreasuryAccountStore from 'stores/useTreasuryAccountStore';
+import useWalletStore from 'stores/useWalletStore';
+import { LinkButton } from '@components/Button';
const NFTSCompactWrapper = () => {
- const router = useRouter()
- const { nftsGovernedTokenAccounts } = useGovernanceAssets()
- const connection = useWalletStore((s) => s.connection)
- const realmNfts = useTreasuryAccountStore((s) => s.allNfts)
- const isLoading = useTreasuryAccountStore((s) => s.isLoadingNfts)
- const { symbol } = useRealm()
- const { fmtUrlWithCluster } = useQueryContext()
+ const router = useRouter();
+ const { nftsGovernedTokenAccounts } = useGovernanceAssets();
+ const connection = useWalletStore((s) => s.connection);
+ const realmNfts = useTreasuryAccountStore((s) => s.allNfts);
+ const isLoading = useTreasuryAccountStore((s) => s.isLoadingNfts);
+ const { symbol } = useRealm();
+ const { fmtUrlWithCluster } = useQueryContext();
return nftsGovernedTokenAccounts.length ? (
@@ -28,9 +28,9 @@ const NFTSCompactWrapper = () => {
className={`flex items-center text-primary-light`}
onClick={() => {
const url = fmtUrlWithCluster(
- `/dao/${symbol}/gallery/${DEFAULT_NFT_TREASURY_MINT}`
- )
- router.push(url)
+ `/dao/${symbol}/gallery/${DEFAULT_NFT_TREASURY_MINT}`,
+ );
+ router.push(url);
}}
>
View
@@ -73,7 +73,7 @@ const NFTSCompactWrapper = () => {
- ) : null
-}
+ ) : null;
+};
-export default NFTSCompactWrapper
+export default NFTSCompactWrapper;
diff --git a/components/NFTS/NFTSelector.tsx b/components/NFTS/NFTSelector.tsx
index b83efc7a48..6bb4c6cf26 100644
--- a/components/NFTS/NFTSelector.tsx
+++ b/components/NFTS/NFTSelector.tsx
@@ -3,18 +3,18 @@ import React, {
useEffect,
useImperativeHandle,
useState,
-} from 'react'
-import { PhotographIcon } from '@heroicons/react/solid'
-import useWalletStore from 'stores/useWalletStore'
-import { NFTWithMint } from '@utils/uiTypes/nfts'
-import { CheckCircleIcon } from '@heroicons/react/solid'
-import { PublicKey } from '@solana/web3.js'
-import Loading from '@components/Loading'
-import { getNfts } from '@utils/tokens'
-import ImgWithLoader from '@components/ImgWithLoader'
+} from 'react';
+import { PhotographIcon } from '@heroicons/react/solid';
+import useWalletStore from 'stores/useWalletStore';
+import { NFTWithMint } from '@utils/uiTypes/nfts';
+import { CheckCircleIcon } from '@heroicons/react/solid';
+import { PublicKey } from '@solana/web3.js';
+import Loading from '@components/Loading';
+import { getNfts } from '@utils/tokens';
+import ImgWithLoader from '@components/ImgWithLoader';
export interface NftSelectorFunctions {
- handleGetNfts: () => void
+ handleGetNfts: () => void;
}
function NFTSelector(
@@ -26,49 +26,49 @@ function NFTSelector(
selectable = true,
familyName = '',
}: {
- ownerPk: PublicKey
- onNftSelect: (nfts: NFTWithMint[]) => void
- nftWidth?: string
- nftHeight?: string
- selectable?: boolean
- familyName?: string
+ ownerPk: PublicKey;
+ onNftSelect: (nfts: NFTWithMint[]) => void;
+ nftWidth?: string;
+ nftHeight?: string;
+ selectable?: boolean;
+ familyName?: string;
},
- ref: React.Ref
+ ref: React.Ref,
) {
- const [nfts, setNfts] = useState([])
- const [selectedNfts, setSelectedNfts] = useState([])
- const connection = useWalletStore((s) => s.connection)
- const [isLoading, setIsLoading] = useState(false)
+ const [nfts, setNfts] = useState([]);
+ const [selectedNfts, setSelectedNfts] = useState([]);
+ const connection = useWalletStore((s) => s.connection);
+ const [isLoading, setIsLoading] = useState(false);
const handleSelectNft = (nft: NFTWithMint) => {
- const isSelected = selectedNfts.find((x) => x.mint === nft.mint)
+ const isSelected = selectedNfts.find((x) => x.mint === nft.mint);
if (isSelected) {
- setSelectedNfts([...selectedNfts.filter((x) => x.mint !== nft.mint)])
+ setSelectedNfts([...selectedNfts.filter((x) => x.mint !== nft.mint)]);
} else {
//For now only one nft at the time
- setSelectedNfts([nft])
+ setSelectedNfts([nft]);
}
- }
+ };
const handleGetNfts = async () => {
- setIsLoading(true)
- const nfts = await getNfts(connection.current, ownerPk)
+ setIsLoading(true);
+ const nfts = await getNfts(connection.current, ownerPk);
if (nfts.length === 1) {
- handleSelectNft(nfts[0])
+ handleSelectNft(nfts[0]);
}
- setNfts(nfts)
- setIsLoading(false)
- }
+ setNfts(nfts);
+ setIsLoading(false);
+ };
useImperativeHandle(ref, () => ({
handleGetNfts,
- }))
+ }));
useEffect(() => {
if (ownerPk) {
- handleGetNfts()
+ handleGetNfts();
}
- }, [ownerPk])
+ }, [ownerPk]);
useEffect(() => {
- onNftSelect(selectedNfts)
- }, [selectedNfts])
+ onNftSelect(selectedNfts);
+ }, [selectedNfts]);
return (
<>
{nfts
.filter(
- (x) => !familyName || x.val.collection.family === familyName
+ (x) => !familyName || x.val.collection.family === familyName,
)
.map((x) => (
{selectedNfts.find(
- (selectedNfts) => selectedNfts.mint === x.mint
+ (selectedNfts) => selectedNfts.mint === x.mint,
) && (
)}
@@ -117,7 +117,7 @@ function NFTSelector(
)}
>
- )
+ );
}
-export default forwardRef(NFTSelector)
+export default forwardRef(NFTSelector);
diff --git a/components/NavBar.tsx b/components/NavBar.tsx
index 306795a790..6985ef7dc5 100644
--- a/components/NavBar.tsx
+++ b/components/NavBar.tsx
@@ -1,24 +1,51 @@
-import useQueryContext from '@hooks/useQueryContext'
-import Link from 'next/link'
-
-import ConnectWalletButton from './ConnectWalletButton'
+import useQueryContext from '@hooks/useQueryContext';
+import useRealm from '@hooks/useRealm';
+import { useRouter } from 'next/router';
+import ConnectWalletButton from './ConnectWalletButton';
const NavBar = () => {
- const { fmtUrlWithCluster } = useQueryContext()
+ const { symbol } = useRealm();
+ const { fmtUrlWithCluster } = useQueryContext();
+
+ const router = useRouter();
+
+ const isDashboardPage = router.pathname.includes('dashboard');
return (
-
-
-
- {/*
Sierra
*/}
-
-
+
+
+
+
+
+
+
+
+
+
- )
-}
+ );
+};
-export default NavBar
+export default NavBar;
diff --git a/components/Notification.tsx b/components/Notification.tsx
index 38f7495ce9..20e7317ea2 100644
--- a/components/Notification.tsx
+++ b/components/Notification.tsx
@@ -1,30 +1,30 @@
-import { useEffect, useState } from 'react'
+import { useEffect, useState } from 'react';
import {
CheckCircleIcon,
InformationCircleIcon,
XCircleIcon,
-} from '@heroicons/react/outline'
-import { XIcon } from '@heroicons/react/solid'
-import useNotificationStore from '../stores/useNotificationStore'
+} from '@heroicons/react/outline';
+import { XIcon } from '@heroicons/react/solid';
+import useNotificationStore from '../stores/useNotificationStore';
const NotificationList = () => {
const { notifications, set: setNotificationStore } = useNotificationStore(
- (s) => s
- )
+ (s) => s,
+ );
useEffect(() => {
if (notifications.length > 0) {
const id = setInterval(() => {
setNotificationStore((state) => {
- state.notifications = notifications.slice(1, notifications.length)
- })
- }, 6000)
+ state.notifications = notifications.slice(1, notifications.length);
+ });
+ }, 6000);
return () => {
- clearInterval(id)
- }
+ clearInterval(id);
+ };
}
- }, [notifications, setNotificationStore])
+ }, [notifications, setNotificationStore]);
return (
{
))}
- )
-}
+ );
+};
const Notification = ({ type, message, description, txid, idx }) => {
- const [showNotification, setShowNotification] = useState(true)
+ const [showNotification, setShowNotification] = useState(true);
- if (!showNotification) return null
+ if (!showNotification) return null;
return (
{
- )
-}
+ );
+};
-export default NotificationList
+export default NotificationList;
diff --git a/components/PageBodyContainer.tsx b/components/PageBodyContainer.tsx
index 368a1d261d..562b90399e 100644
--- a/components/PageBodyContainer.tsx
+++ b/components/PageBodyContainer.tsx
@@ -4,6 +4,6 @@ const PageBodyContainer = ({ children }) => (
{children}
-)
+);
-export default PageBodyContainer
+export default PageBodyContainer;
diff --git a/components/Pagination.tsx b/components/Pagination.tsx
index efe1d95ee4..0e3e06d594 100644
--- a/components/Pagination.tsx
+++ b/components/Pagination.tsx
@@ -1,14 +1,14 @@
-import { ArrowLeftIcon, ArrowRightIcon } from '@heroicons/react/outline'
-import React from 'react'
-import { Pagination } from 'react-headless-pagination'
+import { ArrowLeftIcon, ArrowRightIcon } from '@heroicons/react/outline';
+import React from 'react';
+import { Pagination } from 'react-headless-pagination';
const PaginationComponent = ({ totalPages = 5, onPageChange }) => {
- const [page, setPage] = React.useState(0)
+ const [page, setPage] = React.useState(0);
const handlePageChange = (page: number) => {
- setPage(page)
- onPageChange(page)
- }
+ setPage(page);
+ onPageChange(page);
+ };
return (
<>
@@ -43,7 +43,7 @@ const PaginationComponent = ({ totalPages = 5, onPageChange }) => {
) : null}
>
- )
-}
+ );
+};
-export default PaginationComponent
+export default PaginationComponent;
diff --git a/components/PreviousRouteBtn.tsx b/components/PreviousRouteBtn.tsx
index 15611cb331..73e91988bd 100644
--- a/components/PreviousRouteBtn.tsx
+++ b/components/PreviousRouteBtn.tsx
@@ -1,11 +1,11 @@
-import { ArrowLeftIcon } from '@heroicons/react/solid'
-import useRouterHistory from '@hooks/useRouterHistory'
-import Link from 'next/link'
-import React from 'react'
+import { ArrowLeftIcon } from '@heroicons/react/solid';
+import useRouterHistory from '@hooks/useRouterHistory';
+import Link from 'next/link';
+import React from 'react';
const PreviousRouteBtn = () => {
- const { getLastRoute } = useRouterHistory()
- const lastUrl = getLastRoute() as string
+ const { getLastRoute } = useRouterHistory();
+ const lastUrl = getLastRoute() as string;
return lastUrl ? (
@@ -13,6 +13,6 @@ const PreviousRouteBtn = () => {
Back
- ) : null
-}
-export default PreviousRouteBtn
+ ) : null;
+};
+export default PreviousRouteBtn;
diff --git a/components/ProgressBar.tsx b/components/ProgressBar.tsx
index b6065f88b8..5ea8742ee8 100644
--- a/components/ProgressBar.tsx
+++ b/components/ProgressBar.tsx
@@ -1,4 +1,4 @@
-import React from 'react'
+import React from 'react';
const ProgressBar = ({ progress, prefix }) => {
return (
@@ -22,7 +22,7 @@ const ProgressBar = ({ progress, prefix }) => {
>
- )
-}
+ );
+};
-export default ProgressBar
+export default ProgressBar;
diff --git a/components/ProposalActions.tsx b/components/ProposalActions.tsx
index 39df4af30d..b64eb87e6d 100644
--- a/components/ProposalActions.tsx
+++ b/components/ProposalActions.tsx
@@ -1,40 +1,39 @@
-/* eslint-disable @typescript-eslint/no-non-null-assertion */
-import { useEffect, useState } from 'react'
-import { useHasVoteTimeExpired } from '../hooks/useHasVoteTimeExpired'
-import useRealm from '../hooks/useRealm'
-import {
- getSignatoryRecordAddress,
- ProposalState,
-} from '@solana/spl-governance'
-import useWalletStore from '../stores/useWalletStore'
-import Button, { SecondaryButton } from './Button'
-
-import { RpcContext } from '@solana/spl-governance'
-import { signOffProposal } from 'actions/signOffProposal'
-import { notify } from '@utils/notifications'
-import { finalizeVote } from 'actions/finalizeVotes'
-import { Proposal } from '@solana/spl-governance'
-import { ProgramAccount } from '@solana/spl-governance'
-import { cancelProposal } from 'actions/cancelProposal'
-import { getProgramVersionForRealm } from '@models/registry/api'
+import { useEffect, useState } from 'react';
+import { useHasVoteTimeExpired } from '../hooks/useHasVoteTimeExpired';
+import useRealm from '../hooks/useRealm';
+import { getSignatoryRecordAddress } from '@solana/spl-governance';
+import useWalletStore, {
+ EnhancedProposalState,
+} from '../stores/useWalletStore';
+import Button, { SecondaryButton } from './Button';
+
+import { RpcContext } from '@solana/spl-governance';
+import { signOffProposal } from 'actions/signOffProposal';
+import { notify } from '@utils/notifications';
+import { finalizeVote } from 'actions/finalizeVotes';
+import { Proposal } from '@solana/spl-governance';
+import { ProgramAccount } from '@solana/spl-governance';
+import { cancelProposal } from 'actions/cancelProposal';
+import { getProgramVersionForRealm } from '@models/registry/api';
const ProposalActionsPanel = () => {
const { governance, proposal, proposalOwner } = useWalletStore(
- (s) => s.selectedProposal
- )
- const { realmInfo } = useRealm()
- const wallet = useWalletStore((s) => s.current)
- const connected = useWalletStore((s) => s.connected)
- const hasVoteTimeExpired = useHasVoteTimeExpired(governance, proposal!)
- const signatories = useWalletStore((s) => s.selectedProposal.signatories)
- const connection = useWalletStore((s) => s.connection)
- const fetchRealm = useWalletStore((s) => s.actions.fetchRealm)
- const [signatoryRecord, setSignatoryRecord] = useState(undefined)
+ (s) => s.selectedProposal,
+ );
+ const { realmInfo } = useRealm();
+ const wallet = useWalletStore((s) => s.current);
+ const connected = useWalletStore((s) => s.connected);
+ const hasVoteTimeExpired = useHasVoteTimeExpired(governance, proposal!);
+ const signatories = useWalletStore((s) => s.selectedProposal.signatories);
+ const connection = useWalletStore((s) => s.connection);
+ const fetchRealm = useWalletStore((s) => s.actions.fetchRealm);
+ const [signatoryRecord, setSignatoryRecord] = useState(undefined);
const canFinalizeVote =
- hasVoteTimeExpired && proposal?.account.state === ProposalState.Voting
+ hasVoteTimeExpired &&
+ proposal?.account.state === EnhancedProposalState.Voting;
- const walletPk = wallet?.publicKey
+ const walletPk = wallet?.publicKey;
useEffect(() => {
const setup = async () => {
@@ -42,22 +41,22 @@ const ProposalActionsPanel = () => {
const signatoryRecordPk = await getSignatoryRecordAddress(
realmInfo.programId,
proposal.pubkey,
- walletPk
- )
+ walletPk,
+ );
if (signatoryRecordPk && signatories) {
- setSignatoryRecord(signatories[signatoryRecordPk.toBase58()])
+ setSignatoryRecord(signatories[signatoryRecordPk.toBase58()]);
}
}
- }
+ };
- setup()
- }, [proposal, realmInfo, walletPk])
+ setup();
+ }, [proposal, realmInfo, walletPk]);
const canSignOff =
signatoryRecord &&
- (proposal?.account.state === ProposalState.Draft ||
- proposal?.account.state === ProposalState.SigningOff)
+ (proposal?.account.state === EnhancedProposalState.Draft ||
+ proposal?.account.state === EnhancedProposalState.SigningOff);
const canCancelProposal =
proposal &&
@@ -67,19 +66,19 @@ const ProposalActionsPanel = () => {
proposal.account.canWalletCancel(
governance.account,
proposalOwner.account,
- wallet.publicKey
- )
+ wallet.publicKey,
+ );
const signOffTooltipContent = !connected
? 'Connect your wallet to sign off this proposal'
: !signatoryRecord
? 'Only a signatory of the proposal can sign it off'
: !(
- proposal?.account.state === ProposalState.Draft ||
- proposal?.account.state === ProposalState.SigningOff
+ proposal?.account.state === EnhancedProposalState.Draft ||
+ proposal?.account.state === EnhancedProposalState.SigningOff
)
? 'Invalid proposal state. To sign off a proposal, it must be a draft or be in signing off state after creation.'
- : ''
+ : '';
const cancelTooltipContent = !connected
? 'Connect your wallet to cancel this proposal'
@@ -90,18 +89,19 @@ const ProposalActionsPanel = () => {
!proposal?.account.canWalletCancel(
governance.account,
proposalOwner.account,
- wallet.publicKey
+ wallet.publicKey,
)
? 'Only the owner of the proposal can execute this action'
- : ''
+ : '';
const finalizeVoteTooltipContent = !connected
? 'Connect your wallet to finalize this proposal'
: !hasVoteTimeExpired
? "Vote time has not expired yet. You can finalize a vote only after it's time has expired."
- : proposal?.account.state === ProposalState.Voting && !hasVoteTimeExpired
+ : proposal?.account.state === EnhancedProposalState.Voting &&
+ !hasVoteTimeExpired
? 'Proposal is being voting right now, you need to wait the vote to finish to be able to finalize it.'
- : ''
+ : '';
const handleFinalizeVote = async () => {
try {
if (proposal && realmInfo && governance) {
@@ -110,22 +110,22 @@ const ProposalActionsPanel = () => {
getProgramVersionForRealm(realmInfo),
wallet!,
connection.current,
- connection.endpoint
- )
+ connection.endpoint,
+ );
- await finalizeVote(rpcContext, governance?.account.realm, proposal)
- await fetchRealm(realmInfo!.programId, realmInfo!.realmId)
+ await finalizeVote(rpcContext, governance?.account.realm, proposal);
+ await fetchRealm(realmInfo!.programId, realmInfo!.realmId);
}
} catch (error) {
notify({
type: 'error',
message: `Error: Could not finalize vote.`,
description: `${error}`,
- })
+ });
- console.error('error finalizing vote', error)
+ console.error('error finalizing vote', error);
}
- }
+ };
const handleSignOffProposal = async () => {
try {
@@ -135,30 +135,30 @@ const ProposalActionsPanel = () => {
getProgramVersionForRealm(realmInfo),
wallet!,
connection.current,
- connection.endpoint
- )
+ connection.endpoint,
+ );
await signOffProposal(
rpcContext,
realmInfo.realmId,
proposal,
- signatoryRecord
- )
+ signatoryRecord,
+ );
- await fetchRealm(realmInfo!.programId, realmInfo!.realmId)
+ await fetchRealm(realmInfo!.programId, realmInfo!.realmId);
}
} catch (error) {
notify({
type: 'error',
message: `Error: Could not sign off proposal.`,
description: `${error}`,
- })
+ });
- console.error('error sign off', error)
+ console.error('error sign off', error);
}
- }
+ };
const handleCancelProposal = async (
- proposal: ProgramAccount | undefined
+ proposal: ProgramAccount | undefined,
) => {
try {
if (proposal && realmInfo) {
@@ -167,28 +167,29 @@ const ProposalActionsPanel = () => {
getProgramVersionForRealm(realmInfo),
wallet!,
connection.current,
- connection.endpoint
- )
+ connection.endpoint,
+ );
- await cancelProposal(rpcContext, realmInfo.realmId, proposal)
+ await cancelProposal(rpcContext, realmInfo.realmId, proposal);
- await fetchRealm(realmInfo!.programId, realmInfo!.realmId)
+ await fetchRealm(realmInfo!.programId, realmInfo!.realmId);
}
} catch (error) {
notify({
type: 'error',
message: `Error: Could not cancel proposal.`,
description: `${error}`,
- })
+ });
- console.error('error cancelling proposal', error)
+ console.error('error cancelling proposal', error);
}
- }
+ };
return (
<>
- {ProposalState.Cancelled === proposal?.account.state ||
- ProposalState.Succeeded === proposal?.account.state ||
- ProposalState.Defeated === proposal?.account.state ||
+ {EnhancedProposalState.Cancelled === proposal?.account.state ||
+ EnhancedProposalState.Succeeded === proposal?.account.state ||
+ EnhancedProposalState.Outdated === proposal?.account.state ||
+ EnhancedProposalState.Defeated === proposal?.account.state ||
(!canCancelProposal && !canSignOff && !canFinalizeVote) ? null : (
@@ -228,7 +229,7 @@ const ProposalActionsPanel = () => {
)}
>
- )
-}
+ );
+};
-export default ProposalActionsPanel
+export default ProposalActionsPanel;
diff --git a/components/ProposalCard.tsx b/components/ProposalCard.tsx
index a6a1c3c761..cb190cb451 100644
--- a/components/ProposalCard.tsx
+++ b/components/ProposalCard.tsx
@@ -1,23 +1,23 @@
-import styled from '@emotion/styled'
-import { ChevronRightIcon } from '@heroicons/react/solid'
-import ProposalStateBadge from './ProposalStatusBadge'
-import Link from 'next/link'
-import { Proposal, ProposalState } from '@solana/spl-governance'
-import ApprovalQuorum from './ApprovalQuorum'
-import useRealm from '../hooks/useRealm'
-import useProposalVotes from '../hooks/useProposalVotes'
-import ProposalTimeStatus from './ProposalTimeStatus'
+import styled from '@emotion/styled';
+import { ChevronRightIcon } from '@heroicons/react/solid';
+import ProposalStateBadge from './ProposalStatusBadge';
+import Link from 'next/link';
+import { Proposal, ProposalState } from '@solana/spl-governance';
+import ApprovalQuorum from './ApprovalQuorum';
+import useRealm from '../hooks/useRealm';
+import useProposalVotes from '../hooks/useProposalVotes';
+import ProposalTimeStatus from './ProposalTimeStatus';
-import useQueryContext from '../hooks/useQueryContext'
-import { PublicKey } from '@solana/web3.js'
-import VoteResults from './VoteResults'
+import useQueryContext from '../hooks/useQueryContext';
+import { PublicKey } from '@solana/web3.js';
+import VoteResults from './VoteResults';
type ProposalCardProps = {
- proposalPk: PublicKey
- proposal: Proposal
-}
+ proposalPk: PublicKey;
+ proposal: Proposal;
+};
-const StyledSvg = styled(ChevronRightIcon)``
+const StyledSvg = styled(ChevronRightIcon)``;
const StyledCardWrapper = styled.div`
:hover {
@@ -25,18 +25,18 @@ const StyledCardWrapper = styled.div`
transform: translateX(4px);
}
}
-`
+`;
const ProposalCard = ({ proposalPk, proposal }: ProposalCardProps) => {
- const { symbol } = useRealm()
- const { fmtUrlWithCluster } = useQueryContext()
- const { yesVoteProgress, yesVotesRequired } = useProposalVotes(proposal)
+ const { symbol } = useRealm();
+ const { fmtUrlWithCluster } = useQueryContext();
+ const { yesVoteProgress, yesVotesRequired } = useProposalVotes(proposal);
return (
- )
-}
+ );
+};
-export default ProposalCard
+export default ProposalCard;
diff --git a/components/ProposalFilter.tsx b/components/ProposalFilter.tsx
index b453a4dcc7..405d021b80 100644
--- a/components/ProposalFilter.tsx
+++ b/components/ProposalFilter.tsx
@@ -1,48 +1,60 @@
-import { useEffect, useReducer } from 'react'
-import styled from '@emotion/styled'
-import { ChevronDownIcon } from '@heroicons/react/solid'
-import { Disclosure } from '@headlessui/react'
-import Switch from './Switch'
-import { ProposalState } from '@solana/spl-governance'
+import { useEffect, useReducer } from 'react';
+import styled from '@emotion/styled';
+import { ChevronDownIcon } from '@heroicons/react/solid';
+import { Disclosure } from '@headlessui/react';
+import Switch from './Switch';
+import { EnhancedProposalState } from 'stores/useWalletStore';
-const initialFilterSettings = {
- [ProposalState.Draft]: false,
- [ProposalState.SigningOff]: true,
- [ProposalState.Voting]: true,
- [ProposalState.Succeeded]: true,
- [ProposalState.Executing]: true,
- [ProposalState.Completed]: true,
- [ProposalState.Cancelled]: false,
- [ProposalState.Defeated]: true,
- [ProposalState.ExecutingWithErrors]: true,
-}
+type Filters = {
+ [key in EnhancedProposalState]: boolean;
+};
+
+const initialFilterSettings: Filters = {
+ [EnhancedProposalState.Draft]: false,
+ [EnhancedProposalState.SigningOff]: true,
+ [EnhancedProposalState.Voting]: true,
+ [EnhancedProposalState.Succeeded]: true,
+ [EnhancedProposalState.Executing]: true,
+ [EnhancedProposalState.Completed]: true,
+ [EnhancedProposalState.Cancelled]: false,
+ [EnhancedProposalState.Defeated]: true,
+ [EnhancedProposalState.ExecutingWithErrors]: true,
+ [EnhancedProposalState.Outdated]: false,
+};
const StyledAlertCount = styled.span`
font-size: 0.6rem;
-`
+`;
const ProposalFilter = ({ filters, setFilters }) => {
- const [filterSettings, setFilterSettings] = useReducer(
- (state, newState) => ({ ...state, ...newState }),
- initialFilterSettings
- )
+ const [filterSettings, setFilterSettings] = useReducer<
+ (state: Filters, newState: Partial
) => any
+ >((state, newState) => ({ ...state, ...newState }), initialFilterSettings);
+
+ const handleFilters = (
+ proposalState: EnhancedProposalState,
+ checked: boolean,
+ ) => {
+ setFilterSettings({
+ [proposalState]: checked,
+ });
- const handleFilters = (proposalState, checked) => {
- setFilterSettings({ [proposalState]: checked })
if (!checked) {
- setFilters([...filters, proposalState])
+ setFilters([...filters, proposalState]);
} else {
- setFilters(filters.filter((n) => n !== proposalState))
+ setFilters(
+ filters.filter((n: EnhancedProposalState) => n !== proposalState),
+ );
}
- }
+ };
useEffect(() => {
const initialFilters = Object.keys(initialFilterSettings)
.filter((x) => !initialFilterSettings[x])
- .map(Number)
+ .map(Number);
- setFilters([...initialFilters])
- }, [])
+ setFilters([...initialFilters]);
+ }, []);
return (
{({ open }) => (
@@ -73,81 +85,95 @@ const ProposalFilter = ({ filters, setFilters }) => {
Cancelled
- handleFilters(ProposalState.Cancelled, checked)
+ handleFilters(EnhancedProposalState.Cancelled, checked)
}
/>
Completed
- handleFilters(ProposalState.Completed, checked)
+ handleFilters(EnhancedProposalState.Completed, checked)
}
/>
Defeated
- handleFilters(ProposalState.Defeated, checked)
+ handleFilters(EnhancedProposalState.Defeated, checked)
}
/>
Draft
- handleFilters(ProposalState.Draft, checked)
+ handleFilters(EnhancedProposalState.Draft, checked)
}
/>
Executing
- handleFilters(ProposalState.Executing, checked)
+ handleFilters(EnhancedProposalState.Executing, checked)
}
/>
ExecutingWithErrors
- handleFilters(ProposalState.ExecutingWithErrors, checked)
+ handleFilters(
+ EnhancedProposalState.ExecutingWithErrors,
+ checked,
+ )
}
/>
SigningOff
- handleFilters(ProposalState.SigningOff, checked)
+ handleFilters(EnhancedProposalState.SigningOff, checked)
}
/>
Succeeded
+ handleFilters(EnhancedProposalState.Succeeded, checked)
+ }
+ />
+
+
+ Outdated
+
- handleFilters(ProposalState.Succeeded, checked)
+ handleFilters(EnhancedProposalState.Outdated, checked)
}
/>
Voting
- handleFilters(ProposalState.Voting, checked)
+ handleFilters(EnhancedProposalState.Voting, checked)
}
/>
@@ -156,7 +182,7 @@ const ProposalFilter = ({ filters, setFilters }) => {
>
)}
- )
-}
+ );
+};
-export default ProposalFilter
+export default ProposalFilter;
diff --git a/components/ProposalStatusBadge.tsx b/components/ProposalStatusBadge.tsx
index d8cab1d047..7365a37c6b 100644
--- a/components/ProposalStatusBadge.tsx
+++ b/components/ProposalStatusBadge.tsx
@@ -1,42 +1,57 @@
-import { PublicKey } from '@solana/web3.js'
-import useRealmGovernance from '../hooks/useRealmGovernance'
-import { Proposal, ProposalState } from '@solana/spl-governance'
-import useWalletStore from '../stores/useWalletStore'
-import { isYesVote } from '@models/voteRecords'
+import { PublicKey } from '@solana/web3.js';
+import useRealmGovernance from '../hooks/useRealmGovernance';
+import useWalletStore, {
+ EnhancedProposal,
+ EnhancedProposalState,
+} from '../stores/useWalletStore';
+import { isYesVote } from '@models/voteRecords';
-function getProposalStateLabel(state: ProposalState, hasVoteEnded: boolean) {
+function getProposalStateLabel(
+ state: EnhancedProposalState,
+ hasVoteEnded: boolean,
+) {
switch (state) {
- case ProposalState.ExecutingWithErrors:
- return 'Execution Errors'
- case ProposalState.Voting:
+ case EnhancedProposalState.ExecutingWithErrors:
+ return 'Execution Errors';
+ case EnhancedProposalState.Outdated:
+ return 'Outdated';
+ case EnhancedProposalState.Voting:
// If there is no tipping point and voting period ends then proposal stays in Voting state and needs to be manually finalized
- return hasVoteEnded ? 'Finalizing' : 'Voting'
+ return hasVoteEnded ? 'Finalizing' : 'Voting';
default:
- return ProposalState[state]
+ return EnhancedProposalState[state];
}
}
-function getProposalStateStyle(state: ProposalState) {
+function getProposalStateStyle(state: EnhancedProposalState) {
if (
- state === ProposalState.Voting ||
- state === ProposalState.Executing ||
- state === ProposalState.SigningOff
+ state === EnhancedProposalState.Voting ||
+ state === EnhancedProposalState.Executing ||
+ state === EnhancedProposalState.SigningOff
) {
- return 'border border-blue text-blue'
- } else if (
- state === ProposalState.Completed ||
- state === ProposalState.Succeeded
+ return 'border border-blue text-blue';
+ }
+
+ if (
+ state === EnhancedProposalState.Completed ||
+ state === EnhancedProposalState.Succeeded
) {
- return 'border border-green text-green'
- } else if (
- state === ProposalState.Cancelled ||
- state === ProposalState.Defeated ||
- state === ProposalState.ExecutingWithErrors
+ return 'border border-green text-green';
+ }
+
+ if (
+ state === EnhancedProposalState.Cancelled ||
+ state === EnhancedProposalState.Defeated ||
+ state === EnhancedProposalState.ExecutingWithErrors
) {
- return 'border border-red text-red'
- } else {
- return 'border border-fgd-3 text-fgd-3'
+ return 'border border-red text-red';
+ }
+
+ if (state === EnhancedProposalState.Outdated) {
+ return 'border border-orange text-orange';
}
+
+ return 'border border-fgd-3 text-fgd-3';
}
const ProposalStateBadge = ({
@@ -44,24 +59,24 @@ const ProposalStateBadge = ({
proposal,
open,
}: {
- proposalPk: PublicKey
- proposal: Proposal
- open: boolean
+ proposalPk: PublicKey;
+ proposal: EnhancedProposal;
+ open: boolean;
}) => {
- const governance = useRealmGovernance(proposal.governance)
+ const governance = useRealmGovernance(proposal.governance);
const ownVoteRecord = useWalletStore((s) => s.ownVoteRecordsByProposal)[
proposalPk.toBase58()
- ]
+ ];
let statusLabel = getProposalStateLabel(
proposal.state,
- governance && proposal.getTimeToVoteEnd(governance) < 0
- )
+ governance && proposal.getTimeToVoteEnd(governance) < 0,
+ );
if (ownVoteRecord) {
statusLabel =
- statusLabel + ': ' + (isYesVote(ownVoteRecord.account) ? 'Yes' : 'No')
+ statusLabel + ': ' + (isYesVote(ownVoteRecord.account) ? 'Yes' : 'No');
}
return (
@@ -71,8 +86,8 @@ const ProposalStateBadge = ({
{statusLabel}
@@ -81,14 +96,14 @@ const ProposalStateBadge = ({
) : (
{statusLabel}
)}
>
- )
-}
+ );
+};
-export default ProposalStateBadge
+export default ProposalStateBadge;
diff --git a/components/ProposalTimeStatus.tsx b/components/ProposalTimeStatus.tsx
index b826271701..e40e904ab2 100644
--- a/components/ProposalTimeStatus.tsx
+++ b/components/ProposalTimeStatus.tsx
@@ -1,21 +1,21 @@
-import useRealm from '../hooks/useRealm'
-import { Proposal, ProposalState } from '@solana/spl-governance'
-import { fmtUnixTime } from '../utils/formatting'
-import { VoteCountdown } from './VoteCountdown'
+import useRealm from '../hooks/useRealm';
+import { Proposal, ProposalState } from '@solana/spl-governance';
+import { fmtUnixTime } from '../utils/formatting';
+import { VoteCountdown } from './VoteCountdown';
type ProposalTimeStatusProps = {
- proposal: Proposal
-}
+ proposal: Proposal;
+};
const ProposalTimeStatus = ({ proposal }: ProposalTimeStatusProps) => {
- const { governances } = useRealm()
- const governance = governances[proposal?.governance.toBase58()]?.account
+ const { governances } = useRealm();
+ const governance = governances[proposal?.governance.toBase58()]?.account;
return proposal && governance ? (
{proposal.votingCompletedAt ? (
`${ProposalState[proposal.state]} ${fmtUnixTime(
- proposal.votingCompletedAt
+ proposal.votingCompletedAt,
)}`
) : proposal.votingAt ? (
@@ -23,7 +23,7 @@ const ProposalTimeStatus = ({ proposal }: ProposalTimeStatusProps) => {
`Drafted ${fmtUnixTime(proposal.draftAt)}`
)}
- ) : null
-}
+ ) : null;
+};
-export default ProposalTimeStatus
+export default ProposalTimeStatus;
diff --git a/components/RealmHeader.tsx b/components/RealmHeader.tsx
index 36b2de5089..a0f316f0a9 100644
--- a/components/RealmHeader.tsx
+++ b/components/RealmHeader.tsx
@@ -1,47 +1,13 @@
-import React from 'react'
-import useRealm from 'hooks/useRealm'
-import { CogIcon, GlobeAltIcon } from '@heroicons/react/outline'
-import { ArrowLeftIcon } from '@heroicons/react/solid'
-import Link from 'next/link'
-import { TwitterIcon } from './icons'
-import useQueryContext from 'hooks/useQueryContext'
-import { ExternalLinkIcon } from '@heroicons/react/outline'
-import { getRealmExplorerHost } from 'tools/routing'
+import React from 'react';
+import useRealm from 'hooks/useRealm';
+import { GlobeAltIcon } from '@heroicons/react/outline';
+import { TwitterIcon } from './icons';
const RealmHeader = () => {
- const { fmtUrlWithCluster } = useQueryContext()
- const { realmInfo, realmDisplayName, symbol } = useRealm()
- const { REALM } = process.env
-
- const isBackNavVisible = realmInfo?.symbol !== REALM // hide backnav for the default realm
-
- const explorerHost = getRealmExplorerHost(realmInfo)
- const realmUrl = `https://${explorerHost}/#/realm/${realmInfo?.realmId.toBase58()}?programId=${realmInfo?.programId.toBase58()}`
+ const { realmInfo, realmDisplayName } = useRealm();
return (
-
{realmDisplayName ? (
@@ -63,12 +29,6 @@ const RealmHeader = () => {
)}
- )
-}
+ );
+};
-export default RealmHeader
+export default RealmHeader;
diff --git a/components/RealmWizard/RealmWizard.tsx b/components/RealmWizard/RealmWizard.tsx
deleted file mode 100644
index be0eca25d5..0000000000
--- a/components/RealmWizard/RealmWizard.tsx
+++ /dev/null
@@ -1,488 +0,0 @@
-import React, { useState } from 'react'
-import RealmWizardController from './controller/RealmWizardController'
-// import CreateRealmForm from './components/CreateRealmForm'
-import Loading from '@components/Loading'
-import WizardModeSelect from './components/Steps/WizardModeSelect'
-import { notify } from '@utils/notifications'
-import {
- MultisigOptions,
- BespokeConfig,
- BespokeCouncil,
- BespokeInfo,
- RealmCreated,
-} from './components/Steps'
-import { useMemo } from 'react'
-import Button from '@components/Button'
-import {
- RealmArtifacts,
- RealmWizardMode,
- RealmWizardStep,
- StepDirection,
-} from './interfaces/Realm'
-import { PublicKey } from '@solana/web3.js'
-import useWalletStore from 'stores/useWalletStore'
-import {
- DEFAULT_GOVERNANCE_PROGRAM_ID,
- DEFAULT_TEST_GOVERNANCE_PROGRAM_ID,
-} from '@components/instructions/tools'
-
-import Tooltip from '@components/Tooltip'
-import { StyledLabel } from '@components/inputs/styles'
-import { createMultisigRealm } from 'actions/createMultisigRealm'
-import { ArrowLeftIcon } from '@heroicons/react/solid'
-import useQueryContext from '@hooks/useQueryContext'
-import router from 'next/router'
-import { useEffect } from 'react'
-import { CreateFormSchema } from './validators/createRealmValidator'
-import { formValidation, isFormValid } from '@utils/formValidation'
-import { registerRealm } from 'actions/registerRealm'
-import {
- getGovernanceProgramVersion,
- MintMaxVoteWeightSource,
-} from '@solana/spl-governance'
-import Switch from '@components/Switch'
-import { BN } from '@project-serum/anchor'
-import BigNumber from 'bignumber.js'
-
-enum LoaderMessage {
- CREATING_ARTIFACTS = 'Creating the DAO artifacts..',
- MINTING_COUNCIL_TOKENS = 'Minting the council tokens..',
- MINTING_COMMUNITY_TOKENS = 'Minting the community tokens..',
- DEPLOYING_REALM = 'Building your DAO...',
- COMPLETING_REALM = 'Finishing the DAO buildings..',
- FINISHED = "DAO successfully created. Redirecting to the DAO's page",
- ERROR = 'We found an error while creating your DAO :/',
-}
-
-// TODO: split this component
-
-const RealmWizard: React.FC = () => {
- const { fmtUrlWithCluster } = useQueryContext()
- // const wallet = useWalletStore((s) => s.current)
- const { connection, current: wallet } = useWalletStore((s) => s)
- /**
- * @var {RealmWizardController} ctl
- * The wizard controller instance
- */
- const [ctl, setController] = useState
()
- const [testRealmCheck, setTestRealmCheck] = useState(false)
- const [form, setForm] = useState({
- communityMintMaxVoteWeightSource: '1',
- })
- const [formErrors, setFormErrors] = useState({})
- const [councilSwitchState, setUseCouncil] = useState(true)
- const [isTestProgramId, setIsTestProgramId] = useState(false)
-
- const [isLoading, setIsLoading] = useState(false)
- const [currentStep, setCurrentStep] = useState(
- RealmWizardStep.SELECT_MODE
- )
- const [realmAddress] = useState('')
- const [loaderMessage] = useState(LoaderMessage.DEPLOYING_REALM)
-
- /**
- * Handles and set the form data
- * @param data the form data
- */
- const handleSetForm = (data: RealmArtifacts) => {
- setForm({
- ...form,
- ...data,
- })
- }
-
- /**
- * Generate realm artifacts
- */
- const handleCreateMultisigRealm = async () => {
- if (!ctl) return
- if (!wallet?.publicKey || !connection.current) return
- if (!form.name)
- return notify({
- type: 'error',
- message: 'You must set a name for the realm!',
- })
-
- if (!form.teamWallets?.length)
- return notify({
- type: 'error',
- message: 'Team member wallets are required.',
- })
-
- if (!form.yesThreshold) {
- return notify({
- type: 'error',
- message: 'Approval quorum required.',
- })
- }
-
- const programId = testRealmCheck
- ? DEFAULT_TEST_GOVERNANCE_PROGRAM_ID
- : DEFAULT_GOVERNANCE_PROGRAM_ID
-
- const governanceProgramId = new PublicKey(programId)
- const programVersion = await getGovernanceProgramVersion(
- connection.current,
- governanceProgramId
- )
-
- console.log('CREATE REALM Program', {
- governanceProgramId: governanceProgramId.toBase58(),
- programVersion,
- })
-
- const results = await createMultisigRealm(
- connection.current,
- governanceProgramId,
- programVersion,
- form.name,
- form.yesThreshold,
- form.teamWallets.map((w) => new PublicKey(w)),
- wallet
- )
-
- if (results) {
- router.push(fmtUrlWithCluster(`/dao/${results.realmPk.toBase58()}`))
- return
- }
-
- notify({
- type: 'error',
- message: 'Something bad happened during this request.',
- })
- }
-
- /**
- * Get the mint max vote weight parsed to `MintMaxVoteWeightSource`
- */
- const getMintMaxVoteWeight = () => {
- let value = MintMaxVoteWeightSource.FULL_SUPPLY_FRACTION.value
- if (form.communityMintMaxVoteWeightSource) {
- const fraction = new BigNumber(form.communityMintMaxVoteWeightSource)
- .shiftedBy(MintMaxVoteWeightSource.SUPPLY_FRACTION_DECIMALS)
- .toString()
- value = new BN(fraction)
- }
-
- return new MintMaxVoteWeightSource({
- value,
- })
- }
-
- /**
- * Get the array of wallets parsed into public keys or undefined if not eligible
- */
- const getTeamWallets = (): PublicKey[] | undefined =>
- form.teamWallets ? form.teamWallets.map((w) => new PublicKey(w)) : undefined
-
- const handleCreateBespokeRealm = async () => {
- setFormErrors({})
-
- const { isValid, validationErrors }: formValidation = await isFormValid(
- CreateFormSchema,
- form
- )
-
- if (isValid) {
- try {
- const governanceProgramId = new PublicKey(form.governanceProgramId!)
- const programVersion = await getGovernanceProgramVersion(
- connection.current,
- governanceProgramId
- )
-
- console.log('CREATE REALM Program', {
- governanceProgramId: governanceProgramId.toBase58(),
- programVersion,
- })
-
- const realmAddress = await registerRealm(
- {
- connection,
- wallet: wallet!,
- walletPubkey: wallet!.publicKey!,
- },
- governanceProgramId,
- programVersion,
- form.name!,
- form.communityMintId
- ? new PublicKey(form.communityMintId)
- : undefined,
- form.councilMintId ? new PublicKey(form.councilMintId) : undefined,
- getMintMaxVoteWeight(),
- form.minCommunityTokensToCreateGovernance!,
- form.yesThreshold,
- form.communityMintId ? form.transferAuthority : true,
- form.communityMint ? form.communityMint.account.decimals : undefined,
- form.councilMint ? form.councilMint.account.decimals : undefined,
- getTeamWallets()
- )
- router.push(fmtUrlWithCluster(`/dao/${realmAddress.toBase58()}`))
- } catch (error) {
- notify({
- type: 'error',
- message: error.message,
- })
- }
- } else {
- console.debug(validationErrors)
- setFormErrors(validationErrors)
- }
- setIsLoading(false)
- }
-
- /**
- * Handles and set the selected mode
- * @param option the selected mode
- */
- const handleModeSelection = (option: RealmWizardMode) => {
- try {
- const ctl = new RealmWizardController(option)
- const nextStep = ctl.getNextStep(currentStep, StepDirection.NEXT)
- handleSetForm({
- governanceProgramId:
- process.env.DEFAULT_GOVERNANCE_PROGRAM_ID ??
- DEFAULT_GOVERNANCE_PROGRAM_ID,
- yesThreshold: 60,
- })
- setController(ctl)
- setCurrentStep(nextStep)
- } catch (error: any) {
- notify({
- type: 'error',
- message: error.message,
- })
- }
- }
-
- const handleStepSelection = (direction: StepDirection) => {
- if (ctl) {
- try {
- const nextStep = ctl.getNextStep(currentStep, direction)
- setCurrentStep(nextStep)
- } catch (error) {
- notify({
- type: 'error',
- message: error.message,
- })
- }
- }
- }
-
- const handleCreateRealm = async () => {
- if (!wallet?.publicKey || !connection.current)
- return notify({
- type: 'error',
- message: 'Wallet not connected',
- })
- // Handles the current misuse of the CreateRealmForm
- if (ctl) {
- try {
- setIsLoading(true)
-
- switch (ctl.getMode()) {
- case RealmWizardMode.BASIC:
- await handleCreateMultisigRealm()
- break
- case RealmWizardMode.ADVANCED:
- await handleCreateBespokeRealm()
- break
- default:
- throw new Error('Mode not available.')
- }
- } catch (error) {
- const err = error as Error
- setIsLoading(false)
- notify({
- type: 'error',
- message: err.message,
- })
- } finally {
- setIsLoading(false)
- }
- }
- }
-
- const handleBackButtonClick = () => {
- if (ctl && !ctl.isModeSelect()) {
- setCurrentStep(ctl.getNextStep(currentStep, StepDirection.PREV))
- } else {
- router.push(fmtUrlWithCluster('/realms'))
- }
- }
-
- const isCreateButtonDisabled = () =>
- ctl && ctl.getMode() === RealmWizardMode.ADVANCED
- ? false
- : !form.teamWallets?.length || !form.name
-
- const canGoNext = (step: RealmWizardStep): boolean => {
- if (step === RealmWizardStep.BESPOKE_CONFIG) {
- const errors: any = {}
- !form.name ? (errors.name = 'Name is required') : null
- !form.governanceProgramId
- ? (errors.governanceProgramId = 'Governance Program ID is required')
- : null
-
- setFormErrors(errors)
-
- return !Object.values(errors).length
- }
-
- return true
- }
-
- const onClickNext = (): boolean => {
- if (ctl)
- switch (ctl.getMode()) {
- case RealmWizardMode.ADVANCED:
- return canGoNext(ctl.getCurrentStep())
- default:
- return false
- }
- return false
- }
-
- /**
- * Binds the current step to the matching component
- */
- const BoundStepComponent = useMemo(() => {
- switch (currentStep) {
- case RealmWizardStep.SELECT_MODE:
- return
- case RealmWizardStep.MULTISIG_CONFIG:
- return
- case RealmWizardStep.BESPOKE_CONFIG:
- return (
- {
- setIsTestProgramId(x)
- handleSetForm({
- governanceProgramId: x
- ? DEFAULT_TEST_GOVERNANCE_PROGRAM_ID
- : DEFAULT_GOVERNANCE_PROGRAM_ID,
- })
- }}
- />
- )
- case RealmWizardStep.BESPOKE_COUNCIL:
- return (
- {
- setUseCouncil(x)
- }}
- switchState={councilSwitchState}
- />
- )
- case RealmWizardStep.BESPOKE_INFO:
- return (
-
- )
- case RealmWizardStep.REALM_CREATED:
- return
- default:
- return Sorry, but this step ran away
- }
- }, [currentStep, form, formErrors, councilSwitchState])
-
- useEffect(() => {
- // Return shouldFireCreate to the base state
- if (Object.values(formErrors).length) setFormErrors({})
- }, [form])
-
- return (
-
-
- {isLoading ? (
-
-
- {loaderMessage}
-
- ) : (
-
{BoundStepComponent}
- )}
- {ctl && !(ctl.isModeSelect() || isLoading) && (
- <>
-
- {ctl.getMode() === RealmWizardMode.BASIC && ctl.isLastStep() && (
-
- {
- setTestRealmCheck(check)
- }}
- />
-
-
- Create a test DAO
-
-
-
- )}
- {!ctl.isFirstStep() ? (
-
- ) : (
-
- )}
-
-
-
- >
- )}
-
- )
-}
-
-export default RealmWizard
diff --git a/components/RealmWizard/components/AddWalletModal.tsx b/components/RealmWizard/components/AddWalletModal.tsx
deleted file mode 100644
index 1d49920c1e..0000000000
--- a/components/RealmWizard/components/AddWalletModal.tsx
+++ /dev/null
@@ -1,101 +0,0 @@
-import React, { useState } from 'react'
-import Textarea from '@components/inputs/Textarea'
-import Modal from '@components/Modal'
-import Button, { SecondaryButton } from '@components/Button'
-import { publicKeyValidationTest } from '../validators/createRealmValidator'
-
-const AddWalletModal: React.FC<{
- onOk: (wallets: string[]) => void
- onClose: () => void
- isOpen: boolean
-}> = ({ isOpen = false, onOk, onClose }) => {
- const [walletAddr, setWalletAddr] = useState('')
- const [hasErrors, setErrors] = useState()
-
- const handleAddWallet = () => {
- const wallets = walletAddr.replace(/ +/gim, '').split(/,|\n/gim)
- const errors: string[] = []
- const parsedWallets: string[] = []
- wallets.forEach((wallet, index) => {
- if (wallet.length) {
- parsedWallets.push(wallet)
- if (!publicKeyValidationTest(wallet)) {
- errors.push(
- `Entry ${index + 1} (${wallet.substr(
- 0,
- 8
- )}...) is not a valid public key.`
- )
- }
- }
- })
- if (errors.length) setErrors(errors)
- else {
- onClose()
- setWalletAddr('')
- onOk(parsedWallets)
- }
- }
-
- const getAddMembersText = () => {
- let message = 'Add Member'
- const wallets = walletAddr.split(/\n/)
- if (wallets.length > 1 && wallets[1].length > 1) message += 's'
- return message
- }
-
- return (
- <>
- {isOpen && (
- {
- setWalletAddr('')
- onClose()
- }}
- >
- Team members wallets
-
- )}
- >
- )
-}
-
-export default AddWalletModal
diff --git a/components/RealmWizard/components/ApprovalQuorumInput.tsx b/components/RealmWizard/components/ApprovalQuorumInput.tsx
deleted file mode 100644
index 11f137b40f..0000000000
--- a/components/RealmWizard/components/ApprovalQuorumInput.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-import React from 'react'
-import Input from '@components/inputs/Input'
-import { StyledLabel } from '@components/inputs/styles'
-import AmountSlider from '@components/Slider'
-
-const ApprovalQuorumInput: React.FC<{
- onChange: (amount: number) => void
- onBlur?: () => void
- value?: number
- slider?: boolean
-}> = ({ onChange, onBlur, value, slider = true }) => {
- return (
- <>
- Approval quorum (%)
- {
- let yesThreshold = $e.target.value
- if (yesThreshold.length) {
- yesThreshold =
- +yesThreshold < 1 ? 1 : +yesThreshold > 100 ? 100 : yesThreshold
- }
- onChange(+yesThreshold)
- }}
- />
-
-
- {slider && (
-
- )}
- >
- )
-}
-
-export default ApprovalQuorumInput
diff --git a/components/RealmWizard/components/RealmCreated.tsx b/components/RealmWizard/components/RealmCreated.tsx
deleted file mode 100644
index 6bbc9917ed..0000000000
--- a/components/RealmWizard/components/RealmCreated.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import { PublicKey } from '@solana/web3.js'
-import React from 'react'
-
-const RealmCreated: React.FC<{
- realmAddress: PublicKey
- governanceProgramId: string
-}> = ({ realmAddress, governanceProgramId }) => {
- return (
- <>
-
-
-
Realm created succesfully!
-
-
-
-
- Details about your realm here. These can be added manually to your
- local registry of realms similar to here
-
-
This is a temporary solution.
-
-
-
-
- Governance Program Id
-
-
{governanceProgramId}
-
-
-
Realm Id
-
{realmAddress?.toBase58()}
-
-
-
- >
- )
-}
-
-export default RealmCreated
diff --git a/components/RealmWizard/components/Steps/BespokeConfig.tsx b/components/RealmWizard/components/Steps/BespokeConfig.tsx
deleted file mode 100644
index 709ad65b20..0000000000
--- a/components/RealmWizard/components/Steps/BespokeConfig.tsx
+++ /dev/null
@@ -1,260 +0,0 @@
-import React, { useEffect } from 'react'
-import {
- RealmArtifacts,
- RealmWizardStepComponentProps,
-} from '@components/RealmWizard/interfaces/Realm'
-import Input from '@components/inputs/Input'
-import {
- formatMintNaturalAmountAsDecimal,
- getMintDecimalAmount,
-} from '@tools/sdk/units'
-import { BN } from '@project-serum/anchor'
-import { tryGetMint } from '@utils/tokens'
-import { PublicKey } from '@solana/web3.js'
-import useWalletStore from 'stores/useWalletStore'
-import _ from 'lodash'
-import Switch from '@components/Switch'
-import { StyledLabel } from '@components/inputs/styles'
-import Tooltip from '@components/Tooltip'
-import { MIN_COMMUNITY_TOKENS_TO_CREATE_W_0_SUPPLY } from '@tools/constants'
-import BigNumber from 'bignumber.js'
-
-export const getMintSupplyFactorPercent = (form: RealmArtifacts) => {
- let value = '0'
- if (!form.communityMintMaxVoteWeightSource) return value
- value = (+form.communityMintMaxVoteWeightSource! * 100).toFixed(2)
-
- return value + '%'
-}
-
-export const getSubtitleForMinTokenToCreate = (form: RealmArtifacts) => {
- if (!form.communityMint || form.communityMint.account.supply.eq(new BN(0)))
- return `Default is ${Intl.NumberFormat(navigator.language).format(
- MIN_COMMUNITY_TOKENS_TO_CREATE_W_0_SUPPLY
- )} for mints with no supply`
- return 'Default is 1% of community mint'
-}
-
-export const getMinTokensToCreatePercent = (form: RealmArtifacts) => {
- let value = '0'
- if (!form.minCommunityTokensToCreateGovernance) return value + '%'
- if (form.communityMint?.account.supply) {
- value = new BigNumber(form.minCommunityTokensToCreateGovernance)
- .dividedBy(
- new BigNumber(form.communityMint.account.supply.toString()).shiftedBy(
- -form.communityMint.account.decimals
- )
- )
- .times(100)
- .toString()
- }
-
- return (isFinite(+value) ? value : 0) + '%'
-}
-
-const BespokeConfig: React.FC = ({
- setForm,
- form,
- formErrors,
- onSwitch = () => null,
- isTestProgramId = true,
-}) => {
- const { connection } = useWalletStore((s) => s)
- const handleCommunityMint = async (mintId: string) => {
- try {
- const mintPublicKey = new PublicKey(mintId)
- const mint = await tryGetMint(connection.current, mintPublicKey)
- if (mint) {
- const supply = mint.account.supply
- if (supply.gt(new BN(0))) {
- setForm({
- minCommunityTokensToCreateGovernance: getMintDecimalAmount(
- mint.account,
- supply
- )
- .dividedBy(100)
- .toString(),
- communityMintMaxVoteWeightSource: '1',
- communityMint: mint,
- transferAuthority: true,
- })
- } else {
- setForm({
- communityMint: mint,
- transferAuthority: true,
- })
- }
- }
- } catch (e) {
- console.log('failed to set community mint', e)
- }
- }
-
- useEffect(() => {
- _.debounce(async () => {
- if (form?.communityMintId) {
- await handleCommunityMint(form.communityMintId)
- }
- }, 250)()
- if (!form?.communityMintId?.length) {
- setForm({
- communityMint: undefined,
- minCommunityTokensToCreateGovernance: undefined,
- communityMintId: undefined,
- })
- }
- }, [form?.communityMintId])
-
- return (
- <>
-
-
-
Create a new realm
-
-
-
-
-
- setForm({
- name: evt.target.value,
- })
- }
- />
-
-
-
setForm({ communityMintId: evt.target.value })}
- />
- {form?.communityMint && (
-
-
Mint supply
-
- {formatMintNaturalAmountAsDecimal(
- form.communityMint.account,
- form.communityMint.account.supply
- )}
-
-
- )}
-
- {form?.communityMint && (
- <>
-
-
-
- {
- setForm({ transferAuthority: !form.transferAuthority })
- }}
- />
-
-
- Transfer authority
-
-
-
- >
- )}
-
-
{
- const value = evt.target.value
- setForm({
- minCommunityTokensToCreateGovernance: value,
- })
- }}
- />
-
- {getMinTokensToCreatePercent(form)} of token supply
-
{' '}
-
-
-
-
{
- if (!form.communityMintMaxVoteWeightSource?.length) {
- setForm({
- communityMintMaxVoteWeightSource: '1',
- })
- }
- }}
- onChange={(evt) => {
- const value =
- +evt.target.value <= 1 && +evt.target.value >= 0
- ? evt.target.value
- : 1
- setForm({
- communityMintMaxVoteWeightSource: value,
- })
- }}
- />
-
- {getMintSupplyFactorPercent(form)} vote weight
-
-
-
-
- setForm({
- governanceProgramId: evt.target.value,
- })
- }
- />
-
-
-
- onSwitch(x)}
- />
- Use test instance
-
-
-
- >
- )
-}
-
-export default BespokeConfig
diff --git a/components/RealmWizard/components/Steps/BespokeCouncil.tsx b/components/RealmWizard/components/Steps/BespokeCouncil.tsx
deleted file mode 100644
index f919c9bf89..0000000000
--- a/components/RealmWizard/components/Steps/BespokeCouncil.tsx
+++ /dev/null
@@ -1,146 +0,0 @@
-/* eslint-disable @typescript-eslint/no-unused-vars */
-import React, { useEffect, useState } from 'react'
-import { RealmWizardStepComponentProps } from '@components/RealmWizard/interfaces/Realm'
-import Input from '@components/inputs/Input'
-import Switch from '@components/Switch'
-import { StyledLabel } from '@components/inputs/styles'
-import TeamWalletField from '../TeamWalletField'
-import useWalletStore from 'stores/useWalletStore'
-import ApprovalQuorumInput from '../ApprovalQuorumInput'
-import { tryGetMint } from '@utils/tokens'
-import { PublicKey } from '@solana/web3.js'
-import _ from 'lodash'
-
-const BespokeCouncil: React.FC = ({
- setForm,
- form,
- formErrors,
- switchState = true,
- onSwitch = () => null,
-}) => {
- const { current: wallet, connection } = useWalletStore((s) => s)
- const handleInsertTeamWallet = (wallets: string[]) => {
- let teamWallets: string[] = []
- if (form?.teamWallets) {
- teamWallets = form.teamWallets
- }
- wallets.forEach((wallet) => {
- if (!teamWallets.find((addr) => addr === wallet)) {
- teamWallets.push(wallet)
- setForm({ teamWallets })
- }
- })
- }
-
- const handleRemoveTeamWallet = (index: number) => {
- if (form?.teamWallets && form.teamWallets[index]) {
- const teamWallets = form.teamWallets
- teamWallets.splice(index, 1)
- setForm({ teamWallets })
- }
- }
-
- const handleWallets = () => {
- if (switchState && wallet?.publicKey) {
- // Forces to add the current wallet
- handleInsertTeamWallet([wallet.publicKey.toBase58()])
- } else {
- setForm({ teamWallets: [] })
- }
- }
-
- const handleCouncilMint = async (mintId: string) => {
- try {
- const mintPublicKey = new PublicKey(mintId)
- const mint = await tryGetMint(connection.current, mintPublicKey)
- if (mint) {
- setForm({
- councilMint: mint,
- })
- }
- } catch (e) {
- console.log('failed to set council mint', e)
- }
- }
-
- useEffect(() => {
- _.debounce(async () => {
- if (form?.councilMintId) {
- await handleCouncilMint(form.councilMintId)
- }
- }, 250)()
- if (!form?.communityMintId?.length) {
- setForm({ communityMint: undefined })
- }
- }, [form?.councilMintId])
-
- useEffect(() => {
- handleWallets()
- }, [switchState])
-
- useEffect(() => {
- handleWallets()
- }, [])
-
- return (
- <>
-
-
-
- {
- if (typeof onSwitch === 'function') onSwitch(check)
- }}
- />
- Use Council
-
-
- {switchState && (
- <>
-
- setForm({ councilMintId: evt.target.value })}
- />
-
-
-
{
- setForm({ yesThreshold: $e })
- }}
- onBlur={() => {
- if (
- !form.yesThreshold ||
- form.yesThreshold.toString().match(/\D+/gim)
- ) {
- setForm({
- yesThreshold: 60,
- })
- }
- }}
- />
-
-
-
- >
- )}
- >
- )
-}
-
-export default BespokeCouncil
diff --git a/components/RealmWizard/components/Steps/BespokeInfo.tsx b/components/RealmWizard/components/Steps/BespokeInfo.tsx
deleted file mode 100644
index 2c78d23a77..0000000000
--- a/components/RealmWizard/components/Steps/BespokeInfo.tsx
+++ /dev/null
@@ -1,192 +0,0 @@
-/* eslint-disable @typescript-eslint/no-unused-vars */
-import Divider from '@components/Divider'
-import Input from '@components/inputs/Input'
-import { StyledLabel } from '@components/inputs/styles'
-import { formatMintNaturalAmountAsDecimal } from '@tools/sdk/units'
-import { MIN_COMMUNITY_TOKENS_TO_CREATE_W_0_SUPPLY } from '@tools/constants'
-import React from 'react'
-import { RealmWizardStepComponentProps } from '../../interfaces/Realm'
-import { getMintSupplyFactorPercent } from './BespokeConfig'
-
-const BespokeInfo: React.FC = ({
- setForm,
- form,
- formErrors,
-}) => {
- return (
- <>
-
-
-
-
-
-
-
-
-
-
-
- {form?.communityMint && (
-
-
Mint supply
-
- {formatMintNaturalAmountAsDecimal(
- form.communityMint.account,
- form.communityMint.account.supply
- )}
-
-
- )}
-
- {form?.communityMint && (
- <>
-
-
-
-
-
-
-
-
-
- >
- )}
-
-
-
-
-
Governance Program Id
-
-
- {form?.governanceProgramId}
-
-
-
-
-
-
-
-
- {form.teamWallets?.length ? (
- <>
-
-
-
-
-
-
-
-
-
Team wallets
- {form.teamWallets?.map((wallet, index) => (
-
-
Member {index + 1}:
-
-
- ))}
-
- >
- ) : null}
-
-
- >
- )
-}
-
-export default BespokeInfo
diff --git a/components/RealmWizard/components/Steps/MultisigOptions.tsx b/components/RealmWizard/components/Steps/MultisigOptions.tsx
deleted file mode 100644
index ca037d70ef..0000000000
--- a/components/RealmWizard/components/Steps/MultisigOptions.tsx
+++ /dev/null
@@ -1,107 +0,0 @@
-import React, { useEffect } from 'react'
-import { RealmWizardStepComponentProps } from '../../interfaces/Realm'
-import TeamWalletField from '../TeamWalletField'
-import Input from '@components/inputs/Input'
-
-import useWalletStore from 'stores/useWalletStore'
-import ApprovalQuorumInput from '../ApprovalQuorumInput'
-
-/**
- * This is the Step One for the Realm Wizard.
- *
- * This step will set up the Realm name and the team member wallets.
- * Then the parent should trigger the contracts creation.
- *
- * @param param0 the form data and form handler.
- */
-const MultisigOptions: React.FC = ({
- setForm,
- form,
-}) => {
- const DEFAULT_APPROVAL_QUORUM = 60
- const { current: wallet } = useWalletStore((s) => s)
-
- const handleInsertTeamWallet = (wallets: string[]) => {
- const teamWallets: string[] = form?.teamWallets ?? []
-
- wallets.forEach((wallet) => {
- if (!teamWallets.find((addr) => addr === wallet)) {
- teamWallets.push(wallet)
- }
- })
- setForm({ teamWallets })
- }
-
- const handleRemoveTeamWallet = (index: number) => {
- if (form?.teamWallets && form.teamWallets[index]) {
- const teamWallets = form.teamWallets
- teamWallets.splice(index, 1)
- setForm({ teamWallets })
- }
- }
-
- const addCurrentWallet = () => {
- if (wallet?.publicKey) {
- handleInsertTeamWallet([wallet.publicKey?.toBase58()])
- }
- }
-
- useEffect(() => {
- addCurrentWallet()
- }, [wallet?.publicKey])
-
- useEffect(() => {
- addCurrentWallet()
- }, [])
-
- return (
-
-
-
- {
- setForm({
- name: $e.target.value,
- })
- }}
- />
-
-
-
{
- setForm({ yesThreshold: $e })
- }}
- onBlur={() => {
- if (
- !form.yesThreshold ||
- form.yesThreshold.toString().match(/\D+/gim)
- ) {
- setForm({
- yesThreshold: DEFAULT_APPROVAL_QUORUM,
- })
- }
- }}
- />
-
-
-
-
-
- )
-}
-
-export default MultisigOptions
diff --git a/components/RealmWizard/components/Steps/RealmCreated.tsx b/components/RealmWizard/components/Steps/RealmCreated.tsx
deleted file mode 100644
index f098bf589e..0000000000
--- a/components/RealmWizard/components/Steps/RealmCreated.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import React from 'react'
-
-const RealmCreated: React.FC<{ realmAddress: string }> = ({ realmAddress }) => {
- return (
- <>
- Your Realm was Created!
- Address: {realmAddress}
- >
- )
-}
-
-export default RealmCreated
diff --git a/components/RealmWizard/components/Steps/WizardModeSelect.tsx b/components/RealmWizard/components/Steps/WizardModeSelect.tsx
deleted file mode 100644
index 8c0b61f240..0000000000
--- a/components/RealmWizard/components/Steps/WizardModeSelect.tsx
+++ /dev/null
@@ -1,63 +0,0 @@
-import React from 'react'
-import { RealmWizardMode } from '@components/RealmWizard/interfaces/Realm'
-
-const WizardModeSelect: React.FC<{
- onSelect: (option: number) => void
-}> = ({ onSelect }) => {
- return (
- <>
-
- Create a Decentralized Autonomous Organization (DAO)
-
-
-
-
{
- onSelect(RealmWizardMode.BASIC)
- }}
- >
-
- I want to create a multisig DAO
-
-
- Multisig DAO allows you to create an organization for your team
- members and jointly own and manage shared assets like treasury
- accounts, NFTs, programs or mints.
-
-
-
-
-
{
- onSelect(RealmWizardMode.ADVANCED)
- }}
- >
-
- I want to create a bespoke DAO
-
-
- Bespoke DAO is an advanced option and allows you to create a DAO
- customized for your individual requirements, community structure
- and governance token setup.
-
-
-
-
-
- >
- )
-}
-
-export default WizardModeSelect
diff --git a/components/RealmWizard/components/Steps/index.tsx b/components/RealmWizard/components/Steps/index.tsx
deleted file mode 100644
index b523a4d19f..0000000000
--- a/components/RealmWizard/components/Steps/index.tsx
+++ /dev/null
@@ -1,15 +0,0 @@
-import MultisigOptions from './MultisigOptions'
-import BespokeConfig from './BespokeConfig'
-import BespokeCouncil from './BespokeCouncil'
-import BespokeInfo from './BespokeInfo'
-import WizardModeSelect from './WizardModeSelect'
-import RealmCreated from './RealmCreated'
-
-export {
- MultisigOptions,
- BespokeConfig,
- BespokeCouncil,
- BespokeInfo,
- WizardModeSelect,
- RealmCreated,
-}
diff --git a/components/RealmWizard/components/TeamWalletField.tsx b/components/RealmWizard/components/TeamWalletField.tsx
deleted file mode 100644
index 6934a6af61..0000000000
--- a/components/RealmWizard/components/TeamWalletField.tsx
+++ /dev/null
@@ -1,96 +0,0 @@
-import React, { useEffect, useState } from 'react'
-import { StyledLabel } from '@components/inputs/styles'
-import AddWalletModal from './AddWalletModal'
-import { TrashIcon } from '@heroicons/react/solid'
-import { PlusCircleIcon } from '@heroicons/react/outline'
-import useWalletStore from 'stores/useWalletStore'
-import Tooltip from '@components/Tooltip'
-
-const TeamWalletField: React.FC<{
- onInsert: (wallets: string[]) => void
- onRemove: (index: number) => void
- wallets?: string[]
-}> = ({ wallets = [], onInsert, onRemove }) => {
- const [showAddWalletModal, setShowWalletModal] = useState(false)
- const { current: wallet } = useWalletStore((s) => s)
-
- const newWalletButton = (
- {
- setShowWalletModal(true)
- }}
- >
-
-
- )
-
- const isCurrentWallet = (index: number) =>
- wallets[index] === wallet?.publicKey?.toBase58()
-
- const handleRemoveWallet = (index: number) => {
- if (!isCurrentWallet(index)) onRemove(index)
- }
-
- const trashIcon = (
- type: 'disabled' | 'enabled' = 'enabled',
- index: number
- ) => {
- return (
- {
- handleRemoveWallet(index)
- }}
- />
- )
- }
-
- useEffect(() => {
- if (
- wallet?.publicKey &&
- !wallets.find((addr) => addr === wallet.publicKey?.toBase58())
- ) {
- onInsert([wallet.publicKey?.toBase58()])
- }
- }, [wallets.length, wallet?.publicKey])
-
- return (
-
-
Team wallets
- {wallets.map((wallet, index) => (
-
-
Member {index + 1}:
-
-
- {wallet}
-
- {isCurrentWallet(index) ? (
-
- {trashIcon('disabled', index)}
-
- ) : (
- trashIcon('enabled', index)
- )}
-
-
- ))}
-
-
{
- setShowWalletModal(false)
- }}
- />
- {newWalletButton}
-
- )
-}
-
-export default TeamWalletField
diff --git a/components/RealmWizard/controller/RealmWizardController.ts b/components/RealmWizard/controller/RealmWizardController.ts
deleted file mode 100644
index a2ea82e7a0..0000000000
--- a/components/RealmWizard/controller/RealmWizardController.ts
+++ /dev/null
@@ -1,120 +0,0 @@
-/* eslint-disable @typescript-eslint/no-non-null-assertion */
-import {
- RealmWizardMode,
- RealmWizardStep,
- StepDirection,
-} from '../interfaces/Realm'
-
-/**
- * This class provides methods to control the Realm Creator Wizard.
- *
- * @method mountSteps
- * @method isLastStep
- * @method isFirstStep
- * @method getNextStep
- * @method getCurrentStep
- *
- * @author [Pollum](https://pollum.io)
- * @since v0.1.0
- */
-class RealmWizardController {
- private mode: RealmWizardMode
- private steps: number[] = []
- private currentStep: RealmWizardStep
-
- constructor(mode: RealmWizardMode) {
- this.mountSteps(mode)
-
- this.currentStep = RealmWizardStep.SELECT_MODE
- }
-
- /**
- * Mounts the step based on the wizard mode
- * @param mode
- */
- private mountSteps(mode: RealmWizardMode) {
- this.mode = mode
- this.steps.push(RealmWizardStep.SELECT_MODE)
- switch (this.mode) {
- case RealmWizardMode.BASIC:
- this.steps.push(RealmWizardStep.MULTISIG_CONFIG)
- break
- case RealmWizardMode.ADVANCED:
- this.steps.push(RealmWizardStep.BESPOKE_CONFIG)
- this.steps.push(RealmWizardStep.BESPOKE_COUNCIL)
- this.steps.push(RealmWizardStep.BESPOKE_INFO)
- break
- default:
- throw new Error('The selected mode is not available')
- }
- this.steps.push(RealmWizardStep.REALM_CREATED)
- }
-
- /**
- * Returns the Next desired step. It may be the next or previous step, depending on the chosen direction
- * @param currentStep
- * @param direction
- * @returns
- */
- getNextStep(
- currentStep: RealmWizardStep,
- direction: StepDirection
- ): RealmWizardStep {
- const stepIndex = this.steps.indexOf(currentStep)
- const nextStep = this.steps[stepIndex + direction]
- if (nextStep !== undefined) {
- this.currentStep = nextStep
- return nextStep
- }
-
- throw new Error('The chosen step is not available.')
- }
-
- /**
- * Checks if the state is equal to the last step
- */
- isLastStep(): boolean {
- return this.currentStep === this.steps[this.steps.length - 2]
- }
-
- /**
- * Checks if the state is equal to the first step
- */
- isFirstStep(): boolean {
- return (
- this.currentStep === this.steps[1] ||
- this.currentStep === RealmWizardStep.REALM_CREATED
- )
- }
-
- /**
- * Checks if the page is the mode selector
- */
- isModeSelect(): boolean {
- return this.currentStep === RealmWizardStep.SELECT_MODE
- }
-
- /**
- * Return the current step
- */
- getCurrentStep(): RealmWizardStep {
- return this.currentStep
- }
-
- /**
- * Returns the pagination position of the current step
- */
- getStepPagination(): string {
- const currentStepIdx = this.steps.indexOf(this.currentStep) + 1
- const pages = this.steps.length
- return `Step ${currentStepIdx} of ${pages}`
- }
-
- /**
- * Return the current wizard mode
- */
- getMode(): RealmWizardMode {
- return this.mode
- }
-}
-export default RealmWizardController
diff --git a/components/RealmWizard/interfaces/Realm.ts b/components/RealmWizard/interfaces/Realm.ts
deleted file mode 100644
index 90c989b58e..0000000000
--- a/components/RealmWizard/interfaces/Realm.ts
+++ /dev/null
@@ -1,97 +0,0 @@
-import { ProgramAccount } from '@project-serum/anchor'
-import { MintInfo } from '@solana/spl-token'
-import { PublicKey } from '@solana/web3.js'
-import React from 'react'
-
-/**
- * Default realm artifact interface
- */
-export interface RealmArtifacts {
- governanceProgramId?: string
- name?: string
- communityMintId?: string
- communityMint?: ProgramAccount
- transferAuthority?: boolean
- councilMintId?: string
- councilMint?: ProgramAccount
- communityMintMaxVoteWeightSource?: string
- minCommunityTokensToCreateGovernance?: string
- teamWallets?: string[]
- yesThreshold?: number
-}
-
-/**
- * The modes in which the wizard will work
- */
-export enum RealmWizardMode {
- /**
- * The simplest, shows only the first step and the app
- * take cares of the rest
- */
- BASIC,
- /**
- * To the advanced users who wants to set all details
- * of the Realm.
- */
- ADVANCED,
-}
-
-/**
- * The steps in which the wizard will go through.
- * It will be bound with CreateRealmModes in order
- * to select the correct flow.
- */
-export enum RealmWizardStep {
- /**
- * The mode selection tool
- */
- SELECT_MODE,
- /**
- * Base state: set the name of the Realm and add the team wallets
- */
- MULTISIG_CONFIG,
- /**
- * Set up bespoke basic options
- */
- BESPOKE_CONFIG,
- /**
- * Set up the Bespoke council options
- */
- BESPOKE_COUNCIL,
- /**
- * Setup the governance token
- */
- GOVERNANCE,
- /**
- * Information Inserted to create realm
- */
- BESPOKE_INFO,
- /**
- * Represents the Realm Created state
- */
- REALM_CREATED,
-}
-
-export enum StepDirection {
- PREV = -1,
- NEXT = 1,
-}
-
-export interface RealmWizardStepComponentProps {
- form: RealmArtifacts
- setForm: (data: RealmArtifacts) => void
- beforeClickNext?: React.Dispatch<(...args) => boolean>
- [key: string]: any
-}
-
-export interface RealmProps {
- address?: string
- tx: number
- realmName: string
- communityMintAddress: PublicKey
- councilMintAddress: PublicKey
- tokenGovernance: {
- tokenAccountAddress: string
- beneficiaryTokenAccountAddress: string
- }
-}
diff --git a/components/RealmWizard/validators/createRealmValidator.ts b/components/RealmWizard/validators/createRealmValidator.ts
deleted file mode 100644
index 5fddaef1a2..0000000000
--- a/components/RealmWizard/validators/createRealmValidator.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-import { PublicKey } from '@solana/web3.js'
-import * as yup from 'yup'
-
-const publicKeyValidationTest = (value: string) => {
- try {
- if (!value) return false
- new PublicKey(value)
- return true
- } catch (e) {
- return false
- }
-}
-
-const CreateFormSchema = yup.object().shape({
- governanceProgramId: yup
- .string()
- .required('Governance program id is required')
- .test(
- 'is-public-key',
- 'Governance program id is not a valid public key',
- publicKeyValidationTest
- ),
- name: yup.string().required('Name is required'),
- communityMintId: yup
- .string()
- .test(
- 'is-public-key',
- 'Community token mint id is not a valid public key',
- (value) => (value ? publicKeyValidationTest(value) : true)
- ),
- // communityMint: yup.object().required('Community token mint is not valid'),
- councilMintId: yup
- .string()
- .test(
- 'is-public-key',
- 'Council token mint id is not a valid public key',
- (value) => (value ? publicKeyValidationTest(value) : true)
- ),
- councilMint: yup.object().when('councilMintId', {
- is: (value) => value,
- then: yup.object().required('Council token mint is not valid'),
- }),
-})
-
-export { CreateFormSchema, publicKeyValidationTest }
diff --git a/components/ScrollToTop.tsx b/components/ScrollToTop.tsx
deleted file mode 100644
index 62fd0206f6..0000000000
--- a/components/ScrollToTop.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import React, { useEffect, useState } from 'react'
-import { ChevronUpIcon } from '@heroicons/react/solid'
-
-export default function ScrollToTop() {
- const [isVisible, setIsVisible] = useState(false)
-
- const toggleVisibility = () => {
- if (window.pageYOffset > 300) {
- setIsVisible(true)
- } else {
- setIsVisible(false)
- }
- }
-
- const scrollToTop = () => {
- window.scrollTo({
- top: 0,
- behavior: 'smooth',
- })
- }
-
- useEffect(() => {
- window.addEventListener('scroll', toggleVisibility)
- }, [])
-
- return (
- isVisible && (
-
-
-
- )
- )
-}
diff --git a/components/SearchInput.tsx b/components/SearchInput.tsx
new file mode 100644
index 0000000000..0ee4bbf035
--- /dev/null
+++ b/components/SearchInput.tsx
@@ -0,0 +1,37 @@
+import { SearchIcon } from '@heroicons/react/outline';
+import { TrashIcon } from '@heroicons/react/outline';
+
+const SearchInput = ({
+ value,
+ onChange,
+ placeholder,
+ className,
+}: {
+ value: string;
+ onChange: (value: string) => void;
+ placeholder: string;
+ className?: string;
+}) => {
+ return (
+
+
+
+ onChange(evt.target.value)}
+ />
+
+ {value.trim().length ? (
+ onChange('')}
+ />
+ ) : null}
+
+ );
+};
+
+export default SearchInput;
diff --git a/components/SecretKeyInput.tsx b/components/SecretKeyInput.tsx
new file mode 100644
index 0000000000..fcbf15799f
--- /dev/null
+++ b/components/SecretKeyInput.tsx
@@ -0,0 +1,65 @@
+import { TrashIcon } from '@heroicons/react/outline';
+import { LockClosedIcon } from '@heroicons/react/solid';
+import { Keypair } from '@solana/web3.js';
+import { useState } from 'react';
+
+const SecretKeyInput = ({
+ value,
+ onChange,
+ placeholder,
+ className,
+}: {
+ value: Keypair | null;
+ onChange: (value: Keypair | null) => void;
+ placeholder: string;
+ className?: string;
+}) => {
+ const [message, setMessage] = useState(null);
+ const [secretKey, setSecretKey] = useState(
+ value ? value.secretKey.toString() : '',
+ );
+
+ return (
+
+
+
+
+ {
+ const secretKey = evt.target.value;
+ setSecretKey(secretKey);
+
+ try {
+ const formattedSecretKey = Uint8Array.from(JSON.parse(secretKey));
+ const keypair = Keypair.fromSecretKey(formattedSecretKey);
+
+ onChange(keypair);
+ setMessage(null);
+ } catch {
+ setMessage('Secret key is incorrect');
+ }
+ }}
+ />
+
+ {value ? (
+ {
+ onChange(null);
+ setMessage(null);
+ setSecretKey('');
+ }}
+ />
+ ) : null}
+
+
+ {message ?
{message} : null}
+
+ );
+};
+
+export default SecretKeyInput;
diff --git a/components/SelectDeltafiPool.tsx b/components/SelectDeltafiPool.tsx
new file mode 100644
index 0000000000..9288e0a972
--- /dev/null
+++ b/components/SelectDeltafiPool.tsx
@@ -0,0 +1,40 @@
+import { PoolInfo } from '@tools/sdk/deltafi/configuration';
+import Select from './inputs/Select';
+
+export type PoolName = string;
+
+const SelectDeltafiPool = ({
+ title,
+ poolInfoList,
+ selectedValue,
+ onSelect,
+}: {
+ title: string;
+ poolInfoList: PoolInfo[];
+ selectedValue?: PoolName;
+ onSelect: (poolName: PoolName) => void;
+}) => {
+ return (
+
+
{title}
+
+
+
+ );
+};
+
+export default SelectDeltafiPool;
diff --git a/components/SelectInstructionType.tsx b/components/SelectInstructionType.tsx
new file mode 100644
index 0000000000..47caca6bee
--- /dev/null
+++ b/components/SelectInstructionType.tsx
@@ -0,0 +1,138 @@
+import Select from '@components/inputs/Select';
+import useGovernanceAssets, {
+ InstructionType,
+} from '@hooks/useGovernanceAssets';
+import { PackageEnum } from '@utils/uiTypes/proposalCreationTypes';
+import { useCallback, useEffect, useState } from 'react';
+import ImageTextSelection from './ImageTextSelection';
+
+const SelectInstructionType = ({
+ idx,
+ instructionTypes,
+ selectedInstruction,
+ onChange,
+}: {
+ idx: number;
+ selectedInstruction?: InstructionType;
+ instructionTypes: InstructionType[];
+
+ onChange: ({
+ instructionType,
+ idx,
+ }: {
+ instructionType: InstructionType | null;
+ idx: number;
+ }) => void;
+}) => {
+ const [packageId, setPackageId] = useState(null);
+ const { availablePackages, getPackageTypeById } = useGovernanceAssets();
+
+ const [filteredInstructionTypes, setFilteredInstructionTypes] = useState<
+ InstructionType[]
+ >([]);
+
+ const computeFilteredInstructionsTypes = useCallback(() => {
+ if (packageId === null) {
+ setFilteredInstructionTypes(instructionTypes);
+
+ // Select first instruction by default
+ if (instructionTypes.length && !selectedInstruction) {
+ onChange({ instructionType: instructionTypes[0], idx });
+ }
+
+ return;
+ }
+
+ if (selectedInstruction && selectedInstruction.packageId !== packageId) {
+ onChange({ instructionType: null, idx });
+ }
+
+ const filteredInstructionTypes = instructionTypes.filter(
+ (instructionType) => instructionType.packageId === packageId,
+ );
+
+ // Select first instruction by default
+ if (filteredInstructionTypes.length && !selectedInstruction) {
+ onChange({ instructionType: filteredInstructionTypes[0], idx });
+ }
+
+ setFilteredInstructionTypes(filteredInstructionTypes);
+ }, [packageId, instructionTypes]);
+
+ useEffect(() => {
+ computeFilteredInstructionsTypes();
+ }, [computeFilteredInstructionsTypes]);
+
+ // Only display the package name is a no package is selected
+ const getInstructionDisplayName = (
+ instruction?: InstructionType,
+ ): string | JSX.Element => {
+ if (!instruction) {
+ return '';
+ }
+
+ return (
+ <>
+ {packageId === null ? (
+
+ {getPackageTypeById(instruction.packageId)!.name}:
+
+ ) : null}
+
+ {instruction.name}
+
+ {instruction.tag ? (
+
+ {instruction.tag}
+
+ ) : null}
+ >
+ );
+ };
+
+ const packages = [
+ {
+ id: null,
+ name: 'All',
+ },
+ ...availablePackages,
+ ];
+
+ return (
+
+
Instruction {idx + 1}
+
+
+
+
+
+
+
+ );
+};
+
+export default SelectInstructionType;
diff --git a/components/SelectOptionDetailed.tsx b/components/SelectOptionDetailed.tsx
new file mode 100644
index 0000000000..488924637a
--- /dev/null
+++ b/components/SelectOptionDetailed.tsx
@@ -0,0 +1,65 @@
+export enum Flag {
+ Danger,
+ Warning,
+ OK,
+}
+
+type OptionDetail = {
+ label: string;
+ text: string;
+ flag?: Flag;
+};
+
+const flagColorClassMap: {
+ [flag in Flag]: string;
+} = {
+ [Flag.Danger]: 'text-red',
+ [Flag.Warning]: 'text-orange',
+ [Flag.OK]: 'text-green',
+};
+
+const setFlagColorText = (flag?: Flag) => {
+ if (flag === undefined) {
+ return '';
+ }
+
+ return flagColorClassMap[flag];
+};
+
+const SelectOptionDetailed = ({
+ title,
+ details,
+ diffValue,
+}: {
+ title: string;
+ details: OptionDetail[];
+ diffValue?: OptionDetail;
+}) => {
+ return (
+
+
{title}
+
+
+ {details.map((opt, i) => (
+
+ {`${opt.label}: ${opt.text}`}
+
+ ))}
+ {diffValue && (
+
+
+ {diffValue.text}
+
+
+ )}
+
+
+ );
+};
+
+export default SelectOptionDetailed;
diff --git a/components/SelectOrcaWhirlpool.tsx b/components/SelectOrcaWhirlpool.tsx
new file mode 100644
index 0000000000..a2daf1a70a
--- /dev/null
+++ b/components/SelectOrcaWhirlpool.tsx
@@ -0,0 +1,40 @@
+import { WhirlpoolName, Whirlpools } from '@tools/sdk/orca/configuration';
+import Select from './inputs/Select';
+
+const SelectOrcaWhirlpool = ({
+ title,
+ whirlpools,
+ selectedValue,
+ onSelect,
+}: {
+ title: string;
+ whirlpools: Whirlpools;
+ selectedValue?: WhirlpoolName;
+ onSelect: (whirlpoolName: WhirlpoolName) => void;
+}) => {
+ return (
+
+
{title}
+
+
+
+ );
+};
+
+export default SelectOrcaWhirlpool;
diff --git a/components/SelectOrcaWhirlpoolPosition.tsx b/components/SelectOrcaWhirlpoolPosition.tsx
new file mode 100644
index 0000000000..57b4f8d2ec
--- /dev/null
+++ b/components/SelectOrcaWhirlpoolPosition.tsx
@@ -0,0 +1,89 @@
+import { WhirlpoolPositionInfo } from '@tools/sdk/orca/configuration';
+import Select from './inputs/Select';
+
+const SelectOrcaWhirlpoolPosition = ({
+ title,
+ positionsInfo,
+ selectedValue,
+ onSelect,
+}: {
+ title: string;
+ positionsInfo: WhirlpoolPositionInfo[];
+ selectedValue?: WhirlpoolPositionInfo;
+ onSelect: (positionInfo: WhirlpoolPositionInfo | null) => void;
+}) => {
+ const getPositionDisplay = (positionInfo: WhirlpoolPositionInfo) => (
+
+
+
+ Price range {positionInfo.tokenAName} per {positionInfo.tokenBName}
+
+
+ {positionInfo.uiLowerPrice} - {positionInfo.uiUpperPrice}
+
+
+
+
+ Pubkey
+
+ {positionInfo.publicKey.toBase58()}
+
+
+
+
+ Liquidity
+ {positionInfo.liquidity}
+
+
+
+ Position Mint
+
+ {positionInfo.positionMint.toBase58()}
+
+
+
+ );
+
+ return (
+
+
{title}
+
+ {positionsInfo.length ? (
+
+ ) : (
+
No position available
+ )}
+
+ );
+};
+
+export default SelectOrcaWhirlpoolPosition;
diff --git a/components/Slider.tsx b/components/Slider.tsx
index 8e4bb35e05..71d04bf267 100644
--- a/components/Slider.tsx
+++ b/components/Slider.tsx
@@ -1,13 +1,13 @@
-import { FunctionComponent, useEffect, useState } from 'react'
-import tw from 'twin.macro'
-import styled from '@emotion/styled'
-import Slider from 'rc-slider'
-import 'rc-slider/assets/index.css'
+import { FunctionComponent, useEffect, useState } from 'react';
+import tw from 'twin.macro';
+import styled from '@emotion/styled';
+import Slider from 'rc-slider';
+import 'rc-slider/assets/index.css';
type StyledSliderProps = {
- enableTransition?: boolean
- disabled?: boolean
-}
+ enableTransition?: boolean;
+ disabled?: boolean;
+};
const StyledSlider = styled(Slider)`
.rc-slider-rail {
@@ -53,16 +53,16 @@ const StyledSlider = styled(Slider)`
}
${({ disabled }) => disabled && 'background-color: transparent'}
-`
+`;
const StyledSliderButtonWrapper = styled.div`
${tw`absolute left-0 top-4 w-full`}
-`
+`;
type StyledSliderButtonProps = {
- styleValue: number
- sliderValue: number
-}
+ styleValue: number;
+ sliderValue: number;
+};
const StyledSliderButton = styled.button`
${tw`bg-none font-display transition-all duration-300 hover:text-primary-light focus:outline-none`}
@@ -97,16 +97,16 @@ const StyledSliderButton = styled.button`
${({ styleValue, sliderValue }) =>
styleValue === sliderValue && tw`animate-pulse text-primary-light`}
${({ disabled }) => disabled && 'cursor: default'}
-`
+`;
type SliderProps = {
- onChange: (...args: any[]) => any
- step: number
- value: number
- disabled: boolean
- max?: number
- maxButtonTransition?: boolean
-}
+ onChange: (...args: any[]) => any;
+ step: number;
+ value: number;
+ disabled: boolean;
+ max?: number;
+ maxButtonTransition?: boolean;
+};
const AmountSlider: FunctionComponent = ({
onChange,
@@ -116,27 +116,27 @@ const AmountSlider: FunctionComponent = ({
max,
maxButtonTransition,
}) => {
- const [enableTransition, setEnableTransition] = useState(false)
+ const [enableTransition, setEnableTransition] = useState(false);
useEffect(() => {
if (maxButtonTransition) {
- setEnableTransition(true)
+ setEnableTransition(true);
}
- }, [maxButtonTransition])
+ }, [maxButtonTransition]);
useEffect(() => {
if (enableTransition) {
const transitionTimer = setTimeout(() => {
- setEnableTransition(false)
- }, 500)
- return () => clearTimeout(transitionTimer)
+ setEnableTransition(false);
+ }, 500);
+ return () => clearTimeout(transitionTimer);
}
- }, [enableTransition])
+ }, [enableTransition]);
const handleSliderButtonClick = (value) => {
- onChange(value)
- setEnableTransition(true)
- }
+ onChange(value);
+ setEnableTransition(true);
+ };
return (
@@ -192,7 +192,7 @@ const AmountSlider: FunctionComponent = ({
- )
-}
+ );
+};
-export default AmountSlider
+export default AmountSlider;
diff --git a/components/Switch.tsx b/components/Switch.tsx
index 570b3798de..d4a2858467 100644
--- a/components/Switch.tsx
+++ b/components/Switch.tsx
@@ -1,9 +1,9 @@
-import { FunctionComponent } from 'react'
+import { FunctionComponent } from 'react';
interface SwitchProps {
- checked: boolean
- className?: string
- onChange: (x: boolean) => void
+ checked: boolean;
+ className?: string;
+ onChange: (x: boolean) => void;
}
const Switch: FunctionComponent = ({
@@ -13,8 +13,8 @@ const Switch: FunctionComponent = ({
onChange,
}) => {
const handleClick = () => {
- onChange(!checked)
- }
+ onChange(!checked);
+ };
return (
@@ -42,7 +42,7 @@ const Switch: FunctionComponent = ({
>
- )
-}
+ );
+};
-export default Switch
+export default Switch;
diff --git a/components/Tabs.tsx b/components/Tabs.tsx
index 617e3999ef..293e6f3415 100644
--- a/components/Tabs.tsx
+++ b/components/Tabs.tsx
@@ -1,9 +1,9 @@
-import { FunctionComponent } from 'react'
+import { FunctionComponent } from 'react';
interface TabsProps {
- activeTab: string
- onChange: (x) => void
- tabs: Array
+ activeTab: string;
+ onChange: (x) => void;
+ tabs: Array;
}
const Tabs: FunctionComponent = ({ activeTab, onChange, tabs }) => {
@@ -36,11 +36,11 @@ const Tabs: FunctionComponent = ({ activeTab, onChange, tabs }) => {
>
{tabName}
- )
+ );
})}
- )
-}
+ );
+};
-export default Tabs
+export default Tabs;
diff --git a/components/TokenBalance/NftBalanceCard.tsx b/components/TokenBalance/NftBalanceCard.tsx
index bb4eba60f2..5fd46cd43d 100644
--- a/components/TokenBalance/NftBalanceCard.tsx
+++ b/components/TokenBalance/NftBalanceCard.tsx
@@ -1,9 +1,9 @@
-import NFTSelector from '@components/NFTS/NFTSelector'
-import useWalletStore from 'stores/useWalletStore'
+import NFTSelector from '@components/NFTS/NFTSelector';
+import useWalletStore from 'stores/useWalletStore';
const NftBalanceCard = () => {
- const connected = useWalletStore((s) => s.connected)
- const wallet = useWalletStore((s) => s.current)
+ const connected = useWalletStore((s) => s.connected);
+ const wallet = useWalletStore((s) => s.current);
return (
Your NFTS
@@ -13,7 +13,7 @@ const NftBalanceCard = () => {
) : (
{
- return null
+ return null;
}}
ownerPk={wallet!.publicKey!}
nftHeight="50px"
@@ -24,6 +24,6 @@ const NftBalanceCard = () => {
)}
- )
-}
-export default NftBalanceCard
+ );
+};
+export default NftBalanceCard;
diff --git a/components/TokenBalance/TokenBalanceCard.tsx b/components/TokenBalance/TokenBalanceCard.tsx
index b5d3b0f747..2d610015a4 100644
--- a/components/TokenBalance/TokenBalanceCard.tsx
+++ b/components/TokenBalance/TokenBalanceCard.tsx
@@ -1,106 +1,88 @@
-import { MintInfo } from '@solana/spl-token'
+import { MintInfo } from '@solana/spl-token';
import {
Keypair,
PublicKey,
Transaction,
TransactionInstruction,
-} from '@solana/web3.js'
-import BN from 'bn.js'
-import useRealm from '@hooks/useRealm'
+} from '@solana/web3.js';
+import BN from 'bn.js';
+import useRealm from '@hooks/useRealm';
import {
getProposal,
- getTokenOwnerRecordAddress,
+ ProgramAccount,
Proposal,
ProposalState,
-} from '@solana/spl-governance'
-import { getUnrelinquishedVoteRecords } from '@models/api'
-import { withDepositGoverningTokens } from '@solana/spl-governance'
-import { withRelinquishVote } from '@solana/spl-governance'
-import { withWithdrawGoverningTokens } from '@solana/spl-governance'
-import useWalletStore from '../../stores/useWalletStore'
-import { sendTransaction } from '@utils/send'
-import { approveTokenTransfer } from '@utils/tokens'
-import Button, { LinkButton } from '../Button'
-import { Option } from '@tools/core/option'
-import { GoverningTokenType } from '@solana/spl-governance'
-import { fmtMintAmount } from '@tools/sdk/units'
-import { getMintMetadata } from '../instructions/programs/splToken'
-import { withFinalizeVote } from '@solana/spl-governance'
-import { chunks } from '@utils/helpers'
-import { getProgramVersionForRealm } from '@models/registry/api'
-import { notify } from '@utils/notifications'
-import { ChevronRightIcon, ExclamationIcon } from '@heroicons/react/outline'
-import useQueryContext from '@hooks/useQueryContext'
-import { useRouter } from 'next/router'
-import { useEffect, useState } from 'react'
+ TokenOwnerRecord,
+ VoteRecord,
+} from '@solana/spl-governance';
+import { getUnrelinquishedVoteRecords } from '@models/api';
+import { withDepositGoverningTokens } from '@solana/spl-governance';
+import { withRelinquishVote } from '@solana/spl-governance';
+import { withWithdrawGoverningTokens } from '@solana/spl-governance';
+import useWalletStore from '../../stores/useWalletStore';
+import { sendTransaction } from '@utils/send';
+import { approveTokenTransfer } from '@utils/tokens';
+import Button from '../Button';
+import { Option } from '@tools/core/option';
+import { GoverningTokenType } from '@solana/spl-governance';
+import { fmtMintAmount } from '@tools/sdk/units';
+import { getMintMetadata } from '../instructions/programs/splToken';
+import { withFinalizeVote } from '@solana/spl-governance';
+import { BN_ZERO, chunks } from '@utils/helpers';
+import { getProgramVersionForRealm } from '@models/registry/api';
+import { notify } from '@utils/notifications';
+import { ExclamationIcon } from '@heroicons/react/outline';
+import { VoteRegistryVoterWeight, VoterWeight } from '@models/voteWeights';
+import { fmtTokenAmount } from '@utils/formatting';
+import Tooltip from '@components/Tooltip';
+
+type AccountToVoteFor = {
+ tokenRecord?: ProgramAccount;
+ voterWeight?: VoteRegistryVoterWeight | VoterWeight;
+ voteRecord?: ProgramAccount;
+ voterTokenRecord?: ProgramAccount;
+};
+
+type AccountsToVoteFor = AccountToVoteFor[];
+
+function countVotingPower(accountsToVoteFor: AccountsToVoteFor) {
+ return accountsToVoteFor.reduce(
+ (acc, account) =>
+ account.voterTokenRecord
+ ? acc.add(account.voterTokenRecord.account.governingTokenDepositAmount)
+ : acc,
+ BN_ZERO,
+ );
+}
const TokenBalanceCard = ({ proposal }: { proposal?: Option }) => {
- const router = useRouter()
- const { councilMint, mint, realm, symbol } = useRealm()
- const connected = useWalletStore((s) => s.connected)
- const wallet = useWalletStore((s) => s.current)
- const [tokenOwnerRecordPk, setTokenOwneRecordPk] = useState('')
- const { fmtUrlWithCluster } = useQueryContext()
+ const { realm, councilMint, mint } = useRealm();
+
const isDepositVisible = (
depositMint: MintInfo | undefined,
- realmMint: PublicKey | undefined
+ realmMint: PublicKey | undefined,
) =>
depositMint &&
(!proposal ||
(proposal.isSome() &&
- proposal.value.governingTokenMint.toBase58() === realmMint?.toBase58()))
+ proposal.value.governingTokenMint.toBase58() ===
+ realmMint?.toBase58()));
const communityDepositVisible =
// If there is no council then community deposit is the only option to show
!realm?.account.config.councilMint ||
- isDepositVisible(mint, realm?.account.communityMint)
+ isDepositVisible(mint, realm?.account.communityMint);
const councilDepositVisible = isDepositVisible(
councilMint,
- realm?.account.config.councilMint
- )
- useEffect(() => {
- const getTokenOwnerRecord = async () => {
- const defaultMint = !mint?.supply.isZero()
- ? realm!.account.communityMint
- : !councilMint?.supply.isZero()
- ? realm!.account.config.councilMint
- : undefined
- const tokenOwnerRecordAddress = await getTokenOwnerRecordAddress(
- realm!.owner,
- realm!.pubkey,
- defaultMint!,
- wallet!.publicKey!
- )
- setTokenOwneRecordPk(tokenOwnerRecordAddress.toBase58())
- }
- if (realm && wallet?.connected) {
- getTokenOwnerRecord()
- }
- }, [realm?.pubkey.toBase58(), wallet?.connected])
- const hasLoaded = mint || councilMint
+ realm?.account.config.councilMint,
+ );
+
+ const hasLoaded = mint || councilMint;
return (
-
- Your Tokens
- {
- const url = fmtUrlWithCluster(
- `/dao/${symbol}/account/${tokenOwnerRecordPk}`
- )
- router.push(url)
- }}
- >
- Manage
-
-
-
+
Your Tokens
{hasLoaded ? (
{communityDepositVisible && (
@@ -125,24 +107,24 @@ const TokenBalanceCard = ({ proposal }: { proposal?: Option
}) => {
>
)}
- )
-}
+ );
+};
const TokenDeposit = ({
mint,
tokenType,
councilVote,
}: {
- mint: MintInfo | undefined
- tokenType: GoverningTokenType
- councilVote?: boolean
+ mint: MintInfo | undefined;
+ tokenType: GoverningTokenType;
+ councilVote?: boolean;
}) => {
- const wallet = useWalletStore((s) => s.current)
- const connected = useWalletStore((s) => s.connected)
- const connection = useWalletStore((s) => s.connection.current)
+ const wallet = useWalletStore((s) => s.current);
+ const connected = useWalletStore((s) => s.connected);
+ const connection = useWalletStore((s) => s.connection.current);
const { fetchWalletTokenAccounts, fetchRealm } = useWalletStore(
- (s) => s.actions
- )
+ (s) => s.actions,
+ );
const {
realm,
realmInfo,
@@ -154,46 +136,103 @@ const TokenDeposit = ({
governances,
toManyCommunityOutstandingProposalsForUser,
toManyCouncilOutstandingProposalsForUse,
- } = useRealm()
+ tokenRecords,
+ councilTokenOwnerRecords,
+ } = useRealm();
+
+ const { voteRecordsByVoter } = useWalletStore((s) => s.selectedProposal);
+
+ // Look for accounts where the user is the delegate
+ const getDelegatedAccounts = (): {
+ address: string;
+ nbToken: number;
+ }[] => {
+ if (!wallet?.publicKey) {
+ return [];
+ }
+
+ if (!mint) {
+ throw new Error('Mint info not found');
+ }
+
+ return Object.entries(tokenRecords)
+ .filter(([, value]) =>
+ value.account.governanceDelegate?.equals(wallet.publicKey!),
+ )
+ .map(([key, value]) => ({
+ address: key,
+ nbToken: fmtTokenAmount(
+ value.account.governingTokenDepositAmount,
+ mint.decimals,
+ ),
+ }));
+ };
+
+ // Show nothing if not connected
+ if (!wallet?.publicKey) {
+ return <>>;
+ }
+
// Do not show deposits for mints with zero supply because nobody can deposit anyway
if (!mint || mint.supply.isZero()) {
- return null
+ return null;
}
+ const delegatedAccounts = getDelegatedAccounts().map(
+ ({ address: delegatedAccountAddress }) => ({
+ tokenRecord:
+ tokenType === GoverningTokenType.Community
+ ? tokenRecords[delegatedAccountAddress]
+ : councilTokenOwnerRecords[delegatedAccountAddress],
+ voterWeight: new VoterWeight(ownTokenRecord, ownCouncilTokenRecord),
+ voteRecord: voteRecordsByVoter[delegatedAccountAddress],
+ voterTokenRecord:
+ tokenType === GoverningTokenType.Community
+ ? tokenRecords[delegatedAccountAddress]
+ : councilTokenOwnerRecords[delegatedAccountAddress],
+ }),
+ );
+
+ const votingPowerOfDelegatedAccounts = countVotingPower(delegatedAccounts);
+ const uiVotingPowerOfDelegatedAccounts = fmtTokenAmount(
+ votingPowerOfDelegatedAccounts,
+ mint.decimals,
+ );
+
const depositTokenRecord =
tokenType === GoverningTokenType.Community
? ownTokenRecord
- : ownCouncilTokenRecord
+ : ownCouncilTokenRecord;
const depositTokenAccount =
tokenType === GoverningTokenType.Community
? realmTokenAccount
- : councilTokenAccount
+ : councilTokenAccount;
const depositMint =
tokenType === GoverningTokenType.Community
? realm?.account.communityMint
- : realm?.account.config.councilMint
+ : realm?.account.config.councilMint;
- const tokenName = getMintMetadata(depositMint)?.name ?? realm?.account.name
+ const tokenName = getMintMetadata(depositMint)?.name ?? realm?.account.name;
const depositTokenName = `${tokenName} ${
tokenType === GoverningTokenType.Community ? '' : 'Council'
- }`
+ }`;
const depositTokens = async function (amount: BN) {
- const instructions: TransactionInstruction[] = []
- const signers: Keypair[] = []
+ const instructions: TransactionInstruction[] = [];
+ const signers: Keypair[] = [];
const transferAuthority = approveTokenTransfer(
instructions,
[],
depositTokenAccount!.publicKey,
wallet!.publicKey!,
- amount
- )
+ amount,
+ );
- signers.push(transferAuthority)
+ signers.push(transferAuthority);
await withDepositGoverningTokens(
instructions,
@@ -205,11 +244,11 @@ const TokenDeposit = ({
wallet!.publicKey!,
transferAuthority.publicKey,
wallet!.publicKey!,
- amount
- )
+ amount,
+ );
- const transaction = new Transaction()
- transaction.add(...instructions)
+ const transaction = new Transaction();
+ transaction.add(...instructions);
await sendTransaction({
connection,
@@ -218,61 +257,64 @@ const TokenDeposit = ({
signers,
sendingMessage: 'Depositing tokens',
successMessage: 'Tokens have been deposited',
- })
+ });
- await fetchWalletTokenAccounts()
- await fetchRealm(realmInfo!.programId, realmInfo!.realmId)
- }
+ await fetchWalletTokenAccounts();
+ await fetchRealm(realmInfo!.programId, realmInfo!.realmId);
+ };
const depositAllTokens = async () =>
- await depositTokens(depositTokenAccount!.account.amount)
+ await depositTokens(depositTokenAccount!.account.amount);
const withdrawAllTokens = async function () {
- const instructions: TransactionInstruction[] = []
+ const instructions: TransactionInstruction[] = [];
// If there are unrelinquished votes for the voter then let's release them in the same instruction as convenience
if (depositTokenRecord!.account!.unrelinquishedVotesCount > 0) {
const voteRecords = await getUnrelinquishedVoteRecords(
connection,
realmInfo!.programId,
- depositTokenRecord!.account!.governingTokenOwner
- )
-
- console.log('Vote Records', voteRecords)
+ depositTokenRecord!.account!.governingTokenOwner,
+ );
for (const voteRecord of Object.values(voteRecords)) {
- let proposal = proposals[voteRecord.account.proposal.toBase58()]
+ let proposal = proposals[voteRecord.account.proposal.toBase58()];
if (!proposal) {
- continue
+ continue;
+ }
+
+ // In the voteRecords, council token votes and governing token votes are mixed up
+ // Gotta be sure here we deal only with the appropriate one
+ if (!depositMint!.equals(proposal.account.governingTokenMint)) {
+ continue;
}
if (proposal.account.state === ProposalState.Voting) {
// If the Proposal is in Voting state refetch it to make sure we have the latest state to avoid false positives
- proposal = await getProposal(connection, proposal.pubkey)
+ proposal = await getProposal(connection, proposal.pubkey);
if (proposal.account.state === ProposalState.Voting) {
const governance =
- governances[proposal.account.governance.toBase58()]
+ governances[proposal.account.governance.toBase58()];
if (proposal.account.getTimeToVoteEnd(governance.account) > 0) {
// Note: It's technically possible to withdraw the vote here but I think it would be confusing and people would end up unconsciously withdrawing their votes
notify({
type: 'error',
message: `Can't withdraw tokens while Proposal ${proposal.account.name} is being voted on. Please withdraw your vote first`,
- })
- throw new Error(
- `Can't withdraw tokens while Proposal ${proposal.account.name} is being voted on. Please withdraw your vote first`
- )
- } else {
- // finalize proposal before withdrawing tokens so we don't stop the vote from succeeding
- await withFinalizeVote(
- instructions,
- realmInfo!.programId,
- getProgramVersionForRealm(realmInfo!),
- realm!.pubkey,
- proposal.account.governance,
- proposal.pubkey,
- proposal.account.tokenOwnerRecord,
- proposal.account.governingTokenMint
- )
+ });
+
+ return;
}
+
+ // finalize proposal before withdrawing tokens so we don't stop the vote from succeeding
+ await withFinalizeVote(
+ instructions,
+ realmInfo!.programId,
+ getProgramVersionForRealm(realmInfo!),
+ realm!.pubkey,
+ proposal.account.governance,
+ proposal.pubkey,
+ proposal.account.tokenOwnerRecord,
+ proposal.account.governingTokenMint,
+ );
}
}
@@ -288,8 +330,8 @@ const TokenDeposit = ({
proposal.account.governingTokenMint,
voteRecord.pubkey,
depositTokenRecord!.account.governingTokenOwner,
- wallet!.publicKey!
- )
+ wallet!.publicKey!,
+ );
}
}
@@ -299,15 +341,15 @@ const TokenDeposit = ({
realm!.pubkey,
depositTokenAccount!.publicKey,
depositTokenRecord!.account.governingTokenMint,
- wallet!.publicKey!
- )
+ wallet!.publicKey!,
+ );
try {
// use chunks of 8 here since we added finalize,
// because previously 9 withdraws used to fit into one tx
- const ixChunks = chunks(instructions, 8)
+ const ixChunks = chunks(instructions, 8);
for (const [index, chunk] of ixChunks.entries()) {
- const transaction = new Transaction().add(...chunk)
+ const transaction = new Transaction().add(...chunk);
await sendTransaction({
connection,
wallet,
@@ -320,29 +362,29 @@ const TokenDeposit = ({
index == ixChunks.length - 1
? 'Tokens have been withdrawn'
: `Released tokens (${index}/${ixChunks.length - 2})`,
- })
+ });
}
- await fetchWalletTokenAccounts()
- await fetchRealm(realmInfo!.programId, realmInfo!.realmId)
+ await fetchWalletTokenAccounts();
+ await fetchRealm(realmInfo!.programId, realmInfo!.realmId);
} catch (ex) {
//TODO change to more friendly notification
- notify({ type: 'error', message: `${ex}` })
- console.error("Can't withdraw tokens", ex)
+ notify({ type: 'error', message: `${ex}` });
+ console.error("Can't withdraw tokens", ex);
}
- }
+ };
const hasTokensInWallet =
- depositTokenAccount && depositTokenAccount.account.amount.gt(new BN(0))
+ depositTokenAccount && depositTokenAccount.account.amount.gt(BN_ZERO);
const hasTokensDeposited =
depositTokenRecord &&
- depositTokenRecord.account.governingTokenDepositAmount.gt(new BN(0))
+ depositTokenRecord.account.governingTokenDepositAmount.gt(BN_ZERO);
const depositTooltipContent = !connected
? 'Connect your wallet to deposit'
: !hasTokensInWallet
? "You don't have any governance tokens in your wallet to deposit."
- : ''
+ : '';
const withdrawTooltipContent = !connected
? 'Connect your wallet to withdraw'
: !hasTokensDeposited
@@ -351,33 +393,45 @@ const TokenDeposit = ({
(toManyCouncilOutstandingProposalsForUse ||
toManyCommunityOutstandingProposalsForUser)
? 'You have to many outstanding proposals to withdraw.'
- : ''
+ : '';
const availableTokens =
depositTokenRecord && mint
? fmtMintAmount(
mint,
- depositTokenRecord.account.governingTokenDepositAmount
+ depositTokenRecord.account.governingTokenDepositAmount,
)
- : '0'
+ : '0';
const canShowAvailableTokensMessage =
- !hasTokensDeposited && hasTokensInWallet && connected
- const canExecuteAction = !hasTokensDeposited ? 'deposit' : 'withdraw'
- const canDepositToken = !hasTokensDeposited && hasTokensInWallet
+ !hasTokensDeposited && hasTokensInWallet && connected;
+ const canExecuteAction = !hasTokensDeposited ? 'deposit' : 'withdraw';
+ const canDepositToken = !hasTokensDeposited && hasTokensInWallet;
const tokensToShow =
canDepositToken && depositTokenAccount
? fmtMintAmount(mint, depositTokenAccount.account.amount)
: canDepositToken
? availableTokens
- : 0
+ : 0;
return (
<>
{depositTokenName} Votes
-
{availableTokens}
+
+ {availableTokens}
+ {uiVotingPowerOfDelegatedAccounts > 0 ? (
+
+
+
+
+ {uiVotingPowerOfDelegatedAccounts.toString()}
+
+
+
+ ) : null}
+
@@ -420,7 +474,7 @@ const TokenDeposit = ({
)}
>
- )
-}
+ );
+};
-export default TokenBalanceCard
+export default TokenBalanceCard;
diff --git a/components/TokenBalance/TokenBalanceCardWrapper.tsx b/components/TokenBalance/TokenBalanceCardWrapper.tsx
index e5b9ba75c3..629ccd3338 100644
--- a/components/TokenBalance/TokenBalanceCardWrapper.tsx
+++ b/components/TokenBalance/TokenBalanceCardWrapper.tsx
@@ -1,44 +1,44 @@
-import { Proposal } from '@solana/spl-governance'
-import { Option } from 'tools/core/option'
-import useRealm from '@hooks/useRealm'
-import dynamic from 'next/dynamic'
+import { Proposal } from '@solana/spl-governance';
+import { Option } from 'tools/core/option';
+import useRealm from '@hooks/useRealm';
+import dynamic from 'next/dynamic';
const LockPluginTokenBalanceCard = dynamic(
() =>
import(
'VoteStakeRegistry/components/TokenBalance/LockPluginTokenBalanceCard'
- )
-)
-const TokenBalanceCard = dynamic(() => import('./TokenBalanceCard'))
-const NftBalanceCard = dynamic(() => import('./NftBalanceCard'))
+ ),
+);
+const TokenBalanceCard = dynamic(() => import('./TokenBalanceCard'));
+const NftBalanceCard = dynamic(() => import('./NftBalanceCard'));
const TokenBalanceCardWrapper = ({
proposal,
}: {
- proposal?: Option
+ proposal?: Option;
}) => {
- const { realm, ownTokenRecord } = useRealm()
+ const { realm, ownTokenRecord } = useRealm();
const getTokenBalanceCard = () => {
//based on realm config it will provide proper tokenBalanceCardComponent
- const isLockTokensMode = realm?.account.config.useCommunityVoterWeightAddin
+ const isLockTokensMode = realm?.account.config.useCommunityVoterWeightAddin;
if (
isLockTokensMode &&
(!ownTokenRecord ||
ownTokenRecord.account.governingTokenDepositAmount.isZero())
) {
- return
+ return ;
}
if (
realm?.pubkey.toBase58() ===
'HVywtno57PwcgWQzRaf3Pv8RKWWrF1zoqLZGULNC2jGm'
) {
- return
+ return ;
}
//Default
- return
- }
- return getTokenBalanceCard()
-}
+ return ;
+ };
+ return getTokenBalanceCard();
+};
-export default TokenBalanceCardWrapper
+export default TokenBalanceCardWrapper;
diff --git a/components/Tooltip.tsx b/components/Tooltip.tsx
index 73542f2de0..79c4b86284 100644
--- a/components/Tooltip.tsx
+++ b/components/Tooltip.tsx
@@ -1,14 +1,14 @@
-import React, { ReactNode } from 'react'
-import Tippy from '@tippyjs/react'
-import 'tippy.js/animations/scale.css'
+import React, { ReactNode } from 'react';
+import Tippy from '@tippyjs/react';
+import 'tippy.js/animations/scale.css';
type TooltipProps = {
- content: ReactNode
- placement?: any
- className?: string
- children?: ReactNode
- contentClassName?: string
-}
+ content: ReactNode;
+ placement?: any;
+ className?: string;
+ children?: ReactNode;
+ contentClassName?: string;
+};
const Tooltip = ({
children,
@@ -38,8 +38,8 @@ const Tooltip = ({
) : (
<>{children}>
- )
-}
+ );
+};
const Content = ({ className = '', children }) => {
return (
@@ -48,9 +48,9 @@ const Content = ({ className = '', children }) => {
>
{children}
- )
-}
+ );
+};
-Tooltip.Content = Content
+Tooltip.Content = Content;
-export default Tooltip
+export default Tooltip;
diff --git a/components/TreasuryAccount/AccountHeader.tsx b/components/TreasuryAccount/AccountHeader.tsx
index 7e84b46b57..aa8258e30d 100644
--- a/components/TreasuryAccount/AccountHeader.tsx
+++ b/components/TreasuryAccount/AccountHeader.tsx
@@ -1,20 +1,20 @@
-import { BN } from '@project-serum/anchor'
-import { getMintDecimalAmountFromNatural } from '@tools/sdk/units'
-import tokenService from '@utils/services/token'
-import BigNumber from 'bignumber.js'
-import { useEffect, useState } from 'react'
-import useTreasuryAccountStore from 'stores/useTreasuryAccountStore'
+import { BN } from '@project-serum/anchor';
+import { getMintDecimalAmountFromNatural } from '@tools/sdk/units';
+import tokenService from '@utils/services/token';
+import BigNumber from 'bignumber.js';
+import { useEffect, useState } from 'react';
+import useTreasuryAccountStore from 'stores/useTreasuryAccountStore';
const AccountHeader = () => {
- const currentAccount = useTreasuryAccountStore((s) => s.currentAccount)
- const governanceNfts = useTreasuryAccountStore((s) => s.governanceNfts)
+ const currentAccount = useTreasuryAccountStore((s) => s.currentAccount);
+ const governanceNfts = useTreasuryAccountStore((s) => s.governanceNfts);
const nftsCount =
currentAccount?.governance && currentAccount.isNft
? governanceNfts[currentAccount?.governance?.pubkey.toBase58()]?.length
- : 0
- const isNFT = currentAccount?.isNft
- const tokenInfo = useTreasuryAccountStore((s) => s.tokenInfo)
- const [totalPrice, setTotalPrice] = useState('')
+ : 0;
+ const isNFT = currentAccount?.isNft;
+ const tokenInfo = useTreasuryAccountStore((s) => s.tokenInfo);
+ const [totalPrice, setTotalPrice] = useState('');
const amount =
currentAccount && currentAccount.mint?.account
? getMintDecimalAmountFromNatural(
@@ -22,23 +22,23 @@ const AccountHeader = () => {
new BN(
!currentAccount.isSol
? currentAccount.token!.account.amount
- : currentAccount.solAccount!.lamports
- )
+ : currentAccount.solAccount!.lamports,
+ ),
).toNumber()
- : 0
- const amountFormatted = new BigNumber(amount).toFormat()
- const mintAddress = useTreasuryAccountStore((s) => s.mintAddress)
+ : 0;
+ const amountFormatted = new BigNumber(amount).toFormat();
+ const mintAddress = useTreasuryAccountStore((s) => s.mintAddress);
function handleSetTotalPrice() {
- const price = tokenService.getUSDTokenPrice(mintAddress)
- const totalPrice = amount * price
+ const price = tokenService.getUSDTokenPrice(mintAddress);
+ const totalPrice = amount * price;
const totalPriceFormatted = amount
? new BigNumber(totalPrice).toFormat(0)
- : ''
- setTotalPrice(totalPriceFormatted)
+ : '';
+ setTotalPrice(totalPriceFormatted);
}
useEffect(() => {
- handleSetTotalPrice()
- }, [currentAccount])
+ handleSetTotalPrice();
+ }, [currentAccount]);
return (
{(tokenInfo?.logoURI || isNFT) && (
@@ -59,7 +59,7 @@ const AccountHeader = () => {
- )
-}
+ );
+};
-export default AccountHeader
+export default AccountHeader;
diff --git a/components/TreasuryAccount/AccountItem.tsx b/components/TreasuryAccount/AccountItem.tsx
index 44a0ed7b80..677fcc388c 100644
--- a/components/TreasuryAccount/AccountItem.tsx
+++ b/components/TreasuryAccount/AccountItem.tsx
@@ -1,13 +1,13 @@
-import { GovernedTokenAccount } from '@utils/tokens'
-import useTreasuryAccountStore from 'stores/useTreasuryAccountStore'
-import { getTreasuryAccountItemInfo } from '@utils/treasuryTools'
+import { GovernedTokenAccount } from '@utils/tokens';
+import useTreasuryAccountStore from 'stores/useTreasuryAccountStore';
+import { getTreasuryAccountItemInfo } from '@utils/treasuryTools';
const AccountItem = ({
governedAccountTokenAccount,
}: {
- governedAccountTokenAccount: GovernedTokenAccount
+ governedAccountTokenAccount: GovernedTokenAccount;
}) => {
- const governanceNfts = useTreasuryAccountStore((s) => s.governanceNfts)
+ const governanceNfts = useTreasuryAccountStore((s) => s.governanceNfts);
const {
amountFormatted,
logo,
@@ -15,7 +15,7 @@ const AccountItem = ({
symbol,
displayPrice,
isSol,
- } = getTreasuryAccountItemInfo(governedAccountTokenAccount, governanceNfts)
+ } = getTreasuryAccountItemInfo(governedAccountTokenAccount, governanceNfts);
return (
@@ -41,7 +41,7 @@ const AccountItem = ({
)}
- )
-}
+ );
+};
-export default AccountItem
+export default AccountItem;
diff --git a/components/TreasuryAccount/AccountItemNFT.tsx b/components/TreasuryAccount/AccountItemNFT.tsx
index 135b39a46a..b12fbc6e49 100644
--- a/components/TreasuryAccount/AccountItemNFT.tsx
+++ b/components/TreasuryAccount/AccountItemNFT.tsx
@@ -1,29 +1,29 @@
-import { PublicKey } from '@solana/web3.js'
-import { GovernedTokenAccount } from '@utils/tokens'
-import { abbreviateAddress } from '@utils/formatting'
-import useWalletStore from '../../stores/useWalletStore'
-import useTreasuryAccountStore from 'stores/useTreasuryAccountStore'
+import { PublicKey } from '@solana/web3.js';
+import { GovernedTokenAccount } from '@utils/tokens';
+import { abbreviateAddress } from '@utils/formatting';
+import useWalletStore from '../../stores/useWalletStore';
+import useTreasuryAccountStore from 'stores/useTreasuryAccountStore';
const AccountItemNFT = ({
governedAccountTokenAccount,
className,
onClick,
border = false,
}: {
- governedAccountTokenAccount: GovernedTokenAccount
- className?: string
- onClick?: () => void
- border?: boolean
+ governedAccountTokenAccount: GovernedTokenAccount;
+ className?: string;
+ onClick?: () => void;
+ border?: boolean;
}) => {
- const connection = useWalletStore((s) => s.connection)
- const governanceNfts = useTreasuryAccountStore((s) => s.governanceNfts)
- const { setCurrentAccount } = useTreasuryAccountStore()
+ const connection = useWalletStore((s) => s.connection);
+ const governanceNfts = useTreasuryAccountStore((s) => s.governanceNfts);
+ const { setCurrentAccount } = useTreasuryAccountStore();
const accountPublicKey = governedAccountTokenAccount
? governedAccountTokenAccount.governance?.pubkey
- : null
+ : null;
//TODO move to outside component
async function handleGoToAccountOverview() {
- setCurrentAccount(governedAccountTokenAccount, connection)
+ setCurrentAccount(governedAccountTokenAccount, connection);
}
return (
- )
-}
+ );
+};
-export default AccountItemNFT
+export default AccountItemNFT;
diff --git a/components/TreasuryAccount/AccountOverview.tsx b/components/TreasuryAccount/AccountOverview.tsx
index 7c70ac6482..40276f7ad7 100644
--- a/components/TreasuryAccount/AccountOverview.tsx
+++ b/components/TreasuryAccount/AccountOverview.tsx
@@ -1,128 +1,128 @@
-import Button, { LinkButton } from '@components/Button'
-import { getExplorerUrl } from '@components/explorer/tools'
-import { getAccountName } from '@components/instructions/tools'
-import Modal from '@components/Modal'
-import useGovernanceAssets from '@hooks/useGovernanceAssets'
-import useQueryContext from '@hooks/useQueryContext'
-import useRealm from '@hooks/useRealm'
-import { PublicKey } from '@solana/web3.js'
-import { abbreviateAddress, fmtUnixTime } from '@utils/formatting'
-import BN from 'bn.js'
-import { useRouter } from 'next/router'
-import React, { useEffect, useState } from 'react'
-import useTreasuryAccountStore from 'stores/useTreasuryAccountStore'
-import useWalletStore from 'stores/useWalletStore'
-import AccountHeader from './AccountHeader'
-import DepositNFT from './DepositNFT'
-import SendTokens from './SendTokens'
+import Button, { LinkButton } from '@components/Button';
+import { getExplorerUrl } from '@components/explorer/tools';
+import { getAccountName } from '@components/instructions/tools';
+import Modal from '@components/Modal';
+import useGovernanceAssets from '@hooks/useGovernanceAssets';
+import useQueryContext from '@hooks/useQueryContext';
+import useRealm from '@hooks/useRealm';
+import { PublicKey } from '@solana/web3.js';
+import { abbreviateAddress, fmtUnixTime } from '@utils/formatting';
+import BN from 'bn.js';
+import { useRouter } from 'next/router';
+import React, { useEffect, useState } from 'react';
+import useTreasuryAccountStore from 'stores/useTreasuryAccountStore';
+import useWalletStore from 'stores/useWalletStore';
+import AccountHeader from './AccountHeader';
+import DepositNFT from './DepositNFT';
+import SendTokens from './SendTokens';
import {
ExternalLinkIcon,
PlusCircleIcon,
XCircleIcon,
-} from '@heroicons/react/outline'
-import Tooltip from '@components/Tooltip'
-import ConvertToMsol from './ConvertToMsol'
-import useStrategiesStore from 'Strategies/store/useStrategiesStore'
-import DepositModal from 'Strategies/components/DepositModal'
-import { TreasuryStrategy } from 'Strategies/types/types'
-import BigNumber from 'bignumber.js'
-import { MangoAccount } from '@blockworks-foundation/mango-client'
+} from '@heroicons/react/outline';
+import Tooltip from '@components/Tooltip';
+import ConvertToMsol from './ConvertToMsol';
+import useStrategiesStore from 'Strategies/store/useStrategiesStore';
+import DepositModal from 'Strategies/components/DepositModal';
+import { TreasuryStrategy } from 'Strategies/types/types';
+import BigNumber from 'bignumber.js';
+import { MangoAccount } from '@blockworks-foundation/mango-client';
import {
calculateAllDepositsInMangoAccountsForMint,
MANGO,
tryGetMangoAccountsForOwner,
-} from 'Strategies/protocols/mango/tools'
-import useMarketStore from 'Strategies/store/marketStore'
+} from 'Strategies/protocols/mango/tools';
+import useMarketStore from 'Strategies/store/marketStore';
const AccountOverview = () => {
- const router = useRouter()
- const currentAccount = useTreasuryAccountStore((s) => s.currentAccount)
- const governanceNfts = useTreasuryAccountStore((s) => s.governanceNfts)
+ const router = useRouter();
+ const currentAccount = useTreasuryAccountStore((s) => s.currentAccount);
+ const governanceNfts = useTreasuryAccountStore((s) => s.governanceNfts);
const nftsCount =
currentAccount?.governance && currentAccount.isNft
? governanceNfts[currentAccount?.governance?.pubkey.toBase58()]?.length
- : 0
- const { symbol } = useRealm()
- const { fmtUrlWithCluster } = useQueryContext()
- const isNFT = currentAccount?.isNft
- const isSol = currentAccount?.isSol
- const { canUseTransferInstruction } = useGovernanceAssets()
- const connection = useWalletStore((s) => s.connection)
- const recentActivity = useTreasuryAccountStore((s) => s.recentActivity)
+ : 0;
+ const { symbol } = useRealm();
+ const { fmtUrlWithCluster } = useQueryContext();
+ const isNFT = currentAccount?.isNft;
+ const isSol = currentAccount?.isSol;
+ const { canUseTransferInstruction } = useGovernanceAssets();
+ const connection = useWalletStore((s) => s.connection);
+ const recentActivity = useTreasuryAccountStore((s) => s.recentActivity);
const isLoadingRecentActivity = useTreasuryAccountStore(
- (s) => s.isLoadingRecentActivity
- )
- const market = useMarketStore((s) => s)
- const [currentMangoDeposits, setCurrentMangoDeposits] = useState(0)
- const [mngoAccounts, setMngoAccounts] = useState([])
- const [openNftDepositModal, setOpenNftDepositModal] = useState(false)
- const [openCommonSendModal, setOpenCommonSendModal] = useState(false)
- const [openMsolConvertModal, setOpenMsolConvertModal] = useState(false)
- const accountPublicKey = currentAccount?.transferAddress
- const strategies = useStrategiesStore((s) => s.strategies)
+ (s) => s.isLoadingRecentActivity,
+ );
+ const market = useMarketStore((s) => s);
+ const [currentMangoDeposits, setCurrentMangoDeposits] = useState(0);
+ const [mngoAccounts, setMngoAccounts] = useState([]);
+ const [openNftDepositModal, setOpenNftDepositModal] = useState(false);
+ const [openCommonSendModal, setOpenCommonSendModal] = useState(false);
+ const [openMsolConvertModal, setOpenMsolConvertModal] = useState(false);
+ const accountPublicKey = currentAccount?.transferAddress;
+ const strategies = useStrategiesStore((s) => s.strategies);
const [accountInvestments, setAccountInvestments] = useState<
TreasuryStrategy[]
- >([])
+ >([]);
const [eligibleInvestments, setEligibleInvestments] = useState<
TreasuryStrategy[]
- >([])
- const [showStrategies, setShowStrategies] = useState(false)
+ >([]);
+ const [showStrategies, setShowStrategies] = useState(false);
const [
proposedInvestment,
setProposedInvestment,
- ] = useState(null)
- const [isCopied, setIsCopied] = useState(false)
+ ] = useState(null);
+ const [isCopied, setIsCopied] = useState(false);
useEffect(() => {
if (strategies.length > 0) {
const eligibleInvestments = strategies.filter(
(strat) =>
- strat.handledMint === currentAccount?.token?.account.mint.toString()
- )
- setEligibleInvestments(eligibleInvestments)
+ strat.handledMint === currentAccount?.token?.account.mint.toString(),
+ );
+ setEligibleInvestments(eligibleInvestments);
}
- }, [currentAccount, strategies, mngoAccounts])
+ }, [currentAccount, strategies, mngoAccounts]);
useEffect(() => {
const handleGetMangoAccounts = async () => {
const accounts = await tryGetMangoAccountsForOwner(
market,
- currentAccount!.governance!.pubkey
- )
- const currentAccountMint = currentAccount?.token?.account.mint
+ currentAccount!.governance!.pubkey,
+ );
+ const currentAccountMint = currentAccount?.token?.account.mint;
const currentPositions = calculateAllDepositsInMangoAccountsForMint(
mngoAccounts,
currentAccountMint!,
- market
- )
- setCurrentMangoDeposits(currentPositions)
- setMngoAccounts(accounts ? accounts : [])
+ market,
+ );
+ setCurrentMangoDeposits(currentPositions);
+ setMngoAccounts(accounts ? accounts : []);
if (currentPositions > 0) {
setAccountInvestments(
- eligibleInvestments.filter((x) => x.protocolName === MANGO)
- )
+ eligibleInvestments.filter((x) => x.protocolName === MANGO),
+ );
}
- }
+ };
if (eligibleInvestments.filter((x) => x.protocolName === MANGO).length) {
- handleGetMangoAccounts()
+ handleGetMangoAccounts();
}
- }, [eligibleInvestments])
+ }, [eligibleInvestments]);
useEffect(() => {
if (isCopied) {
const timer = setTimeout(() => {
- setIsCopied(false)
- }, 1500)
- return () => clearTimeout(timer)
+ setIsCopied(false);
+ }, 1500);
+ return () => clearTimeout(timer);
}
- }, [isCopied])
+ }, [isCopied]);
const handleCopyAddress = (address: string) => {
- navigator.clipboard.writeText(address)
- setIsCopied(true)
- }
+ navigator.clipboard.writeText(address);
+ setIsCopied(true);
+ };
if (!currentAccount) {
- return null
+ return null;
}
return (
@@ -141,9 +141,9 @@ const AccountOverview = () => {
className="cursor-pointer default-transition text-primary-light hover:text-primary-dark"
onClick={() => {
const url = fmtUrlWithCluster(
- `/dao/${symbol}/gallery/${currentAccount.transferAddress}`
- )
- router.push(url)
+ `/dao/${symbol}/gallery/${currentAccount.transferAddress}`,
+ );
+ router.push(url);
}}
>
View Collection
@@ -288,7 +288,7 @@ const AccountOverview = () => {
? getExplorerUrl(
connection.endpoint,
activity.signature,
- 'tx'
+ 'tx',
)
: ''
}
@@ -322,7 +322,7 @@ const AccountOverview = () => {
apy={proposedInvestment.apy}
handledMint={proposedInvestment.handledMint}
onClose={() => {
- setProposedInvestment(null)
+ setProposedInvestment(null);
}}
isOpen={proposedInvestment}
protocolName={proposedInvestment.protocolName}
@@ -336,13 +336,13 @@ const AccountOverview = () => {
{
- setOpenNftDepositModal(false)
+ setOpenNftDepositModal(false);
}}
isOpen={openNftDepositModal}
>
{
- setOpenNftDepositModal(false)
+ setOpenNftDepositModal(false);
}}
>
@@ -351,7 +351,7 @@ const AccountOverview = () => {
{
- setOpenCommonSendModal(false)
+ setOpenCommonSendModal(false);
}}
isOpen={openCommonSendModal}
>
@@ -362,7 +362,7 @@ const AccountOverview = () => {
{
- setOpenMsolConvertModal(false)
+ setOpenMsolConvertModal(false);
}}
isOpen={openMsolConvertModal}
>
@@ -370,13 +370,13 @@ const AccountOverview = () => {
)}
>
- )
-}
+ );
+};
interface StrategyCardProps {
- onClick?: () => void
- strat: TreasuryStrategy
- currentMangoDeposits: number
+ onClick?: () => void;
+ strat: TreasuryStrategy;
+ currentMangoDeposits: number;
}
const StrategyCard = ({
@@ -390,10 +390,10 @@ const StrategyCard = ({
protocolName,
handledTokenSymbol,
apy,
- } = strat
+ } = strat;
const currentPositionFtm = new BigNumber(
- currentMangoDeposits.toFixed(0)
- ).toFormat()
+ currentMangoDeposits.toFixed(0),
+ ).toFormat();
return (
@@ -418,7 +418,7 @@ const StrategyCard = ({
) : null}
- )
-}
+ );
+};
-export default AccountOverview
+export default AccountOverview;
diff --git a/components/TreasuryAccount/AccountsCompactWrapper.tsx b/components/TreasuryAccount/AccountsCompactWrapper.tsx
index f0c37cfeef..4a416d5605 100644
--- a/components/TreasuryAccount/AccountsCompactWrapper.tsx
+++ b/components/TreasuryAccount/AccountsCompactWrapper.tsx
@@ -1,34 +1,16 @@
-import AccountsItems from './AccountsItems'
-import HoldTokensTotalPrice from './HoldTokensTotalPrice'
-import useRealm from '@hooks/useRealm'
-import React from 'react'
-import { ChevronRightIcon } from '@heroicons/react/solid'
-import useQueryContext from '@hooks/useQueryContext'
-import { useRouter } from 'next/router'
-import { LinkButton } from '@components/Button'
-import useGovernanceAssets from '@hooks/useGovernanceAssets'
+import AccountsItems from './AccountsItems';
+import HoldTokensTotalPrice from './HoldTokensTotalPrice';
+import React from 'react';
+import useGovernanceAssets from '@hooks/useGovernanceAssets';
const AccountsCompactWrapper = () => {
- const router = useRouter()
- const { fmtUrlWithCluster } = useQueryContext()
- const { symbol } = useRealm()
- const { governedTokenAccounts } = useGovernanceAssets()
+ const { governedTokenAccounts } = useGovernanceAssets();
return (
<>
Treasury
- {
- const url = fmtUrlWithCluster(`/dao/${symbol}/treasury`)
- router.push(url)
- }}
- >
- View
-
-
@@ -36,7 +18,7 @@ const AccountsCompactWrapper = () => {
>
- )
-}
+ );
+};
-export default AccountsCompactWrapper
+export default AccountsCompactWrapper;
diff --git a/components/TreasuryAccount/AccountsItems.tsx b/components/TreasuryAccount/AccountsItems.tsx
index b907570b06..89d977d1d0 100644
--- a/components/TreasuryAccount/AccountsItems.tsx
+++ b/components/TreasuryAccount/AccountsItems.tsx
@@ -1,22 +1,22 @@
-import useGovernanceAssets from '@hooks/useGovernanceAssets'
-import { GovernedTokenAccount } from '@utils/tokens'
-import React, { useEffect, useState } from 'react'
-import AccountItem from './AccountItem'
+import useGovernanceAssets from '@hooks/useGovernanceAssets';
+import { GovernedTokenAccount } from '@utils/tokens';
+import React, { useEffect, useState } from 'react';
+import AccountItem from './AccountItem';
const AccountsItems = () => {
- const { governedTokenAccountsWithoutNfts } = useGovernanceAssets()
+ const { governedTokenAccountsWithoutNfts } = useGovernanceAssets();
const [treasuryAccounts, setTreasuryAccounts] = useState<
GovernedTokenAccount[]
- >([])
+ >([]);
useEffect(() => {
async function prepTreasuryAccounts() {
if (governedTokenAccountsWithoutNfts.every((x) => x.mint && x.token)) {
- setTreasuryAccounts(governedTokenAccountsWithoutNfts)
+ setTreasuryAccounts(governedTokenAccountsWithoutNfts);
}
}
- prepTreasuryAccounts()
- }, [JSON.stringify(governedTokenAccountsWithoutNfts)])
+ prepTreasuryAccounts();
+ }, [JSON.stringify(governedTokenAccountsWithoutNfts)]);
return (
@@ -28,10 +28,10 @@ const AccountsItems = () => {
key={accountWithGovernance?.transferAddress?.toBase58()}
/>
)
- )
+ );
})}
- )
-}
+ );
+};
-export default AccountsItems
+export default AccountsItems;
diff --git a/components/TreasuryAccount/AccountsTabs.tsx b/components/TreasuryAccount/AccountsTabs.tsx
index 3996267e8d..c1a6632639 100644
--- a/components/TreasuryAccount/AccountsTabs.tsx
+++ b/components/TreasuryAccount/AccountsTabs.tsx
@@ -1,11 +1,11 @@
-import { FunctionComponent } from 'react'
-import { getTreasuryAccountItemInfo } from '@utils/treasuryTools'
-import useTreasuryAccountStore from 'stores/useTreasuryAccountStore'
+import { FunctionComponent } from 'react';
+import { getTreasuryAccountItemInfo } from '@utils/treasuryTools';
+import useTreasuryAccountStore from 'stores/useTreasuryAccountStore';
interface AccountsTabsProps {
- activeTab: any
- onChange: (x) => void
- tabs: Array
+ activeTab: any;
+ onChange: (x) => void;
+ tabs: Array;
}
const AccountsTabs: FunctionComponent = ({
@@ -13,7 +13,7 @@ const AccountsTabs: FunctionComponent = ({
onChange,
tabs,
}) => {
- const governanceNfts = useTreasuryAccountStore((s) => s.governanceNfts)
+ const governanceNfts = useTreasuryAccountStore((s) => s.governanceNfts);
return (
= ({
style={{
transform: `translateY(${
tabs.findIndex(
- (t) => t.transferAddress === activeTab?.transferAddress
+ (t) => t.transferAddress === activeTab?.transferAddress,
) * 100
}%)`,
height: `${100 / tabs.length}%`,
@@ -34,7 +34,7 @@ const AccountsTabs: FunctionComponent
= ({
name,
symbol,
displayPrice,
- } = getTreasuryAccountItemInfo(x, governanceNfts)
+ } = getTreasuryAccountItemInfo(x, governanceNfts);
return (
- )
+ );
})}
- )
-}
+ );
+};
-export default AccountsTabs
+export default AccountsTabs;
diff --git a/components/TreasuryAccount/ConvertToMsol.tsx b/components/TreasuryAccount/ConvertToMsol.tsx
index 2811a55a87..a3c5a6703a 100644
--- a/components/TreasuryAccount/ConvertToMsol.tsx
+++ b/components/TreasuryAccount/ConvertToMsol.tsx
@@ -1,38 +1,37 @@
-import { ArrowCircleDownIcon, ArrowCircleUpIcon } from '@heroicons/react/solid'
-import useTreasuryAccountStore from 'stores/useTreasuryAccountStore'
-import AccountLabel from './AccountHeader'
-import GovernedAccountSelect from 'pages/dao/[symbol]/proposal/components/GovernedAccountSelect'
-import useGovernanceAssets from '@hooks/useGovernanceAssets'
-import { GovernedMultiTypeAccount } from '@utils/tokens'
-import { useEffect, useState } from 'react'
+import { ArrowCircleDownIcon, ArrowCircleUpIcon } from '@heroicons/react/solid';
+import useTreasuryAccountStore from 'stores/useTreasuryAccountStore';
+import AccountLabel from './AccountHeader';
+import GovernedAccountSelect from 'pages/dao/[symbol]/proposal/components/GovernedAccountSelect';
+import useGovernanceAssets from '@hooks/useGovernanceAssets';
+import { useEffect, useState } from 'react';
import {
StakingViewForm,
- UiInstruction,
-} from '@utils/uiTypes/proposalCreationTypes'
-import { getMintMinAmountAsDecimal } from '@tools/sdk/units'
-import Input from '@components/inputs/Input'
-import Textarea from '@components/inputs/Textarea'
-import { precision } from '@utils/formatting'
-import useRealm from '@hooks/useRealm'
-import VoteBySwitch from 'pages/dao/[symbol]/proposal/components/VoteBySwitch'
-import Button from '@components/Button'
-import Tooltip from '@components/Tooltip'
-import useWalletStore from 'stores/useWalletStore'
-import { getStakeSchema } from '@utils/validations'
-import { getConvertToMsolInstruction } from '@utils/instructionTools'
-import { PublicKey } from '@solana/web3.js'
+ FormInstructionData,
+} from '@utils/uiTypes/proposalCreationTypes';
+import { getMintMinAmountAsDecimal } from '@tools/sdk/units';
+import Input from '@components/inputs/Input';
+import Textarea from '@components/inputs/Textarea';
+import { precision } from '@utils/formatting';
+import useRealm from '@hooks/useRealm';
+import VoteBySwitch from 'pages/dao/[symbol]/proposal/components/VoteBySwitch';
+import Button from '@components/Button';
+import Tooltip from '@components/Tooltip';
+import useWalletStore from 'stores/useWalletStore';
+import { getStakeSchema } from '@utils/validations';
+import { getConvertToMsolInstruction } from '@utils/instructionTools';
+import { PublicKey } from '@solana/web3.js';
import {
getInstructionDataFromBase64,
Governance,
ProgramAccount,
RpcContext,
-} from '@solana/spl-governance'
-import { getProgramVersionForRealm } from '@models/registry/api'
-import { createProposal } from 'actions/createProposal'
-import useQueryContext from '@hooks/useQueryContext'
-import { useRouter } from 'next/router'
-import { notify } from '@utils/notifications'
-import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore'
+} from '@solana/spl-governance';
+import { getProgramVersionForRealm } from '@models/registry/api';
+import { createProposal } from 'actions/createProposal';
+import useQueryContext from '@hooks/useQueryContext';
+import { useRouter } from 'next/router';
+import { notify } from '@utils/notifications';
+import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore';
const ConvertToMsol = () => {
const {
@@ -43,71 +42,71 @@ const ConvertToMsol = () => {
mint,
councilMint,
symbol,
- } = useRealm()
- const client = useVoteStakeRegistryClientStore((s) => s.state.client)
- const { canUseTransferInstruction } = useGovernanceAssets()
- const { governedTokenAccounts } = useGovernanceAssets()
- const { fmtUrlWithCluster } = useQueryContext()
- const router = useRouter()
- const connection = useWalletStore((s) => s.connection)
- const wallet = useWalletStore((s) => s.current)
- const { fetchRealmGovernance } = useWalletStore((s) => s.actions)
- const currentAccount = useTreasuryAccountStore((s) => s.currentAccount)
+ } = useRealm();
+ const client = useVoteStakeRegistryClientStore((s) => s.state.client);
+ const { canUseTransferInstruction } = useGovernanceAssets();
+ const { governedTokenAccounts } = useGovernanceAssets();
+ const { fmtUrlWithCluster } = useQueryContext();
+ const router = useRouter();
+ const connection = useWalletStore((s) => s.connection);
+ const wallet = useWalletStore((s) => s.current);
+ const { fetchRealmGovernance } = useWalletStore((s) => s.actions);
+ const currentAccount = useTreasuryAccountStore((s) => s.currentAccount);
const notConnectedMessage =
- 'You need to be connected to your wallet to have the ability to create a staking proposal'
+ 'You need to be connected to your wallet to have the ability to create a staking proposal';
- const [formErrors, setFormErrors] = useState({})
+ const [formErrors, setFormErrors] = useState({});
const [form, setForm] = useState({
destinationAccount: undefined,
amount: undefined,
governedTokenAccount: undefined,
title: '',
description: '',
- })
- const [showOptions, setShowOptions] = useState(false)
- const [voteByCouncil, setVoteByCouncil] = useState(false)
- const [isLoading, setIsLoading] = useState(false)
+ });
+ const [showOptions, setShowOptions] = useState(false);
+ const [voteByCouncil, setVoteByCouncil] = useState(false);
+ const [isLoading, setIsLoading] = useState(false);
const mSolTokenAccounts = governedTokenAccounts.filter(
(acc) =>
acc.mint?.publicKey.toString() ===
- 'mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So'
- )
+ 'mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So',
+ );
const mintMinAmount = form.governedTokenAccount?.mint
? getMintMinAmountAsDecimal(form.governedTokenAccount.mint.account)
- : 1
- const proposalTitle = `Convert ${form.amount} SOL to mSOL`
- const schema = getStakeSchema({ form })
+ : 1;
+ const proposalTitle = `Convert ${form.amount} SOL to mSOL`;
+ const schema = getStakeSchema({ form });
const handleSetForm = ({ propertyName, value }) => {
- setFormErrors({})
- setForm({ ...form, [propertyName]: value })
- }
+ setFormErrors({});
+ setForm({ ...form, [propertyName]: value });
+ };
const handlePropose = async () => {
- setIsLoading(true)
- const instruction: UiInstruction = await getConvertToMsolInstruction({
+ setIsLoading(true);
+ const instruction: FormInstructionData = await getConvertToMsolInstruction({
schema,
form,
connection,
setFormErrors,
- })
+ });
if (instruction.isValid) {
if (!realm) {
- setIsLoading(false)
- throw 'No realm selected'
+ setIsLoading(false);
+ throw 'No realm selected';
}
- const governance = currentAccount?.governance
+ const governance = currentAccount?.governance;
const rpcContext = new RpcContext(
new PublicKey(realm.owner.toString()),
getProgramVersionForRealm(realmInfo!),
wallet!,
connection.current,
- connection.endpoint
- )
- const holdUpTime = governance?.account?.config.minInstructionHoldUpTime
+ connection.endpoint,
+ );
+ const holdUpTime = governance?.account?.config.minInstructionHoldUpTime;
const instructionData = {
data: instruction.serializedInstruction
@@ -115,33 +114,33 @@ const ConvertToMsol = () => {
: null,
holdUpTime: holdUpTime,
prerequisiteInstructions: instruction.prerequisiteInstructions || [],
- }
+ };
try {
// Fetch governance to get up to date proposalCount
const selectedGovernance = (await fetchRealmGovernance(
- currentAccount?.governance?.pubkey
- )) as ProgramAccount
+ currentAccount?.governance?.pubkey,
+ )) as ProgramAccount;
const ownTokenRecord = ownVoterWeight.getTokenRecordToCreateProposal(
- governance!.account.config
- )
+ governance!.account.config,
+ );
const defaultProposalMint = !mint?.supply.isZero()
? realm.account.communityMint
: !councilMint?.supply.isZero()
? realm.account.config.councilMint
- : undefined
+ : undefined;
const proposalMint =
canChooseWhoVote && voteByCouncil
? realm.account.config.councilMint
- : defaultProposalMint
+ : defaultProposalMint;
if (!proposalMint) {
throw new Error(
- 'There is no suitable governing token for the proposal'
- )
+ 'There is no suitable governing token for the proposal',
+ );
}
const proposalAddress = await createProposal(
@@ -155,25 +154,25 @@ const ConvertToMsol = () => {
selectedGovernance?.account?.proposalCount,
[instructionData],
false,
- client
- )
+ client,
+ );
const url = fmtUrlWithCluster(
- `/dao/${symbol}/proposal/${proposalAddress}`
- )
- router.push(url)
+ `/dao/${symbol}/proposal/${proposalAddress}`,
+ );
+ router.push(url);
} catch (ex) {
- notify({ type: 'error', message: `${ex}` })
+ notify({ type: 'error', message: `${ex}` });
}
}
- setIsLoading(false)
- }
+ setIsLoading(false);
+ };
useEffect(() => {
handleSetForm({
value: currentAccount,
propertyName: 'governedTokenAccount',
- })
- }, [currentAccount])
+ });
+ }, [currentAccount]);
return (
<>
@@ -182,7 +181,7 @@ const ConvertToMsol = () => {
{
}
error={formErrors['destinationAccount']}
noMaxWidth={true}
- >
+ />
{
Number(mintMinAmount),
Math.min(
Number(Number.MAX_SAFE_INTEGER),
- Number(evt.target.value)
- )
- ).toFixed(precision(mintMinAmount))
+ Number(evt.target.value),
+ ),
+ ).toFixed(precision(mintMinAmount)),
),
propertyName: 'amount',
})
@@ -271,7 +270,7 @@ const ConvertToMsol = () => {
{
- setVoteByCouncil(!voteByCouncil)
+ setVoteByCouncil(!voteByCouncil);
}}
>
)}
@@ -291,7 +290,7 @@ const ConvertToMsol = () => {
>
- )
-}
+ );
+};
-export default ConvertToMsol
+export default ConvertToMsol;
diff --git a/components/TreasuryAccount/DepositLabel.tsx b/components/TreasuryAccount/DepositLabel.tsx
index db2683339c..2836bada4f 100644
--- a/components/TreasuryAccount/DepositLabel.tsx
+++ b/components/TreasuryAccount/DepositLabel.tsx
@@ -1,17 +1,17 @@
-import { LinkButton } from '@components/Button'
-import { getAccountName } from '@components/instructions/tools'
-import { DuplicateIcon } from '@heroicons/react/outline'
-import { PublicKey } from '@solana/web3.js'
-import { abbreviateAddress } from '@utils/formatting'
+import { LinkButton } from '@components/Button';
+import { getAccountName } from '@components/instructions/tools';
+import { DuplicateIcon } from '@heroicons/react/outline';
+import { PublicKey } from '@solana/web3.js';
+import { abbreviateAddress } from '@utils/formatting';
const DepositLabel = ({
header = 'Treasury account address',
abbreviatedAddress = true,
transferAddress,
}: {
- header?: string
- abbreviatedAddress?: boolean
- transferAddress: PublicKey | undefined | null
+ header?: string;
+ abbreviatedAddress?: boolean;
+ transferAddress: PublicKey | undefined | null;
}) => {
return (
@@ -34,14 +34,14 @@ const DepositLabel = ({
{
- navigator.clipboard.writeText(transferAddress!.toBase58())
+ navigator.clipboard.writeText(transferAddress!.toBase58());
}}
>
- )
-}
+ );
+};
-export default DepositLabel
+export default DepositLabel;
diff --git a/components/TreasuryAccount/DepositNFT.tsx b/components/TreasuryAccount/DepositNFT.tsx
index ccdd795792..19e0c82dbe 100644
--- a/components/TreasuryAccount/DepositNFT.tsx
+++ b/components/TreasuryAccount/DepositNFT.tsx
@@ -1,13 +1,13 @@
-import React, { useState } from 'react'
-import useWalletStore from 'stores/useWalletStore'
-import Button, { SecondaryButton } from '@components/Button'
-import Tooltip from '@components/Tooltip'
-import DepositNFTFromWallet from './DepositNFTFromWallet'
-import DepositNFTAddress from './DepositNFTAddress'
-import useTreasuryAccountStore from 'stores/useTreasuryAccountStore'
-import { abbreviateAddress } from '@utils/formatting'
-import { ArrowLeftIcon, ExternalLinkIcon } from '@heroicons/react/solid'
-import { getExplorerUrl } from '@components/explorer/tools'
+import React, { useState } from 'react';
+import useWalletStore from 'stores/useWalletStore';
+import Button, { SecondaryButton } from '@components/Button';
+import Tooltip from '@components/Tooltip';
+import DepositNFTFromWallet from './DepositNFTFromWallet';
+import DepositNFTAddress from './DepositNFTAddress';
+import useTreasuryAccountStore from 'stores/useTreasuryAccountStore';
+import { abbreviateAddress } from '@utils/formatting';
+import { ArrowLeftIcon, ExternalLinkIcon } from '@heroicons/react/solid';
+import { getExplorerUrl } from '@components/explorer/tools';
enum DepositState {
DepositNFTFromWallet,
@@ -15,13 +15,13 @@ enum DepositState {
}
const DepositNFT = ({ onClose }) => {
- const currentAccount = useTreasuryAccountStore((s) => s.currentAccount)
- const connection = useWalletStore((s) => s.connection)
- const connected = useWalletStore((s) => s.connected)
+ const currentAccount = useTreasuryAccountStore((s) => s.currentAccount);
+ const connection = useWalletStore((s) => s.connection);
+ const connected = useWalletStore((s) => s.connected);
const [
currentDepositView,
setCurrentDepositView,
- ] = useState(null)
+ ] = useState(null);
return (
<>
@@ -41,7 +41,7 @@ const DepositNFT = ({ onClose }) => {
currentAccount?.governance?.pubkey
? getExplorerUrl(
connection.endpoint,
- currentAccount!.governance!.pubkey.toBase58()
+ currentAccount!.governance!.pubkey.toBase58(),
)
: ''
}
@@ -86,7 +86,7 @@ const DepositNFT = ({ onClose }) => {
>
)}
>
- )
-}
+ );
+};
-export default DepositNFT
+export default DepositNFT;
diff --git a/components/TreasuryAccount/DepositNFTAddress.tsx b/components/TreasuryAccount/DepositNFTAddress.tsx
index 27ff0747b8..199ae3c52d 100644
--- a/components/TreasuryAccount/DepositNFTAddress.tsx
+++ b/components/TreasuryAccount/DepositNFTAddress.tsx
@@ -1,70 +1,70 @@
-import React, { useEffect, useState } from 'react'
-import useTreasuryAccountStore from 'stores/useTreasuryAccountStore'
-import Input from '@components/inputs/Input'
-import { tryParseKey } from '@tools/validators/pubkey'
-import { debounce } from '@utils/debounce'
-import useWalletStore from 'stores/useWalletStore'
-import { Metadata } from '@metaplex-foundation/mpl-token-metadata'
-import axios from 'axios'
-import { notify } from '@utils/notifications'
-import Loading from '@components/Loading'
-import Button, { LinkButton } from '@components/Button'
-import { PublicKey } from '@solana/web3.js'
+import React, { useEffect, useState } from 'react';
+import useTreasuryAccountStore from 'stores/useTreasuryAccountStore';
+import Input from '@components/inputs/Input';
+import { tryParseKey } from '@tools/validators/pubkey';
+import { debounce } from '@utils/debounce';
+import useWalletStore from 'stores/useWalletStore';
+import { Metadata } from '@metaplex-foundation/mpl-token-metadata';
+import axios from 'axios';
+import { notify } from '@utils/notifications';
+import Loading from '@components/Loading';
+import Button, { LinkButton } from '@components/Button';
+import { PublicKey } from '@solana/web3.js';
import {
ASSOCIATED_TOKEN_PROGRAM_ID,
Token,
TOKEN_PROGRAM_ID,
-} from '@solana/spl-token'
-import Tooltip from '@components/Tooltip'
-import { tryGetAta } from '@utils/validations'
-import useRealm from '@hooks/useRealm'
-import { createATA } from '@utils/ataTools'
-import { abbreviateAddress } from '@utils/formatting'
-import { DuplicateIcon, ExclamationIcon } from '@heroicons/react/outline'
-import useGovernanceAssets from '@hooks/useGovernanceAssets'
-import DepositLabel from './DepositLabel'
-import NFTAccountSelect from './NFTAccountSelect'
-import ImgWithLoader from '@components/ImgWithLoader'
+} from '@solana/spl-token';
+import Tooltip from '@components/Tooltip';
+import { tryGetAta } from '@utils/validations';
+import useRealm from '@hooks/useRealm';
+import { createATA } from '@utils/ataTools';
+import { abbreviateAddress } from '@utils/formatting';
+import { DuplicateIcon, ExclamationIcon } from '@heroicons/react/outline';
+import useGovernanceAssets from '@hooks/useGovernanceAssets';
+import DepositLabel from './DepositLabel';
+import NFTAccountSelect from './NFTAccountSelect';
+import ImgWithLoader from '@components/ImgWithLoader';
const DepositNFTAddress = ({ additionalBtns }: { additionalBtns?: any }) => {
- const currentAccount = useTreasuryAccountStore((s) => s.currentAccount)
+ const currentAccount = useTreasuryAccountStore((s) => s.currentAccount);
- const wallet = useWalletStore((s) => s.current)
- const { realm } = useRealm()
- const connected = useWalletStore((s) => s.connected)
+ const wallet = useWalletStore((s) => s.current);
+ const { realm } = useRealm();
+ const connected = useWalletStore((s) => s.connected);
const [form, setForm] = useState({
mint: '',
- })
- const [isLoading, setIsLoading] = useState(false)
- const [nftMetaData, setNftMetaData] = useState(null)
- const [isInvalidMint, setIsInvalidMint] = useState(false)
- const [formErrors, setFormErrors] = useState({})
- const [imgUrl, setImgUrl] = useState('')
- const [ataAddress, setAtaAddress] = useState('')
- const { nftsGovernedTokenAccounts } = useGovernanceAssets()
- const { setCurrentAccount } = useTreasuryAccountStore()
- const connection = useWalletStore((s) => s.connection)
+ });
+ const [isLoading, setIsLoading] = useState(false);
+ const [nftMetaData, setNftMetaData] = useState(null);
+ const [isInvalidMint, setIsInvalidMint] = useState(false);
+ const [formErrors, setFormErrors] = useState({});
+ const [imgUrl, setImgUrl] = useState('');
+ const [ataAddress, setAtaAddress] = useState('');
+ const { nftsGovernedTokenAccounts } = useGovernanceAssets();
+ const { setCurrentAccount } = useTreasuryAccountStore();
+ const connection = useWalletStore((s) => s.connection);
const handleSetForm = ({ propertyName, value }) => {
- setFormErrors({})
- setForm({ ...form, [propertyName]: value })
- }
+ setFormErrors({});
+ setForm({ ...form, [propertyName]: value });
+ };
const handleGenerateATAAddress = async () => {
- setAtaAddress('')
+ setAtaAddress('');
if (!currentAccount) {
- throw 'No governance selected'
+ throw 'No governance selected';
}
if (!realm) {
- throw 'no realm selected'
+ throw 'no realm selected';
}
- const mintPK = new PublicKey(form.mint)
- const owner = currentAccount!.governance!.pubkey
+ const mintPK = new PublicKey(form.mint);
+ const owner = currentAccount!.governance!.pubkey;
const ataPk = await Token.getAssociatedTokenAddress(
ASSOCIATED_TOKEN_PROGRAM_ID, // always ASSOCIATED_TOKEN_PROGRAM_ID
TOKEN_PROGRAM_ID, // always TOKEN_PROGRAM_ID
mintPK, // mint
- owner! // owner
- )
- const ata = ataPk.toBase58()
- const isExistingAta = await tryGetAta(connection.current, mintPK, owner)
+ owner!, // owner
+ );
+ const ata = ataPk.toBase58();
+ const isExistingAta = await tryGetAta(connection.current, mintPK, owner);
if (!isExistingAta) {
try {
await createATA(
@@ -72,73 +72,73 @@ const DepositNFTAddress = ({ additionalBtns }: { additionalBtns?: any }) => {
wallet,
mintPK,
owner,
- wallet!.publicKey!
- )
- setAtaAddress(ata)
+ wallet!.publicKey!,
+ );
+ setAtaAddress(ata);
} catch (e) {
notify({
type: 'error',
message: 'Unable to create address',
- })
- setAtaAddress('')
+ });
+ setAtaAddress('');
}
} else {
- setAtaAddress(ata)
+ setAtaAddress(ata);
}
- }
+ };
useEffect(() => {
- setIsInvalidMint(false)
+ setIsInvalidMint(false);
if (form.mint) {
debounce.debounceFcn(async () => {
- const pubKey = tryParseKey(form.mint)
+ const pubKey = tryParseKey(form.mint);
if (pubKey) {
- setIsLoading(true)
+ setIsLoading(true);
try {
- const metadataPDA = await Metadata.getPDA(pubKey)
+ const metadataPDA = await Metadata.getPDA(pubKey);
const tokenMetadata = await Metadata.load(
connection.current,
- metadataPDA
- )
- setNftMetaData(tokenMetadata)
+ metadataPDA,
+ );
+ setNftMetaData(tokenMetadata);
} catch (e) {
notify({
type: 'error',
message: 'Unable to fetch nft',
- })
- setNftMetaData(null)
+ });
+ setNftMetaData(null);
}
- setIsLoading(false)
+ setIsLoading(false);
} else {
- setIsInvalidMint(true)
- setNftMetaData(null)
+ setIsInvalidMint(true);
+ setNftMetaData(null);
}
- })
+ });
} else {
- setNftMetaData(null)
+ setNftMetaData(null);
}
- }, [form.mint])
+ }, [form.mint]);
useEffect(() => {
- const uri = nftMetaData?.data?.data?.uri
+ const uri = nftMetaData?.data?.data?.uri;
const getNftData = async (uri) => {
if (uri) {
- setIsLoading(true)
+ setIsLoading(true);
try {
- const nftResponse = (await axios.get(uri)).data
- setImgUrl(nftResponse.image)
+ const nftResponse = (await axios.get(uri)).data;
+ setImgUrl(nftResponse.image);
} catch (e) {
notify({
type: 'error',
message: 'Unable to fetch nft',
- })
+ });
}
- setIsLoading(false)
+ setIsLoading(false);
} else {
- setImgUrl('')
+ setImgUrl('');
}
- }
- setAtaAddress('')
- getNftData(uri)
- }, [JSON.stringify(nftMetaData)])
+ };
+ setAtaAddress('');
+ getNftData(uri);
+ }, [JSON.stringify(nftMetaData)]);
return (
<>
{
{
- navigator.clipboard.writeText(ataAddress)
+ navigator.clipboard.writeText(ataAddress);
}}
>
@@ -216,7 +216,7 @@ const DepositNFTAddress = ({ additionalBtns }: { additionalBtns?: any }) => {
{additionalBtns}
>
- )
-}
+ );
+};
-export default DepositNFTAddress
+export default DepositNFTAddress;
diff --git a/components/TreasuryAccount/DepositNFTFromWallet.tsx b/components/TreasuryAccount/DepositNFTFromWallet.tsx
index 3ba30eb70e..4c6706d275 100644
--- a/components/TreasuryAccount/DepositNFTFromWallet.tsx
+++ b/components/TreasuryAccount/DepositNFTFromWallet.tsx
@@ -1,71 +1,74 @@
-import React, { useEffect, useRef, useState } from 'react'
-import useTreasuryAccountStore from 'stores/useTreasuryAccountStore'
-import useWalletStore from 'stores/useWalletStore'
-import Button from '@components/Button'
-import Tooltip from '@components/Tooltip'
-import { NFTWithMint } from '@utils/uiTypes/nfts'
-import { notify } from '@utils/notifications'
-import { web3 } from '@project-serum/anchor'
+import React, { useEffect, useRef, useState } from 'react';
+import useTreasuryAccountStore from 'stores/useTreasuryAccountStore';
+import useWalletStore from 'stores/useWalletStore';
+import Button from '@components/Button';
+import Tooltip from '@components/Tooltip';
+import { NFTWithMint } from '@utils/uiTypes/nfts';
+import { notify } from '@utils/notifications';
+import { web3 } from '@project-serum/anchor';
import {
ASSOCIATED_TOKEN_PROGRAM_ID,
Token,
TOKEN_PROGRAM_ID,
-} from '@solana/spl-token'
-import { PublicKey } from '@solana/web3.js'
-import { createATA } from '@utils/ataTools'
-import { getTokenAccountsByMint } from '@utils/tokens'
-import { sendTransaction } from '@utils/send'
-import NFTSelector, { NftSelectorFunctions } from '@components/NFTS/NFTSelector'
-import useGovernanceAssets from '@hooks/useGovernanceAssets'
-import NFTAccountSelect from './NFTAccountSelect'
+} from '@solana/spl-token';
+import { PublicKey } from '@solana/web3.js';
+import { createATA } from '@utils/ataTools';
+import { getTokenAccountsByMint } from '@utils/tokens';
+import { sendTransaction } from '@utils/send';
+import NFTSelector, {
+ NftSelectorFunctions,
+} from '@components/NFTS/NFTSelector';
+import useGovernanceAssets from '@hooks/useGovernanceAssets';
+import NFTAccountSelect from './NFTAccountSelect';
const DepositNFTFromWallet = ({ additionalBtns }: { additionalBtns?: any }) => {
- const nftSelectorRef = useRef(null)
- const { setCurrentAccount } = useTreasuryAccountStore()
- const currentAccount = useTreasuryAccountStore((s) => s.currentAccount)
- const { getNfts } = useTreasuryAccountStore()
- const [selectedNfts, setSelectedNfts] = useState([])
- const wallet = useWalletStore((s) => s.current)
- const connected = useWalletStore((s) => s.connected)
- const connection = useWalletStore((s) => s.connection)
- const [isLoading, setIsLoading] = useState(false)
- const [sendingSuccess, setSendingSuccess] = useState(false)
- const { nftsGovernedTokenAccounts } = useGovernanceAssets()
+ const nftSelectorRef = useRef(null);
+ const { setCurrentAccount } = useTreasuryAccountStore();
+ const currentAccount = useTreasuryAccountStore((s) => s.currentAccount);
+ const { getNfts } = useTreasuryAccountStore();
+ const [selectedNfts, setSelectedNfts] = useState([]);
+ const wallet = useWalletStore((s) => s.current);
+ const connected = useWalletStore((s) => s.connected);
+ const connection = useWalletStore((s) => s.connection);
+ const [isLoading, setIsLoading] = useState(false);
+ const [sendingSuccess, setSendingSuccess] = useState(false);
+ const { nftsGovernedTokenAccounts } = useGovernanceAssets();
const handleDeposit = async () => {
- setIsLoading(true)
- setSendingSuccess(false)
+ setIsLoading(true);
+ setSendingSuccess(false);
try {
- const governance = currentAccount!.governance!.pubkey
- const ConnectedWalletAddress = wallet?.publicKey
- const selectedNft = selectedNfts[0]
- const nftMintPk = new PublicKey(selectedNft.mint)
+ const governance = currentAccount!.governance!.pubkey;
+ const ConnectedWalletAddress = wallet?.publicKey;
+ const selectedNft = selectedNfts[0];
+ const nftMintPk = new PublicKey(selectedNft.mint);
const tokenAccountsWithNftMint = await getTokenAccountsByMint(
connection.current,
- nftMintPk.toBase58()
- )
+ nftMintPk.toBase58(),
+ );
//we find ata from connected wallet that holds the nft
const fromAddress = tokenAccountsWithNftMint.find(
- (x) => x.account.owner.toBase58() === ConnectedWalletAddress?.toBase58()
- )?.publicKey
+ (x) =>
+ x.account.owner.toBase58() === ConnectedWalletAddress?.toBase58(),
+ )?.publicKey;
//we check is there ata created for nft before inside governance
const isAtaForGovernanceExist = tokenAccountsWithNftMint.find(
- (x) => x.account.owner.toBase58() === governance.toBase58()
- )
+ (x) => x.account.owner.toBase58() === governance.toBase58(),
+ );
const ataPk = await Token.getAssociatedTokenAddress(
ASSOCIATED_TOKEN_PROGRAM_ID, // always ASSOCIATED_TOKEN_PROGRAM_ID
TOKEN_PROGRAM_ID, // always TOKEN_PROGRAM_ID
nftMintPk, // mint
- governance! // owner
- )
+ governance!, // owner
+ );
if (!isAtaForGovernanceExist) {
await createATA(
connection.current,
wallet,
nftMintPk,
governance,
- wallet!.publicKey!
- )
+ wallet!.publicKey!,
+ );
}
const transaction = new web3.Transaction().add(
Token.createTransferInstruction(
@@ -74,33 +77,33 @@ const DepositNFTFromWallet = ({ additionalBtns }: { additionalBtns?: any }) => {
ataPk,
wallet!.publicKey!,
[],
- 1
- )
- )
+ 1,
+ ),
+ );
await sendTransaction({
connection: connection.current,
wallet,
transaction,
sendingMessage: 'Depositing NFT',
successMessage: 'NFT has been deposited',
- })
- setSendingSuccess(true)
- nftSelectorRef.current?.handleGetNfts()
- getNfts(nftsGovernedTokenAccounts, connection.current)
+ });
+ setSendingSuccess(true);
+ nftSelectorRef.current?.handleGetNfts();
+ getNfts(nftsGovernedTokenAccounts, connection.current);
} catch (e) {
notify({
type: 'error',
message: 'Unable to send selected nft',
- })
+ });
}
- setIsLoading(false)
- }
+ setIsLoading(false);
+ };
useEffect(() => {
if (sendingSuccess) {
- setCurrentAccount(currentAccount!, connection)
+ setCurrentAccount(currentAccount!, connection);
}
- }, [connected, sendingSuccess])
+ }, [connected, sendingSuccess]);
return (
<>
@@ -138,7 +141,7 @@ const DepositNFTFromWallet = ({ additionalBtns }: { additionalBtns?: any }) => {
>
- )
-}
+ );
+};
-export default DepositNFTFromWallet
+export default DepositNFTFromWallet;
diff --git a/components/TreasuryAccount/HoldTokensTotalPrice.tsx b/components/TreasuryAccount/HoldTokensTotalPrice.tsx
index 705feefb9b..8c6e725d67 100644
--- a/components/TreasuryAccount/HoldTokensTotalPrice.tsx
+++ b/components/TreasuryAccount/HoldTokensTotalPrice.tsx
@@ -1,12 +1,12 @@
-import { useTotalTreasuryPrice } from '@hooks/useTotalTreasuryPrice'
+import { useTotalTreasuryPrice } from '@hooks/useTotalTreasuryPrice';
const HoldTokensTotalPrice = () => {
- const { totalPriceFormatted } = useTotalTreasuryPrice()
+ const { totalPriceFormatted } = useTotalTreasuryPrice();
return totalPriceFormatted ? (
Treasury Balance
${totalPriceFormatted}
- ) : null
-}
+ ) : null;
+};
-export default HoldTokensTotalPrice
+export default HoldTokensTotalPrice;
diff --git a/components/TreasuryAccount/NFTAccountSelect.tsx b/components/TreasuryAccount/NFTAccountSelect.tsx
index 857d5abdb5..f5f7608612 100644
--- a/components/TreasuryAccount/NFTAccountSelect.tsx
+++ b/components/TreasuryAccount/NFTAccountSelect.tsx
@@ -1,5 +1,5 @@
-import Select from '@components/inputs/Select'
-import AccountItemNFT from './AccountItemNFT'
+import Select from '@components/inputs/Select';
+import AccountItemNFT from './AccountItemNFT';
const NFTAccountSelect = ({
onChange,
@@ -35,7 +35,7 @@ const NFTAccountSelect = ({
))}
- )
-}
+ );
+};
-export default NFTAccountSelect
+export default NFTAccountSelect;
diff --git a/components/TreasuryAccount/NewTreasuryAccountForm.tsx b/components/TreasuryAccount/NewTreasuryAccountForm.tsx
deleted file mode 100644
index b449288694..0000000000
--- a/components/TreasuryAccount/NewTreasuryAccountForm.tsx
+++ /dev/null
@@ -1,313 +0,0 @@
-import BaseGovernanceForm, {
- BaseGovernanceFormFields,
-} from 'components/AssetsList/BaseGovernanceForm'
-import Button from 'components/Button'
-import Input from 'components/inputs/Input'
-import PreviousRouteBtn from 'components/PreviousRouteBtn'
-import useQueryContext from 'hooks/useQueryContext'
-import useRealm from 'hooks/useRealm'
-import { PROGRAM_VERSION_V1, RpcContext } from '@solana/spl-governance'
-import { MintInfo } from '@solana/spl-token'
-import { PublicKey } from '@solana/web3.js'
-import { tryParseKey } from 'tools/validators/pubkey'
-import { debounce } from 'utils/debounce'
-import { isFormValid } from 'utils/formValidation'
-import { getGovernanceConfig } from '@utils/GovernanceTools'
-import { notify } from 'utils/notifications'
-import tokenService from 'utils/services/token'
-import { TokenProgramAccount, tryGetMint } from 'utils/tokens'
-import { createTreasuryAccount } from 'actions/createTreasuryAccount'
-import { useRouter } from 'next/router'
-import React, { useEffect, useState } from 'react'
-import useWalletStore from 'stores/useWalletStore'
-import * as yup from 'yup'
-import {
- DEFAULT_NATIVE_SOL_MINT,
- DEFAULT_NFT_TREASURY_MINT,
-} from '@components/instructions/tools'
-import { MIN_COMMUNITY_TOKENS_TO_CREATE_W_0_SUPPLY } from '@tools/constants'
-import { getProgramVersionForRealm } from '@models/registry/api'
-import { TokenInfo } from '@solana/spl-token-registry'
-import Select from '@components/inputs/Select'
-import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore'
-interface NewTreasuryAccountForm extends BaseGovernanceFormFields {
- mintAddress: string
-}
-const defaultFormValues = {
- mintAddress: '',
- // TODO: This is temp. fix to avoid wrong default for Multisig DAOs
- // This should be dynamic and set to 1% of the community mint supply or
- // MIN_COMMUNITY_TOKENS_TO_CREATE_W_0_SUPPLY when supply is 0
- minCommunityTokensToCreateProposal: MIN_COMMUNITY_TOKENS_TO_CREATE_W_0_SUPPLY,
- minInstructionHoldUpTime: 0,
- maxVotingTime: 3,
- voteThreshold: 60,
-}
-
-const SOL = 'SOL'
-const OTHER = 'OTHER'
-const NFT = 'NFT'
-
-const NewAccountForm = () => {
- const router = useRouter()
- const client = useVoteStakeRegistryClientStore((s) => s.state.client)
- const { fmtUrlWithCluster } = useQueryContext()
- const isCurrentVersionHigherThenV1 = () => {
- return (
- realmInfo?.programVersion && realmInfo.programVersion > PROGRAM_VERSION_V1
- )
- }
- const {
- realmInfo,
- realm,
- mint: realmMint,
- symbol,
- ownVoterWeight,
- } = useRealm()
-
- const types = [
- {
- name: 'SOL Account',
- value: SOL,
- defaultMint: DEFAULT_NATIVE_SOL_MINT,
- hide: !isCurrentVersionHigherThenV1(),
- },
- { name: 'NFT Account', value: NFT, defaultMint: DEFAULT_NFT_TREASURY_MINT },
- { name: 'Token Account', value: OTHER, defaultMint: '' },
- ]
- const wallet = useWalletStore((s) => s.current)
- const connection = useWalletStore((s) => s.connection)
- const connected = useWalletStore((s) => s.connected)
- const { fetchRealm } = useWalletStore((s) => s.actions)
- const [form, setForm] = useState({
- ...defaultFormValues,
- })
- const [tokenInfo, setTokenInfo] = useState(undefined)
- const [mint, setMint] = useState | null>(null)
- const [isLoading, setIsLoading] = useState(false)
- const [formErrors, setFormErrors] = useState({})
- const [treasuryType, setTreasuryType] = useState(types[2])
- const tokenOwnerRecord = ownVoterWeight.canCreateGovernanceUsingCouncilTokens()
- ? ownVoterWeight.councilTokenRecord
- : realm && ownVoterWeight.canCreateGovernanceUsingCommunityTokens(realm)
- ? ownVoterWeight.communityTokenRecord
- : undefined
-
- const handleSetForm = ({ propertyName, value }) => {
- setFormErrors({})
- setForm({ ...form, [propertyName]: value })
- }
- const handleCreate = async () => {
- try {
- if (!realm) {
- throw 'No realm selected'
- }
- if (!connected) {
- throw 'Please connect your wallet'
- }
- if (!tokenOwnerRecord) {
- throw "You don't have enough governance power to create a new treasury account"
- }
- const { isValid, validationErrors } = await isFormValid(schema, form)
- setFormErrors(validationErrors)
- if (isValid && realmMint) {
- setIsLoading(true)
-
- const rpcContext = new RpcContext(
- new PublicKey(realm.owner.toString()),
- getProgramVersionForRealm(realmInfo!),
- wallet!,
- connection.current,
- connection.endpoint
- )
-
- const governanceConfigValues = {
- minTokensToCreateProposal: form.minCommunityTokensToCreateProposal,
- minInstructionHoldUpTime: form.minInstructionHoldUpTime,
- maxVotingTime: form.maxVotingTime,
- voteThresholdPercentage: form.voteThreshold,
- mintDecimals: realmMint.decimals,
- }
-
- const governanceConfig = getGovernanceConfig(governanceConfigValues)
-
- await createTreasuryAccount(
- rpcContext,
- realm,
- new PublicKey(form.mintAddress),
- governanceConfig,
- tokenOwnerRecord!.pubkey,
- client
- )
- setIsLoading(false)
- fetchRealm(realmInfo!.programId, realmInfo!.realmId)
- router.push(fmtUrlWithCluster(`/dao/${symbol}/`))
- }
- } catch (e) {
- console.error('Create Treasury', e)
- //TODO how do we present errors maybe something more generic ?
- notify({
- type: 'error',
- message: `Can't create governance`,
- description: `Transaction error ${e}`,
- })
- setIsLoading(false)
- }
- }
- const handleSetDefaultMintError = () => {
- const mintError = { mintAddress: 'Invalid mint address' }
- setFormErrors(mintError)
- setMint(null)
- setTokenInfo(undefined)
- }
-
- const schema = yup.object().shape({
- mintAddress: yup
- .string()
- .test(
- 'mintAddressTest',
- 'Mint address validation error',
- async function (val: string) {
- if (val) {
- try {
- const pubKey = tryParseKey(val)
- if (!pubKey) {
- return this.createError({
- message: `Invalid mint address`,
- })
- }
-
- const accountData = await connection.current.getAccountInfo(
- pubKey
- )
- if (!accountData) {
- return this.createError({
- message: `Account not found`,
- })
- }
- const mint = tryGetMint(connection.current, pubKey)
- if (!mint) {
- return this.createError({
- message: `Account is not a valid mint`,
- })
- }
- return true
- } catch (e) {
- return this.createError({
- message: `Invalid mint address`,
- })
- }
- } else {
- return this.createError({
- message: `Mint address is required`,
- })
- }
- }
- ),
- })
- useEffect(() => {
- if (form.mintAddress) {
- debounce.debounceFcn(async () => {
- const pubKey = tryParseKey(form.mintAddress)
- if (pubKey) {
- const mintAccount = await tryGetMint(connection.current, pubKey)
- if (mintAccount) {
- setMint(mintAccount)
- const info = tokenService.getTokenInfo(form.mintAddress)
- setTokenInfo(info)
- } else {
- handleSetDefaultMintError()
- }
- } else {
- handleSetDefaultMintError()
- }
- })
- } else {
- setMint(null)
- setTokenInfo(undefined)
- }
- }, [form.mintAddress])
-
- useEffect(() => {
- handleSetForm({
- value: treasuryType.defaultMint,
- propertyName: 'mintAddress',
- })
- }, [treasuryType])
- return (
-
-
-
-
-
Create new treasury account
-
-
-
- {treasuryType.value === OTHER && (
- <>
-
- handleSetForm({
- value: evt.target.value,
- propertyName: 'mintAddress',
- })
- }
- error={formErrors['mintAddress']}
- />
- {tokenInfo ? (
-
- {tokenInfo?.logoURI && (
-
- )}
-
- {tokenInfo.name}
-
{tokenInfo?.symbol}
-
-
- ) : mint ? (
-
Mint found
- ) : null}
- >
- )}
-
-
-
-
-
- )
-}
-
-export default NewAccountForm
diff --git a/components/TreasuryAccount/SendTokens.tsx b/components/TreasuryAccount/SendTokens.tsx
index d2e0d6146a..a0c8d514f8 100644
--- a/components/TreasuryAccount/SendTokens.tsx
+++ b/components/TreasuryAccount/SendTokens.tsx
@@ -1,61 +1,61 @@
-import Button from '@components/Button'
-import Input from '@components/inputs/Input'
-import { getAccountName } from '@components/instructions/tools'
-import useRealm from '@hooks/useRealm'
-import { AccountInfo } from '@solana/spl-token'
-import { PublicKey } from '@solana/web3.js'
+import Button from '@components/Button';
+import Input from '@components/inputs/Input';
+import { getAccountName } from '@components/instructions/tools';
+import useRealm from '@hooks/useRealm';
+import { AccountInfo } from '@solana/spl-token';
+import { PublicKey } from '@solana/web3.js';
import {
// getMintDecimalAmountFromNatural,
getMintMinAmountAsDecimal,
getMintNaturalAmountFromDecimalAsBN,
-} from '@tools/sdk/units'
-import { tryParseKey } from '@tools/validators/pubkey'
-import { debounce } from '@utils/debounce'
-import { abbreviateAddress, precision } from '@utils/formatting'
-import { TokenProgramAccount, tryGetTokenAccount } from '@utils/tokens'
+} from '@tools/sdk/units';
+import { tryParseKey } from '@tools/validators/pubkey';
+import { debounce } from '@utils/debounce';
+import { abbreviateAddress, precision } from '@utils/formatting';
+import { TokenProgramAccount, tryGetTokenAccount } from '@utils/tokens';
import {
SendTokenCompactViewForm,
- UiInstruction,
-} from '@utils/uiTypes/proposalCreationTypes'
-import React, { useEffect, useState } from 'react'
-import useTreasuryAccountStore from 'stores/useTreasuryAccountStore'
-import useWalletStore from 'stores/useWalletStore'
+ FormInstructionData,
+} from '@utils/uiTypes/proposalCreationTypes';
+import React, { useEffect, useState } from 'react';
+import useTreasuryAccountStore from 'stores/useTreasuryAccountStore';
+import useWalletStore from 'stores/useWalletStore';
-import { getTokenTransferSchema } from '@utils/validations'
+import { getTokenTransferSchema } from '@utils/validations';
import {
ArrowCircleDownIcon,
ArrowCircleUpIcon,
// InformationCircleIcon,
-} from '@heroicons/react/solid'
-import tokenService from '@utils/services/token'
-import BigNumber from 'bignumber.js'
-import { getInstructionDataFromBase64 } from '@solana/spl-governance'
-import useQueryContext from '@hooks/useQueryContext'
-import { RpcContext } from '@solana/spl-governance'
-import { Governance } from '@solana/spl-governance'
-import { ProgramAccount } from '@solana/spl-governance'
-import { createProposal } from 'actions/createProposal'
-import { useRouter } from 'next/router'
-import { notify } from '@utils/notifications'
-import Textarea from '@components/inputs/Textarea'
+} from '@heroicons/react/solid';
+import tokenService from '@utils/services/token';
+import BigNumber from 'bignumber.js';
+import { getInstructionDataFromBase64 } from '@solana/spl-governance';
+import useQueryContext from '@hooks/useQueryContext';
+import { RpcContext } from '@solana/spl-governance';
+import { Governance } from '@solana/spl-governance';
+import { ProgramAccount } from '@solana/spl-governance';
+import { createProposal } from 'actions/createProposal';
+import { useRouter } from 'next/router';
+import { notify } from '@utils/notifications';
+import Textarea from '@components/inputs/Textarea';
// import { Popover } from '@headlessui/react'
-import AccountLabel from './AccountHeader'
-import Tooltip from '@components/Tooltip'
-import useGovernanceAssets from '@hooks/useGovernanceAssets'
+import AccountLabel from './AccountHeader';
+import Tooltip from '@components/Tooltip';
+import useGovernanceAssets from '@hooks/useGovernanceAssets';
import {
getSolTransferInstruction,
getTransferInstruction,
getTransferNftInstruction,
-} from '@utils/instructionTools'
-import VoteBySwitch from 'pages/dao/[symbol]/proposal/components/VoteBySwitch'
-import NFTSelector from '@components/NFTS/NFTSelector'
-import { NFTWithMint } from '@utils/uiTypes/nfts'
-import { getProgramVersionForRealm } from '@models/registry/api'
-import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore'
+} from '@utils/instructionTools';
+import VoteBySwitch from 'pages/dao/[symbol]/proposal/components/VoteBySwitch';
+import NFTSelector from '@components/NFTS/NFTSelector';
+import { NFTWithMint } from '@utils/uiTypes/nfts';
+import { getProgramVersionForRealm } from '@models/registry/api';
+import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore';
const SendTokens = () => {
- const currentAccount = useTreasuryAccountStore((s) => s.currentAccount)
- const connection = useWalletStore((s) => s.connection)
+ const currentAccount = useTreasuryAccountStore((s) => s.currentAccount);
+ const connection = useWalletStore((s) => s.connection);
const {
realmInfo,
symbol,
@@ -64,17 +64,17 @@ const SendTokens = () => {
mint,
councilMint,
canChooseWhoVote,
- } = useRealm()
- const client = useVoteStakeRegistryClientStore((s) => s.state.client)
- const { canUseTransferInstruction } = useGovernanceAssets()
- const tokenInfo = useTreasuryAccountStore((s) => s.tokenInfo)
- const isNFT = currentAccount?.isNft
- const isSol = currentAccount?.isSol
- const { fmtUrlWithCluster } = useQueryContext()
- const wallet = useWalletStore((s) => s.current)
- const router = useRouter()
- const { fetchRealmGovernance } = useWalletStore((s) => s.actions)
- const programId: PublicKey | undefined = realmInfo?.programId
+ } = useRealm();
+ const client = useVoteStakeRegistryClientStore((s) => s.state.client);
+ const { canUseTransferInstruction } = useGovernanceAssets();
+ const tokenInfo = useTreasuryAccountStore((s) => s.tokenInfo);
+ const isNFT = currentAccount?.isNft;
+ const isSol = currentAccount?.isSol;
+ const { fmtUrlWithCluster } = useQueryContext();
+ const wallet = useWalletStore((s) => s.current);
+ const router = useRouter();
+ const { fetchRealmGovernance } = useWalletStore((s) => s.actions);
+ const programId: PublicKey | undefined = realmInfo?.programId;
const [form, setForm] = useState({
destinationAccount: '',
amount: isNFT ? 1 : undefined,
@@ -83,48 +83,48 @@ const SendTokens = () => {
mintInfo: undefined,
title: '',
description: '',
- })
- const [selectedNfts, setSelectedNfts] = useState([])
- const [voteByCouncil, setVoteByCouncil] = useState(false)
- const [showOptions, setShowOptions] = useState(false)
+ });
+ const [selectedNfts, setSelectedNfts] = useState([]);
+ const [voteByCouncil, setVoteByCouncil] = useState(false);
+ const [showOptions, setShowOptions] = useState(false);
const [
destinationAccount,
setDestinationAccount,
- ] = useState | null>(null)
- const [isLoading, setIsLoading] = useState(false)
- const [formErrors, setFormErrors] = useState({})
+ ] = useState | null>(null);
+ const [isLoading, setIsLoading] = useState(false);
+ const [formErrors, setFormErrors] = useState({});
const destinationAccountName =
destinationAccount?.publicKey &&
- getAccountName(destinationAccount?.account.address)
+ getAccountName(destinationAccount?.account.address);
const mintMinAmount = form.governedTokenAccount?.mint
? getMintMinAmountAsDecimal(form.governedTokenAccount.mint.account)
- : 1
- const currentPrecision = precision(mintMinAmount)
+ : 1;
+ const currentPrecision = precision(mintMinAmount);
const handleSetForm = ({ propertyName, value }) => {
- setFormErrors({})
- setForm({ ...form, [propertyName]: value })
- }
+ setFormErrors({});
+ setForm({ ...form, [propertyName]: value });
+ };
const setAmount = (event) => {
- const value = event.target.value
+ const value = event.target.value;
handleSetForm({
value: value,
propertyName: 'amount',
- })
- }
+ });
+ };
const validateAmountOnBlur = () => {
- const value = form.amount
+ const value = form.amount;
handleSetForm({
value: parseFloat(
Math.max(
Number(mintMinAmount),
- Math.min(Number(Number.MAX_SAFE_INTEGER), Number(value))
- ).toFixed(currentPrecision)
+ Math.min(Number(Number.MAX_SAFE_INTEGER), Number(value)),
+ ).toFixed(currentPrecision),
),
propertyName: 'amount',
- })
- }
+ });
+ };
// const setMaxAmount = () => {
// const amount =
// currentAccount && currentAccount.mint?.account
@@ -140,16 +140,16 @@ const SendTokens = () => {
// }
const calcTransactionDolarAmount = (amount) => {
const price = tokenService.getUSDTokenPrice(
- currentAccount!.mint!.publicKey.toBase58()
- )
- const totalPrice = amount * price
+ currentAccount!.mint!.publicKey.toBase58(),
+ );
+ const totalPrice = amount * price;
const totalPriceFormatted =
- amount && price ? new BigNumber(totalPrice).toFormat(2) : ''
- return totalPriceFormatted
- }
+ amount && price ? new BigNumber(totalPrice).toFormat(2) : '';
+ return totalPriceFormatted;
+ };
- async function getInstruction(): Promise {
- const selectedNftMint = selectedNfts[0]?.mint
+ async function getInstruction(): Promise {
+ const selectedNftMint = selectedNfts[0]?.mint;
const defaultProps = {
schema,
form,
@@ -159,27 +159,27 @@ const SendTokens = () => {
currentAccount,
setFormErrors,
- }
+ };
if (isNFT) {
return getTransferNftInstruction({
...defaultProps,
nftMint: selectedNftMint,
- })
+ });
}
if (isSol) {
- return getSolTransferInstruction(defaultProps)
+ return getSolTransferInstruction(defaultProps);
}
- return getTransferInstruction(defaultProps)
+ return getTransferInstruction(defaultProps);
}
const handlePropose = async () => {
- setIsLoading(true)
- const instruction: UiInstruction = await getInstruction()
+ setIsLoading(true);
+ const instruction: FormInstructionData = await getInstruction();
if (instruction.isValid) {
- const governance = currentAccount?.governance
- let proposalAddress: PublicKey | null = null
+ const governance = currentAccount?.governance;
+ let proposalAddress: PublicKey | null = null;
if (!realm) {
- setIsLoading(false)
- throw 'No realm selected'
+ setIsLoading(false);
+ throw 'No realm selected';
}
const rpcContext = new RpcContext(
@@ -187,40 +187,40 @@ const SendTokens = () => {
getProgramVersionForRealm(realmInfo!),
wallet!,
connection.current,
- connection.endpoint
- )
+ connection.endpoint,
+ );
const instructionData = {
data: instruction.serializedInstruction
? getInstructionDataFromBase64(instruction.serializedInstruction)
: null,
holdUpTime: governance?.account?.config.minInstructionHoldUpTime,
prerequisiteInstructions: instruction.prerequisiteInstructions || [],
- }
+ };
try {
// Fetch governance to get up to date proposalCount
const selectedGovernance = (await fetchRealmGovernance(
- governance?.pubkey
- )) as ProgramAccount
+ governance?.pubkey,
+ )) as ProgramAccount;
const ownTokenRecord = ownVoterWeight.getTokenRecordToCreateProposal(
- governance!.account.config
- )
+ governance!.account.config,
+ );
const defaultProposalMint = !mint?.supply.isZero()
? realm.account.communityMint
: !councilMint?.supply.isZero()
? realm.account.config.councilMint
- : undefined
+ : undefined;
const proposalMint =
canChooseWhoVote && voteByCouncil
? realm.account.config.councilMint
- : defaultProposalMint
+ : defaultProposalMint;
if (!proposalMint) {
throw new Error(
- 'There is no suitable governing token for the proposal'
- )
+ 'There is no suitable governing token for the proposal',
+ );
}
//Description same as title
proposalAddress = await createProposal(
@@ -234,72 +234,72 @@ const SendTokens = () => {
selectedGovernance?.account?.proposalCount,
[instructionData],
false,
- client
- )
+ client,
+ );
const url = fmtUrlWithCluster(
- `/dao/${symbol}/proposal/${proposalAddress}`
- )
- router.push(url)
+ `/dao/${symbol}/proposal/${proposalAddress}`,
+ );
+ router.push(url);
} catch (ex) {
- notify({ type: 'error', message: `${ex}` })
+ notify({ type: 'error', message: `${ex}` });
}
}
- setIsLoading(false)
- }
+ setIsLoading(false);
+ };
const IsAmountNotHigherThenBalance = () => {
const mintValue = getMintNaturalAmountFromDecimalAsBN(
form.amount!,
- form.governedTokenAccount!.mint!.account.decimals
- )
- let gte: boolean | undefined = false
+ form.governedTokenAccount!.mint!.account.decimals,
+ );
+ let gte: boolean | undefined = false;
try {
- gte = form.governedTokenAccount?.token?.account?.amount?.gte(mintValue)
+ gte = form.governedTokenAccount?.token?.account?.amount?.gte(mintValue);
} catch (e) {
//silent fail
}
- return form.governedTokenAccount?.token?.publicKey && gte
- }
+ return form.governedTokenAccount?.token?.publicKey && gte;
+ };
useEffect(() => {
if (currentAccount) {
handleSetForm({
value: currentAccount,
propertyName: 'governedTokenAccount',
- })
+ });
}
- }, [currentAccount])
+ }, [currentAccount]);
useEffect(() => {
if (form.destinationAccount) {
debounce.debounceFcn(async () => {
- const pubKey = tryParseKey(form.destinationAccount)
+ const pubKey = tryParseKey(form.destinationAccount!);
if (pubKey) {
- const account = await tryGetTokenAccount(connection.current, pubKey)
- setDestinationAccount(account ? account : null)
+ const account = await tryGetTokenAccount(connection.current, pubKey);
+ setDestinationAccount(account ? account : null);
} else {
- setDestinationAccount(null)
+ setDestinationAccount(null);
}
- })
+ });
} else {
- setDestinationAccount(null)
+ setDestinationAccount(null);
}
- }, [form.destinationAccount])
+ }, [form.destinationAccount]);
- const schema = getTokenTransferSchema({ form, connection })
- const transactionDolarAmount = calcTransactionDolarAmount(form.amount)
- const nftName = selectedNfts[0]?.val?.name
+ const schema = getTokenTransferSchema({ form, connection });
+ const transactionDolarAmount = calcTransactionDolarAmount(form.amount);
+ const nftName = selectedNfts[0]?.val?.name;
const nftTitle = `Send ${nftName ? nftName : 'NFT'} to ${
form.destinationAccount
- }`
+ }`;
const proposalTitle = isNFT
? nftTitle
: `Pay ${form.amount}${tokenInfo ? ` ${tokenInfo?.symbol} ` : ' '}to ${
- tryParseKey(form.destinationAccount)
- ? abbreviateAddress(new PublicKey(form.destinationAccount))
+ tryParseKey(form.destinationAccount!)
+ ? abbreviateAddress(new PublicKey(form.destinationAccount!))
: ''
- }`
+ }`;
if (!currentAccount) {
- return null
+ return null;
}
return (
@@ -426,7 +426,7 @@ const SendTokens = () => {
{
- setVoteByCouncil(!voteByCouncil)
+ setVoteByCouncil(!voteByCouncil);
}}
>
)}
@@ -458,7 +458,7 @@ const SendTokens = () => {
>
- )
-}
+ );
+};
-export default SendTokens
+export default SendTokens;
diff --git a/components/TwitterIcon.tsx b/components/TwitterIcon.tsx
index 013f634af2..0ec0c39faa 100644
--- a/components/TwitterIcon.tsx
+++ b/components/TwitterIcon.tsx
@@ -16,7 +16,7 @@ const TwitterIcon = ({ className }) => {
strokeLinejoin="round"
/>
- )
-}
+ );
+};
-export default TwitterIcon
+export default TwitterIcon;
diff --git a/components/VoteCommentModal.tsx b/components/VoteCommentModal.tsx
index a9b931057d..b51073f95e 100644
--- a/components/VoteCommentModal.tsx
+++ b/components/VoteCommentModal.tsx
@@ -1,94 +1,101 @@
-import React, { FunctionComponent, useState } from 'react'
+import React, { useState } from 'react';
import {
ChatMessageBody,
ChatMessageBodyType,
+ GoverningTokenType,
+ ProgramAccount,
+ TokenOwnerRecord,
YesNoVote,
-} from '@solana/spl-governance'
-import { RpcContext } from '@solana/spl-governance'
-import useWalletStore from '../stores/useWalletStore'
-import useRealm from '../hooks/useRealm'
-import { castVote } from '../actions/castVote'
-
-import Button, { SecondaryButton } from './Button'
-// import { notify } from '../utils/notifications'
-import Loading from './Loading'
-import Modal from './Modal'
-import Input from './inputs/Input'
-import Tooltip from './Tooltip'
-import { TokenOwnerRecord } from '@solana/spl-governance'
-import { ProgramAccount } from '@solana/spl-governance'
-import { getProgramVersionForRealm } from '@models/registry/api'
-import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore'
-
-interface VoteCommentModalProps {
- onClose: () => void
- isOpen: boolean
- vote: YesNoVote
- voterTokenRecord: ProgramAccount
-}
-
-const VoteCommentModal: FunctionComponent = ({
+} from '@solana/spl-governance';
+import { RpcContext } from '@solana/spl-governance';
+import useWalletStore from '../stores/useWalletStore';
+import useRealm from '../hooks/useRealm';
+import { castVotes } from '../actions/castVotes';
+
+import Button, { SecondaryButton } from './Button';
+import Loading from './Loading';
+import Modal from './Modal';
+import Input from './inputs/Input';
+import Tooltip from './Tooltip';
+import { getProgramVersionForRealm } from '@models/registry/api';
+import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore';
+
+const VoteCommentModal = ({
onClose,
isOpen,
vote,
- voterTokenRecord,
+ tokenOwnerRecordsToVoteWith,
+}: {
+ onClose: () => void;
+ isOpen: boolean;
+ vote: YesNoVote;
+ tokenOwnerRecordsToVoteWith: ProgramAccount[];
}) => {
- const client = useVoteStakeRegistryClientStore((s) => s.state.client)
- const [submitting, setSubmitting] = useState(false)
- const [comment, setComment] = useState('')
- const wallet = useWalletStore((s) => s.current)
- const connection = useWalletStore((s) => s.connection)
- const { proposal } = useWalletStore((s) => s.selectedProposal)
- const { fetchChatMessages } = useWalletStore((s) => s.actions)
- const { fetchVoteRecords } = useWalletStore((s) => s.actions)
- const { realm, realmInfo } = useRealm()
- const { fetchRealm } = useWalletStore((s) => s.actions)
+ const client = useVoteStakeRegistryClientStore((s) => s.state.client);
+ const [submitting, setSubmitting] = useState(false);
+ const [comment, setComment] = useState('');
+ const wallet = useWalletStore((s) => s.current);
+ const connection = useWalletStore((s) => s.connection);
+ const { proposal, tokenType } = useWalletStore((s) => s.selectedProposal);
+ const { fetchChatMessages } = useWalletStore((s) => s.actions);
+ const { fetchVoteRecords } = useWalletStore((s) => s.actions);
+ const { realm, realmInfo, mint, councilMint } = useRealm();
+ const { fetchRealm } = useWalletStore((s) => s.actions);
const submitVote = async (vote: YesNoVote) => {
- const programId = realmInfo?.programId
- const realmId = realmInfo?.realmId
- setSubmitting(true)
+ const programId = realmInfo?.programId;
+ const realmId = realmInfo?.realmId;
+
+ setSubmitting(true);
+
const rpcContext = new RpcContext(
proposal!.owner,
getProgramVersionForRealm(realmInfo!),
wallet!,
connection.current,
- connection.endpoint
- )
+ connection.endpoint,
+ );
- const msg = comment
+ const message = comment
? new ChatMessageBody({
type: ChatMessageBodyType.Text,
value: comment,
})
- : undefined
+ : undefined;
try {
- await castVote(
+ const usedMint =
+ tokenType === GoverningTokenType.Community ? mint : councilMint;
+
+ if (!usedMint) {
+ throw new Error('Mint not found');
+ }
+
+ await castVotes({
rpcContext,
- realm!,
- proposal!,
- voterTokenRecord.pubkey,
+ realm: realm!,
+ proposal: proposal!,
+ tokenOwnerRecordsToVoteWith,
vote,
- msg,
- client
- )
+ message,
+ client,
+ });
} catch (ex) {
//TODO: How do we present transaction errors to users? Just the notification?
- console.error("Can't cast vote", ex)
- onClose()
+ console.error("Can't cast vote (2)", ex);
+ onClose();
} finally {
- setSubmitting(false)
- onClose()
+ setSubmitting(false);
+ onClose();
}
- fetchChatMessages(proposal!.pubkey)
- fetchVoteRecords(proposal)
- await fetchRealm(programId, realmId)
- }
+ fetchChatMessages(proposal!.pubkey);
+ fetchVoteRecords(proposal);
+ await fetchRealm(programId, realmId);
+ };
- const voteString = vote === YesNoVote.Yes ? 'Yes' : 'No'
+ const voteString = vote === YesNoVote.Yes ? 'Yes' : 'No';
return (
@@ -122,7 +129,7 @@ const VoteCommentModal: FunctionComponent = ({
- )
-}
+ );
+};
-export default React.memo(VoteCommentModal)
+export default React.memo(VoteCommentModal);
diff --git a/components/VoteCountdown.tsx b/components/VoteCountdown.tsx
index e05c3b6952..1b7d226673 100644
--- a/components/VoteCountdown.tsx
+++ b/components/VoteCountdown.tsx
@@ -1,12 +1,12 @@
-import React, { useEffect, useState } from 'react'
-import { Governance, Proposal } from '@solana/spl-governance'
-import dayjs from 'dayjs'
+import React, { useEffect, useState } from 'react';
+import { Governance, Proposal } from '@solana/spl-governance';
+import dayjs from 'dayjs';
interface CountdownState {
- days: number
- hours: number
- minutes: number
- seconds: number
+ days: number;
+ hours: number;
+ minutes: number;
+ seconds: number;
}
const ZeroCountdown: CountdownState = {
@@ -14,68 +14,68 @@ const ZeroCountdown: CountdownState = {
hours: 0,
minutes: 0,
seconds: 0,
-}
+};
const isZeroCountdown = (state: CountdownState) =>
state.days === 0 &&
state.hours === 0 &&
state.minutes === 0 &&
- state.seconds === 0
+ state.seconds === 0;
export function VoteCountdown({
proposal,
governance,
}: {
- proposal: Proposal
- governance: Governance
+ proposal: Proposal;
+ governance: Governance;
}) {
- const [countdown, setCountdown] = useState(ZeroCountdown)
+ const [countdown, setCountdown] = useState(ZeroCountdown);
useEffect(() => {
if (proposal.isVoteFinalized()) {
- setCountdown(ZeroCountdown)
- return
+ setCountdown(ZeroCountdown);
+ return;
}
const getTimeToVoteEnd = () => {
- const now = dayjs().unix()
+ const now = dayjs().unix();
let timeToVoteEnd = proposal.isPreVotingState()
? governance.config.maxVotingTime
: (proposal.votingAt?.toNumber() ?? 0) +
governance.config.maxVotingTime -
- now
+ now;
if (timeToVoteEnd <= 0) {
- return ZeroCountdown
+ return ZeroCountdown;
}
- const days = Math.floor(timeToVoteEnd / 86400)
- timeToVoteEnd -= days * 86400
+ const days = Math.floor(timeToVoteEnd / 86400);
+ timeToVoteEnd -= days * 86400;
- const hours = Math.floor(timeToVoteEnd / 3600) % 24
- timeToVoteEnd -= hours * 3600
+ const hours = Math.floor(timeToVoteEnd / 3600) % 24;
+ timeToVoteEnd -= hours * 3600;
- const minutes = Math.floor(timeToVoteEnd / 60) % 60
- timeToVoteEnd -= minutes * 60
+ const minutes = Math.floor(timeToVoteEnd / 60) % 60;
+ timeToVoteEnd -= minutes * 60;
- const seconds = Math.floor(timeToVoteEnd % 60)
+ const seconds = Math.floor(timeToVoteEnd % 60);
- return { days, hours, minutes, seconds }
- }
+ return { days, hours, minutes, seconds };
+ };
const updateCountdown = () => {
- const newState = getTimeToVoteEnd()
- setCountdown(newState)
- }
+ const newState = getTimeToVoteEnd();
+ setCountdown(newState);
+ };
const interval = setInterval(() => {
- updateCountdown()
- }, 1000)
+ updateCountdown();
+ }, 1000);
- updateCountdown()
- return () => clearInterval(interval)
- }, [proposal, governance])
+ updateCountdown();
+ return () => clearInterval(interval);
+ }, [proposal, governance]);
return (
<>
@@ -108,5 +108,5 @@ export function VoteCountdown({
)}
>
- )
+ );
}
diff --git a/components/VotePanel.tsx b/components/VotePanel.tsx
index 995b0cc13f..173e2a71fc 100644
--- a/components/VotePanel.tsx
+++ b/components/VotePanel.tsx
@@ -1,90 +1,349 @@
-/* eslint-disable @typescript-eslint/no-non-null-assertion */
-
-import { withFinalizeVote, YesNoVote } from '@solana/spl-governance'
-import { TransactionInstruction } from '@solana/web3.js'
-import { useCallback, useState } from 'react'
-import { relinquishVote } from '../actions/relinquishVote'
-import { useHasVoteTimeExpired } from '../hooks/useHasVoteTimeExpired'
-import useRealm from '../hooks/useRealm'
-import { ProposalState } from '@solana/spl-governance'
-import { RpcContext } from '@solana/spl-governance'
-import { GoverningTokenType } from '@solana/spl-governance'
-
-import useWalletStore from '../stores/useWalletStore'
-import Button, { SecondaryButton } from './Button'
-import VoteCommentModal from './VoteCommentModal'
-import { getProgramVersionForRealm } from '@models/registry/api'
+import {
+ ProgramAccount,
+ TokenOwnerRecord,
+ VoteRecord,
+ withFinalizeVote,
+ YesNoVote,
+} from '@solana/spl-governance';
+import { TransactionInstruction } from '@solana/web3.js';
+import { useState } from 'react';
+import relinquishVotes from '../actions/relinquishVotes';
+import { useHasVoteTimeExpired } from '../hooks/useHasVoteTimeExpired';
+import useRealm from '../hooks/useRealm';
+import { RpcContext } from '@solana/spl-governance';
+import { GoverningTokenType } from '@solana/spl-governance';
+
+import useWalletStore, {
+ EnhancedProposalState,
+} from '../stores/useWalletStore';
+import Button from './Button';
+import VoteCommentModal from './VoteCommentModal';
+import { getProgramVersionForRealm } from '@models/registry/api';
+import { VoteRegistryVoterWeight, VoterWeight } from '@models/voteWeights';
+import { castVotes } from 'actions/castVotes';
+import { notify } from '@utils/notifications';
+import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore';
+import { BN_ZERO } from '@utils/helpers';
+import { fmtTokenAmount } from '@utils/formatting';
+
+export type AccountToVoteFor = {
+ tokenRecord?: ProgramAccount;
+ voterWeight?: VoteRegistryVoterWeight | VoterWeight;
+ voteRecord?: ProgramAccount;
+ voterTokenRecord?: ProgramAccount;
+};
+
+export type AccountsToVoteFor = AccountToVoteFor[];
+
+function decideOfExecutableActions(
+ sortedAccounts: SortedAccounts,
+ isVoting: boolean,
+): {
+ showSync?: true;
+ showWithdraw?: true;
+ showVoteYes?: true;
+ showVoteNo?: true;
+} {
+ if (
+ sortedAccounts.accountsThatHaveAlreadyVoted.length > 0 &&
+ sortedAccounts.accountsReadyToVote.length > 0 &&
+ isVoting
+ ) {
+ return {
+ showSync: true,
+ showWithdraw: true,
+ };
+ }
+
+ if (sortedAccounts.accountsReadyToVote.length > 0 && isVoting) {
+ return {
+ showVoteNo: true,
+ showVoteYes: true,
+ };
+ }
+
+ if (sortedAccounts.accountsThatHaveAlreadyVoted.length > 0) {
+ return {
+ showWithdraw: true,
+ };
+ }
+
+ return {};
+}
+
+// Look at the casted votes and get the voteSide
+function getVoteSide(
+ accounts: AccountsToVoteFor,
+): YesNoVote | 'conflicted' | null {
+ return accounts.reduce((state, account) => {
+ // Ignore accounts with un-casted votes
+ if (!account.voteRecord?.account.vote) {
+ return state;
+ }
+
+ const voteSide = account.voteRecord?.account.vote?.toYesNoVote();
+
+ if (typeof voteSide === 'undefined') {
+ return state;
+ }
+
+ if (state === null) {
+ return voteSide;
+ }
+
+ if (state !== voteSide) {
+ return 'conflicted';
+ }
+
+ return voteSide;
+ }, null as YesNoVote | 'conflicted' | null);
+}
+
+type SortedAccounts = {
+ accountsReadyToVote: AccountsToVoteFor;
+ accountsThatHaveAlreadyVoted: AccountsToVoteFor;
+ accountsWithoutVotingPower: AccountsToVoteFor;
+};
+
+function sortAccountsToVoteFor(
+ accountsToVoteFor: AccountsToVoteFor,
+): SortedAccounts {
+ return accountsToVoteFor.reduce(
+ (acc, account) => {
+ // Ignore account without voterTokenRecord
+ if (!account.voterTokenRecord) {
+ return acc;
+ }
+
+ if (
+ account.voterTokenRecord.account.governingTokenDepositAmount.eq(BN_ZERO)
+ ) {
+ acc.accountsWithoutVotingPower.push(account);
+ return acc;
+ }
+
+ if (!account.voteRecord) {
+ acc.accountsReadyToVote.push(account);
+ return acc;
+ }
+
+ if (!account.voteRecord.account.isRelinquished) {
+ acc.accountsThatHaveAlreadyVoted.push(account);
+ return acc;
+ }
+
+ // Unexpected turn of event, ignore the account
+ return acc;
+ },
+ {
+ accountsReadyToVote: [],
+ accountsThatHaveAlreadyVoted: [],
+ accountsWithoutVotingPower: [],
+ } as SortedAccounts,
+ );
+}
const VotePanel = () => {
- const [showVoteModal, setShowVoteModal] = useState(false)
- const [vote, setVote] = useState(null)
+ const [showVoteModal, setShowVoteModal] = useState(false);
+ const [vote, setVote] = useState(null);
+
const {
governance,
proposal,
voteRecordsByVoter,
tokenType,
- } = useWalletStore((s) => s.selectedProposal)
+ } = useWalletStore((s) => s.selectedProposal);
+
const {
ownTokenRecord,
ownCouncilTokenRecord,
- realm,
realmInfo,
+ realm,
ownVoterWeight,
- } = useRealm()
- const wallet = useWalletStore((s) => s.current)
- const connection = useWalletStore((s) => s.connection)
- const connected = useWalletStore((s) => s.connected)
- const fetchRealm = useWalletStore((s) => s.actions.fetchRealm)
- const hasVoteTimeExpired = useHasVoteTimeExpired(governance, proposal!)
-
- const ownVoteRecord =
- wallet?.publicKey && voteRecordsByVoter[wallet.publicKey.toBase58()]
-
- const voterTokenRecord =
- tokenType === GoverningTokenType.Community
- ? ownTokenRecord
- : ownCouncilTokenRecord
-
- const isVoteCast = ownVoteRecord !== undefined
+ tokenRecords,
+ councilMint,
+ mint,
+ councilTokenOwnerRecords,
+ } = useRealm();
+
+ const client = useVoteStakeRegistryClientStore((s) => s.state.client);
+ const wallet = useWalletStore((s) => s.current);
+ const connection = useWalletStore((s) => s.connection);
+ const fetchVoteRecords = useWalletStore((s) => s.actions.fetchVoteRecords);
+ const fetchRealm = useWalletStore((s) => s.actions.fetchRealm);
+ const hasVoteTimeExpired = useHasVoteTimeExpired(governance, proposal!);
+
+ const usedMint =
+ tokenType === GoverningTokenType.Community ? mint : councilMint;
+
+ // Look for accounts where the user is the delegate
+ const getDelegatedAccounts = (): {
+ address: string;
+ nbToken: number;
+ }[] => {
+ if (!wallet?.publicKey) {
+ return [];
+ }
+
+ if (!usedMint) {
+ throw new Error('Information about the mint not found');
+ }
+
+ return Object.entries(tokenRecords)
+ .filter(([, value]) =>
+ value.account.governanceDelegate?.equals(wallet.publicKey!),
+ )
+ .map(([key, value]) => ({
+ address: key,
+ nbToken: fmtTokenAmount(
+ value.account.governingTokenDepositAmount,
+ usedMint.decimals,
+ ),
+ }));
+ };
+
+ const handleShowVoteModal = (vote: YesNoVote) => {
+ setVote(vote);
+
+ setShowVoteModal(true);
+ };
+
+ const handleCloseShowVoteModal = () => setShowVoteModal(false);
+
+ // Show nothing if not connected
+ if (!wallet?.publicKey) {
+ return null;
+ }
+
+ const delegatedAccounts =
+ tokenType === GoverningTokenType.Community ? getDelegatedAccounts() : [];
+
+ // Holds accounts we can vote for
+ const accountsToVoteFor: AccountsToVoteFor = [
+ // The user own account first
+ {
+ tokenRecord:
+ tokenType === GoverningTokenType.Community
+ ? ownTokenRecord
+ : ownCouncilTokenRecord,
+ voterWeight: ownVoterWeight,
+ voteRecord: voteRecordsByVoter[wallet.publicKey.toBase58()],
+ voterTokenRecord:
+ tokenType === GoverningTokenType.Community
+ ? ownTokenRecord
+ : ownCouncilTokenRecord,
+ },
+
+ // Then the delegated accounts
+ ...delegatedAccounts.map(({ address: delegatedAccountAddress }) => ({
+ tokenRecord:
+ tokenType === GoverningTokenType.Community
+ ? tokenRecords[delegatedAccountAddress]
+ : councilTokenOwnerRecords[delegatedAccountAddress],
+ voterWeight: new VoterWeight(ownTokenRecord, ownCouncilTokenRecord),
+ voteRecord: voteRecordsByVoter[delegatedAccountAddress],
+ voterTokenRecord:
+ tokenType === GoverningTokenType.Community
+ ? tokenRecords[delegatedAccountAddress]
+ : councilTokenOwnerRecords[delegatedAccountAddress],
+ })),
+ ];
+
+ // How to detect if an account have vote or not?
+ // If voteRecord equals to undefined, then vote has not been casted
+ // If voteRecord.account.isRelinquished then the vote has been relinquished
+ const sortedAccounts = sortAccountsToVoteFor(accountsToVoteFor);
+
const isVoting =
- proposal?.account.state === ProposalState.Voting && !hasVoteTimeExpired
-
- const isVoteEnabled =
- connected &&
- isVoting &&
- !isVoteCast &&
- voterTokenRecord &&
- ownVoterWeight.hasMinAmountToVote(
- voterTokenRecord.account.governingTokenMint
- )
-
- const isWithdrawEnabled =
- connected &&
- ownVoteRecord &&
- !ownVoteRecord?.account.isRelinquished &&
- proposal &&
- (proposal!.account.state === ProposalState.Voting ||
- proposal!.account.state === ProposalState.Completed ||
- proposal!.account.state === ProposalState.Cancelled ||
- proposal!.account.state === ProposalState.Succeeded ||
- proposal!.account.state === ProposalState.Executing ||
- proposal!.account.state === ProposalState.Defeated)
-
- const submitRelinquishVote = async () => {
- const programId = realmInfo?.programId
- const realmId = realmInfo?.realmId
+ proposal?.account.state === EnhancedProposalState.Voting &&
+ !hasVoteTimeExpired;
+
+ // Decide which options should be displayed to the end user for this proposal regarding the vote states
+ const {
+ showSync,
+ showWithdraw,
+ showVoteNo,
+ showVoteYes,
+ } = decideOfExecutableActions(sortedAccounts, isVoting);
+
+ // There are more power available to vote, when votes are already committed
+ const submitSyncVotes = async () => {
+ const programId = realmInfo?.programId;
+ const realmId = realmInfo?.realmId;
+
+ const rpcContext = new RpcContext(
+ proposal!.owner,
+ getProgramVersionForRealm(realmInfo!),
+ wallet!,
+ connection.current,
+ connection.endpoint,
+ );
+
+ const voteSide = getVoteSide(sortedAccounts.accountsThatHaveAlreadyVoted);
+
+ // Votes are conflicted, withdraw all, so we can start on a clean state again
+ if (voteSide === 'conflicted') {
+ await submitRelinquishVotes();
+
+ notify({
+ type: 'warn',
+ message: `Committed votes are conflicted (Yes and No). Withdrawing all votes...`,
+ });
+
+ return;
+ }
+
+ if (voteSide === null) {
+ notify({
+ type: 'warn',
+ message: `Programming error. We have not been able to detect vote side.`,
+ });
+
+ return;
+ }
+
+ try {
+ if (!usedMint) {
+ throw new Error('Mint not found');
+ }
+
+ await castVotes({
+ rpcContext,
+ realm: realm!,
+ proposal: proposal!,
+
+ tokenOwnerRecordsToVoteWith: sortedAccounts.accountsReadyToVote.map(
+ (account) => account.voterTokenRecord!,
+ ),
+
+ vote: voteSide,
+ client,
+ });
+ } catch (ex) {
+ console.error("Can't cast vote", ex);
+ }
+
+ fetchVoteRecords(proposal);
+ await fetchRealm(programId, realmId);
+ };
+
+ const submitRelinquishVotes = async () => {
+ const programId = realmInfo?.programId;
+ const realmId = realmInfo?.realmId;
+
const rpcContext = new RpcContext(
proposal!.owner,
getProgramVersionForRealm(realmInfo!),
wallet!,
connection.current,
- connection.endpoint
- )
+ connection.endpoint,
+ );
+
try {
- const instructions: TransactionInstruction[] = []
+ const instructions: TransactionInstruction[] = [];
if (
- proposal?.account.state === ProposalState.Voting &&
+ proposal?.account.state === EnhancedProposalState.Voting &&
hasVoteTimeExpired
) {
await withFinalizeVote(
@@ -95,130 +354,131 @@ const VotePanel = () => {
proposal.account.governance,
proposal.pubkey,
proposal.account.tokenOwnerRecord,
- proposal.account.governingTokenMint
- )
+ proposal.account.governingTokenMint,
+ );
}
- await relinquishVote(
+ await relinquishVotes({
rpcContext,
- proposal!,
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
- voterTokenRecord!.pubkey,
- ownVoteRecord!.pubkey,
- instructions
- )
+ proposal: proposal!,
+ records: sortedAccounts.accountsThatHaveAlreadyVoted.map(
+ ({ tokenRecord, voteRecord }) => ({
+ tokenOwnerRecord: tokenRecord!.pubkey,
+ voteRecord: voteRecord!.pubkey,
+ }),
+ ),
+
+ instructions,
+ });
} catch (ex) {
- console.error("Can't relinquish vote", ex)
+ console.error("Can't relinquish vote", ex);
}
- await fetchRealm(programId, realmId)
- }
+ await fetchRealm(programId, realmId);
+ };
- const handleShowVoteModal = (vote: YesNoVote) => {
- setVote(vote)
- setShowVoteModal(true)
+ const getActionLabel = () => {
+ if (!isVoting) {
+ return 'Release your tokens';
+ }
+
+ if (showVoteYes || showVoteNo) {
+ return 'Cast your vote';
+ }
+
+ if (showSync) {
+ return 'Sync or withdraw your vote';
+ }
+
+ return 'Withdraw your vote';
+ };
+
+ const actionLabel = getActionLabel();
+
+ // Nothing to do, nothing to display
+ if (!showWithdraw && !showVoteYes && !showVoteNo && !showSync) {
+ return <>>;
}
- const handleCloseShowVoteModal = useCallback(() => {
- setShowVoteModal(false)
- }, [])
-
- const actionLabel =
- !isVoteCast || !connected
- ? 'Cast your vote'
- : isVoting
- ? 'Withdraw your vote'
- : 'Release your tokens'
-
- const withdrawTooltipContent = !connected
- ? 'You need to connect your wallet'
- : !isWithdrawEnabled
- ? !ownVoteRecord?.account.isRelinquished
- ? 'Owner vote record is not relinquished'
- : 'The proposal is not in a valid state to execute this action.'
- : ''
-
- const voteTooltipContent = !connected
- ? 'You need to connect your wallet to be able to vote'
- : !isVoting && isVoteCast
- ? 'Proposal is not in a voting state anymore.'
- : !voterTokenRecord ||
- !ownVoterWeight.hasMinAmountToVote(
- voterTokenRecord.account.governingTokenMint
- )
- ? 'You don’t have governance power to vote in this realm'
- : ''
-
- const notVisibleStatesForNotConnectedWallet = [
- ProposalState.Cancelled,
- ProposalState.Succeeded,
- ProposalState.Draft,
- ProposalState.Completed,
- ]
-
- const isVisibleToWallet = !connected
- ? !hasVoteTimeExpired &&
- typeof notVisibleStatesForNotConnectedWallet.find(
- (x) => x === proposal?.account.state
- ) === 'undefined'
- : !ownVoteRecord?.account.isRelinquished
-
- const isPanelVisible = (isVoting || isVoteCast) && isVisibleToWallet
return (
- <>
- {isPanelVisible && (
-
-
{actionLabel}
-
-
- {isVoteCast && connected ? (
-
submitRelinquishVote()}
- disabled={!isWithdrawEnabled}
- >
- {isVoting ? 'Withdraw' : 'Release Tokens'}
-
- ) : (
- <>
- {isVoting && (
-
-
-
-
-
- )}
- >
- )}
+
+
{actionLabel}
+
+
+ {delegatedAccounts.length ? (
+
+
+ {delegatedAccounts.length}
+
+ delegated account{delegatedAccounts.length > 1 ? 's' : ''}
+ ) : null}
+
- {showVoteModal ? (
-
- ) : null}
-
- )}
- >
- )
-}
+
+ {showVoteYes ? (
+
+ ) : null}
+
+ {showVoteNo ? (
+
+ ) : null}
+
+ {isVoting && showWithdraw ? (
+
+ ) : null}
+
+ {!isVoting && showWithdraw ? (
+
+ ) : null}
+
+ {showSync ? (
+
+ ) : null}
+
+
+ {showVoteModal ? (
+
account.voterTokenRecord!,
+ )}
+ />
+ ) : null}
+
+ );
+};
-export default VotePanel
+export default VotePanel;
diff --git a/components/VoteResultStatus.tsx b/components/VoteResultStatus.tsx
index d9e1fd2f21..430f88e414 100644
--- a/components/VoteResultStatus.tsx
+++ b/components/VoteResultStatus.tsx
@@ -1,10 +1,10 @@
-import { XCircleIcon, CheckCircleIcon } from '@heroicons/react/outline'
+import { XCircleIcon, CheckCircleIcon } from '@heroicons/react/outline';
type VoteResultStatusProps = {
- progress: number
- votePassed: boolean | undefined
- yesVotesRequired: number
-}
+ progress: number;
+ votePassed: boolean | undefined;
+ yesVotesRequired: number;
+};
const VoteResultStatus = ({
progress,
@@ -26,7 +26,7 @@ const VoteResultStatus = ({
undefined,
{
maximumFractionDigits: 0,
- }
+ },
)} more Yes vote${yesVotesRequired > 1 ? 's' : ''} were needed`}
@@ -41,7 +41,7 @@ const VoteResultStatus = ({
>
- )
-}
+ );
+};
-export default VoteResultStatus
+export default VoteResultStatus;
diff --git a/components/VoteResults.tsx b/components/VoteResults.tsx
index f064686493..fe2f1c46c1 100644
--- a/components/VoteResults.tsx
+++ b/components/VoteResults.tsx
@@ -1,11 +1,11 @@
-import VoteResultsBar from './VoteResultsBar'
-import useProposalVotes from '@hooks/useProposalVotes'
-import { Proposal } from '@solana/spl-governance'
+import VoteResultsBar from './VoteResultsBar';
+import useProposalVotes from '@hooks/useProposalVotes';
+import { Proposal } from '@solana/spl-governance';
type VoteResultsProps = {
- isListView?: boolean
- proposal: Proposal
-}
+ isListView?: boolean;
+ proposal: Proposal;
+};
const VoteResults = ({ isListView, proposal }: VoteResultsProps) => {
const {
@@ -13,7 +13,7 @@ const VoteResults = ({ isListView, proposal }: VoteResultsProps) => {
noVoteCount,
relativeNoVotes,
relativeYesVotes,
- } = useProposalVotes(proposal)
+ } = useProposalVotes(proposal);
return (
{proposal ? (
@@ -73,7 +73,7 @@ const VoteResults = ({ isListView, proposal }: VoteResultsProps) => {
>
)}
- )
-}
+ );
+};
-export default VoteResults
+export default VoteResults;
diff --git a/components/VoteResultsBar.tsx b/components/VoteResultsBar.tsx
index 52f5385368..9abcb95dc8 100644
--- a/components/VoteResultsBar.tsx
+++ b/components/VoteResultsBar.tsx
@@ -1,7 +1,7 @@
type VoteResultsBarProps = {
- approveVotePercentage: number
- denyVotePercentage: number
-}
+ approveVotePercentage: number;
+ denyVotePercentage: number;
+};
const VoteResultsBar = ({
approveVotePercentage = 0,
@@ -36,7 +36,7 @@ const VoteResultsBar = ({
>
>
- )
-}
+ );
+};
-export default VoteResultsBar
+export default VoteResultsBar;
diff --git a/components/chat/Comment.tsx b/components/chat/Comment.tsx
index 977dfe9003..1ba9b4daf3 100644
--- a/components/chat/Comment.tsx
+++ b/components/chat/Comment.tsx
@@ -1,38 +1,38 @@
-import React from 'react'
-import { VoteRecord } from '@solana/spl-governance'
+import React from 'react';
+import { VoteRecord } from '@solana/spl-governance';
import {
CheckCircleIcon,
UserCircleIcon,
XCircleIcon,
-} from '@heroicons/react/solid'
-import { ExternalLinkIcon } from '@heroicons/react/solid'
-import { ChatMessage } from '@solana/spl-governance'
-import { abbreviateAddress, fmtTokenAmount } from '../../utils/formatting'
-import useRealm from '../../hooks/useRealm'
-import { MintInfo } from '@solana/spl-token'
-import { isPublicKey } from '@tools/core/pubkey'
-import { getVoteWeight, isYesVote } from '@models/voteRecords'
-import dayjs from 'dayjs'
-const relativeTime = require('dayjs/plugin/relativeTime')
+} from '@heroicons/react/solid';
+import { ExternalLinkIcon } from '@heroicons/react/solid';
+import { ChatMessage } from '@solana/spl-governance';
+import { abbreviateAddress, fmtTokenAmount } from '../../utils/formatting';
+import useRealm from '../../hooks/useRealm';
+import { MintInfo } from '@solana/spl-token';
+import { isPublicKey } from '@tools/core/pubkey';
+import { getVoteWeight, isYesVote } from '@models/voteRecords';
+import dayjs from 'dayjs';
+const relativeTime = require('dayjs/plugin/relativeTime');
const Comment = ({
chatMessage,
voteRecord,
proposalMint,
}: {
- chatMessage: ChatMessage
- voteRecord: VoteRecord | undefined
- proposalMint: MintInfo | undefined
+ chatMessage: ChatMessage;
+ voteRecord: VoteRecord | undefined;
+ proposalMint: MintInfo | undefined;
}) => {
- dayjs.extend(relativeTime)
- const { author, postedAt, body } = chatMessage
- const { realmInfo } = useRealm()
+ dayjs.extend(relativeTime);
+ const { author, postedAt, body } = chatMessage;
+ const { realmInfo } = useRealm();
const voteSymbol = !realmInfo
? ''
: isPublicKey(realmInfo.symbol)
? realmInfo.displayName
- : realmInfo.symbol
+ : realmInfo.symbol;
//@ts-ignore
- const fromNow = dayjs(postedAt.toNumber() * 1000).fromNow()
+ const fromNow = dayjs(postedAt.toNumber() * 1000).fromNow();
return (
@@ -71,7 +71,7 @@ const Comment = ({
{`${fmtTokenAmount(
getVoteWeight(voteRecord)!,
- proposalMint?.decimals
+ proposalMint?.decimals,
).toLocaleString()} ${voteSymbol}`}
@@ -79,7 +79,7 @@ const Comment = ({
{body.value}
- )
-}
+ );
+};
-export default Comment
+export default Comment;
diff --git a/components/chat/DiscussionForm.tsx b/components/chat/DiscussionForm.tsx
index ecc1b264ae..1cee7abd18 100644
--- a/components/chat/DiscussionForm.tsx
+++ b/components/chat/DiscussionForm.tsx
@@ -1,43 +1,43 @@
-import { useState } from 'react'
-import Button from '../Button'
-import Input from '../inputs/Input'
-import useWalletStore from '../../stores/useWalletStore'
-import useRealm from '../../hooks/useRealm'
-import { RpcContext } from '@solana/spl-governance'
-import { ChatMessageBody, ChatMessageBodyType } from '@solana/spl-governance'
-import { postChatMessage } from '../../actions/chat/postMessage'
-import Loading from '../Loading'
-import Tooltip from '@components/Tooltip'
-import { getProgramVersionForRealm } from '@models/registry/api'
-import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore'
+import { useState } from 'react';
+import Button from '../Button';
+import Input from '../inputs/Input';
+import useWalletStore from '../../stores/useWalletStore';
+import useRealm from '../../hooks/useRealm';
+import { RpcContext } from '@solana/spl-governance';
+import { ChatMessageBody, ChatMessageBodyType } from '@solana/spl-governance';
+import { postChatMessage } from '../../actions/chat/postMessage';
+import Loading from '../Loading';
+import Tooltip from '@components/Tooltip';
+import { getProgramVersionForRealm } from '@models/registry/api';
+import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore';
const DiscussionForm = () => {
- const [comment, setComment] = useState('')
- const connected = useWalletStore((s) => s.connected)
- const { ownVoterWeight, realmInfo, realm } = useRealm()
- const client = useVoteStakeRegistryClientStore((s) => s.state.client)
- const [submitting, setSubmitting] = useState(false)
+ const [comment, setComment] = useState('');
+ const connected = useWalletStore((s) => s.connected);
+ const { ownVoterWeight, realmInfo, realm } = useRealm();
+ const client = useVoteStakeRegistryClientStore((s) => s.state.client);
+ const [submitting, setSubmitting] = useState(false);
- const wallet = useWalletStore((s) => s.current)
- const connection = useWalletStore((s) => s.connection)
- const { proposal } = useWalletStore((s) => s.selectedProposal)
- const { fetchChatMessages } = useWalletStore((s) => s.actions)
+ const wallet = useWalletStore((s) => s.current);
+ const connection = useWalletStore((s) => s.connection);
+ const { proposal } = useWalletStore((s) => s.selectedProposal);
+ const { fetchChatMessages } = useWalletStore((s) => s.actions);
const submitComment = async () => {
- setSubmitting(true)
+ setSubmitting(true);
const rpcContext = new RpcContext(
proposal!.owner,
getProgramVersionForRealm(realmInfo!),
wallet!,
connection.current,
- connection.endpoint
- )
+ connection.endpoint,
+ );
const msg = new ChatMessageBody({
type: ChatMessageBodyType.Text,
value: comment,
- })
+ });
try {
await postChatMessage(
@@ -47,22 +47,22 @@ const DiscussionForm = () => {
ownVoterWeight.getTokenRecord(),
msg,
undefined,
- client
- )
+ client,
+ );
- setComment('')
+ setComment('');
} catch (ex) {
- console.error("Can't post chat message", ex)
+ console.error("Can't post chat message", ex);
//TODO: How do we present transaction errors to users? Just the notification?
} finally {
- setSubmitting(false)
+ setSubmitting(false);
}
- fetchChatMessages(proposal!.pubkey)
- }
+ fetchChatMessages(proposal!.pubkey);
+ };
const postEnabled =
- proposal && connected && ownVoterWeight.hasAnyWeight() && comment
+ proposal && connected && ownVoterWeight.hasAnyWeight() && comment;
const tooltipContent = !connected
? 'Connect your wallet to send a comment'
@@ -70,7 +70,7 @@ const DiscussionForm = () => {
? 'You need to have deposited some tokens to submit your comment.'
: !comment
? 'Write a comment to submit'
- : ''
+ : '';
return (
<>
@@ -93,7 +93,7 @@ const DiscussionForm = () => {
>
- )
-}
+ );
+};
-export default DiscussionForm
+export default DiscussionForm;
diff --git a/components/chat/DiscussionPanel.tsx b/components/chat/DiscussionPanel.tsx
index b732dbddfa..ed3c98d8a5 100644
--- a/components/chat/DiscussionPanel.tsx
+++ b/components/chat/DiscussionPanel.tsx
@@ -1,11 +1,11 @@
-import DiscussionForm from './DiscussionForm'
-import Comment from './Comment'
-import useWalletStore from '../../stores/useWalletStore'
+import DiscussionForm from './DiscussionForm';
+import Comment from './Comment';
+import useWalletStore from '../../stores/useWalletStore';
const DiscussionPanel = () => {
const { chatMessages, voteRecordsByVoter, proposalMint } = useWalletStore(
- (s) => s.selectedProposal
- )
+ (s) => s.selectedProposal,
+ );
return (
@@ -21,7 +21,7 @@ const DiscussionPanel = () => {
{Object.values(chatMessages)
.sort(
(m1, m2) =>
- m2.account.postedAt.toNumber() - m1.account.postedAt.toNumber()
+ m2.account.postedAt.toNumber() - m1.account.postedAt.toNumber(),
)
.map((cm) => (
{
/>
))}
- )
-}
+ );
+};
-export default DiscussionPanel
+export default DiscussionPanel;
diff --git a/components/explorer/inspectorButton.tsx b/components/explorer/inspectorButton.tsx
index c3499be97d..a85cd07f5b 100644
--- a/components/explorer/inspectorButton.tsx
+++ b/components/explorer/inspectorButton.tsx
@@ -1,39 +1,39 @@
-import { dryRunInstruction } from '../../actions/dryRunInstruction'
+import { dryRunInstruction } from '../../actions/dryRunInstruction';
import {
InstructionExecutionStatus,
ProgramAccount,
ProposalTransaction,
-} from '@solana/spl-governance'
-import useWalletStore from '../../stores/useWalletStore'
-import { getExplorerInspectorUrl, getExplorerUrl } from './tools'
-import { SecondaryButton } from '../Button'
-import { notify } from '@utils/notifications'
+} from '@solana/spl-governance';
+import useWalletStore from '../../stores/useWalletStore';
+import { getExplorerInspectorUrl, getExplorerUrl } from './tools';
+import { SecondaryButton } from '../Button';
+import { notify } from '@utils/notifications';
export default function InspectorButton({
proposalInstruction,
}: {
- proposalInstruction: ProgramAccount
+ proposalInstruction: ProgramAccount;
}) {
- const connection = useWalletStore((s) => s.connection)
- const wallet = useWalletStore((s) => s.current)
- const connected = useWalletStore((s) => s.connected)
+ const connection = useWalletStore((s) => s.connection);
+ const wallet = useWalletStore((s) => s.current);
+ const connected = useWalletStore((s) => s.connected);
const wasExecuted =
proposalInstruction.account.executionStatus ===
- InstructionExecutionStatus.Success
+ InstructionExecutionStatus.Success;
const showInspector = async () => {
- let inspectUrl = ''
+ let inspectUrl = '';
if (!wasExecuted) {
- const instructionData = proposalInstruction.account.getSingleInstruction()
+ const instructionData = proposalInstruction.account.getSingleInstruction();
const result = await dryRunInstruction(
connection.current,
wallet!,
- instructionData
- )
+ instructionData,
+ );
inspectUrl = getExplorerInspectorUrl(
connection.endpoint,
- result.transaction
- )
+ result.transaction,
+ );
} else {
try {
const recentActivity = await connection.current.getConfirmedSignaturesForAddress2(
@@ -41,23 +41,23 @@ export default function InspectorButton({
{
limit: 5,
},
- 'confirmed'
- )
+ 'confirmed',
+ );
inspectUrl = getExplorerUrl(
connection.endpoint,
recentActivity[0].signature,
- 'tx'
- )
+ 'tx',
+ );
} catch (e) {
- console.log(e)
+ console.error(e);
}
}
if (inspectUrl) {
- window.open(inspectUrl, '_blank')
+ window.open(inspectUrl, '_blank');
} else {
- notify({ type: 'error', message: 'Something went wrong url not found' })
+ notify({ type: 'error', message: 'Something went wrong url not found' });
}
- }
+ };
return (
{!wasExecuted ? 'Inspect' : 'View transaction'}
- )
+ );
}
diff --git a/components/explorer/tools.ts b/components/explorer/tools.ts
index dd0d6601e9..d1793cb5c9 100644
--- a/components/explorer/tools.ts
+++ b/components/explorer/tools.ts
@@ -1,43 +1,43 @@
-import { PublicKey, Transaction } from '@solana/web3.js'
-import base58 from 'bs58'
+import { PublicKey, Transaction } from '@solana/web3.js';
+import base58 from 'bs58';
export function getExplorerUrl(
endpoint: string,
viewTypeOrItemAddress: 'inspector' | PublicKey | string,
- itemType = 'address'
+ itemType = 'address',
) {
const getClusterUrlParam = () => {
- let cluster = ''
- if (endpoint === 'localnet') {
+ let cluster = '';
+ if (endpoint.includes('localnet')) {
cluster = `custom&customUrl=${encodeURIComponent(
- 'http://127.0.0.1:8899'
- )}`
- } else if (endpoint === 'https://api.devnet.solana.com') {
- cluster = 'devnet'
+ 'http://127.0.0.1:8899',
+ )}`;
+ } else if (endpoint.includes('devnet')) {
+ cluster = 'devnet';
}
- return cluster ? `?cluster=${cluster}` : ''
- }
+ return cluster ? `?cluster=${cluster}` : '';
+ };
- return `https://explorer.solana.com/${itemType}/${viewTypeOrItemAddress}${getClusterUrlParam()}`
+ return `https://explorer.solana.com/${itemType}/${viewTypeOrItemAddress}${getClusterUrlParam()}`;
}
/// Returns explorer inspector URL for the given transaction
export function getExplorerInspectorUrl(
endpoint: string,
- transaction: Transaction
+ transaction: Transaction,
) {
- const SIGNATURE_LENGTH = 64
+ const SIGNATURE_LENGTH = 64;
- const explorerUrl = new URL(getExplorerUrl(endpoint, 'inspector', 'tx'))
+ const explorerUrl = new URL(getExplorerUrl(endpoint, 'inspector', 'tx'));
const signatures = transaction.signatures.map((s) =>
- base58.encode(s.signature ?? Buffer.alloc(SIGNATURE_LENGTH))
- )
- explorerUrl.searchParams.append('signatures', JSON.stringify(signatures))
+ base58.encode(s.signature ?? Buffer.alloc(SIGNATURE_LENGTH)),
+ );
+ explorerUrl.searchParams.append('signatures', JSON.stringify(signatures));
- const message = transaction.serializeMessage()
- explorerUrl.searchParams.append('message', message.toString('base64'))
+ const message = transaction.serializeMessage();
+ explorerUrl.searchParams.append('message', message.toString('base64'));
- return explorerUrl.toString()
+ return explorerUrl.toString();
}
diff --git a/components/icons.jsx b/components/icons.jsx
index 4300a52988..37e48b8155 100644
--- a/components/icons.jsx
+++ b/components/icons.jsx
@@ -13,5 +13,5 @@ export const TwitterIcon = ({ className }) => {
>
- )
-}
+ );
+};
diff --git a/components/inputs/ErrorField.tsx b/components/inputs/ErrorField.tsx
index d29f604fa9..b91e26757c 100644
--- a/components/inputs/ErrorField.tsx
+++ b/components/inputs/ErrorField.tsx
@@ -1,9 +1,9 @@
-import { capitalize } from '@utils/helpers'
+import { capitalize } from '@utils/helpers';
const ErrorField = ({ text }) => {
return text ? (
{text ? capitalize(text) : text}
- ) : null
-}
+ ) : null;
+};
-export default ErrorField
+export default ErrorField;
diff --git a/components/inputs/Input.tsx b/components/inputs/Input.tsx
index 2aafd82fcb..5a9227eda4 100644
--- a/components/inputs/Input.tsx
+++ b/components/inputs/Input.tsx
@@ -1,16 +1,16 @@
-import { StyledLabel, StyledSuffix, inputClasses } from './styles'
-import ErrorField from './ErrorField'
-import { CheckCircleIcon } from '@heroicons/react/outline'
+import { StyledLabel, StyledSuffix, inputClasses } from './styles';
+import ErrorField from './ErrorField';
+import { CheckCircleIcon } from '@heroicons/react/outline';
interface InputProps {
- type: string
- value: any
- onChange?: (e) => void
- className?: string
- disabled?: boolean
- useDefaultStyle?: boolean
- [x: string]: any
- checkIcon?: boolean
+ type: string;
+ value: any;
+ onChange?: (e) => void;
+ className?: string;
+ disabled?: boolean;
+ useDefaultStyle?: boolean;
+ [x: string]: any;
+ checkIcon?: boolean;
}
const Input = ({
@@ -37,6 +37,7 @@ const Input = ({
return (
{label &&
{label}}
+
{subtitle &&
{subtitle}
}
{prefix ? (
- )
-}
+ );
+};
-export default Input
+export default Input;
diff --git a/components/inputs/InputNumberWithMaxButton.tsx b/components/inputs/InputNumberWithMaxButton.tsx
new file mode 100644
index 0000000000..bb4830a576
--- /dev/null
+++ b/components/inputs/InputNumberWithMaxButton.tsx
@@ -0,0 +1,51 @@
+import { ReactNode } from 'react-markdown/lib/react-markdown';
+import Input from './Input';
+
+const InputNumberWithMaxButton = ({
+ value = '',
+ label,
+ onChange,
+ className,
+ error = '',
+ disabled,
+ min,
+ max,
+}: {
+ value: ReactNode;
+ label: string;
+ onChange: (nb: number) => void;
+ className?: string;
+ error?: string;
+ disabled?: boolean;
+ min?: number;
+ max?: number;
+}) => {
+ return (
+
+
onChange(event.target.value)}
+ error={error}
+ type="number"
+ min={min}
+ max={max}
+ />
+
+ {typeof max !== 'undefined' ? (
+
{
+ onChange(max);
+ }}
+ >
+ Max: {max}
+
+ ) : null}
+
+ );
+};
+
+export default InputNumberWithMaxButton;
diff --git a/components/inputs/Select.tsx b/components/inputs/Select.tsx
index 7844ac6484..4eec786519 100644
--- a/components/inputs/Select.tsx
+++ b/components/inputs/Select.tsx
@@ -1,7 +1,7 @@
-import { Listbox } from '@headlessui/react'
-import { ChevronDownIcon } from '@heroicons/react/solid'
-import { StyledLabel, inputClasses } from './styles'
-import ErrorField from './ErrorField'
+import { Listbox } from '@headlessui/react';
+import { ChevronDownIcon } from '@heroicons/react/solid';
+import { StyledLabel, inputClasses } from './styles';
+import ErrorField from './ErrorField';
const Select = ({
value,
@@ -18,19 +18,19 @@ const Select = ({
wrapperClassNames = '',
minWidth = '',
}: {
- value: any | undefined
- onChange: any | undefined
- children: any | undefined
- className?: string | undefined
- placeholder?: string | undefined
- error?: string | undefined
- disabled?: boolean | undefined
- label?: string | undefined
- componentLabel?: any | undefined
- useDefaultStyle?: boolean
- noMaxWidth?: boolean
- wrapperClassNames?: string
- minWidth?: string
+ value: any | undefined;
+ onChange: any | undefined;
+ children: any | undefined;
+ className?: string | undefined;
+ placeholder?: string | undefined;
+ error?: string | undefined;
+ disabled?: boolean | undefined;
+ label?: string | undefined;
+ componentLabel?: any | undefined;
+ useDefaultStyle?: boolean;
+ noMaxWidth?: boolean;
+ wrapperClassNames?: string;
+ minWidth?: string;
}) => {
return (
@@ -48,16 +48,14 @@ const Select = ({
noMaxWidth,
})}
>
-
+
{componentLabel
? componentLabel
: value
? value
: placeholder}
@@ -79,8 +77,8 @@ const Select = ({
- )
-}
+ );
+};
const Option = ({ value, children, className = '' }) => {
return (
@@ -95,9 +93,9 @@ const Option = ({ value, children, className = '' }) => {
)}
- )
-}
+ );
+};
-Select.Option = Option
+Select.Option = Option;
-export default Select
+export default Select;
diff --git a/components/inputs/Textarea.tsx b/components/inputs/Textarea.tsx
index c925d4c27e..a7250edd23 100644
--- a/components/inputs/Textarea.tsx
+++ b/components/inputs/Textarea.tsx
@@ -1,13 +1,13 @@
-import { StyledLabel, StyledSuffix, inputClasses } from './styles'
-import ErrorField from './ErrorField'
+import { StyledLabel, StyledSuffix, inputClasses } from './styles';
+import ErrorField from './ErrorField';
interface TextareaProps {
- value: any
- onChange?: (e) => void
- className?: string
- disabled?: boolean
- useDefaultStyle?: boolean
- [x: string]: any
+ value: any;
+ onChange?: (e) => void;
+ className?: string;
+ disabled?: boolean;
+ useDefaultStyle?: boolean;
+ [x: string]: any;
}
const TextareaProps = ({
@@ -45,7 +45,7 @@ const TextareaProps = ({
- )
-}
+ );
+};
-export default TextareaProps
+export default TextareaProps;
diff --git a/components/inputs/styles.tsx b/components/inputs/styles.tsx
index 0c1ff220d0..3cec08361c 100644
--- a/components/inputs/styles.tsx
+++ b/components/inputs/styles.tsx
@@ -1,12 +1,12 @@
-import styled from '@emotion/styled'
-import tw from 'twin.macro'
+import styled from '@emotion/styled';
+import tw from 'twin.macro';
export const StyledLabel = styled.div`
${tw`mb-1.5 text-sm text-fgd-1`}
-`
+`;
export const StyledSuffix = styled.div`
${tw`absolute right-0 text-xs flex items-center pr-2 h-full bg-transparent text-fgd-4`}
-`
+`;
export const inputClasses = ({
className = '',
disabled,
@@ -15,13 +15,13 @@ export const inputClasses = ({
useDefaultStyle = true,
}) => {
const disabledStyle =
- 'cursor-not-allowed opacity-50 text-fgd-3 border bg-bkg-1 border-bkg-4'
+ 'cursor-not-allowed opacity-50 text-fgd-3 border bg-bkg-1 border-bkg-4';
const defaultStyle = `${
disabled
? disabledStyle
: 'hover:border-primary-light focus:border-primary-light focus:outline-none bg-bkg-1'
- } p-3 w-full border border-fgd-3 default-transition text-sm text-fgd-1 rounded-md ${className}`
+ } p-3 w-full border border-fgd-3 default-transition text-sm text-fgd-1 rounded-md ${className}`;
return `
${
@@ -31,5 +31,5 @@ export const inputClasses = ({
}
${!noMaxWidth && 'max-w-lg'}
${error ? 'border-red' : 'border-fgd-4'}
- `
-}
+ `;
+};
diff --git a/components/instructions/ExecuteAllInstructionButton.tsx b/components/instructions/ExecuteAllInstructionButton.tsx
index de9b588955..e8f3c6b562 100644
--- a/components/instructions/ExecuteAllInstructionButton.tsx
+++ b/components/instructions/ExecuteAllInstructionButton.tsx
@@ -1,21 +1,20 @@
-import React, { useEffect, useState } from 'react'
+import React, { useEffect, useState } from 'react';
import {
InstructionExecutionStatus,
ProgramAccount,
Proposal,
- ProposalState,
ProposalTransaction,
RpcContext,
-} from '@solana/spl-governance'
-import { PublicKey } from '@solana/web3.js'
-import { CheckCircleIcon, PlayIcon, RefreshIcon } from '@heroicons/react/solid'
-import Button from '@components/Button'
-import Tooltip from '@components/Tooltip'
-import useRealm from '@hooks/useRealm'
-import { getProgramVersionForRealm } from '@models/registry/api'
-import { executeInstructions } from 'actions/executeInstructions'
-import useWalletStore from 'stores/useWalletStore'
-import { notify } from '@utils/notifications'
+} from '@solana/spl-governance';
+import { PublicKey } from '@solana/web3.js';
+import { CheckCircleIcon, PlayIcon, RefreshIcon } from '@heroicons/react/solid';
+import Button from '@components/Button';
+import Tooltip from '@components/Tooltip';
+import useRealm from '@hooks/useRealm';
+import { getProgramVersionForRealm } from '@models/registry/api';
+import { executeInstructions } from 'actions/executeInstructions';
+import useWalletStore, { EnhancedProposalState } from 'stores/useWalletStore';
+import { notify } from '@utils/notifications';
export enum PlayState {
Played,
@@ -30,99 +29,103 @@ export function ExecuteAllInstructionButton({
setPlaying,
proposalInstructions,
}: {
- proposal: ProgramAccount
- proposalInstructions: ProgramAccount[]
- playing: PlayState
- setPlaying: React.Dispatch>
+ proposal: ProgramAccount;
+ proposalInstructions: ProgramAccount[];
+ playing: PlayState;
+ setPlaying: React.Dispatch>;
}) {
- const { realmInfo } = useRealm()
- const wallet = useWalletStore((s) => s.current)
- const connection = useWalletStore((s) => s.connection)
- const fetchRealm = useWalletStore((s) => s.actions.fetchRealm)
- const connected = useWalletStore((s) => s.connected)
+ const { realmInfo } = useRealm();
+ const wallet = useWalletStore((s) => s.current);
+ const connection = useWalletStore((s) => s.connection);
+ const fetchRealm = useWalletStore((s) => s.actions.fetchRealm);
+ const connected = useWalletStore((s) => s.connected);
- const [currentSlot, setCurrentSlot] = useState(0)
+ const [currentSlot, setCurrentSlot] = useState(0);
const canExecuteAt = proposal?.account.votingCompletedAt
? proposal.account.votingCompletedAt.toNumber() + 1
- : 0
+ : 0;
- const isPassedExecutionSlot = currentSlot - canExecuteAt >= 0
+ const isPassedExecutionSlot = currentSlot - canExecuteAt >= 0;
const rpcContext = new RpcContext(
new PublicKey(proposal.owner.toString()),
getProgramVersionForRealm(realmInfo!),
wallet!,
connection.current,
- connection.endpoint
- )
+ connection.endpoint,
+ );
// update the current slot every 5 seconds
// if current slot > slot available to execute the transaction
useEffect(() => {
if (isPassedExecutionSlot && proposal) {
const timer = setTimeout(() => {
- rpcContext.connection.getSlot().then(setCurrentSlot)
- }, 5000)
+ rpcContext.connection.getSlot().then(setCurrentSlot);
+ }, 5000);
return () => {
- clearTimeout(timer)
- }
+ clearTimeout(timer);
+ };
}
- }, [isPassedExecutionSlot, rpcContext.connection, currentSlot])
+ }, [isPassedExecutionSlot, rpcContext.connection, currentSlot]);
const onExecuteInstructions = async () => {
- setPlaying(PlayState.Playing)
+ setPlaying(PlayState.Playing);
try {
- await executeInstructions(rpcContext, proposal, proposalInstructions)
- await fetchRealm(realmInfo?.programId, realmInfo?.realmId)
+ await executeInstructions(rpcContext, proposal, proposalInstructions);
+ await fetchRealm(realmInfo?.programId, realmInfo?.realmId);
} catch (error) {
- notify({ type: 'error', message: `error executing instruction ${error}` })
- console.error('error executing instruction', error)
+ notify({
+ type: 'error',
+ message: `error executing instruction ${error}`,
+ });
+ console.error('error executing instruction', error);
- setPlaying(PlayState.Error)
+ setPlaying(PlayState.Error);
- return
+ return;
}
- setPlaying(PlayState.Played)
- }
+ setPlaying(PlayState.Played);
+ };
if (
![
- ProposalState.Executing,
- ProposalState.ExecutingWithErrors,
- ProposalState.Succeeded,
+ EnhancedProposalState.Executing,
+ EnhancedProposalState.ExecutingWithErrors,
+ EnhancedProposalState.Succeeded,
+ EnhancedProposalState.Outdated,
].includes(proposal.account.state)
) {
- return null
+ return null;
}
if (isPassedExecutionSlot) {
- return null
+ return null;
}
if (
playing === PlayState.Unplayed &&
proposalInstructions.every(
- (itx) => itx.account.executionStatus !== InstructionExecutionStatus.Error
+ (itx) => itx.account.executionStatus !== InstructionExecutionStatus.Error,
)
) {
return (
- )
+ );
}
if (playing === PlayState.Playing) {
- return
+ return ;
}
if (
playing === PlayState.Error ||
proposalInstructions.every(
- (itx) => itx.account.executionStatus !== InstructionExecutionStatus.Error
+ (itx) => itx.account.executionStatus !== InstructionExecutionStatus.Error,
)
) {
return (
@@ -132,8 +135,8 @@ export function ExecuteAllInstructionButton({
className="h-5 ml-2 text-orange w-5"
/>
- )
+ );
}
- return
+ return ;
}
diff --git a/components/instructions/ExecuteInstructionButton.tsx b/components/instructions/ExecuteInstructionButton.tsx
index c87b2acfc8..bccad8bd3e 100644
--- a/components/instructions/ExecuteInstructionButton.tsx
+++ b/components/instructions/ExecuteInstructionButton.tsx
@@ -1,22 +1,24 @@
-import { useEffect, useState } from 'react'
-import { executeTransaction } from 'actions/executeTransaction'
+import { useEffect, useState } from 'react';
+import { executeTransaction } from 'actions/executeTransaction';
import {
InstructionExecutionStatus,
- Proposal,
ProposalTransaction,
- ProposalState,
-} from '@solana/spl-governance'
-import React from 'react'
-import { CheckCircleIcon, PlayIcon, RefreshIcon } from '@heroicons/react/solid'
-import Button from '@components/Button'
-import { RpcContext } from '@solana/spl-governance'
-import useRealm from '@hooks/useRealm'
-import useWalletStore from 'stores/useWalletStore'
-import { ProgramAccount } from '@solana/spl-governance'
-import { PublicKey } from '@solana/web3.js'
-import Tooltip from '@components/Tooltip'
-import { getProgramVersionForRealm } from '@models/registry/api'
-import { notify } from '@utils/notifications'
+} from '@solana/spl-governance';
+import React from 'react';
+import { CheckCircleIcon, PlayIcon, RefreshIcon } from '@heroicons/react/solid';
+import Button from '@components/Button';
+import { RpcContext } from '@solana/spl-governance';
+import useRealm from '@hooks/useRealm';
+import useWalletStore, {
+ EnhancedProposal,
+ EnhancedProposalState,
+} from 'stores/useWalletStore';
+import { ProgramAccount } from '@solana/spl-governance';
+import { Keypair, PublicKey } from '@solana/web3.js';
+import Tooltip from '@components/Tooltip';
+import { getProgramVersionForRealm } from '@models/registry/api';
+import useTransactionSignature from '@hooks/useTransactionSignature';
+import { notify } from '@utils/notifications';
export enum PlayState {
Played,
@@ -30,85 +32,109 @@ export function ExecuteInstructionButton({
playing,
setPlaying,
proposalInstruction,
+ additionalSigner,
+ disabled,
}: {
- proposal: ProgramAccount
- proposalInstruction: ProgramAccount
- playing: PlayState
- setPlaying: React.Dispatch>
+ proposal: ProgramAccount;
+ proposalInstruction: ProgramAccount;
+ playing: PlayState;
+ additionalSigner?: Keypair;
+ setPlaying: React.Dispatch>;
+ disabled?: boolean;
}) {
- const { realmInfo } = useRealm()
- const wallet = useWalletStore((s) => s.current)
- const connection = useWalletStore((s) => s.connection)
- const fetchRealm = useWalletStore((s) => s.actions.fetchRealm)
- const connected = useWalletStore((s) => s.connected)
-
- const [currentSlot, setCurrentSlot] = useState(0)
-
+ const { realmInfo } = useRealm();
+ const wallet = useWalletStore((s) => s.current);
+ const connection = useWalletStore((s) => s.connection);
+ const fetchRealm = useWalletStore((s) => s.actions.fetchRealm);
+ const connected = useWalletStore((s) => s.connected);
+ const [currentSlot, setCurrentSlot] = useState(0);
+ const { transactionSignature } = useTransactionSignature(
+ proposalInstruction.pubkey,
+ );
const canExecuteAt = proposal?.account.votingCompletedAt
? proposal.account.votingCompletedAt.toNumber() + 1
- : 0
+ : 0;
- const ineligibleToSee = currentSlot - canExecuteAt >= 0
+ const ineligibleToSee = currentSlot - canExecuteAt >= 0;
const rpcContext = new RpcContext(
new PublicKey(proposal.owner.toString()),
getProgramVersionForRealm(realmInfo!),
wallet!,
connection.current,
- connection.endpoint
- )
+ connection.endpoint,
+ );
useEffect(() => {
if (ineligibleToSee && proposal) {
const timer = setTimeout(() => {
- rpcContext.connection.getSlot().then(setCurrentSlot)
- }, 5000)
+ rpcContext.connection.getSlot().then(setCurrentSlot);
+ }, 5000);
return () => {
- clearTimeout(timer)
- }
+ clearTimeout(timer);
+ };
}
- }, [ineligibleToSee, rpcContext.connection, currentSlot])
+ }, [ineligibleToSee, rpcContext.connection, currentSlot]);
const onExecuteInstruction = async () => {
- setPlaying(PlayState.Playing)
+ setPlaying(PlayState.Playing);
try {
- await executeTransaction(rpcContext, proposal, proposalInstruction)
- await fetchRealm(realmInfo?.programId, realmInfo?.realmId)
+ await executeTransaction(
+ rpcContext,
+ proposal,
+ proposalInstruction,
+ additionalSigner,
+ );
+ await fetchRealm(realmInfo?.programId, realmInfo?.realmId);
} catch (error) {
- notify({ type: 'error', message: `error executing instruction ${error}` })
- console.log('error executing instruction', error)
+ notify({
+ type: 'error',
+ message: `error executing instruction ${error}`,
+ });
+ console.error('error executing instruction', error);
- setPlaying(PlayState.Error)
+ setPlaying(PlayState.Error);
- return
+ return;
}
- setPlaying(PlayState.Played)
- }
-
+ setPlaying(PlayState.Played);
+ };
if (
proposalInstruction.account.executionStatus ===
InstructionExecutionStatus.Success
) {
return (
-
+ {transactionSignature ? (
+ e.stopPropagation()}
+ >
+
+
+ ) : (
+
+ )}
- )
+ );
}
if (
- proposal.account.state !== ProposalState.Executing &&
- proposal.account.state !== ProposalState.ExecutingWithErrors &&
- proposal.account.state !== ProposalState.Succeeded
+ proposal.account.state !== EnhancedProposalState.Executing &&
+ proposal.account.state !== EnhancedProposalState.ExecutingWithErrors &&
+ proposal.account.state !== EnhancedProposalState.Succeeded &&
+ proposal.account.state !== EnhancedProposalState.Outdated
) {
- return null
+ return null;
}
if (ineligibleToSee) {
- return null
+ return null;
}
if (
@@ -117,14 +143,18 @@ export function ExecuteInstructionButton({
InstructionExecutionStatus.Error
) {
return (
-
- )
+ );
}
diff --git a/components/instructions/instructionCard.tsx b/components/instructions/instructionCard.tsx
index f1cb0141ce..51e17869b0 100644
--- a/components/instructions/instructionCard.tsx
+++ b/components/instructions/instructionCard.tsx
@@ -1,114 +1,162 @@
-import { PublicKey } from '@solana/web3.js'
-import { ExternalLinkIcon } from '@heroicons/react/outline'
+import { Keypair, PublicKey } from '@solana/web3.js';
+import { ExternalLinkIcon } from '@heroicons/react/outline';
import {
AccountMetaData,
Proposal,
ProposalTransaction,
-} from '@solana/spl-governance'
+} from '@solana/spl-governance';
import {
getAccountName,
getInstructionDescriptor,
InstructionDescriptor,
WSOL_MINT,
-} from './tools'
-import React, { useEffect, useState } from 'react'
-import useWalletStore from '../../stores/useWalletStore'
-import { getExplorerUrl } from '../explorer/tools'
-import { getProgramName } from './programs/names'
-import { tryGetTokenAccount } from '@utils/tokens'
-import { ExecuteInstructionButton, PlayState } from './ExecuteInstructionButton'
-import { ProgramAccount } from '@solana/spl-governance'
-import InspectorButton from '@components/explorer/inspectorButton'
-import { FlagInstructionErrorButton } from './FlagInstructionErrorButton'
-import { Metadata } from '@metaplex-foundation/mpl-token-metadata'
-import axios from 'axios'
-import { notify } from '@utils/notifications'
-import useGovernanceAssets from '@hooks/useGovernanceAssets'
-import tokenService from '@utils/services/token'
+} from './tools';
+import React, { useEffect, useState } from 'react';
+import useWalletStore from '../../stores/useWalletStore';
+import { getExplorerUrl } from '../explorer/tools';
+import { getProgramName } from './programs/names';
+import { tryGetTokenAccount } from '@utils/tokens';
+import {
+ ExecuteInstructionButton,
+ PlayState,
+} from './ExecuteInstructionButton';
+import { ProgramAccount } from '@solana/spl-governance';
+import InspectorButton from '@components/explorer/inspectorButton';
+import { FlagInstructionErrorButton } from './FlagInstructionErrorButton';
+import { Metadata } from '@metaplex-foundation/mpl-token-metadata';
+import axios from 'axios';
+import { notify } from '@utils/notifications';
+import useGovernanceAssets from '@hooks/useGovernanceAssets';
+import tokenService from '@utils/services/token';
+import { OrcaConfiguration } from '@tools/sdk/orca/configuration';
+import SecretKeyInput from '@components/SecretKeyInput';
export default function InstructionCard({
index,
proposal,
proposalInstruction,
}: {
- index: number
- proposal: ProgramAccount
- proposalInstruction: ProgramAccount
+ index: number;
+ proposal: ProgramAccount;
+ proposalInstruction: ProgramAccount;
}) {
+ const [additionalSigner, setAdditionalSigner] = useState(
+ null,
+ );
const {
nftsGovernedTokenAccounts,
governedTokenAccountsWithoutNfts,
- } = useGovernanceAssets()
- const connection = useWalletStore((s) => s.connection)
- const tokenRecords = useWalletStore((s) => s.selectedRealm)
- const [descriptor, setDescriptor] = useState()
+ } = useGovernanceAssets();
+ const wallet = useWalletStore((s) => s.current);
+ const connection = useWalletStore((s) => s.connection);
+ const tokenRecords = useWalletStore((s) => s.selectedRealm);
+ const [descriptor, setDescriptor] = useState();
const [playing, setPlaying] = useState(
proposalInstruction.account.executedAt
? PlayState.Played
- : PlayState.Unplayed
- )
- const [nftImgUrl, setNftImgUrl] = useState('')
- const [tokenImgUrl, setTokenImgUrl] = useState('')
+ : PlayState.Unplayed,
+ );
+ const [nftImgUrl, setNftImgUrl] = useState('');
+ const [tokenImgUrl, setTokenImgUrl] = useState('');
+
useEffect(() => {
getInstructionDescriptor(
connection.current,
- proposalInstruction.account.getSingleInstruction()
- ).then((d) => setDescriptor(d))
+ proposalInstruction.account.getSingleInstruction(),
+ ).then((d) => setDescriptor(d));
+
const getAmountImg = async () => {
const sourcePk = proposalInstruction.account.getSingleInstruction()
- .accounts[0].pubkey
+ .accounts[0].pubkey;
const tokenAccount = await tryGetTokenAccount(
connection.current,
- sourcePk
- )
+ sourcePk,
+ );
const isSol = governedTokenAccountsWithoutNfts.find(
- (x) => x.transferAddress?.toBase58() === sourcePk.toBase58()
- )?.isSol
+ (x) => x.transferAddress?.toBase58() === sourcePk.toBase58(),
+ )?.isSol;
const isNFTAccount = nftsGovernedTokenAccounts.find(
(x) =>
x.governance?.pubkey.toBase58() ===
- tokenAccount?.account.owner.toBase58()
- )
+ tokenAccount?.account.owner.toBase58(),
+ );
if (isNFTAccount) {
- const mint = tokenAccount?.account.mint
+ const mint = tokenAccount?.account.mint;
if (mint) {
try {
- const metadataPDA = await Metadata.getPDA(mint)
+ const metadataPDA = await Metadata.getPDA(mint);
const tokenMetadata = await Metadata.load(
connection.current,
- metadataPDA
- )
- const url = (await axios.get(tokenMetadata.data.data.uri)).data
- setNftImgUrl(url.image)
+ metadataPDA,
+ );
+ const url = (await axios.get(tokenMetadata.data.data.uri)).data;
+ setNftImgUrl(url.image);
} catch (e) {
notify({
type: 'error',
message: 'Unable to fetch nft',
- })
+ });
}
}
- return
+ return;
}
if (isSol) {
- const info = tokenService.getTokenInfo(WSOL_MINT)
- const imgUrl = info?.logoURI ? info.logoURI : ''
- setTokenImgUrl(imgUrl)
- return
+ const info = tokenService.getTokenInfo(WSOL_MINT);
+ const imgUrl = info?.logoURI ? info.logoURI : '';
+ setTokenImgUrl(imgUrl);
+ return;
}
- const mint = tokenAccount?.account.mint
+ const mint = tokenAccount?.account.mint;
if (mint) {
- const info = tokenService.getTokenInfo(mint.toBase58())
- const imgUrl = info?.logoURI ? info.logoURI : ''
- setTokenImgUrl(imgUrl)
+ const info = tokenService.getTokenInfo(mint.toBase58());
+ const imgUrl = info?.logoURI ? info.logoURI : '';
+ setTokenImgUrl(imgUrl);
}
- return
+ return;
+ };
+ getAmountImg();
+ }, [proposalInstruction, governedTokenAccountsWithoutNfts.length]);
+ const isSol = tokenImgUrl.includes(WSOL_MINT);
+ const proposalAuthority = tokenRecords[proposal.owner.toBase58()];
+
+ const isInstructionAboutOrcaWhirlpoolOpenPosition = ((): boolean => {
+ if (!proposal) {
+ return false;
+ }
+
+ if (playing !== PlayState.Unplayed) {
+ return false;
+ }
+
+ if (
+ !proposalInstruction.account
+ .getSingleInstruction()
+ .programId.equals(OrcaConfiguration.WhirlpoolProgramId)
+ ) {
+ return false;
+ }
+
+ // Compare the first byte of the anchor discriminator
+ if (
+ Number(
+ proposalInstruction.account.getSingleInstruction().data.slice(0, 1),
+ ) !== OrcaConfiguration.instructionsCode.WhirlpoolOpenPositionWithMetadata
+ ) {
+ return false;
}
- getAmountImg()
- }, [proposalInstruction, governedTokenAccountsWithoutNfts.length])
- const isSol = tokenImgUrl.includes(WSOL_MINT)
- const proposalAuthority = tokenRecords[proposal.owner.toBase58()]
+ return true;
+ })();
+
+ // Say if the connected wallet is the payer of the open position instruction
+ const isPayerOfOrcaWhirlpoolOpenPositionIx =
+ isInstructionAboutOrcaWhirlpoolOpenPosition && wallet?.publicKey
+ ? proposalInstruction.account
+ .getSingleInstruction()
+ .accounts[0].pubkey.equals(wallet.publicKey)
+ : false;
+
return (
@@ -156,6 +204,28 @@ export default function InstructionCard({
) : (
)}
+
+ {
+ // In the very particular case it is about Orca Whirlpool Open Position Instruction
+ // We ask the users for the secret key of the position mint
+ isInstructionAboutOrcaWhirlpoolOpenPosition &&
+ isPayerOfOrcaWhirlpoolOpenPositionIx ? (
+
+
+ Provide the positionMint secret key shown during the
+ proposal creation.
+
+
+
+
+ ) : null
+ }
+
@@ -168,25 +238,29 @@ export default function InstructionCard({
{proposal && (
)}
- )
+ );
}
export function InstructionProgram({
endpoint,
programId,
}: {
- endpoint: string
- programId: PublicKey
+ endpoint: string;
+ programId: PublicKey;
}) {
- const programLabel = getProgramName(programId)
+ const programLabel = getProgramName(programId);
return (
Program
@@ -209,7 +283,7 @@ export function InstructionProgram({
/>
- )
+ );
}
export function InstructionAccount({
@@ -218,23 +292,23 @@ export function InstructionAccount({
accountMeta,
descriptor,
}: {
- endpoint: string
- index: number
- accountMeta: AccountMetaData
- descriptor: InstructionDescriptor | undefined
+ endpoint: string;
+ index: number;
+ accountMeta: AccountMetaData;
+ descriptor: InstructionDescriptor | undefined;
}) {
- const connection = useWalletStore((s) => s.connection)
+ const connection = useWalletStore((s) => s.connection);
const [accountLabel, setAccountLabel] = useState(
- getAccountName(accountMeta.pubkey)
- )
+ getAccountName(accountMeta.pubkey),
+ );
if (!accountLabel) {
// Check if the account is SPL token account and if yes then display its owner
tryGetTokenAccount(connection.current, accountMeta.pubkey).then((ta) => {
if (ta) {
- setAccountLabel(`owner: ${ta?.account.owner.toBase58()}`)
+ setAccountLabel(`owner: ${ta?.account.owner.toBase58()}`);
}
- })
+ });
// TODO: Extend to other well known account types
}
@@ -244,7 +318,9 @@ export function InstructionAccount({
{`Account ${index + 1}`}
{descriptor?.accounts && (
- {descriptor.accounts[index]?.name}
+ {typeof descriptor.accounts[index] === 'string'
+ ? descriptor.accounts[index]
+ : descriptor.accounts[index]?.name}
)}
@@ -267,13 +343,13 @@ export function InstructionAccount({
/>
- )
+ );
}
export function InstructionData({
descriptor,
}: {
- descriptor: InstructionDescriptor | undefined
+ descriptor: InstructionDescriptor | undefined;
}) {
return (
@@ -281,5 +357,5 @@ export function InstructionData({
{descriptor?.dataUI}
- )
+ );
}
diff --git a/components/instructions/instructionPanel.tsx b/components/instructions/instructionPanel.tsx
index a62d66ba66..bc8b7618fb 100644
--- a/components/instructions/instructionPanel.tsx
+++ b/components/instructions/instructionPanel.tsx
@@ -1,38 +1,38 @@
-import useProposal from '../../hooks/useProposal'
-import InstructionCard from './instructionCard'
-import { Disclosure } from '@headlessui/react'
-import { ChevronDownIcon } from '@heroicons/react/solid'
-import { useEffect, useRef, useState } from 'react'
-import useWalletStore from 'stores/useWalletStore'
-import { RpcContext } from '@solana/spl-governance'
-import useRealm from '@hooks/useRealm'
-import { getProgramVersionForRealm } from '@models/registry/api'
+import useProposal from '../../hooks/useProposal';
+import InstructionCard from './instructionCard';
+import { Disclosure } from '@headlessui/react';
+import { ChevronDownIcon } from '@heroicons/react/solid';
+import { useEffect, useRef, useState } from 'react';
+import useWalletStore from 'stores/useWalletStore';
+import { RpcContext } from '@solana/spl-governance';
+import useRealm from '@hooks/useRealm';
+import { getProgramVersionForRealm } from '@models/registry/api';
import {
ExecuteAllInstructionButton,
PlayState,
-} from './ExecuteAllInstructionButton'
+} from './ExecuteAllInstructionButton';
export function InstructionPanel() {
- const { instructions, proposal } = useProposal()
- const { realmInfo } = useRealm()
- const mounted = useRef(false)
+ const { instructions, proposal } = useProposal();
+ const { realmInfo } = useRealm();
+ const mounted = useRef(false);
useEffect(() => {
- mounted.current = true
+ mounted.current = true;
return () => {
- mounted.current = false
- }
- }, [])
- const wallet = useWalletStore((s) => s.current)
- const connection = useWalletStore((s) => s.connection)
+ mounted.current = false;
+ };
+ }, []);
+ const wallet = useWalletStore((s) => s.current);
+ const connection = useWalletStore((s) => s.connection);
- const [currentSlot, setCurrentSlot] = useState(0)
+ const [currentSlot, setCurrentSlot] = useState(0);
const canExecuteAt = proposal!.account.votingCompletedAt
? proposal!.account.votingCompletedAt.toNumber() + 1
- : 0
+ : 0;
- const ineligibleToSee = currentSlot - canExecuteAt >= 0
+ const ineligibleToSee = currentSlot - canExecuteAt >= 0;
useEffect(() => {
if (ineligibleToSee && proposal) {
@@ -41,34 +41,34 @@ export function InstructionPanel() {
getProgramVersionForRealm(realmInfo!),
wallet!,
connection.current,
- connection.endpoint
- )
+ connection.endpoint,
+ );
const timer = setTimeout(() => {
rpcContext.connection
.getSlot()
- .then((resp) => (mounted.current ? setCurrentSlot(resp) : null))
- }, 5000)
+ .then((resp) => (mounted.current ? setCurrentSlot(resp) : null));
+ }, 5000);
return () => {
- clearTimeout(timer)
- }
+ clearTimeout(timer);
+ };
}
- }, [ineligibleToSee, connection, currentSlot])
+ }, [ineligibleToSee, connection, currentSlot]);
if (Object.values(instructions).length === 0) {
- return null
+ return null;
}
const proposalInstructions = Object.values(instructions).sort(
- (i1, i2) => i1.account.instructionIndex - i2.account.instructionIndex
- )
+ (i1, i2) => i1.account.instructionIndex - i2.account.instructionIndex,
+ );
const [playing, setPlaying] = useState(
proposalInstructions.every((x) => x.account.executedAt)
? PlayState.Played
- : PlayState.Unplayed
- )
+ : PlayState.Unplayed,
+ );
return (
@@ -119,5 +119,5 @@ export function InstructionPanel() {
)}
- )
+ );
}
diff --git a/components/instructions/programs/associatedTokenAccount.tsx b/components/instructions/programs/associatedTokenAccount.tsx
index 7f9ec71ba7..35f7b6ae76 100644
--- a/components/instructions/programs/associatedTokenAccount.tsx
+++ b/components/instructions/programs/associatedTokenAccount.tsx
@@ -1,7 +1,7 @@
-import { Connection } from '@solana/web3.js'
-import { AccountMetaData } from '@solana/spl-governance'
-import { SPL_TOKENS } from '@utils/splTokens'
-import { SPL_ASSOCIATED_TOKEN_ACCOUNT_PROGRAM_ID } from '@utils/associated'
+import { Connection } from '@solana/web3.js';
+import { AccountMetaData } from '@solana/spl-governance';
+import { SPL_TOKENS } from '@utils/splTokens';
+import { SPL_ASSOCIATED_TOKEN_ACCOUNT_PROGRAM_ID } from '@utils/associated';
export const ATA_PROGRAM_INSTRUCTIONS = {
[SPL_ASSOCIATED_TOKEN_ACCOUNT_PROGRAM_ID.toBase58()]: {
@@ -15,16 +15,16 @@ export const ATA_PROGRAM_INSTRUCTIONS = {
getDataUI: (
_connection: Connection,
_data: Uint8Array,
- accounts: AccountMetaData[]
+ accounts: AccountMetaData[],
) => {
- const ata = accounts[1].pubkey.toString()
- const tokenMint = accounts[3].pubkey.toString()
+ const ata = accounts[1].pubkey.toString();
+ const tokenMint = accounts[3].pubkey.toString();
const tokenName =
SPL_TOKENS[
Object.keys(SPL_TOKENS).find(
- (name) => SPL_TOKENS[name].mint?.toString() === tokenMint
+ (name) => SPL_TOKENS[name].mint?.toString() === tokenMint,
)!
- ].name ?? 'unknown'
+ ].name ?? 'unknown';
return (
@@ -32,12 +32,13 @@ export const ATA_PROGRAM_INSTRUCTIONS = {
New Associated Token Amount Address:
{ata}
+
Token Name
{tokenName}
- )
+ );
},
},
-}
+};
diff --git a/components/instructions/programs/bpfUpgradeableLoader.tsx b/components/instructions/programs/bpfUpgradeableLoader.tsx
index a270f78fd1..252e439e69 100644
--- a/components/instructions/programs/bpfUpgradeableLoader.tsx
+++ b/components/instructions/programs/bpfUpgradeableLoader.tsx
@@ -8,7 +8,7 @@ export const BPF_UPGRADEABLE_LOADER_INSTRUCTIONS = {
{ name: 'Upgrade authority' },
],
getDataUI: () => {
- return
+ return ;
},
},
3: {
@@ -24,7 +24,7 @@ export const BPF_UPGRADEABLE_LOADER_INSTRUCTIONS = {
],
},
getDataUI: () => {
- return
+ return ;
},
},
-}
+};
diff --git a/components/instructions/programs/deltafi.tsx b/components/instructions/programs/deltafi.tsx
new file mode 100644
index 0000000000..becf7d8498
--- /dev/null
+++ b/components/instructions/programs/deltafi.tsx
@@ -0,0 +1,317 @@
+import { struct, u8, nu64 } from 'buffer-layout';
+import { AccountMetaData } from '@solana/spl-governance';
+import { Connection } from '@solana/web3.js';
+import { DeltafiDexV2 } from '@tools/sdk/deltafi/configuration';
+import { tryGetTokenMint } from '@utils/tokens';
+import { BN } from '@blockworks-foundation/mango-client';
+import { nativeAmountToFormattedUiAmount } from '@tools/sdk/units';
+import { ANCHOR_DISCRIMINATOR_LAYOUT } from '@utils/helpers';
+
+export const DELTAFI_PROGRAM_INSTRUCTIONS = {
+ [DeltafiDexV2.DeltafiProgramId.toBase58()]: {
+ [DeltafiDexV2.instructionsCode.WithdrawFromFarm]: {
+ name: 'Deltafi - Withdraw from Farm',
+ accounts: [
+ 'Market Config',
+ 'Swap Info',
+ 'Farm Info',
+ 'Liquidity Provider',
+ 'Farm User',
+ 'Owner',
+ ],
+ getDataUI: async (
+ _connection: Connection,
+ data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ nu64('baseAmount'),
+ nu64('quoteAmount'),
+ ]);
+
+ const { baseAmount, quoteAmount } = dataLayout.decode(
+ Buffer.from(data),
+ ) as any;
+
+ return (
+ <>
+ {`Native Base Amount: ${baseAmount.toString()}`}
+ {`Native Quote Amount: ${quoteAmount.toString()}`}
+ >
+ );
+ },
+ },
+ [DeltafiDexV2.instructionsCode.DepositToFarm]: {
+ name: 'Deltafi - Deposit to Farm',
+ accounts: [
+ 'Market Config',
+ 'Swap Info',
+ 'Farm Info',
+ 'Liquidity Provider',
+ 'Farm User',
+ 'Owner',
+ ],
+ getDataUI: async (
+ _connection: Connection,
+ data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ nu64('baseAmount'),
+ nu64('quoteAmount'),
+ ]);
+
+ const { baseAmount, quoteAmount } = dataLayout.decode(
+ Buffer.from(data),
+ ) as any;
+
+ return (
+ <>
+ {`Native Base Amount: ${baseAmount.toString()}`}
+ {`Native Quote Amount: ${quoteAmount.toString()}`}
+ >
+ );
+ },
+ },
+
+ [DeltafiDexV2.instructionsCode.CreateLiquidityProviderV2]: {
+ name: 'Deltafi - Create Liquidity Provider V2',
+ accounts: [
+ 'Market Config',
+ 'Swap Info',
+ 'Liquidity Provider',
+ 'Owner',
+ 'Payer',
+ 'System Program',
+ 'Rent',
+ ],
+ getDataUI: async (
+ _connection: Connection,
+ data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ u8('bump'),
+ ]);
+
+ const { bump } = dataLayout.decode(Buffer.from(data)) as any;
+
+ return {`Bump: ${bump.toString()}`}
;
+ },
+ },
+
+ [DeltafiDexV2.instructionsCode.CreateFarmUser]: {
+ name: 'Deltafi - Create Farm User V2',
+ accounts: [
+ 'Market Config',
+ 'Farm Info',
+ 'Farm User',
+ 'Owner',
+ 'Payer',
+ 'System Program',
+ 'Rent',
+ ],
+ getDataUI: async (
+ _connection: Connection,
+ _data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ return null;
+ },
+ },
+
+ [DeltafiDexV2.instructionsCode.CreateLiquidityProviderV2]: {
+ name: 'Deltafi - Create Liquidity Provider V2',
+ accounts: [
+ 'Market Config',
+ 'Swap Info',
+ 'Liquidity Provider',
+ 'Owner',
+ 'Payer',
+ 'System Program',
+ 'Rent',
+ ],
+ getDataUI: async (
+ _connection: Connection,
+ data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ u8('bump'),
+ ]);
+
+ const { bump } = dataLayout.decode(Buffer.from(data)) as any;
+
+ return {`Bump: ${bump.toString()}`}
;
+ },
+ },
+
+ [DeltafiDexV2.instructionsCode.WithdrawFromStableSwap]: {
+ name: 'Deltafi - Withdraw from Stable Swap',
+ accounts: [
+ 'Swap Info',
+ 'User Token Base',
+ 'User Token Quote',
+ 'Liquidity Provider',
+ 'Token Base',
+ 'Token Quote',
+ 'Pyth Price Base',
+ 'Pyth Price Quote',
+ 'Admin Fee Token Base',
+ 'Admin Fee Token Quote',
+ 'User Authority',
+ 'Token Program',
+ ],
+ getDataUI: async (
+ connection: Connection,
+ data: Uint8Array,
+ accounts: AccountMetaData[],
+ ) => {
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ nu64('baseShare'),
+ nu64('quoteShare'),
+ nu64('minBaseAmount'),
+ nu64('minQuoteAmount'),
+ ]);
+
+ const {
+ baseShare,
+ quoteShare,
+ minBaseAmount,
+ minQuoteAmount,
+ } = dataLayout.decode(Buffer.from(data)) as any;
+
+ const tokenBase = accounts[4].pubkey;
+ const tokenQuote = accounts[5].pubkey;
+
+ const [baseMint, quoteMint] = await Promise.all([
+ tryGetTokenMint(connection, tokenBase),
+ tryGetTokenMint(connection, tokenQuote),
+ ]);
+
+ if (!baseMint || !quoteMint) {
+ throw new Error('Mint not found');
+ }
+
+ const uiBaseShare = nativeAmountToFormattedUiAmount(
+ new BN(baseShare),
+ baseMint.account.decimals,
+ );
+
+ const uiQuoteShare = nativeAmountToFormattedUiAmount(
+ new BN(quoteShare),
+ quoteMint.account.decimals,
+ );
+
+ const uiMinBaseAmount = nativeAmountToFormattedUiAmount(
+ new BN(minBaseAmount),
+ baseMint.account.decimals,
+ );
+
+ const uiMinQuoteAmount = nativeAmountToFormattedUiAmount(
+ new BN(minQuoteAmount),
+ quoteMint.account.decimals,
+ );
+
+ return (
+ <>
+ {`UI Base Share: ${uiBaseShare}`}
+ {`UI Quote Share: ${uiQuoteShare}`}
+ {`UI Min Base Amount: ${uiMinBaseAmount}`}
+ {`UI Min Quote Amount: ${uiMinQuoteAmount}`}
+ >
+ );
+ },
+ },
+
+ [DeltafiDexV2.instructionsCode.DepositToStableSwap]: {
+ name: 'Deltafi - Deposit from Stable Swap',
+ accounts: [
+ 'Swap Info',
+ 'User Token Base',
+ 'User Token Quote',
+ 'Liquidity Provider',
+ 'Token Base',
+ 'Token Quote',
+ 'Pyth Price Base',
+ 'Pyth Price Quote',
+ 'Admin Fee Token Base',
+ 'Admin Fee Token Quote',
+ 'User Authority',
+ 'Token Program',
+ ],
+ getDataUI: async (
+ connection: Connection,
+ data: Uint8Array,
+ accounts: AccountMetaData[],
+ ) => {
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ nu64('baseAmount'),
+ nu64('quoteAmount'),
+ nu64('minBaseShare'),
+ nu64('minQuoteShare'),
+ ]);
+
+ const {
+ baseAmount,
+ quoteAmount,
+ minBaseShare,
+ minQuoteShare,
+ } = dataLayout.decode(Buffer.from(data)) as any;
+
+ const tokenBase = accounts[4].pubkey;
+ const tokenQuote = accounts[5].pubkey;
+
+ const [baseMint, quoteMint] = await Promise.all([
+ tryGetTokenMint(connection, tokenBase),
+ tryGetTokenMint(connection, tokenQuote),
+ ]);
+
+ if (!baseMint || !quoteMint) {
+ throw new Error('Mint not found');
+ }
+
+ const uiBaseAmount = nativeAmountToFormattedUiAmount(
+ new BN(baseAmount),
+ baseMint.account.decimals,
+ );
+
+ const uiQuoteAmount = nativeAmountToFormattedUiAmount(
+ new BN(quoteAmount),
+ quoteMint.account.decimals,
+ );
+
+ const uiMinBaseShare = nativeAmountToFormattedUiAmount(
+ new BN(minBaseShare),
+ baseMint.account.decimals,
+ );
+
+ const uiMinQuoteShare = nativeAmountToFormattedUiAmount(
+ new BN(minQuoteShare),
+ quoteMint.account.decimals,
+ );
+
+ return (
+ <>
+ {`UI Base Amount: ${uiBaseAmount}`}
+ {`UI Quote Amount: ${uiQuoteAmount}`}
+ {`UI Min Base Share: ${uiMinBaseShare}`}
+ {`UI Min Quote Share: ${uiMinQuoteShare}`}
+ >
+ );
+ },
+ },
+ },
+};
diff --git a/components/instructions/programs/friktion.tsx b/components/instructions/programs/friktion.tsx
new file mode 100644
index 0000000000..b600a5a414
--- /dev/null
+++ b/components/instructions/programs/friktion.tsx
@@ -0,0 +1,142 @@
+import { nu64, struct, u8 } from 'buffer-layout';
+import { BN } from '@project-serum/anchor';
+import { AccountMetaData } from '@solana/spl-governance';
+import { Connection } from '@solana/web3.js';
+import {
+ createLabel,
+ fetchVoltList,
+ FRIKTION_VOLT_PROGRAM,
+} from '@tools/sdk/friktion/friktion';
+import { nativeAmountToFormattedUiAmount } from '@tools/sdk/units';
+import { ANCHOR_DISCRIMINATOR_LAYOUT } from '@utils/helpers';
+
+export const FRIKTION_PROGRAM_INSTRUCTIONS = {
+ [FRIKTION_VOLT_PROGRAM]: {
+ 138: {
+ name: 'Friktion - Deposit With Claim',
+ accounts: [
+ 'Authority',
+ 'Dao Authority',
+ 'Sol Transfer Authority',
+ 'Authority Check',
+ 'Vault Mint',
+ 'Volt Vault',
+ 'Vault Authority',
+ 'Extra Volt Data',
+ 'Deposit Pool',
+ 'Writer Token Pool',
+ 'Vault Token Destination',
+ 'Underlying Token Source',
+ 'Round Info',
+ 'Round Underlying Tokens',
+ 'Pending Deposit Info',
+ 'Pending Deposit Round Info',
+ 'Pending Deposit Round Volt Tokens',
+ 'Pending Deposit Round Underlying Tokens',
+ 'Epoch Info',
+ 'System Program',
+ 'Token Program',
+ ],
+ getDataUI: async (
+ _connection: Connection,
+ data: Uint8Array,
+ accounts: AccountMetaData[],
+ ) => {
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ nu64('depositAmount'),
+ u8('doTransfer'),
+ ]);
+
+ const { depositAmount } = dataLayout.decode(Buffer.from(data)) as any;
+ const vaultId = accounts[5].pubkey;
+ const volt = (await fetchVoltList()).find(
+ (v) => v.voltVaultId === vaultId.toBase58(),
+ );
+ if (!volt) {
+ console.warn('volt not found with vaultId ', vaultId);
+ return;
+ }
+
+ return (
+ <>
+ {`Volt: ${createLabel(
+ volt.voltType,
+ volt.depositTokenSymbol,
+ volt.underlyingTokenSymbol,
+ )}`}
+ {`Deposit Token: ${volt.depositTokenSymbol}`}
+ {`Underlying Token: ${volt.underlyingTokenSymbol}`}
+ {`Amount to deposit: ${nativeAmountToFormattedUiAmount(
+ new BN(depositAmount),
+ volt.shareTokenDecimals,
+ )} ${volt.depositTokenSymbol}`}
+ >
+ );
+ },
+ },
+ 239: {
+ name: 'Friktion - Withdraw With Claim',
+ accounts: [
+ 'Authority',
+ 'Dao Authority',
+ 'Authority Check',
+ 'Vault Mint',
+ 'Volt Vault',
+ 'Vault Authority',
+ 'Extra Volt Data',
+ 'Deposit Pool',
+ 'Underlying Token Destination',
+ 'Vault Token Source',
+ 'Round Info',
+ 'Round Underlying Tokens',
+ 'Pending Withdrawal Info',
+ 'Pending Withdrawal Round Info',
+ 'Pending Withdrawal Round Underlying Tokens For Pws',
+ 'Epoch Info',
+ 'Fee Acct',
+ 'System Program',
+ 'Token Program',
+ 'Rent',
+ ],
+ getDataUI: async (
+ _connection: Connection,
+ data: Uint8Array,
+ accounts: AccountMetaData[],
+ ) => {
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ nu64('withdrawAmount'),
+ ]);
+
+ const { withdrawAmount } = dataLayout.decode(Buffer.from(data)) as any;
+ const vaultId = accounts[4].pubkey;
+ const volt = (await fetchVoltList()).find(
+ (v) => v.voltVaultId === vaultId.toBase58(),
+ );
+ if (!volt) {
+ console.warn('volt not found with vaultId ', vaultId);
+ return;
+ }
+
+ return (
+ <>
+ {`Volt: ${createLabel(
+ volt.voltType,
+ volt.depositTokenSymbol,
+ volt.underlyingTokenSymbol,
+ )}`}
+ {`Withdraw Token: ${volt.depositTokenSymbol}`}
+ {`Underlying Token: ${volt.underlyingTokenSymbol}`}
+ {`Amount to Withdraw: ${nativeAmountToFormattedUiAmount(
+ new BN(withdrawAmount),
+ volt.shareTokenDecimals,
+ )} ${volt.shareTokenSymbol}`}
+ >
+ );
+ },
+ },
+ },
+};
diff --git a/components/instructions/programs/governance.tsx b/components/instructions/programs/governance.tsx
index 3225a0dcb5..9826f0e886 100644
--- a/components/instructions/programs/governance.tsx
+++ b/components/instructions/programs/governance.tsx
@@ -7,17 +7,17 @@ import {
SetRealmAuthorityAction,
SetRealmAuthorityArgs,
VoteTipping,
-} from '@solana/spl-governance'
+} from '@solana/spl-governance';
import {
SetGovernanceConfigArgs,
SetRealmConfigArgs,
-} from '@solana/spl-governance'
-import { GOVERNANCE_SCHEMA } from '@solana/spl-governance'
-import { Connection } from '@solana/web3.js'
-import { fmtMintAmount, getDaysFromTimestamp } from '@tools/sdk/units'
-import { deserialize } from 'borsh'
+} from '@solana/spl-governance';
+import { GOVERNANCE_SCHEMA } from '@solana/spl-governance';
+import { Connection } from '@solana/web3.js';
+import { fmtMintAmount, getDaysFromTimestamp } from '@tools/sdk/units';
+import { deserialize } from 'borsh';
-import { tryGetMint } from '../../../utils/tokens'
+import { tryGetMint } from '../../../utils/tokens';
export const GOVERNANCE_INSTRUCTIONS = {
GovER5Lthms3bLBqWub97yVrMmEogzX7xNjdXpPPCVZw: {
@@ -27,23 +27,23 @@ export const GOVERNANCE_INSTRUCTIONS = {
getDataUI: async (
connection: Connection,
data: Uint8Array,
- accounts: AccountMetaData[]
+ accounts: AccountMetaData[],
) => {
const args = deserialize(
GOVERNANCE_SCHEMA,
SetGovernanceConfigArgs,
- Buffer.from(data)
- ) as SetGovernanceConfigArgs
+ Buffer.from(data),
+ ) as SetGovernanceConfigArgs;
- const governance = await getGovernance(connection, accounts[0].pubkey)
- const realm = await getRealm(connection, governance.account.realm)
+ const governance = await getGovernance(connection, accounts[0].pubkey);
+ const realm = await getRealm(connection, governance.account.realm);
const communityMint = await tryGetMint(
connection,
- realm.account.communityMint
- )
+ realm.account.communityMint,
+ );
const councilMint = realm.account.config.councilMint
? await tryGetMint(connection, realm.account.config.councilMint)
- : undefined
+ : undefined;
return (
<>
@@ -55,20 +55,20 @@ export const GOVERNANCE_INSTRUCTIONS = {
{`minCommunityTokensToCreateProposal:
${fmtMintAmount(
communityMint?.account,
- args.config.minCommunityTokensToCreateProposal
+ args.config.minCommunityTokensToCreateProposal,
)}`}
{`minCouncilTokensToCreateProposal:
${fmtMintAmount(
councilMint?.account,
- args.config.minCouncilTokensToCreateProposal
+ args.config.minCouncilTokensToCreateProposal,
)}`}
{`minInstructionHoldUpTime:
${getDaysFromTimestamp(
- args.config.minInstructionHoldUpTime
+ args.config.minInstructionHoldUpTime,
)} day(s)`}
@@ -84,7 +84,7 @@ export const GOVERNANCE_INSTRUCTIONS = {
${getDaysFromTimestamp(args.config.proposalCoolOffTime)} days(s)`}
>
- )
+ );
},
},
21: {
@@ -97,19 +97,19 @@ export const GOVERNANCE_INSTRUCTIONS = {
getDataUI: async (
connection: Connection,
data: Uint8Array,
- accounts: AccountMetaData[]
+ accounts: AccountMetaData[],
) => {
- const realm = await getRealm(connection, accounts[0].pubkey)
+ const realm = await getRealm(connection, accounts[0].pubkey);
const programVersion = await getGovernanceProgramVersion(
connection,
- realm.owner
- )
+ realm.owner,
+ );
const args = deserialize(
getGovernanceSchema(programVersion),
SetRealmAuthorityArgs,
- Buffer.from(data)
- ) as SetRealmAuthorityArgs
+ Buffer.from(data),
+ ) as SetRealmAuthorityArgs;
return (
<>
@@ -118,7 +118,7 @@ export const GOVERNANCE_INSTRUCTIONS = {
${SetRealmAuthorityAction[args.action!]}`}
>
- )
+ );
},
},
22: {
@@ -127,19 +127,19 @@ export const GOVERNANCE_INSTRUCTIONS = {
getDataUI: async (
connection: Connection,
data: Uint8Array,
- accounts: AccountMetaData[]
+ accounts: AccountMetaData[],
) => {
const args = deserialize(
GOVERNANCE_SCHEMA,
SetRealmConfigArgs,
- Buffer.from(data)
- ) as SetRealmConfigArgs
+ Buffer.from(data),
+ ) as SetRealmConfigArgs;
- const realm = await getRealm(connection, accounts[0].pubkey)
+ const realm = await getRealm(connection, accounts[0].pubkey);
const communityMint = await tryGetMint(
connection,
- realm.account.communityMint
- )
+ realm.account.communityMint,
+ );
return (
<>
@@ -147,7 +147,7 @@ export const GOVERNANCE_INSTRUCTIONS = {
{`minCommunityTokensToCreateGovernance:
${fmtMintAmount(
communityMint?.account,
- args.configArgs.minCommunityTokensToCreateGovernance
+ args.configArgs.minCommunityTokensToCreateGovernance,
)}`}
@@ -159,8 +159,8 @@ export const GOVERNANCE_INSTRUCTIONS = {
${args.configArgs.communityMintMaxVoteWeightSource.fmtSupplyFractionPercentage()}% supply`}
>
- )
+ );
},
},
},
-}
+};
diff --git a/components/instructions/programs/lifinity.tsx b/components/instructions/programs/lifinity.tsx
new file mode 100644
index 0000000000..848f162464
--- /dev/null
+++ b/components/instructions/programs/lifinity.tsx
@@ -0,0 +1,166 @@
+import { Connection } from '@solana/web3.js';
+import { nu64, struct, u8 } from 'buffer-layout';
+import { AccountMetaData } from '@solana/spl-governance';
+import {
+ AMM_PROGRAM_ADDR,
+ getPoolNameByPoolTokenMint,
+ InstructionsCodes,
+} from '@tools/sdk/lifinity/lifinity';
+import { tryGetMint, tryGetTokenMint } from '@utils/tokens';
+import { ANCHOR_DISCRIMINATOR_LAYOUT } from '@utils/helpers';
+import { nativeAmountToFormattedUiAmount } from '@tools/sdk/units';
+
+export const LIFINITY_PROGRAM_INSTRUCTIONS = {
+ [AMM_PROGRAM_ADDR.toBase58()]: {
+ [InstructionsCodes.DepositAllTokenTypes]: {
+ name: 'Lifinity - Deposit All Token Types',
+ accounts: [
+ 'Amm',
+ 'Authority',
+ 'User Transfer Authority',
+ 'Source A Info',
+ 'Source B Info',
+ 'Token A',
+ 'Token B',
+ 'Pool Mint',
+ 'Destination',
+ 'Token Program',
+ 'Config Account',
+ 'Holder Account Info',
+ 'Lifinity Nft Account',
+ 'Lifinity Nft MetaAccount',
+ ],
+ getDataUI: async (
+ connection: Connection,
+ data: Uint8Array,
+ accounts: AccountMetaData[],
+ ) => {
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ nu64('poolTokenAmount'),
+ nu64('maximumTokenAAmount'),
+ nu64('maximumTokenBAmount'),
+ ]);
+
+ const tokenAccountTokenA = accounts[5].pubkey;
+ const tokenAccountTokenB = accounts[6].pubkey;
+ const lpMint = accounts[7].pubkey;
+
+ const [mintInfoTokenA, mintInfoTokenB, lpMintInfo] = await Promise.all([
+ tryGetTokenMint(connection, tokenAccountTokenA),
+ tryGetTokenMint(connection, tokenAccountTokenB),
+ tryGetMint(connection, lpMint),
+ ]);
+
+ if (!mintInfoTokenA || !mintInfoTokenB || !lpMintInfo) {
+ throw new Error('could not load token infos');
+ }
+
+ const {
+ maximumTokenAAmount,
+ maximumTokenBAmount,
+ poolTokenAmount,
+ } = dataLayout.decode(Buffer.from(data)) as any;
+
+ const uiAmountTokenA = nativeAmountToFormattedUiAmount(
+ maximumTokenAAmount,
+ mintInfoTokenA.account.decimals,
+ );
+
+ const uiAmountTokenB = nativeAmountToFormattedUiAmount(
+ maximumTokenBAmount,
+ mintInfoTokenB.account.decimals,
+ );
+
+ const uiAmountTokenLP = nativeAmountToFormattedUiAmount(
+ poolTokenAmount,
+ lpMintInfo.account.decimals,
+ );
+
+ const poolLabel = getPoolNameByPoolTokenMint(lpMint);
+
+ return (
+ <>
+ {`Liquidity Pool: ${poolLabel}`}
+ {`Amount of Token A to deposit: ${uiAmountTokenA}`}
+ {`Max Amount of Token B to deposit: ${uiAmountTokenB}`}
+ {`LP Token to be minted: ${uiAmountTokenLP}`}
+ >
+ );
+ },
+ },
+ [InstructionsCodes.WithdrawAllTokenTypes]: {
+ name: 'Lifinity - Withdraw All Token Types',
+ accounts: [
+ 'Amm',
+ 'Authority',
+ 'User Transfer Authority',
+ 'Source',
+ 'Token A',
+ 'Token B',
+ 'Pool Mint',
+ 'Dest Token A Info',
+ 'Dest Token B Info',
+ 'Fee Account',
+ 'Token Program',
+ ],
+ getDataUI: async (
+ connection: Connection,
+ data: Uint8Array,
+ accounts: AccountMetaData[],
+ ) => {
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ nu64('poolTokenAmount'),
+ nu64('minimumTokenAAmount'),
+ nu64('minimumTokenBAmount'),
+ ]);
+
+ const tokenAccountTokenA = accounts[4].pubkey;
+ const tokenAccountTokenB = accounts[5].pubkey;
+ const lpMint = accounts[6].pubkey;
+
+ const [mintInfoTokenA, mintInfoTokenB, lpMintInfo] = await Promise.all([
+ tryGetTokenMint(connection, tokenAccountTokenA),
+ tryGetTokenMint(connection, tokenAccountTokenB),
+ tryGetMint(connection, lpMint),
+ ]);
+
+ if (!mintInfoTokenA || !mintInfoTokenB || !lpMintInfo) {
+ throw new Error('could not load token infos');
+ }
+
+ const {
+ minimumTokenAAmount,
+ minimumTokenBAmount,
+ poolTokenAmount,
+ } = dataLayout.decode(Buffer.from(data)) as any;
+
+ const uiAmountTokenA = nativeAmountToFormattedUiAmount(
+ minimumTokenAAmount,
+ mintInfoTokenA.account.decimals,
+ );
+
+ const uiAmountTokenB = nativeAmountToFormattedUiAmount(
+ minimumTokenBAmount,
+ mintInfoTokenB.account.decimals,
+ );
+
+ const uiAmountTokenLP = nativeAmountToFormattedUiAmount(
+ poolTokenAmount,
+ lpMintInfo.account.decimals,
+ );
+
+ return (
+ <>
+ {`Min Amount of Token A to withdraw: ${uiAmountTokenA}`}
+ {`Min Amount of Token B to withdraw: ${uiAmountTokenB}`}
+ {`LP Token to be redeemed: ${uiAmountTokenLP}`}
+ >
+ );
+ },
+ },
+ },
+};
diff --git a/components/instructions/programs/mango.tsx b/components/instructions/programs/mango.tsx
index 22acdc382d..011c0ec5d8 100644
--- a/components/instructions/programs/mango.tsx
+++ b/components/instructions/programs/mango.tsx
@@ -1,13 +1,13 @@
-import { Connection } from '@solana/web3.js'
-import { AccountMetaData } from '@solana/spl-governance'
-import { MangoInstructionLayout } from '@blockworks-foundation/mango-client'
+import { Connection } from '@solana/web3.js';
+import { AccountMetaData } from '@solana/spl-governance';
+import { MangoInstructionLayout } from '@blockworks-foundation/mango-client';
function displayInstructionArgument(decodedArgs, argName) {
return (
{argName}: {decodedArgs[argName].toString()}
- )
+ );
}
function displayOptionalInstructionArgument(decodedArgs, argName) {
@@ -15,30 +15,30 @@ function displayOptionalInstructionArgument(decodedArgs, argName) {
displayInstructionArgument(decodedArgs, argName)
) : (
<>>
- )
+ );
}
function displayAllArgs(decodedArgs, exceptions: any[] = []) {
const optionalArgs = Object.keys(decodedArgs)
.filter((k) => k.endsWith('Option'))
.map((k) => k.replace('Option', ''))
- .filter((k) => !exceptions.includes(k))
+ .filter((k) => !exceptions.includes(k));
const otherArgs = Object.keys(decodedArgs).filter(
(k) =>
!k.endsWith('Option') &&
!optionalArgs.includes(k) &&
- !exceptions.includes(k)
- )
+ !exceptions.includes(k),
+ );
return (
<>
{otherArgs.map((a) => displayInstructionArgument(decodedArgs, a))}
{optionalArgs.map((a) =>
- displayOptionalInstructionArgument(decodedArgs, a)
+ displayOptionalInstructionArgument(decodedArgs, a),
)}
>
- )
+ );
}
function displayOptionalDecimalArgument(decodedArgs, argName, decimals = 6) {
@@ -48,7 +48,7 @@ function displayOptionalDecimalArgument(decodedArgs, argName, decimals = 6) {
) : (
<>>
- )
+ );
}
function displayDecimalArgument(decodedArgs, argName, decimals = 6) {
@@ -58,7 +58,7 @@ function displayDecimalArgument(decodedArgs, argName, decimals = 6) {
) : (
<>>
- )
+ );
}
export const MANGO_INSTRUCTIONS = {
@@ -79,10 +79,11 @@ export const MANGO_INSTRUCTIONS = {
getDataUI: async (
_connection: Connection,
data: Uint8Array,
- _accounts: AccountMetaData[]
+ _accounts: AccountMetaData[],
) => {
- const args = MangoInstructionLayout.decode(Buffer.from(data), 0).Deposit
- return <>{displayAllArgs(args)}>
+ const args = MangoInstructionLayout.decode(Buffer.from(data), 0)
+ .Deposit;
+ return <>{displayAllArgs(args)}>;
},
},
4: {
@@ -97,11 +98,11 @@ export const MANGO_INSTRUCTIONS = {
getDataUI: async (
_connection: Connection,
data: Uint8Array,
- _accounts: AccountMetaData[]
+ _accounts: AccountMetaData[],
) => {
const args = MangoInstructionLayout.decode(Buffer.from(data), 0)
- .AddSpotMarket
- return <>{displayAllArgs(args)}>
+ .AddSpotMarket;
+ return <>{displayAllArgs(args)}>;
},
},
10: {
@@ -118,16 +119,16 @@ export const MANGO_INSTRUCTIONS = {
getDataUI: async (
_connection: Connection,
data: Uint8Array,
- _accounts: AccountMetaData[]
+ _accounts: AccountMetaData[],
) => {
const args = MangoInstructionLayout.decode(Buffer.from(data), 0)
- .AddPerpMarket
+ .AddPerpMarket;
return (
<>
{displayAllArgs(args, ['mngoPerPeriod'])}
{displayDecimalArgument(args, 'mngoPerPeriod')}
>
- )
+ );
},
},
37: {
@@ -139,16 +140,16 @@ export const MANGO_INSTRUCTIONS = {
getDataUI: (
_connection: Connection,
data: Uint8Array,
- _accounts: AccountMetaData[]
+ _accounts: AccountMetaData[],
) => {
const args = MangoInstructionLayout.decode(Buffer.from(data), 0)
- .ChangePerpMarketParams
+ .ChangePerpMarketParams;
return (
<>
{displayAllArgs(args, ['mngoPerPeriod'])}
{displayOptionalDecimalArgument(args, 'mngoPerPeriod')}
>
- )
+ );
},
},
46: {
@@ -164,16 +165,16 @@ export const MANGO_INSTRUCTIONS = {
getDataUI: async (
_connection: Connection,
data: Uint8Array,
- _accounts: AccountMetaData[]
+ _accounts: AccountMetaData[],
) => {
const args = MangoInstructionLayout.decode(Buffer.from(data), 0)
- .CreatePerpMarket
+ .CreatePerpMarket;
return (
<>
{displayAllArgs(args, ['mngoPerPeriod'])}
{displayDecimalArgument(args, 'mngoPerPeriod')}
>
- )
+ );
},
},
47: {
@@ -185,16 +186,16 @@ export const MANGO_INSTRUCTIONS = {
getDataUI: (
_connection: Connection,
data: Uint8Array,
- _accounts: AccountMetaData[]
+ _accounts: AccountMetaData[],
) => {
const args = MangoInstructionLayout.decode(Buffer.from(data), 0)
- .ChangePerpMarketParams2
+ .ChangePerpMarketParams2;
return (
<>
{displayAllArgs(args, ['mngoPerPeriod'])}
{displayOptionalDecimalArgument(args, 'mngoPerPeriod')}
>
- )
+ );
},
},
55: {
@@ -208,11 +209,11 @@ export const MANGO_INSTRUCTIONS = {
getDataUI: (
_connection: Connection,
data: Uint8Array,
- _accounts: AccountMetaData[]
+ _accounts: AccountMetaData[],
) => {
const args = MangoInstructionLayout.decode(Buffer.from(data), 0)
- .CreateMangoAccount
- return <>{displayAllArgs(args)}>
+ .CreateMangoAccount;
+ return <>{displayAllArgs(args)}>;
},
},
58: {
@@ -226,11 +227,11 @@ export const MANGO_INSTRUCTIONS = {
getDataUI: (
_connection: Connection,
data: Uint8Array,
- _accounts: AccountMetaData[]
+ _accounts: AccountMetaData[],
) => {
const args = MangoInstructionLayout.decode(Buffer.from(data), 0)
- .SetDelegate
- return <>{displayAllArgs(args)}>
+ .SetDelegate;
+ return <>{displayAllArgs(args)}>;
},
},
61: {
@@ -241,16 +242,16 @@ export const MANGO_INSTRUCTIONS = {
getDataUI: (
_connection: Connection,
data: Uint8Array,
- _accounts: AccountMetaData[]
+ _accounts: AccountMetaData[],
) => {
const args = MangoInstructionLayout.decode(Buffer.from(data), 0)
- .ChangeReferralFeeParams
- return <>{displayAllArgs(args)}>
+ .ChangeReferralFeeParams;
+ return <>{displayAllArgs(args)}>;
},
},
},
-}
+};
// also allow decoding of instructions for devnet versions of mango
MANGO_INSTRUCTIONS['4skJ85cdxQAFVKbcGgfun8iZPL7BadVYXG3kGEGkufqA'] =
- MANGO_INSTRUCTIONS['mv3ekLzLbnVPNxjSKvqBpU3ZeZXPQdEC3bp5MDEBG68']
+ MANGO_INSTRUCTIONS['mv3ekLzLbnVPNxjSKvqBpU3ZeZXPQdEC3bp5MDEBG68'];
diff --git a/components/instructions/programs/mapleFinance.tsx b/components/instructions/programs/mapleFinance.tsx
new file mode 100644
index 0000000000..542f4d9ca8
--- /dev/null
+++ b/components/instructions/programs/mapleFinance.tsx
@@ -0,0 +1,63 @@
+import { nu64, struct, u8 } from 'buffer-layout';
+import { AccountMetaData } from '@solana/spl-governance';
+import { Connection } from '@solana/web3.js';
+import { MapleFinance } from '@tools/sdk/mapleFinance/configuration';
+import { tryGetMint } from '@utils/tokens';
+import { ANCHOR_DISCRIMINATOR_LAYOUT } from '@utils/helpers';
+import { nativeAmountToFormattedUiAmount } from '@tools/sdk/units';
+
+export const MAPLE_FINANCE_PROGRAM_INSTRUCTIONS = {
+ [MapleFinance.SyrupProgramId.toBase58()]: {
+ [MapleFinance.syrupProgramInstructions.lenderDeposit]: {
+ name: 'Maple Finance - Lender Deposit',
+ accounts: [
+ 'Lender',
+ 'Lender User',
+ 'Pool',
+ 'Globals',
+ 'Base Mint',
+ 'Pool Locker',
+ 'Shares Mint',
+ 'Locked Shares',
+ 'Lender Shares',
+ 'Lender Locker',
+ 'System Program',
+ 'Token Program',
+ 'Rent',
+ ],
+ getDataUI: async (
+ connection: Connection,
+ data: Uint8Array,
+ accounts: AccountMetaData[],
+ ) => {
+ const baseMint = accounts[4].pubkey;
+
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ nu64('depositAmount'),
+ ]);
+
+ const { depositAmount } = dataLayout.decode(Buffer.from(data)) as any;
+
+ const mintInfo = await tryGetMint(connection, baseMint);
+
+ if (!mintInfo) throw new Error('Cannot load mint info');
+
+ const uiAmount = nativeAmountToFormattedUiAmount(
+ depositAmount,
+ mintInfo.account.decimals,
+ );
+
+ return (
+
+
+ Ui amount to deposit:
+ {uiAmount}
+
+
+ );
+ },
+ },
+ },
+};
diff --git a/components/instructions/programs/marinade.tsx b/components/instructions/programs/marinade.tsx
index a7f3ba9cf4..eb3447d516 100644
--- a/components/instructions/programs/marinade.tsx
+++ b/components/instructions/programs/marinade.tsx
@@ -1,9 +1,9 @@
-import { BN } from '@project-serum/anchor'
-import { Connection, PublicKey } from '@solana/web3.js'
-import { getMintDecimalAmountFromNatural } from '@tools/sdk/units'
-import { tryGetMint } from '@utils/tokens'
-import { WSOL_MINT } from '../tools'
-import BufferLayout from 'buffer-layout'
+import { BN } from '@project-serum/anchor';
+import { Connection, PublicKey } from '@solana/web3.js';
+import { getMintDecimalAmountFromNatural } from '@tools/sdk/units';
+import { tryGetMint } from '@utils/tokens';
+import { WSOL_MINT } from '../tools';
+import BufferLayout from 'buffer-layout';
export const MARINADE_INSTRUCTIONS = {
MarBmsSgKXdrN1egZf5sqe1TMai9K1rChYNDJgjq7aD: {
@@ -21,19 +21,20 @@ export const MARINADE_INSTRUCTIONS = {
{ name: 'mSOL Mint Authority' },
],
getDataUI: async (connection: Connection, data: Uint8Array) => {
- const tokenMint = await tryGetMint(connection, new PublicKey(WSOL_MINT))
+ const tokenMint = await tryGetMint(
+ connection,
+ new PublicKey(WSOL_MINT),
+ );
//@ts-ignore
const { lamports } = BufferLayout.struct([
BufferLayout.nu64('lamports'),
- ]).decode(Buffer.from(data), 8)
+ ]).decode(Buffer.from(data), 8);
- console.log(lamports)
-
- const rawAmount = new BN(lamports)
+ const rawAmount = new BN(lamports);
const tokenAmount = tokenMint
? getMintDecimalAmountFromNatural(tokenMint.account, rawAmount)
- : rawAmount
+ : rawAmount;
return (
<>
@@ -50,8 +51,8 @@ export const MARINADE_INSTRUCTIONS = {
{JSON.stringify(data)}
)}
>
- )
+ );
},
},
},
-}
+};
diff --git a/components/instructions/programs/names.ts b/components/instructions/programs/names.ts
index 2779ab107f..c4041ae1f1 100644
--- a/components/instructions/programs/names.ts
+++ b/components/instructions/programs/names.ts
@@ -1,4 +1,4 @@
-import { PublicKey } from '@solana/web3.js'
+import { PublicKey } from '@solana/web3.js';
export const GOVERNANCE_PROGRAM_NAMES = {
GqTPL6qRf5aUuqscLh8Rg2HTxPUXfhhAXDptTLhp1t2J: 'Mango Governance Program',
@@ -8,7 +8,7 @@ export const GOVERNANCE_PROGRAM_NAMES = {
'Phantasia Governance Program',
smfjietFKFJ4Sbw1cqESBTpPhF4CwbMwN8kBEC1e5ui:
'Strangemood Foundation Governance Program',
-}
+};
// Well known program names displayed on the instruction card
export const PROGRAM_NAMES = {
@@ -23,6 +23,9 @@ export const PROGRAM_NAMES = {
'675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8': 'Raydium AMM Program',
EhhTKczWMGQt46ynNeRX1WfeagwwJd7ufHvCDjRxjo5Q: 'Raydium Staking Program',
+ UXD8m9cvwk4RcSxnX2HZ9VudQCEeDH6fRnB4CAP57Dr: 'UXD Protocol Program',
+ UXDBdZFw33TgoKPQK2sXDCLfNrdio2gUzLs1yHePfMj: 'UXD IDO Program',
+ UXDSkps5NR8Lu1HB5uPLFfuB34hZ6DCk7RhYZZtGzbF: 'UXD Staking Program',
MarBmsSgKXdrN1egZf5sqe1TMai9K1rChYNDJgjq7aD: 'Marinade Staking Program',
SysvarRent111111111111111111111111111111111: 'Sysvar: Rent',
@@ -30,12 +33,12 @@ export const PROGRAM_NAMES = {
'4Q6WW2ouZ6V3iaNm56MTd5n2tnTm4C5fiH8miFHnAFHo':
'Mango Voter Stake Registry Program',
...GOVERNANCE_PROGRAM_NAMES,
-}
+};
export function getProgramName(programId: PublicKey) {
- return PROGRAM_NAMES[programId.toBase58()]
+ return PROGRAM_NAMES[programId.toBase58()];
}
export function isGovernanceProgram(programId: PublicKey) {
- return GOVERNANCE_PROGRAM_NAMES[programId.toBase58()]
+ return GOVERNANCE_PROGRAM_NAMES[programId.toBase58()];
}
diff --git a/components/instructions/programs/orca.tsx b/components/instructions/programs/orca.tsx
new file mode 100644
index 0000000000..83125c5525
--- /dev/null
+++ b/components/instructions/programs/orca.tsx
@@ -0,0 +1,353 @@
+import { AccountMetaData } from '@solana/spl-governance';
+import { Connection, Keypair } from '@solana/web3.js';
+import { OrcaConfiguration } from '@tools/sdk/orca/configuration';
+import { ANCHOR_DISCRIMINATOR_LAYOUT } from '@utils/helpers';
+import { struct, u8, nu64 } from 'buffer-layout';
+import { u128, bool } from '@project-serum/borsh';
+import {
+ buildWhirlpoolClient,
+ WhirlpoolContext,
+} from '@orca-so/whirlpools-sdk';
+
+// target the same wallet as orca
+import { Wallet } from '@project-serum/anchor/dist/cjs/provider';
+import { nativeBNToUiAmount } from '@tools/sdk/units';
+import { getSplTokenNameByMint } from '@utils/splTokens';
+import { WhirlpoolImpl } from '@orca-so/whirlpools-sdk/dist/impl/whirlpool-impl';
+
+function buildLocalWhirlpoolClient(connection: Connection) {
+ return buildWhirlpoolClient(
+ WhirlpoolContext.from(
+ connection,
+
+ // No need for wallet for what we are doing with the client
+ // Generate a new keypair to satisfy WhirlpoolContext.from()
+ (Keypair.generate() as unknown) as Wallet,
+
+ OrcaConfiguration.WhirlpoolProgramId,
+ ),
+ );
+}
+
+export const ORCA_PROGRAM_INSTRUCTIONS = {
+ [OrcaConfiguration.WhirlpoolProgramId.toBase58()]: {
+ [OrcaConfiguration.instructionsCode.WhirlpoolOpenPositionWithMetadata]: {
+ name: 'Orca - Whirlpool Open Position with Metadata',
+ accounts: [
+ 'Payer',
+ 'Authority',
+ 'Position',
+ 'Position Mint',
+ 'Position Metadata Account',
+ 'Position Token Account',
+ 'Whirlpool',
+ 'Token Program',
+ 'System Program',
+ 'Rent',
+ 'Associated Token Program',
+ 'Metadata Program',
+ 'Metadata Update Auth',
+ ],
+ getDataUI: async (
+ connection: Connection,
+ _data: Uint8Array,
+ accounts: AccountMetaData[],
+ ) => {
+ const whirlpoolAddress = accounts[6].pubkey;
+ const whirlpoolClient = buildLocalWhirlpoolClient(connection);
+ const whirlpool = (await whirlpoolClient.getPool(
+ whirlpoolAddress,
+ )) as WhirlpoolImpl;
+
+ if (!whirlpool) {
+ throw new Error(
+ `Cannot load whirlpool ${whirlpoolAddress.toBase58()} data`,
+ );
+ }
+
+ const tokenAName = getSplTokenNameByMint(whirlpool.tokenAInfo.mint);
+ const tokenBName = getSplTokenNameByMint(whirlpool.tokenBInfo.mint);
+
+ return (
+ <>
+
+ Whirlpool {tokenAName} - {tokenBName}
+
+ >
+ );
+ },
+ },
+
+ [OrcaConfiguration.instructionsCode.WhirlpoolIncreaseLiquidity]: {
+ name: 'Orca - Whirlpool Increase Liquidity',
+ accounts: [
+ 'Whirlpool',
+ 'Token Program',
+ 'Position Authority',
+ 'Position',
+ 'Position Token Account',
+ 'Token Owner Account A',
+ 'Token Owner Account B',
+ 'Token Vault A',
+ 'Token Vault B',
+ 'Tick Array Lower',
+ 'Tick Array Upper',
+ ],
+ getDataUI: async (
+ connection: Connection,
+ data: Uint8Array,
+ accounts: AccountMetaData[],
+ ) => {
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ u128('liquidityAmount'),
+ nu64('tokenMaxA'),
+ nu64('tokenMaxB'),
+ ]);
+
+ const { liquidityAmount, tokenMaxA, tokenMaxB } = dataLayout.decode(
+ Buffer.from(data),
+ ) as any;
+
+ const whirlpoolAddress = accounts[0].pubkey;
+ const whirlpoolClient = buildLocalWhirlpoolClient(connection);
+ const whirlpool = (await whirlpoolClient.getPool(
+ whirlpoolAddress,
+ )) as WhirlpoolImpl;
+
+ if (!whirlpool) {
+ throw new Error(
+ `Cannot load whirlpool ${whirlpoolAddress.toBase58()} data`,
+ );
+ }
+
+ const tokenAName = getSplTokenNameByMint(whirlpool.tokenAInfo.mint);
+ const tokenBName = getSplTokenNameByMint(whirlpool.tokenBInfo.mint);
+
+ const uiTokenMaxA = nativeBNToUiAmount(
+ tokenMaxA,
+ whirlpool.tokenAInfo.decimals,
+ );
+ const uiTokenMaxB = nativeBNToUiAmount(
+ tokenMaxB,
+ whirlpool.tokenBInfo.decimals,
+ );
+
+ return (
+ <>
+
+ Whirlpool {tokenAName} - {tokenBName}
+
+ {`Native Liquidity Amount: ${Number(
+ liquidityAmount.toString(),
+ ).toLocaleString()}`}
+ {`Max ${tokenAName}: ${uiTokenMaxA.toLocaleString()}`}
+ {`Max ${tokenBName}: ${uiTokenMaxB.toLocaleString()}`}
+ >
+ );
+ },
+ },
+
+ [OrcaConfiguration.instructionsCode.WhirlpoolUpdateFeesAndRewards]: {
+ name: 'Orca - Whirlpool Update Fees and Rewards',
+ accounts: [
+ 'Whirlpool',
+ 'Position',
+ 'Tick Array Lower',
+ 'Tick Array Upper',
+ ],
+ getDataUI: async (
+ _connection: Connection,
+ _data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ // No useful data to display. Do not use null to avoid having the bytes displayed
+ return <>>;
+ },
+ },
+
+ [OrcaConfiguration.instructionsCode.WhirlpoolCollectFees]: {
+ name: 'Orca - Whirlpool Collect Fees',
+ accounts: [
+ 'Whirlpool',
+ 'Position Authority',
+ 'Position',
+ 'Position Token Account',
+ 'Token Owner Account A',
+ 'Token Vault A',
+ 'Token Owner Account B',
+ 'Token Vault B',
+ 'Token Program',
+ ],
+ getDataUI: async (
+ _connection: Connection,
+ _data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ // No useful data to display. Do not use null to avoid having the bytes displayed
+ return <>>;
+ },
+ },
+
+ [OrcaConfiguration.instructionsCode.WhirlpoolDecreaseLiquidity]: {
+ name: 'Orca - Whirlpool Decrease Liquidity',
+ accounts: [
+ 'Whirlpool',
+ 'Token Program',
+ 'Position Authority',
+ 'Position',
+ 'Position Token Account',
+ 'Token Owner Account A',
+ 'Token Owner Account B',
+ 'Token Vault A',
+ 'Token Vault B',
+ 'Tick Array Lower',
+ 'Tick Array Upper',
+ ],
+ getDataUI: async (
+ connection: Connection,
+ data: Uint8Array,
+ accounts: AccountMetaData[],
+ ) => {
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ u128('liquidityAmount'),
+ nu64('tokenMinA'),
+ nu64('tokenMinB'),
+ ]);
+
+ const { liquidityAmount, tokenMinA, tokenMinB } = dataLayout.decode(
+ Buffer.from(data),
+ ) as any;
+
+ const whirlpoolAddress = accounts[0].pubkey;
+ const whirlpoolClient = buildLocalWhirlpoolClient(connection);
+ const whirlpool = (await whirlpoolClient.getPool(
+ whirlpoolAddress,
+ )) as WhirlpoolImpl;
+
+ if (!whirlpool) {
+ throw new Error(
+ `Cannot load whirlpool ${whirlpoolAddress.toBase58()} data`,
+ );
+ }
+
+ const tokenAName = getSplTokenNameByMint(whirlpool.tokenAInfo.mint);
+ const tokenBName = getSplTokenNameByMint(whirlpool.tokenBInfo.mint);
+
+ const uiTokenMinA = nativeBNToUiAmount(
+ tokenMinA,
+ whirlpool.tokenAInfo.decimals,
+ );
+ const uiTokenMinB = nativeBNToUiAmount(
+ tokenMinB,
+ whirlpool.tokenBInfo.decimals,
+ );
+
+ return (
+ <>
+
+ Whirlpool {tokenAName} - {tokenBName}
+
+ {`Native Liquidity Amount: ${Number(
+ liquidityAmount.toString(),
+ ).toLocaleString()}`}
+ {`Min ${tokenAName}: ${uiTokenMinA.toLocaleString()}`}
+ {`Min ${tokenBName}: ${uiTokenMinB.toLocaleString()}`}
+ >
+ );
+ },
+ },
+
+ [OrcaConfiguration.instructionsCode.WhirlpoolClosePosition]: {
+ name: 'Orca - Whirlpool Close Position',
+ accounts: [
+ 'Position Authority',
+ 'Receiver',
+ 'Position',
+ 'Position Mint',
+ 'Position Token Account',
+ 'Token Program',
+ ],
+ getDataUI: async (
+ _connection: Connection,
+ _data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ // No useful data to display. Do not use null to avoid having the bytes displayed
+ return <>>;
+ },
+ },
+ [OrcaConfiguration.instructionsCode.WhirlpoolSwap]: {
+ name: 'Orca - Whirlpool Swap',
+ accounts: [
+ 'Token Program',
+ 'Token Authority',
+ 'Whirlpool',
+ 'Token Owner Account A',
+ 'Token Vault A',
+ 'Token Owner Account B',
+ 'Token Vault B',
+ 'Tick Array 0',
+ 'Tick Array 1',
+ 'Tick Array 2',
+ 'Oracle',
+ ],
+ getDataUI: async (
+ connection: Connection,
+ data: Uint8Array,
+ accounts: AccountMetaData[],
+ ) => {
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ nu64('amount'),
+ nu64('otherAmountThreshold'),
+ u128('sqrtPriceLimit'),
+ bool('amountSpecifiedIsInput'),
+ bool('AtoB'),
+ ]);
+
+ const whirlpoolAddress = accounts[2].pubkey;
+ const whirlpoolClient = buildLocalWhirlpoolClient(connection);
+ const whirlpool = (await whirlpoolClient.getPool(
+ whirlpoolAddress,
+ )) as WhirlpoolImpl;
+
+ if (!whirlpool) {
+ throw new Error(
+ `Cannot load whirlpool ${whirlpoolAddress.toBase58()} data`,
+ );
+ }
+
+ const tokenAName = getSplTokenNameByMint(whirlpool.tokenAInfo.mint);
+ const tokenBName = getSplTokenNameByMint(whirlpool.tokenBInfo.mint);
+
+ const {
+ amount,
+ otherAmountThreshold,
+ sqrtPriceLimit,
+ amountSpecifiedIsInput,
+ AtoB,
+ } = dataLayout.decode(Buffer.from(data)) as any;
+
+ return (
+ <>
+
+ Whirlpool {tokenAName} - {tokenBName}
+
+ {`Native Amount: ${Number(
+ amount.toString(),
+ ).toLocaleString()}`}
+ {`Other Amount Threshold: ${otherAmountThreshold.toLocaleString()}`}
+ {`Sqrt Price Limit: ${sqrtPriceLimit.toLocaleString()}`}
+ {`Amount Specified is Input: ${amountSpecifiedIsInput.toString()}`}
+ {`A to B: ${AtoB.toString()}`}
+ >
+ );
+ },
+ },
+ },
+};
diff --git a/components/instructions/programs/quarry.tsx b/components/instructions/programs/quarry.tsx
new file mode 100644
index 0000000000..9d319a4cb7
--- /dev/null
+++ b/components/instructions/programs/quarry.tsx
@@ -0,0 +1,152 @@
+import { nu64, struct, u8 } from 'buffer-layout';
+import { AccountMetaData } from '@solana/spl-governance';
+import { Connection } from '@solana/web3.js';
+import quarryMineConfiguration from '@tools/sdk/quarryMine/configuration';
+import { tryGetTokenMint } from '@utils/tokens';
+import { ANCHOR_DISCRIMINATOR_LAYOUT } from '@utils/helpers';
+import { nativeAmountToFormattedUiAmount } from '@tools/sdk/units';
+
+export const QUARRY_MINE_PROGRAM_INSTRUCTIONS = {
+ [quarryMineConfiguration.quarryMineProgram.toBase58()]: {
+ [quarryMineConfiguration.quarryMineProgramInstructions.createMiner]: {
+ name: 'Quarry Mine - Create Miner',
+ accounts: [
+ 'Authority',
+ 'Miner',
+ 'Quarry',
+ 'Rewarder',
+ 'System Program',
+ 'Payer',
+ 'Token Mint',
+ 'Miner Vault',
+ 'Token Program',
+ ],
+ getDataUI: (
+ _connection: Connection,
+ _data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ return null;
+ },
+ },
+
+ [quarryMineConfiguration.quarryMineProgramInstructions.stakeTokens]: {
+ name: 'Quarry Mine - Stake Tokens',
+ accounts: [
+ 'Authority',
+ 'Miner',
+ 'Quarry',
+ 'Miner Vault',
+ 'Token Account',
+ 'Token Program',
+ 'Rewarder',
+ ],
+ getDataUI: async (
+ connection: Connection,
+ data: Uint8Array,
+ accounts: AccountMetaData[],
+ ) => {
+ const sourceAccount = accounts[4].pubkey;
+
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ nu64('amount'),
+ ]);
+
+ const { amount } = dataLayout.decode(Buffer.from(data)) as any;
+
+ const mintInfo = await tryGetTokenMint(connection, sourceAccount);
+
+ if (!mintInfo) throw new Error('Cannot load source account mint info');
+
+ const uiAmount = nativeAmountToFormattedUiAmount(
+ amount,
+ mintInfo.account.decimals,
+ );
+
+ return (
+
+
+ Amount:
+ {uiAmount}
+
+
+ );
+ },
+ },
+
+ [quarryMineConfiguration.quarryMineProgramInstructions.withdraw]: {
+ name: 'Quarry Mine - Withdraw',
+ accounts: [
+ 'Authority',
+ 'Miner',
+ 'Quarry',
+ 'Miner Vault',
+ 'Token Account',
+ 'Token Program',
+ 'Rewarder',
+ ],
+ getDataUI: async (
+ connection: Connection,
+ data: Uint8Array,
+ accounts: AccountMetaData[],
+ ) => {
+ const destinationAccount = accounts[4].pubkey;
+
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ nu64('amount'),
+ ]);
+
+ const { amount } = dataLayout.decode(Buffer.from(data)) as any;
+
+ const mintInfo = await tryGetTokenMint(connection, destinationAccount);
+
+ if (!mintInfo)
+ throw new Error('Cannot load destination account mint info');
+
+ const uiAmount = nativeAmountToFormattedUiAmount(
+ amount,
+ mintInfo.account.decimals,
+ );
+
+ return (
+
+
+ Amount:
+ {uiAmount}
+
+
+ );
+ },
+ },
+
+ [quarryMineConfiguration.quarryMineProgramInstructions.claimRewards]: {
+ name: 'Quarry Mine - Create Miner',
+ accounts: [
+ 'Mint Wrapper',
+ 'Mint Wrapper Program',
+ 'Minter',
+ 'Rewards Token Mint',
+ 'Rewards Token Account',
+ 'Claim Fee Token Account',
+ 'Authority',
+ 'Miner',
+ 'Quarry',
+ 'Unused Miner Vault',
+ 'Unused Token Account',
+ 'Token Program',
+ 'Rewarder',
+ ],
+ getDataUI: (
+ _connection: Connection,
+ _data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ return null;
+ },
+ },
+ },
+};
diff --git a/components/instructions/programs/raydium.tsx b/components/instructions/programs/raydium.tsx
index aa86f4403e..2b666ad2d9 100644
--- a/components/instructions/programs/raydium.tsx
+++ b/components/instructions/programs/raydium.tsx
@@ -1,8 +1,8 @@
-import { Connection } from '@solana/web3.js'
-import { nu64, struct, u8 } from 'buffer-layout'
-import { AccountMetaData } from '@solana/spl-governance'
-import { fmtMintAmount } from '../../../tools/sdk/units'
-import { tryGetTokenMint } from '../../../utils/tokens'
+import { Connection } from '@solana/web3.js';
+import { nu64, struct, u8 } from 'buffer-layout';
+import { AccountMetaData } from '@solana/spl-governance';
+import { fmtMintAmount } from '../../../tools/sdk/units';
+import { tryGetTokenMint } from '../../../utils/tokens';
const RAYDIUM_AMM_INSTRUCTIONS = {
'675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8': {
@@ -10,42 +10,43 @@ const RAYDIUM_AMM_INSTRUCTIONS = {
name: 'Raydium: Add Liquidity',
accounts: [
{ name: 'Token Program' },
- { name: 'ammId' },
- { name: 'ammAuthority' },
- { name: 'ammOpenOrders' },
- { name: 'ammTargetOrders' },
- { name: 'lpMintAddress' },
- { name: 'poolCoinTokenAccount' },
- { name: 'poolPcTokenAccount' },
- { name: 'serumMarket' },
- { name: 'userCoinTokenAccount' },
- { name: 'userPcTokenAccount' },
- { name: 'userLpTokenAccount' },
- { name: 'userOwner' },
+ { name: 'Amm Id' },
+ { name: 'Amm Authority' },
+ { name: 'Amm Open Orders' },
+ { name: 'Amm Target Orders' },
+ { name: 'Lp Mint Address' },
+ { name: 'Pool Coin Token Account' },
+ { name: 'Pool Pc Token Account' },
+ { name: 'Serum Market' },
+ { name: 'User Coin Token Account' },
+ { name: 'User Pc Token Account' },
+ { name: 'User Lp Token Account' },
+ { name: 'User Owner' },
],
getDataUI: async (
connection: Connection,
data: Uint8Array,
- accounts: AccountMetaData[]
+ accounts: AccountMetaData[],
) => {
const poolCoinMint = await tryGetTokenMint(
connection,
- accounts[6].pubkey // poolCoinTokenAccount
- )
+ accounts[6].pubkey, // Pool Coin Token Account
+ );
const poolPcMint = await tryGetTokenMint(
connection,
- accounts[7].pubkey // poolPcTokenAccount
- )
+ accounts[7].pubkey, // Pool Pc Token Account
+ );
const dataLayout = struct([
u8('instruction'),
nu64('maxCoinAmount'),
nu64('maxPcAmount'),
nu64('fixedFromCoin'),
- ])
+ ]);
+ console.debug('buffer', Buffer.from(data));
- const args = dataLayout.decode(Buffer.from(data)) as any
+ const args = dataLayout.decode(Buffer.from(data)) as any;
return (
<>
@@ -59,53 +60,53 @@ const RAYDIUM_AMM_INSTRUCTIONS = {
fixedFromCoin: {args.fixedFromCoin}
>
- )
+ );
},
},
},
-}
+};
const RAYDIUM_STAKING_INSTRUCTIONS = {
EhhTKczWMGQt46ynNeRX1WfeagwwJd7ufHvCDjRxjo5Q: {
1: {
name: 'Raydium: Deposit',
accounts: [
- { name: 'poolId' },
- { name: 'poolAuthority' },
- { name: 'userInfoAccount' },
- { name: 'userOwner' },
- { name: 'userLpTokenAccount' },
- { name: 'poolLpTokenAccount' },
- { name: 'userRewardTokenAccount' },
- { name: 'poolRewardTokenAccount' },
+ { name: 'Pool Id' },
+ { name: 'Pool Authority' },
+ { name: 'User Info Account' },
+ { name: 'User Owner' },
+ { name: 'User Lp Token Account' },
+ { name: 'Pool Lp Token Account' },
+ { name: 'User Reward Token Account' },
+ { name: 'Pool Reward Token Account' },
{ name: 'Sysvar: Clock' },
{ name: 'Token Program' },
- { name: 'userRewardTokenAccountB' },
- { name: 'poolRewardTokenAccountB' },
+ { name: 'User Reward Token Account B' },
+ { name: 'Pool Reward Token Account B' },
],
getDataUI: async (
connection: Connection,
data: Uint8Array,
- accounts: AccountMetaData[]
+ accounts: AccountMetaData[],
) => {
const lpTokenMint = await tryGetTokenMint(
connection,
- accounts[4].pubkey // userLpTokenAccount
- )
- const dataLayout = struct([u8('instruction'), nu64('amount')])
+ accounts[4].pubkey, // User Lp Token Account
+ );
+ const dataLayout = struct([u8('instruction'), nu64('amount')]);
- const args = dataLayout.decode(Buffer.from(data)) as any
+ const args = dataLayout.decode(Buffer.from(data)) as any;
return (
<>
amount: {fmtMintAmount(lpTokenMint?.account, args.amount)}
>
- )
+ );
},
},
},
-}
+};
export const RAYDIUM_INSTRUCTIONS = {
...RAYDIUM_STAKING_INSTRUCTIONS,
...RAYDIUM_AMM_INSTRUCTIONS,
-}
+};
diff --git a/components/instructions/programs/saberPools.tsx b/components/instructions/programs/saberPools.tsx
new file mode 100644
index 0000000000..5d461a47d2
--- /dev/null
+++ b/components/instructions/programs/saberPools.tsx
@@ -0,0 +1,270 @@
+import BigNumber from 'bignumber.js';
+import { nu64, struct, u8 } from 'buffer-layout';
+import { AccountMetaData } from '@solana/spl-governance';
+import { Connection } from '@solana/web3.js';
+import saberPoolsConfiguration from '@tools/sdk/saberPools/configuration';
+import { SwapSide } from '@tools/sdk/saberPools/swap';
+import { tryGetTokenMint } from '@utils/tokens';
+import { nativeAmountToFormattedUiAmount } from '@tools/sdk/units';
+
+export const SABER_POOLS_PROGRAM_INSTRUCTIONS = {
+ [saberPoolsConfiguration.saberStableSwapProgramId.toBase58()]: {
+ [saberPoolsConfiguration.stableSwapInstructions.deposit]: {
+ name: 'Saber Pools - Deposit',
+ accounts: [
+ 'Swap Account',
+ 'Swap Account Authority',
+ 'Source A',
+ 'Source B',
+ 'Token Account A',
+ 'Token Account B',
+ 'Pool Token Mint',
+ 'Pool Token Amount',
+ 'Token Program Id',
+ ],
+ getDataUI: (
+ _connection: Connection,
+ data: Uint8Array,
+ accounts: AccountMetaData[],
+ ) => {
+ const sourceA = accounts[3].pubkey.toString();
+ const sourceB = accounts[4].pubkey.toString();
+ const tokenAccountA = accounts[5].pubkey;
+ const tokenAccountB = accounts[6].pubkey;
+
+ const pool = saberPoolsConfiguration.getPoolByTokenAccounts(
+ tokenAccountA,
+ tokenAccountB,
+ );
+
+ if (!pool) {
+ return Unknown Pool
;
+ }
+
+ const dataLayout = struct([
+ u8('instruction'),
+ nu64('tokenAmountA'),
+ nu64('tokenAmountB'),
+ nu64('minimumPoolTokenAmount'),
+ ]);
+
+ const { tokenAmountA, tokenAmountB } = dataLayout.decode(
+ Buffer.from(data),
+ ) as any;
+
+ const uiTokenAmountA = nativeAmountToFormattedUiAmount(
+ tokenAmountA,
+ pool.tokenAccountA.decimals,
+ );
+
+ const uiTokenAmountB = nativeAmountToFormattedUiAmount(
+ tokenAmountB,
+ pool.tokenAccountB.decimals,
+ );
+
+ return (
+
+
+ From {pool.tokenAccountA.name} Account:
+ {sourceA}
+
+
+
+ From {pool.tokenAccountB.name} Account:
+ {sourceB}
+
+
+
+ {pool.tokenAccountA.name} Amount:
+ {uiTokenAmountA}
+
+
+
+ {pool.tokenAccountB.name} Amount:
+ {uiTokenAmountB}
+
+
+ );
+ },
+ },
+
+ [saberPoolsConfiguration.stableSwapInstructions.withdrawOne]: {
+ name: 'Saber Pools - Withdraw One',
+ accounts: [
+ 'Swap Account',
+ 'Swap Account Authority',
+ 'User Authority',
+ 'Pool Mint',
+ 'Source Account',
+ 'Base Token Account',
+ 'Quote Token Account',
+ 'Destination Token Account',
+ 'Admin Destination Account',
+ 'Token Program Id',
+ ],
+ getDataUI: (
+ _connection: Connection,
+ data: Uint8Array,
+ accounts: AccountMetaData[],
+ ) => {
+ const owner = accounts[2].pubkey.toString();
+
+ const baseTokenAccount = accounts[5].pubkey;
+ const quoteTokenAccount = accounts[6].pubkey;
+ const destinationAccount = accounts[7].pubkey.toString();
+
+ const pool = saberPoolsConfiguration.getPoolByTokenAccounts(
+ baseTokenAccount,
+ quoteTokenAccount,
+ );
+
+ if (!pool) {
+ return Unknown Pool
;
+ }
+
+ const baseTokenAccountInfo = baseTokenAccount.equals(
+ pool.tokenAccountA.mint,
+ )
+ ? pool.tokenAccountA
+ : pool.tokenAccountB;
+
+ const dataLayout = struct([
+ u8('instruction'),
+ nu64('poolTokenAmount'),
+ nu64('minimumTokenAmount'),
+ ]);
+
+ const { poolTokenAmount, minimumTokenAmount } = dataLayout.decode(
+ Buffer.from(data),
+ ) as any;
+
+ const uiPoolTokenAmount = nativeAmountToFormattedUiAmount(
+ poolTokenAmount,
+ pool.poolToken.decimals,
+ );
+
+ const uiMinimumTokenAmount = nativeAmountToFormattedUiAmount(
+ minimumTokenAmount,
+ baseTokenAccountInfo.decimals,
+ );
+
+ return (
+
+
+ Owner:
+ {owner}
+
+
+
+ Withdraw {pool.poolToken.name}s:
+ {uiPoolTokenAmount}
+
+
+
+ Minimum {baseTokenAccountInfo.name} Tokens Received:
+ {uiMinimumTokenAmount}
+
+
+
+ To {baseTokenAccountInfo.name} Account:
+ {destinationAccount}
+
+
+ );
+ },
+ },
+
+ [saberPoolsConfiguration.stableSwapInstructions.swap]: {
+ name: 'Saber Pools - Swap',
+ accounts: [
+ 'Swap Account',
+ 'Authority',
+ 'User Authority',
+ 'User Source',
+ 'Pool Source',
+ 'Pool Destination',
+ 'User Destination',
+ 'Admin Destination',
+ 'Token Program Id',
+ ],
+
+ getDataUI: async (
+ connection: Connection,
+ data: Uint8Array,
+ accounts: AccountMetaData[],
+ ) => {
+ const userSource = accounts[3].pubkey;
+ const poolDestination = accounts[5].pubkey;
+
+ const [mintSell, mintBuy] = await Promise.all([
+ tryGetTokenMint(connection, userSource),
+ tryGetTokenMint(connection, poolDestination),
+ ]);
+
+ if (!mintSell || !mintBuy) {
+ throw new Error('Cannot load info about mints');
+ }
+
+ const pool = saberPoolsConfiguration.getPoolByTokenMints(
+ mintSell.publicKey,
+ mintBuy.publicKey,
+ );
+
+ if (!pool) {
+ return Unknown Pool
;
+ }
+
+ const swapSide: SwapSide = pool.tokenAccountA.tokenMint.equals(
+ mintSell.publicKey,
+ )
+ ? 'swapAforB'
+ : 'swapBforA';
+
+ const sellToken =
+ swapSide === 'swapAforB' ? pool.tokenAccountA : pool.tokenAccountB;
+ const buyToken =
+ swapSide === 'swapAforB' ? pool.tokenAccountB : pool.tokenAccountA;
+
+ const dataLayout = struct([
+ u8('instruction'),
+ nu64('amountIn'),
+ nu64('minimumAmountOut'),
+ ]);
+
+ const { amountIn, minimumAmountOut } = dataLayout.decode(
+ Buffer.from(data),
+ ) as any;
+
+ const uiAmountIn = Number(
+ new BigNumber(amountIn).shiftedBy(-sellToken.decimals).toString(),
+ ).toLocaleString();
+
+ const uiMinimumAmountOut = Number(
+ new BigNumber(minimumAmountOut)
+ .shiftedBy(-buyToken.decimals)
+ .toString(),
+ ).toLocaleString();
+
+ return (
+
+
+
+ Sell {sellToken.name} for {buyToken.name}
+
+
+
+
+ {sellToken.name} Amount In:
+ {uiAmountIn}
+
+
+
+ {buyToken.name} Minimum Amount Out:
+ {uiMinimumAmountOut}
+
+
+ );
+ },
+ },
+ },
+};
diff --git a/components/instructions/programs/socean.tsx b/components/instructions/programs/socean.tsx
new file mode 100644
index 0000000000..46658fb035
--- /dev/null
+++ b/components/instructions/programs/socean.tsx
@@ -0,0 +1,239 @@
+import { nu64, struct, u8 } from 'buffer-layout';
+import { AccountMetaData } from '@solana/spl-governance';
+import { Connection } from '@solana/web3.js';
+import soceanConfiguration from '@tools/sdk/socean/configuration';
+import { tryGetMint, tryGetTokenMint } from '@utils/tokens';
+import { ANCHOR_DISCRIMINATOR_LAYOUT } from '@utils/helpers';
+import {
+ nativeAmountToFormattedUiAmount,
+ nativeBNToUiAmount,
+} from '@tools/sdk/units';
+
+export const SOCEAN_PROGRAM_INSTRUCTIONS = {
+ [soceanConfiguration.bondingProgramId.mainnet.toBase58()]: {
+ [soceanConfiguration.bondingProgramInstructions.mintBondedTokens]: {
+ name: 'Socean - Mint Bonded Tokens',
+ accounts: [
+ 'Owner',
+ 'Deposit From',
+ 'Mint To',
+ 'Vault',
+ 'Bonded Mint',
+ 'Bond Mint Authority',
+ 'Bond Pool',
+ 'Token Program Id',
+ ],
+ getDataUI: async (
+ connection: Connection,
+ data: Uint8Array,
+ accounts: AccountMetaData[],
+ ) => {
+ const owner = accounts[0].pubkey.toString();
+ const depositFrom = accounts[1].pubkey.toString();
+ const mintTo = accounts[2].pubkey.toString();
+ const bondedMint = accounts[4].pubkey;
+
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ nu64('amount'),
+ ]);
+
+ const { amount } = dataLayout.decode(Buffer.from(data)) as any;
+
+ const bondedMintInfo = await tryGetMint(connection, bondedMint);
+
+ if (!bondedMintInfo) throw new Error('Cannot load bonded mint info');
+
+ const uiAmount = nativeAmountToFormattedUiAmount(
+ amount,
+ bondedMintInfo.account.decimals,
+ );
+
+ owner;
+ return (
+
+
+ Owner:
+ {owner}
+
+
+
+ Bonded Token Amount:
+ {uiAmount}
+
+
+
+ Deposit From (Sale Mint TA/ATA):
+ {depositFrom}
+
+
+
+ Mint To (Bonded Mint TA/ATA):
+ {mintTo}
+
+
+ );
+ },
+ },
+ },
+
+ [soceanConfiguration.descendingAuctionProgramId.mainnet.toBase58()]: {
+ [soceanConfiguration.descendingAuctionProgramInstructions
+ .depositToAuctionPool]: {
+ name: 'Socean - Deposit to Auction Pool',
+ accounts: [
+ 'Auction',
+ 'Auction Pool',
+ 'Auction Authority',
+ 'Authority',
+ 'Source Account',
+ 'Token Program Id',
+ ],
+ getDataUI: async (
+ connection: Connection,
+ data: Uint8Array,
+ accounts: AccountMetaData[],
+ ) => {
+ const owner = accounts[3].pubkey.toString();
+ const sourceAccount = accounts[4].pubkey;
+
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ nu64('depositAmount'),
+ ]);
+
+ const { depositAmount } = dataLayout.decode(Buffer.from(data)) as any;
+
+ const bondedMintInfo = await tryGetTokenMint(connection, sourceAccount);
+
+ if (!bondedMintInfo) throw new Error('Cannot load source account info');
+
+ const uiDepositAmount = nativeAmountToFormattedUiAmount(
+ depositAmount,
+ bondedMintInfo.account.decimals,
+ );
+
+ return (
+
+
+ Owner:
+ {owner}
+
+
+
+ Amount of bonded token to Deposit:
+ {uiDepositAmount}
+
+
+
+ Deposit From (Bonded Mint TA/ATA):
+ {sourceAccount.toString()}
+
+
+ );
+ },
+ },
+
+ [soceanConfiguration.descendingAuctionProgramInstructions.purchase]: {
+ name: 'Socean - Purchase',
+ accounts: [
+ 'Auction',
+ 'Auction Authority',
+ 'Sale Mint',
+ 'Auction Pool',
+ 'Payment Destination',
+ 'Buyer',
+ 'Payment Source',
+ 'Sale Destination',
+ 'Token Program Id',
+ ],
+ getDataUI: async (
+ connection: Connection,
+ data: Uint8Array,
+ accounts: AccountMetaData[],
+ ) => {
+ const auction = accounts[0].pubkey.toString();
+ const saleMint = accounts[2].pubkey;
+ const buyer = accounts[5].pubkey.toString();
+ const paymentSource = accounts[6].pubkey;
+
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ nu64('purchaseAmount'),
+ nu64('expectedPayment'),
+ nu64('slippageTolerance'),
+ ]);
+
+ const {
+ purchaseAmount,
+ expectedPayment,
+ slippageTolerance,
+ } = dataLayout.decode(Buffer.from(data)) as any;
+
+ const [sourceMintInfo, bondedMintInfo] = await Promise.all([
+ tryGetTokenMint(connection, paymentSource),
+ tryGetMint(connection, saleMint),
+ ]);
+
+ if (!sourceMintInfo)
+ throw new Error('Cannot load payment source account info');
+ if (!bondedMintInfo)
+ throw new Error('Cannot load sale destination info');
+
+ const uiPurchaseAmount = nativeAmountToFormattedUiAmount(
+ purchaseAmount,
+ bondedMintInfo.account.decimals,
+ );
+
+ const uiExpectedPayment = nativeAmountToFormattedUiAmount(
+ expectedPayment,
+ sourceMintInfo.account.decimals,
+ );
+
+ const uiSlippageTolerance = (slippageTolerance / 10).toLocaleString();
+
+ const uiPurchaseRatio = (
+ nativeBNToUiAmount(expectedPayment, sourceMintInfo.account.decimals) /
+ nativeBNToUiAmount(purchaseAmount, bondedMintInfo.account.decimals)
+ ).toLocaleString();
+
+ return (
+
+
+ Buyer:
+ {buyer}
+
+
+
+ Amount of bonded token to Purchase:
+ {uiPurchaseAmount}
+
+
+
+ Expected Payment:
+ {uiExpectedPayment}
+
+
+
+ Slippage Tolerance:
+ {uiSlippageTolerance}%
+
+
+
+ Purchase Ratio (X Payment Mint = 1 Bonded Token):
+ {uiPurchaseRatio}
+
+
+
+ Auction:
+ {auction}
+
+
+ );
+ },
+ },
+ },
+};
diff --git a/components/instructions/programs/solend.tsx b/components/instructions/programs/solend.tsx
index 0e38f018ef..f86ee8701a 100644
--- a/components/instructions/programs/solend.tsx
+++ b/components/instructions/programs/solend.tsx
@@ -1,9 +1,8 @@
-import { AccountMetaData } from '@solana/spl-governance'
-import { Connection } from '@solana/web3.js'
-import { LendingInstruction } from '@solendprotocol/solend-sdk/dist/instructions/instruction'
-import SolendConfiguration from '@tools/sdk/solend/configuration'
-
-import { nu64, struct, u8 } from 'buffer-layout'
+import { nu64, struct, u8 } from 'buffer-layout';
+import { LendingInstruction } from '@solendprotocol/solend-sdk/dist/instructions/instruction';
+import { Connection } from '@solana/web3.js';
+import { AccountMetaData } from '@solana/spl-governance';
+import SolendConfiguration from '@tools/sdk/solend/configuration';
export const SOLEND_PROGRAM_INSTRUCTIONS = {
[SolendConfiguration.programID.toBase58()]: {
@@ -20,9 +19,9 @@ export const SOLEND_PROGRAM_INSTRUCTIONS = {
getDataUI: (
_connection: Connection,
_data: Uint8Array,
- accounts: AccountMetaData[]
+ accounts: AccountMetaData[],
) => {
- const mint = accounts[2].pubkey.toString()
+ const mint = accounts[2].pubkey.toString();
return (
@@ -31,7 +30,7 @@ export const SOLEND_PROGRAM_INSTRUCTIONS = {
{mint}
- )
+ );
},
},
@@ -46,17 +45,17 @@ export const SOLEND_PROGRAM_INSTRUCTIONS = {
getDataUI: (
_connection: Connection,
_data: Uint8Array,
- accounts: AccountMetaData[]
+ accounts: AccountMetaData[],
) => {
// All accounts starting at index 2 are reserve accounts
- const reserveAccounts = accounts.slice(2)
+ const reserveAccounts = accounts.slice(2);
const reserveNames = reserveAccounts.map(
(reserveAcc) =>
- SolendConfiguration.getTokenNameByReservePublicKey(
- reserveAcc.pubkey
- ) ?? 'unknown'
- )
+ SolendConfiguration.retroEngineerTokenNameUsingReserve(
+ reserveAcc.pubkey,
+ ) ?? 'unknown',
+ );
return (
@@ -67,7 +66,7 @@ export const SOLEND_PROGRAM_INSTRUCTIONS = {
))}
- )
+ );
},
},
@@ -77,20 +76,21 @@ export const SOLEND_PROGRAM_INSTRUCTIONS = {
getDataUI: (
_connection: Connection,
_data: Uint8Array,
- accounts: AccountMetaData[]
+ accounts: AccountMetaData[],
) => {
- const reserve = accounts[0]
+ const reserve = accounts[0];
const tokenName =
- SolendConfiguration.getTokenNameByReservePublicKey(reserve.pubkey) ??
- 'unknown'
+ SolendConfiguration.retroEngineerTokenNameUsingReserve(
+ reserve.pubkey,
+ ) ?? 'unknown';
return (
Reserve
{tokenName}
- )
+ );
},
},
@@ -115,17 +115,18 @@ export const SOLEND_PROGRAM_INSTRUCTIONS = {
getDataUI: (
_connection: Connection,
data: Uint8Array,
- accounts: AccountMetaData[]
+ accounts: AccountMetaData[],
) => {
- const dataLayout = struct([u8('instruction'), nu64('liquidityAmount')])
+ const dataLayout = struct([u8('instruction'), nu64('liquidityAmount')]);
- const { liquidityAmount } = dataLayout.decode(Buffer.from(data)) as any
+ const { liquidityAmount } = dataLayout.decode(Buffer.from(data)) as any;
- const reserve = accounts[2]
+ const reserve = accounts[2];
const tokenName =
- SolendConfiguration.getTokenNameByReservePublicKey(reserve.pubkey) ??
- 'unknown'
+ SolendConfiguration.retroEngineerTokenNameUsingReserve(
+ reserve.pubkey,
+ ) ?? 'unknown';
return (
@@ -138,7 +139,7 @@ export const SOLEND_PROGRAM_INSTRUCTIONS = {
{liquidityAmount}
- )
+ );
},
},
@@ -163,17 +164,23 @@ export const SOLEND_PROGRAM_INSTRUCTIONS = {
getDataUI: (
_connection: Connection,
data: Uint8Array,
- accounts: AccountMetaData[]
+ accounts: AccountMetaData[],
) => {
- const dataLayout = struct([u8('instruction'), nu64('collateralAmount')])
+ const dataLayout = struct([
+ u8('instruction'),
+ nu64('collateralAmount'),
+ ]);
- const { collateralAmount } = dataLayout.decode(Buffer.from(data)) as any
+ const { collateralAmount } = dataLayout.decode(
+ Buffer.from(data),
+ ) as any;
- const reserve = accounts[2]
+ const reserve = accounts[2];
const tokenName =
- SolendConfiguration.getTokenNameByReservePublicKey(reserve.pubkey) ??
- 'unknown'
+ SolendConfiguration.retroEngineerTokenNameUsingReserve(
+ reserve.pubkey,
+ ) ?? 'unknown';
return (
@@ -186,8 +193,8 @@ export const SOLEND_PROGRAM_INSTRUCTIONS = {
{collateralAmount}
- )
+ );
},
},
},
-}
+};
diff --git a/components/instructions/programs/splToken.tsx b/components/instructions/programs/splToken.tsx
index b47b3f2f2f..267b24b4e6 100644
--- a/components/instructions/programs/splToken.tsx
+++ b/components/instructions/programs/splToken.tsx
@@ -1,11 +1,11 @@
-import { Connection, PublicKey } from '@solana/web3.js'
-import { AccountMetaData } from '@solana/spl-governance'
-import { tryGetMint, tryGetTokenAccount } from '../../../utils/tokens'
-import BN from 'bn.js'
-import { getMintDecimalAmountFromNatural } from '@tools/sdk/units'
-import tokenService from '@utils/services/token'
+import { Connection, PublicKey } from '@solana/web3.js';
+import { AccountMetaData } from '@solana/spl-governance';
+import { tryGetMint, tryGetTokenAccount } from '../../../utils/tokens';
+import BN from 'bn.js';
+import { getMintDecimalAmountFromNatural } from '@tools/sdk/units';
+import tokenService from '@utils/services/token';
export interface TokenMintMetadata {
- name: string
+ name: string;
}
// Mint metadata for Well known tokens displayed on the instruction card
@@ -16,18 +16,18 @@ export const MINT_METADATA = {
SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt: { name: 'SRM' },
MyHd6a7HWKTMeJMHBkrbMq4hZwZxwn9x7dxXcopQ4Wd: { name: 'OMH' },
UXPhBoR3qG4UCiGNJfV7MqhHyFqKN68g45GoYvAeL2M: { name: 'UXP' },
-}
+};
export function getMintMetadata(
- tokenMintPk: PublicKey | undefined
+ tokenMintPk: PublicKey | undefined,
): TokenMintMetadata {
- const tokenMintAddress = tokenMintPk ? tokenMintPk.toBase58() : ''
+ const tokenMintAddress = tokenMintPk ? tokenMintPk.toBase58() : '';
const tokenInfo = tokenMintAddress
? tokenService.getTokenInfo(tokenMintAddress)
- : null
+ : null;
return tokenInfo
? { name: tokenInfo.symbol }
- : MINT_METADATA[tokenMintAddress]
+ : MINT_METADATA[tokenMintAddress];
}
export const SPL_TOKEN_INSTRUCTIONS = {
@@ -42,18 +42,18 @@ export const SPL_TOKEN_INSTRUCTIONS = {
getDataUI: async (
connection: Connection,
data: Uint8Array,
- accounts: AccountMetaData[]
+ accounts: AccountMetaData[],
) => {
const tokenAccount = await tryGetTokenAccount(
connection,
- accounts[0].pubkey
- )
+ accounts[0].pubkey,
+ );
const tokenMint = await tryGetMint(
connection,
- tokenAccount!.account.mint
- )
+ tokenAccount!.account.mint,
+ );
- const tokenMintDescriptor = getMintMetadata(tokenAccount?.account.mint)
+ const tokenMintDescriptor = getMintMetadata(tokenAccount?.account.mint);
// TokenTransfer instruction layout
// TODO: Use BufferLayout to decode the instruction
@@ -61,10 +61,10 @@ export const SPL_TOKEN_INSTRUCTIONS = {
// BufferLayout.u8('instruction'),
// Layout.uint64('amount'),
// ]);
- const rawAmount = new BN(data.slice(1), 'le')
+ const rawAmount = new BN(data.slice(1), 'le');
const tokenAmount = tokenMint
? getMintDecimalAmountFromNatural(tokenMint.account, rawAmount)
- : rawAmount
+ : rawAmount;
return (
<>
@@ -81,7 +81,7 @@ export const SPL_TOKEN_INSTRUCTIONS = {
{JSON.stringify(data)}
)}
>
- )
+ );
},
},
7: {
@@ -94,11 +94,11 @@ export const SPL_TOKEN_INSTRUCTIONS = {
getDataUI: async (
connection: Connection,
data: Uint8Array,
- accounts: AccountMetaData[]
+ accounts: AccountMetaData[],
) => {
- const tokenMint = await tryGetMint(connection, accounts[0].pubkey)
+ const tokenMint = await tryGetMint(connection, accounts[0].pubkey);
- const tokenMintDescriptor = getMintMetadata(accounts[0].pubkey)
+ const tokenMintDescriptor = getMintMetadata(accounts[0].pubkey);
// TokenMint instruction layout
// TODO: Use BufferLayout to decode the instruction
@@ -106,10 +106,10 @@ export const SPL_TOKEN_INSTRUCTIONS = {
// BufferLayout.u8('instruction'),
// Layout.uint64('amount'),
// ]);
- const rawAmount = new BN(data.slice(1), 'le')
+ const rawAmount = new BN(data.slice(1), 'le');
const tokenAmount = tokenMint
? getMintDecimalAmountFromNatural(tokenMint.account, rawAmount)
- : rawAmount
+ : rawAmount;
return (
<>
@@ -126,7 +126,7 @@ export const SPL_TOKEN_INSTRUCTIONS = {
{JSON.stringify(data)}
)}
>
- )
+ );
},
},
8: {
@@ -139,17 +139,17 @@ export const SPL_TOKEN_INSTRUCTIONS = {
getDataUI: async (
connection: Connection,
data: Uint8Array,
- accounts: AccountMetaData[]
+ accounts: AccountMetaData[],
) => {
- const mint = accounts[1].pubkey
- const tokenMint = await tryGetMint(connection, mint)
+ const mint = accounts[1].pubkey;
+ const tokenMint = await tryGetMint(connection, mint);
- const tokenMintDescriptor = getMintMetadata(mint)
+ const tokenMintDescriptor = getMintMetadata(mint);
- const rawAmount = new BN(data.slice(1), 'le')
+ const rawAmount = new BN(data.slice(1), 'le');
const tokenAmount = tokenMint
? getMintDecimalAmountFromNatural(tokenMint.account, rawAmount)
- : rawAmount
+ : rawAmount;
return (
<>
@@ -166,8 +166,8 @@ export const SPL_TOKEN_INSTRUCTIONS = {
{JSON.stringify(data)}
)}
>
- )
+ );
},
},
},
-}
+};
diff --git a/components/instructions/programs/system.tsx b/components/instructions/programs/system.tsx
index 1f95e24691..38d0e2f47e 100644
--- a/components/instructions/programs/system.tsx
+++ b/components/instructions/programs/system.tsx
@@ -1,10 +1,41 @@
-import { BN } from '@project-serum/anchor'
-import { Connection, PublicKey } from '@solana/web3.js'
-import { getMintDecimalAmountFromNatural } from '@tools/sdk/units'
-import { tryGetMint } from '@utils/tokens'
-import { WSOL_MINT } from '../tools'
-import BufferLayout from 'buffer-layout'
-import { AccountMetaData } from '@solana/spl-governance'
+import BufferLayout from 'buffer-layout';
+import { Connection, PublicKey } from '@solana/web3.js';
+import { AccountMetaData } from '@solana/spl-governance';
+import { BN } from '@project-serum/anchor';
+import { getMintDecimalAmountFromNatural } from '@tools/sdk/units';
+import { tryGetMint } from '@utils/tokens';
+import { WSOL_MINT } from '../tools';
+
+const SYSTEM_PROGRAM_ID = new PublicKey('11111111111111111111111111111111');
+
+const CREATE_ACCOUNT_WITH_SEED_INSTRUCTION_ID = 3;
+
+export const SYSTEM_PROGRAM_INSTRUCTIONS = {
+ [SYSTEM_PROGRAM_ID.toBase58()]: {
+ [CREATE_ACCOUNT_WITH_SEED_INSTRUCTION_ID]: {
+ name: 'System Program - Create Account With Seed',
+ accounts: [
+ 'Obligation',
+ 'Lending Market Account',
+ 'Obligation Owner',
+ 'Sysvar: Clock',
+ 'Rent Program',
+ 'Token Program',
+ ],
+ getDataUI: (
+ _connection: Connection,
+ _data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ return (
+ <>
+ No data
+ >
+ );
+ },
+ },
+ },
+};
export const SYSTEM_INSTRUCTIONS = {
'11111111111111111111111111111111': {
@@ -16,18 +47,21 @@ export const SYSTEM_INSTRUCTIONS = {
{ name: 'Authority' },
],
getDataUI: async (connection: Connection, data: Uint8Array) => {
- const tokenMint = await tryGetMint(connection, new PublicKey(WSOL_MINT))
+ const tokenMint = await tryGetMint(
+ connection,
+ new PublicKey(WSOL_MINT),
+ );
//@ts-ignore
const { lamports } = BufferLayout.struct([
BufferLayout.u32('instruction'),
BufferLayout.ns64('lamports'),
- ]).decode(Buffer.from(data))
+ ]).decode(Buffer.from(data));
- const rawAmount = new BN(lamports)
+ const rawAmount = new BN(lamports);
const tokenAmount = tokenMint
? getMintDecimalAmountFromNatural(tokenMint.account, rawAmount)
- : rawAmount
+ : rawAmount;
return (
<>
@@ -44,7 +78,7 @@ export const SYSTEM_INSTRUCTIONS = {
{JSON.stringify(data)}
)}
>
- )
+ );
},
},
3: {
@@ -60,10 +94,10 @@ export const SYSTEM_INSTRUCTIONS = {
getDataUI: (
_connection: Connection,
_data: Uint8Array,
- _accounts: AccountMetaData[]
+ _accounts: AccountMetaData[],
) => {
- return No Instruction data
+ return No Instruction data
;
},
},
},
-}
+};
diff --git a/components/instructions/programs/tribeca.tsx b/components/instructions/programs/tribeca.tsx
new file mode 100644
index 0000000000..de4bb9afea
--- /dev/null
+++ b/components/instructions/programs/tribeca.tsx
@@ -0,0 +1,218 @@
+import { nu64, struct, u32, u8 } from 'buffer-layout';
+import { AccountMetaData } from '@solana/spl-governance';
+import { Connection } from '@solana/web3.js';
+import ATribecaConfiguration from '@tools/sdk/tribeca/ATribecaConfiguration';
+import { ANCHOR_DISCRIMINATOR_LAYOUT } from '@utils/helpers';
+
+export const TRIBECA_PROGRAM_INSTRUCTIONS = {
+ [ATribecaConfiguration.gaugeProgramId.toBase58()]: {
+ [ATribecaConfiguration.gaugeInstructions.createGaugeVoter]: {
+ name: 'Tribeca - Create Gauge Voter',
+ accounts: [
+ 'Gauge Voter',
+ 'Gaugemeister',
+ 'Escrow',
+ 'Payer',
+ 'System Program',
+ ],
+ getDataUI: (
+ _connection: Connection,
+ _data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ return null;
+ },
+ },
+
+ [ATribecaConfiguration.gaugeInstructions.createGaugeVote]: {
+ name: 'Tribeca - Create Gauge Vote',
+ accounts: [
+ 'Gauge Vote',
+ 'Gauge Voter',
+ 'Gauge',
+ 'Payer',
+ 'System Program',
+ ],
+ getDataUI: (
+ _connection: Connection,
+ _data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ return null;
+ },
+ },
+
+ [ATribecaConfiguration.gaugeInstructions.setGaugeVote]: {
+ name: 'Tribeca - Set Gauge Vote',
+ accounts: [
+ 'Gaugemeister',
+ 'Gauge',
+ 'Gauge Voter',
+ 'Gauge Vote',
+ 'Escrow',
+ 'Vote Delegate',
+ ],
+ getDataUI: (
+ _connection: Connection,
+ data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ u32('weight'),
+ ]);
+
+ const { weight } = dataLayout.decode(Buffer.from(data)) as any;
+
+ return (
+
+
+ Weight:
+ {weight}
+
+
+ );
+ },
+ },
+
+ [ATribecaConfiguration.gaugeInstructions.prepareEpochGaugeVoter]: {
+ name: 'Tribeca - Prepare Epoch Gauge Voter',
+ accounts: [
+ 'Gaugemeister',
+ 'Locker',
+ 'Escrow',
+ 'Gauge Voter',
+ 'Epoch Gauge Voter',
+ 'Payer',
+ 'System Program',
+ ],
+ getDataUI: (
+ _connection: Connection,
+ _data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ return null;
+ },
+ },
+
+ [ATribecaConfiguration.gaugeInstructions.gaugeCommitVote]: {
+ name: 'Tribeca - Gauge Commit Vote',
+ accounts: [
+ 'Gaugemeister',
+ 'Gauge',
+ 'Gauge Voter',
+ 'Gauge Vote',
+ 'Epoch Gauge',
+ 'Epoch Gauge Voter',
+ 'Epoch Gauge Vote',
+ 'Payer',
+ 'System Program',
+ ],
+ getDataUI: (
+ _connection: Connection,
+ _data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ return null;
+ },
+ },
+
+ [ATribecaConfiguration.gaugeInstructions.gaugeRevertVote]: {
+ name: 'Tribeca - Gauge Revert Vote',
+ accounts: [
+ 'Gaugemeister',
+ 'Gauge',
+ 'Gauge Voter',
+ 'Gauge Vote',
+ 'Epoch Gauge',
+ 'Epoch Gauge Voter',
+ 'Escrow',
+ 'Vote Delegate',
+ 'Epoch Gauge Vote',
+ 'Payer',
+ ],
+ getDataUI: (
+ _connection: Connection,
+ _data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ return null;
+ },
+ },
+
+ [ATribecaConfiguration.gaugeInstructions.resetEpochGaugeVoter]: {
+ name: 'Tribeca - Reset Epoch Gauge Voter',
+ accounts: [
+ 'Gaugemeister',
+ 'Locker',
+ 'Escrow',
+ 'Gauge Voter',
+ 'Epoch Gauge Voter',
+ ],
+ getDataUI: (
+ _connection: Connection,
+ _data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ return null;
+ },
+ },
+ },
+
+ [ATribecaConfiguration.lockedVoterProgramId.toBase58()]: {
+ [ATribecaConfiguration.lockedVoterInstructions.newEscrow]: {
+ name: 'Tribeca - New Escrow',
+ accounts: ['Locker', 'Escrow', 'Escrow Owner', 'Payer', 'System Program'],
+ getDataUI: (
+ _connection: Connection,
+ _data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ return null;
+ },
+ },
+
+ [ATribecaConfiguration.lockedVoterInstructions.lock]: {
+ name: 'Tribeca - Lock',
+ accounts: [
+ 'Locker',
+ 'Escrow',
+ 'Escrow Tokens',
+ 'Escrow Owner',
+ 'Source Tokens',
+ 'Token Program',
+ ],
+ getDataUI: (
+ _connection: Connection,
+ data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ nu64('amount'),
+ nu64('duration'),
+ ]);
+
+ const { amount, duration } = dataLayout.decode(
+ Buffer.from(data),
+ ) as any;
+
+ return (
+
+
+ Native Amount:
+ {Number(amount).toLocaleString()}
+
+
+
+ Duration (seconds):
+ {Number(duration).toLocaleString()}
+
+
+ );
+ },
+ },
+ },
+};
diff --git a/components/instructions/programs/uxdProtocol.tsx b/components/instructions/programs/uxdProtocol.tsx
new file mode 100644
index 0000000000..ed5f007614
--- /dev/null
+++ b/components/instructions/programs/uxdProtocol.tsx
@@ -0,0 +1,319 @@
+import { Connection } from '@solana/web3.js';
+import { struct, u8, nu64 } from 'buffer-layout';
+import { AccountMetaData } from '@solana/spl-governance';
+import { bool, u128, u64 } from '@project-serum/borsh';
+import { INSURANCE_MINTS } from '@tools/sdk/uxdProtocol/uxdClient';
+import { UXD_DECIMALS } from '@uxd-protocol/uxd-client';
+import { nativeAmountToFormattedUiAmount } from '@tools/sdk/units';
+import { BN } from '@project-serum/anchor';
+import { tryGetTokenMint } from '@utils/tokens';
+import { ANCHOR_DISCRIMINATOR_LAYOUT } from '@utils/helpers';
+
+export const UXD_PROGRAM_INSTRUCTIONS = {
+ UXD8m9cvwk4RcSxnX2HZ9VudQCEeDH6fRnB4CAP57Dr: {
+ 216: {
+ name: 'UXD - Set Mango Depository Quote Mint and Redeem Soft Cap',
+ accounts: ['Authority', 'Controller'],
+ getDataUI: (
+ _connection: Connection,
+ data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ nu64('quoteMintAndRedeemSoftCap'),
+ ]);
+
+ const { quoteMintAndRedeemSoftCap } = dataLayout.decode(
+ Buffer.from(data),
+ ) as any;
+
+ return (
+ <>
+ {`native quote mint and redeem soft cap: ${quoteMintAndRedeemSoftCap.toLocaleString()}`}
+ >
+ );
+ },
+ },
+ 136: {
+ name: 'UXD - Disable Depository Regular Minting',
+ accounts: ['Authority', 'Controller', 'Depository'],
+ getDataUI: (
+ _connection: Connection,
+ data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ bool('disable'),
+ ]);
+
+ const { disable } = dataLayout.decode(Buffer.from(data)) as any;
+
+ return (
+ <>
+ {`disable: ${disable}`}
+ >
+ );
+ },
+ },
+ 174: {
+ name: 'UXD - Set Mango Depository Quote Mint and Redeem Fee',
+ accounts: ['Authority', 'Controller', 'Depository'],
+ getDataUI: (
+ _connection: Connection,
+ data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ u8('quoteFee'),
+ ]);
+
+ const { quoteFee } = dataLayout.decode(Buffer.from(data)) as any;
+
+ return (
+ <>
+ {`quote Fee: ${quoteFee} bps`}
+ >
+ );
+ },
+ },
+ 137: {
+ name: 'UXD - Initialize Controller',
+ accounts: [
+ 'Authority',
+ 'Payer',
+ 'Controller',
+ 'Redeemable Mint',
+ 'System Program',
+ 'Token Program',
+ 'Rent',
+ ],
+ getDataUI: (
+ _connection: Connection,
+ data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ u8('bump'),
+ u8('redeemableBump'),
+ u8('redeemableMintDecimals'),
+ ]);
+
+ const args = dataLayout.decode(Buffer.from(data)) as any;
+
+ return (
+ <>
+ {`bump: ${args.bump}`}
+ {`redeemable bump: ${args.redeemableBump}`}
+ {`redeemable mint decimals: ${args.redeemableMintDecimals.toString()}`}
+ >
+ );
+ },
+ },
+ 45: {
+ name: 'UXD - Set Redeemable Global Supply Cap',
+ accounts: ['Authority', 'Controller'],
+ getDataUI: (
+ _connection: Connection,
+ data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ u128('redeemableGlobalSupplyCap'),
+ ]);
+
+ const args = dataLayout.decode(Buffer.from(data)) as any;
+
+ return (
+ <>
+ {`Redeemable Global Supply Cap: ${nativeAmountToFormattedUiAmount(
+ new BN(args.redeemableGlobalSupplyCap.toString()),
+ UXD_DECIMALS,
+ )}`}
+ >
+ );
+ },
+ },
+ 213: {
+ name: 'UXD - Set Mango Depositories Redeemable Supply Soft Cap',
+ accounts: ['Authority', 'Controller'],
+ getDataUI: (
+ _connection: Connection,
+ data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ u128('softCap'),
+ ]);
+ const args = dataLayout.decode(Buffer.from(data)) as any;
+
+ return (
+ <>
+ {`Redeemable Supply Soft Cap: ${nativeAmountToFormattedUiAmount(
+ new BN(args.softCap.toString()),
+ UXD_DECIMALS,
+ )}`}
+ >
+ );
+ },
+ },
+ 133: {
+ name: 'UXD - Register Mango Depository',
+ accounts: [
+ 'Authority',
+ 'Payer',
+ 'Controller',
+ 'Depository',
+ 'Collateral Mint', // BTC/ WSOL.....
+ 'Insurance Mint', // USDC
+ 'Depository Collateral Passthrough Account',
+ 'Depository Insurance Passthrough Account',
+ 'Depository Mango Account',
+ 'Mango Group',
+ 'Rent',
+ 'System Program',
+ 'Token Program',
+ 'Mango Program',
+ ],
+ getDataUI: (
+ _connection: Connection,
+ data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ u8('bump'),
+ u8('collateralPassthroughBump'),
+ u8('insurancePassthroughBump'),
+ u8('mangoAccountBump'),
+ ]);
+ const args = dataLayout.decode(Buffer.from(data)) as any;
+
+ return (
+ <>
+ {`bump: ${args.bump.toString()}`}
+ {`collateralPassthroughBump: ${args.collateralPassthroughBump.toString()}`}
+ {`insurancePassthroughBump: ${args.insurancePassthroughBump.toString()}`}
+ {`mangoAccountBump: ${args.mangoAccountBump.toString()}`}
+ >
+ );
+ },
+ },
+ 198: {
+ name: 'UXD - Deposit Insurance To Mango Depository',
+ accounts: [
+ 'Authority',
+ 'Controller',
+ 'Depository',
+ 'Insurance Mint',
+ 'Authority Insurance',
+ 'Depository Insurance Passthrough Account',
+ 'Depository Mango Account',
+ // mango accounts for CPI
+ 'Mango Group',
+ 'Mango Cache',
+ 'Mango Root Bank',
+ 'Mango Node Bank',
+ 'Mango Vault',
+ //
+ 'Token Program',
+ 'Mango Program',
+ ],
+ getDataUI: async (
+ _connection: Connection,
+ data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ u64('insuranceAmount'),
+ ]);
+
+ const args = dataLayout.decode(Buffer.from(data)) as any;
+
+ return (
+ <>
+ {`Insurance Amount to deposit: ${nativeAmountToFormattedUiAmount(
+ new BN(args.insuranceAmount.toString()),
+ INSURANCE_MINTS.mainnet.USDC.decimals,
+ )}`}
+ >
+ );
+ },
+ },
+ 227: {
+ name: 'UXD - Withdraw Insurance From Mango Depository',
+ accounts: [
+ 'Authority',
+ 'Controller',
+ 'Depository',
+ 'Collateral Mint',
+ 'Quote Mint',
+ 'Authority Quote',
+ 'Depository Mango Account',
+ 'Mango Group',
+ 'Mango Cache',
+ 'Mango Signer',
+ 'Mango Root Bank',
+ 'Mango Node Bank',
+ 'Mango Vault',
+ 'System Program',
+ 'Token Program',
+ 'Mango Program',
+ ],
+ getDataUI: async (
+ connection: Connection,
+ data: Uint8Array,
+ accounts: AccountMetaData[],
+ ) => {
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ nu64('insuranceAmount'),
+ ]);
+
+ const collateralMint = accounts[3].pubkey;
+
+ const args = dataLayout.decode(Buffer.from(data)) as any;
+
+ const mintInfo = await tryGetTokenMint(connection, collateralMint);
+
+ if (!mintInfo) {
+ return (
+ <>
+ Native amount
+
+ {Number(args.insuranceAmount).toLocaleString()}
+
+ >
+ );
+ }
+
+ const uiInsuranceAmount = nativeAmountToFormattedUiAmount(
+ new BN(args.insuranceAmount.toString()),
+ mintInfo.account.decimals,
+ );
+
+ return (
+ <>
+ UI amount
+ {uiInsuranceAmount}
+ >
+ );
+ },
+ },
+ },
+};
diff --git a/components/instructions/programs/uxdProtocolStaking.tsx b/components/instructions/programs/uxdProtocolStaking.tsx
new file mode 100644
index 0000000000..080d030749
--- /dev/null
+++ b/components/instructions/programs/uxdProtocolStaking.tsx
@@ -0,0 +1,224 @@
+import { Connection } from '@solana/web3.js';
+import { nu64, struct, u32, u8 } from 'buffer-layout';
+import { AccountMetaData } from '@solana/spl-governance';
+import stakingConfiguration from '@tools/sdk/uxdProtocolStaking/configuration';
+import { tryGetMint, tryGetTokenMint } from '@utils/tokens';
+import { getMintDecimalAmountFromNatural } from '@tools/sdk/units';
+import { ANCHOR_DISCRIMINATOR_LAYOUT } from '@utils/helpers';
+
+const config = {
+ [stakingConfiguration.instructionCodes.initializeStakingCampaign]: {
+ name: 'UXD Staking - Initialize Staking Campaign',
+ accounts: [
+ 'Authority',
+ 'Payer',
+ 'Staking Campaign',
+ 'Reward Mint',
+ 'Staked Mint',
+ 'Reward Vault',
+ 'Staked Vault',
+ 'Authority Reward Ata',
+ 'System Program',
+ 'Token Program',
+ 'Associated Token Program',
+ 'Rent',
+ ],
+ getDataUI: async (
+ connection: Connection,
+ data: Uint8Array,
+ accounts: AccountMetaData[],
+ ) => {
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ nu64('startTs'),
+ u8('optionEndTs'),
+ ...(data.length === 33 ? [nu64('endTs')] : []),
+ nu64('rewardDepositAmount'),
+ ]);
+
+ const rewardMint = accounts[3].pubkey;
+ const stakedMint = accounts[4].pubkey;
+
+ const mintInfo = await tryGetMint(connection, rewardMint);
+
+ if (!mintInfo)
+ throw new Error(`Cannot load mintInfo ${rewardMint.toBase58()}`);
+
+ const args = dataLayout.decode(Buffer.from(data)) as any;
+
+ const { startTs, endTs, rewardDepositAmount } = args;
+
+ const startDate = new Date(Number(startTs) * 1000).toUTCString();
+ const endDate = endTs
+ ? new Date(Number(endTs) * 1000).toUTCString()
+ : '-';
+
+ const rewardDepositAmountUi = getMintDecimalAmountFromNatural(
+ mintInfo.account,
+ rewardDepositAmount,
+ )
+ .toNumber()
+ .toLocaleString();
+
+ return (
+ <>
+ {`start of the campaign: ${startDate}`}
+ {`end of the campaign: ${endDate}`}
+ {`reward deposit amount: ${rewardDepositAmountUi}`}
+ {`reward mint: ${rewardMint.toBase58()}`}
+ {`staked mint: ${stakedMint.toBase58()}`}
+ >
+ );
+ },
+ },
+
+ [stakingConfiguration.instructionCodes.addStakingOption]: {
+ name: 'UXD Staking - Add Staking Options',
+ accounts: ['Authority', 'Payer', 'Staking Campaign'],
+ getDataUI: async (
+ _connection: Connection,
+ data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ // 12 Byte is the header that is always there
+ // 16 bytes = 8 for lockupSecs, 8 for apr
+ const nbOptions = (data.length - 12) / 16;
+
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ u32('nbOption'),
+
+ ...Array.from(new Array(nbOptions)).reduce((acc, _, index) => {
+ return [...acc, nu64(`lockupSecs${index}`), nu64(`apr${index}`)];
+ }, []),
+ ]);
+
+ const args = dataLayout.decode(Buffer.from(data)) as any;
+
+ return (
+ <>
+ {Array.from(new Array(nbOptions)).map((_, index) => {
+ return (
+ <>
+ {`option ${index + 1} lockup time in seconds: ${Number(
+ args[`lockupSecs${index}`],
+ ).toLocaleString()}`}
+
+ {`option ${index + 1} apr: ${
+ args[`apr${index}`] / (stakingConfiguration.APR_BASIS / 100)
+ }%`}
+ >
+ );
+ })}
+ >
+ );
+ },
+ },
+
+ [stakingConfiguration.instructionCodes.activateStakingOption]: {
+ name: 'UXD Staking - Activate Staking Options',
+ accounts: ['Authority', 'Payer', 'Staking Campaign'],
+ getDataUI: async (
+ _connection: Connection,
+ data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ u8('stakingOptionIdentifier'),
+ u8('activate'),
+ ]);
+
+ const args = dataLayout.decode(Buffer.from(data)) as any;
+
+ const { stakingOptionIdentifier, activate } = args;
+
+ return (
+ <>
+ {`staking option identifier: ${stakingOptionIdentifier.toString()}`}
+ {`status: ${activate === 0 ? 'DEACTIVATE' : 'ACTIVATE'}`}
+ >
+ );
+ },
+ },
+
+ [stakingConfiguration.instructionCodes.finalizeStakingCampaign]: {
+ name: 'UXD Staking - Finalize Staking Campaign',
+ accounts: [
+ 'Authority',
+ 'Payer',
+ 'Staking Campaign',
+ 'Reward Mint',
+ 'Reward Vault',
+ 'Authority Reward Ata',
+ 'System Program',
+ 'Token Program',
+ 'Associated Token Program',
+ 'Rent',
+ ],
+ getDataUI: async (
+ _connection: Connection,
+ _data: Uint8Array,
+ _accounts: AccountMetaData[],
+ ) => {
+ return null;
+ },
+ },
+
+ [stakingConfiguration.instructionCodes.refillRewardVault]: {
+ name: 'UXD Staking - Refill Reward Vault',
+ accounts: [
+ 'Authority',
+ 'Payer',
+ 'Staking Campaign',
+ 'Reward Vault',
+ 'Authority Reward Ata',
+ 'Token Program',
+ ],
+ getDataUI: async (
+ connection: Connection,
+ data: Uint8Array,
+ accounts: AccountMetaData[],
+ ) => {
+ const dataLayout = struct([
+ u8('instruction'),
+ ...ANCHOR_DISCRIMINATOR_LAYOUT,
+ nu64('rewardRefillAmount'),
+ ]);
+
+ const rewardVault = accounts[3].pubkey;
+
+ const args = dataLayout.decode(Buffer.from(data)) as any;
+
+ const mintInfo = await tryGetTokenMint(connection, rewardVault);
+
+ if (!mintInfo)
+ throw new Error(
+ `Cannot load account mint info ${rewardVault.toBase58()}`,
+ );
+
+ const { rewardRefillAmount } = args;
+
+ const rewardRefillAmountUi = getMintDecimalAmountFromNatural(
+ mintInfo.account,
+ rewardRefillAmount,
+ )
+ .toNumber()
+ .toLocaleString();
+
+ return (
+ <>
+ {`reward refill amount: ${rewardRefillAmountUi}`}
+ >
+ );
+ },
+ },
+};
+
+export const UXD_PROTOCOL_STAKING_INSTRUCTIONS = {
+ [stakingConfiguration.programId.devnet!.toBase58()]: config,
+ [stakingConfiguration.programId.mainnet!.toBase58()]: config,
+};
diff --git a/components/instructions/programs/voteStakeRegistry.tsx b/components/instructions/programs/voteStakeRegistry.tsx
index 113eee29dc..5338482516 100644
--- a/components/instructions/programs/voteStakeRegistry.tsx
+++ b/components/instructions/programs/voteStakeRegistry.tsx
@@ -1,37 +1,37 @@
-import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client'
-import { Wallet } from '@marinade.finance/marinade-ts-sdk'
-import { BN, Provider } from '@project-serum/anchor'
-import { AccountMetaData } from '@solana/spl-governance'
-import { Connection, Keypair, PublicKey } from '@solana/web3.js'
-import { fmtMintAmount } from '@tools/sdk/units'
-import tokenService from '@utils/services/token'
-import { tryGetMint } from '@utils/tokens'
-import { tryGetRegistrar, tryGetVoter } from 'VoteStakeRegistry/sdk/api'
+import { VsrClient } from '@blockworks-foundation/voter-stake-registry-client';
+import { Wallet } from '@marinade.finance/marinade-ts-sdk';
+import { BN, Provider } from '@project-serum/anchor';
+import { AccountMetaData } from '@solana/spl-governance';
+import { Connection, Keypair, PublicKey } from '@solana/web3.js';
+import { fmtMintAmount } from '@tools/sdk/units';
+import tokenService from '@utils/services/token';
+import { tryGetMint } from '@utils/tokens';
+import { tryGetRegistrar, tryGetVoter } from 'VoteStakeRegistry/sdk/api';
import {
DAYS_PER_MONTH,
getFormattedStringFromDays,
secsToDays,
SECS_PER_DAY,
-} from 'VoteStakeRegistry/tools/dateTools'
-import { calcMultiplier } from 'VoteStakeRegistry/tools/deposits'
+} from 'VoteStakeRegistry/tools/dateTools';
+import { calcMultiplier } from 'VoteStakeRegistry/tools/deposits';
interface ClawbackInstruction {
- depositEntryIndex: number
+ depositEntryIndex: number;
}
interface VotingMintCfgInstruction {
- idx: number
- digitShift: number
- baselineVoteWeightScaledFactor: BN
- maxExtraLockupVoteWeightScaledFactor: BN
- lockupSaturationSecs: BN
- grantAuthority: PublicKey
+ idx: number;
+ digitShift: number;
+ baselineVoteWeightScaledFactor: BN;
+ maxExtraLockupVoteWeightScaledFactor: BN;
+ lockupSaturationSecs: BN;
+ grantAuthority: PublicKey;
}
interface GrantInstruction {
- periods: number
- kind: object
- amount: BN
- startTs: BN
- allowClawback: boolean
+ periods: number;
+ kind: object;
+ amount: BN;
+ startTs: BN;
+ allowClawback: boolean;
}
export const VOTE_STAKE_REGISTRY_INSTRUCTIONS = {
@@ -49,30 +49,33 @@ export const VOTE_STAKE_REGISTRY_INSTRUCTIONS = {
getDataUI: async (
connection: Connection,
data: Uint8Array,
- accounts: AccountMetaData[]
+ accounts: AccountMetaData[],
) => {
try {
- const options = Provider.defaultOptions()
+ const options = Provider.defaultOptions();
const provider = new Provider(
connection,
new Wallet(Keypair.generate()),
- options
- )
- const vsrClient = await VsrClient.connect(provider)
+ options,
+ );
+ const vsrClient = await VsrClient.connect(provider);
const decodedInstructionData = vsrClient.program.coder.instruction.decode(
- Buffer.from(data)
- )?.data as ClawbackInstruction | null
- const existingVoter = await tryGetVoter(accounts[2].pubkey, vsrClient)
+ Buffer.from(data),
+ )?.data as ClawbackInstruction | null;
+ const existingVoter = await tryGetVoter(
+ accounts[2].pubkey,
+ vsrClient,
+ );
const deposit = decodedInstructionData
? existingVoter?.deposits[decodedInstructionData.depositEntryIndex]
- : null
+ : null;
const existingRegistrar = await tryGetRegistrar(
accounts[0].pubkey,
- vsrClient
- )
+ vsrClient,
+ );
const mintPk =
- existingRegistrar?.votingMints[deposit!.votingMintConfigIdx].mint
- const mint = await tryGetMint(connection, mintPk!)
+ existingRegistrar?.votingMints[deposit!.votingMintConfigIdx].mint;
+ const mint = await tryGetMint(connection, mintPk!);
return (
@@ -82,10 +85,10 @@ export const VOTE_STAKE_REGISTRY_INSTRUCTIONS = {
{fmtMintAmount(mint?.account, deposit!.amountDepositedNative)}
- )
+ );
} catch (e) {
- console.log(e)
- return {JSON.stringify(data)}
+ console.error(e);
+ return {JSON.stringify(data)}
;
}
},
},
@@ -100,7 +103,7 @@ export const VOTE_STAKE_REGISTRY_INSTRUCTIONS = {
{ name: 'Payer' },
],
getDataUI: async () => {
- return
+ return ;
},
},
113: {
@@ -112,21 +115,21 @@ export const VOTE_STAKE_REGISTRY_INSTRUCTIONS = {
],
getDataUI: async (connection: Connection, data: Uint8Array) => {
try {
- const options = Provider.defaultOptions()
+ const options = Provider.defaultOptions();
const provider = new Provider(
connection,
new Wallet(Keypair.generate()),
- options
- )
- const vsrClient = await VsrClient.connect(provider)
+ options,
+ );
+ const vsrClient = await VsrClient.connect(provider);
const decodedInstructionData = vsrClient.program.coder.instruction.decode(
- Buffer.from(data)
- )?.data as VotingMintCfgInstruction
+ Buffer.from(data),
+ )?.data as VotingMintCfgInstruction;
const {
maxExtraLockupVoteWeightScaledFactor,
lockupSaturationSecs,
baselineVoteWeightScaledFactor,
- } = decodedInstructionData
+ } = decodedInstructionData;
return (
Index: {decodedInstructionData?.idx}
@@ -145,7 +148,7 @@ export const VOTE_STAKE_REGISTRY_INSTRUCTIONS = {
Max lockup time:{' '}
{decodedInstructionData &&
getFormattedStringFromDays(
- secsToDays(lockupSaturationSecs.toNumber())
+ secsToDays(lockupSaturationSecs.toNumber()),
)}{' '}
(secs: {lockupSaturationSecs.toNumber()})
@@ -163,10 +166,10 @@ export const VOTE_STAKE_REGISTRY_INSTRUCTIONS = {
{decodedInstructionData?.grantAuthority.toBase58()}
- )
+ );
} catch (e) {
- console.log(e)
- return {JSON.stringify(data)}
+ console.error(e);
+ return {JSON.stringify(data)}
;
}
},
},
@@ -187,26 +190,26 @@ export const VOTE_STAKE_REGISTRY_INSTRUCTIONS = {
getDataUI: async (
connection: Connection,
data: Uint8Array,
- accounts: AccountMetaData[]
+ accounts: AccountMetaData[],
) => {
try {
- const options = Provider.defaultOptions()
+ const options = Provider.defaultOptions();
const provider = new Provider(
connection,
new Wallet(Keypair.generate()),
- options
- )
- const vsrClient = await VsrClient.connect(provider)
+ options,
+ );
+ const vsrClient = await VsrClient.connect(provider);
const decodedInstructionData = vsrClient.program.coder.instruction.decode(
- Buffer.from(data)
- )?.data as GrantInstruction | null
- const mintPk = accounts[9].pubkey
- const mint = await tryGetMint(connection, mintPk!)
+ Buffer.from(data),
+ )?.data as GrantInstruction | null;
+ const mintPk = accounts[9].pubkey;
+ const mint = await tryGetMint(connection, mintPk!);
const lockupKind = decodedInstructionData
? Object.keys(decodedInstructionData?.kind)[0]
- : null
- const periods = decodedInstructionData?.periods
- const logoUrl = tokenService.getTokenInfo(mintPk.toBase58())?.logoURI
+ : null;
+ const periods = decodedInstructionData?.periods;
+ const logoUrl = tokenService.getTokenInfo(mintPk.toBase58())?.logoURI;
return (
<>
{decodedInstructionData ? (
@@ -217,7 +220,7 @@ export const VOTE_STAKE_REGISTRY_INSTRUCTIONS = {
Amount:{' '}
{fmtMintAmount(
mint!.account,
- decodedInstructionData.amount
+ decodedInstructionData.amount,
)}
{lockupKind === 'monthly' && periods && (
@@ -225,7 +228,7 @@ export const VOTE_STAKE_REGISTRY_INSTRUCTIONS = {
Vested:{' '}
{fmtMintAmount(
mint!.account,
- decodedInstructionData.amount.div(new BN(periods))
+ decodedInstructionData.amount.div(new BN(periods)),
)}{' '}
p/m
@@ -238,7 +241,7 @@ export const VOTE_STAKE_REGISTRY_INSTRUCTIONS = {
Start date:{' '}
{new Date(
- decodedInstructionData.startTs.toNumber() * 1000
+ decodedInstructionData.startTs.toNumber() * 1000,
).toDateString()}
{periods && (
@@ -248,7 +251,7 @@ export const VOTE_STAKE_REGISTRY_INSTRUCTIONS = {
decodedInstructionData.startTs.toNumber() * 1000 +
(lockupKind === 'monthly'
? periods * DAYS_PER_MONTH * SECS_PER_DAY * 1000
- : periods * SECS_PER_DAY * 1000)
+ : periods * SECS_PER_DAY * 1000),
).toDateString()}
)}
@@ -262,12 +265,12 @@ export const VOTE_STAKE_REGISTRY_INSTRUCTIONS = {
{JSON.stringify(data)}
)}
>
- )
+ );
} catch (e) {
- console.log(e)
- return {JSON.stringify(data)}
+ console.error(e);
+ return {JSON.stringify(data)}
;
}
},
},
},
-}
+};
diff --git a/components/instructions/tools.tsx b/components/instructions/tools.tsx
index d82f08be48..1caf6221c5 100644
--- a/components/instructions/tools.tsx
+++ b/components/instructions/tools.tsx
@@ -4,107 +4,58 @@ import {
// TransactionInstruction,
// Account,
// Transaction,
-} from '@solana/web3.js'
-import { AccountMetaData, InstructionData } from '@solana/spl-governance'
-
-import { BPF_UPGRADEABLE_LOADER_INSTRUCTIONS } from './programs/bpfUpgradeableLoader'
-import { GOVERNANCE_INSTRUCTIONS } from './programs/governance'
-import { MANGO_INSTRUCTIONS } from './programs/mango'
-import { getProgramName, isGovernanceProgram } from './programs/names'
-import { RAYDIUM_INSTRUCTIONS } from './programs/raydium'
-import { SPL_TOKEN_INSTRUCTIONS } from './programs/splToken'
-import { SYSTEM_INSTRUCTIONS } from './programs/system'
-import { VOTE_STAKE_REGISTRY_INSTRUCTIONS } from './programs/voteStakeRegistry'
-import { MARINADE_INSTRUCTIONS } from './programs/marinade'
-import { SOLEND_PROGRAM_INSTRUCTIONS } from './programs/solend'
-import { ATA_PROGRAM_INSTRUCTIONS } from './programs/associatedTokenAccount'
+} from '@solana/web3.js';
+import { AccountMetaData, InstructionData } from '@solana/spl-governance';
+
+import { BPF_UPGRADEABLE_LOADER_INSTRUCTIONS } from './programs/bpfUpgradeableLoader';
+import { GOVERNANCE_INSTRUCTIONS } from './programs/governance';
+import { MANGO_INSTRUCTIONS } from './programs/mango';
+import { getProgramName, isGovernanceProgram } from './programs/names';
+import { RAYDIUM_INSTRUCTIONS } from './programs/raydium';
+import { QUARRY_MINE_PROGRAM_INSTRUCTIONS } from './programs/quarry';
+import { SPL_TOKEN_INSTRUCTIONS } from './programs/splToken';
+import { SABER_POOLS_PROGRAM_INSTRUCTIONS } from './programs/saberPools';
+import { SOCEAN_PROGRAM_INSTRUCTIONS } from './programs/socean';
+import { UXD_PROGRAM_INSTRUCTIONS } from './programs/uxdProtocol';
+import { SYSTEM_INSTRUCTIONS } from './programs/system';
+import { VOTE_STAKE_REGISTRY_INSTRUCTIONS } from './programs/voteStakeRegistry';
+import { MARINADE_INSTRUCTIONS } from './programs/marinade';
+import { SOLEND_PROGRAM_INSTRUCTIONS } from './programs/solend';
+import { ATA_PROGRAM_INSTRUCTIONS } from './programs/associatedTokenAccount';
+import { UXD_PROTOCOL_STAKING_INSTRUCTIONS } from './programs/uxdProtocolStaking';
+import { LIFINITY_PROGRAM_INSTRUCTIONS } from './programs/lifinity';
+import { TRIBECA_PROGRAM_INSTRUCTIONS } from './programs/tribeca';
+import { MAPLE_FINANCE_PROGRAM_INSTRUCTIONS } from './programs/mapleFinance';
+import { FRIKTION_PROGRAM_INSTRUCTIONS } from './programs/friktion';
+import { DELTAFI_PROGRAM_INSTRUCTIONS } from './programs/deltafi';
+import { ORCA_PROGRAM_INSTRUCTIONS } from './programs/orca';
/**
* Default governance program id instance
*/
export const DEFAULT_GOVERNANCE_PROGRAM_ID =
- 'GovER5Lthms3bLBqWub97yVrMmEogzX7xNjdXpPPCVZw'
+ 'GovER5Lthms3bLBqWub97yVrMmEogzX7xNjdXpPPCVZw';
/**
* Default TEST governance program id instance
*/
export const DEFAULT_TEST_GOVERNANCE_PROGRAM_ID =
- 'GTesTBiEWE32WHXXE2S4XbZvA5CrEc4xs6ZgRe895dP'
+ 'GTesTBiEWE32WHXXE2S4XbZvA5CrEc4xs6ZgRe895dP';
// Well known account names displayed on the instruction card
export const ACCOUNT_NAMES = {
- Guiwem4qBivtkSFrxZAEfuthBz6YuWyCwS4G3fjBYu5Z: 'Mango DAO MNGO Treasury Vault',
- '9RGoboEjmaAjSCXsKi6p6zJucnwF3Eg5NUN9jPS6ziL3':
- 'Mango DAO MNGO Treasury Governance',
- '4PdEyhrV3gaUj4ffwjKGXBLo42jF2CQCCBoXenwCRWXf':
- 'Mango DAO USDC Treasury Vault',
- '65u1A86RC2U6whcHeD2mRG1tXCSmH2GsiktmEFQmzZgq':
- 'Mango DAO USDC Treasury Governance',
- '4WQSYg21RrJNYhF4251XFpoy1uYbMHcMfZNLMXA3x5Mp':
- 'Mango DAO Voter Stake Registry Registrar',
- DPiH3H3c7t47BMxqTxLsuPQpEC6Kne8GA9VXbxpnZxFE: 'Mango DAO Governance Realm',
- '7Sn4TN4ZkMghVBAhZ88UkyzXoYkMScaE6qtk9eWV3rJz':
- 'Mango DAO Governance Realm Authority',
- '59BEyxwrFpt3x4sZ7TcXC3bHx3seGfqGkATcDx6siLWy':
- 'Mango v3 Insurance Fund Vault',
- '9qFV99WD5TKnpYw8w3xz3mgMBR5anoSZo2BynrGmNZqY': 'Mango v3 Revenue Vault',
- '6GX2brfV7byA8bCurwgcqiGxNEgzjUmdYgarYZZr2MKe': 'Mango v3 Revenue Governance',
- CF8sDcPztLDkvnEbYnCaXiDxhUpZ2uKLStpmFfRDNxSd:
- 'Mango v3 BTC-PERP Incentive Vault',
- '7Gm5zF6FNJpyhqdwKcEdMQw3r5YzitYUGVDKYMPT1cMy': 'Mango v3 Program Governance',
- MangoCzJ36AjZyKwVj3VnYU4GTonjfVEnJmvvWaxLac: 'MNGO Token Mint',
- EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v: 'USDC Token Mint',
-
- MyHd6a7HWKTMeJMHBkrbMq4hZwZxwn9x7dxXcopQ4Wd: 'OMH Token',
- '2A7UgheVhmoQqXBAQyG1wCoMpooPuiUf2DK6XFiQTtbG': 'OMH Mint Governance',
-
- // Metaplex Foundation
- Cmtpx4jmkc9ShvWub4hcAvCqrqvWRpWW9eLUdruyZAN8:
- 'Metaplex Foundation Council Mint',
- '2yf8YggL4cUhCygoppFMWWeBuJtmLQE9oHkiiUnXP1uM':
- 'Metaplex Foundation Council Mint Governance',
- mtpXxYKnxwJJReD3PiZ1NLCfbMkHgNcJeGsdXFTfoBk:
- 'Metaplex Foundation Community Mint',
- '2ZxVbyU35dqtMHgLbZZPoGURf2XuPVmSgmVHY8bTfiMC':
- 'Metaplex Foundation Community Mint Governance',
-
- // Metaplex Genesis
- CMPxgYJPXRA8BRfC41uvv6YvpQwtFvLeV9PXjSLpNhYq: 'Metaplex Genesis Council Mint',
- '68NxN1Vo2TLhA3H33yBjwQE5D5UxqB2iL1HL4dgHyF66':
- 'Metaplex Genesis Council Mint Governance',
- mpXGnkKdGs1eRZPKkBQ3GW5G4LsVgcX4RzGa5WPo67v:
- 'Metaplex Genesis Community Mint',
- '4A9WiAZyXpBBEYaBv3UNQCKTqmDth7fukGnBoprLLH2i':
- 'Metaplex Genesis Community Mint Governance',
-
- Cfafd52FfHRA5FRkTXmMNyHZfhNkbaHpZ12ggmeTVEMw:
- 'Friends and Family Council Mint',
- FAFDfoUkaxoMqiNur9F1iigdBNrXFf4uNmS5XrhMewvf:
- 'Friends and Family Community Mint',
-
- // GM DAO
- '7WbRWL33mM3pbFLvuqNjBztihQtHWWFPGr4HLHyqViG9': 'Team funds',
- DWhnQm42vCBLkA9RsrBB2spyR3uAJq1BGeroyNMKgnEh: 'Marketing funds',
-
- // GSAIL
- '39J1sWHCJgWab8pn6zpTqFCYRXTYVqbEkpLimrq8kTYJ':
- 'GSAIL VAULT 2022-2026 VESTING SCHEDULE',
- GAMpPYx4DcJdPhnr7sM84gxym4NiNpzo4G6WufpRLemP: 'GSAIL TREASURY VAULT',
-
- // Marinade DAO
- B7ux5n2LYxJhS2TsMAcE98eMbkY3dBHUWyrZPBnDmMT5: 'MNDE Treasury',
- GewCM8ipoPnEraZZqEp6VgVPLZfxr8xwJREmidXVU1EH: 'mSOL Treasury',
-
- // MonkOG DAO
- CVuCjHrqj97fSTsnSKzEBVPeYzXEEv6uiRjzBLRvnouj: 'MonkOG DAO Treasury Vault',
-
- // MMCC ClubDAO
- '92tozWPkbybEjPeiGpNFL8onAnT739cxLRQofGVnrmm6': 'ClubDAO DCF Revenue Vault',
- A6HXL3WMWT4gB1QvYJfZgDp2ufTfLkWBaX6Theakdf5h:
- 'ClubDAO Main SOL Treasury Vault',
- '9UbiR69cKVVtQEejb5pzwSNJFrtr7pjRoygGaBBjUtpR': 'ClubDAO RB Revenue Vault',
- Dn1G2mh9VdZg9VoX62i545domg25Jbvx7VwuiXNyV6Qe:
- 'ClubDAO Main NFT Treasury Vault ',
-}
+ //UXD DAO
+ '9SAveSCmGTVR9csAjK45keGitb1kdsC22Pb1AFdoUcSD': 'USDC Treasury Vault',
+ '89WLRw7xc6XEC3hdo89fSb8boAxAJu9wYVFok8JEDSJa':
+ 'USDC Secondary Treasury Vault',
+ GEkb8xU5DrPw4TW75BgoRbqUeuyKpsZ4Q2RHMX9M74W5: 'UXP Treasury Vault',
+ '39qcqpaiLivyFLBLh4wvPmLrs336BBpXkKYb88i8dSiJ': 'UXD Council Token',
+ '4dQ66QipF693wXjf832n1PXvAVz1A252P8EoSY2CFqjg': 'SBR Treasury Vault',
+ '6VfHhLym1TjQhD64ZL8Qi5eMVcCzgkUsa8evEKGKRXto': 'SOL Treasury Vault',
+ E2SZHFGNbNpaQv62RQb6AcDu6c1EBBC7tG3xsQMk2XKB: 'SUNNY Treasury Vault',
+ // Tricks to display the hot wallet name, Please recode this
+ '89j5yTsuqCpdeJUW566FrkVrpEwMHpqUvm47yanBsh7b':
+ 'SOL Treasury Vault / Hot Wallet',
+};
// Blacklisted governances which should not be displayed in the UI
// TODO: Add this to on-chain metadata to Governance account
@@ -114,49 +65,49 @@ export const HIDDEN_GOVERNANCES = new Map([
['2j2oe8YXdYJyS7G8CeEW5KARijdjjZkuPy5MnN8gBQqQ', ''],
['56yqzBEr9BqDGjYPJz9G8LVQrbXsQM2t2Yq3Gk8S56d1', ''],
['4styeLGsBRpV4xKsCNMRPb94U7JN8ZXoXJTLZA5hdjo9', ''],
-])
+]);
// Blacklisted proposals which should not be displayed in the UI
// TODO: Add this to on-chain metadata to Proposal account
export const HIDDEN_PROPOSALS = new Map([
['E8XgiVpDJgDf4XgBKjZnMs3S1K7cmibtbDqjw5aNobCZ', ''],
-])
+]);
export const DEFAULT_NFT_TREASURY_MINT =
- 'GNFTm5rz1Kzvq94G7DJkcrEUnCypeQYf7Ya8arPoHWvw'
+ 'GNFTm5rz1Kzvq94G7DJkcrEUnCypeQYf7Ya8arPoHWvw';
export const DEFAULT_NATIVE_SOL_MINT =
- 'GSoLvSToqaUmMyqP12GffzcirPAickrpZmVUFtek6x5u'
+ 'GSoLvSToqaUmMyqP12GffzcirPAickrpZmVUFtek6x5u';
export function getAccountName(accountPk: PublicKey) {
- return ACCOUNT_NAMES[accountPk.toBase58()] ?? getProgramName(accountPk)
+ return ACCOUNT_NAMES[accountPk.toBase58()] ?? getProgramName(accountPk);
}
export const CHAT_PROGRAM_ID = new PublicKey(
- '7fjWgipzcHFP3c5TMMWumFHNAL5Eme1gFqqRGnNPbbfG'
-)
+ '7fjWgipzcHFP3c5TMMWumFHNAL5Eme1gFqqRGnNPbbfG',
+);
-export const WSOL_MINT = 'So11111111111111111111111111111111111111112'
+export const WSOL_MINT = 'So11111111111111111111111111111111111111112';
export interface AccountDescriptor {
- name: string
- important?: boolean
+ name: string;
+ important?: boolean;
}
export interface InstructionDescriptorFactory {
- name: string
- accounts: AccountDescriptor[]
+ name: string;
+ accounts: AccountDescriptor[];
getDataUI: (
connection: Connection,
data: Uint8Array,
- accounts: AccountMetaData[]
- ) => Promise
+ accounts: AccountMetaData[],
+ ) => Promise;
}
export interface InstructionDescriptor {
- name: string
- accounts: AccountDescriptor[]
- dataUI: JSX.Element
+ name: string;
+ accounts: AccountDescriptor[];
+ dataUI: JSX.Element;
}
// Well known program instructions displayed on the instruction card
@@ -165,40 +116,52 @@ export const INSTRUCTION_DESCRIPTORS = {
...BPF_UPGRADEABLE_LOADER_INSTRUCTIONS,
...MANGO_INSTRUCTIONS,
...RAYDIUM_INSTRUCTIONS,
+ ...UXD_PROGRAM_INSTRUCTIONS,
+ ...QUARRY_MINE_PROGRAM_INSTRUCTIONS,
+ ...SABER_POOLS_PROGRAM_INSTRUCTIONS,
+ ...SOCEAN_PROGRAM_INSTRUCTIONS,
...MARINADE_INSTRUCTIONS,
...SOLEND_PROGRAM_INSTRUCTIONS,
...ATA_PROGRAM_INSTRUCTIONS,
...SYSTEM_INSTRUCTIONS,
...VOTE_STAKE_REGISTRY_INSTRUCTIONS,
-}
+ ...UXD_PROTOCOL_STAKING_INSTRUCTIONS,
+ ...LIFINITY_PROGRAM_INSTRUCTIONS,
+ ...TRIBECA_PROGRAM_INSTRUCTIONS,
+ ...MAPLE_FINANCE_PROGRAM_INSTRUCTIONS,
+ ...FRIKTION_PROGRAM_INSTRUCTIONS,
+ ...DELTAFI_PROGRAM_INSTRUCTIONS,
+ ...ORCA_PROGRAM_INSTRUCTIONS,
+};
export async function getInstructionDescriptor(
connection: Connection,
- instruction: InstructionData
+ instruction: InstructionData,
) {
- let descriptors: any
+ let descriptors: any;
if (isGovernanceProgram(instruction.programId)) {
descriptors =
- GOVERNANCE_INSTRUCTIONS['GovER5Lthms3bLBqWub97yVrMmEogzX7xNjdXpPPCVZw']
+ GOVERNANCE_INSTRUCTIONS['GovER5Lthms3bLBqWub97yVrMmEogzX7xNjdXpPPCVZw'];
} else {
- descriptors = INSTRUCTION_DESCRIPTORS[instruction.programId.toBase58()]
+ descriptors = INSTRUCTION_DESCRIPTORS[instruction.programId.toBase58()];
}
// Make it work for program with one instruction like ATA program
// and for the one with multiple instructions
const descriptor = !instruction.data.length
? descriptors
- : descriptors && descriptors[instruction.data[0]]
+ : descriptors && descriptors[instruction.data[0]];
+
const dataUI = (descriptor?.getDataUI &&
(await descriptor?.getDataUI(
connection,
instruction.data,
instruction.accounts,
- instruction.programId
- ))) ?? <>{JSON.stringify(instruction.data)}>
+ instruction.programId,
+ ))) ?? <>{JSON.stringify(instruction.data)}>;
return {
name: descriptor?.name,
accounts: descriptor?.accounts,
dataUI,
- }
+ };
}
diff --git a/docs/.gitignore b/docs/.gitignore
deleted file mode 100644
index b2d6de3062..0000000000
--- a/docs/.gitignore
+++ /dev/null
@@ -1,20 +0,0 @@
-# Dependencies
-/node_modules
-
-# Production
-/build
-
-# Generated files
-.docusaurus
-.cache-loader
-
-# Misc
-.DS_Store
-.env.local
-.env.development.local
-.env.test.local
-.env.production.local
-
-npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
diff --git a/docs/README.md b/docs/README.md
deleted file mode 100644
index aaba2fa1e1..0000000000
--- a/docs/README.md
+++ /dev/null
@@ -1,41 +0,0 @@
-# Website
-
-This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
-
-### Installation
-
-```
-$ yarn
-```
-
-### Local Development
-
-```
-$ yarn start
-```
-
-This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
-
-### Build
-
-```
-$ yarn build
-```
-
-This command generates static content into the `build` directory and can be served using any static contents hosting service.
-
-### Deployment
-
-Using SSH:
-
-```
-$ USE_SSH=true yarn deploy
-```
-
-Not using SSH:
-
-```
-$ GIT_USER= yarn deploy
-```
-
-If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
diff --git a/docs/babel.config.js b/docs/babel.config.js
deleted file mode 100644
index 6752648189..0000000000
--- a/docs/babel.config.js
+++ /dev/null
@@ -1,3 +0,0 @@
-module.exports = {
- presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
-}
diff --git a/docs/docs/intro.md b/docs/docs/intro.md
deleted file mode 100644
index 10819cfc3b..0000000000
--- a/docs/docs/intro.md
+++ /dev/null
@@ -1,36 +0,0 @@
----
-sidebar_position: 1
-slug: /
----
-
-# Tutorial Intro
-
-Let's discover **Docusaurus in less than 5 minutes**.
-
-## Getting Started
-
-Get started by **creating a new site**.
-
-Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**.
-
-## Generate a new site
-
-Generate a new Docusaurus site using the **classic template**:
-
-```shell
-npm init docusaurus@latest my-website classic
-```
-
-## Start your site
-
-Run the development server:
-
-```shell
-cd my-website
-
-npx docusaurus start
-```
-
-Your site starts at `http://localhost:3000`.
-
-Open `docs/intro.md` and edit some lines: the site **reloads automatically** and displays your changes.
diff --git a/docs/docs/tutorial-basics/_category_.json b/docs/docs/tutorial-basics/_category_.json
deleted file mode 100644
index 135e4a6858..0000000000
--- a/docs/docs/tutorial-basics/_category_.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "label": "Tutorial - Basics",
- "position": 2
-}
diff --git a/docs/docs/tutorial-basics/congratulations.md b/docs/docs/tutorial-basics/congratulations.md
deleted file mode 100644
index 9ef99bbadd..0000000000
--- a/docs/docs/tutorial-basics/congratulations.md
+++ /dev/null
@@ -1,21 +0,0 @@
----
-sidebar_position: 6
----
-
-# Congratulations!
-
-You have just learned the **basics of Docusaurus** and made some changes to the **initial template**.
-
-Docusaurus has **much more to offer**!
-
-Have **5 more minutes**? Take a look at **[versioning](../tutorial-extras/manage-docs-versions.md)** and **[i18n](../tutorial-extras/translate-your-site.md)**.
-
-Anything **unclear** or **buggy** in this tutorial? [Please report it!](https://github.com/facebook/docusaurus/discussions/4610)
-
-## What's next?
-
-- Read the [official documentation](https://docusaurus.io/).
-- Add a custom [Design and Layout](https://docusaurus.io/docs/styling-layout)
-- Add a [search bar](https://docusaurus.io/docs/search)
-- Find inspirations in the [Docusaurus showcase](https://docusaurus.io/showcase)
-- Get involved in the [Docusaurus Community](https://docusaurus.io/community/support)
diff --git a/docs/docs/tutorial-basics/create-a-blog-post.md b/docs/docs/tutorial-basics/create-a-blog-post.md
deleted file mode 100644
index 0d50aaf316..0000000000
--- a/docs/docs/tutorial-basics/create-a-blog-post.md
+++ /dev/null
@@ -1,34 +0,0 @@
----
-sidebar_position: 3
----
-
-# Create a Blog Post
-
-Docusaurus creates a **page for each blog post**, but also a **blog index page**, a **tag system**, an **RSS** feed...
-
-## Create your first Post
-
-Create a file at `blog/2021-02-28-greetings.md`:
-
-```md title="blog/2021-02-28-greetings.md"
----
-slug: greetings
-title: Greetings!
-authors:
- - name: Joel Marcey
- title: Co-creator of Docusaurus 1
- url: https://github.com/JoelMarcey
- image_url: https://github.com/JoelMarcey.png
- - name: Sébastien Lorber
- title: Docusaurus maintainer
- url: https://sebastienlorber.com
- image_url: https://github.com/slorber.png
-tags: [greetings]
----
-
-Congratulations, you have made your first post!
-
-Feel free to play around and edit this post as much you like.
-```
-
-A new blog post is now available at `http://localhost:3000/blog/greetings`.
diff --git a/docs/docs/tutorial-basics/create-a-document.md b/docs/docs/tutorial-basics/create-a-document.md
deleted file mode 100644
index feaced79d0..0000000000
--- a/docs/docs/tutorial-basics/create-a-document.md
+++ /dev/null
@@ -1,55 +0,0 @@
----
-sidebar_position: 2
----
-
-# Create a Document
-
-Documents are **groups of pages** connected through:
-
-- a **sidebar**
-- **previous/next navigation**
-- **versioning**
-
-## Create your first Doc
-
-Create a markdown file at `docs/hello.md`:
-
-```md title="docs/hello.md"
-# Hello
-
-This is my **first Docusaurus document**!
-```
-
-A new document is now available at `http://localhost:3000/docs/hello`.
-
-## Configure the Sidebar
-
-Docusaurus automatically **creates a sidebar** from the `docs` folder.
-
-Add metadata to customize the sidebar label and position:
-
-```md title="docs/hello.md" {1-4}
----
-sidebar_label: 'Hi!'
-sidebar_position: 3
----
-
-# Hello
-
-This is my **first Docusaurus document**!
-```
-
-It is also possible to create your sidebar explicitly in `sidebars.js`:
-
-```diff title="sidebars.js"
-module.exports = {
- tutorialSidebar: [
- {
- type: 'category',
- label: 'Tutorial',
-- items: [...],
-+ items: ['hello'],
- },
- ],
-};
-```
diff --git a/docs/docs/tutorial-basics/create-a-page.md b/docs/docs/tutorial-basics/create-a-page.md
deleted file mode 100644
index f5b5129093..0000000000
--- a/docs/docs/tutorial-basics/create-a-page.md
+++ /dev/null
@@ -1,43 +0,0 @@
----
-sidebar_position: 1
----
-
-# Create a Page
-
-Add **Markdown or React** files to `src/pages` to create a **standalone page**:
-
-- `src/pages/index.js` -> `localhost:3000/`
-- `src/pages/foo.md` -> `localhost:3000/foo`
-- `src/pages/foo/bar.js` -> `localhost:3000/foo/bar`
-
-## Create your first React Page
-
-Create a file at `src/pages/my-react-page.js`:
-
-```jsx title="src/pages/my-react-page.js"
-import React from 'react'
-import Layout from '@theme/Layout'
-
-export default function MyReactPage() {
- return (
-
- My React page
- This is a React page
-
- )
-}
-```
-
-A new page is now available at `http://localhost:3000/my-react-page`.
-
-## Create your first Markdown Page
-
-Create a file at `src/pages/my-markdown-page.md`:
-
-```mdx title="src/pages/my-markdown-page.md"
-# My Markdown page
-
-This is a Markdown page
-```
-
-A new page is now available at `http://localhost:3000/my-markdown-page`.
diff --git a/docs/docs/tutorial-basics/deploy-your-site.md b/docs/docs/tutorial-basics/deploy-your-site.md
deleted file mode 100644
index 492eae0276..0000000000
--- a/docs/docs/tutorial-basics/deploy-your-site.md
+++ /dev/null
@@ -1,31 +0,0 @@
----
-sidebar_position: 5
----
-
-# Deploy your site
-
-Docusaurus is a **static-site-generator** (also called **[Jamstack](https://jamstack.org/)**).
-
-It builds your site as simple **static HTML, JavaScript and CSS files**.
-
-## Build your site
-
-Build your site **for production**:
-
-```bash
-npm run build
-```
-
-The static files are generated in the `build` folder.
-
-## Deploy your site
-
-Test your production build locally:
-
-```bash
-npm run serve
-```
-
-The `build` folder is now served at `http://localhost:3000/`.
-
-You can now deploy the `build` folder **almost anywhere** easily, **for free** or very small cost (read the **[Deployment Guide](https://docusaurus.io/docs/deployment)**).
diff --git a/docs/docs/tutorial-basics/markdown-features.mdx b/docs/docs/tutorial-basics/markdown-features.mdx
deleted file mode 100644
index 01d18374d3..0000000000
--- a/docs/docs/tutorial-basics/markdown-features.mdx
+++ /dev/null
@@ -1,145 +0,0 @@
----
-sidebar_position: 4
----
-
-# Markdown Features
-
-Docusaurus supports **[Markdown](https://daringfireball.net/projects/markdown/syntax)** and a few **additional features**.
-
-## Front Matter
-
-Markdown documents have metadata at the top called [Front Matter](https://jekyllrb.com/docs/front-matter/):
-
-```text title="my-doc.md"
-// highlight-start
----
-id: my-doc-id
-title: My document title
-description: My document description
-slug: /my-custom-url
----
-// highlight-end
-
-## Markdown heading
-
-Markdown text with [links](./hello.md)
-```
-
-## Links
-
-Regular Markdown links are supported, using url paths or relative file paths.
-
-```md
-Let's see how to [Create a page](/create-a-page).
-```
-
-```md
-Let's see how to [Create a page](./create-a-page.md).
-```
-
-**Result:** Let's see how to [Create a page](./create-a-page.md).
-
-## Images
-
-Regular Markdown images are supported.
-
-Add an image at `static/img/docusaurus.png` and display it in Markdown:
-
-```md
-![Docusaurus logo](/img/docusaurus.png)
-```
-
-![Docusaurus logo](/img/docusaurus.png)
-
-## Code Blocks
-
-Markdown code blocks are supported with Syntax highlighting.
-
- ```jsx title="src/components/HelloDocusaurus.js"
- function HelloDocusaurus() {
- return (
- Hello, Docusaurus!
- )
- }
- ```
-
-```jsx title="src/components/HelloDocusaurus.js"
-function HelloDocusaurus() {
- return Hello, Docusaurus!
-}
-```
-
-## Admonitions
-
-Docusaurus has a special syntax to create admonitions and callouts:
-
- :::tip My tip
-
- Use this awesome feature option
-
- :::
-
- :::danger Take care
-
- This action is dangerous
-
- :::
-
-:::tip My tip
-
-Use this awesome feature option
-
-:::
-
-:::danger Take care
-
-This action is dangerous
-
-:::
-
-## MDX and React Components
-
-[MDX](https://mdxjs.com/) can make your documentation more **interactive** and allows using any **React components inside Markdown**:
-
-```jsx
-export const Highlight = ({children, color}) => (
- {
- alert(`You clicked the color ${color} with label ${children}`)
- }}>
- {children}
-
-);
-
-This is Docusaurus green !
-
-This is Facebook blue !
-```
-
-export const Highlight = ({ children, color }) => (
- {
- alert(`You clicked the color ${color} with label ${children}`)
- }}
- >
- {children}
-
-)
-
-This is Docusaurus green !
-
-This is Facebook blue !
diff --git a/docs/docs/tutorial-extras/_category_.json b/docs/docs/tutorial-extras/_category_.json
deleted file mode 100644
index ca3f8e0640..0000000000
--- a/docs/docs/tutorial-extras/_category_.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "label": "Tutorial - Extras",
- "position": 3
-}
diff --git a/docs/docs/tutorial-extras/manage-docs-versions.md b/docs/docs/tutorial-extras/manage-docs-versions.md
deleted file mode 100644
index cd16718c2b..0000000000
--- a/docs/docs/tutorial-extras/manage-docs-versions.md
+++ /dev/null
@@ -1,55 +0,0 @@
----
-sidebar_position: 1
----
-
-# Manage Docs Versions
-
-Docusaurus can manage multiple versions of your docs.
-
-## Create a docs version
-
-Release a version 1.0 of your project:
-
-```bash
-npm run docusaurus docs:version 1.0
-```
-
-The `docs` folder is copied into `versioned_docs/version-1.0` and `versions.json` is created.
-
-Your docs now have 2 versions:
-
-- `1.0` at `http://localhost:3000/docs/` for the version 1.0 docs
-- `current` at `http://localhost:3000/docs/next/` for the **upcoming, unreleased docs**
-
-## Add a Version Dropdown
-
-To navigate seamlessly across versions, add a version dropdown.
-
-Modify the `docusaurus.config.js` file:
-
-```js title="docusaurus.config.js"
-module.exports = {
- themeConfig: {
- navbar: {
- items: [
- // highlight-start
- {
- type: 'docsVersionDropdown',
- },
- // highlight-end
- ],
- },
- },
-}
-```
-
-The docs version dropdown appears in your navbar:
-
-![Docs Version Dropdown](/img/tutorial/docsVersionDropdown.png)
-
-## Update an existing version
-
-It is possible to edit versioned docs in their respective folder:
-
-- `versioned_docs/version-1.0/hello.md` updates `http://localhost:3000/docs/hello`
-- `docs/hello.md` updates `http://localhost:3000/docs/next/hello`
diff --git a/docs/docs/tutorial-extras/translate-your-site.md b/docs/docs/tutorial-extras/translate-your-site.md
deleted file mode 100644
index e713004fd7..0000000000
--- a/docs/docs/tutorial-extras/translate-your-site.md
+++ /dev/null
@@ -1,88 +0,0 @@
----
-sidebar_position: 2
----
-
-# Translate your site
-
-Let's translate `docs/intro.md` to French.
-
-## Configure i18n
-
-Modify `docusaurus.config.js` to add support for the `fr` locale:
-
-```js title="docusaurus.config.js"
-module.exports = {
- i18n: {
- defaultLocale: 'en',
- locales: ['en', 'fr'],
- },
-}
-```
-
-## Translate a doc
-
-Copy the `docs/intro.md` file to the `i18n/fr` folder:
-
-```bash
-mkdir -p i18n/fr/docusaurus-plugin-content-docs/current/
-
-cp docs/intro.md i18n/fr/docusaurus-plugin-content-docs/current/intro.md
-```
-
-Translate `i18n/fr/docusaurus-plugin-content-docs/current/intro.md` in French.
-
-## Start your localized site
-
-Start your site on the French locale:
-
-```bash
-npm run start -- --locale fr
-```
-
-Your localized site is accessible at `http://localhost:3000/fr/` and the `Getting Started` page is translated.
-
-:::caution
-
-In development, you can only use one locale at a same time.
-
-:::
-
-## Add a Locale Dropdown
-
-To navigate seamlessly across languages, add a locale dropdown.
-
-Modify the `docusaurus.config.js` file:
-
-```js title="docusaurus.config.js"
-module.exports = {
- themeConfig: {
- navbar: {
- items: [
- // highlight-start
- {
- type: 'localeDropdown',
- },
- // highlight-end
- ],
- },
- },
-}
-```
-
-The locale dropdown now appears in your navbar:
-
-![Locale Dropdown](/img/tutorial/localeDropdown.png)
-
-## Build your localized site
-
-Build your site for a specific locale:
-
-```bash
-npm run build -- --locale fr
-```
-
-Or build your site to include all the locales at once:
-
-```bash
-npm run build
-```
diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js
deleted file mode 100644
index 22d92d14f7..0000000000
--- a/docs/docusaurus.config.js
+++ /dev/null
@@ -1,99 +0,0 @@
-// @ts-check
-// Note: type annotations allow type checking and IDEs autocompletion
-
-const lightCodeTheme = require('prism-react-renderer/themes/github')
-const darkCodeTheme = require('prism-react-renderer/themes/dracula')
-
-/** @type {import('@docusaurus/types').Config} */
-const config = {
- title: 'SPL Governance UI',
- url: 'https://solana-labs.github.io',
- baseUrl: '/governance-ui/',
- trailingSlash: false,
- onBrokenLinks: 'throw',
- onBrokenMarkdownLinks: 'warn',
- favicon: 'img/favicon.ico',
- organizationName: 'solana-labs', // Usually your GitHub org/user name.
- projectName: 'governance-ui', // Usually your repo name.
-
- presets: [
- [
- 'classic',
- /** @type {import('@docusaurus/preset-classic').Options} */
- ({
- docs: {
- sidebarPath: require.resolve('./sidebars.js'),
- routeBasePath: '/',
- editUrl:
- 'https://github.com/solana-labs/governance-ui/edit/main/docs/',
- },
- theme: {
- customCss: require.resolve('./src/css/custom.css'),
- },
- }),
- ],
- ],
-
- themeConfig:
- /** @type {import('@docusaurus/preset-classic').ThemeConfig} */
- ({
- navbar: {
- title: 'SPL Governance UI',
- logo: {
- alt: 'SPL Governance UI',
- src: 'img/solana-logo.svg',
- },
- items: [
- {
- type: 'doc',
- docId: 'intro',
- position: 'left',
- label: 'Tutorial',
- },
- {
- href: 'https://github.com/solana-labs/governance-ui',
- label: 'GitHub',
- position: 'right',
- },
- ],
- },
- footer: {
- style: 'dark',
- links: [
- {
- title: 'Community',
- items: [
- {
- label: 'Discord',
- href: 'https://discordapp.com/invite/pquxPsq',
- },
- {
- label: 'Twitter',
- href: 'https://twitter.com/solana',
- },
- {
- label: 'Forums',
- href: 'https://forums.solana.com',
- },
- ],
- },
- {
- title: 'More',
- items: [
- {
- label: 'GitHub',
- href: 'https://github.com/solana-labs/governance-ui',
- },
- ],
- },
- ],
- copyright: `Copyright © ${new Date().getFullYear()} Solana Foundation`,
- },
- prism: {
- theme: lightCodeTheme,
- darkTheme: darkCodeTheme,
- },
- }),
-}
-
-module.exports = config
diff --git a/docs/package.json b/docs/package.json
deleted file mode 100644
index 4fda2d4b2a..0000000000
--- a/docs/package.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
- "name": "governance",
- "version": "0.0.0",
- "private": true,
- "scripts": {
- "docusaurus": "docusaurus",
- "start": "docusaurus start",
- "build": "docusaurus build",
- "swizzle": "docusaurus swizzle",
- "deploy": "docusaurus deploy",
- "clear": "docusaurus clear",
- "serve": "docusaurus serve",
- "write-translations": "docusaurus write-translations",
- "write-heading-ids": "docusaurus write-heading-ids"
- },
- "dependencies": {
- "@docusaurus/core": "2.0.0-beta.13",
- "@docusaurus/preset-classic": "2.0.0-beta.13",
- "@mdx-js/react": "^1.6.21",
- "clsx": "^1.1.1",
- "prism-react-renderer": "^1.2.1",
- "react": "^17.0.1",
- "react-dom": "^17.0.1"
- },
- "browserslist": {
- "production": [
- ">0.5%",
- "not dead",
- "not op_mini all"
- ],
- "development": [
- "last 1 chrome version",
- "last 1 firefox version",
- "last 1 safari version"
- ]
- }
-}
diff --git a/docs/sidebars.js b/docs/sidebars.js
deleted file mode 100644
index e8dc947007..0000000000
--- a/docs/sidebars.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Creating a sidebar enables you to:
- - create an ordered group of docs
- - render a sidebar for each doc of that group
- - provide next/previous navigation
-
- The sidebars can be generated from the filesystem, or explicitly defined here.
-
- Create as many sidebars as you want.
- */
-
-// @ts-check
-
-/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
-const sidebars = {
- // By default, Docusaurus generates a sidebar from the docs folder structure
- tutorialSidebar: [{ type: 'autogenerated', dirName: '.' }],
-
- // But you can create a sidebar manually
- /*
- tutorialSidebar: [
- {
- type: 'category',
- label: 'Tutorial',
- items: ['hello'],
- },
- ],
- */
-}
-
-module.exports = sidebars
diff --git a/docs/src/components/HomepageFeatures.js b/docs/src/components/HomepageFeatures.js
deleted file mode 100644
index 9b63211dfa..0000000000
--- a/docs/src/components/HomepageFeatures.js
+++ /dev/null
@@ -1,64 +0,0 @@
-import React from 'react'
-import clsx from 'clsx'
-import styles from './HomepageFeatures.module.css'
-
-const FeatureList = [
- {
- title: 'Easy to Use',
- Svg: require('../../static/img/undraw_docusaurus_mountain.svg').default,
- description: (
- <>
- Docusaurus was designed from the ground up to be easily installed and
- used to get your website up and running quickly.
- >
- ),
- },
- {
- title: 'Focus on What Matters',
- Svg: require('../../static/img/undraw_docusaurus_tree.svg').default,
- description: (
- <>
- Docusaurus lets you focus on your docs, and we'll do the chores. Go
- ahead and move your docs into the docs
directory.
- >
- ),
- },
- {
- title: 'Powered by React',
- Svg: require('../../static/img/undraw_docusaurus_react.svg').default,
- description: (
- <>
- Extend or customize your website layout by reusing React. Docusaurus can
- be extended while reusing the same header and footer.
- >
- ),
- },
-]
-
-function Feature({ Svg, title, description }) {
- return (
-
-
-
-
-
-
{title}
-
{description}
-
-
- )
-}
-
-export default function HomepageFeatures() {
- return (
-
-
-
- {FeatureList.map((props, idx) => (
-
- ))}
-
-
-
- )
-}
diff --git a/docs/src/components/HomepageFeatures.module.css b/docs/src/components/HomepageFeatures.module.css
deleted file mode 100644
index b248eb2e5d..0000000000
--- a/docs/src/components/HomepageFeatures.module.css
+++ /dev/null
@@ -1,11 +0,0 @@
-.features {
- display: flex;
- align-items: center;
- padding: 2rem 0;
- width: 100%;
-}
-
-.featureSvg {
- height: 200px;
- width: 200px;
-}
diff --git a/docs/src/css/custom.css b/docs/src/css/custom.css
deleted file mode 100644
index 6abe148544..0000000000
--- a/docs/src/css/custom.css
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * Any CSS included here will be global. The classic template
- * bundles Infima by default. Infima is a CSS framework designed to
- * work well for content-centric websites.
- */
-
-/* You can override the default Infima variables here. */
-:root {
- --ifm-color-primary: #25c2a0;
- --ifm-color-primary-dark: rgb(33, 175, 144);
- --ifm-color-primary-darker: rgb(31, 165, 136);
- --ifm-color-primary-darkest: rgb(26, 136, 112);
- --ifm-color-primary-light: rgb(70, 203, 174);
- --ifm-color-primary-lighter: rgb(102, 212, 189);
- --ifm-color-primary-lightest: rgb(146, 224, 208);
- --ifm-code-font-size: 95%;
-}
-
-.docusaurus-highlight-code-line {
- background-color: rgba(0, 0, 0, 0.1);
- display: block;
- margin: 0 calc(-1 * var(--ifm-pre-padding));
- padding: 0 var(--ifm-pre-padding);
-}
-
-html[data-theme='dark'] .docusaurus-highlight-code-line {
- background-color: rgba(0, 0, 0, 0.3);
-}
diff --git a/docs/static/.nojekyll b/docs/static/.nojekyll
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/docs/static/img/android-chrome-192x192.png b/docs/static/img/android-chrome-192x192.png
deleted file mode 100644
index de05e465bc..0000000000
Binary files a/docs/static/img/android-chrome-192x192.png and /dev/null differ
diff --git a/docs/static/img/android-chrome-512x512.png b/docs/static/img/android-chrome-512x512.png
deleted file mode 100644
index 3639f8aed7..0000000000
Binary files a/docs/static/img/android-chrome-512x512.png and /dev/null differ
diff --git a/docs/static/img/apple-touch-icon.png b/docs/static/img/apple-touch-icon.png
deleted file mode 100644
index 15aa750074..0000000000
Binary files a/docs/static/img/apple-touch-icon.png and /dev/null differ
diff --git a/docs/static/img/docusaurus.png b/docs/static/img/docusaurus.png
deleted file mode 100644
index f458149e3c..0000000000
Binary files a/docs/static/img/docusaurus.png and /dev/null differ
diff --git a/docs/static/img/favicon-16x16.png b/docs/static/img/favicon-16x16.png
deleted file mode 100644
index 786eddb0e4..0000000000
Binary files a/docs/static/img/favicon-16x16.png and /dev/null differ
diff --git a/docs/static/img/favicon-32x32.png b/docs/static/img/favicon-32x32.png
deleted file mode 100644
index 0bfdc32f30..0000000000
Binary files a/docs/static/img/favicon-32x32.png and /dev/null differ
diff --git a/docs/static/img/favicon.ico b/docs/static/img/favicon.ico
deleted file mode 100644
index cae80e9131..0000000000
Binary files a/docs/static/img/favicon.ico and /dev/null differ
diff --git a/docs/static/img/logo.svg b/docs/static/img/logo.svg
deleted file mode 100644
index 9db6d0d066..0000000000
--- a/docs/static/img/logo.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/docs/static/img/site.webmanifest b/docs/static/img/site.webmanifest
deleted file mode 100644
index fa99de77db..0000000000
--- a/docs/static/img/site.webmanifest
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "name": "",
- "short_name": "",
- "icons": [
- {
- "src": "/android-chrome-192x192.png",
- "sizes": "192x192",
- "type": "image/png"
- },
- {
- "src": "/android-chrome-512x512.png",
- "sizes": "512x512",
- "type": "image/png"
- }
- ],
- "theme_color": "#ffffff",
- "background_color": "#ffffff",
- "display": "standalone"
-}
diff --git a/docs/static/img/solana-logo.svg b/docs/static/img/solana-logo.svg
deleted file mode 100644
index 3d4c64a3a4..0000000000
--- a/docs/static/img/solana-logo.svg
+++ /dev/null
@@ -1,13 +0,0 @@
-
diff --git a/docs/static/img/tutorial/docsVersionDropdown.png b/docs/static/img/tutorial/docsVersionDropdown.png
deleted file mode 100644
index ff1cbe6889..0000000000
Binary files a/docs/static/img/tutorial/docsVersionDropdown.png and /dev/null differ
diff --git a/docs/static/img/tutorial/localeDropdown.png b/docs/static/img/tutorial/localeDropdown.png
deleted file mode 100644
index d7163f9675..0000000000
Binary files a/docs/static/img/tutorial/localeDropdown.png and /dev/null differ
diff --git a/docs/static/img/undraw_docusaurus_mountain.svg b/docs/static/img/undraw_docusaurus_mountain.svg
deleted file mode 100644
index 431cef2f7f..0000000000
--- a/docs/static/img/undraw_docusaurus_mountain.svg
+++ /dev/null
@@ -1,170 +0,0 @@
-
diff --git a/docs/static/img/undraw_docusaurus_react.svg b/docs/static/img/undraw_docusaurus_react.svg
deleted file mode 100644
index e417050433..0000000000
--- a/docs/static/img/undraw_docusaurus_react.svg
+++ /dev/null
@@ -1,169 +0,0 @@
-
diff --git a/docs/static/img/undraw_docusaurus_tree.svg b/docs/static/img/undraw_docusaurus_tree.svg
deleted file mode 100644
index a05cc03dda..0000000000
--- a/docs/static/img/undraw_docusaurus_tree.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/docs/yarn.lock b/docs/yarn.lock
deleted file mode 100644
index f982116f0f..0000000000
--- a/docs/yarn.lock
+++ /dev/null
@@ -1,7562 +0,0 @@
-# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
-# yarn lockfile v1
-
-
-"@algolia/autocomplete-core@1.5.0":
- version "1.5.0"
- resolved "https://registry.yarnpkg.com/@algolia/autocomplete-core/-/autocomplete-core-1.5.0.tgz#6c91c9de7748e9c103846828a58dfe92bd4d6689"
- integrity sha512-E7+VJwcvwMM8vPeaVn7fNUgix8WHV8A1WUeHDi2KHemCaaGc8lvUnP3QnvhMxiDhTe7OpMEv4o2TBUMyDgThaw==
- dependencies:
- "@algolia/autocomplete-shared" "1.5.0"
-
-"@algolia/autocomplete-preset-algolia@1.5.0":
- version "1.5.0"
- resolved "https://registry.yarnpkg.com/@algolia/autocomplete-preset-algolia/-/autocomplete-preset-algolia-1.5.0.tgz#61671f09c0c77133d9baf1356719f8378c48437a"
- integrity sha512-iiFxKERGHkvkiupmrFJbvESpP/zv5jSgH714XRiP5LDvUHaYOo4GLAwZCFf2ef/L5tdtPBARvekn6k1Xf33gjA==
- dependencies:
- "@algolia/autocomplete-shared" "1.5.0"
-
-"@algolia/autocomplete-shared@1.5.0":
- version "1.5.0"
- resolved "https://registry.yarnpkg.com/@algolia/autocomplete-shared/-/autocomplete-shared-1.5.0.tgz#09580bc89408a2ab5f29e312120dad68f58019bd"
- integrity sha512-bRSkqHHHSwZYbFY3w9hgMyQRm86Wz27bRaGCbNldLfbk0zUjApmE4ajx+ZCVSLqxvcUEjMqZFJzDsder12eKsg==
-
-"@algolia/cache-browser-local-storage@4.11.0":
- version "4.11.0"
- resolved "https://registry.yarnpkg.com/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.11.0.tgz#1c168add00b398a860db6c86039e33b2843a9425"
- integrity sha512-4sr9vHIG1fVA9dONagdzhsI/6M5mjs/qOe2xUP0yBmwsTsuwiZq3+Xu6D3dsxsuFetcJgC6ydQoCW8b7fDJHYQ==
- dependencies:
- "@algolia/cache-common" "4.11.0"
-
-"@algolia/cache-common@4.11.0":
- version "4.11.0"
- resolved "https://registry.yarnpkg.com/@algolia/cache-common/-/cache-common-4.11.0.tgz#066fe6d58b18e4b028dbef9bb8de07c5e22a3594"
- integrity sha512-lODcJRuPXqf+6mp0h6bOxPMlbNoyn3VfjBVcQh70EDP0/xExZbkpecgHyyZK4kWg+evu+mmgvTK3GVHnet/xKw==
-
-"@algolia/cache-in-memory@4.11.0":
- version "4.11.0"
- resolved "https://registry.yarnpkg.com/@algolia/cache-in-memory/-/cache-in-memory-4.11.0.tgz#763c8cb655e6fd2261588e04214fca0959ac07c1"
- integrity sha512-aBz+stMSTBOBaBEQ43zJXz2DnwS7fL6dR0e2myehAgtfAWlWwLDHruc/98VOy1ZAcBk1blE2LCU02bT5HekGxQ==
- dependencies:
- "@algolia/cache-common" "4.11.0"
-
-"@algolia/client-account@4.11.0":
- version "4.11.0"
- resolved "https://registry.yarnpkg.com/@algolia/client-account/-/client-account-4.11.0.tgz#67fadd3b0802b013ebaaa4b47bb7babae892374e"
- integrity sha512-jwmFBoUSzoMwMqgD3PmzFJV/d19p1RJXB6C1ADz4ju4mU7rkaQLtqyZroQpheLoU5s5Tilmn/T8/0U2XLoJCRQ==
- dependencies:
- "@algolia/client-common" "4.11.0"
- "@algolia/client-search" "4.11.0"
- "@algolia/transporter" "4.11.0"
-
-"@algolia/client-analytics@4.11.0":
- version "4.11.0"
- resolved "https://registry.yarnpkg.com/@algolia/client-analytics/-/client-analytics-4.11.0.tgz#cbdc8128205e2da749cafc79e54708d14c413974"
- integrity sha512-v5U9585aeEdYml7JqggHAj3E5CQ+jPwGVztPVhakBk8H/cmLyPS2g8wvmIbaEZCHmWn4TqFj3EBHVYxAl36fSA==
- dependencies:
- "@algolia/client-common" "4.11.0"
- "@algolia/client-search" "4.11.0"
- "@algolia/requester-common" "4.11.0"
- "@algolia/transporter" "4.11.0"
-
-"@algolia/client-common@4.11.0":
- version "4.11.0"
- resolved "https://registry.yarnpkg.com/@algolia/client-common/-/client-common-4.11.0.tgz#9a2d1f6f8eaad25ba5d6d4ce307ba5bd84e6f999"
- integrity sha512-Qy+F+TZq12kc7tgfC+FM3RvYH/Ati7sUiUv/LkvlxFwNwNPwWGoZO81AzVSareXT/ksDDrabD4mHbdTbBPTRmQ==
- dependencies:
- "@algolia/requester-common" "4.11.0"
- "@algolia/transporter" "4.11.0"
-
-"@algolia/client-personalization@4.11.0":
- version "4.11.0"
- resolved "https://registry.yarnpkg.com/@algolia/client-personalization/-/client-personalization-4.11.0.tgz#d3bf0e760f85df876b4baf5b81996f0aa3a59940"
- integrity sha512-mI+X5IKiijHAzf9fy8VSl/GTT67dzFDnJ0QAM8D9cMPevnfX4U72HRln3Mjd0xEaYUOGve8TK/fMg7d3Z5yG6g==
- dependencies:
- "@algolia/client-common" "4.11.0"
- "@algolia/requester-common" "4.11.0"
- "@algolia/transporter" "4.11.0"
-
-"@algolia/client-search@4.11.0":
- version "4.11.0"
- resolved "https://registry.yarnpkg.com/@algolia/client-search/-/client-search-4.11.0.tgz#c1105d715a2a04ba27231eca86f5d6620f68f4ae"
- integrity sha512-iovPLc5YgiXBdw2qMhU65sINgo9umWbHFzInxoNErWnYoTQWfXsW6P54/NlKx5uscoLVjSf+5RUWwFu5BX+lpw==
- dependencies:
- "@algolia/client-common" "4.11.0"
- "@algolia/requester-common" "4.11.0"
- "@algolia/transporter" "4.11.0"
-
-"@algolia/events@^4.0.1":
- version "4.0.1"
- resolved "https://registry.yarnpkg.com/@algolia/events/-/events-4.0.1.tgz#fd39e7477e7bc703d7f893b556f676c032af3950"
- integrity sha512-FQzvOCgoFXAbf5Y6mYozw2aj5KCJoA3m4heImceldzPSMbdyS4atVjJzXKMsfX3wnZTFYwkkt8/z8UesLHlSBQ==
-
-"@algolia/logger-common@4.11.0":
- version "4.11.0"
- resolved "https://registry.yarnpkg.com/@algolia/logger-common/-/logger-common-4.11.0.tgz#bac1c2d59d29dee378b57412c8edd435b97de663"
- integrity sha512-pRMJFeOY8hoWKIxWuGHIrqnEKN/kqKh7UilDffG/+PeEGxBuku+Wq5CfdTFG0C9ewUvn8mAJn5BhYA5k8y0Jqg==
-
-"@algolia/logger-console@4.11.0":
- version "4.11.0"
- resolved "https://registry.yarnpkg.com/@algolia/logger-console/-/logger-console-4.11.0.tgz#ced19e3abb22eb782ed5268d51efb5aa9ef109ef"
- integrity sha512-wXztMk0a3VbNmYP8Kpc+F7ekuvaqZmozM2eTLok0XIshpAeZ/NJDHDffXK2Pw+NF0wmHqurptLYwKoikjBYvhQ==
- dependencies:
- "@algolia/logger-common" "4.11.0"
-
-"@algolia/requester-browser-xhr@4.11.0":
- version "4.11.0"
- resolved "https://registry.yarnpkg.com/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.11.0.tgz#f9e1ad56f185432aa8dde8cad53ae271fd5d6181"
- integrity sha512-Fp3SfDihAAFR8bllg8P5ouWi3+qpEVN5e7hrtVIYldKBOuI/qFv80Zv/3/AMKNJQRYglS4zWyPuqrXm58nz6KA==
- dependencies:
- "@algolia/requester-common" "4.11.0"
-
-"@algolia/requester-common@4.11.0":
- version "4.11.0"
- resolved "https://registry.yarnpkg.com/@algolia/requester-common/-/requester-common-4.11.0.tgz#d16de98d3ff72434bac39e4d915eab08035946a9"
- integrity sha512-+cZGe/9fuYgGuxjaBC+xTGBkK7OIYdfapxhfvEf03dviLMPmhmVYFJtJlzAjQ2YmGDJpHrGgAYj3i/fbs8yhiA==
-
-"@algolia/requester-node-http@4.11.0":
- version "4.11.0"
- resolved "https://registry.yarnpkg.com/@algolia/requester-node-http/-/requester-node-http-4.11.0.tgz#beb2b6b68d5f4ce15aec80ede623f0ac96991368"
- integrity sha512-qJIk9SHRFkKDi6dMT9hba8X1J1z92T5AZIgl+tsApjTGIRQXJLTIm+0q4yOefokfu4CoxYwRZ9QAq+ouGwfeOg==
- dependencies:
- "@algolia/requester-common" "4.11.0"
-
-"@algolia/transporter@4.11.0":
- version "4.11.0"
- resolved "https://registry.yarnpkg.com/@algolia/transporter/-/transporter-4.11.0.tgz#a8de3c173093ceceb02b26b577395ce3b3d4b96f"
- integrity sha512-k4dyxiaEfYpw4UqybK9q7lrFzehygo6KV3OCYJMMdX0IMWV0m4DXdU27c1zYRYtthaFYaBzGF4Kjcl8p8vxCKw==
- dependencies:
- "@algolia/cache-common" "4.11.0"
- "@algolia/logger-common" "4.11.0"
- "@algolia/requester-common" "4.11.0"
-
-"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.16.0", "@babel/code-frame@^7.8.3":
- version "7.16.0"
- resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.0.tgz#0dfc80309beec8411e65e706461c408b0bb9b431"
- integrity sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA==
- dependencies:
- "@babel/highlight" "^7.16.0"
-
-"@babel/compat-data@^7.13.11", "@babel/compat-data@^7.16.0", "@babel/compat-data@^7.16.4":
- version "7.16.4"
- resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.16.4.tgz#081d6bbc336ec5c2435c6346b2ae1fb98b5ac68e"
- integrity sha512-1o/jo7D+kC9ZjHX5v+EHrdjl3PhxMrLSOTGsOdHJ+KL8HCaEK6ehrVL2RS6oHDZp+L7xLirLrPmQtEng769J/Q==
-
-"@babel/core@7.12.9":
- version "7.12.9"
- resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.12.9.tgz#fd450c4ec10cdbb980e2928b7aa7a28484593fc8"
- integrity sha512-gTXYh3M5wb7FRXQy+FErKFAv90BnlOuNn1QkCK2lREoPAjrQCO49+HVSrFoe5uakFAF5eenS75KbO2vQiLrTMQ==
- dependencies:
- "@babel/code-frame" "^7.10.4"
- "@babel/generator" "^7.12.5"
- "@babel/helper-module-transforms" "^7.12.1"
- "@babel/helpers" "^7.12.5"
- "@babel/parser" "^7.12.7"
- "@babel/template" "^7.12.7"
- "@babel/traverse" "^7.12.9"
- "@babel/types" "^7.12.7"
- convert-source-map "^1.7.0"
- debug "^4.1.0"
- gensync "^1.0.0-beta.1"
- json5 "^2.1.2"
- lodash "^4.17.19"
- resolve "^1.3.2"
- semver "^5.4.1"
- source-map "^0.5.0"
-
-"@babel/core@^7.15.5", "@babel/core@^7.16.0":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.16.5.tgz#924aa9e1ae56e1e55f7184c8bf073a50d8677f5c"
- integrity sha512-wUcenlLzuWMZ9Zt8S0KmFwGlH6QKRh3vsm/dhDA3CHkiTA45YuG1XkHRcNRl73EFPXDp/d5kVOU0/y7x2w6OaQ==
- dependencies:
- "@babel/code-frame" "^7.16.0"
- "@babel/generator" "^7.16.5"
- "@babel/helper-compilation-targets" "^7.16.3"
- "@babel/helper-module-transforms" "^7.16.5"
- "@babel/helpers" "^7.16.5"
- "@babel/parser" "^7.16.5"
- "@babel/template" "^7.16.0"
- "@babel/traverse" "^7.16.5"
- "@babel/types" "^7.16.0"
- convert-source-map "^1.7.0"
- debug "^4.1.0"
- gensync "^1.0.0-beta.2"
- json5 "^2.1.2"
- semver "^6.3.0"
- source-map "^0.5.0"
-
-"@babel/generator@^7.12.5", "@babel/generator@^7.16.0", "@babel/generator@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.16.5.tgz#26e1192eb8f78e0a3acaf3eede3c6fc96d22bedf"
- integrity sha512-kIvCdjZqcdKqoDbVVdt5R99icaRtrtYhYK/xux5qiWCBmfdvEYMFZ68QCrpE5cbFM1JsuArUNs1ZkuKtTtUcZA==
- dependencies:
- "@babel/types" "^7.16.0"
- jsesc "^2.5.1"
- source-map "^0.5.0"
-
-"@babel/helper-annotate-as-pure@^7.16.0":
- version "7.16.0"
- resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.0.tgz#9a1f0ebcda53d9a2d00108c4ceace6a5d5f1f08d"
- integrity sha512-ItmYF9vR4zA8cByDocY05o0LGUkp1zhbTQOH1NFyl5xXEqlTJQCEJjieriw+aFpxo16swMxUnUiKS7a/r4vtHg==
- dependencies:
- "@babel/types" "^7.16.0"
-
-"@babel/helper-builder-binary-assignment-operator-visitor@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.16.5.tgz#a8429d064dce8207194b8bf05a70a9ea828746af"
- integrity sha512-3JEA9G5dmmnIWdzaT9d0NmFRgYnWUThLsDaL7982H0XqqWr56lRrsmwheXFMjR+TMl7QMBb6mzy9kvgr1lRLUA==
- dependencies:
- "@babel/helper-explode-assignable-expression" "^7.16.0"
- "@babel/types" "^7.16.0"
-
-"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.16.3":
- version "7.16.3"
- resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.3.tgz#5b480cd13f68363df6ec4dc8ac8e2da11363cbf0"
- integrity sha512-vKsoSQAyBmxS35JUOOt+07cLc6Nk/2ljLIHwmq2/NM6hdioUaqEXq/S+nXvbvXbZkNDlWOymPanJGOc4CBjSJA==
- dependencies:
- "@babel/compat-data" "^7.16.0"
- "@babel/helper-validator-option" "^7.14.5"
- browserslist "^4.17.5"
- semver "^6.3.0"
-
-"@babel/helper-create-class-features-plugin@^7.16.0", "@babel/helper-create-class-features-plugin@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.16.5.tgz#5d1bcd096792c1ebec6249eebc6358eec55d0cad"
- integrity sha512-NEohnYA7mkB8L5JhU7BLwcBdU3j83IziR9aseMueWGeAjblbul3zzb8UvJ3a1zuBiqCMObzCJHFqKIQE6hTVmg==
- dependencies:
- "@babel/helper-annotate-as-pure" "^7.16.0"
- "@babel/helper-environment-visitor" "^7.16.5"
- "@babel/helper-function-name" "^7.16.0"
- "@babel/helper-member-expression-to-functions" "^7.16.5"
- "@babel/helper-optimise-call-expression" "^7.16.0"
- "@babel/helper-replace-supers" "^7.16.5"
- "@babel/helper-split-export-declaration" "^7.16.0"
-
-"@babel/helper-create-regexp-features-plugin@^7.16.0":
- version "7.16.0"
- resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.16.0.tgz#06b2348ce37fccc4f5e18dcd8d75053f2a7c44ff"
- integrity sha512-3DyG0zAFAZKcOp7aVr33ddwkxJ0Z0Jr5V99y3I690eYLpukJsJvAbzTy1ewoCqsML8SbIrjH14Jc/nSQ4TvNPA==
- dependencies:
- "@babel/helper-annotate-as-pure" "^7.16.0"
- regexpu-core "^4.7.1"
-
-"@babel/helper-define-polyfill-provider@^0.3.0":
- version "0.3.0"
- resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.0.tgz#c5b10cf4b324ff840140bb07e05b8564af2ae971"
- integrity sha512-7hfT8lUljl/tM3h+izTX/pO3W3frz2ok6Pk+gzys8iJqDfZrZy2pXjRTZAvG2YmfHun1X4q8/UZRLatMfqc5Tg==
- dependencies:
- "@babel/helper-compilation-targets" "^7.13.0"
- "@babel/helper-module-imports" "^7.12.13"
- "@babel/helper-plugin-utils" "^7.13.0"
- "@babel/traverse" "^7.13.0"
- debug "^4.1.1"
- lodash.debounce "^4.0.8"
- resolve "^1.14.2"
- semver "^6.1.2"
-
-"@babel/helper-environment-visitor@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.5.tgz#f6a7f38b3c6d8b07c88faea083c46c09ef5451b8"
- integrity sha512-ODQyc5AnxmZWm/R2W7fzhamOk1ey8gSguo5SGvF0zcB3uUzRpTRmM/jmLSm9bDMyPlvbyJ+PwPEK0BWIoZ9wjg==
- dependencies:
- "@babel/types" "^7.16.0"
-
-"@babel/helper-explode-assignable-expression@^7.16.0":
- version "7.16.0"
- resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.16.0.tgz#753017337a15f46f9c09f674cff10cee9b9d7778"
- integrity sha512-Hk2SLxC9ZbcOhLpg/yMznzJ11W++lg5GMbxt1ev6TXUiJB0N42KPC+7w8a+eWGuqDnUYuwStJoZHM7RgmIOaGQ==
- dependencies:
- "@babel/types" "^7.16.0"
-
-"@babel/helper-function-name@^7.16.0":
- version "7.16.0"
- resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.16.0.tgz#b7dd0797d00bbfee4f07e9c4ea5b0e30c8bb1481"
- integrity sha512-BZh4mEk1xi2h4HFjWUXRQX5AEx4rvaZxHgax9gcjdLWdkjsY7MKt5p0otjsg5noXw+pB+clMCjw+aEVYADMjog==
- dependencies:
- "@babel/helper-get-function-arity" "^7.16.0"
- "@babel/template" "^7.16.0"
- "@babel/types" "^7.16.0"
-
-"@babel/helper-get-function-arity@^7.16.0":
- version "7.16.0"
- resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.0.tgz#0088c7486b29a9cb5d948b1a1de46db66e089cfa"
- integrity sha512-ASCquNcywC1NkYh/z7Cgp3w31YW8aojjYIlNg4VeJiHkqyP4AzIvr4qx7pYDb4/s8YcsZWqqOSxgkvjUz1kpDQ==
- dependencies:
- "@babel/types" "^7.16.0"
-
-"@babel/helper-hoist-variables@^7.16.0":
- version "7.16.0"
- resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.0.tgz#4c9023c2f1def7e28ff46fc1dbcd36a39beaa81a"
- integrity sha512-1AZlpazjUR0EQZQv3sgRNfM9mEVWPK3M6vlalczA+EECcPz3XPh6VplbErL5UoMpChhSck5wAJHthlj1bYpcmg==
- dependencies:
- "@babel/types" "^7.16.0"
-
-"@babel/helper-member-expression-to-functions@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.5.tgz#1bc9f7e87354e86f8879c67b316cb03d3dc2caab"
- integrity sha512-7fecSXq7ZrLE+TWshbGT+HyCLkxloWNhTbU2QM1NTI/tDqyf0oZiMcEfYtDuUDCo528EOlt39G1rftea4bRZIw==
- dependencies:
- "@babel/types" "^7.16.0"
-
-"@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.16.0":
- version "7.16.0"
- resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.16.0.tgz#90538e60b672ecf1b448f5f4f5433d37e79a3ec3"
- integrity sha512-kkH7sWzKPq0xt3H1n+ghb4xEMP8k0U7XV3kkB+ZGy69kDk2ySFW1qPi06sjKzFY3t1j6XbJSqr4mF9L7CYVyhg==
- dependencies:
- "@babel/types" "^7.16.0"
-
-"@babel/helper-module-transforms@^7.12.1", "@babel/helper-module-transforms@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.16.5.tgz#530ebf6ea87b500f60840578515adda2af470a29"
- integrity sha512-CkvMxgV4ZyyioElFwcuWnDCcNIeyqTkCm9BxXZi73RR1ozqlpboqsbGUNvRTflgZtFbbJ1v5Emvm+lkjMYY/LQ==
- dependencies:
- "@babel/helper-environment-visitor" "^7.16.5"
- "@babel/helper-module-imports" "^7.16.0"
- "@babel/helper-simple-access" "^7.16.0"
- "@babel/helper-split-export-declaration" "^7.16.0"
- "@babel/helper-validator-identifier" "^7.15.7"
- "@babel/template" "^7.16.0"
- "@babel/traverse" "^7.16.5"
- "@babel/types" "^7.16.0"
-
-"@babel/helper-optimise-call-expression@^7.16.0":
- version "7.16.0"
- resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.0.tgz#cecdb145d70c54096b1564f8e9f10cd7d193b338"
- integrity sha512-SuI467Gi2V8fkofm2JPnZzB/SUuXoJA5zXe/xzyPP2M04686RzFKFHPK6HDVN6JvWBIEW8tt9hPR7fXdn2Lgpw==
- dependencies:
- "@babel/types" "^7.16.0"
-
-"@babel/helper-plugin-utils@7.10.4":
- version "7.10.4"
- resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz#2f75a831269d4f677de49986dff59927533cf375"
- integrity sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==
-
-"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.5", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.5.tgz#afe37a45f39fce44a3d50a7958129ea5b1a5c074"
- integrity sha512-59KHWHXxVA9K4HNF4sbHCf+eJeFe0Te/ZFGqBT4OjXhrwvA04sGfaEGsVTdsjoszq0YTP49RC9UKe5g8uN2RwQ==
-
-"@babel/helper-remap-async-to-generator@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.5.tgz#e706646dc4018942acb4b29f7e185bc246d65ac3"
- integrity sha512-X+aAJldyxrOmN9v3FKp+Hu1NO69VWgYgDGq6YDykwRPzxs5f2N+X988CBXS7EQahDU+Vpet5QYMqLk+nsp+Qxw==
- dependencies:
- "@babel/helper-annotate-as-pure" "^7.16.0"
- "@babel/helper-wrap-function" "^7.16.5"
- "@babel/types" "^7.16.0"
-
-"@babel/helper-replace-supers@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.16.5.tgz#96d3988bd0ab0a2d22c88c6198c3d3234ca25326"
- integrity sha512-ao3seGVa/FZCMCCNDuBcqnBFSbdr8N2EW35mzojx3TwfIbdPmNK+JV6+2d5bR0Z71W5ocLnQp9en/cTF7pBJiQ==
- dependencies:
- "@babel/helper-environment-visitor" "^7.16.5"
- "@babel/helper-member-expression-to-functions" "^7.16.5"
- "@babel/helper-optimise-call-expression" "^7.16.0"
- "@babel/traverse" "^7.16.5"
- "@babel/types" "^7.16.0"
-
-"@babel/helper-simple-access@^7.16.0":
- version "7.16.0"
- resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.16.0.tgz#21d6a27620e383e37534cf6c10bba019a6f90517"
- integrity sha512-o1rjBT/gppAqKsYfUdfHq5Rk03lMQrkPHG1OWzHWpLgVXRH4HnMM9Et9CVdIqwkCQlobnGHEJMsgWP/jE1zUiw==
- dependencies:
- "@babel/types" "^7.16.0"
-
-"@babel/helper-skip-transparent-expression-wrappers@^7.16.0":
- version "7.16.0"
- resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.16.0.tgz#0ee3388070147c3ae051e487eca3ebb0e2e8bb09"
- integrity sha512-+il1gTy0oHwUsBQZyJvukbB4vPMdcYBrFHa0Uc4AizLxbq6BOYC51Rv4tWocX9BLBDLZ4kc6qUFpQ6HRgL+3zw==
- dependencies:
- "@babel/types" "^7.16.0"
-
-"@babel/helper-split-export-declaration@^7.16.0":
- version "7.16.0"
- resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.0.tgz#29672f43663e936df370aaeb22beddb3baec7438"
- integrity sha512-0YMMRpuDFNGTHNRiiqJX19GjNXA4H0E8jZ2ibccfSxaCogbm3am5WN/2nQNj0YnQwGWM1J06GOcQ2qnh3+0paw==
- dependencies:
- "@babel/types" "^7.16.0"
-
-"@babel/helper-validator-identifier@^7.15.7":
- version "7.15.7"
- resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz#220df993bfe904a4a6b02ab4f3385a5ebf6e2389"
- integrity sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==
-
-"@babel/helper-validator-option@^7.14.5":
- version "7.14.5"
- resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz#6e72a1fff18d5dfcb878e1e62f1a021c4b72d5a3"
- integrity sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow==
-
-"@babel/helper-wrap-function@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.16.5.tgz#0158fca6f6d0889c3fee8a6ed6e5e07b9b54e41f"
- integrity sha512-2J2pmLBqUqVdJw78U0KPNdeE2qeuIyKoG4mKV7wAq3mc4jJG282UgjZw4ZYDnqiWQuS3Y3IYdF/AQ6CpyBV3VA==
- dependencies:
- "@babel/helper-function-name" "^7.16.0"
- "@babel/template" "^7.16.0"
- "@babel/traverse" "^7.16.5"
- "@babel/types" "^7.16.0"
-
-"@babel/helpers@^7.12.5", "@babel/helpers@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.16.5.tgz#29a052d4b827846dd76ece16f565b9634c554ebd"
- integrity sha512-TLgi6Lh71vvMZGEkFuIxzaPsyeYCHQ5jJOOX1f0xXn0uciFuE8cEk0wyBquMcCxBXZ5BJhE2aUB7pnWTD150Tw==
- dependencies:
- "@babel/template" "^7.16.0"
- "@babel/traverse" "^7.16.5"
- "@babel/types" "^7.16.0"
-
-"@babel/highlight@^7.16.0":
- version "7.16.0"
- resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.0.tgz#6ceb32b2ca4b8f5f361fb7fd821e3fddf4a1725a"
- integrity sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g==
- dependencies:
- "@babel/helper-validator-identifier" "^7.15.7"
- chalk "^2.0.0"
- js-tokens "^4.0.0"
-
-"@babel/parser@^7.12.7", "@babel/parser@^7.16.0", "@babel/parser@^7.16.4", "@babel/parser@^7.16.5":
- version "7.16.6"
- resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.6.tgz#8f194828193e8fa79166f34a4b4e52f3e769a314"
- integrity sha512-Gr86ujcNuPDnNOY8mi383Hvi8IYrJVJYuf3XcuBM/Dgd+bINn/7tHqsj+tKkoreMbmGsFLsltI/JJd8fOFWGDQ==
-
-"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.16.2":
- version "7.16.2"
- resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.16.2.tgz#2977fca9b212db153c195674e57cfab807733183"
- integrity sha512-h37CvpLSf8gb2lIJ2CgC3t+EjFbi0t8qS7LCS1xcJIlEXE4czlofwaW7W1HA8zpgOCzI9C1nmoqNR1zWkk0pQg==
- dependencies:
- "@babel/helper-plugin-utils" "^7.14.5"
-
-"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.16.0":
- version "7.16.0"
- resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.16.0.tgz#358972eaab006f5eb0826183b0c93cbcaf13e1e2"
- integrity sha512-4tcFwwicpWTrpl9qjf7UsoosaArgImF85AxqCRZlgc3IQDvkUHjJpruXAL58Wmj+T6fypWTC/BakfEkwIL/pwA==
- dependencies:
- "@babel/helper-plugin-utils" "^7.14.5"
- "@babel/helper-skip-transparent-expression-wrappers" "^7.16.0"
- "@babel/plugin-proposal-optional-chaining" "^7.16.0"
-
-"@babel/plugin-proposal-async-generator-functions@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.5.tgz#fd3bd7e0d98404a3d4cbca15a72d533f8c9a2f67"
- integrity sha512-C/FX+3HNLV6sz7AqbTQqEo1L9/kfrKjxcVtgyBCmvIgOjvuBVUWooDoi7trsLxOzCEo5FccjRvKHkfDsJFZlfA==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
- "@babel/helper-remap-async-to-generator" "^7.16.5"
- "@babel/plugin-syntax-async-generators" "^7.8.4"
-
-"@babel/plugin-proposal-class-properties@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.16.5.tgz#3269f44b89122110f6339806e05d43d84106468a"
- integrity sha512-pJD3HjgRv83s5dv1sTnDbZOaTjghKEz8KUn1Kbh2eAIRhGuyQ1XSeI4xVXU3UlIEVA3DAyIdxqT1eRn7Wcn55A==
- dependencies:
- "@babel/helper-create-class-features-plugin" "^7.16.5"
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-proposal-class-static-block@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.16.5.tgz#df58ab015a7d3b0963aafc8f20792dcd834952a9"
- integrity sha512-EEFzuLZcm/rNJ8Q5krK+FRKdVkd6FjfzT9tuSZql9sQn64K0hHA2KLJ0DqVot9/iV6+SsuadC5yI39zWnm+nmQ==
- dependencies:
- "@babel/helper-create-class-features-plugin" "^7.16.5"
- "@babel/helper-plugin-utils" "^7.16.5"
- "@babel/plugin-syntax-class-static-block" "^7.14.5"
-
-"@babel/plugin-proposal-dynamic-import@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.16.5.tgz#2e0d19d5702db4dcb9bc846200ca02f2e9d60e9e"
- integrity sha512-P05/SJZTTvHz79LNYTF8ff5xXge0kk5sIIWAypcWgX4BTRUgyHc8wRxJ/Hk+mU0KXldgOOslKaeqnhthcDJCJQ==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
- "@babel/plugin-syntax-dynamic-import" "^7.8.3"
-
-"@babel/plugin-proposal-export-namespace-from@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.16.5.tgz#3b4dd28378d1da2fea33e97b9f25d1c2f5bf1ac9"
- integrity sha512-i+sltzEShH1vsVydvNaTRsgvq2vZsfyrd7K7vPLUU/KgS0D5yZMe6uipM0+izminnkKrEfdUnz7CxMRb6oHZWw==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
- "@babel/plugin-syntax-export-namespace-from" "^7.8.3"
-
-"@babel/plugin-proposal-json-strings@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.16.5.tgz#1e726930fca139caab6b084d232a9270d9d16f9c"
- integrity sha512-QQJueTFa0y9E4qHANqIvMsuxM/qcLQmKttBACtPCQzGUEizsXDACGonlPiSwynHfOa3vNw0FPMVvQzbuXwh4SQ==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
- "@babel/plugin-syntax-json-strings" "^7.8.3"
-
-"@babel/plugin-proposal-logical-assignment-operators@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.16.5.tgz#df1f2e4b5a0ec07abf061d2c18e53abc237d3ef5"
- integrity sha512-xqibl7ISO2vjuQM+MzR3rkd0zfNWltk7n9QhaD8ghMmMceVguYrNDt7MikRyj4J4v3QehpnrU8RYLnC7z/gZLA==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
- "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4"
-
-"@babel/plugin-proposal-nullish-coalescing-operator@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.16.5.tgz#652555bfeeeee2d2104058c6225dc6f75e2d0f07"
- integrity sha512-YwMsTp/oOviSBhrjwi0vzCUycseCYwoXnLiXIL3YNjHSMBHicGTz7GjVU/IGgz4DtOEXBdCNG72pvCX22ehfqg==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
- "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3"
-
-"@babel/plugin-proposal-numeric-separator@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.16.5.tgz#edcb6379b6cf4570be64c45965d8da7a2debf039"
- integrity sha512-DvB9l/TcsCRvsIV9v4jxR/jVP45cslTVC0PMVHvaJhhNuhn2Y1SOhCSFlPK777qLB5wb8rVDaNoqMTyOqtY5Iw==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
- "@babel/plugin-syntax-numeric-separator" "^7.10.4"
-
-"@babel/plugin-proposal-object-rest-spread@7.12.1":
- version "7.12.1"
- resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.12.1.tgz#def9bd03cea0f9b72283dac0ec22d289c7691069"
- integrity sha512-s6SowJIjzlhx8o7lsFx5zmY4At6CTtDvgNQDdPzkBQucle58A6b/TTeEBYtyDgmcXjUTM+vE8YOGHZzzbc/ioA==
- dependencies:
- "@babel/helper-plugin-utils" "^7.10.4"
- "@babel/plugin-syntax-object-rest-spread" "^7.8.0"
- "@babel/plugin-transform-parameters" "^7.12.1"
-
-"@babel/plugin-proposal-object-rest-spread@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.16.5.tgz#f30f80dacf7bc1404bf67f99c8d9c01665e830ad"
- integrity sha512-UEd6KpChoyPhCoE840KRHOlGhEZFutdPDMGj+0I56yuTTOaT51GzmnEl/0uT41fB/vD2nT+Pci2KjezyE3HmUw==
- dependencies:
- "@babel/compat-data" "^7.16.4"
- "@babel/helper-compilation-targets" "^7.16.3"
- "@babel/helper-plugin-utils" "^7.16.5"
- "@babel/plugin-syntax-object-rest-spread" "^7.8.3"
- "@babel/plugin-transform-parameters" "^7.16.5"
-
-"@babel/plugin-proposal-optional-catch-binding@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.16.5.tgz#1a5405765cf589a11a33a1fd75b2baef7d48b74e"
- integrity sha512-ihCMxY1Iljmx4bWy/PIMJGXN4NS4oUj1MKynwO07kiKms23pNvIn1DMB92DNB2R0EA882sw0VXIelYGdtF7xEQ==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
- "@babel/plugin-syntax-optional-catch-binding" "^7.8.3"
-
-"@babel/plugin-proposal-optional-chaining@^7.16.0", "@babel/plugin-proposal-optional-chaining@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.16.5.tgz#a5fa61056194d5059366c0009cb9a9e66ed75c1f"
- integrity sha512-kzdHgnaXRonttiTfKYnSVafbWngPPr2qKw9BWYBESl91W54e+9R5pP70LtWxV56g0f05f/SQrwHYkfvbwcdQ/A==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
- "@babel/helper-skip-transparent-expression-wrappers" "^7.16.0"
- "@babel/plugin-syntax-optional-chaining" "^7.8.3"
-
-"@babel/plugin-proposal-private-methods@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.16.5.tgz#2086f7d78c1b0c712d49b5c3fbc2d1ca21a7ee12"
- integrity sha512-+yFMO4BGT3sgzXo+lrq7orX5mAZt57DwUK6seqII6AcJnJOIhBJ8pzKH47/ql/d426uQ7YhN8DpUFirQzqYSUA==
- dependencies:
- "@babel/helper-create-class-features-plugin" "^7.16.5"
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-proposal-private-property-in-object@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.16.5.tgz#a42d4b56005db3d405b12841309dbca647e7a21b"
- integrity sha512-+YGh5Wbw0NH3y/E5YMu6ci5qTDmAEVNoZ3I54aB6nVEOZ5BQ7QJlwKq5pYVucQilMByGn/bvX0af+uNaPRCabA==
- dependencies:
- "@babel/helper-annotate-as-pure" "^7.16.0"
- "@babel/helper-create-class-features-plugin" "^7.16.5"
- "@babel/helper-plugin-utils" "^7.16.5"
- "@babel/plugin-syntax-private-property-in-object" "^7.14.5"
-
-"@babel/plugin-proposal-unicode-property-regex@^7.16.5", "@babel/plugin-proposal-unicode-property-regex@^7.4.4":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.16.5.tgz#35fe753afa7c572f322bd068ff3377bde0f37080"
- integrity sha512-s5sKtlKQyFSatt781HQwv1hoM5BQ9qRH30r+dK56OLDsHmV74mzwJNX7R1yMuE7VZKG5O6q/gmOGSAO6ikTudg==
- dependencies:
- "@babel/helper-create-regexp-features-plugin" "^7.16.0"
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-syntax-async-generators@^7.8.4":
- version "7.8.4"
- resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d"
- integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==
- dependencies:
- "@babel/helper-plugin-utils" "^7.8.0"
-
-"@babel/plugin-syntax-class-properties@^7.12.13":
- version "7.12.13"
- resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10"
- integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==
- dependencies:
- "@babel/helper-plugin-utils" "^7.12.13"
-
-"@babel/plugin-syntax-class-static-block@^7.14.5":
- version "7.14.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz#195df89b146b4b78b3bf897fd7a257c84659d406"
- integrity sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==
- dependencies:
- "@babel/helper-plugin-utils" "^7.14.5"
-
-"@babel/plugin-syntax-dynamic-import@^7.8.3":
- version "7.8.3"
- resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz#62bf98b2da3cd21d626154fc96ee5b3cb68eacb3"
- integrity sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==
- dependencies:
- "@babel/helper-plugin-utils" "^7.8.0"
-
-"@babel/plugin-syntax-export-namespace-from@^7.8.3":
- version "7.8.3"
- resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz#028964a9ba80dbc094c915c487ad7c4e7a66465a"
- integrity sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==
- dependencies:
- "@babel/helper-plugin-utils" "^7.8.3"
-
-"@babel/plugin-syntax-json-strings@^7.8.3":
- version "7.8.3"
- resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a"
- integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==
- dependencies:
- "@babel/helper-plugin-utils" "^7.8.0"
-
-"@babel/plugin-syntax-jsx@7.12.1":
- version "7.12.1"
- resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.12.1.tgz#9d9d357cc818aa7ae7935917c1257f67677a0926"
- integrity sha512-1yRi7yAtB0ETgxdY9ti/p2TivUxJkTdhu/ZbF9MshVGqOx1TdB3b7xCXs49Fupgg50N45KcAsRP/ZqWjs9SRjg==
- dependencies:
- "@babel/helper-plugin-utils" "^7.10.4"
-
-"@babel/plugin-syntax-jsx@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.16.5.tgz#bf255d252f78bc8b77a17cadc37d1aa5b8ed4394"
- integrity sha512-42OGssv9NPk4QHKVgIHlzeLgPOW5rGgfV5jzG90AhcXXIv6hu/eqj63w4VgvRxdvZY3AlYeDgPiSJ3BqAd1Y6Q==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-syntax-logical-assignment-operators@^7.10.4":
- version "7.10.4"
- resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699"
- integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==
- dependencies:
- "@babel/helper-plugin-utils" "^7.10.4"
-
-"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3":
- version "7.8.3"
- resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9"
- integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==
- dependencies:
- "@babel/helper-plugin-utils" "^7.8.0"
-
-"@babel/plugin-syntax-numeric-separator@^7.10.4":
- version "7.10.4"
- resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97"
- integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==
- dependencies:
- "@babel/helper-plugin-utils" "^7.10.4"
-
-"@babel/plugin-syntax-object-rest-spread@7.8.3", "@babel/plugin-syntax-object-rest-spread@^7.8.0", "@babel/plugin-syntax-object-rest-spread@^7.8.3":
- version "7.8.3"
- resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871"
- integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==
- dependencies:
- "@babel/helper-plugin-utils" "^7.8.0"
-
-"@babel/plugin-syntax-optional-catch-binding@^7.8.3":
- version "7.8.3"
- resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1"
- integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==
- dependencies:
- "@babel/helper-plugin-utils" "^7.8.0"
-
-"@babel/plugin-syntax-optional-chaining@^7.8.3":
- version "7.8.3"
- resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a"
- integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==
- dependencies:
- "@babel/helper-plugin-utils" "^7.8.0"
-
-"@babel/plugin-syntax-private-property-in-object@^7.14.5":
- version "7.14.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz#0dc6671ec0ea22b6e94a1114f857970cd39de1ad"
- integrity sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==
- dependencies:
- "@babel/helper-plugin-utils" "^7.14.5"
-
-"@babel/plugin-syntax-top-level-await@^7.14.5":
- version "7.14.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c"
- integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==
- dependencies:
- "@babel/helper-plugin-utils" "^7.14.5"
-
-"@babel/plugin-syntax-typescript@^7.16.0":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.5.tgz#f47a33e4eee38554f00fb6b2f894fa1f5649b0b3"
- integrity sha512-/d4//lZ1Vqb4mZ5xTep3dDK888j7BGM/iKqBmndBaoYAFPlPKrGU608VVBz5JeyAb6YQDjRu1UKqj86UhwWVgw==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-transform-arrow-functions@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.16.5.tgz#04c18944dd55397b521d9d7511e791acea7acf2d"
- integrity sha512-8bTHiiZyMOyfZFULjsCnYOWG059FVMes0iljEHSfARhNgFfpsqE92OrCffv3veSw9rwMkYcFe9bj0ZoXU2IGtQ==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-transform-async-to-generator@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.16.5.tgz#89c9b501e65bb14c4579a6ce9563f859de9b34e4"
- integrity sha512-TMXgfioJnkXU+XRoj7P2ED7rUm5jbnDWwlCuFVTpQboMfbSya5WrmubNBAMlk7KXvywpo8rd8WuYZkis1o2H8w==
- dependencies:
- "@babel/helper-module-imports" "^7.16.0"
- "@babel/helper-plugin-utils" "^7.16.5"
- "@babel/helper-remap-async-to-generator" "^7.16.5"
-
-"@babel/plugin-transform-block-scoped-functions@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.16.5.tgz#af087494e1c387574260b7ee9b58cdb5a4e9b0b0"
- integrity sha512-BxmIyKLjUGksJ99+hJyL/HIxLIGnLKtw772zYDER7UuycDZ+Xvzs98ZQw6NGgM2ss4/hlFAaGiZmMNKvValEjw==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-transform-block-scoping@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.16.5.tgz#b91f254fe53e210eabe4dd0c40f71c0ed253c5e7"
- integrity sha512-JxjSPNZSiOtmxjX7PBRBeRJTUKTyJ607YUYeT0QJCNdsedOe+/rXITjP08eG8xUpsLfPirgzdCFN+h0w6RI+pQ==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-transform-classes@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.16.5.tgz#6acf2ec7adb50fb2f3194dcd2909dbd056dcf216"
- integrity sha512-DzJ1vYf/7TaCYy57J3SJ9rV+JEuvmlnvvyvYKFbk5u46oQbBvuB9/0w+YsVsxkOv8zVWKpDmUoj4T5ILHoXevA==
- dependencies:
- "@babel/helper-annotate-as-pure" "^7.16.0"
- "@babel/helper-environment-visitor" "^7.16.5"
- "@babel/helper-function-name" "^7.16.0"
- "@babel/helper-optimise-call-expression" "^7.16.0"
- "@babel/helper-plugin-utils" "^7.16.5"
- "@babel/helper-replace-supers" "^7.16.5"
- "@babel/helper-split-export-declaration" "^7.16.0"
- globals "^11.1.0"
-
-"@babel/plugin-transform-computed-properties@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.16.5.tgz#2af91ebf0cceccfcc701281ada7cfba40a9b322a"
- integrity sha512-n1+O7xtU5lSLraRzX88CNcpl7vtGdPakKzww74bVwpAIRgz9JVLJJpOLb0uYqcOaXVM0TL6X0RVeIJGD2CnCkg==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-transform-destructuring@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.16.5.tgz#89ebc87499ac4a81b897af53bb5d3eed261bd568"
- integrity sha512-GuRVAsjq+c9YPK6NeTkRLWyQskDC099XkBSVO+6QzbnOnH2d/4mBVXYStaPrZD3dFRfg00I6BFJ9Atsjfs8mlg==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-transform-dotall-regex@^7.16.5", "@babel/plugin-transform-dotall-regex@^7.4.4":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.16.5.tgz#b40739c00b6686820653536d6d143e311de67936"
- integrity sha512-iQiEMt8Q4/5aRGHpGVK2Zc7a6mx7qEAO7qehgSug3SDImnuMzgmm/wtJALXaz25zUj1PmnNHtShjFgk4PDx4nw==
- dependencies:
- "@babel/helper-create-regexp-features-plugin" "^7.16.0"
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-transform-duplicate-keys@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.16.5.tgz#2450f2742325412b746d7d005227f5e8973b512a"
- integrity sha512-81tijpDg2a6I1Yhj4aWY1l3O1J4Cg/Pd7LfvuaH2VVInAkXtzibz9+zSPdUM1WvuUi128ksstAP0hM5w48vQgg==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-transform-exponentiation-operator@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.16.5.tgz#36e261fa1ab643cfaf30eeab38e00ed1a76081e2"
- integrity sha512-12rba2HwemQPa7BLIKCzm1pT2/RuQHtSFHdNl41cFiC6oi4tcrp7gjB07pxQvFpcADojQywSjblQth6gJyE6CA==
- dependencies:
- "@babel/helper-builder-binary-assignment-operator-visitor" "^7.16.5"
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-transform-for-of@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.16.5.tgz#9b544059c6ca11d565457c0ff1f08e13ce225261"
- integrity sha512-+DpCAJFPAvViR17PIMi9x2AE34dll5wNlXO43wagAX2YcRGgEVHCNFC4azG85b4YyyFarvkc/iD5NPrz4Oneqw==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-transform-function-name@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.16.5.tgz#6896ebb6a5538a75d6a4086a277752f655a7bd15"
- integrity sha512-Fuec/KPSpVLbGo6z1RPw4EE1X+z9gZk1uQmnYy7v4xr4TO9p41v1AoUuXEtyqAI7H+xNJYSICzRqZBhDEkd3kQ==
- dependencies:
- "@babel/helper-function-name" "^7.16.0"
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-transform-literals@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.16.5.tgz#af392b90e3edb2bd6dc316844cbfd6b9e009d320"
- integrity sha512-B1j9C/IfvshnPcklsc93AVLTrNVa69iSqztylZH6qnmiAsDDOmmjEYqOm3Ts2lGSgTSywnBNiqC949VdD0/gfw==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-transform-member-expression-literals@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.16.5.tgz#4bd6ecdc11932361631097b779ca5c7570146dd5"
- integrity sha512-d57i3vPHWgIde/9Y8W/xSFUndhvhZN5Wu2TjRrN1MVz5KzdUihKnfDVlfP1U7mS5DNj/WHHhaE4/tTi4hIyHwQ==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-transform-modules-amd@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.16.5.tgz#92c0a3e83f642cb7e75fada9ab497c12c2616527"
- integrity sha512-oHI15S/hdJuSCfnwIz+4lm6wu/wBn7oJ8+QrkzPPwSFGXk8kgdI/AIKcbR/XnD1nQVMg/i6eNaXpszbGuwYDRQ==
- dependencies:
- "@babel/helper-module-transforms" "^7.16.5"
- "@babel/helper-plugin-utils" "^7.16.5"
- babel-plugin-dynamic-import-node "^2.3.3"
-
-"@babel/plugin-transform-modules-commonjs@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.16.5.tgz#4ee03b089536f076b2773196529d27c32b9d7bde"
- integrity sha512-ABhUkxvoQyqhCWyb8xXtfwqNMJD7tx+irIRnUh6lmyFud7Jln1WzONXKlax1fg/ey178EXbs4bSGNd6PngO+SQ==
- dependencies:
- "@babel/helper-module-transforms" "^7.16.5"
- "@babel/helper-plugin-utils" "^7.16.5"
- "@babel/helper-simple-access" "^7.16.0"
- babel-plugin-dynamic-import-node "^2.3.3"
-
-"@babel/plugin-transform-modules-systemjs@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.16.5.tgz#07078ba2e3cc94fbdd06836e355c246e98ad006b"
- integrity sha512-53gmLdScNN28XpjEVIm7LbWnD/b/TpbwKbLk6KV4KqC9WyU6rq1jnNmVG6UgAdQZVVGZVoik3DqHNxk4/EvrjA==
- dependencies:
- "@babel/helper-hoist-variables" "^7.16.0"
- "@babel/helper-module-transforms" "^7.16.5"
- "@babel/helper-plugin-utils" "^7.16.5"
- "@babel/helper-validator-identifier" "^7.15.7"
- babel-plugin-dynamic-import-node "^2.3.3"
-
-"@babel/plugin-transform-modules-umd@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.16.5.tgz#caa9c53d636fb4e3c99fd35a4c9ba5e5cd7e002e"
- integrity sha512-qTFnpxHMoenNHkS3VoWRdwrcJ3FhX567GvDA3hRZKF0Dj8Fmg0UzySZp3AP2mShl/bzcywb/UWAMQIjA1bhXvw==
- dependencies:
- "@babel/helper-module-transforms" "^7.16.5"
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-transform-named-capturing-groups-regex@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.16.5.tgz#4afd8cdee377ce3568f4e8a9ee67539b69886a3c"
- integrity sha512-/wqGDgvFUeKELW6ex6QB7dLVRkd5ehjw34tpXu1nhKC0sFfmaLabIswnpf8JgDyV2NeDmZiwoOb0rAmxciNfjA==
- dependencies:
- "@babel/helper-create-regexp-features-plugin" "^7.16.0"
-
-"@babel/plugin-transform-new-target@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.16.5.tgz#759ea9d6fbbc20796056a5d89d13977626384416"
- integrity sha512-ZaIrnXF08ZC8jnKR4/5g7YakGVL6go6V9ql6Jl3ecO8PQaQqFE74CuM384kezju7Z9nGCCA20BqZaR1tJ/WvHg==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-transform-object-super@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.16.5.tgz#8ccd9a1bcd3e7732ff8aa1702d067d8cd70ce380"
- integrity sha512-tded+yZEXuxt9Jdtkc1RraW1zMF/GalVxaVVxh41IYwirdRgyAxxxCKZ9XB7LxZqmsjfjALxupNE1MIz9KH+Zg==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
- "@babel/helper-replace-supers" "^7.16.5"
-
-"@babel/plugin-transform-parameters@^7.12.1", "@babel/plugin-transform-parameters@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.16.5.tgz#4fc74b18a89638bd90aeec44a11793ecbe031dde"
- integrity sha512-B3O6AL5oPop1jAVg8CV+haeUte9oFuY85zu0jwnRNZZi3tVAbJriu5tag/oaO2kGaQM/7q7aGPBlTI5/sr9enA==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-transform-property-literals@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.16.5.tgz#58f1465a7202a2bb2e6b003905212dd7a79abe3f"
- integrity sha512-+IRcVW71VdF9pEH/2R/Apab4a19LVvdVsr/gEeotH00vSDVlKD+XgfSIw+cgGWsjDB/ziqGv/pGoQZBIiQVXHg==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-transform-react-constant-elements@^7.14.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-constant-elements/-/plugin-transform-react-constant-elements-7.16.5.tgz#4b01ea6b14bd4e55ca92bb2d6c28dd9957118924"
- integrity sha512-fdc1s5npHMZ9A+w9bYbrZu4499WyYPVaTTsRO8bU0GJcMuK4ejIX4lyjnpvi+YGLK/EhFQxWszqylO0vaMciFw==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-transform-react-display-name@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.16.5.tgz#d5e910327d7931fb9f8f9b6c6999473ceae5a286"
- integrity sha512-dHYCOnzSsXFz8UcdNQIHGvg94qPL/teF7CCiCEMRxmA1G2p5Mq4JnKVowCDxYfiQ9D7RstaAp9kwaSI+sXbnhw==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-transform-react-jsx-development@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.16.5.tgz#87da9204c275ffb57f45d192a1120cf104bc1e86"
- integrity sha512-uQSLacMZSGLCxOw20dzo1dmLlKkd+DsayoV54q3MHXhbqgPzoiGerZQgNPl/Ro8/OcXV2ugfnkx+rxdS0sN5Uw==
- dependencies:
- "@babel/plugin-transform-react-jsx" "^7.16.5"
-
-"@babel/plugin-transform-react-jsx@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.16.5.tgz#5298aedc5f81e02b1cb702e597e8d6a346675765"
- integrity sha512-+arLIz1d7kmwX0fKxTxbnoeG85ONSnLpvdODa4P3pc1sS7CV1hfmtYWufkW/oYsPnkDrEeQFxhUWcFnrXW7jQQ==
- dependencies:
- "@babel/helper-annotate-as-pure" "^7.16.0"
- "@babel/helper-module-imports" "^7.16.0"
- "@babel/helper-plugin-utils" "^7.16.5"
- "@babel/plugin-syntax-jsx" "^7.16.5"
- "@babel/types" "^7.16.0"
-
-"@babel/plugin-transform-react-pure-annotations@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-pure-annotations/-/plugin-transform-react-pure-annotations-7.16.5.tgz#6535d0fe67c7a3a26c5105f92c8cbcbe844cd94b"
- integrity sha512-0nYU30hCxnCVCbRjSy9ahlhWZ2Sn6khbY4FqR91W+2RbSqkWEbVu2gXh45EqNy4Bq7sRU+H4i0/6YKwOSzh16A==
- dependencies:
- "@babel/helper-annotate-as-pure" "^7.16.0"
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-transform-regenerator@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.16.5.tgz#704cc6d8dd3dd4758267621ab7b36375238cef13"
- integrity sha512-2z+it2eVWU8TtQQRauvGUqZwLy4+7rTfo6wO4npr+fvvN1SW30ZF3O/ZRCNmTuu4F5MIP8OJhXAhRV5QMJOuYg==
- dependencies:
- regenerator-transform "^0.14.2"
-
-"@babel/plugin-transform-reserved-words@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.16.5.tgz#db95e98799675e193dc2b47d3e72a7c0651d0c30"
- integrity sha512-aIB16u8lNcf7drkhXJRoggOxSTUAuihTSTfAcpynowGJOZiGf+Yvi7RuTwFzVYSYPmWyARsPqUGoZWWWxLiknw==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-transform-runtime@^7.16.0":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.16.5.tgz#0cc3f01d69f299d5a42cd9ec43b92ea7a777b8db"
- integrity sha512-gxpfS8XQWDbQ8oP5NcmpXxtEgCJkbO+W9VhZlOhr0xPyVaRjAQPOv7ZDj9fg0d5s9+NiVvMCE6gbkEkcsxwGRw==
- dependencies:
- "@babel/helper-module-imports" "^7.16.0"
- "@babel/helper-plugin-utils" "^7.16.5"
- babel-plugin-polyfill-corejs2 "^0.3.0"
- babel-plugin-polyfill-corejs3 "^0.4.0"
- babel-plugin-polyfill-regenerator "^0.3.0"
- semver "^6.3.0"
-
-"@babel/plugin-transform-shorthand-properties@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.16.5.tgz#ccb60b1a23b799f5b9a14d97c5bc81025ffd96d7"
- integrity sha512-ZbuWVcY+MAXJuuW7qDoCwoxDUNClfZxoo7/4swVbOW1s/qYLOMHlm9YRWMsxMFuLs44eXsv4op1vAaBaBaDMVg==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-transform-spread@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.16.5.tgz#912b06cff482c233025d3e69cf56d3e8fa166c29"
- integrity sha512-5d6l/cnG7Lw4tGHEoga4xSkYp1euP7LAtrah1h1PgJ3JY7yNsjybsxQAnVK4JbtReZ/8z6ASVmd3QhYYKLaKZw==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
- "@babel/helper-skip-transparent-expression-wrappers" "^7.16.0"
-
-"@babel/plugin-transform-sticky-regex@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.16.5.tgz#593579bb2b5a8adfbe02cb43823275d9098f75f9"
- integrity sha512-usYsuO1ID2LXxzuUxifgWtJemP7wL2uZtyrTVM4PKqsmJycdS4U4mGovL5xXkfUheds10Dd2PjoQLXw6zCsCbg==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-transform-template-literals@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.16.5.tgz#343651385fd9923f5aa2275ca352c5d9183e1773"
- integrity sha512-gnyKy9RyFhkovex4BjKWL3BVYzUDG6zC0gba7VMLbQoDuqMfJ1SDXs8k/XK41Mmt1Hyp4qNAvGFb9hKzdCqBRQ==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-transform-typeof-symbol@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.16.5.tgz#a1d1bf2c71573fe30965d0e4cd6a3291202e20ed"
- integrity sha512-ldxCkW180qbrvyCVDzAUZqB0TAeF8W/vGJoRcaf75awm6By+PxfJKvuqVAnq8N9wz5Xa6mSpM19OfVKKVmGHSQ==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-transform-typescript@^7.16.1":
- version "7.16.1"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.16.1.tgz#cc0670b2822b0338355bc1b3d2246a42b8166409"
- integrity sha512-NO4XoryBng06jjw/qWEU2LhcLJr1tWkhpMam/H4eas/CDKMX/b2/Ylb6EI256Y7+FVPCawwSM1rrJNOpDiz+Lg==
- dependencies:
- "@babel/helper-create-class-features-plugin" "^7.16.0"
- "@babel/helper-plugin-utils" "^7.14.5"
- "@babel/plugin-syntax-typescript" "^7.16.0"
-
-"@babel/plugin-transform-unicode-escapes@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.16.5.tgz#80507c225af49b4f4ee647e2a0ce53d2eeff9e85"
- integrity sha512-shiCBHTIIChGLdyojsKQjoAyB8MBwat25lKM7MJjbe1hE0bgIppD+LX9afr41lLHOhqceqeWl4FkLp+Bgn9o1Q==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/plugin-transform-unicode-regex@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.16.5.tgz#ac84d6a1def947d71ffb832426aa53b83d7ed49e"
- integrity sha512-GTJ4IW012tiPEMMubd7sD07iU9O/LOo8Q/oU4xNhcaq0Xn8+6TcUQaHtC8YxySo1T+ErQ8RaWogIEeFhKGNPzw==
- dependencies:
- "@babel/helper-create-regexp-features-plugin" "^7.16.0"
- "@babel/helper-plugin-utils" "^7.16.5"
-
-"@babel/preset-env@^7.15.6", "@babel/preset-env@^7.16.4":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.16.5.tgz#2e94d922f4a890979af04ffeb6a6b4e44ba90847"
- integrity sha512-MiJJW5pwsktG61NDxpZ4oJ1CKxM1ncam9bzRtx9g40/WkLRkxFP6mhpkYV0/DxcciqoiHicx291+eUQrXb/SfQ==
- dependencies:
- "@babel/compat-data" "^7.16.4"
- "@babel/helper-compilation-targets" "^7.16.3"
- "@babel/helper-plugin-utils" "^7.16.5"
- "@babel/helper-validator-option" "^7.14.5"
- "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.16.2"
- "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.16.0"
- "@babel/plugin-proposal-async-generator-functions" "^7.16.5"
- "@babel/plugin-proposal-class-properties" "^7.16.5"
- "@babel/plugin-proposal-class-static-block" "^7.16.5"
- "@babel/plugin-proposal-dynamic-import" "^7.16.5"
- "@babel/plugin-proposal-export-namespace-from" "^7.16.5"
- "@babel/plugin-proposal-json-strings" "^7.16.5"
- "@babel/plugin-proposal-logical-assignment-operators" "^7.16.5"
- "@babel/plugin-proposal-nullish-coalescing-operator" "^7.16.5"
- "@babel/plugin-proposal-numeric-separator" "^7.16.5"
- "@babel/plugin-proposal-object-rest-spread" "^7.16.5"
- "@babel/plugin-proposal-optional-catch-binding" "^7.16.5"
- "@babel/plugin-proposal-optional-chaining" "^7.16.5"
- "@babel/plugin-proposal-private-methods" "^7.16.5"
- "@babel/plugin-proposal-private-property-in-object" "^7.16.5"
- "@babel/plugin-proposal-unicode-property-regex" "^7.16.5"
- "@babel/plugin-syntax-async-generators" "^7.8.4"
- "@babel/plugin-syntax-class-properties" "^7.12.13"
- "@babel/plugin-syntax-class-static-block" "^7.14.5"
- "@babel/plugin-syntax-dynamic-import" "^7.8.3"
- "@babel/plugin-syntax-export-namespace-from" "^7.8.3"
- "@babel/plugin-syntax-json-strings" "^7.8.3"
- "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4"
- "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3"
- "@babel/plugin-syntax-numeric-separator" "^7.10.4"
- "@babel/plugin-syntax-object-rest-spread" "^7.8.3"
- "@babel/plugin-syntax-optional-catch-binding" "^7.8.3"
- "@babel/plugin-syntax-optional-chaining" "^7.8.3"
- "@babel/plugin-syntax-private-property-in-object" "^7.14.5"
- "@babel/plugin-syntax-top-level-await" "^7.14.5"
- "@babel/plugin-transform-arrow-functions" "^7.16.5"
- "@babel/plugin-transform-async-to-generator" "^7.16.5"
- "@babel/plugin-transform-block-scoped-functions" "^7.16.5"
- "@babel/plugin-transform-block-scoping" "^7.16.5"
- "@babel/plugin-transform-classes" "^7.16.5"
- "@babel/plugin-transform-computed-properties" "^7.16.5"
- "@babel/plugin-transform-destructuring" "^7.16.5"
- "@babel/plugin-transform-dotall-regex" "^7.16.5"
- "@babel/plugin-transform-duplicate-keys" "^7.16.5"
- "@babel/plugin-transform-exponentiation-operator" "^7.16.5"
- "@babel/plugin-transform-for-of" "^7.16.5"
- "@babel/plugin-transform-function-name" "^7.16.5"
- "@babel/plugin-transform-literals" "^7.16.5"
- "@babel/plugin-transform-member-expression-literals" "^7.16.5"
- "@babel/plugin-transform-modules-amd" "^7.16.5"
- "@babel/plugin-transform-modules-commonjs" "^7.16.5"
- "@babel/plugin-transform-modules-systemjs" "^7.16.5"
- "@babel/plugin-transform-modules-umd" "^7.16.5"
- "@babel/plugin-transform-named-capturing-groups-regex" "^7.16.5"
- "@babel/plugin-transform-new-target" "^7.16.5"
- "@babel/plugin-transform-object-super" "^7.16.5"
- "@babel/plugin-transform-parameters" "^7.16.5"
- "@babel/plugin-transform-property-literals" "^7.16.5"
- "@babel/plugin-transform-regenerator" "^7.16.5"
- "@babel/plugin-transform-reserved-words" "^7.16.5"
- "@babel/plugin-transform-shorthand-properties" "^7.16.5"
- "@babel/plugin-transform-spread" "^7.16.5"
- "@babel/plugin-transform-sticky-regex" "^7.16.5"
- "@babel/plugin-transform-template-literals" "^7.16.5"
- "@babel/plugin-transform-typeof-symbol" "^7.16.5"
- "@babel/plugin-transform-unicode-escapes" "^7.16.5"
- "@babel/plugin-transform-unicode-regex" "^7.16.5"
- "@babel/preset-modules" "^0.1.5"
- "@babel/types" "^7.16.0"
- babel-plugin-polyfill-corejs2 "^0.3.0"
- babel-plugin-polyfill-corejs3 "^0.4.0"
- babel-plugin-polyfill-regenerator "^0.3.0"
- core-js-compat "^3.19.1"
- semver "^6.3.0"
-
-"@babel/preset-modules@^0.1.5":
- version "0.1.5"
- resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.5.tgz#ef939d6e7f268827e1841638dc6ff95515e115d9"
- integrity sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA==
- dependencies:
- "@babel/helper-plugin-utils" "^7.0.0"
- "@babel/plugin-proposal-unicode-property-regex" "^7.4.4"
- "@babel/plugin-transform-dotall-regex" "^7.4.4"
- "@babel/types" "^7.4.4"
- esutils "^2.0.2"
-
-"@babel/preset-react@^7.14.5", "@babel/preset-react@^7.16.0":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.16.5.tgz#09df3b7a6522cb3e6682dc89b4dfebb97d22031b"
- integrity sha512-3kzUOQeaxY/2vhPDS7CX/KGEGu/1bOYGvdRDJ2U5yjEz5o5jmIeTPLoiQBPGjfhPascLuW5OlMiPzwOOuB6txg==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
- "@babel/helper-validator-option" "^7.14.5"
- "@babel/plugin-transform-react-display-name" "^7.16.5"
- "@babel/plugin-transform-react-jsx" "^7.16.5"
- "@babel/plugin-transform-react-jsx-development" "^7.16.5"
- "@babel/plugin-transform-react-pure-annotations" "^7.16.5"
-
-"@babel/preset-typescript@^7.15.0", "@babel/preset-typescript@^7.16.0":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.16.5.tgz#b86a5b0ae739ba741347d2f58c52f52e63cf1ba1"
- integrity sha512-lmAWRoJ9iOSvs3DqOndQpj8XqXkzaiQs50VG/zESiI9D3eoZhGriU675xNCr0UwvsuXrhMAGvyk1w+EVWF3u8Q==
- dependencies:
- "@babel/helper-plugin-utils" "^7.16.5"
- "@babel/helper-validator-option" "^7.14.5"
- "@babel/plugin-transform-typescript" "^7.16.1"
-
-"@babel/runtime-corejs3@^7.16.3":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.16.5.tgz#9057d879720c136193f0440bc400088212a74894"
- integrity sha512-F1pMwvTiUNSAM8mc45kccMQxj31x3y3P+tA/X8hKNWp3/hUsxdGxZ3D3H8JIkxtfA8qGkaBTKvcmvStaYseAFw==
- dependencies:
- core-js-pure "^3.19.0"
- regenerator-runtime "^0.13.4"
-
-"@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.10.3", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.13", "@babel/runtime@^7.16.3", "@babel/runtime@^7.8.4":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.16.5.tgz#7f3e34bf8bdbbadf03fbb7b1ea0d929569c9487a"
- integrity sha512-TXWihFIS3Pyv5hzR7j6ihmeLkZfrXGxAr5UfSl8CHf+6q/wpiYDkUau0czckpYG8QmnCIuPpdLtuA9VmuGGyMA==
- dependencies:
- regenerator-runtime "^0.13.4"
-
-"@babel/template@^7.12.7", "@babel/template@^7.16.0":
- version "7.16.0"
- resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.0.tgz#d16a35ebf4cd74e202083356fab21dd89363ddd6"
- integrity sha512-MnZdpFD/ZdYhXwiunMqqgyZyucaYsbL0IrjoGjaVhGilz+x8YB++kRfygSOIj1yOtWKPlx7NBp+9I1RQSgsd5A==
- dependencies:
- "@babel/code-frame" "^7.16.0"
- "@babel/parser" "^7.16.0"
- "@babel/types" "^7.16.0"
-
-"@babel/traverse@^7.12.9", "@babel/traverse@^7.13.0", "@babel/traverse@^7.16.3", "@babel/traverse@^7.16.5":
- version "7.16.5"
- resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.16.5.tgz#d7d400a8229c714a59b87624fc67b0f1fbd4b2b3"
- integrity sha512-FOCODAzqUMROikDYLYxl4nmwiLlu85rNqBML/A5hKRVXG2LV8d0iMqgPzdYTcIpjZEBB7D6UDU9vxRZiriASdQ==
- dependencies:
- "@babel/code-frame" "^7.16.0"
- "@babel/generator" "^7.16.5"
- "@babel/helper-environment-visitor" "^7.16.5"
- "@babel/helper-function-name" "^7.16.0"
- "@babel/helper-hoist-variables" "^7.16.0"
- "@babel/helper-split-export-declaration" "^7.16.0"
- "@babel/parser" "^7.16.5"
- "@babel/types" "^7.16.0"
- debug "^4.1.0"
- globals "^11.1.0"
-
-"@babel/types@^7.12.7", "@babel/types@^7.15.6", "@babel/types@^7.16.0", "@babel/types@^7.4.4":
- version "7.16.0"
- resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.16.0.tgz#db3b313804f96aadd0b776c4823e127ad67289ba"
- integrity sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg==
- dependencies:
- "@babel/helper-validator-identifier" "^7.15.7"
- to-fast-properties "^2.0.0"
-
-"@docsearch/css@3.0.0-alpha.42":
- version "3.0.0-alpha.42"
- resolved "https://registry.yarnpkg.com/@docsearch/css/-/css-3.0.0-alpha.42.tgz#deb6049e999d6ca9451eba4793cb5b6da28c8773"
- integrity sha512-AGwI2AXUacYhVOHmYnsXoYDJKO6Ued2W+QO80GERbMLhC7GH5tfvtW5REs/s7jSdcU3vzFoxT8iPDBCh/PkrlQ==
-
-"@docsearch/react@^3.0.0-alpha.39":
- version "3.0.0-alpha.42"
- resolved "https://registry.yarnpkg.com/@docsearch/react/-/react-3.0.0-alpha.42.tgz#1d22a2b05779f24d090ff8d7ff2699e4d50dff5c"
- integrity sha512-1aOslZJDxwUUcm2QRNmlEePUgL8P5fOAeFdOLDMctHQkV2iTja9/rKVbkP8FZbIUnZxuuCCn8ErLrjD/oXWOag==
- dependencies:
- "@algolia/autocomplete-core" "1.5.0"
- "@algolia/autocomplete-preset-algolia" "1.5.0"
- "@docsearch/css" "3.0.0-alpha.42"
- algoliasearch "^4.0.0"
-
-"@docusaurus/core@2.0.0-beta.13":
- version "2.0.0-beta.13"
- resolved "https://registry.yarnpkg.com/@docusaurus/core/-/core-2.0.0-beta.13.tgz#3179303e043bf6bd5da6b0141574665f5e66ea98"
- integrity sha512-iSU20aIVUDO8m+9koP/sHR1O/6Wvcr/WUMyYwJ47OPq4OkM4L2+opN9mb7UI5ZFXotXZAyMBe1Q6h83FC5xzvA==
- dependencies:
- "@babel/core" "^7.16.0"
- "@babel/generator" "^7.16.0"
- "@babel/plugin-syntax-dynamic-import" "^7.8.3"
- "@babel/plugin-transform-runtime" "^7.16.0"
- "@babel/preset-env" "^7.16.4"
- "@babel/preset-react" "^7.16.0"
- "@babel/preset-typescript" "^7.16.0"
- "@babel/runtime" "^7.16.3"
- "@babel/runtime-corejs3" "^7.16.3"
- "@babel/traverse" "^7.16.3"
- "@docusaurus/cssnano-preset" "2.0.0-beta.13"
- "@docusaurus/mdx-loader" "2.0.0-beta.13"
- "@docusaurus/react-loadable" "5.5.2"
- "@docusaurus/utils" "2.0.0-beta.13"
- "@docusaurus/utils-common" "2.0.0-beta.13"
- "@docusaurus/utils-validation" "2.0.0-beta.13"
- "@slorber/static-site-generator-webpack-plugin" "^4.0.0"
- "@svgr/webpack" "^6.0.0"
- autoprefixer "^10.3.5"
- babel-loader "^8.2.2"
- babel-plugin-dynamic-import-node "2.3.0"
- boxen "^5.0.1"
- chalk "^4.1.2"
- chokidar "^3.5.2"
- clean-css "^5.1.5"
- commander "^5.1.0"
- copy-webpack-plugin "^9.0.1"
- core-js "^3.18.0"
- css-loader "^5.1.1"
- css-minimizer-webpack-plugin "^3.0.2"
- cssnano "^5.0.8"
- del "^6.0.0"
- detect-port "^1.3.0"
- escape-html "^1.0.3"
- eta "^1.12.3"
- file-loader "^6.2.0"
- fs-extra "^10.0.0"
- globby "^11.0.2"
- html-minifier-terser "^6.0.2"
- html-tags "^3.1.0"
- html-webpack-plugin "^5.4.0"
- import-fresh "^3.3.0"
- is-root "^2.1.0"
- leven "^3.1.0"
- lodash "^4.17.20"
- mini-css-extract-plugin "^1.6.0"
- nprogress "^0.2.0"
- postcss "^8.3.7"
- postcss-loader "^6.1.1"
- prompts "^2.4.1"
- react-dev-utils "12.0.0-next.47"
- react-error-overlay "^6.0.9"
- react-helmet "^6.1.0"
- react-loadable "npm:@docusaurus/react-loadable@5.5.2"
- react-loadable-ssr-addon-v5-slorber "^1.0.1"
- react-router "^5.2.0"
- react-router-config "^5.1.1"
- react-router-dom "^5.2.0"
- remark-admonitions "^1.2.1"
- resolve-pathname "^3.0.0"
- rtl-detect "^1.0.4"
- semver "^7.3.4"
- serve-handler "^6.1.3"
- shelljs "^0.8.4"
- strip-ansi "^6.0.0"
- terser-webpack-plugin "^5.2.4"
- tslib "^2.3.1"
- update-notifier "^5.1.0"
- url-loader "^4.1.1"
- wait-on "^6.0.0"
- webpack "^5.61.0"
- webpack-bundle-analyzer "^4.4.2"
- webpack-dev-server "^4.5.0"
- webpack-merge "^5.8.0"
- webpackbar "^5.0.0-3"
-
-"@docusaurus/cssnano-preset@2.0.0-beta.13":
- version "2.0.0-beta.13"
- resolved "https://registry.yarnpkg.com/@docusaurus/cssnano-preset/-/cssnano-preset-2.0.0-beta.13.tgz#14d20360ca71be62b045b56607632b5221b69963"
- integrity sha512-5e6tOtRJ4tFO94TtVNluseOJ7WX0sqCzS2nCUo02DUR4h/xlF/YMLpdt6FKd450L5l2uIrAc08QzX4Nv4y85Kg==
- dependencies:
- cssnano-preset-advanced "^5.1.4"
- postcss "^8.3.7"
- postcss-sort-media-queries "^4.1.0"
-
-"@docusaurus/mdx-loader@2.0.0-beta.13":
- version "2.0.0-beta.13"
- resolved "https://registry.yarnpkg.com/@docusaurus/mdx-loader/-/mdx-loader-2.0.0-beta.13.tgz#1f5a0e8487355f867d23627015c8a679a14463d0"
- integrity sha512-z7Sa3VTybhKhlFyBMap6tyIb5e+FVa28jYXeq6aLe7Xr16YCK9ZqjlM8G6/Gvx68L8ILBlNsCZM2GinIh8t7/Q==
- dependencies:
- "@babel/parser" "^7.16.4"
- "@babel/traverse" "^7.16.3"
- "@docusaurus/utils" "2.0.0-beta.13"
- "@mdx-js/mdx" "^1.6.21"
- "@mdx-js/react" "^1.6.21"
- chalk "^4.1.2"
- escape-html "^1.0.3"
- file-loader "^6.2.0"
- fs-extra "^10.0.0"
- gray-matter "^4.0.3"
- mdast-util-to-string "^2.0.0"
- remark-emoji "^2.1.0"
- stringify-object "^3.3.0"
- tslib "^2.3.1"
- unist-util-visit "^2.0.2"
- url-loader "^4.1.1"
- webpack "^5.61.0"
-
-"@docusaurus/plugin-content-blog@2.0.0-beta.13":
- version "2.0.0-beta.13"
- resolved "https://registry.yarnpkg.com/@docusaurus/plugin-content-blog/-/plugin-content-blog-2.0.0-beta.13.tgz#57c9b6f71c57dd6895a11b9f541e2e7b95206828"
- integrity sha512-J0SesYymavO9pjnuhC28ycSVgzv7Z1fSpq7tfkqLh3uPydq9N2eY7CbyPOysrLBta3/PveldLU+XskiNUs7hCg==
- dependencies:
- "@docusaurus/core" "2.0.0-beta.13"
- "@docusaurus/mdx-loader" "2.0.0-beta.13"
- "@docusaurus/utils" "2.0.0-beta.13"
- "@docusaurus/utils-validation" "2.0.0-beta.13"
- chalk "^4.1.2"
- escape-string-regexp "^4.0.0"
- feed "^4.2.2"
- fs-extra "^10.0.0"
- globby "^11.0.2"
- js-yaml "^4.0.0"
- loader-utils "^2.0.0"
- lodash "^4.17.20"
- reading-time "^1.5.0"
- remark-admonitions "^1.2.1"
- tslib "^2.3.1"
- utility-types "^3.10.0"
- webpack "^5.61.0"
-
-"@docusaurus/plugin-content-docs@2.0.0-beta.13":
- version "2.0.0-beta.13"
- resolved "https://registry.yarnpkg.com/@docusaurus/plugin-content-docs/-/plugin-content-docs-2.0.0-beta.13.tgz#060e344147a05574f34380462a3380b38a24fbbc"
- integrity sha512-NaYxr/R+FBaONUFEcFAOfYNA5CRwceRHNFOEIRdJtkJZbWpct5vkKPIojUWUfJbXb2/nV98rPufHyOdVmvAxVA==
- dependencies:
- "@docusaurus/core" "2.0.0-beta.13"
- "@docusaurus/mdx-loader" "2.0.0-beta.13"
- "@docusaurus/utils" "2.0.0-beta.13"
- "@docusaurus/utils-validation" "2.0.0-beta.13"
- chalk "^4.1.2"
- combine-promises "^1.1.0"
- escape-string-regexp "^4.0.0"
- fs-extra "^10.0.0"
- globby "^11.0.2"
- import-fresh "^3.2.2"
- js-yaml "^4.0.0"
- loader-utils "^2.0.0"
- lodash "^4.17.20"
- remark-admonitions "^1.2.1"
- shelljs "^0.8.4"
- tslib "^2.3.1"
- utility-types "^3.10.0"
- webpack "^5.61.0"
-
-"@docusaurus/plugin-content-pages@2.0.0-beta.13":
- version "2.0.0-beta.13"
- resolved "https://registry.yarnpkg.com/@docusaurus/plugin-content-pages/-/plugin-content-pages-2.0.0-beta.13.tgz#8a892a6d8064d7f007d684cf4e3a8d5614060027"
- integrity sha512-gUG69seyivxM0/vQ0SDeynEx9un6IMauMD8J8CWHikTF/axnV27aadjEmmBP8cEvpvXfy3k1zAcGV+BcMUGKbw==
- dependencies:
- "@docusaurus/core" "2.0.0-beta.13"
- "@docusaurus/mdx-loader" "2.0.0-beta.13"
- "@docusaurus/utils" "2.0.0-beta.13"
- "@docusaurus/utils-validation" "2.0.0-beta.13"
- globby "^11.0.2"
- remark-admonitions "^1.2.1"
- tslib "^2.3.1"
- webpack "^5.61.0"
-
-"@docusaurus/plugin-debug@2.0.0-beta.13":
- version "2.0.0-beta.13"
- resolved "https://registry.yarnpkg.com/@docusaurus/plugin-debug/-/plugin-debug-2.0.0-beta.13.tgz#3313e34b46aaee3ca15c1cad6cdb316faa3a1cdf"
- integrity sha512-tiuKE510Md0RR2+Pkh+YSj41mZmPv/l0c6Mi71mhHiHG5YABjVxbJxoG06WRm/qDkwCwkFcdKRUy/Cu+n9SGDQ==
- dependencies:
- "@docusaurus/core" "2.0.0-beta.13"
- "@docusaurus/utils" "2.0.0-beta.13"
- fs-extra "^10.0.0"
- react-json-view "^1.21.3"
- tslib "^2.3.1"
-
-"@docusaurus/plugin-google-analytics@2.0.0-beta.13":
- version "2.0.0-beta.13"
- resolved "https://registry.yarnpkg.com/@docusaurus/plugin-google-analytics/-/plugin-google-analytics-2.0.0-beta.13.tgz#4f1eea13c32fa3ccc84b865eaafe988f36d4d95b"
- integrity sha512-I37v2aWq43EXVScSOrYqP6PtHNVWar9OJ4Pbgwx1GNAy2VTyAQMoD8cLOCm6LVsEPxzIj+JsvGHrMlzaXZ3WIQ==
- dependencies:
- "@docusaurus/core" "2.0.0-beta.13"
- "@docusaurus/utils-validation" "2.0.0-beta.13"
-
-"@docusaurus/plugin-google-gtag@2.0.0-beta.13":
- version "2.0.0-beta.13"
- resolved "https://registry.yarnpkg.com/@docusaurus/plugin-google-gtag/-/plugin-google-gtag-2.0.0-beta.13.tgz#9d0c477cb3e85ece99f1846d70c0e21d32cb107e"
- integrity sha512-+V4Fp0KaIi50Mf7G0qj1g4xynF6pqDZjhvzZrQG351As9JZanLUIC9ggAleXLQih+ZST1qEEgjogVSlikNlcCQ==
- dependencies:
- "@docusaurus/core" "2.0.0-beta.13"
- "@docusaurus/utils-validation" "2.0.0-beta.13"
-
-"@docusaurus/plugin-sitemap@2.0.0-beta.13":
- version "2.0.0-beta.13"
- resolved "https://registry.yarnpkg.com/@docusaurus/plugin-sitemap/-/plugin-sitemap-2.0.0-beta.13.tgz#d2a2e0eb28286e6277f229a6c3f47ab1b05be052"
- integrity sha512-SEiefgI9nDWgtQXMzaIHAQwKIsof9tYp0iU7BEqRSJqM2CX3LwGIGr1JpQOxBUJfbHu5tk1LMgJO11Pfz/fMNQ==
- dependencies:
- "@docusaurus/core" "2.0.0-beta.13"
- "@docusaurus/utils" "2.0.0-beta.13"
- "@docusaurus/utils-common" "2.0.0-beta.13"
- "@docusaurus/utils-validation" "2.0.0-beta.13"
- fs-extra "^10.0.0"
- sitemap "^7.0.0"
- tslib "^2.3.1"
-
-"@docusaurus/preset-classic@2.0.0-beta.13":
- version "2.0.0-beta.13"
- resolved "https://registry.yarnpkg.com/@docusaurus/preset-classic/-/preset-classic-2.0.0-beta.13.tgz#907badfe99e46d37ab900f148cc7169671c7fe95"
- integrity sha512-LuxZc7/VO0abXVccQaSXND6mY6hA62DKadp4Gaw+IZV5vabrlBLQYaN9G/Cn5De+b1G5qbsyNS3sz6UQLWqQvA==
- dependencies:
- "@docusaurus/core" "2.0.0-beta.13"
- "@docusaurus/plugin-content-blog" "2.0.0-beta.13"
- "@docusaurus/plugin-content-docs" "2.0.0-beta.13"
- "@docusaurus/plugin-content-pages" "2.0.0-beta.13"
- "@docusaurus/plugin-debug" "2.0.0-beta.13"
- "@docusaurus/plugin-google-analytics" "2.0.0-beta.13"
- "@docusaurus/plugin-google-gtag" "2.0.0-beta.13"
- "@docusaurus/plugin-sitemap" "2.0.0-beta.13"
- "@docusaurus/theme-classic" "2.0.0-beta.13"
- "@docusaurus/theme-search-algolia" "2.0.0-beta.13"
-
-"@docusaurus/react-loadable@5.5.2", "react-loadable@npm:@docusaurus/react-loadable@5.5.2":
- version "5.5.2"
- resolved "https://registry.yarnpkg.com/@docusaurus/react-loadable/-/react-loadable-5.5.2.tgz#81aae0db81ecafbdaee3651f12804580868fa6ce"
- integrity sha512-A3dYjdBGuy0IGT+wyLIGIKLRE+sAk1iNk0f1HjNDysO7u8lhL4N3VEm+FAubmJbAztn94F7MxBTPmnixbiyFdQ==
- dependencies:
- "@types/react" "*"
- prop-types "^15.6.2"
-
-"@docusaurus/theme-classic@2.0.0-beta.13":
- version "2.0.0-beta.13"
- resolved "https://registry.yarnpkg.com/@docusaurus/theme-classic/-/theme-classic-2.0.0-beta.13.tgz#131f04dd1812ea3534c59fdb6a970e191fabdd46"
- integrity sha512-c5yc4OauJ0MxVVa872lV2eBUho4xpUaq0U151dXbpQbIs5YRc1RWitzGOSUPuTrERT/d887TuQDfofh/zTHdAQ==
- dependencies:
- "@docusaurus/plugin-content-blog" "2.0.0-beta.13"
- "@docusaurus/plugin-content-docs" "2.0.0-beta.13"
- "@docusaurus/plugin-content-pages" "2.0.0-beta.13"
- "@docusaurus/theme-common" "2.0.0-beta.13"
- "@docusaurus/theme-translations" "2.0.0-beta.13"
- "@docusaurus/utils" "2.0.0-beta.13"
- "@docusaurus/utils-validation" "2.0.0-beta.13"
- "@mdx-js/mdx" "^1.6.21"
- "@mdx-js/react" "^1.6.21"
- chalk "^4.1.2"
- clsx "^1.1.1"
- copy-text-to-clipboard "^3.0.1"
- globby "^11.0.2"
- infima "0.2.0-alpha.36"
- lodash "^4.17.20"
- postcss "^8.3.7"
- prism-react-renderer "^1.2.1"
- prismjs "^1.23.0"
- react-router-dom "^5.2.0"
- rtlcss "^3.3.0"
-
-"@docusaurus/theme-common@2.0.0-beta.13":
- version "2.0.0-beta.13"
- resolved "https://registry.yarnpkg.com/@docusaurus/theme-common/-/theme-common-2.0.0-beta.13.tgz#3b1e2374ed5b2ef7315e197dd8448d824b1853cf"
- integrity sha512-lperE2dgmKmSHIRaMx34qTTwsjDsKu2WSZwbZ/faIPt5lups2OgiON154qYfFqOVwbM+IvdFQWfo4RiEaNesvQ==
- dependencies:
- "@docusaurus/plugin-content-blog" "2.0.0-beta.13"
- "@docusaurus/plugin-content-docs" "2.0.0-beta.13"
- "@docusaurus/plugin-content-pages" "2.0.0-beta.13"
- clsx "^1.1.1"
- fs-extra "^10.0.0"
- parse-numeric-range "^1.3.0"
- tslib "^2.3.1"
- utility-types "^3.10.0"
-
-"@docusaurus/theme-search-algolia@2.0.0-beta.13":
- version "2.0.0-beta.13"
- resolved "https://registry.yarnpkg.com/@docusaurus/theme-search-algolia/-/theme-search-algolia-2.0.0-beta.13.tgz#095c8ffbe1120c2a6f564e8e0fd9418dba2df267"
- integrity sha512-/+jiRQvuG85iWlOsprQd/1OGUifwN8t9WMlPA6TjAcUoycFdra73P/1RHZzMjuUd8CV0VbzaD+wLCryMdf5lIw==
- dependencies:
- "@docsearch/react" "^3.0.0-alpha.39"
- "@docusaurus/core" "2.0.0-beta.13"
- "@docusaurus/theme-common" "2.0.0-beta.13"
- "@docusaurus/theme-translations" "2.0.0-beta.13"
- "@docusaurus/utils" "2.0.0-beta.13"
- "@docusaurus/utils-validation" "2.0.0-beta.13"
- algoliasearch "^4.10.5"
- algoliasearch-helper "^3.5.5"
- clsx "^1.1.1"
- eta "^1.12.3"
- lodash "^4.17.20"
-
-"@docusaurus/theme-translations@2.0.0-beta.13":
- version "2.0.0-beta.13"
- resolved "https://registry.yarnpkg.com/@docusaurus/theme-translations/-/theme-translations-2.0.0-beta.13.tgz#353ebe3d20994a6d71edf28d62aa663db5fa2e92"
- integrity sha512-ZDjObLcJCoylltgbnyOr3gnkh+pOH3U7m3kJJNyVuC3yPIK97NHcQXO5FxujlwjtWL11BIGDOu+oZsmaNL7PMw==
- dependencies:
- fs-extra "^10.0.0"
- tslib "^2.3.1"
-
-"@docusaurus/utils-common@2.0.0-beta.13":
- version "2.0.0-beta.13"
- resolved "https://registry.yarnpkg.com/@docusaurus/utils-common/-/utils-common-2.0.0-beta.13.tgz#12511a35b1fdb1c57b773ed8fb92ad7cffd4da47"
- integrity sha512-jtTGqFbk0qL+338w311aYxpBScAS7MjwXbQdxkBtTV3iELApl6Vc2XXspWCWAQGr+BsRjjz+jnVei9BqUG1PnQ==
- dependencies:
- tslib "^2.3.1"
-
-"@docusaurus/utils-validation@2.0.0-beta.13":
- version "2.0.0-beta.13"
- resolved "https://registry.yarnpkg.com/@docusaurus/utils-validation/-/utils-validation-2.0.0-beta.13.tgz#3ec823a9587f1163e679f7d284277a5b912ea4da"
- integrity sha512-2ucoqiFKQURCmqxRN3uYwper/uEWiY0auMRMt0RnhgRZlY3460IoPMjs5ewyjWAP7huRMhNz/FMmNUheKEK06w==
- dependencies:
- "@docusaurus/utils" "2.0.0-beta.13"
- chalk "^4.1.2"
- joi "^17.4.2"
- tslib "^2.3.1"
-
-"@docusaurus/utils@2.0.0-beta.13":
- version "2.0.0-beta.13"
- resolved "https://registry.yarnpkg.com/@docusaurus/utils/-/utils-2.0.0-beta.13.tgz#aac3d7732593969cacfca29675c490b0309dc324"
- integrity sha512-jvQynP//qwqwD8tvCdCH6a9QMc8XQwC6nJsU3pu6+dvU9STVrriBH4RmrQSL4orPFdJ46sBjQEH7DD3sYvv9fw==
- dependencies:
- "@mdx-js/runtime" "^1.6.22"
- "@svgr/webpack" "^6.0.0"
- chalk "^4.1.2"
- escape-string-regexp "^4.0.0"
- file-loader "^6.2.0"
- fs-extra "^10.0.0"
- github-slugger "^1.4.0"
- globby "^11.0.4"
- gray-matter "^4.0.3"
- lodash "^4.17.20"
- micromatch "^4.0.4"
- remark-mdx-remove-exports "^1.6.22"
- remark-mdx-remove-imports "^1.6.22"
- resolve-pathname "^3.0.0"
- tslib "^2.3.1"
- url-loader "^4.1.1"
-
-"@hapi/hoek@^9.0.0":
- version "9.2.1"
- resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.2.1.tgz#9551142a1980503752536b5050fd99f4a7f13b17"
- integrity sha512-gfta+H8aziZsm8pZa0vj04KO6biEiisppNgA1kbJvFrrWu9Vm7eaUEy76DIxsuTaWvti5fkJVhllWc6ZTE+Mdw==
-
-"@hapi/topo@^5.0.0":
- version "5.1.0"
- resolved "https://registry.yarnpkg.com/@hapi/topo/-/topo-5.1.0.tgz#dc448e332c6c6e37a4dc02fd84ba8d44b9afb012"
- integrity sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==
- dependencies:
- "@hapi/hoek" "^9.0.0"
-
-"@mdx-js/mdx@1.6.22", "@mdx-js/mdx@^1.6.21":
- version "1.6.22"
- resolved "https://registry.yarnpkg.com/@mdx-js/mdx/-/mdx-1.6.22.tgz#8a723157bf90e78f17dc0f27995398e6c731f1ba"
- integrity sha512-AMxuLxPz2j5/6TpF/XSdKpQP1NlG0z11dFOlq+2IP/lSgl11GY8ji6S/rgsViN/L0BDvHvUMruRb7ub+24LUYA==
- dependencies:
- "@babel/core" "7.12.9"
- "@babel/plugin-syntax-jsx" "7.12.1"
- "@babel/plugin-syntax-object-rest-spread" "7.8.3"
- "@mdx-js/util" "1.6.22"
- babel-plugin-apply-mdx-type-prop "1.6.22"
- babel-plugin-extract-import-names "1.6.22"
- camelcase-css "2.0.1"
- detab "2.0.4"
- hast-util-raw "6.0.1"
- lodash.uniq "4.5.0"
- mdast-util-to-hast "10.0.1"
- remark-footnotes "2.0.0"
- remark-mdx "1.6.22"
- remark-parse "8.0.3"
- remark-squeeze-paragraphs "4.0.0"
- style-to-object "0.3.0"
- unified "9.2.0"
- unist-builder "2.0.3"
- unist-util-visit "2.0.3"
-
-"@mdx-js/react@1.6.22", "@mdx-js/react@^1.6.21":
- version "1.6.22"
- resolved "https://registry.yarnpkg.com/@mdx-js/react/-/react-1.6.22.tgz#ae09b4744fddc74714ee9f9d6f17a66e77c43573"
- integrity sha512-TDoPum4SHdfPiGSAaRBw7ECyI8VaHpK8GJugbJIJuqyh6kzw9ZLJZW3HGL3NNrJGxcAixUvqROm+YuQOo5eXtg==
-
-"@mdx-js/runtime@^1.6.22":
- version "1.6.22"
- resolved "https://registry.yarnpkg.com/@mdx-js/runtime/-/runtime-1.6.22.tgz#3edd388bf68a519ffa1aaf9c446b548165102345"
- integrity sha512-p17spaO2+55VLCuxXA3LVHC4phRx60NR2XMdZ+qgVU1lKvEX4y88dmFNOzGDCPLJ03IZyKrJ/rPWWRiBrd9JrQ==
- dependencies:
- "@mdx-js/mdx" "1.6.22"
- "@mdx-js/react" "1.6.22"
- buble-jsx-only "^0.19.8"
-
-"@mdx-js/util@1.6.22":
- version "1.6.22"
- resolved "https://registry.yarnpkg.com/@mdx-js/util/-/util-1.6.22.tgz#219dfd89ae5b97a8801f015323ffa4b62f45718b"
- integrity sha512-H1rQc1ZOHANWBvPcW+JpGwr+juXSxM8Q8YCkm3GhZd8REu1fHR3z99CErO1p9pkcfcxZnMdIZdIsXkOHY0NilA==
-
-"@nodelib/fs.scandir@2.1.5":
- version "2.1.5"
- resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5"
- integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==
- dependencies:
- "@nodelib/fs.stat" "2.0.5"
- run-parallel "^1.1.9"
-
-"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2":
- version "2.0.5"
- resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b"
- integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==
-
-"@nodelib/fs.walk@^1.2.3":
- version "1.2.8"
- resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a"
- integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==
- dependencies:
- "@nodelib/fs.scandir" "2.1.5"
- fastq "^1.6.0"
-
-"@polka/url@^1.0.0-next.20":
- version "1.0.0-next.21"
- resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.21.tgz#5de5a2385a35309427f6011992b544514d559aa1"
- integrity sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==
-
-"@sideway/address@^4.1.3":
- version "4.1.3"
- resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.3.tgz#d93cce5d45c5daec92ad76db492cc2ee3c64ab27"
- integrity sha512-8ncEUtmnTsMmL7z1YPB47kPUq7LpKWJNFPsRzHiIajGC5uXlWGn+AmkYPcHNl8S4tcEGx+cnORnNYaw2wvL+LQ==
- dependencies:
- "@hapi/hoek" "^9.0.0"
-
-"@sideway/formula@^3.0.0":
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/@sideway/formula/-/formula-3.0.0.tgz#fe158aee32e6bd5de85044be615bc08478a0a13c"
- integrity sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg==
-
-"@sideway/pinpoint@^2.0.0":
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/@sideway/pinpoint/-/pinpoint-2.0.0.tgz#cff8ffadc372ad29fd3f78277aeb29e632cc70df"
- integrity sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==
-
-"@sindresorhus/is@^0.14.0":
- version "0.14.0"
- resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea"
- integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==
-
-"@slorber/static-site-generator-webpack-plugin@^4.0.0":
- version "4.0.1"
- resolved "https://registry.yarnpkg.com/@slorber/static-site-generator-webpack-plugin/-/static-site-generator-webpack-plugin-4.0.1.tgz#0c8852146441aaa683693deaa5aee2f991d94841"
- integrity sha512-PSv4RIVO1Y3kvHxjvqeVisk3E9XFoO04uwYBDWe217MFqKspplYswTuKLiJu0aLORQWzuQjfVsSlLPojwfYsLw==
- dependencies:
- bluebird "^3.7.1"
- cheerio "^0.22.0"
- eval "^0.1.4"
- url "^0.11.0"
- webpack-sources "^1.4.3"
-
-"@svgr/babel-plugin-add-jsx-attribute@^6.0.0":
- version "6.0.0"
- resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-6.0.0.tgz#bd6d1ff32a31b82b601e73672a789cc41e84fe18"
- integrity sha512-MdPdhdWLtQsjd29Wa4pABdhWbaRMACdM1h31BY+c6FghTZqNGT7pEYdBoaGeKtdTOBC/XNFQaKVj+r/Ei2ryWA==
-
-"@svgr/babel-plugin-remove-jsx-attribute@^6.0.0":
- version "6.0.0"
- resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-remove-jsx-attribute/-/babel-plugin-remove-jsx-attribute-6.0.0.tgz#58654908beebfa069681a83332544b17e5237e89"
- integrity sha512-aVdtfx9jlaaxc3unA6l+M9YRnKIZjOhQPthLKqmTXC8UVkBLDRGwPKo+r8n3VZN8B34+yVajzPTZ+ptTSuZZCw==
-
-"@svgr/babel-plugin-remove-jsx-empty-expression@^6.0.0":
- version "6.0.0"
- resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-remove-jsx-empty-expression/-/babel-plugin-remove-jsx-empty-expression-6.0.0.tgz#d06dd6e8a8f603f92f9979bb9990a1f85a4f57ba"
- integrity sha512-Ccj42ApsePD451AZJJf1QzTD1B/BOU392URJTeXFxSK709i0KUsGtbwyiqsKu7vsYxpTM0IA5clAKDyf9RCZyA==
-
-"@svgr/babel-plugin-replace-jsx-attribute-value@^6.0.0":
- version "6.0.0"
- resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-replace-jsx-attribute-value/-/babel-plugin-replace-jsx-attribute-value-6.0.0.tgz#0b85837577b02c31c09c758a12932820f5245cee"
- integrity sha512-88V26WGyt1Sfd1emBYmBJRWMmgarrExpKNVmI9vVozha4kqs6FzQJ/Kp5+EYli1apgX44518/0+t9+NU36lThQ==
-
-"@svgr/babel-plugin-svg-dynamic-title@^6.0.0":
- version "6.0.0"
- resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-svg-dynamic-title/-/babel-plugin-svg-dynamic-title-6.0.0.tgz#28236ec26f7ab9d486a487d36ae52d58ba15676f"
- integrity sha512-F7YXNLfGze+xv0KMQxrl2vkNbI9kzT9oDK55/kUuymh1ACyXkMV+VZWX1zEhSTfEKh7VkHVZGmVtHg8eTZ6PRg==
-
-"@svgr/babel-plugin-svg-em-dimensions@^6.0.0":
- version "6.0.0"
- resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-svg-em-dimensions/-/babel-plugin-svg-em-dimensions-6.0.0.tgz#40267c5dea1b43c4f83a0eb6169e08b43d8bafce"
- integrity sha512-+rghFXxdIqJNLQK08kwPBD3Z22/0b2tEZ9lKiL/yTfuyj1wW8HUXu4bo/XkogATIYuXSghVQOOCwURXzHGKyZA==
-
-"@svgr/babel-plugin-transform-react-native-svg@^6.0.0":
- version "6.0.0"
- resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-transform-react-native-svg/-/babel-plugin-transform-react-native-svg-6.0.0.tgz#eb688d0a5f539e34d268d8a516e81f5d7fede7c9"
- integrity sha512-VaphyHZ+xIKv5v0K0HCzyfAaLhPGJXSk2HkpYfXIOKb7DjLBv0soHDxNv6X0vr2titsxE7klb++u7iOf7TSrFQ==
-
-"@svgr/babel-plugin-transform-svg-component@^6.1.0":
- version "6.1.0"
- resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-transform-svg-component/-/babel-plugin-transform-svg-component-6.1.0.tgz#39f92954f7611c269a4ca6906d19e66cdc12babe"
- integrity sha512-1zacrn08K5RyV2NtXahOZ5Im/+aB1Y0LVh6QpzwgQV05sY7H5Npq+OcW/UqXbfB2Ua/WnHsFossFQqigCjarYg==
-
-"@svgr/babel-preset@^6.1.0":
- version "6.1.0"
- resolved "https://registry.yarnpkg.com/@svgr/babel-preset/-/babel-preset-6.1.0.tgz#b8a6b0019537bcd75b3e23fd33c180476c1ef446"
- integrity sha512-f9XrTqcwhHLVkjvXBw6QJVxuIfmW22z8iTdGqGvUGGxWoeRV2EzSHstWMBgIVd7t+TmkerqowRvBYiT0OEx3cw==
- dependencies:
- "@svgr/babel-plugin-add-jsx-attribute" "^6.0.0"
- "@svgr/babel-plugin-remove-jsx-attribute" "^6.0.0"
- "@svgr/babel-plugin-remove-jsx-empty-expression" "^6.0.0"
- "@svgr/babel-plugin-replace-jsx-attribute-value" "^6.0.0"
- "@svgr/babel-plugin-svg-dynamic-title" "^6.0.0"
- "@svgr/babel-plugin-svg-em-dimensions" "^6.0.0"
- "@svgr/babel-plugin-transform-react-native-svg" "^6.0.0"
- "@svgr/babel-plugin-transform-svg-component" "^6.1.0"
-
-"@svgr/core@^6.1.2":
- version "6.1.2"
- resolved "https://registry.yarnpkg.com/@svgr/core/-/core-6.1.2.tgz#17db14b8d559cb9dc4afa459aa487c00bf6cab80"
- integrity sha512-G1UVZcPS5R+HfBG5QC7n2ibkax8RXki2sbKHySTTnajeNXbzriBJcpF4GpYzWptfvD2gmqTDY9XaX+x08TUyGQ==
- dependencies:
- "@svgr/plugin-jsx" "^6.1.2"
- camelcase "^6.2.0"
- cosmiconfig "^7.0.1"
-
-"@svgr/hast-util-to-babel-ast@^6.0.0":
- version "6.0.0"
- resolved "https://registry.yarnpkg.com/@svgr/hast-util-to-babel-ast/-/hast-util-to-babel-ast-6.0.0.tgz#423329ad866b6c169009cc82b5e28ffee80c857c"
- integrity sha512-S+TxtCdDyRGafH1VG1t/uPZ87aOYOHzWL8kqz4FoSZcIbzWA6rnOmjNViNiDzqmEpzp2PW5o5mZfvC9DiVZhTQ==
- dependencies:
- "@babel/types" "^7.15.6"
- entities "^3.0.1"
-
-"@svgr/plugin-jsx@^6.1.2":
- version "6.1.2"
- resolved "https://registry.yarnpkg.com/@svgr/plugin-jsx/-/plugin-jsx-6.1.2.tgz#8a2815aaa46cc3d5cffa963e92b06bd0c33e7748"
- integrity sha512-K/w16g3BznTjVjLyUyV0fE7LLl1HSq5KJjvczFVVvx9QG0+3xtU7RX6gvoVnTvYlrNo8QxxqLWVAU3HQm68Eew==
- dependencies:
- "@babel/core" "^7.15.5"
- "@svgr/babel-preset" "^6.1.0"
- "@svgr/hast-util-to-babel-ast" "^6.0.0"
- svg-parser "^2.0.2"
-
-"@svgr/plugin-svgo@^6.1.2":
- version "6.1.2"
- resolved "https://registry.yarnpkg.com/@svgr/plugin-svgo/-/plugin-svgo-6.1.2.tgz#4fe7a2defe237f0493dee947dde6fa5cea57e6c1"
- integrity sha512-UHVSRZV3RdaggDT60OMIEmhskN736DOF6PuBcCaql6jBDA9+SZkA5ZMEw73ZLAlwdOAmw+0Gi4vx/xvAfnmerw==
- dependencies:
- cosmiconfig "^7.0.1"
- deepmerge "^4.2.2"
- svgo "^2.5.0"
-
-"@svgr/webpack@^6.0.0":
- version "6.1.2"
- resolved "https://registry.yarnpkg.com/@svgr/webpack/-/webpack-6.1.2.tgz#23fd605e9163deb7ef3feef52545ff11dc9989bf"
- integrity sha512-5RzzWxFquywENwvnsiGjZ7IED+0l2lnICR3OKQ6OUyGgxlu+ac73NmDSXp6EPBz/ZTArpMZtug7jiPMUkXxnlg==
- dependencies:
- "@babel/core" "^7.15.5"
- "@babel/plugin-transform-react-constant-elements" "^7.14.5"
- "@babel/preset-env" "^7.15.6"
- "@babel/preset-react" "^7.14.5"
- "@babel/preset-typescript" "^7.15.0"
- "@svgr/core" "^6.1.2"
- "@svgr/plugin-jsx" "^6.1.2"
- "@svgr/plugin-svgo" "^6.1.2"
-
-"@szmarczak/http-timer@^1.1.2":
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421"
- integrity sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==
- dependencies:
- defer-to-connect "^1.0.1"
-
-"@trysound/sax@0.2.0":
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.2.0.tgz#cccaab758af56761eb7bf37af6f03f326dd798ad"
- integrity sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==
-
-"@types/body-parser@*":
- version "1.19.2"
- resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.2.tgz#aea2059e28b7658639081347ac4fab3de166e6f0"
- integrity sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==
- dependencies:
- "@types/connect" "*"
- "@types/node" "*"
-
-"@types/bonjour@^3.5.9":
- version "3.5.10"
- resolved "https://registry.yarnpkg.com/@types/bonjour/-/bonjour-3.5.10.tgz#0f6aadfe00ea414edc86f5d106357cda9701e275"
- integrity sha512-p7ienRMiS41Nu2/igbJxxLDWrSZ0WxM8UQgCeO9KhoVF7cOVFkrKsiDr1EsJIla8vV3oEEjGcz11jc5yimhzZw==
- dependencies:
- "@types/node" "*"
-
-"@types/connect-history-api-fallback@^1.3.5":
- version "1.3.5"
- resolved "https://registry.yarnpkg.com/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.3.5.tgz#d1f7a8a09d0ed5a57aee5ae9c18ab9b803205dae"
- integrity sha512-h8QJa8xSb1WD4fpKBDcATDNGXghFj6/3GRWG6dhmRcu0RX1Ubasur2Uvx5aeEwlf0MwblEC2bMzzMQntxnw/Cw==
- dependencies:
- "@types/express-serve-static-core" "*"
- "@types/node" "*"
-
-"@types/connect@*":
- version "3.4.35"
- resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.35.tgz#5fcf6ae445e4021d1fc2219a4873cc73a3bb2ad1"
- integrity sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==
- dependencies:
- "@types/node" "*"
-
-"@types/eslint-scope@^3.7.0":
- version "3.7.2"
- resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.2.tgz#11e96a868c67acf65bf6f11d10bb89ea71d5e473"
- integrity sha512-TzgYCWoPiTeRg6RQYgtuW7iODtVoKu3RVL72k3WohqhjfaOLK5Mg2T4Tg1o2bSfu0vPkoI48wdQFv5b/Xe04wQ==
- dependencies:
- "@types/eslint" "*"
- "@types/estree" "*"
-
-"@types/eslint@*":
- version "8.2.1"
- resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.2.1.tgz#13f3d69bac93c2ae008019c28783868d0a1d6605"
- integrity sha512-UP9rzNn/XyGwb5RQ2fok+DzcIRIYwc16qTXse5+Smsy8MOIccCChT15KAwnsgQx4PzJkaMq4myFyZ4CL5TjhIQ==
- dependencies:
- "@types/estree" "*"
- "@types/json-schema" "*"
-
-"@types/estree@*", "@types/estree@^0.0.50":
- version "0.0.50"
- resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83"
- integrity sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw==
-
-"@types/express-serve-static-core@*", "@types/express-serve-static-core@^4.17.18":
- version "4.17.27"
- resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.27.tgz#7a776191e47295d2a05962ecbb3a4ce97e38b401"
- integrity sha512-e/sVallzUTPdyOTiqi8O8pMdBBphscvI6E4JYaKlja4Lm+zh7UFSSdW5VMkRbhDtmrONqOUHOXRguPsDckzxNA==
- dependencies:
- "@types/node" "*"
- "@types/qs" "*"
- "@types/range-parser" "*"
-
-"@types/express@*":
- version "4.17.13"
- resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.13.tgz#a76e2995728999bab51a33fabce1d705a3709034"
- integrity sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==
- dependencies:
- "@types/body-parser" "*"
- "@types/express-serve-static-core" "^4.17.18"
- "@types/qs" "*"
- "@types/serve-static" "*"
-
-"@types/hast@^2.0.0":
- version "2.3.4"
- resolved "https://registry.yarnpkg.com/@types/hast/-/hast-2.3.4.tgz#8aa5ef92c117d20d974a82bdfb6a648b08c0bafc"
- integrity sha512-wLEm0QvaoawEDoTRwzTXp4b4jpwiJDvR5KMnFnVodm3scufTlBOWRD6N1OBf9TZMhjlNsSfcO5V+7AF4+Vy+9g==
- dependencies:
- "@types/unist" "*"
-
-"@types/html-minifier-terser@^6.0.0":
- version "6.1.0"
- resolved "https://registry.yarnpkg.com/@types/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz#4fc33a00c1d0c16987b1a20cf92d20614c55ac35"
- integrity sha512-oh/6byDPnL1zeNXFrDXFLyZjkr1MsBG667IM792caf1L2UPOOMf65NFzjUH/ltyfwjAGfs1rsX1eftK0jC/KIg==
-
-"@types/http-proxy@^1.17.5":
- version "1.17.8"
- resolved "https://registry.yarnpkg.com/@types/http-proxy/-/http-proxy-1.17.8.tgz#968c66903e7e42b483608030ee85800f22d03f55"
- integrity sha512-5kPLG5BKpWYkw/LVOGWpiq3nEVqxiN32rTgI53Sk12/xHFQ2rG3ehI9IO+O3W2QoKeyB92dJkoka8SUm6BX1pA==
- dependencies:
- "@types/node" "*"
-
-"@types/json-schema@*", "@types/json-schema@^7.0.4", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9":
- version "7.0.9"
- resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d"
- integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==
-
-"@types/mdast@^3.0.0":
- version "3.0.10"
- resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-3.0.10.tgz#4724244a82a4598884cbbe9bcfd73dff927ee8af"
- integrity sha512-W864tg/Osz1+9f4lrGTZpCSO5/z4608eUp19tbozkq2HJK6i3z1kT0H9tlADXuYIb1YYOBByU4Jsqkk75q48qA==
- dependencies:
- "@types/unist" "*"
-
-"@types/mime@^1":
- version "1.3.2"
- resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a"
- integrity sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==
-
-"@types/node@*":
- version "17.0.5"
- resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.5.tgz#57ca67ec4e57ad9e4ef5a6bab48a15387a1c83e0"
- integrity sha512-w3mrvNXLeDYV1GKTZorGJQivK6XLCoGwpnyJFbJVK/aTBQUxOCaa/GlFAAN3OTDFcb7h5tiFG+YXCO2By+riZw==
-
-"@types/node@^15.0.1":
- version "15.14.9"
- resolved "https://registry.yarnpkg.com/@types/node/-/node-15.14.9.tgz#bc43c990c3c9be7281868bbc7b8fdd6e2b57adfa"
- integrity sha512-qjd88DrCxupx/kJD5yQgZdcYKZKSIGBVDIBE1/LTGcNm3d2Np/jxojkdePDdfnBHJc5W7vSMpbJ1aB7p/Py69A==
-
-"@types/parse-json@^4.0.0":
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0"
- integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==
-
-"@types/parse5@^5.0.0":
- version "5.0.3"
- resolved "https://registry.yarnpkg.com/@types/parse5/-/parse5-5.0.3.tgz#e7b5aebbac150f8b5fdd4a46e7f0bd8e65e19109"
- integrity sha512-kUNnecmtkunAoQ3CnjmMkzNU/gtxG8guhi+Fk2U/kOpIKjIMKnXGp4IJCgQJrXSgMsWYimYG4TGjz/UzbGEBTw==
-
-"@types/prop-types@*":
- version "15.7.4"
- resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.4.tgz#fcf7205c25dff795ee79af1e30da2c9790808f11"
- integrity sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ==
-
-"@types/qs@*":
- version "6.9.7"
- resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb"
- integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==
-
-"@types/range-parser@*":
- version "1.2.4"
- resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc"
- integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==
-
-"@types/react@*":
- version "17.0.38"
- resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.38.tgz#f24249fefd89357d5fa71f739a686b8d7c7202bd"
- integrity sha512-SI92X1IA+FMnP3qM5m4QReluXzhcmovhZnLNm3pyeQlooi02qI7sLiepEYqT678uNiyc25XfCqxREFpy3W7YhQ==
- dependencies:
- "@types/prop-types" "*"
- "@types/scheduler" "*"
- csstype "^3.0.2"
-
-"@types/retry@^0.12.0":
- version "0.12.1"
- resolved "https://registry.yarnpkg.com/@types/retry/-/retry-0.12.1.tgz#d8f1c0d0dc23afad6dc16a9e993a0865774b4065"
- integrity sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g==
-
-"@types/sax@^1.2.1":
- version "1.2.4"
- resolved "https://registry.yarnpkg.com/@types/sax/-/sax-1.2.4.tgz#8221affa7f4f3cb21abd22f244cfabfa63e6a69e"
- integrity sha512-pSAff4IAxJjfAXUG6tFkO7dsSbTmf8CtUpfhhZ5VhkRpC4628tJhh3+V6H1E+/Gs9piSzYKT5yzHO5M4GG9jkw==
- dependencies:
- "@types/node" "*"
-
-"@types/scheduler@*":
- version "0.16.2"
- resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39"
- integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==
-
-"@types/serve-index@^1.9.1":
- version "1.9.1"
- resolved "https://registry.yarnpkg.com/@types/serve-index/-/serve-index-1.9.1.tgz#1b5e85370a192c01ec6cec4735cf2917337a6278"
- integrity sha512-d/Hs3nWDxNL2xAczmOVZNj92YZCS6RGxfBPjKzuu/XirCgXdpKEb88dYNbrYGint6IVWLNP+yonwVAuRC0T2Dg==
- dependencies:
- "@types/express" "*"
-
-"@types/serve-static@*":
- version "1.13.10"
- resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.13.10.tgz#f5e0ce8797d2d7cc5ebeda48a52c96c4fa47a8d9"
- integrity sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ==
- dependencies:
- "@types/mime" "^1"
- "@types/node" "*"
-
-"@types/sockjs@^0.3.33":
- version "0.3.33"
- resolved "https://registry.yarnpkg.com/@types/sockjs/-/sockjs-0.3.33.tgz#570d3a0b99ac995360e3136fd6045113b1bd236f"
- integrity sha512-f0KEEe05NvUnat+boPTZ0dgaLZ4SfSouXUgv5noUiefG2ajgKjmETo9ZJyuqsl7dfl2aHlLJUiki6B4ZYldiiw==
- dependencies:
- "@types/node" "*"
-
-"@types/unist@*", "@types/unist@^2.0.0", "@types/unist@^2.0.2", "@types/unist@^2.0.3":
- version "2.0.6"
- resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.6.tgz#250a7b16c3b91f672a24552ec64678eeb1d3a08d"
- integrity sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==
-
-"@types/ws@^8.2.2":
- version "8.2.2"
- resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.2.2.tgz#7c5be4decb19500ae6b3d563043cd407bf366c21"
- integrity sha512-NOn5eIcgWLOo6qW8AcuLZ7G8PycXu0xTxxkS6Q18VWFxgPUSOwV0pBj2a/4viNZVu25i7RIB7GttdkAIUUXOOg==
- dependencies:
- "@types/node" "*"
-
-"@webassemblyjs/ast@1.11.1":
- version "1.11.1"
- resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.1.tgz#2bfd767eae1a6996f432ff7e8d7fc75679c0b6a7"
- integrity sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==
- dependencies:
- "@webassemblyjs/helper-numbers" "1.11.1"
- "@webassemblyjs/helper-wasm-bytecode" "1.11.1"
-
-"@webassemblyjs/floating-point-hex-parser@1.11.1":
- version "1.11.1"
- resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz#f6c61a705f0fd7a6aecaa4e8198f23d9dc179e4f"
- integrity sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==
-
-"@webassemblyjs/helper-api-error@1.11.1":
- version "1.11.1"
- resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz#1a63192d8788e5c012800ba6a7a46c705288fd16"
- integrity sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==
-
-"@webassemblyjs/helper-buffer@1.11.1":
- version "1.11.1"
- resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz#832a900eb444884cde9a7cad467f81500f5e5ab5"
- integrity sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA==
-
-"@webassemblyjs/helper-numbers@1.11.1":
- version "1.11.1"
- resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz#64d81da219fbbba1e3bd1bfc74f6e8c4e10a62ae"
- integrity sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ==
- dependencies:
- "@webassemblyjs/floating-point-hex-parser" "1.11.1"
- "@webassemblyjs/helper-api-error" "1.11.1"
- "@xtuc/long" "4.2.2"
-
-"@webassemblyjs/helper-wasm-bytecode@1.11.1":
- version "1.11.1"
- resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz#f328241e41e7b199d0b20c18e88429c4433295e1"
- integrity sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==
-
-"@webassemblyjs/helper-wasm-section@1.11.1":
- version "1.11.1"
- resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz#21ee065a7b635f319e738f0dd73bfbda281c097a"
- integrity sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg==
- dependencies:
- "@webassemblyjs/ast" "1.11.1"
- "@webassemblyjs/helper-buffer" "1.11.1"
- "@webassemblyjs/helper-wasm-bytecode" "1.11.1"
- "@webassemblyjs/wasm-gen" "1.11.1"
-
-"@webassemblyjs/ieee754@1.11.1":
- version "1.11.1"
- resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz#963929e9bbd05709e7e12243a099180812992614"
- integrity sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ==
- dependencies:
- "@xtuc/ieee754" "^1.2.0"
-
-"@webassemblyjs/leb128@1.11.1":
- version "1.11.1"
- resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.11.1.tgz#ce814b45574e93d76bae1fb2644ab9cdd9527aa5"
- integrity sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw==
- dependencies:
- "@xtuc/long" "4.2.2"
-
-"@webassemblyjs/utf8@1.11.1":
- version "1.11.1"
- resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.11.1.tgz#d1f8b764369e7c6e6bae350e854dec9a59f0a3ff"
- integrity sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ==
-
-"@webassemblyjs/wasm-edit@1.11.1":
- version "1.11.1"
- resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz#ad206ebf4bf95a058ce9880a8c092c5dec8193d6"
- integrity sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA==
- dependencies:
- "@webassemblyjs/ast" "1.11.1"
- "@webassemblyjs/helper-buffer" "1.11.1"
- "@webassemblyjs/helper-wasm-bytecode" "1.11.1"
- "@webassemblyjs/helper-wasm-section" "1.11.1"
- "@webassemblyjs/wasm-gen" "1.11.1"
- "@webassemblyjs/wasm-opt" "1.11.1"
- "@webassemblyjs/wasm-parser" "1.11.1"
- "@webassemblyjs/wast-printer" "1.11.1"
-
-"@webassemblyjs/wasm-gen@1.11.1":
- version "1.11.1"
- resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz#86c5ea304849759b7d88c47a32f4f039ae3c8f76"
- integrity sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA==
- dependencies:
- "@webassemblyjs/ast" "1.11.1"
- "@webassemblyjs/helper-wasm-bytecode" "1.11.1"
- "@webassemblyjs/ieee754" "1.11.1"
- "@webassemblyjs/leb128" "1.11.1"
- "@webassemblyjs/utf8" "1.11.1"
-
-"@webassemblyjs/wasm-opt@1.11.1":
- version "1.11.1"
- resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz#657b4c2202f4cf3b345f8a4c6461c8c2418985f2"
- integrity sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw==
- dependencies:
- "@webassemblyjs/ast" "1.11.1"
- "@webassemblyjs/helper-buffer" "1.11.1"
- "@webassemblyjs/wasm-gen" "1.11.1"
- "@webassemblyjs/wasm-parser" "1.11.1"
-
-"@webassemblyjs/wasm-parser@1.11.1":
- version "1.11.1"
- resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz#86ca734534f417e9bd3c67c7a1c75d8be41fb199"
- integrity sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA==
- dependencies:
- "@webassemblyjs/ast" "1.11.1"
- "@webassemblyjs/helper-api-error" "1.11.1"
- "@webassemblyjs/helper-wasm-bytecode" "1.11.1"
- "@webassemblyjs/ieee754" "1.11.1"
- "@webassemblyjs/leb128" "1.11.1"
- "@webassemblyjs/utf8" "1.11.1"
-
-"@webassemblyjs/wast-printer@1.11.1":
- version "1.11.1"
- resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz#d0c73beda8eec5426f10ae8ef55cee5e7084c2f0"
- integrity sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg==
- dependencies:
- "@webassemblyjs/ast" "1.11.1"
- "@xtuc/long" "4.2.2"
-
-"@xtuc/ieee754@^1.2.0":
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790"
- integrity sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==
-
-"@xtuc/long@4.2.2":
- version "4.2.2"
- resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d"
- integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==
-
-accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7:
- version "1.3.7"
- resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd"
- integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==
- dependencies:
- mime-types "~2.1.24"
- negotiator "0.6.2"
-
-acorn-dynamic-import@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz#482210140582a36b83c3e342e1cfebcaa9240948"
- integrity sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw==
-
-acorn-import-assertions@^1.7.6:
- version "1.8.0"
- resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz#ba2b5939ce62c238db6d93d81c9b111b29b855e9"
- integrity sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==
-
-acorn-jsx@^5.0.1:
- version "5.3.2"
- resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937"
- integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==
-
-acorn-walk@^8.0.0:
- version "8.2.0"
- resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1"
- integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==
-
-acorn@^6.1.1:
- version "6.4.2"
- resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6"
- integrity sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==
-
-acorn@^8.0.4, acorn@^8.4.1:
- version "8.7.0"
- resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf"
- integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==
-
-address@^1.0.1, address@^1.1.2:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/address/-/address-1.1.2.tgz#bf1116c9c758c51b7a933d296b72c221ed9428b6"
- integrity sha512-aT6camzM4xEA54YVJYSqxz1kv4IHnQZRtThJJHhUMRExaU5spC7jX5ugSwTaTgJliIgs4VhZOk7htClvQ/LmRA==
-
-aggregate-error@^3.0.0:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a"
- integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==
- dependencies:
- clean-stack "^2.0.0"
- indent-string "^4.0.0"
-
-ajv-formats@^2.1.1:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/ajv-formats/-/ajv-formats-2.1.1.tgz#6e669400659eb74973bbf2e33327180a0996b520"
- integrity sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==
- dependencies:
- ajv "^8.0.0"
-
-ajv-keywords@^3.4.1, ajv-keywords@^3.5.2:
- version "3.5.2"
- resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d"
- integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==
-
-ajv-keywords@^5.0.0:
- version "5.1.0"
- resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-5.1.0.tgz#69d4d385a4733cdbeab44964a1170a88f87f0e16"
- integrity sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==
- dependencies:
- fast-deep-equal "^3.1.3"
-
-ajv@^6.12.2, ajv@^6.12.4, ajv@^6.12.5:
- version "6.12.6"
- resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4"
- integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==
- dependencies:
- fast-deep-equal "^3.1.1"
- fast-json-stable-stringify "^2.0.0"
- json-schema-traverse "^0.4.1"
- uri-js "^4.2.2"
-
-ajv@^8.0.0, ajv@^8.8.0:
- version "8.8.2"
- resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.8.2.tgz#01b4fef2007a28bf75f0b7fc009f62679de4abbb"
- integrity sha512-x9VuX+R/jcFj1DHo/fCp99esgGDWiHENrKxaCENuCxpoMCmAt/COCGVDwA7kleEpEzJjDnvh3yGoOuLu0Dtllw==
- dependencies:
- fast-deep-equal "^3.1.1"
- json-schema-traverse "^1.0.0"
- require-from-string "^2.0.2"
- uri-js "^4.2.2"
-
-algoliasearch-helper@^3.5.5:
- version "3.7.0"
- resolved "https://registry.yarnpkg.com/algoliasearch-helper/-/algoliasearch-helper-3.7.0.tgz#c0a0493df84d850360f664ad7a9d4fc78a94fd78"
- integrity sha512-XJ3QfERBLfeVCyTVx80gon7r3/rgm/CE8Ha1H7cbablRe/X7SfYQ14g/eO+MhjVKIQp+gy9oC6G5ilmLwS1k6w==
- dependencies:
- "@algolia/events" "^4.0.1"
-
-algoliasearch@^4.0.0, algoliasearch@^4.10.5:
- version "4.11.0"
- resolved "https://registry.yarnpkg.com/algoliasearch/-/algoliasearch-4.11.0.tgz#234befb3ac355c094077f0edf3777240b1ee013c"
- integrity sha512-IXRj8kAP2WrMmj+eoPqPc6P7Ncq1yZkFiyDrjTBObV1ADNL8Z/KdZ+dWC5MmYcBLAbcB/mMCpak5N/D1UIZvsA==
- dependencies:
- "@algolia/cache-browser-local-storage" "4.11.0"
- "@algolia/cache-common" "4.11.0"
- "@algolia/cache-in-memory" "4.11.0"
- "@algolia/client-account" "4.11.0"
- "@algolia/client-analytics" "4.11.0"
- "@algolia/client-common" "4.11.0"
- "@algolia/client-personalization" "4.11.0"
- "@algolia/client-search" "4.11.0"
- "@algolia/logger-common" "4.11.0"
- "@algolia/logger-console" "4.11.0"
- "@algolia/requester-browser-xhr" "4.11.0"
- "@algolia/requester-common" "4.11.0"
- "@algolia/requester-node-http" "4.11.0"
- "@algolia/transporter" "4.11.0"
-
-alphanum-sort@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3"
- integrity sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=
-
-ansi-align@^3.0.0:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.1.tgz#0cdf12e111ace773a86e9a1fad1225c43cb19a59"
- integrity sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==
- dependencies:
- string-width "^4.1.0"
-
-ansi-html-community@^0.0.8:
- version "0.0.8"
- resolved "https://registry.yarnpkg.com/ansi-html-community/-/ansi-html-community-0.0.8.tgz#69fbc4d6ccbe383f9736934ae34c3f8290f1bf41"
- integrity sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw==
-
-ansi-regex@^5.0.1:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
- integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
-
-ansi-regex@^6.0.1:
- version "6.0.1"
- resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a"
- integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==
-
-ansi-styles@^3.2.1:
- version "3.2.1"
- resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
- integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==
- dependencies:
- color-convert "^1.9.0"
-
-ansi-styles@^4.0.0, ansi-styles@^4.1.0:
- version "4.3.0"
- resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
- integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
- dependencies:
- color-convert "^2.0.1"
-
-anymatch@~3.1.2:
- version "3.1.2"
- resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716"
- integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==
- dependencies:
- normalize-path "^3.0.0"
- picomatch "^2.0.4"
-
-arg@^5.0.0:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/arg/-/arg-5.0.1.tgz#eb0c9a8f77786cad2af8ff2b862899842d7b6adb"
- integrity sha512-e0hDa9H2Z9AwFkk2qDlwhoMYE4eToKarchkQHovNdLTCYMHZHeRjI71crOh+dio4K6u1IcwubQqo79Ga4CyAQA==
-
-argparse@^1.0.7:
- version "1.0.10"
- resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
- integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==
- dependencies:
- sprintf-js "~1.0.2"
-
-argparse@^2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
- integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==
-
-array-flatten@1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2"
- integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=
-
-array-flatten@^2.1.0:
- version "2.1.2"
- resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-2.1.2.tgz#24ef80a28c1a893617e2149b0c6d0d788293b099"
- integrity sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ==
-
-array-union@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d"
- integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==
-
-asap@~2.0.3:
- version "2.0.6"
- resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46"
- integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=
-
-async@^2.6.2:
- version "2.6.3"
- resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff"
- integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==
- dependencies:
- lodash "^4.17.14"
-
-at-least-node@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2"
- integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==
-
-autoprefixer@^10.3.5, autoprefixer@^10.3.7:
- version "10.4.0"
- resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.0.tgz#c3577eb32a1079a440ec253e404eaf1eb21388c8"
- integrity sha512-7FdJ1ONtwzV1G43GDD0kpVMn/qbiNqyOPMFTX5nRffI+7vgWoFEc6DcXOxHJxrWNDXrZh18eDsZjvZGUljSRGA==
- dependencies:
- browserslist "^4.17.5"
- caniuse-lite "^1.0.30001272"
- fraction.js "^4.1.1"
- normalize-range "^0.1.2"
- picocolors "^1.0.0"
- postcss-value-parser "^4.1.0"
-
-axios@^0.21.1:
- version "0.21.4"
- resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575"
- integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==
- dependencies:
- follow-redirects "^1.14.0"
-
-babel-loader@^8.2.2:
- version "8.2.3"
- resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.2.3.tgz#8986b40f1a64cacfcb4b8429320085ef68b1342d"
- integrity sha512-n4Zeta8NC3QAsuyiizu0GkmRcQ6clkV9WFUnUf1iXP//IeSKbWjofW3UHyZVwlOB4y039YQKefawyTn64Zwbuw==
- dependencies:
- find-cache-dir "^3.3.1"
- loader-utils "^1.4.0"
- make-dir "^3.1.0"
- schema-utils "^2.6.5"
-
-babel-plugin-apply-mdx-type-prop@1.6.22:
- version "1.6.22"
- resolved "https://registry.yarnpkg.com/babel-plugin-apply-mdx-type-prop/-/babel-plugin-apply-mdx-type-prop-1.6.22.tgz#d216e8fd0de91de3f1478ef3231e05446bc8705b"
- integrity sha512-VefL+8o+F/DfK24lPZMtJctrCVOfgbqLAGZSkxwhazQv4VxPg3Za/i40fu22KR2m8eEda+IfSOlPLUSIiLcnCQ==
- dependencies:
- "@babel/helper-plugin-utils" "7.10.4"
- "@mdx-js/util" "1.6.22"
-
-babel-plugin-dynamic-import-node@2.3.0:
- version "2.3.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.0.tgz#f00f507bdaa3c3e3ff6e7e5e98d90a7acab96f7f"
- integrity sha512-o6qFkpeQEBxcqt0XYlWzAVxNCSCZdUgcR8IRlhD/8DylxjjO4foPcvTW0GGKa/cVt3rvxZ7o5ippJ+/0nvLhlQ==
- dependencies:
- object.assign "^4.1.0"
-
-babel-plugin-dynamic-import-node@^2.3.3:
- version "2.3.3"
- resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz#84fda19c976ec5c6defef57f9427b3def66e17a3"
- integrity sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==
- dependencies:
- object.assign "^4.1.0"
-
-babel-plugin-extract-import-names@1.6.22:
- version "1.6.22"
- resolved "https://registry.yarnpkg.com/babel-plugin-extract-import-names/-/babel-plugin-extract-import-names-1.6.22.tgz#de5f9a28eb12f3eb2578bf74472204e66d1a13dc"
- integrity sha512-yJ9BsJaISua7d8zNT7oRG1ZLBJCIdZ4PZqmH8qa9N5AK01ifk3fnkc98AXhtzE7UkfCsEumvoQWgoYLhOnJ7jQ==
- dependencies:
- "@babel/helper-plugin-utils" "7.10.4"
-
-babel-plugin-polyfill-corejs2@^0.3.0:
- version "0.3.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.0.tgz#407082d0d355ba565af24126fb6cb8e9115251fd"
- integrity sha512-wMDoBJ6uG4u4PNFh72Ty6t3EgfA91puCuAwKIazbQlci+ENb/UU9A3xG5lutjUIiXCIn1CY5L15r9LimiJyrSA==
- dependencies:
- "@babel/compat-data" "^7.13.11"
- "@babel/helper-define-polyfill-provider" "^0.3.0"
- semver "^6.1.1"
-
-babel-plugin-polyfill-corejs3@^0.4.0:
- version "0.4.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.4.0.tgz#0b571f4cf3d67f911512f5c04842a7b8e8263087"
- integrity sha512-YxFreYwUfglYKdLUGvIF2nJEsGwj+RhWSX/ije3D2vQPOXuyMLMtg/cCGMDpOA7Nd+MwlNdnGODbd2EwUZPlsw==
- dependencies:
- "@babel/helper-define-polyfill-provider" "^0.3.0"
- core-js-compat "^3.18.0"
-
-babel-plugin-polyfill-regenerator@^0.3.0:
- version "0.3.0"
- resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.3.0.tgz#9ebbcd7186e1a33e21c5e20cae4e7983949533be"
- integrity sha512-dhAPTDLGoMW5/84wkgwiLRwMnio2i1fUe53EuvtKMv0pn2p3S8OCoV1xAzfJPl0KOX7IB89s2ib85vbYiea3jg==
- dependencies:
- "@babel/helper-define-polyfill-provider" "^0.3.0"
-
-bail@^1.0.0:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/bail/-/bail-1.0.5.tgz#b6fa133404a392cbc1f8c4bf63f5953351e7a776"
- integrity sha512-xFbRxM1tahm08yHBP16MMjVUAvDaBMD38zsM9EMAUN61omwLmKlOpB/Zku5QkjZ8TZ4vn53pj+t518cH0S03RQ==
-
-balanced-match@^1.0.0:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
- integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
-
-base16@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/base16/-/base16-1.0.0.tgz#e297f60d7ec1014a7a971a39ebc8a98c0b681e70"
- integrity sha1-4pf2DX7BAUp6lxo568ipjAtoHnA=
-
-batch@0.6.1:
- version "0.6.1"
- resolved "https://registry.yarnpkg.com/batch/-/batch-0.6.1.tgz#dc34314f4e679318093fc760272525f94bf25c16"
- integrity sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=
-
-big.js@^5.2.2:
- version "5.2.2"
- resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328"
- integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==
-
-binary-extensions@^2.0.0:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d"
- integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==
-
-bluebird@^3.7.1:
- version "3.7.2"
- resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f"
- integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==
-
-body-parser@1.19.1:
- version "1.19.1"
- resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.1.tgz#1499abbaa9274af3ecc9f6f10396c995943e31d4"
- integrity sha512-8ljfQi5eBk8EJfECMrgqNGWPEY5jWP+1IzkzkGdFFEwFQZZyaZ21UqdaHktgiMlH0xLHqIFtE/u2OYE5dOtViA==
- dependencies:
- bytes "3.1.1"
- content-type "~1.0.4"
- debug "2.6.9"
- depd "~1.1.2"
- http-errors "1.8.1"
- iconv-lite "0.4.24"
- on-finished "~2.3.0"
- qs "6.9.6"
- raw-body "2.4.2"
- type-is "~1.6.18"
-
-bonjour@^3.5.0:
- version "3.5.0"
- resolved "https://registry.yarnpkg.com/bonjour/-/bonjour-3.5.0.tgz#8e890a183d8ee9a2393b3844c691a42bcf7bc9f5"
- integrity sha1-jokKGD2O6aI5OzhExpGkK897yfU=
- dependencies:
- array-flatten "^2.1.0"
- deep-equal "^1.0.1"
- dns-equal "^1.0.0"
- dns-txt "^2.0.2"
- multicast-dns "^6.0.1"
- multicast-dns-service-types "^1.1.0"
-
-boolbase@^1.0.0, boolbase@~1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e"
- integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24=
-
-boxen@^5.0.0, boxen@^5.0.1:
- version "5.1.2"
- resolved "https://registry.yarnpkg.com/boxen/-/boxen-5.1.2.tgz#788cb686fc83c1f486dfa8a40c68fc2b831d2b50"
- integrity sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==
- dependencies:
- ansi-align "^3.0.0"
- camelcase "^6.2.0"
- chalk "^4.1.0"
- cli-boxes "^2.2.1"
- string-width "^4.2.2"
- type-fest "^0.20.2"
- widest-line "^3.1.0"
- wrap-ansi "^7.0.0"
-
-brace-expansion@^1.1.7:
- version "1.1.11"
- resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
- integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
- dependencies:
- balanced-match "^1.0.0"
- concat-map "0.0.1"
-
-braces@^3.0.1, braces@~3.0.2:
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
- integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==
- dependencies:
- fill-range "^7.0.1"
-
-browserslist@^4.0.0, browserslist@^4.14.5, browserslist@^4.16.0, browserslist@^4.16.5, browserslist@^4.16.6, browserslist@^4.17.5, browserslist@^4.19.1:
- version "4.19.1"
- resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.19.1.tgz#4ac0435b35ab655896c31d53018b6dd5e9e4c9a3"
- integrity sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==
- dependencies:
- caniuse-lite "^1.0.30001286"
- electron-to-chromium "^1.4.17"
- escalade "^3.1.1"
- node-releases "^2.0.1"
- picocolors "^1.0.0"
-
-buble-jsx-only@^0.19.8:
- version "0.19.8"
- resolved "https://registry.yarnpkg.com/buble-jsx-only/-/buble-jsx-only-0.19.8.tgz#6e3524aa0f1c523de32496ac9aceb9cc2b493867"
- integrity sha512-7AW19pf7PrKFnGTEDzs6u9+JZqQwM1VnLS19OlqYDhXomtFFknnoQJAPHeg84RMFWAvOhYrG7harizJNwUKJsA==
- dependencies:
- acorn "^6.1.1"
- acorn-dynamic-import "^4.0.0"
- acorn-jsx "^5.0.1"
- chalk "^2.4.2"
- magic-string "^0.25.3"
- minimist "^1.2.0"
- regexpu-core "^4.5.4"
-
-buffer-from@^1.0.0:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5"
- integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==
-
-buffer-indexof@^1.0.0:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/buffer-indexof/-/buffer-indexof-1.1.1.tgz#52fabcc6a606d1a00302802648ef68f639da268c"
- integrity sha512-4/rOEg86jivtPTeOUUT61jJO1Ya1TrR/OkqCSZDyq84WJh3LuuiphBYJN+fm5xufIk4XAFcEwte/8WzC8If/1g==
-
-bytes@3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048"
- integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=
-
-bytes@3.1.1:
- version "3.1.1"
- resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.1.tgz#3f018291cb4cbad9accb6e6970bca9c8889e879a"
- integrity sha512-dWe4nWO/ruEOY7HkUJ5gFt1DCFV9zPRoJr8pV0/ASQermOZjtq8jMjOprC0Kd10GLN+l7xaUPvxzJFWtxGu8Fg==
-
-cacheable-request@^6.0.0:
- version "6.1.0"
- resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912"
- integrity sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==
- dependencies:
- clone-response "^1.0.2"
- get-stream "^5.1.0"
- http-cache-semantics "^4.0.0"
- keyv "^3.0.0"
- lowercase-keys "^2.0.0"
- normalize-url "^4.1.0"
- responselike "^1.0.2"
-
-call-bind@^1.0.0, call-bind@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c"
- integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==
- dependencies:
- function-bind "^1.1.1"
- get-intrinsic "^1.0.2"
-
-callsites@^3.0.0:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73"
- integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==
-
-camel-case@^4.1.2:
- version "4.1.2"
- resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-4.1.2.tgz#9728072a954f805228225a6deea6b38461e1bd5a"
- integrity sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==
- dependencies:
- pascal-case "^3.1.2"
- tslib "^2.0.3"
-
-camelcase-css@2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/camelcase-css/-/camelcase-css-2.0.1.tgz#ee978f6947914cc30c6b44741b6ed1df7f043fd5"
- integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==
-
-camelcase@^6.2.0:
- version "6.2.1"
- resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.1.tgz#250fd350cfd555d0d2160b1d51510eaf8326e86e"
- integrity sha512-tVI4q5jjFV5CavAU8DXfza/TJcZutVKo/5Foskmsqcm0MsL91moHvwiGNnqaa2o6PF/7yT5ikDRcVcl8Rj6LCA==
-
-caniuse-api@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/caniuse-api/-/caniuse-api-3.0.0.tgz#5e4d90e2274961d46291997df599e3ed008ee4c0"
- integrity sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==
- dependencies:
- browserslist "^4.0.0"
- caniuse-lite "^1.0.0"
- lodash.memoize "^4.1.2"
- lodash.uniq "^4.5.0"
-
-caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001272, caniuse-lite@^1.0.30001286:
- version "1.0.30001292"
- resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001292.tgz#4a55f61c06abc9595965cfd77897dc7bc1cdc456"
- integrity sha512-jnT4Tq0Q4ma+6nncYQVe7d73kmDmE9C3OGTx3MvW7lBM/eY1S1DZTMBON7dqV481RhNiS5OxD7k9JQvmDOTirw==
-
-ccount@^1.0.0, ccount@^1.0.3:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.1.0.tgz#246687debb6014735131be8abab2d93898f8d043"
- integrity sha512-vlNK021QdI7PNeiUh/lKkC/mNHHfV0m/Ad5JoI0TYtlBnJAslM/JIkm/tGC88bkLIwO6OQ5uV6ztS6kVAtCDlg==
-
-chalk@^2.0.0, chalk@^2.4.2:
- version "2.4.2"
- resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
- integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
- dependencies:
- ansi-styles "^3.2.1"
- escape-string-regexp "^1.0.5"
- supports-color "^5.3.0"
-
-chalk@^4.1.0, chalk@^4.1.2:
- version "4.1.2"
- resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
- integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==
- dependencies:
- ansi-styles "^4.1.0"
- supports-color "^7.1.0"
-
-character-entities-legacy@^1.0.0:
- version "1.1.4"
- resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz#94bc1845dce70a5bb9d2ecc748725661293d8fc1"
- integrity sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==
-
-character-entities@^1.0.0:
- version "1.2.4"
- resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-1.2.4.tgz#e12c3939b7eaf4e5b15e7ad4c5e28e1d48c5b16b"
- integrity sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==
-
-character-reference-invalid@^1.0.0:
- version "1.1.4"
- resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz#083329cda0eae272ab3dbbf37e9a382c13af1560"
- integrity sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==
-
-cheerio@^0.22.0:
- version "0.22.0"
- resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-0.22.0.tgz#a9baa860a3f9b595a6b81b1a86873121ed3a269e"
- integrity sha1-qbqoYKP5tZWmuBsahocxIe06Jp4=
- dependencies:
- css-select "~1.2.0"
- dom-serializer "~0.1.0"
- entities "~1.1.1"
- htmlparser2 "^3.9.1"
- lodash.assignin "^4.0.9"
- lodash.bind "^4.1.4"
- lodash.defaults "^4.0.1"
- lodash.filter "^4.4.0"
- lodash.flatten "^4.2.0"
- lodash.foreach "^4.3.0"
- lodash.map "^4.4.0"
- lodash.merge "^4.4.0"
- lodash.pick "^4.2.1"
- lodash.reduce "^4.4.0"
- lodash.reject "^4.4.0"
- lodash.some "^4.4.0"
-
-chokidar@^3.4.2, chokidar@^3.5.2:
- version "3.5.2"
- resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75"
- integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==
- dependencies:
- anymatch "~3.1.2"
- braces "~3.0.2"
- glob-parent "~5.1.2"
- is-binary-path "~2.1.0"
- is-glob "~4.0.1"
- normalize-path "~3.0.0"
- readdirp "~3.6.0"
- optionalDependencies:
- fsevents "~2.3.2"
-
-chrome-trace-event@^1.0.2:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz#1015eced4741e15d06664a957dbbf50d041e26ac"
- integrity sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==
-
-ci-info@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46"
- integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==
-
-clean-css@^5.1.5, clean-css@^5.2.2:
- version "5.2.2"
- resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-5.2.2.tgz#d3a7c6ee2511011e051719838bdcf8314dc4548d"
- integrity sha512-/eR8ru5zyxKzpBLv9YZvMXgTSSQn7AdkMItMYynsFgGwTveCRVam9IUPFloE85B4vAIj05IuKmmEoV7/AQjT0w==
- dependencies:
- source-map "~0.6.0"
-
-clean-stack@^2.0.0:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b"
- integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==
-
-cli-boxes@^2.2.1:
- version "2.2.1"
- resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f"
- integrity sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==
-
-clone-deep@^4.0.1:
- version "4.0.1"
- resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387"
- integrity sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==
- dependencies:
- is-plain-object "^2.0.4"
- kind-of "^6.0.2"
- shallow-clone "^3.0.0"
-
-clone-response@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b"
- integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=
- dependencies:
- mimic-response "^1.0.0"
-
-clsx@^1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.1.1.tgz#98b3134f9abbdf23b2663491ace13c5c03a73188"
- integrity sha512-6/bPho624p3S2pMyvP5kKBPXnI3ufHLObBFCfgx+LkeR5lg2XYy2hqZqUf45ypD8COn2bhgGJSUE+l5dhNBieA==
-
-collapse-white-space@^1.0.2:
- version "1.0.6"
- resolved "https://registry.yarnpkg.com/collapse-white-space/-/collapse-white-space-1.0.6.tgz#e63629c0016665792060dbbeb79c42239d2c5287"
- integrity sha512-jEovNnrhMuqyCcjfEJA56v0Xq8SkIoPKDyaHahwo3POf4qcSXqMYuwNcOTzp74vTsR9Tn08z4MxWqAhcekogkQ==
-
-color-convert@^1.9.0:
- version "1.9.3"
- resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
- integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==
- dependencies:
- color-name "1.1.3"
-
-color-convert@^2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
- integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
- dependencies:
- color-name "~1.1.4"
-
-color-name@1.1.3:
- version "1.1.3"
- resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
- integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=
-
-color-name@~1.1.4:
- version "1.1.4"
- resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
- integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
-
-colord@^2.9.1:
- version "2.9.2"
- resolved "https://registry.yarnpkg.com/colord/-/colord-2.9.2.tgz#25e2bacbbaa65991422c07ea209e2089428effb1"
- integrity sha512-Uqbg+J445nc1TKn4FoDPS6ZZqAvEDnwrH42yo8B40JSOgSLxMZ/gt3h4nmCtPLQeXhjJJkqBx7SCY35WnIixaQ==
-
-colorette@^2.0.10:
- version "2.0.16"
- resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.16.tgz#713b9af84fdb000139f04546bd4a93f62a5085da"
- integrity sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g==
-
-combine-promises@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/combine-promises/-/combine-promises-1.1.0.tgz#72db90743c0ca7aab7d0d8d2052fd7b0f674de71"
- integrity sha512-ZI9jvcLDxqwaXEixOhArm3r7ReIivsXkpbyEWyeOhzz1QS0iSgBPnWvEqvIQtYyamGCYA88gFhmUrs9hrrQ0pg==
-
-comma-separated-tokens@^1.0.0:
- version "1.0.8"
- resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz#632b80b6117867a158f1080ad498b2fbe7e3f5ea"
- integrity sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw==
-
-commander@^2.20.0:
- version "2.20.3"
- resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
- integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==
-
-commander@^5.1.0:
- version "5.1.0"
- resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae"
- integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==
-
-commander@^7.2.0:
- version "7.2.0"
- resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7"
- integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==
-
-commander@^8.3.0:
- version "8.3.0"
- resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66"
- integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==
-
-commondir@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b"
- integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=
-
-compressible@~2.0.16:
- version "2.0.18"
- resolved "https://registry.yarnpkg.com/compressible/-/compressible-2.0.18.tgz#af53cca6b070d4c3c0750fbd77286a6d7cc46fba"
- integrity sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==
- dependencies:
- mime-db ">= 1.43.0 < 2"
-
-compression@^1.7.4:
- version "1.7.4"
- resolved "https://registry.yarnpkg.com/compression/-/compression-1.7.4.tgz#95523eff170ca57c29a0ca41e6fe131f41e5bb8f"
- integrity sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==
- dependencies:
- accepts "~1.3.5"
- bytes "3.0.0"
- compressible "~2.0.16"
- debug "2.6.9"
- on-headers "~1.0.2"
- safe-buffer "5.1.2"
- vary "~1.1.2"
-
-concat-map@0.0.1:
- version "0.0.1"
- resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
- integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
-
-configstore@^5.0.1:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/configstore/-/configstore-5.0.1.tgz#d365021b5df4b98cdd187d6a3b0e3f6a7cc5ed96"
- integrity sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==
- dependencies:
- dot-prop "^5.2.0"
- graceful-fs "^4.1.2"
- make-dir "^3.0.0"
- unique-string "^2.0.0"
- write-file-atomic "^3.0.0"
- xdg-basedir "^4.0.0"
-
-connect-history-api-fallback@^1.6.0:
- version "1.6.0"
- resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz#8b32089359308d111115d81cad3fceab888f97bc"
- integrity sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==
-
-consola@^2.15.3:
- version "2.15.3"
- resolved "https://registry.yarnpkg.com/consola/-/consola-2.15.3.tgz#2e11f98d6a4be71ff72e0bdf07bd23e12cb61550"
- integrity sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==
-
-content-disposition@0.5.2:
- version "0.5.2"
- resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.2.tgz#0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4"
- integrity sha1-DPaLud318r55YcOoUXjLhdunjLQ=
-
-content-disposition@0.5.4:
- version "0.5.4"
- resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe"
- integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==
- dependencies:
- safe-buffer "5.2.1"
-
-content-type@~1.0.4:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b"
- integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==
-
-convert-source-map@^1.7.0:
- version "1.8.0"
- resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369"
- integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==
- dependencies:
- safe-buffer "~5.1.1"
-
-cookie-signature@1.0.6:
- version "1.0.6"
- resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c"
- integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw=
-
-cookie@0.4.1:
- version "0.4.1"
- resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.1.tgz#afd713fe26ebd21ba95ceb61f9a8116e50a537d1"
- integrity sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==
-
-copy-text-to-clipboard@^3.0.1:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/copy-text-to-clipboard/-/copy-text-to-clipboard-3.0.1.tgz#8cbf8f90e0a47f12e4a24743736265d157bce69c"
- integrity sha512-rvVsHrpFcL4F2P8ihsoLdFHmd404+CMg71S756oRSeQgqk51U3kicGdnvfkrxva0xXH92SjGS62B0XIJsbh+9Q==
-
-copy-webpack-plugin@^9.0.1:
- version "9.1.0"
- resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-9.1.0.tgz#2d2c460c4c4695ec0a58afb2801a1205256c4e6b"
- integrity sha512-rxnR7PaGigJzhqETHGmAcxKnLZSR5u1Y3/bcIv/1FnqXedcL/E2ewK7ZCNrArJKCiSv8yVXhTqetJh8inDvfsA==
- dependencies:
- fast-glob "^3.2.7"
- glob-parent "^6.0.1"
- globby "^11.0.3"
- normalize-path "^3.0.0"
- schema-utils "^3.1.1"
- serialize-javascript "^6.0.0"
-
-core-js-compat@^3.18.0, core-js-compat@^3.19.1:
- version "3.20.1"
- resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.20.1.tgz#96917b4db634fbbbc7b36575b2e8fcbf7e4f9691"
- integrity sha512-AVhKZNpqMV3Jz8hU0YEXXE06qoxtQGsAqU0u1neUngz5IusDJRX/ZJ6t3i7mS7QxNyEONbCo14GprkBrxPlTZA==
- dependencies:
- browserslist "^4.19.1"
- semver "7.0.0"
-
-core-js-pure@^3.19.0:
- version "3.20.1"
- resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.20.1.tgz#f7a2c62f98de83e4da8fca7b78846d3a2f542145"
- integrity sha512-yeNNr3L9cEBwNy6vhhIJ0nko7fE7uFO6PgawcacGt2VWep4WqQx0RiqlkgSP7kqUMC1IKdfO9qPeWXcUheHLVQ==
-
-core-js@^3.18.0:
- version "3.20.1"
- resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.20.1.tgz#eb1598047b7813572f1dc24b7c6a95528c99eef3"
- integrity sha512-btdpStYFQScnNVQ5slVcr858KP0YWYjV16eGJQw8Gg7CWtu/2qNvIM3qVRIR3n1pK2R9NNOrTevbvAYxajwEjg==
-
-core-util-is@~1.0.0:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85"
- integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==
-
-cosmiconfig@^6.0.0:
- version "6.0.0"
- resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-6.0.0.tgz#da4fee853c52f6b1e6935f41c1a2fc50bd4a9982"
- integrity sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==
- dependencies:
- "@types/parse-json" "^4.0.0"
- import-fresh "^3.1.0"
- parse-json "^5.0.0"
- path-type "^4.0.0"
- yaml "^1.7.2"
-
-cosmiconfig@^7.0.0, cosmiconfig@^7.0.1:
- version "7.0.1"
- resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.1.tgz#714d756522cace867867ccb4474c5d01bbae5d6d"
- integrity sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==
- dependencies:
- "@types/parse-json" "^4.0.0"
- import-fresh "^3.2.1"
- parse-json "^5.0.0"
- path-type "^4.0.0"
- yaml "^1.10.0"
-
-cross-fetch@^3.0.4:
- version "3.1.4"
- resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.4.tgz#9723f3a3a247bf8b89039f3a380a9244e8fa2f39"
- integrity sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ==
- dependencies:
- node-fetch "2.6.1"
-
-cross-spawn@^7.0.3:
- version "7.0.3"
- resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
- integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
- dependencies:
- path-key "^3.1.0"
- shebang-command "^2.0.0"
- which "^2.0.1"
-
-crypto-random-string@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5"
- integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==
-
-css-declaration-sorter@^6.0.3:
- version "6.1.3"
- resolved "https://registry.yarnpkg.com/css-declaration-sorter/-/css-declaration-sorter-6.1.3.tgz#e9852e4cf940ba79f509d9425b137d1f94438dc2"
- integrity sha512-SvjQjNRZgh4ULK1LDJ2AduPKUKxIqmtU7ZAyi47BTV+M90Qvxr9AB6lKlLbDUfXqI9IQeYA8LbAsCZPpJEV3aA==
- dependencies:
- timsort "^0.3.0"
-
-css-loader@^5.1.1:
- version "5.2.7"
- resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-5.2.7.tgz#9b9f111edf6fb2be5dc62525644cbc9c232064ae"
- integrity sha512-Q7mOvpBNBG7YrVGMxRxcBJZFL75o+cH2abNASdibkj/fffYD8qWbInZrD0S9ccI6vZclF3DsHE7njGlLtaHbhg==
- dependencies:
- icss-utils "^5.1.0"
- loader-utils "^2.0.0"
- postcss "^8.2.15"
- postcss-modules-extract-imports "^3.0.0"
- postcss-modules-local-by-default "^4.0.0"
- postcss-modules-scope "^3.0.0"
- postcss-modules-values "^4.0.0"
- postcss-value-parser "^4.1.0"
- schema-utils "^3.0.0"
- semver "^7.3.5"
-
-css-minimizer-webpack-plugin@^3.0.2:
- version "3.3.1"
- resolved "https://registry.yarnpkg.com/css-minimizer-webpack-plugin/-/css-minimizer-webpack-plugin-3.3.1.tgz#5afc4507a4ec13dd223f043cda8953ee0bf6ecfa"
- integrity sha512-SHA7Hu/EiF0dOwdmV2+agvqYpG+ljlUa7Dvn1AVOmSH3N8KOERoaM9lGpstz9nGsoTjANGyUXdrxl/EwdMScRg==
- dependencies:
- cssnano "^5.0.6"
- jest-worker "^27.0.2"
- postcss "^8.3.5"
- schema-utils "^4.0.0"
- serialize-javascript "^6.0.0"
- source-map "^0.6.1"
-
-css-select@^4.1.3:
- version "4.2.1"
- resolved "https://registry.yarnpkg.com/css-select/-/css-select-4.2.1.tgz#9e665d6ae4c7f9d65dbe69d0316e3221fb274cdd"
- integrity sha512-/aUslKhzkTNCQUB2qTX84lVmfia9NyjP3WpDGtj/WxhwBzWBYUV3DgUpurHTme8UTPcPlAD1DJ+b0nN/t50zDQ==
- dependencies:
- boolbase "^1.0.0"
- css-what "^5.1.0"
- domhandler "^4.3.0"
- domutils "^2.8.0"
- nth-check "^2.0.1"
-
-css-select@~1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858"
- integrity sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=
- dependencies:
- boolbase "~1.0.0"
- css-what "2.1"
- domutils "1.5.1"
- nth-check "~1.0.1"
-
-css-tree@^1.1.2, css-tree@^1.1.3:
- version "1.1.3"
- resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.1.3.tgz#eb4870fb6fd7707327ec95c2ff2ab09b5e8db91d"
- integrity sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==
- dependencies:
- mdn-data "2.0.14"
- source-map "^0.6.1"
-
-css-what@2.1:
- version "2.1.3"
- resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.3.tgz#a6d7604573365fe74686c3f311c56513d88285f2"
- integrity sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==
-
-css-what@^5.1.0:
- version "5.1.0"
- resolved "https://registry.yarnpkg.com/css-what/-/css-what-5.1.0.tgz#3f7b707aadf633baf62c2ceb8579b545bb40f7fe"
- integrity sha512-arSMRWIIFY0hV8pIxZMEfmMI47Wj3R/aWpZDDxWYCPEiOMv6tfOrnpDtgxBYPEQD4V0Y/958+1TdC3iWTFcUPw==
-
-cssesc@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee"
- integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==
-
-cssnano-preset-advanced@^5.1.4:
- version "5.1.9"
- resolved "https://registry.yarnpkg.com/cssnano-preset-advanced/-/cssnano-preset-advanced-5.1.9.tgz#7f392122a5b26368cb05d30750d7a50d6ede7f8b"
- integrity sha512-lWyaSP22ixL8pi9k+yz7VQwa1OHDCZ3SIZeq5K40NIRDII42ua2pO9HRtWQ9N+xh/AQTTHZR4ZOSxouB7VjCIQ==
- dependencies:
- autoprefixer "^10.3.7"
- cssnano-preset-default "^5.1.9"
- postcss-discard-unused "^5.0.1"
- postcss-merge-idents "^5.0.1"
- postcss-reduce-idents "^5.0.1"
- postcss-zindex "^5.0.1"
-
-cssnano-preset-default@^5.1.9:
- version "5.1.9"
- resolved "https://registry.yarnpkg.com/cssnano-preset-default/-/cssnano-preset-default-5.1.9.tgz#79628ac48eccbdad570f70b4018cc38d43d1b7df"
- integrity sha512-RhkEucqlQ+OxEi14K1p8gdXcMQy1mSpo7P1oC44oRls7BYIj8p+cht4IFBFV3W4iOjTP8EUB33XV1fX9KhDzyA==
- dependencies:
- css-declaration-sorter "^6.0.3"
- cssnano-utils "^2.0.1"
- postcss-calc "^8.0.0"
- postcss-colormin "^5.2.2"
- postcss-convert-values "^5.0.2"
- postcss-discard-comments "^5.0.1"
- postcss-discard-duplicates "^5.0.1"
- postcss-discard-empty "^5.0.1"
- postcss-discard-overridden "^5.0.1"
- postcss-merge-longhand "^5.0.4"
- postcss-merge-rules "^5.0.3"
- postcss-minify-font-values "^5.0.1"
- postcss-minify-gradients "^5.0.3"
- postcss-minify-params "^5.0.2"
- postcss-minify-selectors "^5.1.0"
- postcss-normalize-charset "^5.0.1"
- postcss-normalize-display-values "^5.0.1"
- postcss-normalize-positions "^5.0.1"
- postcss-normalize-repeat-style "^5.0.1"
- postcss-normalize-string "^5.0.1"
- postcss-normalize-timing-functions "^5.0.1"
- postcss-normalize-unicode "^5.0.1"
- postcss-normalize-url "^5.0.4"
- postcss-normalize-whitespace "^5.0.1"
- postcss-ordered-values "^5.0.2"
- postcss-reduce-initial "^5.0.2"
- postcss-reduce-transforms "^5.0.1"
- postcss-svgo "^5.0.3"
- postcss-unique-selectors "^5.0.2"
-
-cssnano-utils@^2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/cssnano-utils/-/cssnano-utils-2.0.1.tgz#8660aa2b37ed869d2e2f22918196a9a8b6498ce2"
- integrity sha512-i8vLRZTnEH9ubIyfdZCAdIdgnHAUeQeByEeQ2I7oTilvP9oHO6RScpeq3GsFUVqeB8uZgOQ9pw8utofNn32hhQ==
-
-cssnano@^5.0.6, cssnano@^5.0.8:
- version "5.0.14"
- resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-5.0.14.tgz#99bc550f663b48c38e9b8e0ae795697c9de84b47"
- integrity sha512-qzhRkFvBhv08tbyKCIfWbxBXmkIpLl1uNblt8SpTHkgLfON5OCPX/CCnkdNmEosvo8bANQYmTTMEgcVBlisHaw==
- dependencies:
- cssnano-preset-default "^5.1.9"
- lilconfig "^2.0.3"
- yaml "^1.10.2"
-
-csso@^4.2.0:
- version "4.2.0"
- resolved "https://registry.yarnpkg.com/csso/-/csso-4.2.0.tgz#ea3a561346e8dc9f546d6febedd50187cf389529"
- integrity sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==
- dependencies:
- css-tree "^1.1.2"
-
-csstype@^3.0.2:
- version "3.0.10"
- resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.10.tgz#2ad3a7bed70f35b965707c092e5f30b327c290e5"
- integrity sha512-2u44ZG2OcNUO9HDp/Jl8C07x6pU/eTR3ncV91SiK3dhG9TWvRVsCoJw14Ckx5DgWkzGA3waZWO3d7pgqpUI/XA==
-
-debug@2.6.9, debug@^2.6.0:
- version "2.6.9"
- resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
- integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==
- dependencies:
- ms "2.0.0"
-
-debug@^3.1.1:
- version "3.2.7"
- resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a"
- integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==
- dependencies:
- ms "^2.1.1"
-
-debug@^4.1.0, debug@^4.1.1:
- version "4.3.3"
- resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664"
- integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==
- dependencies:
- ms "2.1.2"
-
-decompress-response@^3.3.0:
- version "3.3.0"
- resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3"
- integrity sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=
- dependencies:
- mimic-response "^1.0.0"
-
-deep-equal@^1.0.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.1.1.tgz#b5c98c942ceffaf7cb051e24e1434a25a2e6076a"
- integrity sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==
- dependencies:
- is-arguments "^1.0.4"
- is-date-object "^1.0.1"
- is-regex "^1.0.4"
- object-is "^1.0.1"
- object-keys "^1.1.1"
- regexp.prototype.flags "^1.2.0"
-
-deep-extend@^0.6.0:
- version "0.6.0"
- resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac"
- integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==
-
-deepmerge@^4.2.2:
- version "4.2.2"
- resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955"
- integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==
-
-default-gateway@^6.0.3:
- version "6.0.3"
- resolved "https://registry.yarnpkg.com/default-gateway/-/default-gateway-6.0.3.tgz#819494c888053bdb743edbf343d6cdf7f2943a71"
- integrity sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg==
- dependencies:
- execa "^5.0.0"
-
-defer-to-connect@^1.0.1:
- version "1.1.3"
- resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591"
- integrity sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==
-
-define-lazy-prop@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f"
- integrity sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==
-
-define-properties@^1.1.3:
- version "1.1.3"
- resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1"
- integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==
- dependencies:
- object-keys "^1.0.12"
-
-del@^6.0.0:
- version "6.0.0"
- resolved "https://registry.yarnpkg.com/del/-/del-6.0.0.tgz#0b40d0332cea743f1614f818be4feb717714c952"
- integrity sha512-1shh9DQ23L16oXSZKB2JxpL7iMy2E0S9d517ptA1P8iw0alkPtQcrKH7ru31rYtKwF499HkTu+DRzq3TCKDFRQ==
- dependencies:
- globby "^11.0.1"
- graceful-fs "^4.2.4"
- is-glob "^4.0.1"
- is-path-cwd "^2.2.0"
- is-path-inside "^3.0.2"
- p-map "^4.0.0"
- rimraf "^3.0.2"
- slash "^3.0.0"
-
-depd@~1.1.2:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9"
- integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=
-
-destroy@~1.0.4:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80"
- integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=
-
-detab@2.0.4:
- version "2.0.4"
- resolved "https://registry.yarnpkg.com/detab/-/detab-2.0.4.tgz#b927892069aff405fbb9a186fe97a44a92a94b43"
- integrity sha512-8zdsQA5bIkoRECvCrNKPla84lyoR7DSAyf7p0YgXzBO9PDJx8KntPUay7NS6yp+KdxdVtiE5SpHKtbp2ZQyA9g==
- dependencies:
- repeat-string "^1.5.4"
-
-detect-node@^2.0.4:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.1.0.tgz#c9c70775a49c3d03bc2c06d9a73be550f978f8b1"
- integrity sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==
-
-detect-port-alt@^1.1.6:
- version "1.1.6"
- resolved "https://registry.yarnpkg.com/detect-port-alt/-/detect-port-alt-1.1.6.tgz#24707deabe932d4a3cf621302027c2b266568275"
- integrity sha512-5tQykt+LqfJFBEYaDITx7S7cR7mJ/zQmLXZ2qt5w04ainYZw6tBf9dBunMjVeVOdYVRUzUOE4HkY5J7+uttb5Q==
- dependencies:
- address "^1.0.1"
- debug "^2.6.0"
-
-detect-port@^1.3.0:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/detect-port/-/detect-port-1.3.0.tgz#d9c40e9accadd4df5cac6a782aefd014d573d1f1"
- integrity sha512-E+B1gzkl2gqxt1IhUzwjrxBKRqx1UzC3WLONHinn8S3T6lwV/agVCyitiFOsGJ/eYuEUBvD71MZHy3Pv1G9doQ==
- dependencies:
- address "^1.0.1"
- debug "^2.6.0"
-
-dir-glob@^3.0.1:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f"
- integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==
- dependencies:
- path-type "^4.0.0"
-
-dns-equal@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/dns-equal/-/dns-equal-1.0.0.tgz#b39e7f1da6eb0a75ba9c17324b34753c47e0654d"
- integrity sha1-s55/HabrCnW6nBcySzR1PEfgZU0=
-
-dns-packet@^1.3.1:
- version "1.3.4"
- resolved "https://registry.yarnpkg.com/dns-packet/-/dns-packet-1.3.4.tgz#e3455065824a2507ba886c55a89963bb107dec6f"
- integrity sha512-BQ6F4vycLXBvdrJZ6S3gZewt6rcrks9KBgM9vrhW+knGRqc8uEdT7fuCwloc7nny5xNoMJ17HGH0R/6fpo8ECA==
- dependencies:
- ip "^1.1.0"
- safe-buffer "^5.0.1"
-
-dns-txt@^2.0.2:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/dns-txt/-/dns-txt-2.0.2.tgz#b91d806f5d27188e4ab3e7d107d881a1cc4642b6"
- integrity sha1-uR2Ab10nGI5Ks+fRB9iBocxGQrY=
- dependencies:
- buffer-indexof "^1.0.0"
-
-dom-converter@^0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/dom-converter/-/dom-converter-0.2.0.tgz#6721a9daee2e293682955b6afe416771627bb768"
- integrity sha512-gd3ypIPfOMr9h5jIKq8E3sHOTCjeirnl0WK5ZdS1AW0Odt0b1PaWaHdJ4Qk4klv+YB9aJBS7mESXjFoDQPu6DA==
- dependencies:
- utila "~0.4"
-
-dom-serializer@0:
- version "0.2.2"
- resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.2.2.tgz#1afb81f533717175d478655debc5e332d9f9bb51"
- integrity sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==
- dependencies:
- domelementtype "^2.0.1"
- entities "^2.0.0"
-
-dom-serializer@^1.0.1:
- version "1.3.2"
- resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-1.3.2.tgz#6206437d32ceefaec7161803230c7a20bc1b4d91"
- integrity sha512-5c54Bk5Dw4qAxNOI1pFEizPSjVsx5+bpJKmL2kPn8JhBUq2q09tTCa3mjijun2NfK78NMouDYNMBkOrPZiS+ig==
- dependencies:
- domelementtype "^2.0.1"
- domhandler "^4.2.0"
- entities "^2.0.0"
-
-dom-serializer@~0.1.0:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.1.tgz#1ec4059e284babed36eec2941d4a970a189ce7c0"
- integrity sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==
- dependencies:
- domelementtype "^1.3.0"
- entities "^1.1.1"
-
-domelementtype@1, domelementtype@^1.3.0, domelementtype@^1.3.1:
- version "1.3.1"
- resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f"
- integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==
-
-domelementtype@^2.0.1, domelementtype@^2.2.0:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.2.0.tgz#9a0b6c2782ed6a1c7323d42267183df9bd8b1d57"
- integrity sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==
-
-domhandler@^2.3.0:
- version "2.4.2"
- resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803"
- integrity sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==
- dependencies:
- domelementtype "1"
-
-domhandler@^4.0.0, domhandler@^4.2.0, domhandler@^4.3.0:
- version "4.3.0"
- resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-4.3.0.tgz#16c658c626cf966967e306f966b431f77d4a5626"
- integrity sha512-fC0aXNQXqKSFTr2wDNZDhsEYjCiYsDWl3D01kwt25hm1YIPyDGHvvi3rw+PLqHAl/m71MaiF7d5zvBr0p5UB2g==
- dependencies:
- domelementtype "^2.2.0"
-
-domutils@1.5.1:
- version "1.5.1"
- resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf"
- integrity sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=
- dependencies:
- dom-serializer "0"
- domelementtype "1"
-
-domutils@^1.5.1:
- version "1.7.0"
- resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a"
- integrity sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==
- dependencies:
- dom-serializer "0"
- domelementtype "1"
-
-domutils@^2.5.2, domutils@^2.8.0:
- version "2.8.0"
- resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.8.0.tgz#4437def5db6e2d1f5d6ee859bd95ca7d02048135"
- integrity sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==
- dependencies:
- dom-serializer "^1.0.1"
- domelementtype "^2.2.0"
- domhandler "^4.2.0"
-
-dot-case@^3.0.4:
- version "3.0.4"
- resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-3.0.4.tgz#9b2b670d00a431667a8a75ba29cd1b98809ce751"
- integrity sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==
- dependencies:
- no-case "^3.0.4"
- tslib "^2.0.3"
-
-dot-prop@^5.2.0:
- version "5.3.0"
- resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88"
- integrity sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==
- dependencies:
- is-obj "^2.0.0"
-
-duplexer3@^0.1.4:
- version "0.1.4"
- resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2"
- integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=
-
-duplexer@^0.1.1, duplexer@^0.1.2:
- version "0.1.2"
- resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6"
- integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==
-
-ee-first@1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
- integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=
-
-electron-to-chromium@^1.4.17:
- version "1.4.28"
- resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.28.tgz#fef0e92e281df6d568f482d8d53c34ca5374de48"
- integrity sha512-Gzbf0wUtKfyPaqf0Plz+Ctinf9eQIzxEqBHwSvbGfeOm9GMNdLxyu1dNiCUfM+x6r4BE0xUJNh3Nmg9gfAtTmg==
-
-emoji-regex@^8.0.0:
- version "8.0.0"
- resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
- integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==
-
-emojis-list@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78"
- integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==
-
-emoticon@^3.2.0:
- version "3.2.0"
- resolved "https://registry.yarnpkg.com/emoticon/-/emoticon-3.2.0.tgz#c008ca7d7620fac742fe1bf4af8ff8fed154ae7f"
- integrity sha512-SNujglcLTTg+lDAcApPNgEdudaqQFiAbJCqzjNxJkvN9vAwCGi0uu8IUVvx+f16h+V44KCY6Y2yboroc9pilHg==
-
-encodeurl@~1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59"
- integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=
-
-end-of-stream@^1.1.0:
- version "1.4.4"
- resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0"
- integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==
- dependencies:
- once "^1.4.0"
-
-enhanced-resolve@^5.8.3:
- version "5.8.3"
- resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.8.3.tgz#6d552d465cce0423f5b3d718511ea53826a7b2f0"
- integrity sha512-EGAbGvH7j7Xt2nc0E7D99La1OiEs8LnyimkRgwExpUMScN6O+3x9tIWs7PLQZVNx4YD+00skHXPXi1yQHpAmZA==
- dependencies:
- graceful-fs "^4.2.4"
- tapable "^2.2.0"
-
-entities@^1.1.1, entities@~1.1.1:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56"
- integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==
-
-entities@^2.0.0:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55"
- integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==
-
-entities@^3.0.1:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/entities/-/entities-3.0.1.tgz#2b887ca62585e96db3903482d336c1006c3001d4"
- integrity sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q==
-
-error-ex@^1.3.1:
- version "1.3.2"
- resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf"
- integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==
- dependencies:
- is-arrayish "^0.2.1"
-
-es-module-lexer@^0.9.0:
- version "0.9.3"
- resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.9.3.tgz#6f13db00cc38417137daf74366f535c8eb438f19"
- integrity sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==
-
-escalade@^3.1.1:
- version "3.1.1"
- resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40"
- integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==
-
-escape-goat@^2.0.0:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/escape-goat/-/escape-goat-2.1.1.tgz#1b2dc77003676c457ec760b2dc68edb648188675"
- integrity sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==
-
-escape-html@^1.0.3, escape-html@~1.0.3:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988"
- integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=
-
-escape-string-regexp@^1.0.5:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
- integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
-
-escape-string-regexp@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344"
- integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==
-
-escape-string-regexp@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
- integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==
-
-eslint-scope@5.1.1:
- version "5.1.1"
- resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c"
- integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==
- dependencies:
- esrecurse "^4.3.0"
- estraverse "^4.1.1"
-
-esprima@^4.0.0:
- version "4.0.1"
- resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
- integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==
-
-esrecurse@^4.3.0:
- version "4.3.0"
- resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921"
- integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==
- dependencies:
- estraverse "^5.2.0"
-
-estraverse@^4.1.1:
- version "4.3.0"
- resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d"
- integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==
-
-estraverse@^5.2.0:
- version "5.3.0"
- resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123"
- integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==
-
-esutils@^2.0.2:
- version "2.0.3"
- resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64"
- integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==
-
-eta@^1.12.3:
- version "1.12.3"
- resolved "https://registry.yarnpkg.com/eta/-/eta-1.12.3.tgz#2982d08adfbef39f9fa50e2fbd42d7337e7338b1"
- integrity sha512-qHixwbDLtekO/d51Yr4glcaUJCIjGVJyTzuqV4GPlgZo1YpgOKG+avQynErZIYrfM6JIJdtiG2Kox8tbb+DoGg==
-
-etag@~1.8.1:
- version "1.8.1"
- resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887"
- integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=
-
-eval@^0.1.4:
- version "0.1.6"
- resolved "https://registry.yarnpkg.com/eval/-/eval-0.1.6.tgz#9620d7d8c85515e97e6b47c5814f46ae381cb3cc"
- integrity sha512-o0XUw+5OGkXw4pJZzQoXUk+H87DHuC+7ZE//oSrRGtatTmr12oTnLfg6QOq9DyTt0c/p4TwzgmkKrBzWTSizyQ==
- dependencies:
- require-like ">= 0.1.1"
-
-eventemitter3@^4.0.0:
- version "4.0.7"
- resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f"
- integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==
-
-events@^3.2.0:
- version "3.3.0"
- resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400"
- integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==
-
-execa@^5.0.0:
- version "5.1.1"
- resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd"
- integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==
- dependencies:
- cross-spawn "^7.0.3"
- get-stream "^6.0.0"
- human-signals "^2.1.0"
- is-stream "^2.0.0"
- merge-stream "^2.0.0"
- npm-run-path "^4.0.1"
- onetime "^5.1.2"
- signal-exit "^3.0.3"
- strip-final-newline "^2.0.0"
-
-express@^4.17.1:
- version "4.17.2"
- resolved "https://registry.yarnpkg.com/express/-/express-4.17.2.tgz#c18369f265297319beed4e5558753cc8c1364cb3"
- integrity sha512-oxlxJxcQlYwqPWKVJJtvQiwHgosH/LrLSPA+H4UxpyvSS6jC5aH+5MoHFM+KABgTOt0APue4w66Ha8jCUo9QGg==
- dependencies:
- accepts "~1.3.7"
- array-flatten "1.1.1"
- body-parser "1.19.1"
- content-disposition "0.5.4"
- content-type "~1.0.4"
- cookie "0.4.1"
- cookie-signature "1.0.6"
- debug "2.6.9"
- depd "~1.1.2"
- encodeurl "~1.0.2"
- escape-html "~1.0.3"
- etag "~1.8.1"
- finalhandler "~1.1.2"
- fresh "0.5.2"
- merge-descriptors "1.0.1"
- methods "~1.1.2"
- on-finished "~2.3.0"
- parseurl "~1.3.3"
- path-to-regexp "0.1.7"
- proxy-addr "~2.0.7"
- qs "6.9.6"
- range-parser "~1.2.1"
- safe-buffer "5.2.1"
- send "0.17.2"
- serve-static "1.14.2"
- setprototypeof "1.2.0"
- statuses "~1.5.0"
- type-is "~1.6.18"
- utils-merge "1.0.1"
- vary "~1.1.2"
-
-extend-shallow@^2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f"
- integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=
- dependencies:
- is-extendable "^0.1.0"
-
-extend@^3.0.0:
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa"
- integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==
-
-fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3:
- version "3.1.3"
- resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
- integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==
-
-fast-glob@^3.1.1, fast-glob@^3.2.7:
- version "3.2.7"
- resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1"
- integrity sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==
- dependencies:
- "@nodelib/fs.stat" "^2.0.2"
- "@nodelib/fs.walk" "^1.2.3"
- glob-parent "^5.1.2"
- merge2 "^1.3.0"
- micromatch "^4.0.4"
-
-fast-json-stable-stringify@^2.0.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633"
- integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==
-
-fast-url-parser@1.1.3:
- version "1.1.3"
- resolved "https://registry.yarnpkg.com/fast-url-parser/-/fast-url-parser-1.1.3.tgz#f4af3ea9f34d8a271cf58ad2b3759f431f0b318d"
- integrity sha1-9K8+qfNNiicc9YrSs3WfQx8LMY0=
- dependencies:
- punycode "^1.3.2"
-
-fastq@^1.6.0:
- version "1.13.0"
- resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c"
- integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==
- dependencies:
- reusify "^1.0.4"
-
-faye-websocket@^0.11.3:
- version "0.11.4"
- resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.4.tgz#7f0d9275cfdd86a1c963dc8b65fcc451edcbb1da"
- integrity sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==
- dependencies:
- websocket-driver ">=0.5.1"
-
-fbemitter@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/fbemitter/-/fbemitter-3.0.0.tgz#00b2a1af5411254aab416cd75f9e6289bee4bff3"
- integrity sha512-KWKaceCwKQU0+HPoop6gn4eOHk50bBv/VxjJtGMfwmJt3D29JpN4H4eisCtIPA+a8GVBam+ldMMpMjJUvpDyHw==
- dependencies:
- fbjs "^3.0.0"
-
-fbjs-css-vars@^1.0.0:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/fbjs-css-vars/-/fbjs-css-vars-1.0.2.tgz#216551136ae02fe255932c3ec8775f18e2c078b8"
- integrity sha512-b2XGFAFdWZWg0phtAWLHCk836A1Xann+I+Dgd3Gk64MHKZO44FfoD1KxyvbSh0qZsIoXQGGlVztIY+oitJPpRQ==
-
-fbjs@^3.0.0, fbjs@^3.0.1:
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-3.0.2.tgz#dfae08a85c66a58372993ce2caf30863f569ff94"
- integrity sha512-qv+boqYndjElAJHNN3NoM8XuwQZ1j2m3kEvTgdle8IDjr6oUbkEpvABWtj/rQl3vq4ew7dnElBxL4YJAwTVqQQ==
- dependencies:
- cross-fetch "^3.0.4"
- fbjs-css-vars "^1.0.0"
- loose-envify "^1.0.0"
- object-assign "^4.1.0"
- promise "^7.1.1"
- setimmediate "^1.0.5"
- ua-parser-js "^0.7.30"
-
-feed@^4.2.2:
- version "4.2.2"
- resolved "https://registry.yarnpkg.com/feed/-/feed-4.2.2.tgz#865783ef6ed12579e2c44bbef3c9113bc4956a7e"
- integrity sha512-u5/sxGfiMfZNtJ3OvQpXcvotFpYkL0n9u9mM2vkui2nGo8b4wvDkJ8gAkYqbA8QpGyFCv3RK0Z+Iv+9veCS9bQ==
- dependencies:
- xml-js "^1.6.11"
-
-file-loader@^6.2.0:
- version "6.2.0"
- resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-6.2.0.tgz#baef7cf8e1840df325e4390b4484879480eebe4d"
- integrity sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw==
- dependencies:
- loader-utils "^2.0.0"
- schema-utils "^3.0.0"
-
-filesize@^6.1.0:
- version "6.4.0"
- resolved "https://registry.yarnpkg.com/filesize/-/filesize-6.4.0.tgz#914f50471dd66fdca3cefe628bd0cde4ef769bcd"
- integrity sha512-mjFIpOHC4jbfcTfoh4rkWpI31mF7viw9ikj/JyLoKzqlwG/YsefKfvYlYhdYdg/9mtK2z1AzgN/0LvVQ3zdlSQ==
-
-fill-range@^7.0.1:
- version "7.0.1"
- resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
- integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==
- dependencies:
- to-regex-range "^5.0.1"
-
-finalhandler@~1.1.2:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d"
- integrity sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==
- dependencies:
- debug "2.6.9"
- encodeurl "~1.0.2"
- escape-html "~1.0.3"
- on-finished "~2.3.0"
- parseurl "~1.3.3"
- statuses "~1.5.0"
- unpipe "~1.0.0"
-
-find-cache-dir@^3.3.1:
- version "3.3.2"
- resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.2.tgz#b30c5b6eff0730731aea9bbd9dbecbd80256d64b"
- integrity sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==
- dependencies:
- commondir "^1.0.1"
- make-dir "^3.0.2"
- pkg-dir "^4.1.0"
-
-find-up@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73"
- integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==
- dependencies:
- locate-path "^3.0.0"
-
-find-up@^4.0.0, find-up@^4.1.0:
- version "4.1.0"
- resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19"
- integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==
- dependencies:
- locate-path "^5.0.0"
- path-exists "^4.0.0"
-
-find-up@^5.0.0:
- version "5.0.0"
- resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc"
- integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==
- dependencies:
- locate-path "^6.0.0"
- path-exists "^4.0.0"
-
-flux@^4.0.1:
- version "4.0.3"
- resolved "https://registry.yarnpkg.com/flux/-/flux-4.0.3.tgz#573b504a24982c4768fdfb59d8d2ea5637d72ee7"
- integrity sha512-yKAbrp7JhZhj6uiT1FTuVMlIAT1J4jqEyBpFApi1kxpGZCvacMVc/t1pMQyotqHhAgvoE3bNvAykhCo2CLjnYw==
- dependencies:
- fbemitter "^3.0.0"
- fbjs "^3.0.1"
-
-follow-redirects@^1.0.0, follow-redirects@^1.14.0:
- version "1.14.6"
- resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.6.tgz#8cfb281bbc035b3c067d6cd975b0f6ade6e855cd"
- integrity sha512-fhUl5EwSJbbl8AR+uYL2KQDxLkdSjZGR36xy46AO7cOMTrCMON6Sa28FmAnC2tRTDbd/Uuzz3aJBv7EBN7JH8A==
-
-fork-ts-checker-webpack-plugin@^6.0.5:
- version "6.5.0"
- resolved "https://registry.yarnpkg.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-6.5.0.tgz#0282b335fa495a97e167f69018f566ea7d2a2b5e"
- integrity sha512-cS178Y+xxtIjEUorcHddKS7yCMlrDPV31mt47blKKRfMd70Kxu5xruAFE2o9sDY6wVC5deuob/u/alD04YYHnw==
- dependencies:
- "@babel/code-frame" "^7.8.3"
- "@types/json-schema" "^7.0.5"
- chalk "^4.1.0"
- chokidar "^3.4.2"
- cosmiconfig "^6.0.0"
- deepmerge "^4.2.2"
- fs-extra "^9.0.0"
- glob "^7.1.6"
- memfs "^3.1.2"
- minimatch "^3.0.4"
- schema-utils "2.7.0"
- semver "^7.3.2"
- tapable "^1.0.0"
-
-forwarded@0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811"
- integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==
-
-fraction.js@^4.1.1:
- version "4.1.2"
- resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.1.2.tgz#13e420a92422b6cf244dff8690ed89401029fbe8"
- integrity sha512-o2RiJQ6DZaR/5+Si0qJUIy637QMRudSi9kU/FFzx9EZazrIdnBgpU+3sEWCxAVhH2RtxW2Oz+T4p2o8uOPVcgA==
-
-fresh@0.5.2:
- version "0.5.2"
- resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7"
- integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=
-
-fs-extra@^10.0.0:
- version "10.0.0"
- resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.0.0.tgz#9ff61b655dde53fb34a82df84bb214ce802e17c1"
- integrity sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==
- dependencies:
- graceful-fs "^4.2.0"
- jsonfile "^6.0.1"
- universalify "^2.0.0"
-
-fs-extra@^9.0.0:
- version "9.1.0"
- resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d"
- integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==
- dependencies:
- at-least-node "^1.0.0"
- graceful-fs "^4.2.0"
- jsonfile "^6.0.1"
- universalify "^2.0.0"
-
-fs-monkey@1.0.3:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/fs-monkey/-/fs-monkey-1.0.3.tgz#ae3ac92d53bb328efe0e9a1d9541f6ad8d48e2d3"
- integrity sha512-cybjIfiiE+pTWicSCLFHSrXZ6EilF30oh91FDP9S2B051prEa7QWfrVTQm10/dDpswBDXZugPa1Ogu8Yh+HV0Q==
-
-fs.realpath@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
- integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=
-
-fsevents@~2.3.2:
- version "2.3.2"
- resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
- integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==
-
-function-bind@^1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
- integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==
-
-gensync@^1.0.0-beta.1, gensync@^1.0.0-beta.2:
- version "1.0.0-beta.2"
- resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0"
- integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==
-
-get-intrinsic@^1.0.2:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6"
- integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==
- dependencies:
- function-bind "^1.1.1"
- has "^1.0.3"
- has-symbols "^1.0.1"
-
-get-own-enumerable-property-symbols@^3.0.0:
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz#b5fde77f22cbe35f390b4e089922c50bce6ef664"
- integrity sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==
-
-get-stream@^4.1.0:
- version "4.1.0"
- resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5"
- integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==
- dependencies:
- pump "^3.0.0"
-
-get-stream@^5.1.0:
- version "5.2.0"
- resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3"
- integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==
- dependencies:
- pump "^3.0.0"
-
-get-stream@^6.0.0:
- version "6.0.1"
- resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7"
- integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==
-
-github-slugger@^1.4.0:
- version "1.4.0"
- resolved "https://registry.yarnpkg.com/github-slugger/-/github-slugger-1.4.0.tgz#206eb96cdb22ee56fdc53a28d5a302338463444e"
- integrity sha512-w0dzqw/nt51xMVmlaV1+JRzN+oCa1KfcgGEWhxUG16wbdA+Xnt/yoFO8Z8x/V82ZcZ0wy6ln9QDup5avbhiDhQ==
-
-glob-parent@^5.1.2, glob-parent@~5.1.2:
- version "5.1.2"
- resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
- integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==
- dependencies:
- is-glob "^4.0.1"
-
-glob-parent@^6.0.1:
- version "6.0.2"
- resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3"
- integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==
- dependencies:
- is-glob "^4.0.3"
-
-glob-to-regexp@^0.4.1:
- version "0.4.1"
- resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e"
- integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==
-
-glob@^7.0.0, glob@^7.1.3, glob@^7.1.6:
- version "7.2.0"
- resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023"
- integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==
- dependencies:
- fs.realpath "^1.0.0"
- inflight "^1.0.4"
- inherits "2"
- minimatch "^3.0.4"
- once "^1.3.0"
- path-is-absolute "^1.0.0"
-
-global-dirs@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-3.0.0.tgz#70a76fe84ea315ab37b1f5576cbde7d48ef72686"
- integrity sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA==
- dependencies:
- ini "2.0.0"
-
-global-modules@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-2.0.0.tgz#997605ad2345f27f51539bea26574421215c7780"
- integrity sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==
- dependencies:
- global-prefix "^3.0.0"
-
-global-prefix@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-3.0.0.tgz#fc85f73064df69f50421f47f883fe5b913ba9b97"
- integrity sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==
- dependencies:
- ini "^1.3.5"
- kind-of "^6.0.2"
- which "^1.3.1"
-
-globals@^11.1.0:
- version "11.12.0"
- resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e"
- integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==
-
-globby@^11.0.1, globby@^11.0.2, globby@^11.0.3, globby@^11.0.4:
- version "11.0.4"
- resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5"
- integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==
- dependencies:
- array-union "^2.1.0"
- dir-glob "^3.0.1"
- fast-glob "^3.1.1"
- ignore "^5.1.4"
- merge2 "^1.3.0"
- slash "^3.0.0"
-
-got@^9.6.0:
- version "9.6.0"
- resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85"
- integrity sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==
- dependencies:
- "@sindresorhus/is" "^0.14.0"
- "@szmarczak/http-timer" "^1.1.2"
- cacheable-request "^6.0.0"
- decompress-response "^3.3.0"
- duplexer3 "^0.1.4"
- get-stream "^4.1.0"
- lowercase-keys "^1.0.1"
- mimic-response "^1.0.1"
- p-cancelable "^1.0.0"
- to-readable-stream "^1.0.0"
- url-parse-lax "^3.0.0"
-
-graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4, graceful-fs@^4.2.6:
- version "4.2.8"
- resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a"
- integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==
-
-gray-matter@^4.0.3:
- version "4.0.3"
- resolved "https://registry.yarnpkg.com/gray-matter/-/gray-matter-4.0.3.tgz#e893c064825de73ea1f5f7d88c7a9f7274288798"
- integrity sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==
- dependencies:
- js-yaml "^3.13.1"
- kind-of "^6.0.2"
- section-matter "^1.0.0"
- strip-bom-string "^1.0.0"
-
-gzip-size@^5.1.1:
- version "5.1.1"
- resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-5.1.1.tgz#cb9bee692f87c0612b232840a873904e4c135274"
- integrity sha512-FNHi6mmoHvs1mxZAds4PpdCS6QG8B4C1krxJsMutgxl5t3+GlRTzzI3NEkifXx2pVsOvJdOGSmIgDhQ55FwdPA==
- dependencies:
- duplexer "^0.1.1"
- pify "^4.0.1"
-
-gzip-size@^6.0.0:
- version "6.0.0"
- resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-6.0.0.tgz#065367fd50c239c0671cbcbad5be3e2eeb10e462"
- integrity sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==
- dependencies:
- duplexer "^0.1.2"
-
-handle-thing@^2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-2.0.1.tgz#857f79ce359580c340d43081cc648970d0bb234e"
- integrity sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==
-
-has-flag@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
- integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0=
-
-has-flag@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
- integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
-
-has-symbols@^1.0.1, has-symbols@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423"
- integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==
-
-has-tostringtag@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25"
- integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==
- dependencies:
- has-symbols "^1.0.2"
-
-has-yarn@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/has-yarn/-/has-yarn-2.1.0.tgz#137e11354a7b5bf11aa5cb649cf0c6f3ff2b2e77"
- integrity sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==
-
-has@^1.0.3:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796"
- integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==
- dependencies:
- function-bind "^1.1.1"
-
-hast-to-hyperscript@^9.0.0:
- version "9.0.1"
- resolved "https://registry.yarnpkg.com/hast-to-hyperscript/-/hast-to-hyperscript-9.0.1.tgz#9b67fd188e4c81e8ad66f803855334173920218d"
- integrity sha512-zQgLKqF+O2F72S1aa4y2ivxzSlko3MAvxkwG8ehGmNiqd98BIN3JM1rAJPmplEyLmGLO2QZYJtIneOSZ2YbJuA==
- dependencies:
- "@types/unist" "^2.0.3"
- comma-separated-tokens "^1.0.0"
- property-information "^5.3.0"
- space-separated-tokens "^1.0.0"
- style-to-object "^0.3.0"
- unist-util-is "^4.0.0"
- web-namespaces "^1.0.0"
-
-hast-util-from-parse5@^5.0.0:
- version "5.0.3"
- resolved "https://registry.yarnpkg.com/hast-util-from-parse5/-/hast-util-from-parse5-5.0.3.tgz#3089dc0ee2ccf6ec8bc416919b51a54a589e097c"
- integrity sha512-gOc8UB99F6eWVWFtM9jUikjN7QkWxB3nY0df5Z0Zq1/Nkwl5V4hAAsl0tmwlgWl/1shlTF8DnNYLO8X6wRV9pA==
- dependencies:
- ccount "^1.0.3"
- hastscript "^5.0.0"
- property-information "^5.0.0"
- web-namespaces "^1.1.2"
- xtend "^4.0.1"
-
-hast-util-from-parse5@^6.0.0:
- version "6.0.1"
- resolved "https://registry.yarnpkg.com/hast-util-from-parse5/-/hast-util-from-parse5-6.0.1.tgz#554e34abdeea25ac76f5bd950a1f0180e0b3bc2a"
- integrity sha512-jeJUWiN5pSxW12Rh01smtVkZgZr33wBokLzKLwinYOUfSzm1Nl/c3GUGebDyOKjdsRgMvoVbV0VpAcpjF4NrJA==
- dependencies:
- "@types/parse5" "^5.0.0"
- hastscript "^6.0.0"
- property-information "^5.0.0"
- vfile "^4.0.0"
- vfile-location "^3.2.0"
- web-namespaces "^1.0.0"
-
-hast-util-parse-selector@^2.0.0:
- version "2.2.5"
- resolved "https://registry.yarnpkg.com/hast-util-parse-selector/-/hast-util-parse-selector-2.2.5.tgz#d57c23f4da16ae3c63b3b6ca4616683313499c3a"
- integrity sha512-7j6mrk/qqkSehsM92wQjdIgWM2/BW61u/53G6xmC8i1OmEdKLHbk419QKQUjz6LglWsfqoiHmyMRkP1BGjecNQ==
-
-hast-util-raw@6.0.1:
- version "6.0.1"
- resolved "https://registry.yarnpkg.com/hast-util-raw/-/hast-util-raw-6.0.1.tgz#973b15930b7529a7b66984c98148b46526885977"
- integrity sha512-ZMuiYA+UF7BXBtsTBNcLBF5HzXzkyE6MLzJnL605LKE8GJylNjGc4jjxazAHUtcwT5/CEt6afRKViYB4X66dig==
- dependencies:
- "@types/hast" "^2.0.0"
- hast-util-from-parse5 "^6.0.0"
- hast-util-to-parse5 "^6.0.0"
- html-void-elements "^1.0.0"
- parse5 "^6.0.0"
- unist-util-position "^3.0.0"
- vfile "^4.0.0"
- web-namespaces "^1.0.0"
- xtend "^4.0.0"
- zwitch "^1.0.0"
-
-hast-util-to-parse5@^6.0.0:
- version "6.0.0"
- resolved "https://registry.yarnpkg.com/hast-util-to-parse5/-/hast-util-to-parse5-6.0.0.tgz#1ec44650b631d72952066cea9b1445df699f8479"
- integrity sha512-Lu5m6Lgm/fWuz8eWnrKezHtVY83JeRGaNQ2kn9aJgqaxvVkFCZQBEhgodZUDUvoodgyROHDb3r5IxAEdl6suJQ==
- dependencies:
- hast-to-hyperscript "^9.0.0"
- property-information "^5.0.0"
- web-namespaces "^1.0.0"
- xtend "^4.0.0"
- zwitch "^1.0.0"
-
-hastscript@^5.0.0:
- version "5.1.2"
- resolved "https://registry.yarnpkg.com/hastscript/-/hastscript-5.1.2.tgz#bde2c2e56d04c62dd24e8c5df288d050a355fb8a"
- integrity sha512-WlztFuK+Lrvi3EggsqOkQ52rKbxkXL3RwB6t5lwoa8QLMemoWfBuL43eDrwOamJyR7uKQKdmKYaBH1NZBiIRrQ==
- dependencies:
- comma-separated-tokens "^1.0.0"
- hast-util-parse-selector "^2.0.0"
- property-information "^5.0.0"
- space-separated-tokens "^1.0.0"
-
-hastscript@^6.0.0:
- version "6.0.0"
- resolved "https://registry.yarnpkg.com/hastscript/-/hastscript-6.0.0.tgz#e8768d7eac56c3fdeac8a92830d58e811e5bf640"
- integrity sha512-nDM6bvd7lIqDUiYEiu5Sl/+6ReP0BMk/2f4U/Rooccxkj0P5nm+acM5PrGJ/t5I8qPGiqZSE6hVAwZEdZIvP4w==
- dependencies:
- "@types/hast" "^2.0.0"
- comma-separated-tokens "^1.0.0"
- hast-util-parse-selector "^2.0.0"
- property-information "^5.0.0"
- space-separated-tokens "^1.0.0"
-
-he@^1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f"
- integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==
-
-history@^4.9.0:
- version "4.10.1"
- resolved "https://registry.yarnpkg.com/history/-/history-4.10.1.tgz#33371a65e3a83b267434e2b3f3b1b4c58aad4cf3"
- integrity sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==
- dependencies:
- "@babel/runtime" "^7.1.2"
- loose-envify "^1.2.0"
- resolve-pathname "^3.0.0"
- tiny-invariant "^1.0.2"
- tiny-warning "^1.0.0"
- value-equal "^1.0.1"
-
-hoist-non-react-statics@^3.1.0:
- version "3.3.2"
- resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45"
- integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==
- dependencies:
- react-is "^16.7.0"
-
-hpack.js@^2.1.6:
- version "2.1.6"
- resolved "https://registry.yarnpkg.com/hpack.js/-/hpack.js-2.1.6.tgz#87774c0949e513f42e84575b3c45681fade2a0b2"
- integrity sha1-h3dMCUnlE/QuhFdbPEVoH63ioLI=
- dependencies:
- inherits "^2.0.1"
- obuf "^1.0.0"
- readable-stream "^2.0.1"
- wbuf "^1.1.0"
-
-html-entities@^2.3.2:
- version "2.3.2"
- resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-2.3.2.tgz#760b404685cb1d794e4f4b744332e3b00dcfe488"
- integrity sha512-c3Ab/url5ksaT0WyleslpBEthOzWhrjQbg75y7XUsfSzi3Dgzt0l8w5e7DylRn15MTlMMD58dTfzddNS2kcAjQ==
-
-html-minifier-terser@^6.0.2:
- version "6.1.0"
- resolved "https://registry.yarnpkg.com/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz#bfc818934cc07918f6b3669f5774ecdfd48f32ab"
- integrity sha512-YXxSlJBZTP7RS3tWnQw74ooKa6L9b9i9QYXY21eUEvhZ3u9XLfv6OnFsQq6RxkhHygsaUMvYsZRV5rU/OVNZxw==
- dependencies:
- camel-case "^4.1.2"
- clean-css "^5.2.2"
- commander "^8.3.0"
- he "^1.2.0"
- param-case "^3.0.4"
- relateurl "^0.2.7"
- terser "^5.10.0"
-
-html-tags@^3.1.0:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/html-tags/-/html-tags-3.1.0.tgz#7b5e6f7e665e9fb41f30007ed9e0d41e97fb2140"
- integrity sha512-1qYz89hW3lFDEazhjW0yVAV87lw8lVkrJocr72XmBkMKsoSVJCQx3W8BXsC7hO2qAt8BoVjYjtAcZ9perqGnNg==
-
-html-void-elements@^1.0.0:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/html-void-elements/-/html-void-elements-1.0.5.tgz#ce9159494e86d95e45795b166c2021c2cfca4483"
- integrity sha512-uE/TxKuyNIcx44cIWnjr/rfIATDH7ZaOMmstu0CwhFG1Dunhlp4OC6/NMbhiwoq5BpW0ubi303qnEk/PZj614w==
-
-html-webpack-plugin@^5.4.0:
- version "5.5.0"
- resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-5.5.0.tgz#c3911936f57681c1f9f4d8b68c158cd9dfe52f50"
- integrity sha512-sy88PC2cRTVxvETRgUHFrL4No3UxvcH8G1NepGhqaTT+GXN2kTamqasot0inS5hXeg1cMbFDt27zzo9p35lZVw==
- dependencies:
- "@types/html-minifier-terser" "^6.0.0"
- html-minifier-terser "^6.0.2"
- lodash "^4.17.21"
- pretty-error "^4.0.0"
- tapable "^2.0.0"
-
-htmlparser2@^3.9.1:
- version "3.10.1"
- resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f"
- integrity sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==
- dependencies:
- domelementtype "^1.3.1"
- domhandler "^2.3.0"
- domutils "^1.5.1"
- entities "^1.1.1"
- inherits "^2.0.1"
- readable-stream "^3.1.1"
-
-htmlparser2@^6.1.0:
- version "6.1.0"
- resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-6.1.0.tgz#c4d762b6c3371a05dbe65e94ae43a9f845fb8fb7"
- integrity sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A==
- dependencies:
- domelementtype "^2.0.1"
- domhandler "^4.0.0"
- domutils "^2.5.2"
- entities "^2.0.0"
-
-http-cache-semantics@^4.0.0:
- version "4.1.0"
- resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390"
- integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==
-
-http-deceiver@^1.2.7:
- version "1.2.7"
- resolved "https://registry.yarnpkg.com/http-deceiver/-/http-deceiver-1.2.7.tgz#fa7168944ab9a519d337cb0bec7284dc3e723d87"
- integrity sha1-+nFolEq5pRnTN8sL7HKE3D5yPYc=
-
-http-errors@1.8.1:
- version "1.8.1"
- resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.1.tgz#7c3f28577cbc8a207388455dbd62295ed07bd68c"
- integrity sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==
- dependencies:
- depd "~1.1.2"
- inherits "2.0.4"
- setprototypeof "1.2.0"
- statuses ">= 1.5.0 < 2"
- toidentifier "1.0.1"
-
-http-errors@~1.6.2:
- version "1.6.3"
- resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d"
- integrity sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=
- dependencies:
- depd "~1.1.2"
- inherits "2.0.3"
- setprototypeof "1.1.0"
- statuses ">= 1.4.0 < 2"
-
-http-parser-js@>=0.5.1:
- version "0.5.5"
- resolved "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.5.5.tgz#d7c30d5d3c90d865b4a2e870181f9d6f22ac7ac5"
- integrity sha512-x+JVEkO2PoM8qqpbPbOL3cqHPwerep7OwzK7Ay+sMQjKzaKCqWvjoXm5tqMP9tXWWTnTzAjIhXg+J99XYuPhPA==
-
-http-proxy-middleware@^2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-2.0.1.tgz#7ef3417a479fb7666a571e09966c66a39bd2c15f"
- integrity sha512-cfaXRVoZxSed/BmkA7SwBVNI9Kj7HFltaE5rqYOub5kWzWZ+gofV2koVN1j2rMW7pEfSSlCHGJ31xmuyFyfLOg==
- dependencies:
- "@types/http-proxy" "^1.17.5"
- http-proxy "^1.18.1"
- is-glob "^4.0.1"
- is-plain-obj "^3.0.0"
- micromatch "^4.0.2"
-
-http-proxy@^1.18.1:
- version "1.18.1"
- resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.18.1.tgz#401541f0534884bbf95260334e72f88ee3976549"
- integrity sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==
- dependencies:
- eventemitter3 "^4.0.0"
- follow-redirects "^1.0.0"
- requires-port "^1.0.0"
-
-human-signals@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0"
- integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==
-
-iconv-lite@0.4.24:
- version "0.4.24"
- resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
- integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==
- dependencies:
- safer-buffer ">= 2.1.2 < 3"
-
-icss-utils@^5.0.0, icss-utils@^5.1.0:
- version "5.1.0"
- resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-5.1.0.tgz#c6be6858abd013d768e98366ae47e25d5887b1ae"
- integrity sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==
-
-ignore@^5.1.4:
- version "5.2.0"
- resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a"
- integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==
-
-immer@^9.0.6:
- version "9.0.7"
- resolved "https://registry.yarnpkg.com/immer/-/immer-9.0.7.tgz#b6156bd7db55db7abc73fd2fdadf4e579a701075"
- integrity sha512-KGllzpbamZDvOIxnmJ0jI840g7Oikx58lBPWV0hUh7dtAyZpFqqrBZdKka5GlTwMTZ1Tjc/bKKW4VSFAt6BqMA==
-
-import-fresh@^3.1.0, import-fresh@^3.2.1, import-fresh@^3.2.2, import-fresh@^3.3.0:
- version "3.3.0"
- resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b"
- integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==
- dependencies:
- parent-module "^1.0.0"
- resolve-from "^4.0.0"
-
-import-lazy@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43"
- integrity sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=
-
-imurmurhash@^0.1.4:
- version "0.1.4"
- resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
- integrity sha1-khi5srkoojixPcT7a21XbyMUU+o=
-
-indent-string@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251"
- integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==
-
-infima@0.2.0-alpha.36:
- version "0.2.0-alpha.36"
- resolved "https://registry.yarnpkg.com/infima/-/infima-0.2.0-alpha.36.tgz#205515680e2dc588ec1a07b6ce108e49b29cc810"
- integrity sha512-tlhQa7S09+QzQs8hCZ9oBeD6xOFap1f2zDO4I5HRZ4SMFKKGk9sIhwaou1FWpYoqM6aaoK2YN+G1fND+Sad1Qw==
-
-inflight@^1.0.4:
- version "1.0.6"
- resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
- integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=
- dependencies:
- once "^1.3.0"
- wrappy "1"
-
-inherits@2, inherits@2.0.4, inherits@^2.0.0, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3:
- version "2.0.4"
- resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
- integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
-
-inherits@2.0.3:
- version "2.0.3"
- resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
- integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
-
-ini@2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/ini/-/ini-2.0.0.tgz#e5fd556ecdd5726be978fa1001862eacb0a94bc5"
- integrity sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==
-
-ini@^1.3.5, ini@~1.3.0:
- version "1.3.8"
- resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c"
- integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==
-
-inline-style-parser@0.1.1:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/inline-style-parser/-/inline-style-parser-0.1.1.tgz#ec8a3b429274e9c0a1f1c4ffa9453a7fef72cea1"
- integrity sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==
-
-interpret@^1.0.0:
- version "1.4.0"
- resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e"
- integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==
-
-ip@^1.1.0:
- version "1.1.5"
- resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a"
- integrity sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=
-
-ipaddr.js@1.9.1:
- version "1.9.1"
- resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3"
- integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==
-
-ipaddr.js@^2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-2.0.1.tgz#eca256a7a877e917aeb368b0a7497ddf42ef81c0"
- integrity sha512-1qTgH9NG+IIJ4yfKs2e6Pp1bZg8wbDbKHT21HrLIeYBTRLgMYKnMTPAuI3Lcs61nfx5h1xlXnbJtH1kX5/d/ng==
-
-is-alphabetical@1.0.4, is-alphabetical@^1.0.0:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-1.0.4.tgz#9e7d6b94916be22153745d184c298cbf986a686d"
- integrity sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==
-
-is-alphanumerical@^1.0.0:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz#7eb9a2431f855f6b1ef1a78e326df515696c4dbf"
- integrity sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==
- dependencies:
- is-alphabetical "^1.0.0"
- is-decimal "^1.0.0"
-
-is-arguments@^1.0.4:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b"
- integrity sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==
- dependencies:
- call-bind "^1.0.2"
- has-tostringtag "^1.0.0"
-
-is-arrayish@^0.2.1:
- version "0.2.1"
- resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d"
- integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=
-
-is-binary-path@~2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09"
- integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==
- dependencies:
- binary-extensions "^2.0.0"
-
-is-buffer@^2.0.0:
- version "2.0.5"
- resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191"
- integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==
-
-is-ci@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c"
- integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==
- dependencies:
- ci-info "^2.0.0"
-
-is-core-module@^2.2.0:
- version "2.8.0"
- resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.0.tgz#0321336c3d0925e497fd97f5d95cb114a5ccd548"
- integrity sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==
- dependencies:
- has "^1.0.3"
-
-is-date-object@^1.0.1:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f"
- integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==
- dependencies:
- has-tostringtag "^1.0.0"
-
-is-decimal@^1.0.0:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-1.0.4.tgz#65a3a5958a1c5b63a706e1b333d7cd9f630d3fa5"
- integrity sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==
-
-is-docker@^2.0.0, is-docker@^2.1.1:
- version "2.2.1"
- resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa"
- integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==
-
-is-extendable@^0.1.0:
- version "0.1.1"
- resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89"
- integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=
-
-is-extglob@^2.1.1:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
- integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=
-
-is-fullwidth-code-point@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d"
- integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==
-
-is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1:
- version "4.0.3"
- resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084"
- integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==
- dependencies:
- is-extglob "^2.1.1"
-
-is-hexadecimal@^1.0.0:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz#cc35c97588da4bd49a8eedd6bc4082d44dcb23a7"
- integrity sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==
-
-is-installed-globally@^0.4.0:
- version "0.4.0"
- resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.4.0.tgz#9a0fd407949c30f86eb6959ef1b7994ed0b7b520"
- integrity sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==
- dependencies:
- global-dirs "^3.0.0"
- is-path-inside "^3.0.2"
-
-is-npm@^5.0.0:
- version "5.0.0"
- resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-5.0.0.tgz#43e8d65cc56e1b67f8d47262cf667099193f45a8"
- integrity sha512-WW/rQLOazUq+ST/bCAVBp/2oMERWLsR7OrKyt052dNDk4DHcDE0/7QSXITlmi+VBcV13DfIbysG3tZJm5RfdBA==
-
-is-number@^7.0.0:
- version "7.0.0"
- resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
- integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==
-
-is-obj@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f"
- integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8=
-
-is-obj@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982"
- integrity sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==
-
-is-path-cwd@^2.2.0:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-2.2.0.tgz#67d43b82664a7b5191fd9119127eb300048a9fdb"
- integrity sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==
-
-is-path-inside@^3.0.2:
- version "3.0.3"
- resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283"
- integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==
-
-is-plain-obj@^2.0.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287"
- integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==
-
-is-plain-obj@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-3.0.0.tgz#af6f2ea14ac5a646183a5bbdb5baabbc156ad9d7"
- integrity sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA==
-
-is-plain-object@^2.0.4:
- version "2.0.4"
- resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677"
- integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==
- dependencies:
- isobject "^3.0.1"
-
-is-regex@^1.0.4:
- version "1.1.4"
- resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958"
- integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==
- dependencies:
- call-bind "^1.0.2"
- has-tostringtag "^1.0.0"
-
-is-regexp@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069"
- integrity sha1-/S2INUXEa6xaYz57mgnof6LLUGk=
-
-is-root@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/is-root/-/is-root-2.1.0.tgz#809e18129cf1129644302a4f8544035d51984a9c"
- integrity sha512-AGOriNp96vNBd3HtU+RzFEc75FfR5ymiYv8E553I71SCeXBiMsVDUtdio1OEFvrPyLIQ9tVR5RxXIFe5PUFjMg==
-
-is-stream@^2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077"
- integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==
-
-is-typedarray@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
- integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=
-
-is-whitespace-character@^1.0.0:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/is-whitespace-character/-/is-whitespace-character-1.0.4.tgz#0858edd94a95594c7c9dd0b5c174ec6e45ee4aa7"
- integrity sha512-SDweEzfIZM0SJV0EUga669UTKlmL0Pq8Lno0QDQsPnvECB3IM2aP0gdx5TrU0A01MAPfViaZiI2V1QMZLaKK5w==
-
-is-word-character@^1.0.0:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/is-word-character/-/is-word-character-1.0.4.tgz#ce0e73216f98599060592f62ff31354ddbeb0230"
- integrity sha512-5SMO8RVennx3nZrqtKwCGyyetPE9VDba5ugvKLaD4KopPG5kR4mQ7tNt/r7feL5yt5h3lpuBbIUmCOG2eSzXHA==
-
-is-wsl@^2.1.1, is-wsl@^2.2.0:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271"
- integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==
- dependencies:
- is-docker "^2.0.0"
-
-is-yarn-global@^0.3.0:
- version "0.3.0"
- resolved "https://registry.yarnpkg.com/is-yarn-global/-/is-yarn-global-0.3.0.tgz#d502d3382590ea3004893746754c89139973e232"
- integrity sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==
-
-isarray@0.0.1:
- version "0.0.1"
- resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
- integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=
-
-isarray@~1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
- integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=
-
-isexe@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
- integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=
-
-isobject@^3.0.1:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df"
- integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8=
-
-jest-worker@^27.0.2, jest-worker@^27.4.1:
- version "27.4.5"
- resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.4.5.tgz#d696e3e46ae0f24cff3fa7195ffba22889262242"
- integrity sha512-f2s8kEdy15cv9r7q4KkzGXvlY0JTcmCbMHZBfSQDwW77REr45IDWwd0lksDFeVHH2jJ5pqb90T77XscrjeGzzg==
- dependencies:
- "@types/node" "*"
- merge-stream "^2.0.0"
- supports-color "^8.0.0"
-
-joi@^17.4.0, joi@^17.4.2:
- version "17.5.0"
- resolved "https://registry.yarnpkg.com/joi/-/joi-17.5.0.tgz#7e66d0004b5045d971cf416a55fb61d33ac6e011"
- integrity sha512-R7hR50COp7StzLnDi4ywOXHrBrgNXuUUfJWIR5lPY5Bm/pOD3jZaTwpluUXVLRWcoWZxkrHBBJ5hLxgnlehbdw==
- dependencies:
- "@hapi/hoek" "^9.0.0"
- "@hapi/topo" "^5.0.0"
- "@sideway/address" "^4.1.3"
- "@sideway/formula" "^3.0.0"
- "@sideway/pinpoint" "^2.0.0"
-
-"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
- integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
-
-js-yaml@^3.13.1:
- version "3.14.1"
- resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537"
- integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==
- dependencies:
- argparse "^1.0.7"
- esprima "^4.0.0"
-
-js-yaml@^4.0.0:
- version "4.1.0"
- resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602"
- integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==
- dependencies:
- argparse "^2.0.1"
-
-jsesc@^2.5.1:
- version "2.5.2"
- resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4"
- integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==
-
-jsesc@~0.5.0:
- version "0.5.0"
- resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d"
- integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=
-
-json-buffer@3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898"
- integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=
-
-json-parse-better-errors@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9"
- integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==
-
-json-parse-even-better-errors@^2.3.0:
- version "2.3.1"
- resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d"
- integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==
-
-json-schema-traverse@^0.4.1:
- version "0.4.1"
- resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660"
- integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==
-
-json-schema-traverse@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2"
- integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==
-
-json5@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe"
- integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==
- dependencies:
- minimist "^1.2.0"
-
-json5@^2.1.2:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3"
- integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==
- dependencies:
- minimist "^1.2.5"
-
-jsonfile@^6.0.1:
- version "6.1.0"
- resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae"
- integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==
- dependencies:
- universalify "^2.0.0"
- optionalDependencies:
- graceful-fs "^4.1.6"
-
-keyv@^3.0.0:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9"
- integrity sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==
- dependencies:
- json-buffer "3.0.0"
-
-kind-of@^6.0.0, kind-of@^6.0.2:
- version "6.0.3"
- resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd"
- integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==
-
-kleur@^3.0.3:
- version "3.0.3"
- resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e"
- integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==
-
-klona@^2.0.5:
- version "2.0.5"
- resolved "https://registry.yarnpkg.com/klona/-/klona-2.0.5.tgz#d166574d90076395d9963aa7a928fabb8d76afbc"
- integrity sha512-pJiBpiXMbt7dkzXe8Ghj/u4FfXOOa98fPW+bihOJ4SjnoijweJrNThJfd3ifXpXhREjpoF2mZVH1GfS9LV3kHQ==
-
-latest-version@^5.1.0:
- version "5.1.0"
- resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-5.1.0.tgz#119dfe908fe38d15dfa43ecd13fa12ec8832face"
- integrity sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==
- dependencies:
- package-json "^6.3.0"
-
-leven@^3.1.0:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2"
- integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==
-
-lilconfig@^2.0.3:
- version "2.0.4"
- resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.0.4.tgz#f4507d043d7058b380b6a8f5cb7bcd4b34cee082"
- integrity sha512-bfTIN7lEsiooCocSISTWXkiWJkRqtL9wYtYy+8EK3Y41qh3mpwPU0ycTOgjdY9ErwXCc8QyrQp82bdL0Xkm9yA==
-
-lines-and-columns@^1.1.6:
- version "1.2.4"
- resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632"
- integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==
-
-loader-runner@^4.2.0:
- version "4.2.0"
- resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.2.0.tgz#d7022380d66d14c5fb1d496b89864ebcfd478384"
- integrity sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw==
-
-loader-utils@^1.4.0:
- version "1.4.0"
- resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613"
- integrity sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==
- dependencies:
- big.js "^5.2.2"
- emojis-list "^3.0.0"
- json5 "^1.0.1"
-
-loader-utils@^2.0.0:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.2.tgz#d6e3b4fb81870721ae4e0868ab11dd638368c129"
- integrity sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==
- dependencies:
- big.js "^5.2.2"
- emojis-list "^3.0.0"
- json5 "^2.1.2"
-
-locate-path@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e"
- integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==
- dependencies:
- p-locate "^3.0.0"
- path-exists "^3.0.0"
-
-locate-path@^5.0.0:
- version "5.0.0"
- resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0"
- integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==
- dependencies:
- p-locate "^4.1.0"
-
-locate-path@^6.0.0:
- version "6.0.0"
- resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286"
- integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==
- dependencies:
- p-locate "^5.0.0"
-
-lodash.assignin@^4.0.9:
- version "4.2.0"
- resolved "https://registry.yarnpkg.com/lodash.assignin/-/lodash.assignin-4.2.0.tgz#ba8df5fb841eb0a3e8044232b0e263a8dc6a28a2"
- integrity sha1-uo31+4QesKPoBEIysOJjqNxqKKI=
-
-lodash.bind@^4.1.4:
- version "4.2.1"
- resolved "https://registry.yarnpkg.com/lodash.bind/-/lodash.bind-4.2.1.tgz#7ae3017e939622ac31b7d7d7dcb1b34db1690d35"
- integrity sha1-euMBfpOWIqwxt9fX3LGzTbFpDTU=
-
-lodash.curry@^4.0.1:
- version "4.1.1"
- resolved "https://registry.yarnpkg.com/lodash.curry/-/lodash.curry-4.1.1.tgz#248e36072ede906501d75966200a86dab8b23170"
- integrity sha1-JI42By7ekGUB11lmIAqG2riyMXA=
-
-lodash.debounce@^4.0.8:
- version "4.0.8"
- resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
- integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168=
-
-lodash.defaults@^4.0.1:
- version "4.2.0"
- resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c"
- integrity sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=
-
-lodash.filter@^4.4.0:
- version "4.6.0"
- resolved "https://registry.yarnpkg.com/lodash.filter/-/lodash.filter-4.6.0.tgz#668b1d4981603ae1cc5a6fa760143e480b4c4ace"
- integrity sha1-ZosdSYFgOuHMWm+nYBQ+SAtMSs4=
-
-lodash.flatten@^4.2.0:
- version "4.4.0"
- resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f"
- integrity sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=
-
-lodash.flow@^3.3.0:
- version "3.5.0"
- resolved "https://registry.yarnpkg.com/lodash.flow/-/lodash.flow-3.5.0.tgz#87bf40292b8cf83e4e8ce1a3ae4209e20071675a"
- integrity sha1-h79AKSuM+D5OjOGjrkIJ4gBxZ1o=
-
-lodash.foreach@^4.3.0:
- version "4.5.0"
- resolved "https://registry.yarnpkg.com/lodash.foreach/-/lodash.foreach-4.5.0.tgz#1a6a35eace401280c7f06dddec35165ab27e3e53"
- integrity sha1-Gmo16s5AEoDH8G3d7DUWWrJ+PlM=
-
-lodash.map@^4.4.0:
- version "4.6.0"
- resolved "https://registry.yarnpkg.com/lodash.map/-/lodash.map-4.6.0.tgz#771ec7839e3473d9c4cde28b19394c3562f4f6d3"
- integrity sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=
-
-lodash.memoize@^4.1.2:
- version "4.1.2"
- resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe"
- integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=
-
-lodash.merge@^4.4.0:
- version "4.6.2"
- resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a"
- integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==
-
-lodash.pick@^4.2.1:
- version "4.4.0"
- resolved "https://registry.yarnpkg.com/lodash.pick/-/lodash.pick-4.4.0.tgz#52f05610fff9ded422611441ed1fc123a03001b3"
- integrity sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM=
-
-lodash.reduce@^4.4.0:
- version "4.6.0"
- resolved "https://registry.yarnpkg.com/lodash.reduce/-/lodash.reduce-4.6.0.tgz#f1ab6b839299ad48f784abbf476596f03b914d3b"
- integrity sha1-8atrg5KZrUj3hKu/R2WW8DuRTTs=
-
-lodash.reject@^4.4.0:
- version "4.6.0"
- resolved "https://registry.yarnpkg.com/lodash.reject/-/lodash.reject-4.6.0.tgz#80d6492dc1470864bbf583533b651f42a9f52415"
- integrity sha1-gNZJLcFHCGS79YNTO2UfQqn1JBU=
-
-lodash.some@^4.4.0:
- version "4.6.0"
- resolved "https://registry.yarnpkg.com/lodash.some/-/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d"
- integrity sha1-G7nzFO9ri63tE7VJFpsqlF62jk0=
-
-lodash.uniq@4.5.0, lodash.uniq@^4.5.0:
- version "4.5.0"
- resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
- integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=
-
-lodash@^4.17.14, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21:
- version "4.17.21"
- resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
- integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
-
-loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3.1, loose-envify@^1.4.0:
- version "1.4.0"
- resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
- integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
- dependencies:
- js-tokens "^3.0.0 || ^4.0.0"
-
-lower-case@^2.0.2:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-2.0.2.tgz#6fa237c63dbdc4a82ca0fd882e4722dc5e634e28"
- integrity sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==
- dependencies:
- tslib "^2.0.3"
-
-lowercase-keys@^1.0.0, lowercase-keys@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f"
- integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==
-
-lowercase-keys@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479"
- integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==
-
-lru-cache@^6.0.0:
- version "6.0.0"
- resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
- integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==
- dependencies:
- yallist "^4.0.0"
-
-magic-string@^0.25.3:
- version "0.25.7"
- resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051"
- integrity sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==
- dependencies:
- sourcemap-codec "^1.4.4"
-
-make-dir@^3.0.0, make-dir@^3.0.2, make-dir@^3.1.0:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f"
- integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==
- dependencies:
- semver "^6.0.0"
-
-markdown-escapes@^1.0.0:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.4.tgz#c95415ef451499d7602b91095f3c8e8975f78535"
- integrity sha512-8z4efJYk43E0upd0NbVXwgSTQs6cT3T06etieCMEg7dRbzCbxUCK/GHlX8mhHRDcp+OLlHkPKsvqQTCvsRl2cg==
-
-mdast-squeeze-paragraphs@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/mdast-squeeze-paragraphs/-/mdast-squeeze-paragraphs-4.0.0.tgz#7c4c114679c3bee27ef10b58e2e015be79f1ef97"
- integrity sha512-zxdPn69hkQ1rm4J+2Cs2j6wDEv7O17TfXTJ33tl/+JPIoEmtV9t2ZzBM5LPHE8QlHsmVD8t3vPKCyY3oH+H8MQ==
- dependencies:
- unist-util-remove "^2.0.0"
-
-mdast-util-definitions@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/mdast-util-definitions/-/mdast-util-definitions-4.0.0.tgz#c5c1a84db799173b4dcf7643cda999e440c24db2"
- integrity sha512-k8AJ6aNnUkB7IE+5azR9h81O5EQ/cTDXtWdMq9Kk5KcEW/8ritU5CeLg/9HhOC++nALHBlaogJ5jz0Ybk3kPMQ==
- dependencies:
- unist-util-visit "^2.0.0"
-
-mdast-util-to-hast@10.0.1:
- version "10.0.1"
- resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-10.0.1.tgz#0cfc82089494c52d46eb0e3edb7a4eb2aea021eb"
- integrity sha512-BW3LM9SEMnjf4HXXVApZMt8gLQWVNXc3jryK0nJu/rOXPOnlkUjmdkDlmxMirpbU9ILncGFIwLH/ubnWBbcdgA==
- dependencies:
- "@types/mdast" "^3.0.0"
- "@types/unist" "^2.0.0"
- mdast-util-definitions "^4.0.0"
- mdurl "^1.0.0"
- unist-builder "^2.0.0"
- unist-util-generated "^1.0.0"
- unist-util-position "^3.0.0"
- unist-util-visit "^2.0.0"
-
-mdast-util-to-string@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-2.0.0.tgz#b8cfe6a713e1091cb5b728fc48885a4767f8b97b"
- integrity sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w==
-
-mdn-data@2.0.14:
- version "2.0.14"
- resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.14.tgz#7113fc4281917d63ce29b43446f701e68c25ba50"
- integrity sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==
-
-mdurl@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e"
- integrity sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=
-
-media-typer@0.3.0:
- version "0.3.0"
- resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748"
- integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=
-
-memfs@^3.1.2, memfs@^3.2.2:
- version "3.4.0"
- resolved "https://registry.yarnpkg.com/memfs/-/memfs-3.4.0.tgz#8bc12062b973be6b295d4340595736a656f0a257"
- integrity sha512-o/RfP0J1d03YwsAxyHxAYs2kyJp55AFkMazlFAZFR2I2IXkxiUTXRabJ6RmNNCQ83LAD2jy52Khj0m3OffpNdA==
- dependencies:
- fs-monkey "1.0.3"
-
-merge-descriptors@1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61"
- integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=
-
-merge-stream@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60"
- integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==
-
-merge2@^1.3.0:
- version "1.4.1"
- resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
- integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==
-
-methods@~1.1.2:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee"
- integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=
-
-micromatch@^4.0.2, micromatch@^4.0.4:
- version "4.0.4"
- resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9"
- integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==
- dependencies:
- braces "^3.0.1"
- picomatch "^2.2.3"
-
-mime-db@1.51.0, "mime-db@>= 1.43.0 < 2":
- version "1.51.0"
- resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.51.0.tgz#d9ff62451859b18342d960850dc3cfb77e63fb0c"
- integrity sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==
-
-mime-db@~1.33.0:
- version "1.33.0"
- resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.33.0.tgz#a3492050a5cb9b63450541e39d9788d2272783db"
- integrity sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==
-
-mime-types@2.1.18:
- version "2.1.18"
- resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.18.tgz#6f323f60a83d11146f831ff11fd66e2fe5503bb8"
- integrity sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==
- dependencies:
- mime-db "~1.33.0"
-
-mime-types@^2.1.27, mime-types@^2.1.31, mime-types@~2.1.17, mime-types@~2.1.24:
- version "2.1.34"
- resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.34.tgz#5a712f9ec1503511a945803640fafe09d3793c24"
- integrity sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==
- dependencies:
- mime-db "1.51.0"
-
-mime@1.6.0:
- version "1.6.0"
- resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1"
- integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==
-
-mimic-fn@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b"
- integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==
-
-mimic-response@^1.0.0, mimic-response@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b"
- integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==
-
-mini-create-react-context@^0.4.0:
- version "0.4.1"
- resolved "https://registry.yarnpkg.com/mini-create-react-context/-/mini-create-react-context-0.4.1.tgz#072171561bfdc922da08a60c2197a497cc2d1d5e"
- integrity sha512-YWCYEmd5CQeHGSAKrYvXgmzzkrvssZcuuQDDeqkT+PziKGMgE+0MCCtcKbROzocGBG1meBLl2FotlRwf4gAzbQ==
- dependencies:
- "@babel/runtime" "^7.12.1"
- tiny-warning "^1.0.3"
-
-mini-css-extract-plugin@^1.6.0:
- version "1.6.2"
- resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-1.6.2.tgz#83172b4fd812f8fc4a09d6f6d16f924f53990ca8"
- integrity sha512-WhDvO3SjGm40oV5y26GjMJYjd2UMqrLAGKy5YS2/3QKJy2F7jgynuHTir/tgUUOiNQu5saXHdc8reo7YuhhT4Q==
- dependencies:
- loader-utils "^2.0.0"
- schema-utils "^3.0.0"
- webpack-sources "^1.1.0"
-
-minimalistic-assert@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7"
- integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==
-
-minimatch@3.0.4, minimatch@^3.0.4:
- version "3.0.4"
- resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
- integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
- dependencies:
- brace-expansion "^1.1.7"
-
-minimist@^1.2.0, minimist@^1.2.5:
- version "1.2.5"
- resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
- integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
-
-mkdirp@^0.5.5:
- version "0.5.5"
- resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def"
- integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==
- dependencies:
- minimist "^1.2.5"
-
-mrmime@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/mrmime/-/mrmime-1.0.0.tgz#14d387f0585a5233d291baba339b063752a2398b"
- integrity sha512-a70zx7zFfVO7XpnQ2IX1Myh9yY4UYvfld/dikWRnsXxbyvMcfz+u6UfgNAtH+k2QqtJuzVpv6eLTx1G2+WKZbQ==
-
-ms@2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
- integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
-
-ms@2.1.2:
- version "2.1.2"
- resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
- integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
-
-ms@2.1.3, ms@^2.1.1:
- version "2.1.3"
- resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
- integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
-
-multicast-dns-service-types@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz#899f11d9686e5e05cb91b35d5f0e63b773cfc901"
- integrity sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE=
-
-multicast-dns@^6.0.1:
- version "6.2.3"
- resolved "https://registry.yarnpkg.com/multicast-dns/-/multicast-dns-6.2.3.tgz#a0ec7bd9055c4282f790c3c82f4e28db3b31b229"
- integrity sha512-ji6J5enbMyGRHIAkAOu3WdV8nggqviKCEKtXcOqfphZZtQrmHKycfynJ2V7eVPUA4NhJ6V7Wf4TmGbTwKE9B6g==
- dependencies:
- dns-packet "^1.3.1"
- thunky "^1.0.2"
-
-nanoid@^3.1.30:
- version "3.1.30"
- resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.30.tgz#63f93cc548d2a113dc5dfbc63bfa09e2b9b64362"
- integrity sha512-zJpuPDwOv8D2zq2WRoMe1HsfZthVewpel9CAvTfc/2mBD1uUT/agc5f7GHGWXlYkFvi1mVxe4IjvP2HNrop7nQ==
-
-negotiator@0.6.2:
- version "0.6.2"
- resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb"
- integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==
-
-neo-async@^2.6.2:
- version "2.6.2"
- resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f"
- integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==
-
-no-case@^3.0.4:
- version "3.0.4"
- resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d"
- integrity sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==
- dependencies:
- lower-case "^2.0.2"
- tslib "^2.0.3"
-
-node-emoji@^1.10.0:
- version "1.11.0"
- resolved "https://registry.yarnpkg.com/node-emoji/-/node-emoji-1.11.0.tgz#69a0150e6946e2f115e9d7ea4df7971e2628301c"
- integrity sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A==
- dependencies:
- lodash "^4.17.21"
-
-node-fetch@2.6.1:
- version "2.6.1"
- resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052"
- integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==
-
-node-forge@^0.10.0:
- version "0.10.0"
- resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.10.0.tgz#32dea2afb3e9926f02ee5ce8794902691a676bf3"
- integrity sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==
-
-node-releases@^2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.1.tgz#3d1d395f204f1f2f29a54358b9fb678765ad2fc5"
- integrity sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==
-
-normalize-path@^3.0.0, normalize-path@~3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
- integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==
-
-normalize-range@^0.1.2:
- version "0.1.2"
- resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942"
- integrity sha1-LRDAa9/TEuqXd2laTShDlFa3WUI=
-
-normalize-url@^4.1.0:
- version "4.5.1"
- resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a"
- integrity sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==
-
-normalize-url@^6.0.1:
- version "6.1.0"
- resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a"
- integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==
-
-npm-run-path@^4.0.1:
- version "4.0.1"
- resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea"
- integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==
- dependencies:
- path-key "^3.0.0"
-
-nprogress@^0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/nprogress/-/nprogress-0.2.0.tgz#cb8f34c53213d895723fcbab907e9422adbcafb1"
- integrity sha1-y480xTIT2JVyP8urkH6UIq28r7E=
-
-nth-check@^2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.0.1.tgz#2efe162f5c3da06a28959fbd3db75dbeea9f0fc2"
- integrity sha512-it1vE95zF6dTT9lBsYbxvqh0Soy4SPowchj0UBGj/V6cTPnXXtQOPUbhZ6CmGzAD/rW22LQK6E96pcdJXk4A4w==
- dependencies:
- boolbase "^1.0.0"
-
-nth-check@~1.0.1:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c"
- integrity sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==
- dependencies:
- boolbase "~1.0.0"
-
-object-assign@^4.1.0, object-assign@^4.1.1:
- version "4.1.1"
- resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
- integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=
-
-object-is@^1.0.1:
- version "1.1.5"
- resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.5.tgz#b9deeaa5fc7f1846a0faecdceec138e5778f53ac"
- integrity sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==
- dependencies:
- call-bind "^1.0.2"
- define-properties "^1.1.3"
-
-object-keys@^1.0.12, object-keys@^1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e"
- integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==
-
-object.assign@^4.1.0:
- version "4.1.2"
- resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940"
- integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==
- dependencies:
- call-bind "^1.0.0"
- define-properties "^1.1.3"
- has-symbols "^1.0.1"
- object-keys "^1.1.1"
-
-obuf@^1.0.0, obuf@^1.1.2:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e"
- integrity sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==
-
-on-finished@~2.3.0:
- version "2.3.0"
- resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947"
- integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=
- dependencies:
- ee-first "1.1.1"
-
-on-headers@~1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.2.tgz#772b0ae6aaa525c399e489adfad90c403eb3c28f"
- integrity sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==
-
-once@^1.3.0, once@^1.3.1, once@^1.4.0:
- version "1.4.0"
- resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
- integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
- dependencies:
- wrappy "1"
-
-onetime@^5.1.2:
- version "5.1.2"
- resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e"
- integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==
- dependencies:
- mimic-fn "^2.1.0"
-
-open@^7.0.2:
- version "7.4.2"
- resolved "https://registry.yarnpkg.com/open/-/open-7.4.2.tgz#b8147e26dcf3e426316c730089fd71edd29c2321"
- integrity sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==
- dependencies:
- is-docker "^2.0.0"
- is-wsl "^2.1.1"
-
-open@^8.0.9:
- version "8.4.0"
- resolved "https://registry.yarnpkg.com/open/-/open-8.4.0.tgz#345321ae18f8138f82565a910fdc6b39e8c244f8"
- integrity sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==
- dependencies:
- define-lazy-prop "^2.0.0"
- is-docker "^2.1.1"
- is-wsl "^2.2.0"
-
-opener@^1.5.2:
- version "1.5.2"
- resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598"
- integrity sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==
-
-p-cancelable@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc"
- integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==
-
-p-limit@^2.0.0, p-limit@^2.2.0:
- version "2.3.0"
- resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1"
- integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==
- dependencies:
- p-try "^2.0.0"
-
-p-limit@^3.0.2:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b"
- integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==
- dependencies:
- yocto-queue "^0.1.0"
-
-p-locate@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4"
- integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==
- dependencies:
- p-limit "^2.0.0"
-
-p-locate@^4.1.0:
- version "4.1.0"
- resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07"
- integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==
- dependencies:
- p-limit "^2.2.0"
-
-p-locate@^5.0.0:
- version "5.0.0"
- resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834"
- integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==
- dependencies:
- p-limit "^3.0.2"
-
-p-map@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b"
- integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==
- dependencies:
- aggregate-error "^3.0.0"
-
-p-retry@^4.5.0:
- version "4.6.1"
- resolved "https://registry.yarnpkg.com/p-retry/-/p-retry-4.6.1.tgz#8fcddd5cdf7a67a0911a9cf2ef0e5df7f602316c"
- integrity sha512-e2xXGNhZOZ0lfgR9kL34iGlU8N/KO0xZnQxVEwdeOvpqNDQfdnxIYizvWtK8RglUa3bGqI8g0R/BdfzLMxRkiA==
- dependencies:
- "@types/retry" "^0.12.0"
- retry "^0.13.1"
-
-p-try@^2.0.0:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6"
- integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==
-
-package-json@^6.3.0:
- version "6.5.0"
- resolved "https://registry.yarnpkg.com/package-json/-/package-json-6.5.0.tgz#6feedaca35e75725876d0b0e64974697fed145b0"
- integrity sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==
- dependencies:
- got "^9.6.0"
- registry-auth-token "^4.0.0"
- registry-url "^5.0.0"
- semver "^6.2.0"
-
-param-case@^3.0.4:
- version "3.0.4"
- resolved "https://registry.yarnpkg.com/param-case/-/param-case-3.0.4.tgz#7d17fe4aa12bde34d4a77d91acfb6219caad01c5"
- integrity sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==
- dependencies:
- dot-case "^3.0.4"
- tslib "^2.0.3"
-
-parent-module@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2"
- integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==
- dependencies:
- callsites "^3.0.0"
-
-parse-entities@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-2.0.0.tgz#53c6eb5b9314a1f4ec99fa0fdf7ce01ecda0cbe8"
- integrity sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==
- dependencies:
- character-entities "^1.0.0"
- character-entities-legacy "^1.0.0"
- character-reference-invalid "^1.0.0"
- is-alphanumerical "^1.0.0"
- is-decimal "^1.0.0"
- is-hexadecimal "^1.0.0"
-
-parse-json@^5.0.0:
- version "5.2.0"
- resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd"
- integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==
- dependencies:
- "@babel/code-frame" "^7.0.0"
- error-ex "^1.3.1"
- json-parse-even-better-errors "^2.3.0"
- lines-and-columns "^1.1.6"
-
-parse-numeric-range@^1.3.0:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/parse-numeric-range/-/parse-numeric-range-1.3.0.tgz#7c63b61190d61e4d53a1197f0c83c47bb670ffa3"
- integrity sha512-twN+njEipszzlMJd4ONUYgSfZPDxgHhT9Ahed5uTigpQn90FggW4SA/AIPq/6a149fTbE9qBEcSwE3FAEp6wQQ==
-
-parse5@^5.0.0:
- version "5.1.1"
- resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.1.tgz#f68e4e5ba1852ac2cadc00f4555fff6c2abb6178"
- integrity sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==
-
-parse5@^6.0.0:
- version "6.0.1"
- resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b"
- integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==
-
-parseurl@~1.3.2, parseurl@~1.3.3:
- version "1.3.3"
- resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4"
- integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==
-
-pascal-case@^3.1.2:
- version "3.1.2"
- resolved "https://registry.yarnpkg.com/pascal-case/-/pascal-case-3.1.2.tgz#b48e0ef2b98e205e7c1dae747d0b1508237660eb"
- integrity sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==
- dependencies:
- no-case "^3.0.4"
- tslib "^2.0.3"
-
-path-exists@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515"
- integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=
-
-path-exists@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3"
- integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==
-
-path-is-absolute@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
- integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
-
-path-is-inside@1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53"
- integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=
-
-path-key@^3.0.0, path-key@^3.1.0:
- version "3.1.1"
- resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375"
- integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==
-
-path-parse@^1.0.6:
- version "1.0.7"
- resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
- integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==
-
-path-to-regexp@0.1.7:
- version "0.1.7"
- resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c"
- integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=
-
-path-to-regexp@2.2.1:
- version "2.2.1"
- resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-2.2.1.tgz#90b617025a16381a879bc82a38d4e8bdeb2bcf45"
- integrity sha512-gu9bD6Ta5bwGrrU8muHzVOBFFREpp2iRkVfhBJahwJ6p6Xw20SjT0MxLnwkjOibQmGSYhiUnf2FLe7k+jcFmGQ==
-
-path-to-regexp@^1.7.0:
- version "1.8.0"
- resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.8.0.tgz#887b3ba9d84393e87a0a0b9f4cb756198b53548a"
- integrity sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==
- dependencies:
- isarray "0.0.1"
-
-path-type@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b"
- integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==
-
-picocolors@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c"
- integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==
-
-picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3:
- version "2.3.0"
- resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972"
- integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==
-
-pify@^4.0.1:
- version "4.0.1"
- resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231"
- integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==
-
-pkg-dir@^4.1.0:
- version "4.2.0"
- resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3"
- integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==
- dependencies:
- find-up "^4.0.0"
-
-pkg-up@^3.1.0:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-3.1.0.tgz#100ec235cc150e4fd42519412596a28512a0def5"
- integrity sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==
- dependencies:
- find-up "^3.0.0"
-
-portfinder@^1.0.28:
- version "1.0.28"
- resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.28.tgz#67c4622852bd5374dd1dd900f779f53462fac778"
- integrity sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA==
- dependencies:
- async "^2.6.2"
- debug "^3.1.1"
- mkdirp "^0.5.5"
-
-postcss-calc@^8.0.0:
- version "8.0.0"
- resolved "https://registry.yarnpkg.com/postcss-calc/-/postcss-calc-8.0.0.tgz#a05b87aacd132740a5db09462a3612453e5df90a"
- integrity sha512-5NglwDrcbiy8XXfPM11F3HeC6hoT9W7GUH/Zi5U/p7u3Irv4rHhdDcIZwG0llHXV4ftsBjpfWMXAnXNl4lnt8g==
- dependencies:
- postcss-selector-parser "^6.0.2"
- postcss-value-parser "^4.0.2"
-
-postcss-colormin@^5.2.2:
- version "5.2.2"
- resolved "https://registry.yarnpkg.com/postcss-colormin/-/postcss-colormin-5.2.2.tgz#019cd6912bef9e7e0924462c5e4ffae241e2f437"
- integrity sha512-tSEe3NpqWARUTidDlF0LntPkdlhXqfDFuA1yslqpvvGAfpZ7oBaw+/QXd935NKm2U9p4PED0HDZlzmMk7fVC6g==
- dependencies:
- browserslist "^4.16.6"
- caniuse-api "^3.0.0"
- colord "^2.9.1"
- postcss-value-parser "^4.2.0"
-
-postcss-convert-values@^5.0.2:
- version "5.0.2"
- resolved "https://registry.yarnpkg.com/postcss-convert-values/-/postcss-convert-values-5.0.2.tgz#879b849dc3677c7d6bc94b6a2c1a3f0808798059"
- integrity sha512-KQ04E2yadmfa1LqXm7UIDwW1ftxU/QWZmz6NKnHnUvJ3LEYbbcX6i329f/ig+WnEByHegulocXrECaZGLpL8Zg==
- dependencies:
- postcss-value-parser "^4.1.0"
-
-postcss-discard-comments@^5.0.1:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/postcss-discard-comments/-/postcss-discard-comments-5.0.1.tgz#9eae4b747cf760d31f2447c27f0619d5718901fe"
- integrity sha512-lgZBPTDvWrbAYY1v5GYEv8fEO/WhKOu/hmZqmCYfrpD6eyDWWzAOsl2rF29lpvziKO02Gc5GJQtlpkTmakwOWg==
-
-postcss-discard-duplicates@^5.0.1:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/postcss-discard-duplicates/-/postcss-discard-duplicates-5.0.1.tgz#68f7cc6458fe6bab2e46c9f55ae52869f680e66d"
- integrity sha512-svx747PWHKOGpAXXQkCc4k/DsWo+6bc5LsVrAsw+OU+Ibi7klFZCyX54gjYzX4TH+f2uzXjRviLARxkMurA2bA==
-
-postcss-discard-empty@^5.0.1:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/postcss-discard-empty/-/postcss-discard-empty-5.0.1.tgz#ee136c39e27d5d2ed4da0ee5ed02bc8a9f8bf6d8"
- integrity sha512-vfU8CxAQ6YpMxV2SvMcMIyF2LX1ZzWpy0lqHDsOdaKKLQVQGVP1pzhrI9JlsO65s66uQTfkQBKBD/A5gp9STFw==
-
-postcss-discard-overridden@^5.0.1:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/postcss-discard-overridden/-/postcss-discard-overridden-5.0.1.tgz#454b41f707300b98109a75005ca4ab0ff2743ac6"
- integrity sha512-Y28H7y93L2BpJhrdUR2SR2fnSsT+3TVx1NmVQLbcnZWwIUpJ7mfcTC6Za9M2PG6w8j7UQRfzxqn8jU2VwFxo3Q==
-
-postcss-discard-unused@^5.0.1:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/postcss-discard-unused/-/postcss-discard-unused-5.0.1.tgz#63e35a74a154912f93d4e75a1e6ff3cc146f934b"
- integrity sha512-tD6xR/xyZTwfhKYRw0ylfCY8wbfhrjpKAMnDKRTLMy2fNW5hl0hoV6ap5vo2JdCkuHkP3CHw72beO4Y8pzFdww==
- dependencies:
- postcss-selector-parser "^6.0.5"
-
-postcss-loader@^6.1.1:
- version "6.2.1"
- resolved "https://registry.yarnpkg.com/postcss-loader/-/postcss-loader-6.2.1.tgz#0895f7346b1702103d30fdc66e4d494a93c008ef"
- integrity sha512-WbbYpmAaKcux/P66bZ40bpWsBucjx/TTgVVzRZ9yUO8yQfVBlameJ0ZGVaPfH64hNSBh63a+ICP5nqOpBA0w+Q==
- dependencies:
- cosmiconfig "^7.0.0"
- klona "^2.0.5"
- semver "^7.3.5"
-
-postcss-merge-idents@^5.0.1:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/postcss-merge-idents/-/postcss-merge-idents-5.0.1.tgz#6b5856fc28f2571f28ecce49effb9b0e64be9437"
- integrity sha512-xu8ueVU0RszbI2gKkxR6mluupsOSSLvt8q4gA2fcKFkA+x6SlH3cb4cFHpDvcRCNFbUmCR/VUub+Y6zPOjPx+Q==
- dependencies:
- cssnano-utils "^2.0.1"
- postcss-value-parser "^4.1.0"
-
-postcss-merge-longhand@^5.0.4:
- version "5.0.4"
- resolved "https://registry.yarnpkg.com/postcss-merge-longhand/-/postcss-merge-longhand-5.0.4.tgz#41f4f3270282ea1a145ece078b7679f0cef21c32"
- integrity sha512-2lZrOVD+d81aoYkZDpWu6+3dTAAGkCKbV5DoRhnIR7KOULVrI/R7bcMjhrH9KTRy6iiHKqmtG+n/MMj1WmqHFw==
- dependencies:
- postcss-value-parser "^4.1.0"
- stylehacks "^5.0.1"
-
-postcss-merge-rules@^5.0.3:
- version "5.0.3"
- resolved "https://registry.yarnpkg.com/postcss-merge-rules/-/postcss-merge-rules-5.0.3.tgz#b5cae31f53129812a77e3eb1eeee448f8cf1a1db"
- integrity sha512-cEKTMEbWazVa5NXd8deLdCnXl+6cYG7m2am+1HzqH0EnTdy8fRysatkaXb2dEnR+fdaDxTvuZ5zoBdv6efF6hg==
- dependencies:
- browserslist "^4.16.6"
- caniuse-api "^3.0.0"
- cssnano-utils "^2.0.1"
- postcss-selector-parser "^6.0.5"
-
-postcss-minify-font-values@^5.0.1:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/postcss-minify-font-values/-/postcss-minify-font-values-5.0.1.tgz#a90cefbfdaa075bd3dbaa1b33588bb4dc268addf"
- integrity sha512-7JS4qIsnqaxk+FXY1E8dHBDmraYFWmuL6cgt0T1SWGRO5bzJf8sUoelwa4P88LEWJZweHevAiDKxHlofuvtIoA==
- dependencies:
- postcss-value-parser "^4.1.0"
-
-postcss-minify-gradients@^5.0.3:
- version "5.0.3"
- resolved "https://registry.yarnpkg.com/postcss-minify-gradients/-/postcss-minify-gradients-5.0.3.tgz#f970a11cc71e08e9095e78ec3a6b34b91c19550e"
- integrity sha512-Z91Ol22nB6XJW+5oe31+YxRsYooxOdFKcbOqY/V8Fxse1Y3vqlNRpi1cxCqoACZTQEhl+xvt4hsbWiV5R+XI9Q==
- dependencies:
- colord "^2.9.1"
- cssnano-utils "^2.0.1"
- postcss-value-parser "^4.1.0"
-
-postcss-minify-params@^5.0.2:
- version "5.0.2"
- resolved "https://registry.yarnpkg.com/postcss-minify-params/-/postcss-minify-params-5.0.2.tgz#1b644da903473fbbb18fbe07b8e239883684b85c"
- integrity sha512-qJAPuBzxO1yhLad7h2Dzk/F7n1vPyfHfCCh5grjGfjhi1ttCnq4ZXGIW77GSrEbh9Hus9Lc/e/+tB4vh3/GpDg==
- dependencies:
- alphanum-sort "^1.0.2"
- browserslist "^4.16.6"
- cssnano-utils "^2.0.1"
- postcss-value-parser "^4.1.0"
-
-postcss-minify-selectors@^5.1.0:
- version "5.1.0"
- resolved "https://registry.yarnpkg.com/postcss-minify-selectors/-/postcss-minify-selectors-5.1.0.tgz#4385c845d3979ff160291774523ffa54eafd5a54"
- integrity sha512-NzGBXDa7aPsAcijXZeagnJBKBPMYLaJJzB8CQh6ncvyl2sIndLVWfbcDi0SBjRWk5VqEjXvf8tYwzoKf4Z07og==
- dependencies:
- alphanum-sort "^1.0.2"
- postcss-selector-parser "^6.0.5"
-
-postcss-modules-extract-imports@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz#cda1f047c0ae80c97dbe28c3e76a43b88025741d"
- integrity sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw==
-
-postcss-modules-local-by-default@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.0.tgz#ebbb54fae1598eecfdf691a02b3ff3b390a5a51c"
- integrity sha512-sT7ihtmGSF9yhm6ggikHdV0hlziDTX7oFoXtuVWeDd3hHObNkcHRo9V3yg7vCAY7cONyxJC/XXCmmiHHcvX7bQ==
- dependencies:
- icss-utils "^5.0.0"
- postcss-selector-parser "^6.0.2"
- postcss-value-parser "^4.1.0"
-
-postcss-modules-scope@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/postcss-modules-scope/-/postcss-modules-scope-3.0.0.tgz#9ef3151456d3bbfa120ca44898dfca6f2fa01f06"
- integrity sha512-hncihwFA2yPath8oZ15PZqvWGkWf+XUfQgUGamS4LqoP1anQLOsOJw0vr7J7IwLpoY9fatA2qiGUGmuZL0Iqlg==
- dependencies:
- postcss-selector-parser "^6.0.4"
-
-postcss-modules-values@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz#d7c5e7e68c3bb3c9b27cbf48ca0bb3ffb4602c9c"
- integrity sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==
- dependencies:
- icss-utils "^5.0.0"
-
-postcss-normalize-charset@^5.0.1:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/postcss-normalize-charset/-/postcss-normalize-charset-5.0.1.tgz#121559d1bebc55ac8d24af37f67bd4da9efd91d0"
- integrity sha512-6J40l6LNYnBdPSk+BHZ8SF+HAkS4q2twe5jnocgd+xWpz/mx/5Sa32m3W1AA8uE8XaXN+eg8trIlfu8V9x61eg==
-
-postcss-normalize-display-values@^5.0.1:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/postcss-normalize-display-values/-/postcss-normalize-display-values-5.0.1.tgz#62650b965981a955dffee83363453db82f6ad1fd"
- integrity sha512-uupdvWk88kLDXi5HEyI9IaAJTE3/Djbcrqq8YgjvAVuzgVuqIk3SuJWUisT2gaJbZm1H9g5k2w1xXilM3x8DjQ==
- dependencies:
- cssnano-utils "^2.0.1"
- postcss-value-parser "^4.1.0"
-
-postcss-normalize-positions@^5.0.1:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/postcss-normalize-positions/-/postcss-normalize-positions-5.0.1.tgz#868f6af1795fdfa86fbbe960dceb47e5f9492fe5"
- integrity sha512-rvzWAJai5xej9yWqlCb1OWLd9JjW2Ex2BCPzUJrbaXmtKtgfL8dBMOOMTX6TnvQMtjk3ei1Lswcs78qKO1Skrg==
- dependencies:
- postcss-value-parser "^4.1.0"
-
-postcss-normalize-repeat-style@^5.0.1:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-5.0.1.tgz#cbc0de1383b57f5bb61ddd6a84653b5e8665b2b5"
- integrity sha512-syZ2itq0HTQjj4QtXZOeefomckiV5TaUO6ReIEabCh3wgDs4Mr01pkif0MeVwKyU/LHEkPJnpwFKRxqWA/7O3w==
- dependencies:
- cssnano-utils "^2.0.1"
- postcss-value-parser "^4.1.0"
-
-postcss-normalize-string@^5.0.1:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/postcss-normalize-string/-/postcss-normalize-string-5.0.1.tgz#d9eafaa4df78c7a3b973ae346ef0e47c554985b0"
- integrity sha512-Ic8GaQ3jPMVl1OEn2U//2pm93AXUcF3wz+OriskdZ1AOuYV25OdgS7w9Xu2LO5cGyhHCgn8dMXh9bO7vi3i9pA==
- dependencies:
- postcss-value-parser "^4.1.0"
-
-postcss-normalize-timing-functions@^5.0.1:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-5.0.1.tgz#8ee41103b9130429c6cbba736932b75c5e2cb08c"
- integrity sha512-cPcBdVN5OsWCNEo5hiXfLUnXfTGtSFiBU9SK8k7ii8UD7OLuznzgNRYkLZow11BkQiiqMcgPyh4ZqXEEUrtQ1Q==
- dependencies:
- cssnano-utils "^2.0.1"
- postcss-value-parser "^4.1.0"
-
-postcss-normalize-unicode@^5.0.1:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/postcss-normalize-unicode/-/postcss-normalize-unicode-5.0.1.tgz#82d672d648a411814aa5bf3ae565379ccd9f5e37"
- integrity sha512-kAtYD6V3pK0beqrU90gpCQB7g6AOfP/2KIPCVBKJM2EheVsBQmx/Iof+9zR9NFKLAx4Pr9mDhogB27pmn354nA==
- dependencies:
- browserslist "^4.16.0"
- postcss-value-parser "^4.1.0"
-
-postcss-normalize-url@^5.0.4:
- version "5.0.4"
- resolved "https://registry.yarnpkg.com/postcss-normalize-url/-/postcss-normalize-url-5.0.4.tgz#3b0322c425e31dd275174d0d5db0e466f50810fb"
- integrity sha512-cNj3RzK2pgQQyNp7dzq0dqpUpQ/wYtdDZM3DepPmFjCmYIfceuD9VIAcOdvrNetjIU65g1B4uwdP/Krf6AFdXg==
- dependencies:
- normalize-url "^6.0.1"
- postcss-value-parser "^4.2.0"
-
-postcss-normalize-whitespace@^5.0.1:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/postcss-normalize-whitespace/-/postcss-normalize-whitespace-5.0.1.tgz#b0b40b5bcac83585ff07ead2daf2dcfbeeef8e9a"
- integrity sha512-iPklmI5SBnRvwceb/XH568yyzK0qRVuAG+a1HFUsFRf11lEJTiQQa03a4RSCQvLKdcpX7XsI1Gen9LuLoqwiqA==
- dependencies:
- postcss-value-parser "^4.1.0"
-
-postcss-ordered-values@^5.0.2:
- version "5.0.2"
- resolved "https://registry.yarnpkg.com/postcss-ordered-values/-/postcss-ordered-values-5.0.2.tgz#1f351426977be00e0f765b3164ad753dac8ed044"
- integrity sha512-8AFYDSOYWebJYLyJi3fyjl6CqMEG/UVworjiyK1r573I56kb3e879sCJLGvR3merj+fAdPpVplXKQZv+ey6CgQ==
- dependencies:
- cssnano-utils "^2.0.1"
- postcss-value-parser "^4.1.0"
-
-postcss-reduce-idents@^5.0.1:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/postcss-reduce-idents/-/postcss-reduce-idents-5.0.1.tgz#99b49ce8ee6f9c179447671cc9693e198e877bb7"
- integrity sha512-6Rw8iIVFbqtaZExgWK1rpVgP7DPFRPh0DDFZxJ/ADNqPiH10sPCoq5tgo6kLiTyfh9sxjKYjXdc8udLEcPOezg==
- dependencies:
- postcss-value-parser "^4.1.0"
-
-postcss-reduce-initial@^5.0.2:
- version "5.0.2"
- resolved "https://registry.yarnpkg.com/postcss-reduce-initial/-/postcss-reduce-initial-5.0.2.tgz#fa424ce8aa88a89bc0b6d0f94871b24abe94c048"
- integrity sha512-v/kbAAQ+S1V5v9TJvbGkV98V2ERPdU6XvMcKMjqAlYiJ2NtsHGlKYLPjWWcXlaTKNxooId7BGxeraK8qXvzKtw==
- dependencies:
- browserslist "^4.16.6"
- caniuse-api "^3.0.0"
-
-postcss-reduce-transforms@^5.0.1:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/postcss-reduce-transforms/-/postcss-reduce-transforms-5.0.1.tgz#93c12f6a159474aa711d5269923e2383cedcf640"
- integrity sha512-a//FjoPeFkRuAguPscTVmRQUODP+f3ke2HqFNgGPwdYnpeC29RZdCBvGRGTsKpMURb/I3p6jdKoBQ2zI+9Q7kA==
- dependencies:
- cssnano-utils "^2.0.1"
- postcss-value-parser "^4.1.0"
-
-postcss-selector-parser@^6.0.2, postcss-selector-parser@^6.0.4, postcss-selector-parser@^6.0.5:
- version "6.0.8"
- resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.8.tgz#f023ed7a9ea736cd7ef70342996e8e78645a7914"
- integrity sha512-D5PG53d209Z1Uhcc0qAZ5U3t5HagH3cxu+WLZ22jt3gLUpXM4eXXfiO14jiDWST3NNooX/E8wISfOhZ9eIjGTQ==
- dependencies:
- cssesc "^3.0.0"
- util-deprecate "^1.0.2"
-
-postcss-sort-media-queries@^4.1.0:
- version "4.2.1"
- resolved "https://registry.yarnpkg.com/postcss-sort-media-queries/-/postcss-sort-media-queries-4.2.1.tgz#a99bae69ef1098ee3b64a5fa94d258ec240d0355"
- integrity sha512-9VYekQalFZ3sdgcTjXMa0dDjsfBVHXlraYJEMiOJ/2iMmI2JGCMavP16z3kWOaRu8NSaJCTgVpB/IVpH5yT9YQ==
- dependencies:
- sort-css-media-queries "2.0.4"
-
-postcss-svgo@^5.0.3:
- version "5.0.3"
- resolved "https://registry.yarnpkg.com/postcss-svgo/-/postcss-svgo-5.0.3.tgz#d945185756e5dfaae07f9edb0d3cae7ff79f9b30"
- integrity sha512-41XZUA1wNDAZrQ3XgWREL/M2zSw8LJPvb5ZWivljBsUQAGoEKMYm6okHsTjJxKYI4M75RQEH4KYlEM52VwdXVA==
- dependencies:
- postcss-value-parser "^4.1.0"
- svgo "^2.7.0"
-
-postcss-unique-selectors@^5.0.2:
- version "5.0.2"
- resolved "https://registry.yarnpkg.com/postcss-unique-selectors/-/postcss-unique-selectors-5.0.2.tgz#5d6893daf534ae52626708e0d62250890108c0c1"
- integrity sha512-w3zBVlrtZm7loQWRPVC0yjUwwpty7OM6DnEHkxcSQXO1bMS3RJ+JUS5LFMSDZHJcvGsRwhZinCWVqn8Kej4EDA==
- dependencies:
- alphanum-sort "^1.0.2"
- postcss-selector-parser "^6.0.5"
-
-postcss-value-parser@^4.0.2, postcss-value-parser@^4.1.0, postcss-value-parser@^4.2.0:
- version "4.2.0"
- resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514"
- integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==
-
-postcss-zindex@^5.0.1:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/postcss-zindex/-/postcss-zindex-5.0.1.tgz#c585724beb69d356af8c7e68847b28d6298ece03"
- integrity sha512-nwgtJJys+XmmSGoYCcgkf/VczP8Mp/0OfSv3v0+fw0uABY4yxw+eFs0Xp9nAZHIKnS5j+e9ywQ+RD+ONyvl5pA==
-
-postcss@^8.2.15, postcss@^8.3.11, postcss@^8.3.5, postcss@^8.3.7:
- version "8.4.5"
- resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.5.tgz#bae665764dfd4c6fcc24dc0fdf7e7aa00cc77f95"
- integrity sha512-jBDboWM8qpaqwkMwItqTQTiFikhs/67OYVvblFFTM7MrZjt6yMKd6r2kgXizEbTTljacm4NldIlZnhbjr84QYg==
- dependencies:
- nanoid "^3.1.30"
- picocolors "^1.0.0"
- source-map-js "^1.0.1"
-
-prepend-http@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897"
- integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=
-
-pretty-error@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-4.0.0.tgz#90a703f46dd7234adb46d0f84823e9d1cb8f10d6"
- integrity sha512-AoJ5YMAcXKYxKhuJGdcvse+Voc6v1RgnsR3nWcYU7q4t6z0Q6T86sv5Zq8VIRbOWWFpvdGE83LtdSMNd+6Y0xw==
- dependencies:
- lodash "^4.17.20"
- renderkid "^3.0.0"
-
-pretty-time@^1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/pretty-time/-/pretty-time-1.1.0.tgz#ffb7429afabb8535c346a34e41873adf3d74dd0e"
- integrity sha512-28iF6xPQrP8Oa6uxE6a1biz+lWeTOAPKggvjB8HAs6nVMKZwf5bG++632Dx614hIWgUPkgivRfG+a8uAXGTIbA==
-
-prism-react-renderer@^1.2.1:
- version "1.2.1"
- resolved "https://registry.yarnpkg.com/prism-react-renderer/-/prism-react-renderer-1.2.1.tgz#392460acf63540960e5e3caa699d851264e99b89"
- integrity sha512-w23ch4f75V1Tnz8DajsYKvY5lF7H1+WvzvLUcF0paFxkTHSp42RS0H5CttdN2Q8RR3DRGZ9v5xD/h3n8C8kGmg==
-
-prismjs@^1.23.0:
- version "1.25.0"
- resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.25.0.tgz#6f822df1bdad965734b310b315a23315cf999756"
- integrity sha512-WCjJHl1KEWbnkQom1+SzftbtXMKQoezOCYs5rECqMN+jP+apI7ftoflyqigqzopSO3hMhTEb0mFClA8lkolgEg==
-
-process-nextick-args@~2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
- integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==
-
-promise@^7.1.1:
- version "7.3.1"
- resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf"
- integrity sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==
- dependencies:
- asap "~2.0.3"
-
-prompts@^2.4.0, prompts@^2.4.1:
- version "2.4.2"
- resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069"
- integrity sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==
- dependencies:
- kleur "^3.0.3"
- sisteransi "^1.0.5"
-
-prop-types@^15.6.2, prop-types@^15.7.2:
- version "15.8.0"
- resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.0.tgz#d237e624c45a9846e469f5f31117f970017ff588"
- integrity sha512-fDGekdaHh65eI3lMi5OnErU6a8Ighg2KjcjQxO7m8VHyWjcPyj5kiOgV1LQDOOOgVy3+5FgjXvdSSX7B8/5/4g==
- dependencies:
- loose-envify "^1.4.0"
- object-assign "^4.1.1"
- react-is "^16.13.1"
-
-property-information@^5.0.0, property-information@^5.3.0:
- version "5.6.0"
- resolved "https://registry.yarnpkg.com/property-information/-/property-information-5.6.0.tgz#61675545fb23002f245c6540ec46077d4da3ed69"
- integrity sha512-YUHSPk+A30YPv+0Qf8i9Mbfe/C0hdPXk1s1jPVToV8pk8BQtpw10ct89Eo7OWkutrwqvT0eicAxlOg3dOAu8JA==
- dependencies:
- xtend "^4.0.0"
-
-proxy-addr@~2.0.7:
- version "2.0.7"
- resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025"
- integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==
- dependencies:
- forwarded "0.2.0"
- ipaddr.js "1.9.1"
-
-pump@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64"
- integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==
- dependencies:
- end-of-stream "^1.1.0"
- once "^1.3.1"
-
-punycode@1.3.2:
- version "1.3.2"
- resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d"
- integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=
-
-punycode@^1.3.2:
- version "1.4.1"
- resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
- integrity sha1-wNWmOycYgArY4esPpSachN1BhF4=
-
-punycode@^2.1.0:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
- integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
-
-pupa@^2.1.1:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/pupa/-/pupa-2.1.1.tgz#f5e8fd4afc2c5d97828faa523549ed8744a20d62"
- integrity sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A==
- dependencies:
- escape-goat "^2.0.0"
-
-pure-color@^1.2.0:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/pure-color/-/pure-color-1.3.0.tgz#1fe064fb0ac851f0de61320a8bf796836422f33e"
- integrity sha1-H+Bk+wrIUfDeYTIKi/eWg2Qi8z4=
-
-qs@6.9.6:
- version "6.9.6"
- resolved "https://registry.yarnpkg.com/qs/-/qs-6.9.6.tgz#26ed3c8243a431b2924aca84cc90471f35d5a0ee"
- integrity sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ==
-
-querystring@0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620"
- integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=
-
-queue-microtask@^1.2.2:
- version "1.2.3"
- resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243"
- integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==
-
-randombytes@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a"
- integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==
- dependencies:
- safe-buffer "^5.1.0"
-
-range-parser@1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e"
- integrity sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=
-
-range-parser@^1.2.1, range-parser@~1.2.1:
- version "1.2.1"
- resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031"
- integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==
-
-raw-body@2.4.2:
- version "2.4.2"
- resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.2.tgz#baf3e9c21eebced59dd6533ac872b71f7b61cb32"
- integrity sha512-RPMAFUJP19WIet/99ngh6Iv8fzAbqum4Li7AD6DtGaW2RpMB/11xDoalPiJMTbu6I3hkbMVkATvZrqb9EEqeeQ==
- dependencies:
- bytes "3.1.1"
- http-errors "1.8.1"
- iconv-lite "0.4.24"
- unpipe "1.0.0"
-
-rc@^1.2.8:
- version "1.2.8"
- resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed"
- integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==
- dependencies:
- deep-extend "^0.6.0"
- ini "~1.3.0"
- minimist "^1.2.0"
- strip-json-comments "~2.0.1"
-
-react-base16-styling@^0.6.0:
- version "0.6.0"
- resolved "https://registry.yarnpkg.com/react-base16-styling/-/react-base16-styling-0.6.0.tgz#ef2156d66cf4139695c8a167886cb69ea660792c"
- integrity sha1-7yFW1mz0E5aVyKFniGy2nqZgeSw=
- dependencies:
- base16 "^1.0.0"
- lodash.curry "^4.0.1"
- lodash.flow "^3.3.0"
- pure-color "^1.2.0"
-
-react-dev-utils@12.0.0-next.47:
- version "12.0.0-next.47"
- resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-12.0.0-next.47.tgz#e55c31a05eb30cfd69ca516e8b87d61724e880fb"
- integrity sha512-PsE71vP15TZMmp/RZKOJC4fYD5Pvt0+wCoyG3QHclto0d4FyIJI78xGRICOOThZFROqgXYlZP6ddmeybm+jO4w==
- dependencies:
- "@babel/code-frame" "^7.10.4"
- address "^1.1.2"
- browserslist "^4.16.5"
- chalk "^2.4.2"
- cross-spawn "^7.0.3"
- detect-port-alt "^1.1.6"
- escape-string-regexp "^2.0.0"
- filesize "^6.1.0"
- find-up "^4.1.0"
- fork-ts-checker-webpack-plugin "^6.0.5"
- global-modules "^2.0.0"
- globby "^11.0.1"
- gzip-size "^5.1.1"
- immer "^9.0.6"
- is-root "^2.1.0"
- loader-utils "^2.0.0"
- open "^7.0.2"
- pkg-up "^3.1.0"
- prompts "^2.4.0"
- react-error-overlay "7.0.0-next.54+1465357b"
- recursive-readdir "^2.2.2"
- shell-quote "^1.7.2"
- strip-ansi "^6.0.0"
- text-table "^0.2.0"
-
-react-dom@^17.0.1:
- version "17.0.2"
- resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23"
- integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==
- dependencies:
- loose-envify "^1.1.0"
- object-assign "^4.1.1"
- scheduler "^0.20.2"
-
-react-error-overlay@7.0.0-next.54+1465357b:
- version "7.0.0-next.54"
- resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-7.0.0-next.54.tgz#c1eb5ab86aee15e9552e6d97897b08f2bd06d140"
- integrity sha512-b96CiTnZahXPDNH9MKplvt5+jD+BkxDw7q5R3jnkUXze/ux1pLv32BBZmlj0OfCUeMqyz4sAmF+0ccJGVMlpXw==
-
-react-error-overlay@^6.0.9:
- version "6.0.10"
- resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.10.tgz#0fe26db4fa85d9dbb8624729580e90e7159a59a6"
- integrity sha512-mKR90fX7Pm5seCOfz8q9F+66VCc1PGsWSBxKbITjfKVQHMNF2zudxHnMdJiB1fRCb+XsbQV9sO9DCkgsMQgBIA==
-
-react-fast-compare@^3.1.1:
- version "3.2.0"
- resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.0.tgz#641a9da81b6a6320f270e89724fb45a0b39e43bb"
- integrity sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA==
-
-react-helmet@^6.1.0:
- version "6.1.0"
- resolved "https://registry.yarnpkg.com/react-helmet/-/react-helmet-6.1.0.tgz#a750d5165cb13cf213e44747502652e794468726"
- integrity sha512-4uMzEY9nlDlgxr61NL3XbKRy1hEkXmKNXhjbAIOVw5vcFrsdYbH2FEwcNyWvWinl103nXgzYNlns9ca+8kFiWw==
- dependencies:
- object-assign "^4.1.1"
- prop-types "^15.7.2"
- react-fast-compare "^3.1.1"
- react-side-effect "^2.1.0"
-
-react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0:
- version "16.13.1"
- resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
- integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
-
-react-json-view@^1.21.3:
- version "1.21.3"
- resolved "https://registry.yarnpkg.com/react-json-view/-/react-json-view-1.21.3.tgz#f184209ee8f1bf374fb0c41b0813cff54549c475"
- integrity sha512-13p8IREj9/x/Ye4WI/JpjhoIwuzEgUAtgJZNBJckfzJt1qyh24BdTm6UQNGnyTq9dapQdrqvquZTo3dz1X6Cjw==
- dependencies:
- flux "^4.0.1"
- react-base16-styling "^0.6.0"
- react-lifecycles-compat "^3.0.4"
- react-textarea-autosize "^8.3.2"
-
-react-lifecycles-compat@^3.0.4:
- version "3.0.4"
- resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362"
- integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==
-
-react-loadable-ssr-addon-v5-slorber@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/react-loadable-ssr-addon-v5-slorber/-/react-loadable-ssr-addon-v5-slorber-1.0.1.tgz#2cdc91e8a744ffdf9e3556caabeb6e4278689883"
- integrity sha512-lq3Lyw1lGku8zUEJPDxsNm1AfYHBrO9Y1+olAYwpUJ2IGFBskM0DMKok97A6LWUpHm+o7IvQBOWu9MLenp9Z+A==
- dependencies:
- "@babel/runtime" "^7.10.3"
-
-react-router-config@^5.1.1:
- version "5.1.1"
- resolved "https://registry.yarnpkg.com/react-router-config/-/react-router-config-5.1.1.tgz#0f4263d1a80c6b2dc7b9c1902c9526478194a988"
- integrity sha512-DuanZjaD8mQp1ppHjgnnUnyOlqYXZVjnov/JzFhjLEwd3Z4dYjMSnqrEzzGThH47vpCOqPPwJM2FtthLeJ8Pbg==
- dependencies:
- "@babel/runtime" "^7.1.2"
-
-react-router-dom@^5.2.0:
- version "5.3.0"
- resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-5.3.0.tgz#da1bfb535a0e89a712a93b97dd76f47ad1f32363"
- integrity sha512-ObVBLjUZsphUUMVycibxgMdh5jJ1e3o+KpAZBVeHcNQZ4W+uUGGWsokurzlF4YOldQYRQL4y6yFRWM4m3svmuQ==
- dependencies:
- "@babel/runtime" "^7.12.13"
- history "^4.9.0"
- loose-envify "^1.3.1"
- prop-types "^15.6.2"
- react-router "5.2.1"
- tiny-invariant "^1.0.2"
- tiny-warning "^1.0.0"
-
-react-router@5.2.1, react-router@^5.2.0:
- version "5.2.1"
- resolved "https://registry.yarnpkg.com/react-router/-/react-router-5.2.1.tgz#4d2e4e9d5ae9425091845b8dbc6d9d276239774d"
- integrity sha512-lIboRiOtDLFdg1VTemMwud9vRVuOCZmUIT/7lUoZiSpPODiiH1UQlfXy+vPLC/7IWdFYnhRwAyNqA/+I7wnvKQ==
- dependencies:
- "@babel/runtime" "^7.12.13"
- history "^4.9.0"
- hoist-non-react-statics "^3.1.0"
- loose-envify "^1.3.1"
- mini-create-react-context "^0.4.0"
- path-to-regexp "^1.7.0"
- prop-types "^15.6.2"
- react-is "^16.6.0"
- tiny-invariant "^1.0.2"
- tiny-warning "^1.0.0"
-
-react-side-effect@^2.1.0:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/react-side-effect/-/react-side-effect-2.1.1.tgz#66c5701c3e7560ab4822a4ee2742dee215d72eb3"
- integrity sha512-2FoTQzRNTncBVtnzxFOk2mCpcfxQpenBMbk5kSVBg5UcPqV9fRbgY2zhb7GTWWOlpFmAxhClBDlIq8Rsubz1yQ==
-
-react-textarea-autosize@^8.3.2:
- version "8.3.3"
- resolved "https://registry.yarnpkg.com/react-textarea-autosize/-/react-textarea-autosize-8.3.3.tgz#f70913945369da453fd554c168f6baacd1fa04d8"
- integrity sha512-2XlHXK2TDxS6vbQaoPbMOfQ8GK7+irc2fVK6QFIcC8GOnH3zI/v481n+j1L0WaPVvKxwesnY93fEfH++sus2rQ==
- dependencies:
- "@babel/runtime" "^7.10.2"
- use-composed-ref "^1.0.0"
- use-latest "^1.0.0"
-
-react@^17.0.1:
- version "17.0.2"
- resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037"
- integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==
- dependencies:
- loose-envify "^1.1.0"
- object-assign "^4.1.1"
-
-readable-stream@^2.0.1:
- version "2.3.7"
- resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57"
- integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==
- dependencies:
- core-util-is "~1.0.0"
- inherits "~2.0.3"
- isarray "~1.0.0"
- process-nextick-args "~2.0.0"
- safe-buffer "~5.1.1"
- string_decoder "~1.1.1"
- util-deprecate "~1.0.1"
-
-readable-stream@^3.0.6, readable-stream@^3.1.1:
- version "3.6.0"
- resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198"
- integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==
- dependencies:
- inherits "^2.0.3"
- string_decoder "^1.1.1"
- util-deprecate "^1.0.1"
-
-readdirp@~3.6.0:
- version "3.6.0"
- resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7"
- integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==
- dependencies:
- picomatch "^2.2.1"
-
-reading-time@^1.5.0:
- version "1.5.0"
- resolved "https://registry.yarnpkg.com/reading-time/-/reading-time-1.5.0.tgz#d2a7f1b6057cb2e169beaf87113cc3411b5bc5bb"
- integrity sha512-onYyVhBNr4CmAxFsKS7bz+uTLRakypIe4R+5A824vBSkQy/hB3fZepoVEf8OVAxzLvK+H/jm9TzpI3ETSm64Kg==
-
-rechoir@^0.6.2:
- version "0.6.2"
- resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384"
- integrity sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=
- dependencies:
- resolve "^1.1.6"
-
-recursive-readdir@^2.2.2:
- version "2.2.2"
- resolved "https://registry.yarnpkg.com/recursive-readdir/-/recursive-readdir-2.2.2.tgz#9946fb3274e1628de6e36b2f6714953b4845094f"
- integrity sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg==
- dependencies:
- minimatch "3.0.4"
-
-regenerate-unicode-properties@^9.0.0:
- version "9.0.0"
- resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-9.0.0.tgz#54d09c7115e1f53dc2314a974b32c1c344efe326"
- integrity sha512-3E12UeNSPfjrgwjkR81m5J7Aw/T55Tu7nUyZVQYCKEOs+2dkxEY+DpPtZzO4YruuiPb7NkYLVcyJC4+zCbk5pA==
- dependencies:
- regenerate "^1.4.2"
-
-regenerate@^1.4.2:
- version "1.4.2"
- resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a"
- integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==
-
-regenerator-runtime@^0.13.4:
- version "0.13.9"
- resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52"
- integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==
-
-regenerator-transform@^0.14.2:
- version "0.14.5"
- resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.14.5.tgz#c98da154683671c9c4dcb16ece736517e1b7feb4"
- integrity sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw==
- dependencies:
- "@babel/runtime" "^7.8.4"
-
-regexp.prototype.flags@^1.2.0:
- version "1.3.1"
- resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.3.1.tgz#7ef352ae8d159e758c0eadca6f8fcb4eef07be26"
- integrity sha512-JiBdRBq91WlY7uRJ0ds7R+dU02i6LKi8r3BuQhNXn+kmeLN+EfHhfjqMRis1zJxnlu88hq/4dx0P2OP3APRTOA==
- dependencies:
- call-bind "^1.0.2"
- define-properties "^1.1.3"
-
-regexpu-core@^4.5.4, regexpu-core@^4.7.1:
- version "4.8.0"
- resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.8.0.tgz#e5605ba361b67b1718478501327502f4479a98f0"
- integrity sha512-1F6bYsoYiz6is+oz70NWur2Vlh9KWtswuRuzJOfeYUrfPX2o8n74AnUVaOGDbUqVGO9fNHu48/pjJO4sNVwsOg==
- dependencies:
- regenerate "^1.4.2"
- regenerate-unicode-properties "^9.0.0"
- regjsgen "^0.5.2"
- regjsparser "^0.7.0"
- unicode-match-property-ecmascript "^2.0.0"
- unicode-match-property-value-ecmascript "^2.0.0"
-
-registry-auth-token@^4.0.0:
- version "4.2.1"
- resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-4.2.1.tgz#6d7b4006441918972ccd5fedcd41dc322c79b250"
- integrity sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw==
- dependencies:
- rc "^1.2.8"
-
-registry-url@^5.0.0:
- version "5.1.0"
- resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-5.1.0.tgz#e98334b50d5434b81136b44ec638d9c2009c5009"
- integrity sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==
- dependencies:
- rc "^1.2.8"
-
-regjsgen@^0.5.2:
- version "0.5.2"
- resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.5.2.tgz#92ff295fb1deecbf6ecdab2543d207e91aa33733"
- integrity sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==
-
-regjsparser@^0.7.0:
- version "0.7.0"
- resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.7.0.tgz#a6b667b54c885e18b52554cb4960ef71187e9968"
- integrity sha512-A4pcaORqmNMDVwUjWoTzuhwMGpP+NykpfqAsEgI1FSH/EzC7lrN5TMd+kN8YCovX+jMpu8eaqXgXPCa0g8FQNQ==
- dependencies:
- jsesc "~0.5.0"
-
-rehype-parse@^6.0.2:
- version "6.0.2"
- resolved "https://registry.yarnpkg.com/rehype-parse/-/rehype-parse-6.0.2.tgz#aeb3fdd68085f9f796f1d3137ae2b85a98406964"
- integrity sha512-0S3CpvpTAgGmnz8kiCyFLGuW5yA4OQhyNTm/nwPopZ7+PI11WnGl1TTWTGv/2hPEe/g2jRLlhVVSsoDH8waRug==
- dependencies:
- hast-util-from-parse5 "^5.0.0"
- parse5 "^5.0.0"
- xtend "^4.0.0"
-
-relateurl@^0.2.7:
- version "0.2.7"
- resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9"
- integrity sha1-VNvzd+UUQKypCkzSdGANP/LYiKk=
-
-remark-admonitions@^1.2.1:
- version "1.2.1"
- resolved "https://registry.yarnpkg.com/remark-admonitions/-/remark-admonitions-1.2.1.tgz#87caa1a442aa7b4c0cafa04798ed58a342307870"
- integrity sha512-Ji6p68VDvD+H1oS95Fdx9Ar5WA2wcDA4kwrrhVU7fGctC6+d3uiMICu7w7/2Xld+lnU7/gi+432+rRbup5S8ow==
- dependencies:
- rehype-parse "^6.0.2"
- unified "^8.4.2"
- unist-util-visit "^2.0.1"
-
-remark-emoji@^2.1.0:
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/remark-emoji/-/remark-emoji-2.2.0.tgz#1c702090a1525da5b80e15a8f963ef2c8236cac7"
- integrity sha512-P3cj9s5ggsUvWw5fS2uzCHJMGuXYRb0NnZqYlNecewXt8QBU9n5vW3DUUKOhepS8F9CwdMx9B8a3i7pqFWAI5w==
- dependencies:
- emoticon "^3.2.0"
- node-emoji "^1.10.0"
- unist-util-visit "^2.0.3"
-
-remark-footnotes@2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/remark-footnotes/-/remark-footnotes-2.0.0.tgz#9001c4c2ffebba55695d2dd80ffb8b82f7e6303f"
- integrity sha512-3Clt8ZMH75Ayjp9q4CorNeyjwIxHFcTkaektplKGl2A1jNGEUey8cKL0ZC5vJwfcD5GFGsNLImLG/NGzWIzoMQ==
-
-remark-mdx-remove-exports@^1.6.22:
- version "1.6.22"
- resolved "https://registry.yarnpkg.com/remark-mdx-remove-exports/-/remark-mdx-remove-exports-1.6.22.tgz#9e34f3d02c9c54b02ca0a1fde946449338d06ecb"
- integrity sha512-7g2uiTmTGfz5QyVb+toeX25frbk1Y6yd03RXGPtqx0+DVh86Gb7MkNYbk7H2X27zdZ3CQv1W/JqlFO0Oo8IxVA==
- dependencies:
- unist-util-remove "2.0.0"
-
-remark-mdx-remove-imports@^1.6.22:
- version "1.6.22"
- resolved "https://registry.yarnpkg.com/remark-mdx-remove-imports/-/remark-mdx-remove-imports-1.6.22.tgz#79f711c95359cff437a120d1fbdc1326ec455826"
- integrity sha512-lmjAXD8Ltw0TsvBzb45S+Dxx7LTJAtDaMneMAv8LAUIPEyYoKkmGbmVsiF0/pY6mhM1Q16swCmu1TN+ie/vn/A==
- dependencies:
- unist-util-remove "2.0.0"
-
-remark-mdx@1.6.22:
- version "1.6.22"
- resolved "https://registry.yarnpkg.com/remark-mdx/-/remark-mdx-1.6.22.tgz#06a8dab07dcfdd57f3373af7f86bd0e992108bbd"
- integrity sha512-phMHBJgeV76uyFkH4rvzCftLfKCr2RZuF+/gmVcaKrpsihyzmhXjA0BEMDaPTXG5y8qZOKPVo83NAOX01LPnOQ==
- dependencies:
- "@babel/core" "7.12.9"
- "@babel/helper-plugin-utils" "7.10.4"
- "@babel/plugin-proposal-object-rest-spread" "7.12.1"
- "@babel/plugin-syntax-jsx" "7.12.1"
- "@mdx-js/util" "1.6.22"
- is-alphabetical "1.0.4"
- remark-parse "8.0.3"
- unified "9.2.0"
-
-remark-parse@8.0.3:
- version "8.0.3"
- resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-8.0.3.tgz#9c62aa3b35b79a486454c690472906075f40c7e1"
- integrity sha512-E1K9+QLGgggHxCQtLt++uXltxEprmWzNfg+MxpfHsZlrddKzZ/hZyWHDbK3/Ap8HJQqYJRXP+jHczdL6q6i85Q==
- dependencies:
- ccount "^1.0.0"
- collapse-white-space "^1.0.2"
- is-alphabetical "^1.0.0"
- is-decimal "^1.0.0"
- is-whitespace-character "^1.0.0"
- is-word-character "^1.0.0"
- markdown-escapes "^1.0.0"
- parse-entities "^2.0.0"
- repeat-string "^1.5.4"
- state-toggle "^1.0.0"
- trim "0.0.1"
- trim-trailing-lines "^1.0.0"
- unherit "^1.0.4"
- unist-util-remove-position "^2.0.0"
- vfile-location "^3.0.0"
- xtend "^4.0.1"
-
-remark-squeeze-paragraphs@4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/remark-squeeze-paragraphs/-/remark-squeeze-paragraphs-4.0.0.tgz#76eb0e085295131c84748c8e43810159c5653ead"
- integrity sha512-8qRqmL9F4nuLPIgl92XUuxI3pFxize+F1H0e/W3llTk0UsjJaj01+RrirkMw7P21RKe4X6goQhYRSvNWX+70Rw==
- dependencies:
- mdast-squeeze-paragraphs "^4.0.0"
-
-renderkid@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/renderkid/-/renderkid-3.0.0.tgz#5fd823e4d6951d37358ecc9a58b1f06836b6268a"
- integrity sha512-q/7VIQA8lmM1hF+jn+sFSPWGlMkSAeNYcPLmDQx2zzuiDfaLrOmumR8iaUKlenFgh0XRPIUeSPlH3A+AW3Z5pg==
- dependencies:
- css-select "^4.1.3"
- dom-converter "^0.2.0"
- htmlparser2 "^6.1.0"
- lodash "^4.17.21"
- strip-ansi "^6.0.1"
-
-repeat-string@^1.5.4:
- version "1.6.1"
- resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637"
- integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc=
-
-require-from-string@^2.0.2:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909"
- integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==
-
-"require-like@>= 0.1.1":
- version "0.1.2"
- resolved "https://registry.yarnpkg.com/require-like/-/require-like-0.1.2.tgz#ad6f30c13becd797010c468afa775c0c0a6b47fa"
- integrity sha1-rW8wwTvs15cBDEaK+ndcDAprR/o=
-
-requires-port@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
- integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=
-
-resolve-from@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6"
- integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==
-
-resolve-pathname@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/resolve-pathname/-/resolve-pathname-3.0.0.tgz#99d02224d3cf263689becbb393bc560313025dcd"
- integrity sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==
-
-resolve@^1.1.6, resolve@^1.14.2, resolve@^1.3.2:
- version "1.20.0"
- resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975"
- integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==
- dependencies:
- is-core-module "^2.2.0"
- path-parse "^1.0.6"
-
-responselike@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7"
- integrity sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=
- dependencies:
- lowercase-keys "^1.0.0"
-
-retry@^0.13.1:
- version "0.13.1"
- resolved "https://registry.yarnpkg.com/retry/-/retry-0.13.1.tgz#185b1587acf67919d63b357349e03537b2484658"
- integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==
-
-reusify@^1.0.4:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76"
- integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==
-
-rimraf@^3.0.2:
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a"
- integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==
- dependencies:
- glob "^7.1.3"
-
-rtl-detect@^1.0.4:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/rtl-detect/-/rtl-detect-1.0.4.tgz#40ae0ea7302a150b96bc75af7d749607392ecac6"
- integrity sha512-EBR4I2VDSSYr7PkBmFy04uhycIpDKp+21p/jARYXlCSjQksTBQcJ0HFUPOO79EPPH5JS6VAhiIQbycf0O3JAxQ==
-
-rtlcss@^3.3.0:
- version "3.5.0"
- resolved "https://registry.yarnpkg.com/rtlcss/-/rtlcss-3.5.0.tgz#c9eb91269827a102bac7ae3115dd5d049de636c3"
- integrity sha512-wzgMaMFHQTnyi9YOwsx9LjOxYXJPzS8sYnFaKm6R5ysvTkwzHiB0vxnbHwchHQT65PTdBjDG21/kQBWI7q9O7A==
- dependencies:
- find-up "^5.0.0"
- picocolors "^1.0.0"
- postcss "^8.3.11"
- strip-json-comments "^3.1.1"
-
-run-parallel@^1.1.9:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee"
- integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==
- dependencies:
- queue-microtask "^1.2.2"
-
-rxjs@^7.1.0:
- version "7.4.0"
- resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.4.0.tgz#a12a44d7eebf016f5ff2441b87f28c9a51cebc68"
- integrity sha512-7SQDi7xeTMCJpqViXh8gL/lebcwlp3d831F05+9B44A4B0WfsEwUQHR64gsH1kvJ+Ep/J9K2+n1hVl1CsGN23w==
- dependencies:
- tslib "~2.1.0"
-
-safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
- version "5.1.2"
- resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
- integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
-
-safe-buffer@5.2.1, safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@~5.2.0:
- version "5.2.1"
- resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
- integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
-
-"safer-buffer@>= 2.1.2 < 3":
- version "2.1.2"
- resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
- integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
-
-sax@^1.2.4:
- version "1.2.4"
- resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
- integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==
-
-scheduler@^0.20.2:
- version "0.20.2"
- resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91"
- integrity sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==
- dependencies:
- loose-envify "^1.1.0"
- object-assign "^4.1.1"
-
-schema-utils@2.7.0:
- version "2.7.0"
- resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.7.0.tgz#17151f76d8eae67fbbf77960c33c676ad9f4efc7"
- integrity sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==
- dependencies:
- "@types/json-schema" "^7.0.4"
- ajv "^6.12.2"
- ajv-keywords "^3.4.1"
-
-schema-utils@^2.6.5:
- version "2.7.1"
- resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.7.1.tgz#1ca4f32d1b24c590c203b8e7a50bf0ea4cd394d7"
- integrity sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==
- dependencies:
- "@types/json-schema" "^7.0.5"
- ajv "^6.12.4"
- ajv-keywords "^3.5.2"
-
-schema-utils@^3.0.0, schema-utils@^3.1.0, schema-utils@^3.1.1:
- version "3.1.1"
- resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.1.1.tgz#bc74c4b6b6995c1d88f76a8b77bea7219e0c8281"
- integrity sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==
- dependencies:
- "@types/json-schema" "^7.0.8"
- ajv "^6.12.5"
- ajv-keywords "^3.5.2"
-
-schema-utils@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.0.0.tgz#60331e9e3ae78ec5d16353c467c34b3a0a1d3df7"
- integrity sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg==
- dependencies:
- "@types/json-schema" "^7.0.9"
- ajv "^8.8.0"
- ajv-formats "^2.1.1"
- ajv-keywords "^5.0.0"
-
-section-matter@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/section-matter/-/section-matter-1.0.0.tgz#e9041953506780ec01d59f292a19c7b850b84167"
- integrity sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==
- dependencies:
- extend-shallow "^2.0.1"
- kind-of "^6.0.0"
-
-select-hose@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca"
- integrity sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo=
-
-selfsigned@^1.10.11:
- version "1.10.11"
- resolved "https://registry.yarnpkg.com/selfsigned/-/selfsigned-1.10.11.tgz#24929cd906fe0f44b6d01fb23999a739537acbe9"
- integrity sha512-aVmbPOfViZqOZPgRBT0+3u4yZFHpmnIghLMlAcb5/xhp5ZtB/RVnKhz5vl2M32CLXAqR4kha9zfhNg0Lf/sxKA==
- dependencies:
- node-forge "^0.10.0"
-
-semver-diff@^3.1.1:
- version "3.1.1"
- resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-3.1.1.tgz#05f77ce59f325e00e2706afd67bb506ddb1ca32b"
- integrity sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==
- dependencies:
- semver "^6.3.0"
-
-semver@7.0.0:
- version "7.0.0"
- resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e"
- integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==
-
-semver@^5.4.1:
- version "5.7.1"
- resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
- integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
-
-semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0:
- version "6.3.0"
- resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
- integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
-
-semver@^7.3.2, semver@^7.3.4, semver@^7.3.5:
- version "7.3.5"
- resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7"
- integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==
- dependencies:
- lru-cache "^6.0.0"
-
-send@0.17.2:
- version "0.17.2"
- resolved "https://registry.yarnpkg.com/send/-/send-0.17.2.tgz#926622f76601c41808012c8bf1688fe3906f7820"
- integrity sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww==
- dependencies:
- debug "2.6.9"
- depd "~1.1.2"
- destroy "~1.0.4"
- encodeurl "~1.0.2"
- escape-html "~1.0.3"
- etag "~1.8.1"
- fresh "0.5.2"
- http-errors "1.8.1"
- mime "1.6.0"
- ms "2.1.3"
- on-finished "~2.3.0"
- range-parser "~1.2.1"
- statuses "~1.5.0"
-
-serialize-javascript@^6.0.0:
- version "6.0.0"
- resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8"
- integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==
- dependencies:
- randombytes "^2.1.0"
-
-serve-handler@^6.1.3:
- version "6.1.3"
- resolved "https://registry.yarnpkg.com/serve-handler/-/serve-handler-6.1.3.tgz#1bf8c5ae138712af55c758477533b9117f6435e8"
- integrity sha512-FosMqFBNrLyeiIDvP1zgO6YoTzFYHxLDEIavhlmQ+knB2Z7l1t+kGLHkZIDN7UVWqQAmKI3D20A6F6jo3nDd4w==
- dependencies:
- bytes "3.0.0"
- content-disposition "0.5.2"
- fast-url-parser "1.1.3"
- mime-types "2.1.18"
- minimatch "3.0.4"
- path-is-inside "1.0.2"
- path-to-regexp "2.2.1"
- range-parser "1.2.0"
-
-serve-index@^1.9.1:
- version "1.9.1"
- resolved "https://registry.yarnpkg.com/serve-index/-/serve-index-1.9.1.tgz#d3768d69b1e7d82e5ce050fff5b453bea12a9239"
- integrity sha1-03aNabHn2C5c4FD/9bRTvqEqkjk=
- dependencies:
- accepts "~1.3.4"
- batch "0.6.1"
- debug "2.6.9"
- escape-html "~1.0.3"
- http-errors "~1.6.2"
- mime-types "~2.1.17"
- parseurl "~1.3.2"
-
-serve-static@1.14.2:
- version "1.14.2"
- resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.2.tgz#722d6294b1d62626d41b43a013ece4598d292bfa"
- integrity sha512-+TMNA9AFxUEGuC0z2mevogSnn9MXKb4fa7ngeRMJaaGv8vTwnIEkKi+QGvPt33HSnf8pRS+WGM0EbMtCJLKMBQ==
- dependencies:
- encodeurl "~1.0.2"
- escape-html "~1.0.3"
- parseurl "~1.3.3"
- send "0.17.2"
-
-setimmediate@^1.0.5:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285"
- integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=
-
-setprototypeof@1.1.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656"
- integrity sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==
-
-setprototypeof@1.2.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424"
- integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==
-
-shallow-clone@^3.0.0:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3"
- integrity sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==
- dependencies:
- kind-of "^6.0.2"
-
-shebang-command@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea"
- integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==
- dependencies:
- shebang-regex "^3.0.0"
-
-shebang-regex@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
- integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
-
-shell-quote@^1.7.2:
- version "1.7.3"
- resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.3.tgz#aa40edac170445b9a431e17bb62c0b881b9c4123"
- integrity sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==
-
-shelljs@^0.8.4:
- version "0.8.4"
- resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2"
- integrity sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==
- dependencies:
- glob "^7.0.0"
- interpret "^1.0.0"
- rechoir "^0.6.2"
-
-signal-exit@^3.0.2, signal-exit@^3.0.3:
- version "3.0.6"
- resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.6.tgz#24e630c4b0f03fea446a2bd299e62b4a6ca8d0af"
- integrity sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==
-
-sirv@^1.0.7:
- version "1.0.19"
- resolved "https://registry.yarnpkg.com/sirv/-/sirv-1.0.19.tgz#1d73979b38c7fe91fcba49c85280daa9c2363b49"
- integrity sha512-JuLThK3TnZG1TAKDwNIqNq6QA2afLOCcm+iE8D1Kj3GA40pSPsxQjjJl0J8X3tsR7T+CP1GavpzLwYkgVLWrZQ==
- dependencies:
- "@polka/url" "^1.0.0-next.20"
- mrmime "^1.0.0"
- totalist "^1.0.0"
-
-sisteransi@^1.0.5:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed"
- integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==
-
-sitemap@^7.0.0:
- version "7.0.0"
- resolved "https://registry.yarnpkg.com/sitemap/-/sitemap-7.0.0.tgz#022bef4df8cba42e38e1fe77039f234cab0372b6"
- integrity sha512-Ud0jrRQO2k7fEtPAM+cQkBKoMvxQyPKNXKDLn8tRVHxRCsdDQ2JZvw+aZ5IRYYQVAV9iGxEar6boTwZzev+x3g==
- dependencies:
- "@types/node" "^15.0.1"
- "@types/sax" "^1.2.1"
- arg "^5.0.0"
- sax "^1.2.4"
-
-slash@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
- integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==
-
-sockjs@^0.3.21:
- version "0.3.24"
- resolved "https://registry.yarnpkg.com/sockjs/-/sockjs-0.3.24.tgz#c9bc8995f33a111bea0395ec30aa3206bdb5ccce"
- integrity sha512-GJgLTZ7vYb/JtPSSZ10hsOYIvEYsjbNU+zPdIHcUaWVNUEPivzxku31865sSSud0Da0W4lEeOPlmw93zLQchuQ==
- dependencies:
- faye-websocket "^0.11.3"
- uuid "^8.3.2"
- websocket-driver "^0.7.4"
-
-sort-css-media-queries@2.0.4:
- version "2.0.4"
- resolved "https://registry.yarnpkg.com/sort-css-media-queries/-/sort-css-media-queries-2.0.4.tgz#b2badfa519cb4a938acbc6d3aaa913d4949dc908"
- integrity sha512-PAIsEK/XupCQwitjv7XxoMvYhT7EAfyzI3hsy/MyDgTvc+Ft55ctdkctJLOy6cQejaIC+zjpUL4djFVm2ivOOw==
-
-source-list-map@^2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34"
- integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==
-
-source-map-js@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.1.tgz#a1741c131e3c77d048252adfa24e23b908670caf"
- integrity sha512-4+TN2b3tqOCd/kaGRJ/sTYA0tR0mdXx26ipdolxcwtJVqEnqNYvlCAt1q3ypy4QMlYus+Zh34RNtYLoq2oQ4IA==
-
-source-map-support@~0.5.20:
- version "0.5.21"
- resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f"
- integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==
- dependencies:
- buffer-from "^1.0.0"
- source-map "^0.6.0"
-
-source-map@^0.5.0:
- version "0.5.7"
- resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"
- integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=
-
-source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1:
- version "0.6.1"
- resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
- integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
-
-source-map@~0.7.2:
- version "0.7.3"
- resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383"
- integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==
-
-sourcemap-codec@^1.4.4:
- version "1.4.8"
- resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4"
- integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==
-
-space-separated-tokens@^1.0.0:
- version "1.1.5"
- resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz#85f32c3d10d9682007e917414ddc5c26d1aa6899"
- integrity sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA==
-
-spdy-transport@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/spdy-transport/-/spdy-transport-3.0.0.tgz#00d4863a6400ad75df93361a1608605e5dcdcf31"
- integrity sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw==
- dependencies:
- debug "^4.1.0"
- detect-node "^2.0.4"
- hpack.js "^2.1.6"
- obuf "^1.1.2"
- readable-stream "^3.0.6"
- wbuf "^1.7.3"
-
-spdy@^4.0.2:
- version "4.0.2"
- resolved "https://registry.yarnpkg.com/spdy/-/spdy-4.0.2.tgz#b74f466203a3eda452c02492b91fb9e84a27677b"
- integrity sha512-r46gZQZQV+Kl9oItvl1JZZqJKGr+oEkB08A6BzkiR7593/7IbtuncXHd2YoYeTsG4157ZssMu9KYvUHLcjcDoA==
- dependencies:
- debug "^4.1.0"
- handle-thing "^2.0.0"
- http-deceiver "^1.2.7"
- select-hose "^2.0.0"
- spdy-transport "^3.0.0"
-
-sprintf-js@~1.0.2:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
- integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=
-
-stable@^0.1.8:
- version "0.1.8"
- resolved "https://registry.yarnpkg.com/stable/-/stable-0.1.8.tgz#836eb3c8382fe2936feaf544631017ce7d47a3cf"
- integrity sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==
-
-state-toggle@^1.0.0:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/state-toggle/-/state-toggle-1.0.3.tgz#e123b16a88e143139b09c6852221bc9815917dfe"
- integrity sha512-d/5Z4/2iiCnHw6Xzghyhb+GcmF89bxwgXG60wjIiZaxnymbyOmI8Hk4VqHXiVVp6u2ysaskFfXg3ekCj4WNftQ==
-
-"statuses@>= 1.4.0 < 2", "statuses@>= 1.5.0 < 2", statuses@~1.5.0:
- version "1.5.0"
- resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
- integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=
-
-std-env@^3.0.1:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/std-env/-/std-env-3.0.1.tgz#bc4cbc0e438610197e34c2d79c3df30b491f5182"
- integrity sha512-mC1Ps9l77/97qeOZc+HrOL7TIaOboHqMZ24dGVQrlxFcpPpfCHpH+qfUT7Dz+6mlG8+JPA1KfBQo19iC/+Ngcw==
-
-string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.2:
- version "4.2.3"
- resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
- integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
- dependencies:
- emoji-regex "^8.0.0"
- is-fullwidth-code-point "^3.0.0"
- strip-ansi "^6.0.1"
-
-string_decoder@^1.1.1:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e"
- integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==
- dependencies:
- safe-buffer "~5.2.0"
-
-string_decoder@~1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
- integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==
- dependencies:
- safe-buffer "~5.1.0"
-
-stringify-object@^3.3.0:
- version "3.3.0"
- resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629"
- integrity sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==
- dependencies:
- get-own-enumerable-property-symbols "^3.0.0"
- is-obj "^1.0.1"
- is-regexp "^1.0.0"
-
-strip-ansi@^6.0.0, strip-ansi@^6.0.1:
- version "6.0.1"
- resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
- integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
- dependencies:
- ansi-regex "^5.0.1"
-
-strip-ansi@^7.0.0:
- version "7.0.1"
- resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.0.1.tgz#61740a08ce36b61e50e65653f07060d000975fb2"
- integrity sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==
- dependencies:
- ansi-regex "^6.0.1"
-
-strip-bom-string@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/strip-bom-string/-/strip-bom-string-1.0.0.tgz#e5211e9224369fbb81d633a2f00044dc8cedad92"
- integrity sha1-5SEekiQ2n7uB1jOi8ABE3IztrZI=
-
-strip-final-newline@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad"
- integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==
-
-strip-json-comments@^3.1.1:
- version "3.1.1"
- resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006"
- integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==
-
-strip-json-comments@~2.0.1:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
- integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo=
-
-style-to-object@0.3.0, style-to-object@^0.3.0:
- version "0.3.0"
- resolved "https://registry.yarnpkg.com/style-to-object/-/style-to-object-0.3.0.tgz#b1b790d205991cc783801967214979ee19a76e46"
- integrity sha512-CzFnRRXhzWIdItT3OmF8SQfWyahHhjq3HwcMNCNLn+N7klOOqPjMeG/4JSu77D7ypZdGvSzvkrbyeTMizz2VrA==
- dependencies:
- inline-style-parser "0.1.1"
-
-stylehacks@^5.0.1:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/stylehacks/-/stylehacks-5.0.1.tgz#323ec554198520986806388c7fdaebc38d2c06fb"
- integrity sha512-Es0rVnHIqbWzveU1b24kbw92HsebBepxfcqe5iix7t9j0PQqhs0IxXVXv0pY2Bxa08CgMkzD6OWql7kbGOuEdA==
- dependencies:
- browserslist "^4.16.0"
- postcss-selector-parser "^6.0.4"
-
-supports-color@^5.3.0:
- version "5.5.0"
- resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
- integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==
- dependencies:
- has-flag "^3.0.0"
-
-supports-color@^7.1.0:
- version "7.2.0"
- resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da"
- integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==
- dependencies:
- has-flag "^4.0.0"
-
-supports-color@^8.0.0:
- version "8.1.1"
- resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c"
- integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==
- dependencies:
- has-flag "^4.0.0"
-
-svg-parser@^2.0.2:
- version "2.0.4"
- resolved "https://registry.yarnpkg.com/svg-parser/-/svg-parser-2.0.4.tgz#fdc2e29e13951736140b76cb122c8ee6630eb6b5"
- integrity sha512-e4hG1hRwoOdRb37cIMSgzNsxyzKfayW6VOflrwvR+/bzrkyxY/31WkbgnQpgtrNp1SdpJvpUAGTa/ZoiPNDuRQ==
-
-svgo@^2.5.0, svgo@^2.7.0:
- version "2.8.0"
- resolved "https://registry.yarnpkg.com/svgo/-/svgo-2.8.0.tgz#4ff80cce6710dc2795f0c7c74101e6764cfccd24"
- integrity sha512-+N/Q9kV1+F+UeWYoSiULYo4xYSDQlTgb+ayMobAXPwMnLvop7oxKMo9OzIrX5x3eS4L4f2UHhc9axXwY8DpChg==
- dependencies:
- "@trysound/sax" "0.2.0"
- commander "^7.2.0"
- css-select "^4.1.3"
- css-tree "^1.1.3"
- csso "^4.2.0"
- picocolors "^1.0.0"
- stable "^0.1.8"
-
-tapable@^1.0.0:
- version "1.1.3"
- resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2"
- integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==
-
-tapable@^2.0.0, tapable@^2.1.1, tapable@^2.2.0:
- version "2.2.1"
- resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0"
- integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==
-
-terser-webpack-plugin@^5.1.3, terser-webpack-plugin@^5.2.4:
- version "5.3.0"
- resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.0.tgz#21641326486ecf91d8054161c816e464435bae9f"
- integrity sha512-LPIisi3Ol4chwAaPP8toUJ3L4qCM1G0wao7L3qNv57Drezxj6+VEyySpPw4B1HSO2Eg/hDY/MNF5XihCAoqnsQ==
- dependencies:
- jest-worker "^27.4.1"
- schema-utils "^3.1.1"
- serialize-javascript "^6.0.0"
- source-map "^0.6.1"
- terser "^5.7.2"
-
-terser@^5.10.0, terser@^5.7.2:
- version "5.10.0"
- resolved "https://registry.yarnpkg.com/terser/-/terser-5.10.0.tgz#b86390809c0389105eb0a0b62397563096ddafcc"
- integrity sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA==
- dependencies:
- commander "^2.20.0"
- source-map "~0.7.2"
- source-map-support "~0.5.20"
-
-text-table@^0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
- integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=
-
-thunky@^1.0.2:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/thunky/-/thunky-1.1.0.tgz#5abaf714a9405db0504732bbccd2cedd9ef9537d"
- integrity sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==
-
-timsort@^0.3.0:
- version "0.3.0"
- resolved "https://registry.yarnpkg.com/timsort/-/timsort-0.3.0.tgz#405411a8e7e6339fe64db9a234de11dc31e02bd4"
- integrity sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=
-
-tiny-invariant@^1.0.2:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.2.0.tgz#a1141f86b672a9148c72e978a19a73b9b94a15a9"
- integrity sha512-1Uhn/aqw5C6RI4KejVeTg6mIS7IqxnLJ8Mv2tV5rTc0qWobay7pDUz6Wi392Cnc8ak1H0F2cjoRzb2/AW4+Fvg==
-
-tiny-warning@^1.0.0, tiny-warning@^1.0.3:
- version "1.0.3"
- resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754"
- integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==
-
-to-fast-properties@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e"
- integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=
-
-to-readable-stream@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/to-readable-stream/-/to-readable-stream-1.0.0.tgz#ce0aa0c2f3df6adf852efb404a783e77c0475771"
- integrity sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==
-
-to-regex-range@^5.0.1:
- version "5.0.1"
- resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4"
- integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==
- dependencies:
- is-number "^7.0.0"
-
-toidentifier@1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35"
- integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==
-
-totalist@^1.0.0:
- version "1.1.0"
- resolved "https://registry.yarnpkg.com/totalist/-/totalist-1.1.0.tgz#a4d65a3e546517701e3e5c37a47a70ac97fe56df"
- integrity sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g==
-
-trim-trailing-lines@^1.0.0:
- version "1.1.4"
- resolved "https://registry.yarnpkg.com/trim-trailing-lines/-/trim-trailing-lines-1.1.4.tgz#bd4abbec7cc880462f10b2c8b5ce1d8d1ec7c2c0"
- integrity sha512-rjUWSqnfTNrjbB9NQWfPMH/xRK1deHeGsHoVfpxJ++XeYXE0d6B1En37AHfw3jtfTU7dzMzZL2jjpe8Qb5gLIQ==
-
-trim@0.0.1:
- version "0.0.1"
- resolved "https://registry.yarnpkg.com/trim/-/trim-0.0.1.tgz#5858547f6b290757ee95cccc666fb50084c460dd"
- integrity sha1-WFhUf2spB1fulczMZm+1AITEYN0=
-
-trough@^1.0.0:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.5.tgz#b8b639cefad7d0bb2abd37d433ff8293efa5f406"
- integrity sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==
-
-tslib@^2.0.3, tslib@^2.3.1:
- version "2.3.1"
- resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01"
- integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==
-
-tslib@~2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.1.0.tgz#da60860f1c2ecaa5703ab7d39bc05b6bf988b97a"
- integrity sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==
-
-type-fest@^0.20.2:
- version "0.20.2"
- resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4"
- integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==
-
-type-is@~1.6.18:
- version "1.6.18"
- resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131"
- integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==
- dependencies:
- media-typer "0.3.0"
- mime-types "~2.1.24"
-
-typedarray-to-buffer@^3.1.5:
- version "3.1.5"
- resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080"
- integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==
- dependencies:
- is-typedarray "^1.0.0"
-
-ua-parser-js@^0.7.30:
- version "0.7.31"
- resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.31.tgz#649a656b191dffab4f21d5e053e27ca17cbff5c6"
- integrity sha512-qLK/Xe9E2uzmYI3qLeOmI0tEOt+TBBQyUIAh4aAgU05FVYzeZrKUdkAZfBNVGRaHVgV0TDkdEngJSw/SyQchkQ==
-
-unherit@^1.0.4:
- version "1.1.3"
- resolved "https://registry.yarnpkg.com/unherit/-/unherit-1.1.3.tgz#6c9b503f2b41b262330c80e91c8614abdaa69c22"
- integrity sha512-Ft16BJcnapDKp0+J/rqFC3Rrk6Y/Ng4nzsC028k2jdDII/rdZ7Wd3pPT/6+vIIxRagwRc9K0IUX0Ra4fKvw+WQ==
- dependencies:
- inherits "^2.0.0"
- xtend "^4.0.0"
-
-unicode-canonical-property-names-ecmascript@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc"
- integrity sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==
-
-unicode-match-property-ecmascript@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz#54fd16e0ecb167cf04cf1f756bdcc92eba7976c3"
- integrity sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==
- dependencies:
- unicode-canonical-property-names-ecmascript "^2.0.0"
- unicode-property-aliases-ecmascript "^2.0.0"
-
-unicode-match-property-value-ecmascript@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.0.0.tgz#1a01aa57247c14c568b89775a54938788189a714"
- integrity sha512-7Yhkc0Ye+t4PNYzOGKedDhXbYIBe1XEQYQxOPyhcXNMJ0WCABqqj6ckydd6pWRZTHV4GuCPKdBAUiMc60tsKVw==
-
-unicode-property-aliases-ecmascript@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz#0a36cb9a585c4f6abd51ad1deddb285c165297c8"
- integrity sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ==
-
-unified@9.2.0:
- version "9.2.0"
- resolved "https://registry.yarnpkg.com/unified/-/unified-9.2.0.tgz#67a62c627c40589edebbf60f53edfd4d822027f8"
- integrity sha512-vx2Z0vY+a3YoTj8+pttM3tiJHCwY5UFbYdiWrwBEbHmK8pvsPj2rtAX2BFfgXen8T39CJWblWRDT4L5WGXtDdg==
- dependencies:
- bail "^1.0.0"
- extend "^3.0.0"
- is-buffer "^2.0.0"
- is-plain-obj "^2.0.0"
- trough "^1.0.0"
- vfile "^4.0.0"
-
-unified@^8.4.2:
- version "8.4.2"
- resolved "https://registry.yarnpkg.com/unified/-/unified-8.4.2.tgz#13ad58b4a437faa2751a4a4c6a16f680c500fff1"
- integrity sha512-JCrmN13jI4+h9UAyKEoGcDZV+i1E7BLFuG7OsaDvTXI5P0qhHX+vZO/kOhz9jn8HGENDKbwSeB0nVOg4gVStGA==
- dependencies:
- bail "^1.0.0"
- extend "^3.0.0"
- is-plain-obj "^2.0.0"
- trough "^1.0.0"
- vfile "^4.0.0"
-
-unique-string@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-2.0.0.tgz#39c6451f81afb2749de2b233e3f7c5e8843bd89d"
- integrity sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==
- dependencies:
- crypto-random-string "^2.0.0"
-
-unist-builder@2.0.3, unist-builder@^2.0.0:
- version "2.0.3"
- resolved "https://registry.yarnpkg.com/unist-builder/-/unist-builder-2.0.3.tgz#77648711b5d86af0942f334397a33c5e91516436"
- integrity sha512-f98yt5pnlMWlzP539tPc4grGMsFaQQlP/vM396b00jngsiINumNmsY8rkXjfoi1c6QaM8nQ3vaGDuoKWbe/1Uw==
-
-unist-util-generated@^1.0.0:
- version "1.1.6"
- resolved "https://registry.yarnpkg.com/unist-util-generated/-/unist-util-generated-1.1.6.tgz#5ab51f689e2992a472beb1b35f2ce7ff2f324d4b"
- integrity sha512-cln2Mm1/CZzN5ttGK7vkoGw+RZ8VcUH6BtGbq98DDtRGquAAOXig1mrBQYelOwMXYS8rK+vZDyyojSjp7JX+Lg==
-
-unist-util-is@^4.0.0:
- version "4.1.0"
- resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-4.1.0.tgz#976e5f462a7a5de73d94b706bac1b90671b57797"
- integrity sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg==
-
-unist-util-position@^3.0.0:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/unist-util-position/-/unist-util-position-3.1.0.tgz#1c42ee6301f8d52f47d14f62bbdb796571fa2d47"
- integrity sha512-w+PkwCbYSFw8vpgWD0v7zRCl1FpY3fjDSQ3/N/wNd9Ffa4gPi8+4keqt99N3XW6F99t/mUzp2xAhNmfKWp95QA==
-
-unist-util-remove-position@^2.0.0:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/unist-util-remove-position/-/unist-util-remove-position-2.0.1.tgz#5d19ca79fdba712301999b2b73553ca8f3b352cc"
- integrity sha512-fDZsLYIe2uT+oGFnuZmy73K6ZxOPG/Qcm+w7jbEjaFcJgbQ6cqjs/eSPzXhsmGpAsWPkqZM9pYjww5QTn3LHMA==
- dependencies:
- unist-util-visit "^2.0.0"
-
-unist-util-remove@2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/unist-util-remove/-/unist-util-remove-2.0.0.tgz#32c2ad5578802f2ca62ab808173d505b2c898488"
- integrity sha512-HwwWyNHKkeg/eXRnE11IpzY8JT55JNM1YCwwU9YNCnfzk6s8GhPXrVBBZWiwLeATJbI7euvoGSzcy9M29UeW3g==
- dependencies:
- unist-util-is "^4.0.0"
-
-unist-util-remove@^2.0.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/unist-util-remove/-/unist-util-remove-2.1.0.tgz#b0b4738aa7ee445c402fda9328d604a02d010588"
- integrity sha512-J8NYPyBm4baYLdCbjmf1bhPu45Cr1MWTm77qd9istEkzWpnN6O9tMsEbB2JhNnBCqGENRqEWomQ+He6au0B27Q==
- dependencies:
- unist-util-is "^4.0.0"
-
-unist-util-stringify-position@^2.0.0:
- version "2.0.3"
- resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz#cce3bfa1cdf85ba7375d1d5b17bdc4cada9bd9da"
- integrity sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==
- dependencies:
- "@types/unist" "^2.0.2"
-
-unist-util-visit-parents@^3.0.0:
- version "3.1.1"
- resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz#65a6ce698f78a6b0f56aa0e88f13801886cdaef6"
- integrity sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==
- dependencies:
- "@types/unist" "^2.0.0"
- unist-util-is "^4.0.0"
-
-unist-util-visit@2.0.3, unist-util-visit@^2.0.0, unist-util-visit@^2.0.1, unist-util-visit@^2.0.2, unist-util-visit@^2.0.3:
- version "2.0.3"
- resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-2.0.3.tgz#c3703893146df47203bb8a9795af47d7b971208c"
- integrity sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==
- dependencies:
- "@types/unist" "^2.0.0"
- unist-util-is "^4.0.0"
- unist-util-visit-parents "^3.0.0"
-
-universalify@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717"
- integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==
-
-unpipe@1.0.0, unpipe@~1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"
- integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=
-
-update-notifier@^5.1.0:
- version "5.1.0"
- resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-5.1.0.tgz#4ab0d7c7f36a231dd7316cf7729313f0214d9ad9"
- integrity sha512-ItnICHbeMh9GqUy31hFPrD1kcuZ3rpxDZbf4KUDavXwS0bW5m7SLbDQpGX3UYr072cbrF5hFUs3r5tUsPwjfHw==
- dependencies:
- boxen "^5.0.0"
- chalk "^4.1.0"
- configstore "^5.0.1"
- has-yarn "^2.1.0"
- import-lazy "^2.1.0"
- is-ci "^2.0.0"
- is-installed-globally "^0.4.0"
- is-npm "^5.0.0"
- is-yarn-global "^0.3.0"
- latest-version "^5.1.0"
- pupa "^2.1.1"
- semver "^7.3.4"
- semver-diff "^3.1.1"
- xdg-basedir "^4.0.0"
-
-uri-js@^4.2.2:
- version "4.4.1"
- resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e"
- integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==
- dependencies:
- punycode "^2.1.0"
-
-url-loader@^4.1.1:
- version "4.1.1"
- resolved "https://registry.yarnpkg.com/url-loader/-/url-loader-4.1.1.tgz#28505e905cae158cf07c92ca622d7f237e70a4e2"
- integrity sha512-3BTV812+AVHHOJQO8O5MkWgZ5aosP7GnROJwvzLS9hWDj00lZ6Z0wNak423Lp9PBZN05N+Jk/N5Si8jRAlGyWA==
- dependencies:
- loader-utils "^2.0.0"
- mime-types "^2.1.27"
- schema-utils "^3.0.0"
-
-url-parse-lax@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c"
- integrity sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=
- dependencies:
- prepend-http "^2.0.0"
-
-url@^0.11.0:
- version "0.11.0"
- resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1"
- integrity sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=
- dependencies:
- punycode "1.3.2"
- querystring "0.2.0"
-
-use-composed-ref@^1.0.0:
- version "1.2.1"
- resolved "https://registry.yarnpkg.com/use-composed-ref/-/use-composed-ref-1.2.1.tgz#9bdcb5ccd894289105da2325e1210079f56bf849"
- integrity sha512-6+X1FLlIcjvFMAeAD/hcxDT8tmyrWnbSPMU0EnxQuDLIxokuFzWliXBiYZuGIx+mrAMLBw0WFfCkaPw8ebzAhw==
-
-use-isomorphic-layout-effect@^1.0.0:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.1.1.tgz#7bb6589170cd2987a152042f9084f9effb75c225"
- integrity sha512-L7Evj8FGcwo/wpbv/qvSfrkHFtOpCzvM5yl2KVyDJoylVuSvzphiiasmjgQPttIGBAy2WKiBNR98q8w7PiNgKQ==
-
-use-latest@^1.0.0:
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/use-latest/-/use-latest-1.2.0.tgz#a44f6572b8288e0972ec411bdd0840ada366f232"
- integrity sha512-d2TEuG6nSLKQLAfW3By8mKr8HurOlTkul0sOpxbClIv4SQ4iOd7BYr7VIzdbktUCnv7dua/60xzd8igMU6jmyw==
- dependencies:
- use-isomorphic-layout-effect "^1.0.0"
-
-util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
- integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
-
-utila@~0.4:
- version "0.4.0"
- resolved "https://registry.yarnpkg.com/utila/-/utila-0.4.0.tgz#8a16a05d445657a3aea5eecc5b12a4fa5379772c"
- integrity sha1-ihagXURWV6Oupe7MWxKk+lN5dyw=
-
-utility-types@^3.10.0:
- version "3.10.0"
- resolved "https://registry.yarnpkg.com/utility-types/-/utility-types-3.10.0.tgz#ea4148f9a741015f05ed74fd615e1d20e6bed82b"
- integrity sha512-O11mqxmi7wMKCo6HKFt5AhO4BwY3VV68YU07tgxfz8zJTIxr4BpsezN49Ffwy9j3ZpwwJp4fkRwjRzq3uWE6Rg==
-
-utils-merge@1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713"
- integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=
-
-uuid@^8.3.2:
- version "8.3.2"
- resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
- integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==
-
-value-equal@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-1.0.1.tgz#1e0b794c734c5c0cade179c437d356d931a34d6c"
- integrity sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==
-
-vary@~1.1.2:
- version "1.1.2"
- resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
- integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=
-
-vfile-location@^3.0.0, vfile-location@^3.2.0:
- version "3.2.0"
- resolved "https://registry.yarnpkg.com/vfile-location/-/vfile-location-3.2.0.tgz#d8e41fbcbd406063669ebf6c33d56ae8721d0f3c"
- integrity sha512-aLEIZKv/oxuCDZ8lkJGhuhztf/BW4M+iHdCwglA/eWc+vtuRFJj8EtgceYFX4LRjOhCAAiNHsKGssC6onJ+jbA==
-
-vfile-message@^2.0.0:
- version "2.0.4"
- resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-2.0.4.tgz#5b43b88171d409eae58477d13f23dd41d52c371a"
- integrity sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ==
- dependencies:
- "@types/unist" "^2.0.0"
- unist-util-stringify-position "^2.0.0"
-
-vfile@^4.0.0:
- version "4.2.1"
- resolved "https://registry.yarnpkg.com/vfile/-/vfile-4.2.1.tgz#03f1dce28fc625c625bc6514350fbdb00fa9e624"
- integrity sha512-O6AE4OskCG5S1emQ/4gl8zK586RqA3srz3nfK/Viy0UPToBc5Trp9BVFb1u0CjsKrAWwnpr4ifM/KBXPWwJbCA==
- dependencies:
- "@types/unist" "^2.0.0"
- is-buffer "^2.0.0"
- unist-util-stringify-position "^2.0.0"
- vfile-message "^2.0.0"
-
-wait-on@^6.0.0:
- version "6.0.0"
- resolved "https://registry.yarnpkg.com/wait-on/-/wait-on-6.0.0.tgz#7e9bf8e3d7fe2daecbb7a570ac8ca41e9311c7e7"
- integrity sha512-tnUJr9p5r+bEYXPUdRseolmz5XqJTTj98JgOsfBn7Oz2dxfE2g3zw1jE+Mo8lopM3j3et/Mq1yW7kKX6qw7RVw==
- dependencies:
- axios "^0.21.1"
- joi "^17.4.0"
- lodash "^4.17.21"
- minimist "^1.2.5"
- rxjs "^7.1.0"
-
-watchpack@^2.3.1:
- version "2.3.1"
- resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.3.1.tgz#4200d9447b401156eeca7767ee610f8809bc9d25"
- integrity sha512-x0t0JuydIo8qCNctdDrn1OzH/qDzk2+rdCOC3YzumZ42fiMqmQ7T3xQurykYMhYfHaPHTp4ZxAx2NfUo1K6QaA==
- dependencies:
- glob-to-regexp "^0.4.1"
- graceful-fs "^4.1.2"
-
-wbuf@^1.1.0, wbuf@^1.7.3:
- version "1.7.3"
- resolved "https://registry.yarnpkg.com/wbuf/-/wbuf-1.7.3.tgz#c1d8d149316d3ea852848895cb6a0bfe887b87df"
- integrity sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA==
- dependencies:
- minimalistic-assert "^1.0.0"
-
-web-namespaces@^1.0.0, web-namespaces@^1.1.2:
- version "1.1.4"
- resolved "https://registry.yarnpkg.com/web-namespaces/-/web-namespaces-1.1.4.tgz#bc98a3de60dadd7faefc403d1076d529f5e030ec"
- integrity sha512-wYxSGajtmoP4WxfejAPIr4l0fVh+jeMXZb08wNc0tMg6xsfZXj3cECqIK0G7ZAqUq0PP8WlMDtaOGVBTAWztNw==
-
-webpack-bundle-analyzer@^4.4.2:
- version "4.5.0"
- resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.5.0.tgz#1b0eea2947e73528754a6f9af3e91b2b6e0f79d5"
- integrity sha512-GUMZlM3SKwS8Z+CKeIFx7CVoHn3dXFcUAjT/dcZQQmfSZGvitPfMob2ipjai7ovFFqPvTqkEZ/leL4O0YOdAYQ==
- dependencies:
- acorn "^8.0.4"
- acorn-walk "^8.0.0"
- chalk "^4.1.0"
- commander "^7.2.0"
- gzip-size "^6.0.0"
- lodash "^4.17.20"
- opener "^1.5.2"
- sirv "^1.0.7"
- ws "^7.3.1"
-
-webpack-dev-middleware@^5.3.0:
- version "5.3.0"
- resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-5.3.0.tgz#8fc02dba6e72e1d373eca361623d84610f27be7c"
- integrity sha512-MouJz+rXAm9B1OTOYaJnn6rtD/lWZPy2ufQCH3BPs8Rloh/Du6Jze4p7AeLYHkVi0giJnYLaSGDC7S+GM9arhg==
- dependencies:
- colorette "^2.0.10"
- memfs "^3.2.2"
- mime-types "^2.1.31"
- range-parser "^1.2.1"
- schema-utils "^4.0.0"
-
-webpack-dev-server@^4.5.0:
- version "4.7.1"
- resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-4.7.1.tgz#4fe8f7435843dd2e676d687846f7a3d53f758c0d"
- integrity sha512-bkoNgFyqlF/CT726Axtf/ELHHYsTZJWz3QJ6HqstWPbalhjAPunlPH9bwt/Lr5cLb+uoLmsta6svVplVzq8beA==
- dependencies:
- "@types/bonjour" "^3.5.9"
- "@types/connect-history-api-fallback" "^1.3.5"
- "@types/serve-index" "^1.9.1"
- "@types/sockjs" "^0.3.33"
- "@types/ws" "^8.2.2"
- ansi-html-community "^0.0.8"
- bonjour "^3.5.0"
- chokidar "^3.5.2"
- colorette "^2.0.10"
- compression "^1.7.4"
- connect-history-api-fallback "^1.6.0"
- default-gateway "^6.0.3"
- del "^6.0.0"
- express "^4.17.1"
- graceful-fs "^4.2.6"
- html-entities "^2.3.2"
- http-proxy-middleware "^2.0.0"
- ipaddr.js "^2.0.1"
- open "^8.0.9"
- p-retry "^4.5.0"
- portfinder "^1.0.28"
- schema-utils "^4.0.0"
- selfsigned "^1.10.11"
- serve-index "^1.9.1"
- sockjs "^0.3.21"
- spdy "^4.0.2"
- strip-ansi "^7.0.0"
- webpack-dev-middleware "^5.3.0"
- ws "^8.1.0"
-
-webpack-merge@^5.8.0:
- version "5.8.0"
- resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-5.8.0.tgz#2b39dbf22af87776ad744c390223731d30a68f61"
- integrity sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q==
- dependencies:
- clone-deep "^4.0.1"
- wildcard "^2.0.0"
-
-webpack-sources@^1.1.0, webpack-sources@^1.4.3:
- version "1.4.3"
- resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.4.3.tgz#eedd8ec0b928fbf1cbfe994e22d2d890f330a933"
- integrity sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==
- dependencies:
- source-list-map "^2.0.0"
- source-map "~0.6.1"
-
-webpack-sources@^3.2.2:
- version "3.2.2"
- resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.2.tgz#d88e3741833efec57c4c789b6010db9977545260"
- integrity sha512-cp5qdmHnu5T8wRg2G3vZZHoJPN14aqQ89SyQ11NpGH5zEMDCclt49rzo+MaRazk7/UeILhAI+/sEtcM+7Fr0nw==
-
-webpack@^5.61.0:
- version "5.65.0"
- resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.65.0.tgz#ed2891d9145ba1f0d318e4ea4f89c3fa18e6f9be"
- integrity sha512-Q5or2o6EKs7+oKmJo7LaqZaMOlDWQse9Tm5l1WAfU/ujLGN5Pb0SqGeVkN/4bpPmEqEP5RnVhiqsOtWtUVwGRw==
- dependencies:
- "@types/eslint-scope" "^3.7.0"
- "@types/estree" "^0.0.50"
- "@webassemblyjs/ast" "1.11.1"
- "@webassemblyjs/wasm-edit" "1.11.1"
- "@webassemblyjs/wasm-parser" "1.11.1"
- acorn "^8.4.1"
- acorn-import-assertions "^1.7.6"
- browserslist "^4.14.5"
- chrome-trace-event "^1.0.2"
- enhanced-resolve "^5.8.3"
- es-module-lexer "^0.9.0"
- eslint-scope "5.1.1"
- events "^3.2.0"
- glob-to-regexp "^0.4.1"
- graceful-fs "^4.2.4"
- json-parse-better-errors "^1.0.2"
- loader-runner "^4.2.0"
- mime-types "^2.1.27"
- neo-async "^2.6.2"
- schema-utils "^3.1.0"
- tapable "^2.1.1"
- terser-webpack-plugin "^5.1.3"
- watchpack "^2.3.1"
- webpack-sources "^3.2.2"
-
-webpackbar@^5.0.0-3:
- version "5.0.2"
- resolved "https://registry.yarnpkg.com/webpackbar/-/webpackbar-5.0.2.tgz#d3dd466211c73852741dfc842b7556dcbc2b0570"
- integrity sha512-BmFJo7veBDgQzfWXl/wwYXr/VFus0614qZ8i9znqcl9fnEdiVkdbi0TedLQ6xAK92HZHDJ0QmyQ0fmuZPAgCYQ==
- dependencies:
- chalk "^4.1.0"
- consola "^2.15.3"
- pretty-time "^1.1.0"
- std-env "^3.0.1"
-
-websocket-driver@>=0.5.1, websocket-driver@^0.7.4:
- version "0.7.4"
- resolved "https://registry.yarnpkg.com/websocket-driver/-/websocket-driver-0.7.4.tgz#89ad5295bbf64b480abcba31e4953aca706f5760"
- integrity sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==
- dependencies:
- http-parser-js ">=0.5.1"
- safe-buffer ">=5.1.0"
- websocket-extensions ">=0.1.1"
-
-websocket-extensions@>=0.1.1:
- version "0.1.4"
- resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42"
- integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==
-
-which@^1.3.1:
- version "1.3.1"
- resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a"
- integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==
- dependencies:
- isexe "^2.0.0"
-
-which@^2.0.1:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"
- integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==
- dependencies:
- isexe "^2.0.0"
-
-widest-line@^3.1.0:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-3.1.0.tgz#8292333bbf66cb45ff0de1603b136b7ae1496eca"
- integrity sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==
- dependencies:
- string-width "^4.0.0"
-
-wildcard@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/wildcard/-/wildcard-2.0.0.tgz#a77d20e5200c6faaac979e4b3aadc7b3dd7f8fec"
- integrity sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==
-
-wrap-ansi@^7.0.0:
- version "7.0.0"
- resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
- integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
- dependencies:
- ansi-styles "^4.0.0"
- string-width "^4.1.0"
- strip-ansi "^6.0.0"
-
-wrappy@1:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
- integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
-
-write-file-atomic@^3.0.0:
- version "3.0.3"
- resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8"
- integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==
- dependencies:
- imurmurhash "^0.1.4"
- is-typedarray "^1.0.0"
- signal-exit "^3.0.2"
- typedarray-to-buffer "^3.1.5"
-
-ws@^7.3.1:
- version "7.5.6"
- resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.6.tgz#e59fc509fb15ddfb65487ee9765c5a51dec5fe7b"
- integrity sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA==
-
-ws@^8.1.0:
- version "8.4.0"
- resolved "https://registry.yarnpkg.com/ws/-/ws-8.4.0.tgz#f05e982a0a88c604080e8581576e2a063802bed6"
- integrity sha512-IHVsKe2pjajSUIl4KYMQOdlyliovpEPquKkqbwswulszzI7r0SfQrxnXdWAEqOlDCLrVSJzo+O1hAwdog2sKSQ==
-
-xdg-basedir@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13"
- integrity sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==
-
-xml-js@^1.6.11:
- version "1.6.11"
- resolved "https://registry.yarnpkg.com/xml-js/-/xml-js-1.6.11.tgz#927d2f6947f7f1c19a316dd8eea3614e8b18f8e9"
- integrity sha512-7rVi2KMfwfWFl+GpPg6m80IVMWXLRjO+PxTq7V2CDhoGak0wzYzFgUY2m4XJ47OGdXd8eLE8EmwfAmdjw7lC1g==
- dependencies:
- sax "^1.2.4"
-
-xtend@^4.0.0, xtend@^4.0.1:
- version "4.0.2"
- resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54"
- integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==
-
-yallist@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
- integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==
-
-yaml@^1.10.0, yaml@^1.10.2, yaml@^1.7.2:
- version "1.10.2"
- resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b"
- integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==
-
-yocto-queue@^0.1.0:
- version "0.1.0"
- resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
- integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
-
-zwitch@^1.0.0:
- version "1.0.5"
- resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-1.0.5.tgz#d11d7381ffed16b742f6af7b3f223d5cd9fe9920"
- integrity sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==
diff --git a/hooks/handleGovernanceAssetsStore.ts b/hooks/handleGovernanceAssetsStore.ts
index c76445c4f8..19ccf959cd 100644
--- a/hooks/handleGovernanceAssetsStore.ts
+++ b/hooks/handleGovernanceAssetsStore.ts
@@ -1,14 +1,14 @@
import {
DEFAULT_NATIVE_SOL_MINT,
DEFAULT_NFT_TREASURY_MINT,
-} from '@components/instructions/tools'
+} from '@components/instructions/tools';
import {
getNativeTreasuryAddress,
GovernanceAccountType,
-} from '@solana/spl-governance'
-import { TOKEN_PROGRAM_ID } from '@solana/spl-token'
-import { Connection, ParsedAccountData, PublicKey } from '@solana/web3.js'
-import tokenService from '@utils/services/token'
+} from '@solana/spl-governance';
+import { TOKEN_PROGRAM_ID } from '@solana/spl-token';
+import { Connection, ParsedAccountData, PublicKey } from '@solana/web3.js';
+import tokenService from '@utils/services/token';
import {
AccountInfoGen,
GovernedTokenAccount,
@@ -16,77 +16,79 @@ import {
tryGetMint,
ukraineDaoTokenAccountsOwnerAddress,
ukraineDAOGovPk,
-} from '@utils/tokens'
-import { useRouter } from 'next/router'
-import { useEffect } from 'react'
-import useGovernanceAssetsStore from 'stores/useGovernanceAssetsStore'
-import useWalletStore from 'stores/useWalletStore'
-import useGovernanceAssets from './useGovernanceAssets'
-import useRealm from './useRealm'
+} from '@utils/tokens';
+import { useRouter } from 'next/router';
+import { useEffect } from 'react';
+import useGovernanceAssetsStore from 'stores/useGovernanceAssetsStore';
+import useWalletStore from 'stores/useWalletStore';
+import useGovernanceAssets from './useGovernanceAssets';
+import useRealm from './useRealm';
export default function handleGovernanceAssetsStore() {
- const route = useRouter()
- const { governances, tokenMints, realmTokenAccounts, realm } = useRealm()
- const connection = useWalletStore((s) => s.connection.current)
- const { getGovernancesByAccountTypes } = useGovernanceAssets()
+ const route = useRouter();
+ const { governances, tokenMints, realmTokenAccounts, realm } = useRealm();
+ const connection = useWalletStore((s) => s.connection.current);
+ const { getGovernancesByAccountTypes } = useGovernanceAssets();
const tokenGovernances = getGovernancesByAccountTypes([
GovernanceAccountType.TokenGovernanceV1,
GovernanceAccountType.TokenGovernanceV2,
- ])
+ ]);
const {
setGovernancesArray,
setGovernedTokenAccounts,
setGovernedAccounts,
- } = useGovernanceAssetsStore()
+ } = useGovernanceAssetsStore();
useEffect(() => {
if (realm) {
- setGovernancesArray(governances)
+ setGovernancesArray(governances);
}
if (realm && route.pathname.includes('/params')) {
- setGovernedAccounts(connection, realm)
+ setGovernedAccounts(connection, realm);
}
- }, [JSON.stringify(governances), realm?.pubkey, route.pathname])
+ }, [JSON.stringify(governances), realm?.pubkey, route.pathname]);
useEffect(() => {
async function prepareTokenGovernances() {
- const governedTokenAccountsArray: GovernedTokenAccount[] = []
+ const governedTokenAccountsArray: GovernedTokenAccount[] = [];
for (const gov of tokenGovernances) {
const realmTokenAccount = realmTokenAccounts.find(
(x) =>
- x.publicKey.toBase58() === gov.account.governedAccount.toBase58()
- )
+ x.publicKey.toBase58() === gov.account.governedAccount.toBase58(),
+ );
const mint = tokenMints.find(
(x) =>
realmTokenAccount?.account.mint.toBase58() ===
- x.publicKey.toBase58()
- )
- const isNft = mint?.publicKey.toBase58() === DEFAULT_NFT_TREASURY_MINT
- const isSol = mint?.publicKey.toBase58() === DEFAULT_NATIVE_SOL_MINT
+ x.publicKey.toBase58(),
+ );
+ const isNft = mint?.publicKey.toBase58() === DEFAULT_NFT_TREASURY_MINT;
+ const isSol = mint?.publicKey.toBase58() === DEFAULT_NATIVE_SOL_MINT;
let transferAddress = realmTokenAccount
? realmTokenAccount.publicKey
- : null
- let solAccount: null | AccountInfoGen = null
+ : null;
+ let solAccount: null | AccountInfoGen<
+ Buffer | ParsedAccountData
+ > = null;
if (isNft) {
- transferAddress = gov.pubkey
+ transferAddress = gov.pubkey;
}
if (isSol) {
const solAddress = await getNativeTreasuryAddress(
realm!.owner,
- gov.pubkey
- )
- transferAddress = solAddress
- const resp = await connection.getParsedAccountInfo(solAddress)
+ gov.pubkey,
+ );
+ transferAddress = solAddress;
+ const resp = await connection.getParsedAccountInfo(solAddress);
const mintRentAmount = await connection.getMinimumBalanceForRentExemption(
- 0
- )
+ 0,
+ );
if (resp.value) {
solAccount = resp.value as AccountInfoGen<
Buffer | ParsedAccountData
- >
+ >;
solAccount.lamports =
solAccount.lamports !== 0
? solAccount.lamports - mintRentAmount
- : solAccount.lamports
+ : solAccount.lamports;
}
}
const obj = {
@@ -97,13 +99,13 @@ export default function handleGovernanceAssetsStore() {
isSol,
transferAddress,
solAccount,
- }
- governedTokenAccountsArray.push(obj)
+ };
+ governedTokenAccountsArray.push(obj);
}
//Just for ukraine dao, it will be replaced with good abstraction
const ukraineGov = tokenGovernances.find(
- (x) => x.pubkey.toBase58() === ukraineDAOGovPk
- )
+ (x) => x.pubkey.toBase58() === ukraineDAOGovPk,
+ );
if (ukraineGov) {
const resp = (
await getProgramAccountsByOwner(
@@ -111,18 +113,18 @@ export default function handleGovernanceAssetsStore() {
TOKEN_PROGRAM_ID,
new PublicKey(ukraineDaoTokenAccountsOwnerAddress),
165,
- 32
+ 32,
)
)
.flatMap((x) => x)
.map((x) => {
- const publicKey = x.pubkey
- const data = Buffer.from(x.account.data)
- const account = parseTokenAccountData(publicKey, data)
- return { publicKey, account }
- })
+ const publicKey = x.pubkey;
+ const data = Buffer.from(x.account.data);
+ const account = parseTokenAccountData(publicKey, data);
+ return { publicKey, account };
+ });
for (const tokenAcc of resp) {
- const mint = await tryGetMint(connection, tokenAcc.account.mint)
+ const mint = await tryGetMint(connection, tokenAcc.account.mint);
const obj = {
governance: ukraineGov,
token: tokenAcc,
@@ -131,26 +133,26 @@ export default function handleGovernanceAssetsStore() {
isSol: false,
transferAddress: tokenAcc.account.address,
solAccount: null,
- }
+ };
if (mint?.account.decimals) {
- governedTokenAccountsArray.push(obj)
+ governedTokenAccountsArray.push(obj);
}
}
}
await tokenService.fetchTokenPrices(
governedTokenAccountsArray
.filter((x) => x.mint)
- .map((x) => x.mint!.publicKey.toBase58())
- )
- setGovernedTokenAccounts(governedTokenAccountsArray)
+ .map((x) => x.mint!.publicKey.toBase58()),
+ );
+ setGovernedTokenAccounts(governedTokenAccountsArray);
}
- prepareTokenGovernances()
+ prepareTokenGovernances();
}, [
JSON.stringify(tokenMints),
JSON.stringify(realmTokenAccounts),
JSON.stringify(tokenGovernances),
JSON.stringify(governances),
- ])
+ ]);
}
const getProgramAccountsByOwner = (
@@ -158,7 +160,7 @@ const getProgramAccountsByOwner = (
programId: PublicKey,
owner: PublicKey,
dataSize: number,
- offset: number
+ offset: number,
) => {
return connection.getProgramAccounts(
programId, // new PublicKey("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA")
@@ -174,6 +176,6 @@ const getProgramAccountsByOwner = (
},
},
],
- }
- )
-}
+ },
+ );
+};
diff --git a/hooks/handleRouterHistory.ts b/hooks/handleRouterHistory.ts
index 2c1635936a..2db0689eb0 100644
--- a/hooks/handleRouterHistory.ts
+++ b/hooks/handleRouterHistory.ts
@@ -1,23 +1,23 @@
-import { useRouter } from 'next/router'
-import { useEffect } from 'react'
-import useRouterHistoryStore from 'stores/useRouterHistoryStore'
-import { usePrevious } from './usePrevious'
+import { useRouter } from 'next/router';
+import { useEffect } from 'react';
+import useRouterHistoryStore from 'stores/useRouterHistoryStore';
+import { usePrevious } from './usePrevious';
//nextjs don't provide route history out of the box.
//we store only 4 last routes
export default function handleRouterHistory() {
- const router = useRouter()
- const previousPath = usePrevious(router.asPath) as string
- const history = useRouterHistoryStore((s) => s.history)
- const setHistory = useRouterHistoryStore((s) => s.setHistory)
+ const router = useRouter();
+ const previousPath = usePrevious(router.asPath) as string;
+ const history = useRouterHistoryStore((s) => s.history);
+ const setHistory = useRouterHistoryStore((s) => s.setHistory);
useEffect(() => {
if (router.asPath !== previousPath) {
- const newHistory = [...history, previousPath]
+ const newHistory = [...history, previousPath];
if (newHistory.length > 4) {
- newHistory.shift()
+ newHistory.shift();
}
- setHistory(newHistory)
+ setHistory(newHistory);
}
- }, [router.asPath])
+ }, [router.asPath]);
}
diff --git a/hooks/useCreateProposal.ts b/hooks/useCreateProposal.ts
index 8c35bbf707..518fb48b46 100644
--- a/hooks/useCreateProposal.ts
+++ b/hooks/useCreateProposal.ts
@@ -1,24 +1,24 @@
-import { ProgramAccount, Governance } from '@solana/spl-governance'
+import { ProgramAccount, Governance } from '@solana/spl-governance';
import {
createProposal,
InstructionDataWithHoldUpTime,
-} from 'actions/createProposal'
-import useWalletStore from 'stores/useWalletStore'
-import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore'
-import useRealm from './useRealm'
-import useRpcContext from './useRpcContext'
+} from 'actions/createProposal';
+import useWalletStore from 'stores/useWalletStore';
+import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore';
+import useRealm from './useRealm';
+import useRpcContext from './useRpcContext';
export default function useCreateProposal() {
- const client = useVoteStakeRegistryClientStore((s) => s.state.client)
- const { fetchRealmGovernance } = useWalletStore((s) => s.actions)
+ const client = useVoteStakeRegistryClientStore((s) => s.state.client);
+ const { fetchRealmGovernance } = useWalletStore((s) => s.actions);
const {
realm,
ownVoterWeight,
mint,
councilMint,
canChooseWhoVote,
- } = useRealm()
- const { getRpcContext } = useRpcContext()
+ } = useRealm();
+ const { getRpcContext } = useRpcContext();
const handleCreateProposal = async ({
title,
description,
@@ -27,35 +27,35 @@ export default function useCreateProposal() {
voteByCouncil = false,
isDraft = false,
}: {
- title: string
- description: string
- governance: ProgramAccount
- instructionsData: InstructionDataWithHoldUpTime[]
- voteByCouncil?: boolean
- isDraft?: boolean
+ title: string;
+ description: string;
+ governance: ProgramAccount;
+ instructionsData: InstructionDataWithHoldUpTime[];
+ voteByCouncil?: boolean;
+ isDraft?: boolean;
}) => {
const ownTokenRecord = ownVoterWeight.getTokenRecordToCreateProposal(
- governance!.account.config
- )
+ governance!.account.config,
+ );
const defaultProposalMint = !mint?.supply.isZero()
? realm!.account.communityMint
: !councilMint?.supply.isZero()
? realm!.account.config.councilMint
- : undefined
+ : undefined;
const proposalMint =
canChooseWhoVote && voteByCouncil
? realm!.account.config.councilMint
- : defaultProposalMint
+ : defaultProposalMint;
if (!proposalMint) {
- throw new Error('There is no suitable governing token for the proposal')
+ throw new Error('There is no suitable governing token for the proposal');
}
- const rpcContext = getRpcContext()
+ const rpcContext = getRpcContext();
// Fetch governance to get up to date proposalCount
const selectedGovernance = (await fetchRealmGovernance(
- governance?.pubkey
- )) as ProgramAccount
+ governance?.pubkey,
+ )) as ProgramAccount;
return await createProposal(
rpcContext,
realm!,
@@ -67,8 +67,8 @@ export default function useCreateProposal() {
selectedGovernance?.account?.proposalCount,
instructionsData,
isDraft,
- client
- )
- }
- return { handleCreateProposal }
+ client,
+ );
+ };
+ return { handleCreateProposal };
}
diff --git a/hooks/useDeltafiProgram.ts b/hooks/useDeltafiProgram.ts
new file mode 100644
index 0000000000..25b5733d03
--- /dev/null
+++ b/hooks/useDeltafiProgram.ts
@@ -0,0 +1,27 @@
+import { useEffect, useState } from 'react';
+
+import useWalletStore from 'stores/useWalletStore';
+import deltafiConfiguration from '@tools/sdk/deltafi/configuration';
+import { DeltafiProgram } from '@tools/sdk/deltafi/program/deltafi';
+
+export default function useDeltafiProgram() {
+ const connection = useWalletStore((s) => s.connection);
+ const wallet = useWalletStore((s) => s.current);
+
+ const [program, setProgram] = useState(null);
+
+ useEffect(() => {
+ if (!connection || !wallet) {
+ return;
+ }
+
+ setProgram(
+ deltafiConfiguration.getDeltafiProgram({
+ connection: connection.current,
+ wallet,
+ }),
+ );
+ }, [connection, wallet]);
+
+ return program;
+}
diff --git a/hooks/useGovernanceAssets.ts b/hooks/useGovernanceAssets.ts
index 9f82790397..f3711f2204 100644
--- a/hooks/useGovernanceAssets.ts
+++ b/hooks/useGovernanceAssets.ts
@@ -1,235 +1,699 @@
-import { GovernanceAccountType } from '@solana/spl-governance'
-import { MintInfo } from '@solana/spl-token'
+import { GovernanceAccountType } from '@solana/spl-governance';
+import { MintInfo } from '@solana/spl-token';
import {
getMultipleAccountInfoChunked,
GovernedMintInfoAccount,
parseMintAccountData,
-} from '@utils/tokens'
-import { Instructions } from '@utils/uiTypes/proposalCreationTypes'
+} from '@utils/tokens';
+import {
+ InstructionEnum,
+ PackageEnum,
+} from '@utils/uiTypes/proposalCreationTypes';
+
+import useWalletStore from 'stores/useWalletStore';
+
+import useRealm from './useRealm';
+import useGovernanceAssetsStore from 'stores/useGovernanceAssetsStore';
+
+export type InstructionTag = 'beta' | 'deprecated';
+
+type Instruction = {
+ name: string;
+ isVisible?: boolean;
+ packageId: PackageEnum;
+ tag?: InstructionTag;
+};
+
+type Instructions = {
+ [instructionId in InstructionEnum]: Instruction;
+};
-import useWalletStore from 'stores/useWalletStore'
+export type InstructionType = {
+ id: InstructionEnum;
+ name: string;
+ packageId: PackageEnum;
+ tag?: InstructionTag;
+};
-import useRealm from './useRealm'
-import useGovernanceAssetsStore from 'stores/useGovernanceAssetsStore'
+type Package = {
+ name: string;
+ image?: string;
+};
+
+type Packages = {
+ [packageId in PackageEnum]: Package;
+};
+
+export type PackageType = Package & {
+ id: PackageEnum;
+};
export default function useGovernanceAssets() {
- const { ownVoterWeight, realm, symbol, governances } = useRealm()
- const connection = useWalletStore((s) => s.connection.current)
+ const { ownVoterWeight, realm, symbol, governances } = useRealm();
+ const connection = useWalletStore((s) => s.connection.current);
+ const cluster = useWalletStore((s) => s.connection.cluster);
const governedTokenAccounts = useGovernanceAssetsStore(
- (s) => s.governedTokenAccounts
- )
- const governancesArray = useGovernanceAssetsStore((s) => s.governancesArray)
+ (s) => s.governedTokenAccounts,
+ );
+ const governancesArray = useGovernanceAssetsStore((s) => s.governancesArray);
const getGovernancesByAccountType = (type: GovernanceAccountType) => {
const governancesFiltered = governancesArray.filter(
- (gov) => gov.account?.accountType === type
- )
- return governancesFiltered
- }
+ (gov) => gov.account?.accountType === type,
+ );
+ return governancesFiltered;
+ };
const getGovernancesByAccountTypes = (types: GovernanceAccountType[]) => {
const governancesFiltered = governancesArray.filter((gov) =>
- types.some((t) => gov.account?.accountType === t)
- )
- return governancesFiltered
- }
+ types.some((t) => gov.account?.accountType === t),
+ );
+ return governancesFiltered;
+ };
function canUseGovernanceForInstruction(types: GovernanceAccountType[]) {
return (
realm &&
getGovernancesByAccountTypes(types).some((govAcc) =>
- ownVoterWeight.canCreateProposal(govAcc.account.config)
+ ownVoterWeight.canCreateProposal(govAcc.account.config),
)
- )
+ );
}
const canMintRealmCommunityToken = () => {
const governances = getGovernancesByAccountTypes([
GovernanceAccountType.MintGovernanceV1,
GovernanceAccountType.MintGovernanceV2,
- ])
+ ]);
return !!governances.find((govAcc) =>
- realm?.account.communityMint.equals(govAcc.account.governedAccount)
- )
- }
+ realm?.account.communityMint.equals(govAcc.account.governedAccount),
+ );
+ };
const canMintRealmCouncilToken = () => {
const governances = getGovernancesByAccountTypes([
GovernanceAccountType.MintGovernanceV1,
GovernanceAccountType.MintGovernanceV2,
- ])
+ ]);
return !!governances.find(
(x) =>
x.account.governedAccount.toBase58() ==
- realm?.account.config.councilMint?.toBase58()
- )
- }
+ realm?.account.config.councilMint?.toBase58(),
+ );
+ };
// TODO: Check governedAccounts from all governances plus search for token accounts owned by governances
const canUseTransferInstruction = canUseGovernanceForInstruction([
GovernanceAccountType.TokenGovernanceV1,
GovernanceAccountType.TokenGovernanceV2,
- ])
+ ]);
const canUseProgramUpgradeInstruction = canUseGovernanceForInstruction([
GovernanceAccountType.ProgramGovernanceV1,
GovernanceAccountType.ProgramGovernanceV2,
- ])
+ ]);
const canUseMintInstruction = canUseGovernanceForInstruction([
GovernanceAccountType.MintGovernanceV1,
GovernanceAccountType.MintGovernanceV2,
- ])
+ ]);
+
+ const canUseUxdInstructions =
+ ((cluster === 'mainnet' && symbol === 'UXP') || cluster !== 'mainnet') &&
+ canUseGovernanceForInstruction([
+ GovernanceAccountType.ProgramGovernanceV1,
+ GovernanceAccountType.ProgramGovernanceV2,
+ ]);
const canUseAnyInstruction =
realm &&
governancesArray.some((gov) =>
- ownVoterWeight.canCreateProposal(gov.account.config)
- )
+ ownVoterWeight.canCreateProposal(gov.account.config),
+ );
- const getAvailableInstructions = () => {
- return availableInstructions.filter((itx) => itx.isVisible)
- }
async function getMintWithGovernances() {
const mintGovernances = getGovernancesByAccountTypes([
GovernanceAccountType.MintGovernanceV1,
GovernanceAccountType.MintGovernanceV2,
- ])
- const governedMintInfoAccounts: GovernedMintInfoAccount[] = []
+ ]);
+ const governedMintInfoAccounts: GovernedMintInfoAccount[] = [];
const mintGovernancesMintInfo = await getMultipleAccountInfoChunked(
connection,
- mintGovernances.map((x) => x.account.governedAccount)
- )
+ mintGovernances.map((x) => x.account.governedAccount),
+ );
mintGovernancesMintInfo.forEach((mintAccountInfo, index) => {
- const governance = mintGovernances[index]
+ const governance = mintGovernances[index];
if (!mintAccountInfo) {
throw new Error(
- `Missing mintAccountInfo for: ${governance.pubkey.toBase58()}`
- )
+ `Missing mintAccountInfo for: ${governance.pubkey.toBase58()}`,
+ );
}
- const data = Buffer.from(mintAccountInfo.data)
- const parsedMintInfo = parseMintAccountData(data) as MintInfo
+ const data = Buffer.from(mintAccountInfo.data as Buffer);
+ const parsedMintInfo = parseMintAccountData(data) as MintInfo;
const obj = {
governance,
mintInfo: parsedMintInfo,
- }
- governedMintInfoAccounts.push(obj)
- })
- return governedMintInfoAccounts
+ };
+ governedMintInfoAccounts.push(obj);
+ });
+ return governedMintInfoAccounts;
}
+
const governedTokenAccountsWithoutNfts = governedTokenAccounts.filter(
- (x) => !x.isNft
- )
+ (x) => !x.isNft,
+ );
const nftsGovernedTokenAccounts = governedTokenAccounts.filter(
- (govTokenAcc) => govTokenAcc.isNft
- )
+ (govTokenAcc) => govTokenAcc.isNft,
+ );
const canUseTokenTransferInstruction = governedTokenAccountsWithoutNfts.some(
(acc) =>
acc.governance &&
- ownVoterWeight.canCreateProposal(acc.governance?.account?.config)
- )
- const availableInstructions = [
- {
- id: Instructions.Transfer,
- name: 'Transfer Tokens',
- isVisible: canUseTokenTransferInstruction,
+ ownVoterWeight.canCreateProposal(acc.governance?.account?.config),
+ );
+
+ const packages: Packages = {
+ [PackageEnum.Native]: {
+ name: 'Native',
},
- {
- id: Instructions.Grant,
- name: 'Grant',
- isVisible:
- canUseTokenTransferInstruction &&
- realm?.account.config.useCommunityVoterWeightAddin,
- },
- {
- id: Instructions.Clawback,
- name: 'Clawback',
- isVisible:
- canUseTokenTransferInstruction &&
- realm?.account.config.useCommunityVoterWeightAddin,
- },
- {
- id: Instructions.CreateAssociatedTokenAccount,
- name: 'Create Associated Token Account',
+ [PackageEnum.Solend]: {
+ name: 'Solend',
+ image: '/img/solend.png',
+ },
+ [PackageEnum.Raydium]: {
+ name: 'Raydium',
+ image: '/img/raydium.png',
+ },
+ [PackageEnum.UXD]: {
+ name: 'UXD',
+ image: '/img/uxd.png',
+ },
+ [PackageEnum.UXDStaking]: {
+ name: 'UXD Staking',
+ image: '/img/uxd-staking.png',
+ },
+ [PackageEnum.Friktion]: {
+ name: 'Friktion',
+ image: '/img/friktion.png',
+ },
+ [PackageEnum.Lifinity]: {
+ name: 'Lifinity',
+ image: '/img/lifinity.png',
+ },
+ [PackageEnum.Tribeca]: {
+ name: 'Tribeca',
+ image: '/img/tribeca.png',
+ },
+ [PackageEnum.Socean]: {
+ name: 'Socean',
+ image: '/img/socean.png',
+ },
+ [PackageEnum.Saber]: {
+ name: 'Saber',
+ image: '/img/saber.png',
+ },
+ [PackageEnum.Quarry]: {
+ name: 'Quarry',
+ image: '/img/quarry.png',
+ },
+ [PackageEnum.MapleFinance]: {
+ name: 'Maple Finance',
+ image: '/img/mapleFinance.png',
+ },
+ [PackageEnum.Deltafi]: {
+ name: 'Deltafi',
+ image: '/img/deltafi.png',
+ },
+ [PackageEnum.Orca]: {
+ name: 'Orca',
+ image: '/img/orca.svg',
+ },
+ };
+
+ const instructions: Instructions = {
+ [InstructionEnum.MapleFinanceLenderDepositForm]: {
+ name: 'Lender Deposit',
isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.MapleFinance,
+ tag: 'beta',
},
- {
- id: Instructions.DepositIntoVolt,
- name: 'Friktion: Deposit into Volt',
+ [InstructionEnum.LifinityDepositToPool]: {
+ name: 'Deposit To Pool',
isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Lifinity,
},
- {
- id: Instructions.CreateSolendObligationAccount,
+ [InstructionEnum.LifinityWithdrawFromPool]: {
+ name: 'Withdraw From Pool',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Lifinity,
+ },
+ [InstructionEnum.QuarryClaimRewards]: {
+ name: 'Claim Rewards',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Quarry,
+ },
+ [InstructionEnum.QuarryCreateMiner]: {
+ name: 'Create Miner',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Quarry,
+ },
+ [InstructionEnum.QuarryCreateMinerVaultAccount]: {
+ name: 'Create Miner Vault Account',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Quarry,
+ },
+ [InstructionEnum.QuarryStakeTokens]: {
+ name: 'Stake Tokens',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Quarry,
+ },
+ [InstructionEnum.QuarryWithdrawTokens]: {
+ name: 'Withdraw Tokens',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Quarry,
+ },
+ [InstructionEnum.TribecaCreateEpochGauge]: {
+ name: 'Create Epoch Gauge',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Tribeca,
+ },
+ [InstructionEnum.TribecaCreateEscrowGovernanceTokenATA]: {
+ name: 'Create Escrow Governance Token ATA',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Tribeca,
+ },
+ [InstructionEnum.TribecaCreateGaugeVote]: {
+ name: 'Create Gauge Vote',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Tribeca,
+ },
+ [InstructionEnum.TribecaCreateGaugeVoter]: {
+ name: 'Create Gauge Voter',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Tribeca,
+ },
+ [InstructionEnum.TribecaGaugeCommitVote]: {
+ name: 'Gauge Commit Vote',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Tribeca,
+ },
+ [InstructionEnum.TribecaGaugeRevertVote]: {
+ name: 'Gauge Revert Vote',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Tribeca,
+ },
+ [InstructionEnum.TribecaLock]: {
+ name: 'Lock Tokens',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Tribeca,
+ },
+ [InstructionEnum.TribecaNewEscrow]: {
+ name: 'New Escrow',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Tribeca,
+ },
+ [InstructionEnum.TribecaPrepareEpochGaugeVoter]: {
+ name: 'Prepare Epoch Gauge Voter',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Tribeca,
+ },
+ [InstructionEnum.TribecaResetEpochGaugeVoter]: {
+ name: 'Reset Epoch Gauge Voter',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Tribeca,
+ },
+ [InstructionEnum.TribecaGaugeSetVote]: {
+ name: 'Set Gauge Vote',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Tribeca,
+ },
+ [InstructionEnum.SoceanMintBondedTokens]: {
+ name: 'Mint Bonded Tokens',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Socean,
+ },
+ [InstructionEnum.SoceanDepositToAuctionPool]: {
+ name: 'Deposit to Auction',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Socean,
+ },
+ [InstructionEnum.SoceanPurchaseBondedTokens]: {
+ name: 'Purchase Bonded Tokens',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Socean,
+ },
+ [InstructionEnum.SoceanCloseAuction]: {
+ name: 'Close Auction',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Socean,
+ },
+ [InstructionEnum.SoceanVest]: {
+ name: 'Vest',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Socean,
+ },
+ [InstructionEnum.SoceanCancelVest]: {
+ name: 'Cancel Vest',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Socean,
+ },
+ [InstructionEnum.SolendCreateObligationAccount]: {
name: 'Solend: Create Obligation Account',
isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Solend,
},
- {
- id: Instructions.InitSolendObligationAccount,
- name: 'Solend: Init Obligation Account',
+ [InstructionEnum.SolendCreateObligationAccount]: {
+ name: 'Create Obligation Account',
isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Solend,
},
- {
- id: Instructions.DepositReserveLiquidityAndObligationCollateral,
- name: 'Solend: Deposit Funds',
+ [InstructionEnum.SolendInitObligationAccount]: {
+ name: 'Init Obligation Account',
isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Solend,
},
- {
- id: Instructions.RefreshSolendReserve,
- name: 'Solend: Refresh Reserve',
+ [InstructionEnum.SolendDepositReserveLiquidityAndObligationCollateral]: {
+ name: 'Deposit Funds',
isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Solend,
},
- {
- id: Instructions.RefreshSolendObligation,
- name: 'Solend: Refresh Obligation',
+ [InstructionEnum.SolendRefreshReserve]: {
+ name: 'Refresh Reserve',
isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Solend,
},
- {
- id: Instructions.WithdrawObligationCollateralAndRedeemReserveLiquidity,
- name: 'Solend: Withdraw Funds',
+ [InstructionEnum.SolendRefreshObligation]: {
+ name: 'Refresh Obligation',
isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Solend,
},
- {
- id: Instructions.ProgramUpgrade,
+ [InstructionEnum.SolendWithdrawObligationCollateralAndRedeemReserveLiquidity]: {
+ name: 'Withdraw Funds',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Solend,
+ },
+ [InstructionEnum.SaberPoolsDeposit]: {
+ name: 'Pool Deposit',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Saber,
+ },
+ [InstructionEnum.SaberPoolsWithdrawOne]: {
+ name: 'Withdraw One From Pool',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Saber,
+ },
+ [InstructionEnum.SaberPoolsSwap]: {
+ name: 'Swap',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Saber,
+ tag: 'beta',
+ },
+ [InstructionEnum.SaberPeripheryRedeemAllTokensFromMintProxy]: {
+ name: 'Redeem All Tokens From Mint Proxy',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Saber,
+ },
+ [InstructionEnum.UXDInitializeController]: {
+ name: 'Initialize Controller',
+ isVisible: canUseUxdInstructions,
+ packageId: PackageEnum.UXD,
+ },
+ [InstructionEnum.UXDSetRedeemableGlobalSupplyCap]: {
+ name: 'Set Redeemable Global Supply Cap',
+ isVisible: canUseUxdInstructions,
+ packageId: PackageEnum.UXD,
+ },
+ [InstructionEnum.UXDSetMangoDepositoriesRedeemableSoftCap]: {
+ name: 'Set Mango Depositories Redeemable Supply Soft Cap',
+ isVisible: canUseUxdInstructions,
+ packageId: PackageEnum.UXD,
+ },
+ [InstructionEnum.UXDRegisterMangoDepository]: {
+ name: 'Register Mango Depository',
+ isVisible: canUseUxdInstructions,
+ packageId: PackageEnum.UXD,
+ },
+ [InstructionEnum.UXDDepositInsuranceToMangoDepository]: {
+ name: 'Deposit Insurance To Mango Depository',
+ isVisible: canUseUxdInstructions,
+ packageId: PackageEnum.UXD,
+ },
+ [InstructionEnum.UXDWithdrawInsuranceFromMangoDepository]: {
+ name: 'Withdraw Insurance From Mango Depository',
+ isVisible: canUseUxdInstructions,
+ packageId: PackageEnum.UXD,
+ },
+ [InstructionEnum.UXDDisableDepositoryMinting]: {
+ name: 'Disable Depository Minting',
+ isVisible: canUseUxdInstructions,
+ packageId: PackageEnum.UXD,
+ tag: 'beta',
+ },
+ [InstructionEnum.UXDQuoteMintWithMangoDepository]: {
+ name: 'Quote Mint With Mango Depository',
+ isVisible: canUseUxdInstructions,
+ packageId: PackageEnum.UXD,
+ tag: 'beta',
+ },
+ [InstructionEnum.UXDQuoteRedeemWithMangoDepository]: {
+ name: 'Quote Redeem With Mango Depository',
+ isVisible: canUseUxdInstructions,
+ packageId: PackageEnum.UXD,
+ tag: 'beta',
+ },
+ [InstructionEnum.UXDSetMangoDepositoryQuoteMintAndRedeemFee]: {
+ name: 'Set Mango Depository Quote Mint And Redeem Fee',
+ isVisible: canUseUxdInstructions,
+ packageId: PackageEnum.UXD,
+ tag: 'beta',
+ },
+ [InstructionEnum.UXDSetMangoDepositoryQuoteMintAndRedeemSoftCap]: {
+ name: 'Set Mango Depository Quote Mint And Redeem Soft Cap',
+ isVisible: canUseUxdInstructions,
+ packageId: PackageEnum.UXD,
+ tag: 'beta',
+ },
+ [InstructionEnum.RaydiumAddLiquidity]: {
+ name: 'Add To Liquidity Pool',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Raydium,
+ },
+ [InstructionEnum.RaydiumRemoveLiquidity]: {
+ name: 'Remove From Liquidity Pool',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Raydium,
+ },
+ [InstructionEnum.FriktionDepositIntoVolt]: {
+ name: 'Deposit into Volt',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Friktion,
+ },
+ [InstructionEnum.FriktionWithdrawFromVolt]: {
+ name: 'Withdraw from Volt',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Friktion,
+ tag: 'beta',
+ },
+ [InstructionEnum.FriktionClaimWithdrawal]: {
+ name: 'Claim Pending Withdrawal',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Friktion,
+ tag: 'beta',
+ },
+ [InstructionEnum.Transfer]: {
+ name: 'Transfer Tokens From Treasuries',
+ isVisible: canUseTokenTransferInstruction,
+ packageId: PackageEnum.Native,
+ tag: 'deprecated',
+ },
+ [InstructionEnum.CreateAssociatedTokenAccount]: {
+ name: 'Create Associated Token Account',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Native,
+ },
+ [InstructionEnum.ProgramUpgrade]: {
name: 'Upgrade Program',
isVisible: canUseProgramUpgradeInstruction,
+ packageId: PackageEnum.Native,
+ },
+ [InstructionEnum.SetProgramAuthority]: {
+ name: 'Set Program Authority',
+ isVisible: canUseProgramUpgradeInstruction,
+ packageId: PackageEnum.Native,
},
- {
- id: Instructions.Mint,
+ [InstructionEnum.Mint]: {
name: 'Mint Tokens',
isVisible: canUseMintInstruction,
+ packageId: PackageEnum.Native,
+ tag: 'deprecated',
},
- {
- id: Instructions.Base64,
+ [InstructionEnum.Base64]: {
name: 'Execute Custom Instruction',
isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Native,
},
- {
- id: Instructions.MangoMakeChangeMaxAccounts,
- name: 'Mango - change max accounts',
- isVisible: canUseProgramUpgradeInstruction && symbol === 'MNGO',
- },
- {
- id: Instructions.MangoChangeReferralFeeParams,
- name: 'Mango - change referral fee params',
- isVisible: canUseProgramUpgradeInstruction && symbol === 'MNGO',
- },
- {
- id: Instructions.None,
+ [InstructionEnum.None]: {
name: 'None',
- isVisible:
+ isVisible: !!(
realm &&
Object.values(governances).some((g) =>
- ownVoterWeight.canCreateProposal(g.account.config)
- ),
+ ownVoterWeight.canCreateProposal(g.account.config),
+ )
+ ),
+ packageId: PackageEnum.Native,
+ },
+ [InstructionEnum.UXDStakingMigrateStakingCampaignFromV1ToV2]: {
+ name: 'Migrate Staking Campaign From v1 to v2',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.UXDStaking,
+ },
+ [InstructionEnum.UXDStakingInitializeStakingCampaign]: {
+ name: 'Initialize Staking Campaign',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.UXDStaking,
},
- ]
+ [InstructionEnum.UXDStakingFinalizeStakingCampaign]: {
+ name: 'Finalize Staking Campaign',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.UXDStaking,
+ },
+ [InstructionEnum.UXDStakingAddStakingOption]: {
+ name: 'Add Staking Option',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.UXDStaking,
+ },
+ [InstructionEnum.UXDStakingActivateStakingOption]: {
+ name: 'Activate Staking Option',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.UXDStaking,
+ },
+ [InstructionEnum.UXDStakingRefillRewardVault]: {
+ name: 'Refill Reward Vault',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.UXDStaking,
+ },
+ [InstructionEnum.NativeTransferTokensForm]: {
+ name: 'Transfer Tokens',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Native,
+ tag: 'beta',
+ },
+ [InstructionEnum.DeltafiCreateLiquidityProvider]: {
+ name: 'Create Liquidity Provider',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Deltafi,
+ tag: 'beta',
+ },
+ [InstructionEnum.DeltafiPoolDeposit]: {
+ name: 'Deposit Tokens to Pool',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Deltafi,
+ tag: 'beta',
+ },
+ [InstructionEnum.DeltafiPoolWithdraw]: {
+ name: 'Withdraw Tokens from Pool',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Deltafi,
+ tag: 'beta',
+ },
+ [InstructionEnum.DeltafiCreateFarmUser]: {
+ name: 'Create Farm User',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Deltafi,
+ tag: 'beta',
+ },
+ [InstructionEnum.DeltafiFarmDeposit]: {
+ name: 'Deposit Tokens to Farm',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Deltafi,
+ tag: 'beta',
+ },
+ [InstructionEnum.DeltafiFarmWithdraw]: {
+ name: 'Withdraw Tokens from Farm',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Deltafi,
+ tag: 'beta',
+ },
+ [InstructionEnum.NativeBurnSplTokens]: {
+ name: 'Burn SPL Tokens',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Native,
+ tag: 'beta',
+ },
+ [InstructionEnum.OrcaWhirlpoolOpenPosition]: {
+ name: 'Orca Whirlpool Open Position',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Orca,
+ tag: 'beta',
+ },
+ [InstructionEnum.OrcaWhirlpoolIncreaseLiquidity]: {
+ name: 'Orca Whirlpool Increase Liquidity',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Orca,
+ tag: 'beta',
+ },
+ [InstructionEnum.OrcaWhirlpoolUpdateFeesAndRewards]: {
+ name: 'Orca Whirlpool Update Fees and Rewards',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Orca,
+ tag: 'beta',
+ },
+ [InstructionEnum.OrcaWhirlpoolCollectFees]: {
+ name: 'Orca Whirlpool Collect Fees',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Orca,
+ tag: 'beta',
+ },
+ [InstructionEnum.OrcaWhirlpoolDecreaseLiquidity]: {
+ name: 'Orca Whirlpool Decrease Liquidity',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Orca,
+ tag: 'beta',
+ },
+ [InstructionEnum.OrcaWhirlpoolClosePosition]: {
+ name: 'Orca Whirlpool Close Position',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Orca,
+ tag: 'beta',
+ },
+ [InstructionEnum.OrcaWhirlpoolSwap]: {
+ name: 'Orca Whirlpool Swap',
+ isVisible: canUseAnyInstruction,
+ packageId: PackageEnum.Orca,
+ tag: 'beta',
+ },
+ };
+
+ const availableInstructions = Object.entries(instructions)
+ .filter(
+ ([, { isVisible }]) => typeof isVisible === 'undefined' || isVisible,
+ )
+ .map(([id, { name, packageId, tag }]) => ({
+ id: Number(id) as InstructionEnum,
+ name,
+ packageId,
+ tag,
+ }));
+
+ const availablePackages: PackageType[] = Object.entries(packages).map(
+ ([id, infos]) => ({
+ id: Number(id) as PackageEnum,
+ ...infos,
+ }),
+ );
+
+ const getPackageTypeById = (packageId: PackageEnum) => {
+ return availablePackages.find(
+ (availablePackage) => availablePackage.id === packageId,
+ );
+ };
return {
governancesArray,
getGovernancesByAccountType,
getGovernancesByAccountTypes,
+ availablePackages,
availableInstructions,
- getAvailableInstructions,
governedTokenAccounts,
getMintWithGovernances,
+ getPackageTypeById,
canUseTransferInstruction,
canUseMintInstruction,
canMintRealmCommunityToken,
@@ -237,5 +701,5 @@ export default function useGovernanceAssets() {
canUseProgramUpgradeInstruction,
governedTokenAccountsWithoutNfts,
nftsGovernedTokenAccounts,
- }
+ };
}
diff --git a/hooks/useGovernanceUnderlyingTokenAccounts.ts b/hooks/useGovernanceUnderlyingTokenAccounts.ts
new file mode 100644
index 0000000000..563ab702fc
--- /dev/null
+++ b/hooks/useGovernanceUnderlyingTokenAccounts.ts
@@ -0,0 +1,160 @@
+import BigNumber from 'bignumber.js';
+import { useCallback, useEffect, useState } from 'react';
+import { Connection, PublicKey } from '@solana/web3.js';
+import { BN } from '@project-serum/anchor';
+import { SPL_TOKENS } from '@utils/splTokens';
+import { getOwnedTokenAccounts, tryGetMint } from '@utils/tokens';
+import useWalletStore from 'stores/useWalletStore';
+import { abbreviateAddress } from '@utils/formatting';
+import { findATAAddrSync } from '@utils/ataTools';
+
+export type OwnedTokenAccountInfo = {
+ pubkey: PublicKey;
+ mint: PublicKey;
+ amount: BN;
+ uiAmount: number;
+ mintDecimals: number;
+ mintName: string;
+
+ // could be either the Associated Token Account of the mint
+ // or a Token Account
+ isATA: boolean;
+};
+
+export type OwnedTokenAccountsInfo = {
+ [key: string]: OwnedTokenAccountInfo;
+};
+
+function getSplTokenNameFromConstant(tokenMint: PublicKey): string {
+ return (
+ Object.values(SPL_TOKENS).find(({ mint }) => mint.equals(tokenMint))
+ ?.name ?? abbreviateAddress(tokenMint)
+ );
+}
+
+async function getMultipleMintsInfo(
+ mints: PublicKey[],
+ connection: Connection,
+) {
+ const mintInfos = await Promise.all(
+ mints.map((mint) => tryGetMint(connection, mint)),
+ );
+
+ return mintInfos.reduce(
+ (mintInfos, mintInfo, index) => {
+ if (!mintInfo) {
+ throw new Error(
+ `Cannot load mint info about ${mints[index].toString()}`,
+ );
+ }
+
+ const {
+ publicKey,
+ account: { decimals },
+ } = mintInfo;
+
+ return {
+ ...mintInfos,
+
+ [publicKey.toString()]: {
+ mint: publicKey,
+ decimals,
+ name: getSplTokenNameFromConstant(publicKey),
+ },
+ };
+ },
+ {} as {
+ [key: string]: {
+ mint: PublicKey;
+ decimals: number;
+ name: string;
+ };
+ },
+ );
+}
+
+// Loads all the token accounts related to the governance public key
+export default function useGovernanceUnderlyingTokenAccounts(
+ governancePk?: PublicKey,
+) {
+ const connection = useWalletStore((state) => state.connection);
+
+ const [
+ ownedTokenAccountsInfo,
+ setOwnedTokenAccountsInfo,
+ ] = useState(null);
+
+ const getOwnedTokenAccountsFn = useCallback(async () => {
+ if (!connection || !governancePk) return null;
+
+ const accounts = await getOwnedTokenAccounts(
+ connection.current,
+ governancePk,
+ );
+
+ // Create a map with all token accounts info
+ const ownedTokenAccountsInfo = accounts.reduce(
+ (ownedTokenAccountsInfo, { publicKey, account: { mint, amount } }) => ({
+ ...ownedTokenAccountsInfo,
+
+ [publicKey.toBase58()]: {
+ pubkey: publicKey,
+ amount: new BN(amount.toString()),
+ mint,
+ },
+ }),
+ {} as {
+ [key: string]: Pick<
+ OwnedTokenAccountInfo,
+ 'pubkey' | 'amount' | 'mint'
+ >;
+ },
+ );
+
+ const uniqueMintList = [
+ ...new Set(Object.values(ownedTokenAccountsInfo).map(({ mint }) => mint)),
+ ];
+
+ // Get decimal/name information about the mint
+ const mintsInfo = await getMultipleMintsInfo(
+ uniqueMintList,
+ connection.current,
+ );
+
+ // Merge mint info with ownedTokenAccountsInfo
+ return Object.entries(ownedTokenAccountsInfo).reduce(
+ (accounts, [pubkeyString, account]) => {
+ const { decimals: mintDecimals, name: mintName } = mintsInfo[
+ account.mint.toString()
+ ];
+
+ const [ata] = findATAAddrSync(governancePk, account.mint);
+
+ return {
+ ...accounts,
+
+ [pubkeyString]: {
+ ...account,
+
+ mintDecimals,
+ mintName,
+ uiAmount: new BigNumber(account.amount.toString())
+ .shiftedBy(-mintDecimals)
+ .toNumber(),
+
+ isATA: ata.equals(account.pubkey),
+ },
+ };
+ },
+ {} as OwnedTokenAccountsInfo,
+ );
+ }, [connection, governancePk]);
+
+ useEffect(() => {
+ getOwnedTokenAccountsFn().then(setOwnedTokenAccountsInfo);
+ }, [getOwnedTokenAccountsFn]);
+
+ return {
+ ownedTokenAccountsInfo,
+ };
+}
diff --git a/hooks/useGovernedMultiTypeAccounts.ts b/hooks/useGovernedMultiTypeAccounts.ts
index acb2f4f23a..acc7b62a79 100644
--- a/hooks/useGovernedMultiTypeAccounts.ts
+++ b/hooks/useGovernedMultiTypeAccounts.ts
@@ -1,68 +1,97 @@
-import { GovernedMultiTypeAccount } from '@utils/tokens'
-import { useCallback, useEffect, useState } from 'react'
-import useGovernanceAssets from './useGovernanceAssets'
+import { GovernanceAccountType } from '@solana/spl-governance';
+import { PublicKey } from '@solana/web3.js';
+import { GovernedMultiTypeAccount, GovernedTokenAccount } from '@utils/tokens';
+import { useCallback, useEffect, useState } from 'react';
+import useGovernanceAssets from './useGovernanceAssets';
export default function useGovernedMultiTypeAccounts() {
const {
getMintWithGovernances,
governancesArray,
governedTokenAccounts,
- } = useGovernanceAssets()
+ } = useGovernanceAssets();
const [governedMultiTypeAccounts, setGovernedMultiTypeAccounts] = useState<
GovernedMultiTypeAccount[]
- >([])
+ >([]);
const getGovernedMultiTypeAccounts = useCallback(async (): Promise<
GovernedMultiTypeAccount[]
> => {
- const mintWithGovernances = await getMintWithGovernances()
+ const mintWithGovernances = await getMintWithGovernances();
return governancesArray.map((gov) => {
const governedTokenAccount = governedTokenAccounts.find((tokenAcc) =>
- tokenAcc.governance?.pubkey.equals(gov.pubkey)
- )
+ tokenAcc.governance?.pubkey.equals(gov.pubkey),
+ );
if (governedTokenAccount) {
- return governedTokenAccount as GovernedMultiTypeAccount
+ return governedTokenAccount as GovernedMultiTypeAccount;
}
const mintGovernance = mintWithGovernances.find((mint) =>
- mint.governance?.pubkey.equals(gov.pubkey)
- )
+ mint.governance?.pubkey.equals(gov.pubkey),
+ );
if (mintGovernance) {
- return mintGovernance as GovernedMultiTypeAccount
+ return mintGovernance as GovernedMultiTypeAccount;
}
return {
governance: gov,
- }
- })
+ };
+ });
// FIXME: `governedTokenAccounts` & `governancesArray` should have stable references.
// These should respect immutability principles & only change if their content changes.
// Working around this by stringifying both objects & using the resulting string
// representation as hook dependency, so the hook only runs when either of these changes,
// but with a performance tax unfortunately
- }, [JSON.stringify(governedTokenAccounts), JSON.stringify(governancesArray)])
+ }, [JSON.stringify(governedTokenAccounts), JSON.stringify(governancesArray)]);
useEffect(() => {
// Ignore obsolete results created by race calls
- let abort = false
+ let abort = false;
- ;(async () => {
- const governedMultiTypeAccounts = await getGovernedMultiTypeAccounts()
+ (async () => {
+ const governedMultiTypeAccounts = await getGovernedMultiTypeAccounts();
- if (abort) return
+ if (abort) return;
- setGovernedMultiTypeAccounts(governedMultiTypeAccounts)
- })()
+ setGovernedMultiTypeAccounts(governedMultiTypeAccounts);
+ })();
return () => {
- abort = true
+ abort = true;
+ };
+ }, [getGovernedMultiTypeAccounts]);
+
+ const getGovernedAccountPublicKey = useCallback((
+ governedAccount: GovernedMultiTypeAccount | undefined,
+
+ // can force the fact to use the owner for SOL Token Governance
+ forceToUseSolTokenGovernanceOwner?: boolean,
+ ): PublicKey | undefined => {
+ if (!governedAccount || !governedAccount.governance) {
+ return;
}
- }, [getGovernedMultiTypeAccounts])
+
+ const accountType = governedAccount.governance.account.accountType;
+
+ if (
+ accountType === GovernanceAccountType.TokenGovernanceV1 ||
+ accountType === GovernanceAccountType.TokenGovernanceV2
+ ) {
+ const programGovernedAccount = governedAccount as GovernedTokenAccount;
+
+ if (programGovernedAccount.isSol && !forceToUseSolTokenGovernanceOwner) {
+ return programGovernedAccount.transferAddress ?? undefined;
+ }
+ }
+
+ return governedAccount.governance.pubkey;
+ }, []);
return {
governedMultiTypeAccounts,
- }
+ getGovernedAccountPublicKey,
+ };
}
diff --git a/hooks/useHasVoteTimeExpired.ts b/hooks/useHasVoteTimeExpired.ts
index e1e5f341f0..a58bb2a5cb 100644
--- a/hooks/useHasVoteTimeExpired.ts
+++ b/hooks/useHasVoteTimeExpired.ts
@@ -1,10 +1,10 @@
-import { Governance, Proposal } from '@solana/spl-governance'
-import { ProgramAccount } from '@solana/spl-governance'
-import { useIsBeyondTimestamp } from './useIsBeyondTimestamp'
+import { Governance, Proposal } from '@solana/spl-governance';
+import { ProgramAccount } from '@solana/spl-governance';
+import { useIsBeyondTimestamp } from './useIsBeyondTimestamp';
export const useHasVoteTimeExpired = (
governance: ProgramAccount | undefined,
- proposal: ProgramAccount
+ proposal: ProgramAccount,
) => {
return useIsBeyondTimestamp(
proposal
@@ -14,6 +14,6 @@ export const useHasVoteTimeExpired = (
? proposal.account.votingAt.toNumber() +
governance.account.config.maxVotingTime
: undefined
- : undefined
- )
-}
+ : undefined,
+ );
+};
diff --git a/hooks/useHotWallet.ts b/hooks/useHotWallet.ts
new file mode 100644
index 0000000000..9221db8db0
--- /dev/null
+++ b/hooks/useHotWallet.ts
@@ -0,0 +1,49 @@
+import { PublicKey } from '@solana/web3.js';
+import { useEffect, useState } from 'react';
+import useRealm from './useRealm';
+
+const RealmsHotWallet = {
+ UXDProtocol: {
+ name: `SOL Treasury's Owner`,
+ publicKey: new PublicKey('7M6TSEkRiXiYmpRCcCDSdJGTGxAPem2HBqjW4gLQ2KoE'),
+ },
+
+ 'Kek World': {
+ name: `SOL Treasury's Owner`,
+ publicKey: new PublicKey('AuQHcJZhTd1dnXRrM78RomFiCvW6a9CqxxJ94Fp9h8b'),
+ },
+
+ // Devnet realm
+ 'kek world': {
+ name: `SOL Treasury's Owner`,
+ publicKey: new PublicKey('AWuSjBCEMVtk8fX2HAwtuMjoHLmLM72PJxi1dZdKHPFu'),
+ },
+
+ // <---- declare your realm hot wallet here
+};
+
+export type HotWalletAccount = {
+ name: string;
+ publicKey: PublicKey;
+};
+
+const useHotWallet = () => {
+ const { realm } = useRealm();
+
+ const [hotWalletAccount, setHotWalletAccount] = useState<{
+ name: string;
+ publicKey: PublicKey;
+ } | null>(null);
+
+ useEffect(() => {
+ if (!realm) return;
+
+ setHotWalletAccount(RealmsHotWallet[realm.account.name] ?? null);
+ }, [realm]);
+
+ return {
+ hotWalletAccount,
+ };
+};
+
+export default useHotWallet;
diff --git a/hooks/useHotWalletPluginTokenAccounts.ts b/hooks/useHotWalletPluginTokenAccounts.ts
new file mode 100644
index 0000000000..98c44a37eb
--- /dev/null
+++ b/hooks/useHotWalletPluginTokenAccounts.ts
@@ -0,0 +1,126 @@
+import { MintInfo, u64 } from '@solana/spl-token';
+import BigNumber from 'bignumber.js';
+import { PublicKey } from '@solana/web3.js';
+import {
+ getOwnedTokenAccounts,
+ TokenProgramAccount,
+ tryGetMint,
+} from '@utils/tokens';
+import { useCallback, useEffect, useState } from 'react';
+import useWalletStore from 'stores/useWalletStore';
+import tokenService from '@utils/services/token';
+import { BN } from '@project-serum/anchor';
+import { HotWalletAccount } from './useHotWallet';
+import { getSplTokenNameByMint } from '@utils/splTokens';
+
+export type HotWalletTokenAccounts = {
+ publicKey: PublicKey;
+ mint: PublicKey;
+ decimals: number;
+ amount: u64;
+ mintName?: string;
+ usdMintValue: number;
+ usdTotalValue: u64;
+}[];
+
+const useHotWalletPluginTokenAccounts = (
+ hotWalletAccount: HotWalletAccount,
+) => {
+ const connection = useWalletStore((store) => store.connection);
+ const [
+ tokenAccounts,
+ setTokenAccounts,
+ ] = useState(null);
+
+ const loadTokenAccounts = useCallback(async () => {
+ if (!connection.current) return [];
+
+ const ownedTokenAccounts = await getOwnedTokenAccounts(
+ connection.current,
+ hotWalletAccount.publicKey,
+ );
+
+ const tokenMintAddresses = [
+ ...new Set(ownedTokenAccounts.map(({ account: { mint } }) => mint)),
+ ];
+
+ const mintInfos = (
+ await Promise.all(
+ tokenMintAddresses.map((tokenMintAddress) =>
+ tryGetMint(connection.current, tokenMintAddress),
+ ),
+ )
+ ).reduce(
+ (acc, mintInfo, index) => {
+ if (!mintInfo)
+ throw new Error(
+ `Cannot load mint info ${tokenMintAddresses[index].toBase58()}`,
+ );
+
+ acc[mintInfo.publicKey.toBase58()] = {
+ ...mintInfo,
+ name: getSplTokenNameByMint(mintInfo.publicKey),
+ usdValue: tokenService.getUSDTokenPrice(
+ mintInfo.publicKey.toBase58(),
+ ),
+ };
+
+ return acc;
+ },
+ {} as {
+ [key: string]: TokenProgramAccount & {
+ name?: string;
+ usdValue: number;
+ };
+ },
+ );
+
+ return ownedTokenAccounts
+ .map((tokenAccount) => {
+ const mintInfo = mintInfos[tokenAccount.account.mint.toBase58()];
+
+ return {
+ mint: tokenAccount.account.mint,
+ publicKey: tokenAccount.publicKey,
+ amount: tokenAccount.account.amount,
+ decimals: mintInfo.account.decimals,
+ mintName: mintInfo.name,
+ usdMintValue: mintInfo.usdValue,
+ usdTotalValue: new BN(
+ new BigNumber(tokenAccount.account.amount.toString())
+ .multipliedBy(mintInfo.usdValue)
+ .integerValue()
+ .toString(),
+ ),
+ };
+ })
+ .sort((a, b) => (b.amount.toString() < a.amount.toString() ? -1 : 1));
+ }, [
+ connection,
+ JSON.stringify(tokenService._tokenPriceToUSDlist),
+ hotWalletAccount,
+ ]);
+
+ useEffect(() => {
+ // add a cancel
+ let quit = false;
+
+ loadTokenAccounts().then((infos) => {
+ if (quit) {
+ return;
+ }
+
+ setTokenAccounts(infos);
+ });
+
+ return () => {
+ quit = true;
+ };
+ }, [loadTokenAccounts]);
+
+ return {
+ tokenAccounts,
+ };
+};
+
+export default useHotWalletPluginTokenAccounts;
diff --git a/hooks/useHotWalletPluginUXDStaking.ts b/hooks/useHotWalletPluginUXDStaking.ts
new file mode 100644
index 0000000000..a19c78e8b6
--- /dev/null
+++ b/hooks/useHotWalletPluginUXDStaking.ts
@@ -0,0 +1,127 @@
+import { useCallback, useEffect, useState } from 'react';
+import { HotWalletAccount } from './useHotWallet';
+import uxdProtocolStakingConfiguration from '@tools/sdk/uxdProtocolStaking/configuration';
+import useWalletStore from 'stores/useWalletStore';
+import { PublicKey } from '@solana/web3.js';
+import {
+ StakingCampaign,
+ getTokenAccountUiBalance,
+} from '@uxdprotocol/uxd-staking-client';
+import { nativeAmountToFormattedUiAmount } from '@tools/sdk/units';
+import useSingleSideStakingClient from './useSingleSideStakingClient';
+
+const UsersCampaigns = {
+ ['AWuSjBCEMVtk8fX2HAwtuMjoHLmLM72PJxi1dZdKHPFu']: [
+ // Fake Dao devnet SOL Treasury's governance
+ {
+ name: 'Campaign Name',
+ pda: new PublicKey('Hkzqzfy9VKd5SNeMZnN1Yq49MjrjUzoXxqevFEMxQZFx'),
+ },
+ ],
+
+ ['AuQHcJZhTd1dnXRrM78RomFiCvW6a9CqxxJ94Fp9h8b']: [
+ // Fake Dao SOL Treasury's governance
+ {
+ name: 'Campaign Test',
+ pda: new PublicKey('C37FJ2JeDciaEs1nKazMkkH21VZjQVq4WTMLSJYiibRr'),
+ },
+ ],
+
+ ['7M6TSEkRiXiYmpRCcCDSdJGTGxAPem2HBqjW4gLQ2KoE']: [
+ // Dao SOL Treasury's governance
+ {
+ name: 'UXP Campaign',
+ pda: new PublicKey('GMkG1Xr1ZAtLbHRxfbqLFEHqjP7rGwEfhQFed41aEL1k'),
+ },
+ ],
+};
+
+export type StakingCampaignInfo = StakingCampaign & {
+ name: string;
+ pda: PublicKey;
+
+ // Token staked on staking accounts v1
+ uiStakedTokensV1: number;
+ uiStakedTokensV2: number;
+};
+
+const useHotWalletPluginUXDStaking = (hotWalletAccount: HotWalletAccount) => {
+ const [stakingCampaignsInfo, setStakingCampaignsInfo] = useState<
+ StakingCampaignInfo[]
+ >();
+ const connection = useWalletStore((s) => s.connection);
+ const { client: sssClient } = useSingleSideStakingClient();
+
+ const loadUXDStakingCampaignInfo = useCallback(async () => {
+ try {
+ const programId =
+ uxdProtocolStakingConfiguration.programId[connection.cluster];
+
+ if (!programId || !sssClient) {
+ return [];
+ }
+
+ const campaigns =
+ UsersCampaigns[hotWalletAccount.publicKey.toBase58()] ?? [];
+
+ const stakingCampaigns: StakingCampaign[] = await Promise.all(
+ campaigns.map(({ pda }) => sssClient.getOnChainStakingCampaign(pda)),
+ );
+
+ const uiStakedTokensStakingAccountsV1: PromiseSettledResult[] = await Promise.allSettled(
+ stakingCampaigns.map(({ stakedVault }) =>
+ getTokenAccountUiBalance({
+ connection: connection.current,
+ tokenAccount: stakedVault,
+ }),
+ ),
+ );
+
+ return stakingCampaigns.map((stakingCampaign, index) => {
+ const uiStakedTokensV1 = uiStakedTokensStakingAccountsV1[index];
+
+ return {
+ ...stakingCampaign,
+ uiStakedTokensV1:
+ uiStakedTokensV1.status === 'rejected' ? 0 : uiStakedTokensV1.value,
+ uiStakedTokensV2: Number(
+ nativeAmountToFormattedUiAmount(
+ stakingCampaign.stakedAmount,
+ stakingCampaign.stakedMintDecimals,
+ ),
+ ),
+ name: campaigns[index].name,
+ pda: campaigns[index].pda,
+ };
+ });
+ } catch (e) {
+ console.error(e);
+ return [];
+ }
+ }, [connection, hotWalletAccount, sssClient]);
+
+ useEffect(() => {
+ loadUXDStakingCampaignInfo();
+ }, [loadUXDStakingCampaignInfo]);
+
+ useEffect(() => {
+ // add a cancel
+ let quit = false;
+
+ loadUXDStakingCampaignInfo().then((infos) => {
+ if (quit) {
+ return;
+ }
+
+ setStakingCampaignsInfo(infos);
+ });
+
+ return () => {
+ quit = true;
+ };
+ }, [loadUXDStakingCampaignInfo]);
+
+ return { stakingCampaignsInfo };
+};
+
+export default useHotWalletPluginUXDStaking;
diff --git a/hooks/useHydrateStore.tsx b/hooks/useHydrateStore.tsx
index 128cc4524d..bbdc6b8373 100644
--- a/hooks/useHydrateStore.tsx
+++ b/hooks/useHydrateStore.tsx
@@ -1,20 +1,22 @@
-import { useRouter } from 'next/router'
-import { useEffect } from 'react'
-import useWalletStore from '../stores/useWalletStore'
+import { useRouter } from 'next/router';
+import { useEffect } from 'react';
+import useWalletStore from '../stores/useWalletStore';
export default function useHydrateStore() {
- const router = useRouter()
- const { symbol, cluster, pk } = router.query
- const selectedRealmMints = useWalletStore((s) => s.selectedRealm.mints)
- const { fetchRealmBySymbol, fetchProposal } = useWalletStore((s) => s.actions)
+ const router = useRouter();
+ const { symbol, cluster, pk } = router.query;
+ const selectedRealmMints = useWalletStore((s) => s.selectedRealm.mints);
+ const { fetchRealmBySymbol, fetchProposal } = useWalletStore(
+ (s) => s.actions,
+ );
useEffect(() => {
- fetchRealmBySymbol(cluster as string, symbol as string)
- }, [symbol, cluster])
+ fetchRealmBySymbol(cluster as string, symbol as string);
+ }, [symbol, cluster]);
useEffect(() => {
if (pk && Object.entries(selectedRealmMints).length > 0) {
- fetchProposal(pk)
+ fetchProposal(pk);
}
- }, [pk, selectedRealmMints])
+ }, [pk, selectedRealmMints]);
}
diff --git a/hooks/useInstructionFormBuilder.ts b/hooks/useInstructionFormBuilder.ts
new file mode 100644
index 0000000000..0ac1304ed8
--- /dev/null
+++ b/hooks/useInstructionFormBuilder.ts
@@ -0,0 +1,161 @@
+import { useContext, useEffect, useState } from 'react';
+import * as yup from 'yup';
+import { serializeInstructionToBase64 } from '@solana/spl-governance';
+import { Connection, PublicKey, TransactionInstruction } from '@solana/web3.js';
+import { debounce } from '@utils/debounce';
+import { isFormValid } from '@utils/formValidation';
+import { GovernedMultiTypeAccount } from '@utils/tokens';
+import { FormInstructionData } from '@utils/uiTypes/proposalCreationTypes';
+
+import { NewProposalContext } from 'pages/dao/[symbol]/proposal/new';
+import useWalletStore from 'stores/useWalletStore';
+import { SignerWalletAdapter } from '@solana/wallet-adapter-base';
+import useGovernedMultiTypeAccounts from './useGovernedMultiTypeAccounts';
+import { EndpointTypes } from '@models/types';
+
+export type SerializedInstruction = string;
+
+function useInstructionFormBuilder<
+ T extends {
+ governedAccount?: GovernedMultiTypeAccount;
+ }
+>({
+ index,
+ initialFormValues,
+ schema,
+ buildInstruction,
+ getCustomHoldUpTime,
+ shouldSplitIntoSeparateTxs = false,
+}: {
+ index: number;
+ initialFormValues: T;
+ schema: yup.ObjectSchema<
+ {
+ [key in keyof T]: yup.AnySchema;
+ }
+ >;
+ buildInstruction?: ({
+ form,
+ connection,
+ cluster,
+ wallet,
+ governedAccountPubkey,
+ }: {
+ form: T;
+ connection: Connection;
+ cluster: EndpointTypes;
+ wallet: SignerWalletAdapter;
+ governedAccountPubkey: PublicKey;
+ }) => Promise;
+ getCustomHoldUpTime?: () => Promise;
+ shouldSplitIntoSeparateTxs?: boolean;
+}) {
+ const connection = useWalletStore((s) => s.connection);
+ const wallet = useWalletStore((s) => s.current);
+ const { handleSetInstruction } = useContext(NewProposalContext);
+ const { getGovernedAccountPublicKey } = useGovernedMultiTypeAccounts();
+
+ const [form, setForm] = useState(initialFormValues);
+ const [formErrors, setFormErrors] = useState({});
+
+ const handleSetForm = ({ propertyName, value }) => {
+ setFormErrors({});
+ setForm({ ...form, [propertyName]: value });
+ };
+
+ const validateForm = async (): Promise => {
+ const { isValid, validationErrors } = await isFormValid(schema, form);
+ setFormErrors(validationErrors);
+ return isValid;
+ };
+ const governedAccountPubkey = getGovernedAccountPublicKey(
+ form.governedAccount,
+ true,
+ );
+
+ const getInstruction = async (): Promise => {
+ if (
+ !wallet?.publicKey ||
+ !form.governedAccount?.governance?.account ||
+ !governedAccountPubkey ||
+ !(await validateForm())
+ ) {
+ return {
+ serializedInstruction: '',
+ isValid: false,
+ governance: form.governedAccount?.governance,
+ };
+ }
+
+ try {
+ const prerequisiteInstructions: TransactionInstruction[] = [];
+
+ const transactionInstructionOrSerializedInstruction = buildInstruction
+ ? await buildInstruction({
+ form,
+ connection: connection.current,
+ cluster: connection.cluster,
+ wallet,
+ governedAccountPubkey,
+ })
+ : '';
+
+ const serializedInstruction =
+ typeof transactionInstructionOrSerializedInstruction === 'string'
+ ? transactionInstructionOrSerializedInstruction
+ : serializeInstructionToBase64(
+ transactionInstructionOrSerializedInstruction,
+ );
+
+ const customHoldUpTime = getCustomHoldUpTime
+ ? await getCustomHoldUpTime()
+ : undefined;
+
+ return {
+ serializedInstruction,
+ prerequisiteInstructions,
+ isValid: true,
+ governance: form.governedAccount?.governance,
+ customHoldUpTime,
+ shouldSplitIntoSeparateTxs,
+ };
+ } catch (e) {
+ console.error(e);
+
+ return {
+ serializedInstruction: '',
+ isValid: false,
+ governance: form.governedAccount?.governance,
+ };
+ }
+ };
+
+ useEffect(() => {
+ handleSetForm({
+ propertyName: 'governedAccount',
+ value: initialFormValues.governedAccount,
+ });
+ }, [JSON.stringify(initialFormValues.governedAccount)]);
+
+ useEffect(() => {
+ debounce.debounceFcn(async () => {
+ await validateForm();
+ });
+ handleSetInstruction(
+ { governedAccount: form.governedAccount?.governance, getInstruction },
+ index,
+ );
+ }, [form]);
+
+ return {
+ connection,
+ governedAccountPubkey,
+ wallet,
+ formErrors,
+ form,
+ handleSetForm,
+ validateForm,
+ };
+}
+
+export default useInstructionFormBuilder;
diff --git a/hooks/useInterval.tsx b/hooks/useInterval.tsx
index df8a1a137c..af3bdf3cb4 100644
--- a/hooks/useInterval.tsx
+++ b/hooks/useInterval.tsx
@@ -1,39 +1,39 @@
-import { useState, useRef, useEffect } from 'react'
+import { useState, useRef, useEffect } from 'react';
export function useEffectAfterTimeout(effect, timeout) {
useEffect(() => {
- const handle = setTimeout(effect, timeout)
- return () => clearTimeout(handle)
- })
+ const handle = setTimeout(effect, timeout);
+ return () => clearTimeout(handle);
+ });
}
export function useListener(emitter, eventName) {
- const [, forceUpdate] = useState(0)
+ const [, forceUpdate] = useState(0);
useEffect(() => {
- const listener = () => forceUpdate((i) => i + 1)
- emitter.on(eventName, listener)
- return () => emitter.removeListener(eventName, listener)
- }, [emitter, eventName])
+ const listener = () => forceUpdate((i) => i + 1);
+ emitter.on(eventName, listener);
+ return () => emitter.removeListener(eventName, listener);
+ }, [emitter, eventName]);
}
export default function useInterval(callback, delay) {
- const savedCallback = useRef<() => void>()
+ const savedCallback = useRef<() => void>();
// Remember the latest callback.
useEffect(() => {
- savedCallback.current = callback
- }, [callback])
+ savedCallback.current = callback;
+ }, [callback]);
// Set up the interval.
useEffect(() => {
function tick() {
- savedCallback.current && savedCallback.current()
+ savedCallback.current && savedCallback.current();
}
if (delay !== null) {
- const id = setInterval(tick, delay)
+ const id = setInterval(tick, delay);
return () => {
- clearInterval(id)
- }
+ clearInterval(id);
+ };
}
- }, [delay])
+ }, [delay]);
}
diff --git a/hooks/useIpAddress.tsx b/hooks/useIpAddress.tsx
index 9368227ee1..975731ec99 100644
--- a/hooks/useIpAddress.tsx
+++ b/hooks/useIpAddress.tsx
@@ -1,4 +1,4 @@
-import { useEffect, useState } from 'react'
+import { useEffect, useState } from 'react';
const SANCTIONED_COUNTRIES = [
{ country: 'Antigua and Barbuda', code: 'AG' },
@@ -27,34 +27,38 @@ const SANCTIONED_COUNTRIES = [
{ country: 'Yemen', code: 'YE' },
{ country: 'Zimbabwe', code: 'ZW' },
{ country: 'United States', code: 'US' },
-]
+];
-const SANCTIONED_COUNTRY_CODES = SANCTIONED_COUNTRIES.map(({ code }) => code)
+const SANCTIONED_COUNTRY_CODES = SANCTIONED_COUNTRIES.map(({ code }) => code);
export default function useIpAddress() {
- const [ipAllowed, setIpAllowed] = useState(true)
+ const [ipAllowed, setIpAllowed] = useState(true);
useEffect(() => {
const checkIpLocation = async () => {
- let ipCountryCode
+ let ipCountryCode;
try {
- const response = await fetch(`https://www.cloudflare.com/cdn-cgi/trace`)
- const parsedResponse = await response.text()
- const ipLocation = parsedResponse.match(/loc=(.+)/)
- ipCountryCode = ipLocation ? ipLocation[1] : ''
+ const response = await fetch(
+ `https://www.cloudflare.com/cdn-cgi/trace`,
+ );
+ const parsedResponse = await response.text();
+ const ipLocation = parsedResponse.match(/loc=(.+)/);
+ ipCountryCode = ipLocation ? ipLocation[1] : '';
} catch {
- const response = await fetch(`https://countrycode.bonfida.workers.dev/`)
- const parsedResponse = await response.json()
- ipCountryCode = parsedResponse.countryCode
+ const response = await fetch(
+ `https://countrycode.bonfida.workers.dev/`,
+ );
+ const parsedResponse = await response.json();
+ ipCountryCode = parsedResponse.countryCode;
}
if (ipCountryCode) {
- setIpAllowed(!SANCTIONED_COUNTRY_CODES.includes(ipCountryCode))
+ setIpAllowed(!SANCTIONED_COUNTRY_CODES.includes(ipCountryCode));
}
- }
+ };
- checkIpLocation()
- }, [])
+ checkIpLocation();
+ }, []);
- return { ipAllowed }
+ return { ipAllowed };
}
diff --git a/hooks/useIsBeyondTimestamp.ts b/hooks/useIsBeyondTimestamp.ts
index bc0b8db73e..caa6c0d8b2 100644
--- a/hooks/useIsBeyondTimestamp.ts
+++ b/hooks/useIsBeyondTimestamp.ts
@@ -1,41 +1,41 @@
-import dayjs from 'dayjs'
-import { useEffect, useState } from 'react'
+import dayjs from 'dayjs';
+import { useEffect, useState } from 'react';
export const useIsBeyondTimestamp = (timestamp: number | undefined) => {
const [isBeyondTimestamp, setIsBeyondTimestamp] = useState<
boolean | undefined
- >()
+ >();
useEffect(() => {
if (!timestamp) {
- return
+ return;
}
const sub = (async () => {
- const now = dayjs().unix()
+ const now = dayjs().unix();
if (now > timestamp) {
- setIsBeyondTimestamp(true)
- return
+ setIsBeyondTimestamp(true);
+ return;
}
- setIsBeyondTimestamp(false)
+ setIsBeyondTimestamp(false);
const id = setInterval(() => {
- const now = dayjs().unix()
+ const now = dayjs().unix();
if (now > timestamp) {
- setIsBeyondTimestamp(true)
- clearInterval(id)
+ setIsBeyondTimestamp(true);
+ clearInterval(id);
}
- }, 5000) // TODO: Use actual timestamp to calculate the interval
+ }, 5000); // TODO: Use actual timestamp to calculate the interval
- return id
- })()
+ return id;
+ })();
return () => {
- sub.then((id) => id && clearInterval(id))
- }
- }, [timestamp])
+ sub.then((id) => id && clearInterval(id));
+ };
+ }, [timestamp]);
- return isBeyondTimestamp
-}
+ return isBeyondTimestamp;
+};
diff --git a/hooks/useLargestAccounts.tsx b/hooks/useLargestAccounts.tsx
index d3a4ac60a1..239f011a4f 100644
--- a/hooks/useLargestAccounts.tsx
+++ b/hooks/useLargestAccounts.tsx
@@ -1,24 +1,24 @@
// import useWalletStore from '../stores/useWalletStore'
-import { calculateBalance } from '../utils/balance'
-import { TokenProgramAccount, TokenAccount } from '../utils/tokens'
+import { calculateBalance } from '../utils/balance';
+import { TokenProgramAccount, TokenAccount } from '../utils/tokens';
export function findLargestBalanceAccountForMint(
mints,
tokenAccounts: TokenProgramAccount[],
- mintPk
+ mintPk,
) {
- const accounts = tokenAccounts.filter((a) => a.account.mint.equals(mintPk))
- if (!accounts.length) return undefined
+ const accounts = tokenAccounts.filter((a) => a.account.mint.equals(mintPk));
+ if (!accounts.length) return undefined;
- const balances = accounts.map((a) => calculateBalance(mints, a.account))
+ const balances = accounts.map((a) => calculateBalance(mints, a.account));
const maxBalanceAccountIndex = balances.reduce(
(iMax, bal, iBal) => (bal > balances[iMax] ? iBal : iMax),
- 0
- )
- const account = accounts[maxBalanceAccountIndex]
- const balance = balances[maxBalanceAccountIndex]
+ 0,
+ );
+ const account = accounts[maxBalanceAccountIndex];
+ const balance = balances[maxBalanceAccountIndex];
- return { account, balance }
+ return { account, balance };
}
/*
diff --git a/hooks/useLocalStorageState.tsx b/hooks/useLocalStorageState.tsx
index ba65a632f2..f07a60d3da 100644
--- a/hooks/useLocalStorageState.tsx
+++ b/hooks/useLocalStorageState.tsx
@@ -1,69 +1,69 @@
-import { useMemo, useState, useEffect, useCallback } from 'react'
+import { useMemo, useState, useEffect, useCallback } from 'react';
-const localStorageListeners = {}
+const localStorageListeners = {};
export function useLocalStorageStringState(
key: string,
- defaultState: string | null = null
+ defaultState: string | null = null,
): [string | null, (newState: string | null) => void] {
const state =
typeof window !== 'undefined'
? localStorage.getItem(key) || defaultState
- : defaultState || ''
+ : defaultState || '';
- const [, notify] = useState(key + '\n' + state)
+ const [, notify] = useState(key + '\n' + state);
useEffect(() => {
if (!localStorageListeners[key]) {
- localStorageListeners[key] = []
+ localStorageListeners[key] = [];
}
- localStorageListeners[key].push(notify)
+ localStorageListeners[key].push(notify);
return () => {
localStorageListeners[key] = localStorageListeners[key].filter(
- (listener) => listener !== notify
- )
+ (listener) => listener !== notify,
+ );
if (localStorageListeners[key].length === 0) {
- delete localStorageListeners[key]
+ delete localStorageListeners[key];
}
- }
- }, [key])
+ };
+ }, [key]);
const setState = useCallback<(newState: string | null) => void>(
(newState) => {
if (!localStorageListeners[key]) {
- localStorageListeners[key] = []
+ localStorageListeners[key] = [];
}
- const changed = state !== newState
+ const changed = state !== newState;
if (!changed) {
- return
+ return;
}
if (newState === null) {
- localStorage.removeItem(key)
+ localStorage.removeItem(key);
} else {
- localStorage.setItem(key, newState)
+ localStorage.setItem(key, newState);
}
localStorageListeners[key].forEach((listener) =>
- listener(key + '\n' + newState)
- )
+ listener(key + '\n' + newState),
+ );
},
- [state, key]
- )
+ [state, key],
+ );
- return [state, setState]
+ return [state, setState];
}
export default function useLocalStorageState(
key: string,
- defaultState: T | null = null
+ defaultState: T | null = null,
): [T, (newState: T) => void] {
const [stringState, setStringState] = useLocalStorageStringState(
key,
- JSON.stringify(defaultState)
- )
+ JSON.stringify(defaultState),
+ );
return [
useMemo(() => stringState && JSON.parse(stringState), [stringState]),
(newState) => setStringState(JSON.stringify(newState)),
- ]
+ ];
}
diff --git a/hooks/useOrcaWhirlpoolClient.ts b/hooks/useOrcaWhirlpoolClient.ts
new file mode 100644
index 0000000000..b6d22ef471
--- /dev/null
+++ b/hooks/useOrcaWhirlpoolClient.ts
@@ -0,0 +1,39 @@
+import { useEffect, useState } from 'react';
+import useWalletStore from 'stores/useWalletStore';
+import {
+ buildWhirlpoolClient,
+ WhirlpoolClient,
+ WhirlpoolContext,
+} from '@orca-so/whirlpools-sdk';
+import { OrcaConfiguration } from '@tools/sdk/orca/configuration';
+
+// target the same wallet as orca
+import { Wallet } from '@project-serum/anchor/dist/cjs/provider';
+
+export default function useOrcaWhirlpoolClient() {
+ const connection = useWalletStore((s) => s.connection);
+ const wallet = useWalletStore((s) => s.current);
+
+ const [
+ whirlpoolClient,
+ setWhirlpoolClient,
+ ] = useState(null);
+
+ useEffect(() => {
+ if (!connection || !wallet || !wallet.publicKey) {
+ return;
+ }
+
+ setWhirlpoolClient(
+ buildWhirlpoolClient(
+ WhirlpoolContext.from(
+ connection.current,
+ wallet as Wallet,
+ OrcaConfiguration.WhirlpoolProgramId,
+ ),
+ ),
+ );
+ }, [connection]);
+
+ return whirlpoolClient;
+}
diff --git a/hooks/useOrcaWhirlpoolPositions.ts b/hooks/useOrcaWhirlpoolPositions.ts
new file mode 100644
index 0000000000..b34b9644ea
--- /dev/null
+++ b/hooks/useOrcaWhirlpoolPositions.ts
@@ -0,0 +1,48 @@
+import { useEffect, useState } from 'react';
+import useWalletStore from 'stores/useWalletStore';
+import orcaConfiguration, {
+ WhirlpoolPositionInfo,
+} from '@tools/sdk/orca/configuration';
+import { PublicKey } from '@solana/web3.js';
+import { WhirlpoolImpl } from '@orca-so/whirlpools-sdk/dist/impl/whirlpool-impl';
+
+export default function useOrcaWhirlpoolPositions({
+ whirlpool,
+ authority,
+}: {
+ whirlpool?: WhirlpoolImpl;
+ authority?: PublicKey;
+}) {
+ const connection = useWalletStore((s) => s.connection);
+ const wallet = useWalletStore((s) => s.current);
+
+ const [positionsInfo, setPositionsInfo] = useState<
+ WhirlpoolPositionInfo[] | null
+ >(null);
+
+ useEffect(() => {
+ (async () => {
+ if (
+ !connection ||
+ !wallet ||
+ !wallet.publicKey ||
+ !whirlpool ||
+ !authority
+ ) {
+ return;
+ }
+
+ const positionsInfo = await orcaConfiguration.getAuthorityWhirlpoolPositions(
+ {
+ connection: connection.current,
+ whirlpool,
+ authority,
+ },
+ );
+
+ setPositionsInfo(positionsInfo);
+ })();
+ }, [connection, authority, whirlpool]);
+
+ return positionsInfo;
+}
diff --git a/hooks/usePrevious.ts b/hooks/usePrevious.ts
index 3323fb7841..da39999ba6 100644
--- a/hooks/usePrevious.ts
+++ b/hooks/usePrevious.ts
@@ -1,9 +1,9 @@
-import { useEffect, useRef } from 'react'
+import { useEffect, useRef } from 'react';
export function usePrevious(value) {
- const ref = useRef()
+ const ref = useRef();
useEffect(() => {
- ref.current = value
- })
- return ref.current as any
+ ref.current = value;
+ });
+ return ref.current as any;
}
diff --git a/hooks/useProposal.tsx b/hooks/useProposal.tsx
index 5f62c57308..af33a29cac 100644
--- a/hooks/useProposal.tsx
+++ b/hooks/useProposal.tsx
@@ -1,9 +1,9 @@
-import { useRouter } from 'next/router'
-import useWalletStore from '../stores/useWalletStore'
+import { useRouter } from 'next/router';
+import useWalletStore from '../stores/useWalletStore';
export default function useProposal() {
- const router = useRouter()
- const { pk } = router.query
+ const router = useRouter();
+ const { pk } = router.query;
const {
proposal,
@@ -12,7 +12,7 @@ export default function useProposal() {
proposalMint,
governance,
proposalOwner,
- } = useWalletStore((s) => s.selectedProposal)
+ } = useWalletStore((s) => s.selectedProposal);
return {
pk,
@@ -22,5 +22,5 @@ export default function useProposal() {
proposalMint,
governance,
proposalOwner,
- }
+ };
}
diff --git a/hooks/useProposalVotes.tsx b/hooks/useProposalVotes.tsx
index df2fc0d4a9..3047800309 100644
--- a/hooks/useProposalVotes.tsx
+++ b/hooks/useProposalVotes.tsx
@@ -1,19 +1,19 @@
-import { Proposal } from '@solana/spl-governance'
-import { getProposalMaxVoteWeight } from '../models/voteWeights'
-import { calculatePct, fmtTokenAmount } from '../utils/formatting'
-import useRealm from './useRealm'
+import { Proposal } from '@solana/spl-governance';
+import { getProposalMaxVoteWeight } from '../models/voteWeights';
+import { calculatePct, fmtTokenAmount } from '../utils/formatting';
+import useRealm from './useRealm';
export default function useProposalVotes(proposal?: Proposal) {
- const { realm, mint, councilMint, governances } = useRealm()
+ const { realm, mint, councilMint, governances } = useRealm();
const governance =
- proposal && governances[proposal.governance?.toBase58()]?.account
+ proposal && governances[proposal.governance?.toBase58()]?.account;
const proposalMint =
proposal?.governingTokenMint.toBase58() ===
realm?.account.communityMint.toBase58()
? mint
- : councilMint
+ : councilMint;
// TODO: optimize using memo
if (!realm || !proposal || !governance || !proposalMint)
@@ -25,46 +25,57 @@ export default function useProposalVotes(proposal?: Proposal) {
noVoteCount: 0,
minimumYesVotes: 0,
yesVotesRequired: 0,
- }
+ minimumNoVotes: 0,
+ noVotesRequired: 0,
+ };
const voteThresholdPct =
(proposal.isVoteFinalized() && proposal.voteThresholdPercentage?.value) ||
- governance.config.voteThresholdPercentage.value
+ governance.config.voteThresholdPercentage.value;
const maxVoteWeight = getProposalMaxVoteWeight(
realm.account,
proposal,
- proposalMint
- )
+ proposalMint,
+ );
const minimumYesVotes =
fmtTokenAmount(maxVoteWeight, proposalMint.decimals) *
- (voteThresholdPct / 100)
- const yesVotePct = calculatePct(proposal.getYesVoteCount(), maxVoteWeight)
- const yesVoteProgress = (yesVotePct / voteThresholdPct) * 100
+ (voteThresholdPct / 100);
+ const yesVotePct = calculatePct(proposal.getYesVoteCount(), maxVoteWeight);
+ const yesVoteProgress = (yesVotePct / voteThresholdPct) * 100;
const yesVoteCount = fmtTokenAmount(
proposal.getYesVoteCount(),
- proposalMint.decimals
- )
+ proposalMint.decimals,
+ );
const noVoteCount = fmtTokenAmount(
proposal.getNoVoteCount(),
- proposalMint.decimals
- )
+ proposalMint.decimals,
+ );
- const totalVoteCount = yesVoteCount + noVoteCount
+ const totalVoteCount = yesVoteCount + noVoteCount;
const getRelativeVoteCount = (voteCount: number) =>
- totalVoteCount === 0 ? 0 : (voteCount / totalVoteCount) * 100
+ totalVoteCount === 0 ? 0 : (voteCount / totalVoteCount) * 100;
- const relativeYesVotes = getRelativeVoteCount(yesVoteCount)
- const relativeNoVotes = getRelativeVoteCount(noVoteCount)
+ const relativeYesVotes = getRelativeVoteCount(yesVoteCount);
+ const relativeNoVotes = getRelativeVoteCount(noVoteCount);
- const rawYesVotesRequired = minimumYesVotes - yesVoteCount
+ const rawYesVotesRequired = minimumYesVotes - yesVoteCount;
const yesVotesRequired =
proposalMint.decimals == 0
? Math.ceil(rawYesVotesRequired)
- : rawYesVotesRequired
+ : rawYesVotesRequired;
+
+ const minimumNoVotes =
+ fmtTokenAmount(maxVoteWeight, proposalMint.decimals) - minimumYesVotes;
+
+ const rawNoVotesRequired = minimumNoVotes - noVoteCount;
+ const noVotesRequired =
+ proposalMint.decimals == 0
+ ? Math.ceil(rawNoVotesRequired)
+ : rawNoVotesRequired;
return {
voteThresholdPct,
@@ -76,5 +87,7 @@ export default function useProposalVotes(proposal?: Proposal) {
relativeNoVotes,
minimumYesVotes,
yesVotesRequired,
- }
+ rawNoVotesRequired,
+ noVotesRequired,
+ };
}
diff --git a/hooks/useQueryContext.tsx b/hooks/useQueryContext.tsx
index 9eb1422d03..861ee32e99 100644
--- a/hooks/useQueryContext.tsx
+++ b/hooks/useQueryContext.tsx
@@ -1,21 +1,21 @@
-import { useRouter } from 'next/router'
-import { EndpointTypes } from '../models/types'
+import { useRouter } from 'next/router';
+import { EndpointTypes } from '../models/types';
export default function useQueryContext() {
- const router = useRouter()
- const { cluster } = router.query
+ const router = useRouter();
+ const { cluster } = router.query;
- const endpoint = cluster ? (cluster as EndpointTypes) : 'mainnet'
- const hasClusterOption = endpoint !== 'mainnet'
+ const endpoint = cluster ? (cluster as EndpointTypes) : 'mainnet';
+ const hasClusterOption = endpoint !== 'mainnet';
const fmtUrlWithCluster = (url) => {
if (hasClusterOption) {
- const mark = url.includes('?') ? '&' : '?'
- return decodeURIComponent(`${url}${mark}cluster=${endpoint}`)
+ const mark = url.includes('?') ? '&' : '?';
+ return decodeURIComponent(`${url}${mark}cluster=${endpoint}`);
}
- return url
- }
+ return url;
+ };
return {
fmtUrlWithCluster,
- }
+ };
}
diff --git a/hooks/useRealm.tsx b/hooks/useRealm.tsx
index 46dc90742e..bc1d837a7c 100644
--- a/hooks/useRealm.tsx
+++ b/hooks/useRealm.tsx
@@ -1,23 +1,23 @@
-import { isPublicKey } from '@tools/core/pubkey'
-import { useRouter } from 'next/router'
-import { useMemo, useState } from 'react'
-import useDepositStore from 'VoteStakeRegistry/stores/useDepositStore'
+import { isPublicKey } from '@tools/core/pubkey';
+import { useRouter } from 'next/router';
+import { useMemo, useState } from 'react';
+import useDepositStore from 'VoteStakeRegistry/stores/useDepositStore';
import {
createUnchartedRealmInfo,
getCertifiedRealmInfo,
RealmInfo,
-} from '../models/registry/api'
-import { VoteRegistryVoterWeight, VoterWeight } from '../models/voteWeights'
+} from '../models/registry/api';
+import { VoteRegistryVoterWeight, VoterWeight } from '../models/voteWeights';
-import useWalletStore from '../stores/useWalletStore'
+import useWalletStore from '../stores/useWalletStore';
export default function useRealm() {
- const router = useRouter()
- const { symbol } = router.query
- const connection = useWalletStore((s) => s.connection)
- const connected = useWalletStore((s) => s.connected)
- const wallet = useWalletStore((s) => s.current)
- const tokenAccounts = useWalletStore((s) => s.tokenAccounts)
+ const router = useRouter();
+ const { symbol } = router.query;
+ const connection = useWalletStore((s) => s.connection);
+ const connected = useWalletStore((s) => s.connected);
+ const wallet = useWalletStore((s) => s.current);
+ const tokenAccounts = useWalletStore((s) => s.tokenAccounts);
const {
realm,
mint,
@@ -29,41 +29,41 @@ export default function useRealm() {
tokenRecords,
councilTokenOwnerRecords,
programVersion,
- } = useWalletStore((s) => s.selectedRealm)
- const votingPower = useDepositStore((s) => s.state.votingPower)
- const [realmInfo, setRealmInfo] = useState(undefined)
+ } = useWalletStore((s) => s.selectedRealm);
+ const votingPower = useDepositStore((s) => s.state.votingPower);
+ const [realmInfo, setRealmInfo] = useState(undefined);
useMemo(async () => {
let realmInfo = isPublicKey(symbol as string)
? realm
? createUnchartedRealmInfo(realm)
: undefined
- : getCertifiedRealmInfo(symbol as string, connection)
+ : getCertifiedRealmInfo(symbol as string, connection);
if (realmInfo) {
- realmInfo = { ...realmInfo, programVersion: programVersion }
+ realmInfo = { ...realmInfo, programVersion: programVersion };
}
// Do not set realm info until the programVersion is resolved
if (programVersion) {
- setRealmInfo(realmInfo)
+ setRealmInfo(realmInfo);
}
- }, [symbol, realm, programVersion])
+ }, [symbol, realm, programVersion]);
const realmTokenAccount = useMemo(
() =>
realm &&
tokenAccounts.find((a) =>
- a.account.mint.equals(realm.account.communityMint)
+ a.account.mint.equals(realm.account.communityMint),
),
- [realm, tokenAccounts]
- )
+ [realm, tokenAccounts],
+ );
const ownTokenRecord = useMemo(
() =>
wallet?.connected && wallet.publicKey
? tokenRecords[wallet.publicKey.toBase58()]
: undefined,
- [tokenRecords, wallet, connected]
- )
+ [tokenRecords, wallet, connected],
+ );
const councilTokenAccount = useMemo(
() =>
@@ -72,40 +72,40 @@ export default function useRealm() {
tokenAccounts.find(
(a) =>
realm.account.config.councilMint &&
- a.account.mint.equals(realm.account.config.councilMint)
+ a.account.mint.equals(realm.account.config.councilMint),
),
- [realm, tokenAccounts]
- )
+ [realm, tokenAccounts],
+ );
const ownCouncilTokenRecord = useMemo(
() =>
wallet?.connected && councilMint && wallet.publicKey
? councilTokenOwnerRecords[wallet.publicKey.toBase58()]
: undefined,
- [tokenRecords, wallet, connected]
- )
+ [tokenRecords, wallet, connected],
+ );
const canChooseWhoVote =
realm?.account.communityMint &&
!mint?.supply.isZero() &&
realm.account.config.councilMint &&
- !councilMint?.supply.isZero()
+ !councilMint?.supply.isZero();
//TODO take from realm config when available
- const realmCfgMaxOutstandingProposalCount = 10
+ const realmCfgMaxOutstandingProposalCount = 10;
const toManyCommunityOutstandingProposalsForUser =
ownTokenRecord &&
ownTokenRecord?.account.outstandingProposalCount >=
- realmCfgMaxOutstandingProposalCount
+ realmCfgMaxOutstandingProposalCount;
const toManyCouncilOutstandingProposalsForUse =
ownCouncilTokenRecord &&
ownCouncilTokenRecord?.account.outstandingProposalCount >=
- realmCfgMaxOutstandingProposalCount
+ realmCfgMaxOutstandingProposalCount;
//TODO change when more plugins implemented
const ownVoterWeight = realm?.account.config.useCommunityVoterWeightAddin
? new VoteRegistryVoterWeight(ownTokenRecord, votingPower)
- : new VoterWeight(ownTokenRecord, ownCouncilTokenRecord)
+ : new VoterWeight(ownTokenRecord, ownCouncilTokenRecord);
return {
realm,
realmInfo,
@@ -127,5 +127,5 @@ export default function useRealm() {
councilTokenOwnerRecords,
toManyCouncilOutstandingProposalsForUse,
toManyCommunityOutstandingProposalsForUser,
- }
+ };
}
diff --git a/hooks/useRealmGovernance.ts b/hooks/useRealmGovernance.ts
index 8668972e65..2cbb5cc819 100644
--- a/hooks/useRealmGovernance.ts
+++ b/hooks/useRealmGovernance.ts
@@ -1,10 +1,10 @@
-import { PublicKey } from '@solana/web3.js'
+import { PublicKey } from '@solana/web3.js';
-import useRealm from './useRealm'
+import useRealm from './useRealm';
/// Returns Governance for the given pk from the current realm
export default function useRealmGovernance(governance: PublicKey) {
- const realm = useRealm()
+ const realm = useRealm();
- return realm.governances[governance.toBase58()]?.account
+ return realm.governances[governance.toBase58()]?.account;
}
diff --git a/hooks/useRouterHistory.ts b/hooks/useRouterHistory.ts
index ea7d198bad..69f0c54d77 100644
--- a/hooks/useRouterHistory.ts
+++ b/hooks/useRouterHistory.ts
@@ -1,27 +1,27 @@
-import useRouterHistoryStore from 'stores/useRouterHistoryStore'
-import useQueryContext from './useQueryContext'
-import useRealm from './useRealm'
+import useRouterHistoryStore from 'stores/useRouterHistoryStore';
+import useQueryContext from './useQueryContext';
+import useRealm from './useRealm';
//nextjs don't provide route history out of the box.
//we store only 4 last routes
export default function useRouterHistory() {
- const { fmtUrlWithCluster } = useQueryContext()
- const { symbol } = useRealm()
- const history = useRouterHistoryStore((s) => s.history)
+ const { fmtUrlWithCluster } = useQueryContext();
+ const { symbol } = useRealm();
+ const history = useRouterHistoryStore((s) => s.history);
const getLastRoute = () => {
if (!history.length) {
- return history[history.length - 1]
+ return history[history.length - 1];
} else if (symbol) {
//if we have dao symbol we will redirect to dao home page
- return fmtUrlWithCluster(`/dao/${symbol}/`)
+ return fmtUrlWithCluster(`/dao/${symbol}/`);
} else {
//if user came here and dont have any dao symbol we will redirect to /realms page as home
- return fmtUrlWithCluster('/realms')
+ return fmtUrlWithCluster('/realms');
}
- }
+ };
return {
history,
getLastRoute,
- }
+ };
}
diff --git a/hooks/useRpcContext.ts b/hooks/useRpcContext.ts
index fd83c06dc5..c79b7c6cca 100644
--- a/hooks/useRpcContext.ts
+++ b/hooks/useRpcContext.ts
@@ -1,23 +1,23 @@
-import { getProgramVersionForRealm } from '@models/registry/api'
-import { RpcContext } from '@solana/spl-governance'
-import { PublicKey } from '@solana/web3.js'
-import useWalletStore from 'stores/useWalletStore'
-import useRealm from './useRealm'
+import { getProgramVersionForRealm } from '@models/registry/api';
+import { RpcContext } from '@solana/spl-governance';
+import { PublicKey } from '@solana/web3.js';
+import useWalletStore from 'stores/useWalletStore';
+import useRealm from './useRealm';
export default function useRpcContext() {
- const { realmInfo, realm } = useRealm()
- const connection = useWalletStore((s) => s.connection)
- const wallet = useWalletStore((s) => s.current)
+ const { realmInfo, realm } = useRealm();
+ const connection = useWalletStore((s) => s.connection);
+ const wallet = useWalletStore((s) => s.current);
const getRpcContext = () =>
new RpcContext(
new PublicKey(realm!.owner.toString()),
getProgramVersionForRealm(realmInfo!),
wallet!,
connection.current,
- connection.endpoint
- )
+ connection.endpoint,
+ );
return {
getRpcContext,
- }
+ };
}
diff --git a/hooks/useSaberStats.ts b/hooks/useSaberStats.ts
new file mode 100644
index 0000000000..93470f4fc9
--- /dev/null
+++ b/hooks/useSaberStats.ts
@@ -0,0 +1,134 @@
+import { PublicKey } from '@solana/web3.js';
+import { useCallback, useEffect, useState } from 'react';
+import {
+ SolanaAugmentedProvider,
+ SolanaProvider,
+ SignerWallet,
+} from '@saberhq/solana-contrib';
+import useWalletStore from 'stores/useWalletStore';
+import {
+ findMinerAddress,
+ findQuarryAddress,
+ QuarrySDK,
+} from '@quarryprotocol/quarry-sdk';
+
+import QuarryMineConfiguration, {
+ SABER_UXD_USDC_LP,
+} from '@tools/sdk/quarryMine/configuration';
+
+import { tryGetMint } from '@utils/tokens';
+import { BN } from '@project-serum/anchor';
+import BigNumber from 'bignumber.js';
+import { getSplTokenNameByMint } from '@utils/splTokens';
+import { HotWalletAccount } from './useHotWallet';
+
+export type SaberStats = {
+ liquidityPoolName: string;
+ balance: BN;
+ uiBalance: number;
+ pendingRewards: {
+ mint: PublicKey;
+ name: string;
+ uiPendingAmount: number;
+ }[];
+ mintName: string;
+ rewardsTokenMintName: string;
+};
+
+const useSaberStats = (hotWalletAccount: HotWalletAccount) => {
+ const connection = useWalletStore((store) => store.connection);
+ const wallet = useWalletStore((s) => s.current);
+
+ const [saberStats, setSaberStats] = useState(null);
+
+ const loadInfo = useCallback(async () => {
+ if (!connection.current || !hotWalletAccount) return [];
+
+ try {
+ const {
+ mint,
+ rewarder,
+ mintName,
+ rewardsTokenMintName,
+ } = QuarryMineConfiguration.mintSpecificAddresses[SABER_UXD_USDC_LP];
+
+ const [quarry] = await findQuarryAddress(rewarder, mint);
+ const [miner] = await findMinerAddress(
+ quarry,
+ hotWalletAccount.publicKey,
+ );
+
+ const sdk = QuarrySDK.load({
+ provider: new SolanaAugmentedProvider(
+ SolanaProvider.load({
+ connection: connection.current,
+ sendConnection: connection.current,
+ wallet: (wallet as unknown) as SignerWallet,
+ }),
+ ),
+ });
+
+ const sonarData = await fetch(
+ 'https://api-uxd.sonar.watch/uxd',
+ ).then((res) => res.json());
+ const saberAccountSonarData = sonarData.find(
+ ({ platform, owner }) =>
+ platform === 'quarry' &&
+ owner === hotWalletAccount.publicKey.toBase58(),
+ );
+
+ const pendingRewards = saberAccountSonarData.rewardAssets.map(
+ (asset) => ({
+ mint: new PublicKey(asset.mint),
+ name: getSplTokenNameByMint(new PublicKey(asset.mint)),
+ uiPendingAmount: asset.pending,
+ }),
+ );
+
+ const minerData = await sdk.programs.Mine.account.miner.fetch(miner);
+
+ const lpMintInfo = await tryGetMint(connection.current, mint);
+ if (!lpMintInfo)
+ throw new Error(`Cannot load lp mint info for ${mint.toBase58()}`);
+
+ return [
+ {
+ liquidityPoolName: 'Saber UXD-USDC Liquidity Pool',
+ balance: minerData.balance,
+ uiBalance: new BigNumber(minerData.balance.toString())
+ .shiftedBy(-lpMintInfo.account.decimals)
+ .toNumber(),
+ pendingRewards,
+ mintName,
+ rewardsTokenMintName,
+ },
+ ];
+ } catch (err) {
+ console.error('error loading saber stats', err);
+ return [];
+ }
+ }, [connection, hotWalletAccount, wallet]);
+
+ useEffect(() => {
+ // add a cancel
+ let quit = false;
+
+ loadInfo().then((infos) => {
+ if (quit) {
+ return;
+ }
+
+ setSaberStats(infos);
+ });
+
+ return () => {
+ quit = true;
+ };
+ }, [loadInfo]);
+
+ return {
+ saberStats,
+ };
+};
+
+export default useSaberStats;
diff --git a/hooks/useSingleSideStakingClient.ts b/hooks/useSingleSideStakingClient.ts
new file mode 100644
index 0000000000..7e28bdb00e
--- /dev/null
+++ b/hooks/useSingleSideStakingClient.ts
@@ -0,0 +1,40 @@
+import { SingleSideStakingClient } from '@uxdprotocol/uxd-staking-client';
+import { useEffect, useState } from 'react';
+import configuration from '@tools/sdk/uxdProtocolStaking/configuration';
+import useWalletStore from 'stores/useWalletStore';
+
+export default function useSingleSideStakingClient(): {
+ client: SingleSideStakingClient | null;
+} {
+ const connection = useWalletStore((s) => s.connection);
+ const wallet = useWalletStore((s) => s.current);
+
+ const [client, setClient] = useState(null);
+
+ useEffect(() => {
+ if (!connection || !wallet) {
+ return;
+ }
+
+ if (connection.cluster === 'localnet') {
+ throw new Error('unsupported cluster for Socean programs loading');
+ }
+
+ const programId = configuration.programId[connection.cluster];
+
+ if (!programId) {
+ throw new Error('UXD Staking program id not found');
+ }
+
+ setClient(
+ SingleSideStakingClient.load({
+ connection: connection.current,
+ programId,
+ }),
+ );
+ }, [connection, wallet]);
+
+ return {
+ client,
+ };
+}
diff --git a/hooks/useSoceanPrograms.ts b/hooks/useSoceanPrograms.ts
new file mode 100644
index 0000000000..7d475f7a4f
--- /dev/null
+++ b/hooks/useSoceanPrograms.ts
@@ -0,0 +1,34 @@
+import { useEffect, useState } from 'react';
+import soceanConfiguration, {
+ SoceanPrograms,
+} from '@tools/sdk/socean/configuration';
+import useWalletStore from 'stores/useWalletStore';
+
+export default function useSoceanPrograms() {
+ const connection = useWalletStore((s) => s.connection);
+ const wallet = useWalletStore((s) => s.current);
+
+ const [programs, setPrograms] = useState(null);
+
+ useEffect(() => {
+ if (!connection || !wallet) {
+ return;
+ }
+
+ if (connection.cluster === 'localnet') {
+ throw new Error('unsupported cluster for Socean programs loading');
+ }
+
+ setPrograms(
+ soceanConfiguration.getSoceanPrograms({
+ connection: connection.current,
+ wallet,
+ cluster: connection.cluster,
+ }),
+ );
+ }, [connection, wallet]);
+
+ return {
+ programs,
+ };
+}
diff --git a/hooks/useTotalTreasuryPrice.ts b/hooks/useTotalTreasuryPrice.ts
index 6b5a881cf7..169867d76d 100644
--- a/hooks/useTotalTreasuryPrice.ts
+++ b/hooks/useTotalTreasuryPrice.ts
@@ -1,45 +1,48 @@
-import { WSOL_MINT } from '@components/instructions/tools'
-import { BN } from '@project-serum/anchor'
-import { getMintDecimalAmountFromNatural } from '@tools/sdk/units'
-import tokenService from '@utils/services/token'
-import BigNumber from 'bignumber.js'
-import { useState, useEffect } from 'react'
-import useGovernanceAssets from './useGovernanceAssets'
+import { WSOL_MINT } from '@components/instructions/tools';
+import { BN } from '@project-serum/anchor';
+import { getMintDecimalAmountFromNatural } from '@tools/sdk/units';
+import tokenService from '@utils/services/token';
+import BigNumber from 'bignumber.js';
+import { useState, useEffect } from 'react';
+import useGovernanceAssets from './useGovernanceAssets';
export function useTotalTreasuryPrice() {
- const { governedTokenAccountsWithoutNfts } = useGovernanceAssets()
- const [totalPriceFormatted, setTotalPriceFormatted] = useState('')
+ const { governedTokenAccountsWithoutNfts } = useGovernanceAssets();
+ const [totalPriceFormatted, setTotalPriceFormatted] = useState('');
useEffect(() => {
async function calcTotalTokensPrice() {
const totalPrice = governedTokenAccountsWithoutNfts
.filter(
- (x) => typeof x.mint !== 'undefined' && typeof x.token !== 'undefined'
+ (x) =>
+ typeof x.mint !== 'undefined' && typeof x.token !== 'undefined',
)
.map((x) => {
return (
getMintDecimalAmountFromNatural(
x.mint!.account,
- new BN(x.isSol ? x.solAccount!.lamports : x.token!.account.amount)
+ new BN(
+ x.isSol ? x.solAccount!.lamports : x.token!.account.amount,
+ ),
).toNumber() *
tokenService.getUSDTokenPrice(
- x.isSol ? WSOL_MINT : x.mint!.publicKey.toBase58()
+ x.isSol ? WSOL_MINT : x.mint!.publicKey.toBase58(),
)
- )
+ );
})
- .reduce((acc, val) => acc + val, 0)
+ .reduce((acc, val) => acc + val, 0);
setTotalPriceFormatted(
- totalPrice ? new BigNumber(totalPrice).toFormat(0) : ''
- )
+ totalPrice ? new BigNumber(totalPrice).toFormat(0) : '',
+ );
}
if (governedTokenAccountsWithoutNfts.length) {
- calcTotalTokensPrice()
+ calcTotalTokensPrice();
}
}, [
JSON.stringify(governedTokenAccountsWithoutNfts),
JSON.stringify(tokenService._tokenPriceToUSDlist),
- ])
+ ]);
return {
totalPriceFormatted,
- }
+ };
}
diff --git a/hooks/useTransactionSignature.ts b/hooks/useTransactionSignature.ts
new file mode 100644
index 0000000000..4865ddc419
--- /dev/null
+++ b/hooks/useTransactionSignature.ts
@@ -0,0 +1,31 @@
+import { PublicKey } from '@solana/web3.js';
+import { useState, useEffect } from 'react';
+import useWalletStore from 'stores/useWalletStore';
+
+const useTransactionSignature = (address?: PublicKey) => {
+ const connection = useWalletStore((s) => s.connection);
+ const [transactionSignature, setTransactionSignature] = useState('');
+ useEffect(() => {
+ async function getSignature() {
+ if (!address) return;
+ const transactions = await connection.current.getConfirmedSignaturesForAddress2(
+ address,
+ { limit: 1 },
+ 'finalized',
+ );
+
+ if (!transactions[0]?.signature)
+ throw new Error(
+ `could not find tx signature for proposal itx ${address.toBase58()}`,
+ );
+
+ setTransactionSignature(transactions[0]?.signature);
+ }
+
+ getSignature().catch((e) => console.warn(e.message));
+ }, [connection, address]);
+
+ return { transactionSignature };
+};
+
+export default useTransactionSignature;
diff --git a/hooks/useTribecaGauge.ts b/hooks/useTribecaGauge.ts
new file mode 100644
index 0000000000..597858aa7f
--- /dev/null
+++ b/hooks/useTribecaGauge.ts
@@ -0,0 +1,30 @@
+import { useCallback, useEffect, useState } from 'react';
+import ATribecaConfiguration, {
+ GaugeInfos,
+} from '@tools/sdk/tribeca/ATribecaConfiguration';
+import useTribecaPrograms from './useTribecaPrograms';
+
+export default function useTribecaGauge(
+ tribecaConfiguration: ATribecaConfiguration | null,
+) {
+ const { programs } = useTribecaPrograms(tribecaConfiguration);
+
+ const [gauges, setGauges] = useState(null);
+
+ const loadGauges = useCallback(async (): Promise => {
+ if (!tribecaConfiguration || !programs) {
+ return null;
+ }
+
+ return tribecaConfiguration.fetchAllGauge(programs);
+ }, [tribecaConfiguration, programs]);
+
+ useEffect(() => {
+ loadGauges().then(setGauges);
+ }, [loadGauges]);
+
+ return {
+ gauges,
+ programs,
+ };
+}
diff --git a/hooks/useTribecaGaugesInfos.ts b/hooks/useTribecaGaugesInfos.ts
new file mode 100644
index 0000000000..eac36f9223
--- /dev/null
+++ b/hooks/useTribecaGaugesInfos.ts
@@ -0,0 +1,226 @@
+import { useCallback, useEffect, useState } from 'react';
+import ATribecaConfiguration from '@tools/sdk/tribeca/ATribecaConfiguration';
+import useTribecaGauge from './useTribecaGauge';
+import { PublicKey } from '@solana/web3.js';
+import useRealm from './useRealm';
+import {
+ EpochGaugeVoterData,
+ EscrowData,
+ GaugemeisterData,
+ GaugeVoterData,
+} from '@tools/sdk/tribeca/programs';
+
+const EscrowOwnerMap = {
+ UXDProtocol: {
+ name: `SOL Treasury's Owner`,
+ publicKey: new PublicKey('7M6TSEkRiXiYmpRCcCDSdJGTGxAPem2HBqjW4gLQ2KoE'),
+ },
+ 'Kek World': {
+ name: `SOL Treasury's Owner`,
+ publicKey: new PublicKey('AuQHcJZhTd1dnXRrM78RomFiCvW6a9CqxxJ94Fp9h8b'),
+ },
+};
+
+export type ActiveGaugeVoteData = {
+ name: string;
+ mint: PublicKey;
+ logoURI?: string;
+ weight: number;
+ weightPercentage: number;
+};
+
+export type TribecaGaugesInfos = {
+ escrowData: EscrowData;
+ gaugemeisterData: GaugemeisterData;
+ gaugeVoterData: GaugeVoterData | null;
+ activeGaugeVotesData: ActiveGaugeVoteData[] | null;
+ currentEpochGaugeVoterData: EpochGaugeVoterData | null;
+ nextEpochGaugeVoterData: EpochGaugeVoterData | null;
+};
+
+export default function useTribecaGaugeInfos(
+ tribecaConfiguration: ATribecaConfiguration | null,
+) {
+ const { realm } = useRealm();
+
+ const [escrowOwner, setEscrowOwner] = useState<{
+ name: string;
+ publicKey: PublicKey;
+ } | null>(null);
+
+ useEffect(() => {
+ if (!realm) return;
+
+ setEscrowOwner(EscrowOwnerMap[realm.account.name] ?? null);
+ }, [realm]);
+
+ const { programs, gauges } = useTribecaGauge(tribecaConfiguration);
+
+ const [infos, setInfos] = useState(null);
+
+ const loadInfos = useCallback(async (): Promise => {
+ if (!tribecaConfiguration || !programs || !escrowOwner || !gauges)
+ return null;
+
+ try {
+ const [escrow] = await tribecaConfiguration.findEscrowAddress(
+ escrowOwner.publicKey,
+ );
+
+ const [escrowData, gaugemeisterData] = await Promise.all([
+ programs.LockedVoter.account.escrow.fetch(escrow),
+
+ programs.Gauge.account.gaugemeister.fetch(
+ tribecaConfiguration.gaugemeister,
+ ),
+ ]);
+
+ let gaugeVoter: PublicKey;
+
+ try {
+ const [publicKey] = await tribecaConfiguration.findGaugeVoterAddress(
+ escrow,
+ );
+
+ gaugeVoter = publicKey;
+ } catch (_) {
+ // means we have no gaugeVoter
+ return {
+ escrowData,
+ gaugemeisterData,
+ gaugeVoterData: null,
+ activeGaugeVotesData: null,
+ currentEpochGaugeVoterData: null,
+ nextEpochGaugeVoterData: null,
+ };
+ }
+
+ let gaugeVoterData: GaugeVoterData;
+
+ try {
+ gaugeVoterData = await programs.Gauge.account.gaugeVoter.fetch(
+ gaugeVoter,
+ );
+ } catch (_) {
+ // Gauge voter has not been initialized
+ return {
+ escrowData,
+ gaugemeisterData,
+ gaugeVoterData: null,
+ activeGaugeVotesData: null,
+ currentEpochGaugeVoterData: null,
+ nextEpochGaugeVoterData: null,
+ };
+ }
+
+ const gaugeVotes = await programs.Gauge.account.gaugeVote.all();
+
+ const activeGaugeVotes = gaugeVotes.filter(
+ (gaugeVote) =>
+ gaugeVote.account.weight > 0 &&
+ gaugeVote.account.gaugeVoter.equals(gaugeVoter),
+ );
+
+ const totalRelativeGaugeVotesWeight = activeGaugeVotes.reduce(
+ (totalWeight, activeGaugeVote) =>
+ totalWeight + activeGaugeVote.account.weight,
+ 0,
+ );
+
+ const activeGaugeVotesData = activeGaugeVotes.map((activeGaugeVote) => {
+ const [name, gaugeInfos] = Object.entries(gauges).find(([, gauge]) =>
+ gauge.publicKey.equals(activeGaugeVote.account.gauge),
+ )!;
+
+ return {
+ name,
+ mint: gaugeInfos.mint,
+ logoURI: gaugeInfos.logoURI,
+ weight: activeGaugeVote.account.weight,
+ weightPercentage: Number(
+ (
+ (activeGaugeVote.account.weight * 100) /
+ totalRelativeGaugeVotesWeight
+ ).toFixed(2),
+ ),
+ };
+ });
+
+ let currentEpochGaugeVoterData: EpochGaugeVoterData | null = null;
+
+ try {
+ const [
+ currentEpochGaugeVoter,
+ ] = await tribecaConfiguration.findEpochGaugeVoterAddress(
+ gaugeVoter,
+ gaugemeisterData.currentRewardsEpoch,
+ );
+
+ currentEpochGaugeVoterData = await programs.Gauge.account.epochGaugeVoter.fetch(
+ currentEpochGaugeVoter,
+ );
+ } catch (_) {
+ // ignore error, means we have not voted on the epoch
+ }
+
+ let nextEpochGaugeVoterData: EpochGaugeVoterData | null = null;
+
+ try {
+ const [
+ nextEpochGaugeVoter,
+ ] = await tribecaConfiguration.findEpochGaugeVoterAddress(
+ gaugeVoter,
+ gaugemeisterData.currentRewardsEpoch + 1,
+ );
+
+ nextEpochGaugeVoterData = await programs.Gauge.account.epochGaugeVoter.fetch(
+ nextEpochGaugeVoter,
+ );
+ } catch (_) {
+ // ignore error, means we have not voted on the epoch
+ }
+
+ return {
+ escrowData,
+ gaugemeisterData,
+ gaugeVoterData,
+ activeGaugeVotesData,
+ currentEpochGaugeVoterData,
+ nextEpochGaugeVoterData,
+ };
+ } catch (err) {
+ console.error(
+ `Cannot load Gauges infos for escrowOwner ${
+ escrowOwner.name
+ } / ${escrowOwner.publicKey.toString()}`,
+ err,
+ );
+
+ return null;
+ }
+ }, [tribecaConfiguration, programs, escrowOwner, gauges]);
+
+ useEffect(() => {
+ // add a cancel
+ let quit = false;
+
+ loadInfos().then((infos) => {
+ if (quit) {
+ return;
+ }
+
+ setInfos(infos);
+ });
+
+ return () => {
+ quit = true;
+ };
+ }, [loadInfos]);
+
+ return {
+ escrowOwner,
+ infos,
+ gauges,
+ programs,
+ };
+}
diff --git a/hooks/useTribecaPrograms.ts b/hooks/useTribecaPrograms.ts
new file mode 100644
index 0000000000..f2cfe7a45c
--- /dev/null
+++ b/hooks/useTribecaPrograms.ts
@@ -0,0 +1,34 @@
+import { useEffect, useState } from 'react';
+
+import useWalletStore from 'stores/useWalletStore';
+import ATribecaConfiguration, {
+ TribecaPrograms,
+} from '@tools/sdk/tribeca/ATribecaConfiguration';
+import { getTribecaPrograms } from '@tools/sdk/tribeca/configurations';
+
+export default function useTribecaPrograms(
+ tribecaConfiguration: ATribecaConfiguration | null,
+) {
+ const connection = useWalletStore((s) => s.connection);
+ const wallet = useWalletStore((s) => s.current);
+
+ const [programs, setPrograms] = useState(null);
+
+ useEffect(() => {
+ if (!connection || !wallet || !tribecaConfiguration) {
+ return;
+ }
+
+ setPrograms(
+ getTribecaPrograms({
+ connection: connection.current,
+ wallet,
+ config: tribecaConfiguration,
+ }),
+ );
+ }, [connection, wallet, tribecaConfiguration]);
+
+ return {
+ programs,
+ };
+}
diff --git a/hooks/useWallet.tsx b/hooks/useWallet.tsx
index ab8e99a14c..f119723ab2 100644
--- a/hooks/useWallet.tsx
+++ b/hooks/useWallet.tsx
@@ -1,16 +1,13 @@
-import { useEffect, useMemo } from 'react'
+import { useEffect, useMemo } from 'react';
-import useWalletStore from '../stores/useWalletStore'
-import { notify } from '../utils/notifications'
+import useWalletStore from '../stores/useWalletStore';
+import { notify } from '../utils/notifications';
import {
DEFAULT_PROVIDER,
getWalletProviderByUrl,
-} from '../utils/wallet-adapters'
+} from '../utils/wallet-adapters';
-import useInterval from './useInterval'
-import useLocalStorageState from './useLocalStorageState'
-
-const SECONDS = 1000
+import useLocalStorageState from './useLocalStorageState';
export default function useWallet() {
const {
@@ -20,63 +17,63 @@ export default function useWallet() {
providerUrl: selectedProviderUrl,
set: setWalletStore,
actions,
- } = useWalletStore((state) => state)
+ } = useWalletStore((state) => state);
const [savedProviderUrl, setSavedProviderUrl] = useLocalStorageState(
'walletProvider',
- DEFAULT_PROVIDER.url
- )
+ DEFAULT_PROVIDER.url,
+ );
// initialize selection from local storage
useEffect(() => {
if (!selectedProviderUrl) {
setWalletStore((s) => {
- s.providerUrl = savedProviderUrl
- })
+ s.providerUrl = savedProviderUrl;
+ });
}
- }, [selectedProviderUrl, savedProviderUrl])
+ }, [selectedProviderUrl, savedProviderUrl]);
const provider = useMemo(() => getWalletProviderByUrl(selectedProviderUrl), [
selectedProviderUrl,
- ])
+ ]);
// save selection in local storage
useEffect(() => {
if (selectedProviderUrl && selectedProviderUrl != savedProviderUrl) {
- setSavedProviderUrl(selectedProviderUrl)
+ setSavedProviderUrl(selectedProviderUrl);
}
- }, [selectedProviderUrl])
+ }, [selectedProviderUrl]);
useEffect(() => {
if (provider) {
const updateWallet = () => {
// hack to also update wallet synchronously in case it disconnects
- const wallet = provider.adapter
+ const wallet = provider.adapter;
setWalletStore((state) => {
- state.current = wallet
- })
- }
+ state.current = wallet;
+ });
+ };
if (document.readyState !== 'complete') {
// wait to ensure that browser extensions are loaded
const listener = () => {
- updateWallet()
- window.removeEventListener('load', listener)
- }
- window.addEventListener('load', listener)
- return () => window.removeEventListener('load', listener)
+ updateWallet();
+ window.removeEventListener('load', listener);
+ };
+ window.addEventListener('load', listener);
+ return () => window.removeEventListener('load', listener);
} else {
- updateWallet()
+ updateWallet();
}
}
- }, [provider, connection])
+ }, [provider, connection]);
useEffect(() => {
- if (!wallet) return
+ if (!wallet) return;
wallet.on('connect', async () => {
setWalletStore((state) => {
- state.connected = true
- })
+ state.connected = true;
+ });
notify({
message: 'Wallet connected',
description:
@@ -84,40 +81,27 @@ export default function useWallet() {
wallet!.publicKey!.toString().substr(0, 5) +
'...' +
wallet!.publicKey!.toString().substr(-5),
- })
- await actions.fetchWalletTokenAccounts()
- await actions.fetchOwnVoteRecords()
- })
+ });
+ await actions.fetchWalletTokenAccounts();
+ await actions.fetchOwnVoteRecords();
+ });
wallet.on('disconnect', () => {
setWalletStore((state) => {
- state.connected = false
- state.tokenAccounts = []
- })
+ state.connected = false;
+ state.tokenAccounts = [];
+ });
notify({
type: 'info',
message: 'Disconnected from wallet',
- })
- })
+ });
+ });
return () => {
- wallet?.disconnect?.()
+ wallet?.disconnect?.();
setWalletStore((state) => {
- state.connected = false
- })
- }
- }, [wallet])
-
- // fetch on page load
- useEffect(() => {
- const pageLoad = async () => {
- console.log('pageLoad')
- }
- pageLoad()
- }, [])
-
- // refresh regularly
- useInterval(async () => {
- console.log('refresh')
- }, 10 * SECONDS)
+ state.connected = false;
+ });
+ };
+ }, [wallet]);
- return { connected, wallet }
+ return { connected, wallet };
}
diff --git a/hooks/usefriktionVolts.ts b/hooks/usefriktionVolts.ts
new file mode 100644
index 0000000000..cb56c87c06
--- /dev/null
+++ b/hooks/usefriktionVolts.ts
@@ -0,0 +1,34 @@
+import { useEffect, useState } from 'react';
+import { Wallet } from '@project-serum/sol-wallet-adapter';
+import { Connection, PublicKey } from '@solana/web3.js';
+import { getVolts, VoltList } from '@tools/sdk/friktion/friktion';
+
+const useFriktionVolt = ({
+ connection,
+ wallet,
+ governedAccountPubkey,
+}: {
+ connection: Connection;
+ wallet: Wallet;
+ governedAccountPubkey?: PublicKey;
+}) => {
+ const [friktionVolts, setFriktionVolts] = useState(null);
+
+ useEffect(() => {
+ // call for the mainnet friktion volts
+ (async () => {
+ if (!governedAccountPubkey) return;
+
+ const volts = await getVolts({
+ connection,
+ wallet,
+ governancePubkey: governedAccountPubkey,
+ });
+ setFriktionVolts(volts);
+ })();
+ }, [governedAccountPubkey]);
+
+ return { friktionVolts };
+};
+
+export default useFriktionVolt;
diff --git a/idls/ido_pool.json b/idls/ido_pool.json
deleted file mode 100644
index 3ad9ad24ae..0000000000
--- a/idls/ido_pool.json
+++ /dev/null
@@ -1,402 +0,0 @@
-{
- "version": "0.0.0",
- "name": "ido_pool",
- "instructions": [
- {
- "name": "initializePool",
- "accounts": [
- {
- "name": "poolAccount",
- "isMut": true,
- "isSigner": false
- },
- {
- "name": "poolSigner",
- "isMut": false,
- "isSigner": false
- },
- {
- "name": "redeemableMint",
- "isMut": false,
- "isSigner": false
- },
- {
- "name": "usdcMint",
- "isMut": false,
- "isSigner": false
- },
- {
- "name": "poolWatermelon",
- "isMut": true,
- "isSigner": false
- },
- {
- "name": "poolUsdc",
- "isMut": false,
- "isSigner": false
- },
- {
- "name": "distributionAuthority",
- "isMut": false,
- "isSigner": true
- },
- {
- "name": "creatorWatermelon",
- "isMut": true,
- "isSigner": false
- },
- {
- "name": "tokenProgram",
- "isMut": false,
- "isSigner": false
- },
- {
- "name": "rent",
- "isMut": false,
- "isSigner": false
- },
- {
- "name": "clock",
- "isMut": false,
- "isSigner": false
- }
- ],
- "args": [
- {
- "name": "numIdoTokens",
- "type": "u64"
- },
- {
- "name": "nonce",
- "type": "u8"
- },
- {
- "name": "startIdoTs",
- "type": "i64"
- },
- {
- "name": "endDepositsTs",
- "type": "i64"
- },
- {
- "name": "endIdoTs",
- "type": "i64"
- }
- ]
- },
- {
- "name": "exchangeUsdcForRedeemable",
- "accounts": [
- {
- "name": "poolAccount",
- "isMut": false,
- "isSigner": false
- },
- {
- "name": "poolSigner",
- "isMut": false,
- "isSigner": false
- },
- {
- "name": "redeemableMint",
- "isMut": true,
- "isSigner": false
- },
- {
- "name": "poolUsdc",
- "isMut": true,
- "isSigner": false
- },
- {
- "name": "userAuthority",
- "isMut": false,
- "isSigner": true
- },
- {
- "name": "userUsdc",
- "isMut": true,
- "isSigner": false
- },
- {
- "name": "userRedeemable",
- "isMut": true,
- "isSigner": false
- },
- {
- "name": "tokenProgram",
- "isMut": false,
- "isSigner": false
- },
- {
- "name": "clock",
- "isMut": false,
- "isSigner": false
- }
- ],
- "args": [
- {
- "name": "amount",
- "type": "u64"
- }
- ]
- },
- {
- "name": "exchangeRedeemableForUsdc",
- "accounts": [
- {
- "name": "poolAccount",
- "isMut": false,
- "isSigner": false
- },
- {
- "name": "poolSigner",
- "isMut": false,
- "isSigner": false
- },
- {
- "name": "redeemableMint",
- "isMut": true,
- "isSigner": false
- },
- {
- "name": "poolUsdc",
- "isMut": true,
- "isSigner": false
- },
- {
- "name": "userAuthority",
- "isMut": false,
- "isSigner": true
- },
- {
- "name": "userUsdc",
- "isMut": true,
- "isSigner": false
- },
- {
- "name": "userRedeemable",
- "isMut": true,
- "isSigner": false
- },
- {
- "name": "tokenProgram",
- "isMut": false,
- "isSigner": false
- },
- {
- "name": "clock",
- "isMut": false,
- "isSigner": false
- }
- ],
- "args": [
- {
- "name": "amount",
- "type": "u64"
- }
- ]
- },
- {
- "name": "exchangeRedeemableForWatermelon",
- "accounts": [
- {
- "name": "poolAccount",
- "isMut": false,
- "isSigner": false
- },
- {
- "name": "poolSigner",
- "isMut": false,
- "isSigner": false
- },
- {
- "name": "redeemableMint",
- "isMut": true,
- "isSigner": false
- },
- {
- "name": "poolWatermelon",
- "isMut": true,
- "isSigner": false
- },
- {
- "name": "userAuthority",
- "isMut": false,
- "isSigner": true
- },
- {
- "name": "userWatermelon",
- "isMut": true,
- "isSigner": false
- },
- {
- "name": "userRedeemable",
- "isMut": true,
- "isSigner": false
- },
- {
- "name": "tokenProgram",
- "isMut": false,
- "isSigner": false
- },
- {
- "name": "clock",
- "isMut": false,
- "isSigner": false
- }
- ],
- "args": [
- {
- "name": "amount",
- "type": "u64"
- }
- ]
- },
- {
- "name": "withdrawPoolUsdc",
- "accounts": [
- {
- "name": "poolAccount",
- "isMut": false,
- "isSigner": false
- },
- {
- "name": "poolSigner",
- "isMut": false,
- "isSigner": false
- },
- {
- "name": "poolUsdc",
- "isMut": true,
- "isSigner": false
- },
- {
- "name": "distributionAuthority",
- "isMut": false,
- "isSigner": true
- },
- {
- "name": "creatorUsdc",
- "isMut": true,
- "isSigner": false
- },
- {
- "name": "tokenProgram",
- "isMut": false,
- "isSigner": false
- },
- {
- "name": "clock",
- "isMut": false,
- "isSigner": false
- }
- ],
- "args": []
- }
- ],
- "accounts": [
- {
- "name": "PoolAccount",
- "type": {
- "kind": "struct",
- "fields": [
- {
- "name": "redeemableMint",
- "type": "publicKey"
- },
- {
- "name": "poolWatermelon",
- "type": "publicKey"
- },
- {
- "name": "watermelonMint",
- "type": "publicKey"
- },
- {
- "name": "poolUsdc",
- "type": "publicKey"
- },
- {
- "name": "distributionAuthority",
- "type": "publicKey"
- },
- {
- "name": "nonce",
- "type": "u8"
- },
- {
- "name": "numIdoTokens",
- "type": "u64"
- },
- {
- "name": "startIdoTs",
- "type": "i64"
- },
- {
- "name": "endDepositsTs",
- "type": "i64"
- },
- {
- "name": "endIdoTs",
- "type": "i64"
- }
- ]
- }
- }
- ],
- "errors": [
- {
- "code": 300,
- "name": "IdoFuture",
- "msg": "IDO must start in the future"
- },
- {
- "code": 301,
- "name": "SeqTimes",
- "msg": "IDO times are non-sequential"
- },
- {
- "code": 302,
- "name": "StartIdoTime",
- "msg": "IDO has not started"
- },
- {
- "code": 303,
- "name": "EndDepositsTime",
- "msg": "Deposits period has ended"
- },
- {
- "code": 304,
- "name": "EndIdoTime",
- "msg": "IDO has ended"
- },
- {
- "code": 305,
- "name": "IdoNotOver",
- "msg": "IDO has not finished yet"
- },
- {
- "code": 306,
- "name": "LowUsdc",
- "msg": "Insufficient USDC"
- },
- {
- "code": 307,
- "name": "LowRedeemable",
- "msg": "Insufficient redeemable tokens"
- },
- {
- "code": 308,
- "name": "UsdcNotEqRedeem",
- "msg": "USDC total and redeemable total don't match"
- },
- {
- "code": 309,
- "name": "InvalidNonce",
- "msg": "Given nonce is invalid"
- }
- ],
- "metadata": {
- "address": "6QXNNAPkPsWjd1j3qQJTvRFgSNPARMhF2tE8g1WeGyrM"
- }
-}
diff --git a/jest.config.js b/jest.config.js
index 8fb5251e93..336b24fd34 100644
--- a/jest.config.js
+++ b/jest.config.js
@@ -1,6 +1,6 @@
-const nextJest = require('next/jest')
-const { resolve } = require('path')
-const { readdirSync } = require('fs')
+const nextJest = require('next/jest');
+const { resolve } = require('path');
+const { readdirSync } = require('fs');
// XXX: hack to deal with tsconfig.baseUrl: "." and tsconfig.paths
const directories = readdirSync(__dirname, { withFileTypes: true })
@@ -13,13 +13,13 @@ const directories = readdirSync(__dirname, { withFileTypes: true })
[`^${dir}/(.*)$`]: resolve(__dirname, `./${dir}/$1`),
[`^@${dir}/(.*)$`]: resolve(__dirname, `./${dir}/$1`),
}),
- {}
- )
+ {},
+ );
const customConfig = {
moduleNameMapper: directories,
setupFilesAfterEnv: ['/test/setup.js'],
moduleDirectories: ['node_modules', '/'],
-}
+};
-module.exports = nextJest({ dir: './' })(customConfig)
+module.exports = nextJest({ dir: './' })(customConfig);
diff --git a/models/api.ts b/models/api.ts
index 9e30b05c31..24e48b3983 100644
--- a/models/api.ts
+++ b/models/api.ts
@@ -1,30 +1,32 @@
-import { Connection, PublicKey } from '@solana/web3.js'
+import { Connection, PublicKey } from '@solana/web3.js';
import {
booleanFilter,
getGovernanceAccounts,
TokenOwnerRecord,
VoteRecord,
-} from '@solana/spl-governance'
+} from '@solana/spl-governance';
-import { pubkeyFilter } from '@solana/spl-governance'
-import { arrayToRecord } from '@tools/core/script'
+import { pubkeyFilter } from '@solana/spl-governance';
+import { arrayToRecord } from '@tools/core/script';
// TokenOwnerRecords
export async function getTokenOwnerRecordsForRealmMintMapByOwner(
connection: Connection,
programId: PublicKey,
realmId: PublicKey,
- governingTokenMintPk: PublicKey | undefined
+ governingTokenMintPk: PublicKey | undefined,
) {
return governingTokenMintPk
? getGovernanceAccounts(connection, programId, TokenOwnerRecord, [
pubkeyFilter(1, realmId)!,
pubkeyFilter(1 + 32, governingTokenMintPk)!,
]).then((tors) =>
- arrayToRecord(tors, (tor) => tor.account.governingTokenOwner.toBase58())
+ arrayToRecord(tors, (tor) =>
+ tor.account.governingTokenOwner.toBase58(),
+ ),
)
- : undefined
+ : undefined;
}
// VoteRecords
@@ -32,32 +34,32 @@ export async function getTokenOwnerRecordsForRealmMintMapByOwner(
export async function getUnrelinquishedVoteRecords(
connection: Connection,
programId: PublicKey,
- tokenOwnerRecordPk: PublicKey
+ tokenOwnerRecordPk: PublicKey,
) {
return getGovernanceAccounts(connection, programId, VoteRecord, [
pubkeyFilter(1 + 32, tokenOwnerRecordPk)!,
booleanFilter(1 + 32 + 32, false),
- ])
+ ]);
}
export async function getVoteRecordsByVoterMapByProposal(
connection: Connection,
programId: PublicKey,
- voter: PublicKey
+ voter: PublicKey,
) {
return getGovernanceAccounts(connection, programId, VoteRecord, [
pubkeyFilter(33, voter)!,
- ]).then((vrs) => arrayToRecord(vrs, (vr) => vr.account.proposal.toBase58()))
+ ]).then((vrs) => arrayToRecord(vrs, (vr) => vr.account.proposal.toBase58()));
}
export async function getVoteRecordsByProposalMapByVoter(
connection: Connection,
programId: PublicKey,
- proposalPubKey: PublicKey
+ proposalPubKey: PublicKey,
) {
return getGovernanceAccounts(connection, programId, VoteRecord, [
pubkeyFilter(1, proposalPubKey)!,
]).then((vrs) =>
- arrayToRecord(vrs, (vr) => vr.account.governingTokenOwner.toBase58())
- )
+ arrayToRecord(vrs, (vr) => vr.account.governingTokenOwner.toBase58()),
+ );
}
diff --git a/models/registry/api.ts b/models/registry/api.ts
index 1aa966ca15..dc248a94c3 100644
--- a/models/registry/api.ts
+++ b/models/registry/api.ts
@@ -1,53 +1,53 @@
-import { getRealms, PROGRAM_VERSION_V1, Realm } from '@solana/spl-governance'
+import { getRealms, PROGRAM_VERSION_V1, Realm } from '@solana/spl-governance';
-import { ProgramAccount } from '@solana/spl-governance'
-import { PublicKey } from '@solana/web3.js'
-import { arrayToMap, arrayToUnique } from '@tools/core/script'
+import { ProgramAccount } from '@solana/spl-governance';
+import { PublicKey } from '@solana/web3.js';
+import { arrayToMap, arrayToUnique } from '@tools/core/script';
-import devnetRealms from 'public/realms/devnet.json'
-import mainnetBetaRealms from 'public/realms/mainnet-beta.json'
-import type { ConnectionContext } from 'utils/connection'
-import { equalsIgnoreCase } from '../../tools/core/strings'
+import devnetRealms from 'public/realms/devnet.json';
+import mainnetBetaRealms from 'public/realms/mainnet-beta.json';
+import type { ConnectionContext } from 'utils/connection';
+import { equalsIgnoreCase } from '../../tools/core/strings';
export interface RealmInfo {
- symbol: string
- programId: PublicKey
- programVersion?: number
- realmId: PublicKey
- website?: string
+ symbol: string;
+ programId: PublicKey;
+ programVersion?: number;
+ realmId: PublicKey;
+ website?: string;
// Specifies the realm mainnet name for resource lookups
// It's required for none mainnet environments when the realm name is different than on mainnet
- displayName?: string
+ displayName?: string;
// Website keywords
- keywords?: string
+ keywords?: string;
// twitter:site meta
- twitter?: string
+ twitter?: string;
// og:image
- ogImage?: string
+ ogImage?: string;
// banner mage
- bannerImage?: string
+ bannerImage?: string;
- isCertified: boolean
+ isCertified: boolean;
// 3- featured DAOs ,2- new DAO with active proposals, 1- DAOs with active proposal,
- sortRank?: number
+ sortRank?: number;
}
export function getProgramVersionForRealm(realmInfo: RealmInfo) {
// TODO: as a temp fix V1 is returned by default
- return realmInfo?.programVersion ?? PROGRAM_VERSION_V1
+ return realmInfo?.programVersion ?? PROGRAM_VERSION_V1;
}
interface RealmInfoAsJSON
extends Omit {
- programId: string
- realmId: string
+ programId: string;
+ realmId: string;
}
// TODO: Once governance program clones registry program and governance
// accounts metadata is on-chain the list should be moved there
-const MAINNET_REALMS = parseCertifiedRealms(mainnetBetaRealms)
-const DEVNET_REALMS = parseCertifiedRealms(devnetRealms)
+const MAINNET_REALMS = parseCertifiedRealms(mainnetBetaRealms);
+const DEVNET_REALMS = parseCertifiedRealms(devnetRealms);
function parseCertifiedRealms(realms: RealmInfoAsJSON[]) {
return realms.map((realm) => ({
@@ -56,31 +56,31 @@ function parseCertifiedRealms(realms: RealmInfoAsJSON[]) {
realmId: new PublicKey(realm.realmId),
isCertified: true,
programVersion: realm.programVersion,
- })) as ReadonlyArray
+ })) as ReadonlyArray;
}
// Returns certified realms
// Note: the certification process is currently done through PRs to this repo
// This is a temp. workaround until we have the registry up and running
export function getCertifiedRealmInfos({ cluster }: ConnectionContext) {
- return cluster === 'mainnet' ? MAINNET_REALMS : DEVNET_REALMS
+ return cluster === 'mainnet' ? MAINNET_REALMS : DEVNET_REALMS;
}
export function getCertifiedRealmInfo(
realmId: string,
- connection: ConnectionContext
+ connection: ConnectionContext,
) {
if (!realmId) {
- return undefined
+ return undefined;
}
const realmInfo = getCertifiedRealmInfos(connection).find(
(r) =>
equalsIgnoreCase(r.realmId.toBase58(), realmId) ||
- equalsIgnoreCase(r.symbol, realmId)
- )
+ equalsIgnoreCase(r.symbol, realmId),
+ );
- return realmInfo
+ return realmInfo;
}
// Whitelist of Realms we exclude even from the Unchartered category
@@ -139,26 +139,26 @@ const EXCLUDED_REALMS = new Map([
['9Xe5qW76XPhyohKaz8joecybGnKrgT4N6JNEuM5ZZwa9', ''], // 1SOL test
['2mDwFhax7XcudkVzoV85pxo3B5aRqCt3diavVydjkBJC', ''], // 1SOL test
['DkSvNgykZPPFczhJVh8HDkhz25ByrDoPcB32q75AYu9k', ''], // UXDProtocolDAO test
-])
+]);
// Returns all known realms from all known spl-gov instances which are not certified
export async function getUnchartedRealmInfos(connection: ConnectionContext) {
- const certifiedRealms = getCertifiedRealmInfos(connection)
+ const certifiedRealms = getCertifiedRealmInfos(connection);
const allRealms = (
await Promise.all(
// Assuming all the known spl-gov instances are already included in the certified realms list
arrayToUnique(certifiedRealms, (r) => r.programId.toBase58()).map((p) =>
- getRealms(connection.current, p.programId)
- )
+ getRealms(connection.current, p.programId),
+ ),
)
)
.flatMap((r) => Object.values(r))
- .sort((r1, r2) => r1.account.name.localeCompare(r2.account.name))
+ .sort((r1, r2) => r1.account.name.localeCompare(r2.account.name));
const excludedRealms = arrayToMap(certifiedRealms, (r) =>
- r.realmId.toBase58()
- )
+ r.realmId.toBase58(),
+ );
return Object.values(allRealms)
.map((r) => {
@@ -167,9 +167,9 @@ export async function getUnchartedRealmInfos(connection: ConnectionContext) {
EXCLUDED_REALMS.has(r.pubkey.toBase58())
)
? createUnchartedRealmInfo(r)
- : undefined
+ : undefined;
})
- .filter(Boolean) as readonly RealmInfo[]
+ .filter(Boolean) as readonly RealmInfo[];
}
export function createUnchartedRealmInfo(realm: ProgramAccount) {
@@ -179,5 +179,5 @@ export function createUnchartedRealmInfo(realm: ProgramAccount) {
realmId: realm.pubkey,
displayName: realm.account.name,
isCertified: false,
- } as RealmInfo
+ } as RealmInfo;
}
diff --git a/models/types.ts b/models/types.ts
index a0dda4b77d..9026843b9f 100644
--- a/models/types.ts
+++ b/models/types.ts
@@ -1 +1 @@
-export type EndpointTypes = 'mainnet' | 'devnet' | 'localnet'
+export type EndpointTypes = 'mainnet' | 'devnet' | 'localnet';
diff --git a/models/voteRecords.ts b/models/voteRecords.ts
index 66ea6f89d6..d4a16ae447 100644
--- a/models/voteRecords.ts
+++ b/models/voteRecords.ts
@@ -2,34 +2,34 @@ import {
GovernanceAccountType,
VoteKind,
VoteRecord,
-} from '@solana/spl-governance'
+} from '@solana/spl-governance';
export function isYesVote(voteRecord: VoteRecord) {
switch (voteRecord.accountType) {
case GovernanceAccountType.VoteRecordV1: {
- return voteRecord.voteWeight?.yes && !voteRecord.voteWeight.yes.isZero()
+ return voteRecord.voteWeight?.yes && !voteRecord.voteWeight.yes.isZero();
}
case GovernanceAccountType.VoteRecordV2: {
switch (voteRecord.vote?.voteType) {
case VoteKind.Approve: {
- return true
+ return true;
}
case VoteKind.Deny: {
- return false
+ return false;
}
default:
- throw new Error('Invalid voteKind')
+ throw new Error('Invalid voteKind');
}
}
default:
- throw new Error(`Invalid account type ${voteRecord.accountType} `)
+ throw new Error(`Invalid account type ${voteRecord.accountType} `);
}
}
export function getVoteWeight(voteRecord: VoteRecord) {
if (isYesVote(voteRecord)) {
- return voteRecord.getYesVoteWeight()
+ return voteRecord.getYesVoteWeight();
}
- return voteRecord.getNoVoteWeight()
+ return voteRecord.getNoVoteWeight();
}
diff --git a/models/voteWeights.ts b/models/voteWeights.ts
index 91699a295f..42b22cfeda 100644
--- a/models/voteWeights.ts
+++ b/models/voteWeights.ts
@@ -1,128 +1,130 @@
-import BN from 'bn.js'
-import { MintInfo } from '@solana/spl-token'
-import BigNumber from 'bignumber.js'
+import BN from 'bn.js';
+import { MintInfo } from '@solana/spl-token';
+import BigNumber from 'bignumber.js';
import {
GovernanceConfig,
MintMaxVoteWeightSource,
Proposal,
Realm,
TokenOwnerRecord,
-} from '@solana/spl-governance'
-import { ProgramAccount } from '@solana/spl-governance'
-import { PublicKey } from '@solana/web3.js'
+} from '@solana/spl-governance';
+import { ProgramAccount } from '@solana/spl-governance';
+import { PublicKey } from '@solana/web3.js';
interface VoterWeightInterface {
- votingPower?: BN
- communityTokenRecord?: ProgramAccount | undefined
- councilTokenRecord?: ProgramAccount | undefined
- hasAnyWeight: () => boolean
- getTokenRecord: () => PublicKey
- hasMinCommunityWeight: (minCommunityWeight: BN) => boolean | undefined
- hasMinCouncilWeight: (minCouncilWeight: BN) => boolean | undefined
- canCreateProposal: (config: GovernanceConfig) => boolean | undefined
+ votingPower?: BN;
+ communityTokenRecord?: ProgramAccount | undefined;
+ councilTokenRecord?: ProgramAccount | undefined;
+ hasAnyWeight: () => boolean;
+ getTokenRecord: () => PublicKey;
+ hasMinCommunityWeight: (minCommunityWeight: BN) => boolean | undefined;
+ hasMinCouncilWeight: (minCouncilWeight: BN) => boolean | undefined;
+ canCreateProposal: (config: GovernanceConfig) => boolean | undefined;
canCreateGovernanceUsingCommunityTokens: (
- realm: ProgramAccount
- ) => boolean | undefined
- canCreateGovernanceUsingCouncilTokens: () => boolean | undefined
- canCreateGovernance: (realm: ProgramAccount) => boolean | undefined
+ realm: ProgramAccount,
+ ) => boolean | undefined;
+ canCreateGovernanceUsingCouncilTokens: () => boolean | undefined;
+ canCreateGovernance: (realm: ProgramAccount) => boolean | undefined;
getTokenRecordToCreateProposal: (
- config: GovernanceConfig
- ) => ProgramAccount
- hasMinAmountToVote: (mintPk: PublicKey) => boolean | undefined
+ config: GovernanceConfig,
+ ) => ProgramAccount;
+ hasMinAmountToVote: (mintPk: PublicKey) => boolean | undefined;
}
/// VoterWeight encapsulates logic to determine voter weights from token records (community or council)
export class VoteRegistryVoterWeight implements VoterWeightInterface {
//TODO implement council
- communityTokenRecord: ProgramAccount | undefined
- councilTokenRecord: ProgramAccount | undefined
- votingPower: BN
+ communityTokenRecord: ProgramAccount | undefined;
+ councilTokenRecord: ProgramAccount | undefined;
+ votingPower: BN;
constructor(
communityTokenRecord: ProgramAccount | undefined,
- votingPower: BN
+ votingPower: BN,
) {
- this.communityTokenRecord = communityTokenRecord
- this.councilTokenRecord = undefined
- this.votingPower = votingPower
+ this.communityTokenRecord = communityTokenRecord;
+ this.councilTokenRecord = undefined;
+ this.votingPower = votingPower;
}
// Checks if the voter has any voting weight
hasAnyWeight() {
- return !this.votingPower.isZero()
+ return !this.votingPower.isZero();
}
// Returns first available tokenRecord
getTokenRecord() {
if (this.communityTokenRecord) {
- return this.communityTokenRecord.pubkey
+ return this.communityTokenRecord.pubkey;
}
- throw new Error('Current wallet has no Token Owner Records')
+ throw new Error('Current wallet has no Token Owner Records');
}
hasMinCommunityWeight(minCommunityWeight: BN) {
return (
this.communityTokenRecord && this.votingPower.cmp(minCommunityWeight) >= 0
- )
+ );
}
hasMinCouncilWeight() {
- return false
+ return false;
}
canCreateProposal(config: GovernanceConfig) {
- return this.hasMinCommunityWeight(config.minCommunityTokensToCreateProposal)
+ return this.hasMinCommunityWeight(
+ config.minCommunityTokensToCreateProposal,
+ );
}
canCreateGovernanceUsingCommunityTokens(realm: ProgramAccount) {
return this.hasMinCommunityWeight(
- realm.account.config.minCommunityTokensToCreateGovernance
- )
+ realm.account.config.minCommunityTokensToCreateGovernance,
+ );
}
canCreateGovernanceUsingCouncilTokens() {
- return false
+ return false;
}
canCreateGovernance(realm: ProgramAccount) {
return (
this.canCreateGovernanceUsingCommunityTokens(realm) ||
this.canCreateGovernanceUsingCouncilTokens()
- )
+ );
}
hasMinAmountToVote(mintPk: PublicKey) {
const isCommunity =
this.communityTokenRecord?.account.governingTokenMint.toBase58() ===
- mintPk.toBase58()
+ mintPk.toBase58();
const isCouncil =
this.councilTokenRecord?.account.governingTokenMint.toBase58() ===
- mintPk.toBase58()
+ mintPk.toBase58();
if (isCouncil) {
- return false
+ return false;
}
if (isCommunity) {
- return !this.votingPower.isZero()
+ return !this.votingPower.isZero();
}
}
getTokenRecordToCreateProposal(config: GovernanceConfig) {
// Prefer community token owner record as proposal owner
if (this.hasMinCommunityWeight(config.minCommunityTokensToCreateProposal)) {
- return this.communityTokenRecord!
+ return this.communityTokenRecord!;
}
- throw new Error('Not enough vote weight to create proposal')
+ throw new Error('Not enough vote weight to create proposal');
}
}
export class VoterWeight implements VoterWeightInterface {
- communityTokenRecord: ProgramAccount | undefined
- councilTokenRecord: ProgramAccount | undefined
+ communityTokenRecord: ProgramAccount | undefined;
+ councilTokenRecord: ProgramAccount | undefined;
//votingPower used only with plugin
- votingPower?: BN | undefined
+ votingPower?: BN | undefined;
constructor(
communityTokenRecord: ProgramAccount | undefined,
- councilTokenRecord: ProgramAccount | undefined
+ councilTokenRecord: ProgramAccount | undefined,
) {
- this.communityTokenRecord = communityTokenRecord
- this.councilTokenRecord = councilTokenRecord
+ this.communityTokenRecord = communityTokenRecord;
+ this.councilTokenRecord = councilTokenRecord;
}
// Checks if the voter has any voting weight
@@ -130,116 +132,116 @@ export class VoterWeight implements VoterWeightInterface {
return (
!this.communityTokenRecord?.account.governingTokenDepositAmount.isZero() ||
!this.councilTokenRecord?.account.governingTokenDepositAmount.isZero()
- )
+ );
}
// Returns first available tokenRecord
getTokenRecord() {
if (this.communityTokenRecord) {
- return this.communityTokenRecord.pubkey
+ return this.communityTokenRecord.pubkey;
}
if (this.councilTokenRecord) {
- return this.councilTokenRecord.pubkey
+ return this.councilTokenRecord.pubkey;
}
- throw new Error('Current wallet has no Token Owner Records')
+ throw new Error('Current wallet has no Token Owner Records');
}
hasMinCommunityWeight(minCommunityWeight: BN) {
return (
this.communityTokenRecord &&
this.communityTokenRecord.account.governingTokenDepositAmount.cmp(
- minCommunityWeight
+ minCommunityWeight,
) >= 0
- )
+ );
}
hasMinCouncilWeight(minCouncilWeight: BN) {
return (
this.councilTokenRecord &&
this.councilTokenRecord.account.governingTokenDepositAmount.cmp(
- minCouncilWeight
+ minCouncilWeight,
) >= 0
- )
+ );
}
canCreateProposal(config: GovernanceConfig) {
return (
this.hasMinCommunityWeight(config.minCommunityTokensToCreateProposal) ||
this.hasMinCouncilWeight(config.minCouncilTokensToCreateProposal)
- )
+ );
}
canCreateGovernanceUsingCommunityTokens(realm: ProgramAccount) {
return this.hasMinCommunityWeight(
- realm.account.config.minCommunityTokensToCreateGovernance
- )
+ realm.account.config.minCommunityTokensToCreateGovernance,
+ );
}
canCreateGovernanceUsingCouncilTokens() {
return (
this.councilTokenRecord &&
!this.councilTokenRecord.account.governingTokenDepositAmount.isZero()
- )
+ );
}
canCreateGovernance(realm: ProgramAccount) {
return (
this.canCreateGovernanceUsingCommunityTokens(realm) ||
this.canCreateGovernanceUsingCouncilTokens()
- )
+ );
}
hasMinAmountToVote(mintPk: PublicKey) {
const isCommunity =
this.communityTokenRecord?.account.governingTokenMint.toBase58() ===
- mintPk.toBase58()
+ mintPk.toBase58();
const isCouncil =
this.councilTokenRecord?.account.governingTokenMint.toBase58() ===
- mintPk.toBase58()
+ mintPk.toBase58();
if (isCouncil) {
- return !this.councilTokenRecord?.account.governingTokenDepositAmount.isZero()
+ return !this.councilTokenRecord?.account.governingTokenDepositAmount.isZero();
}
if (isCommunity) {
- return !this.communityTokenRecord?.account.governingTokenDepositAmount.isZero()
+ return !this.communityTokenRecord?.account.governingTokenDepositAmount.isZero();
}
}
getTokenRecordToCreateProposal(config: GovernanceConfig) {
// Prefer community token owner record as proposal owner
if (this.hasMinCommunityWeight(config.minCommunityTokensToCreateProposal)) {
- return this.communityTokenRecord!
+ return this.communityTokenRecord!;
}
if (this.hasMinCouncilWeight(config.minCouncilTokensToCreateProposal)) {
- return this.councilTokenRecord!
+ return this.councilTokenRecord!;
}
- throw new Error('Not enough vote weight to create proposal')
+ throw new Error('Not enough vote weight to create proposal');
}
}
/// Returns max VoteWeight for given mint and max source
export function getMintMaxVoteWeight(
mint: MintInfo,
- maxVoteWeightSource: MintMaxVoteWeightSource
+ maxVoteWeightSource: MintMaxVoteWeightSource,
) {
if (maxVoteWeightSource.isFullSupply()) {
- return mint.supply
+ return mint.supply;
}
- const supplyFraction = maxVoteWeightSource.getSupplyFraction()
+ const supplyFraction = maxVoteWeightSource.getSupplyFraction();
const maxVoteWeight = new BigNumber(supplyFraction.toString())
.multipliedBy(mint.supply.toString())
- .shiftedBy(-MintMaxVoteWeightSource.SUPPLY_FRACTION_DECIMALS)
+ .shiftedBy(-MintMaxVoteWeightSource.SUPPLY_FRACTION_DECIMALS);
- return new BN(maxVoteWeight.dp(0, BigNumber.ROUND_DOWN).toString())
+ return new BN(maxVoteWeight.dp(0, BigNumber.ROUND_DOWN).toString());
}
/// Returns max vote weight for a proposal
export function getProposalMaxVoteWeight(
realm: Realm,
proposal: Proposal,
- governingTokenMint: MintInfo
+ governingTokenMint: MintInfo,
) {
// For finalized proposals the max is stored on the proposal in case it can change in the future
if (proposal.isVoteFinalized() && proposal.maxVoteWeight) {
- return proposal.maxVoteWeight
+ return proposal.maxVoteWeight;
}
// Council votes are currently not affected by MaxVoteWeightSource
@@ -247,11 +249,11 @@ export function getProposalMaxVoteWeight(
proposal.governingTokenMint.toBase58() ===
realm.config.councilMint?.toBase58()
) {
- return governingTokenMint.supply
+ return governingTokenMint.supply;
}
return getMintMaxVoteWeight(
governingTokenMint,
- realm.config.communityMintMaxVoteWeightSource
- )
+ realm.config.communityMintMaxVoteWeightSource,
+ );
}
diff --git a/models/withCreateSplTokenAccount.ts b/models/withCreateSplTokenAccount.ts
deleted file mode 100644
index ab675ad74e..0000000000
--- a/models/withCreateSplTokenAccount.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import {
- Connection,
- Keypair,
- PublicKey,
- TransactionInstruction,
-} from '@solana/web3.js'
-
-import * as serum from '@project-serum/common'
-import { WalletSigner } from '@solana/spl-governance'
-
-export const withCreateSplTokenAccount = async (
- connection: Connection,
- wallet: WalletSigner | undefined,
- instructions: TransactionInstruction[],
- signers: Keypair[],
- mint: PublicKey
-): Promise<{ tokenAccountAddress: PublicKey }> => {
- const tokenAccount = new Keypair()
- const provider = new serum.Provider(
- connection,
- wallet as serum.Wallet,
- serum.Provider.defaultOptions()
- )
- instructions.push(
- ...(await serum.createTokenAccountInstrs(
- provider,
- tokenAccount.publicKey,
- mint,
- wallet!.publicKey!
- ))
- )
- signers.push(tokenAccount)
- return { tokenAccountAddress: tokenAccount.publicKey }
-}
diff --git a/next.config.js b/next.config.js
index d867e45733..33330ffe6e 100644
--- a/next.config.js
+++ b/next.config.js
@@ -5,11 +5,11 @@ const withTM = require('next-transpile-modules')([
'@solana/wallet-adapter-base',
'@solana/wallet-adapter-phantom',
'@solana/wallet-adapter-sollet',
-])
+]);
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
-})
+});
module.exports = withBundleAnalyzer(
withTM({
@@ -17,9 +17,9 @@ module.exports = withBundleAnalyzer(
config.module.rules.push({
test: /\.svg$/,
use: ['@svgr/webpack'],
- })
- if (!isServer) config.resolve.fallback.fs = false
- return config
+ });
+ if (!isServer) config.resolve.fallback.fs = false;
+ return config;
},
env: {
REALM: process.env.REALM,
@@ -27,5 +27,14 @@ module.exports = withBundleAnalyzer(
DEVNET_RPC: process.env.DEVNET_RPC,
DEFAULT_GOVERNANCE_PROGRAM_ID: process.env.DEFAULT_GOVERNANCE_PROGRAM_ID,
},
- })
-)
+ async redirects() {
+ return [
+ {
+ source: '/dao/UXD/:path*',
+ destination: '/dao/UXP/:path*',
+ permanent: true,
+ },
+ ];
+ },
+ }),
+);
diff --git a/package.json b/package.json
index e5d78dd825..43a646f68b 100644
--- a/package.json
+++ b/package.json
@@ -1,10 +1,11 @@
{
- "name": "with-typescript-eslint-jest",
- "author": "@erikdstock",
+ "name": "@uxdprotocol/governance-ui",
+ "author": "UXD Protocol",
+ "private": true,
"license": "MIT",
"version": "1.0.0",
"scripts": {
- "dev": "next dev",
+ "dev": "next dev -p 3000",
"build": "next build",
"start": "next start",
"prepare": "husky install",
@@ -25,33 +26,48 @@
"dependencies": {
"@blockworks-foundation/mango-client": "^3.3.16",
"@blockworks-foundation/voter-stake-registry-client": "^0.2.0",
- "@cardinal/namespaces-components": "^2.5.0",
"@emotion/react": "^11.1.5",
"@emotion/styled": "^11.3.0",
- "@friktion-labs/friktion-sdk": "^1.1.13",
+ "@friktion-labs/friktion-sdk": "1.1.113",
"@headlessui/react": "^1.4.2",
"@heroicons/react": "^1.0.1",
"@marinade.finance/marinade-ts-sdk": "^2.0.9",
+ "@metaplex-foundation/mpl-core": "^0.6.0",
+ "@metaplex-foundation/mpl-token-metadata": "1.2.5",
"@next/bundle-analyzer": "^12.1.0",
"@nfteyez/sol-rayz": "^0.8.0",
- "@project-serum/anchor": "^0.20.1",
- "@project-serum/common": "^0.0.1-beta.3",
+ "@orca-so/sdk": "^1.2.25",
+ "@orca-so/whirlpools-sdk": "^0.5.0",
+ "@project-serum/anchor": "^0.22.1",
+ "@project-serum/borsh": "^0.2.5",
"@project-serum/sol-wallet-adapter": "^0.2.0",
- "@solana/spl-governance": "^0.0.28",
+ "@quarryprotocol/quarry-sdk": "^3.0.0",
+ "@raydium-io/raydium-sdk": "^1.0.1-beta.34",
+ "@saberhq/anchor-contrib": "^1.12.56",
+ "@saberhq/saber-periphery": "^1.1.1",
+ "@saberhq/stableswap-sdk": "^1.12.55",
+ "@saberhq/token-utils": "^1.12.55",
+ "@soceanfi/bonding": "^0.3.0",
+ "@soceanfi/descending-auction": "^0.2.1",
+ "@solana/buffer-layout": "^4.0.0",
+ "@solana/spl-governance": "0.0.34",
"@solana/spl-token": "^0.1.3",
- "@solana/spl-token-registry": "^0.2.1733",
"@solana/wallet-adapter-base": "^0.7.1",
"@solana/wallet-adapter-phantom": "^0.7.0",
"@solana/wallet-adapter-sollet": "^0.8.0",
- "@solana/web3.js": "^1.31.0",
+ "@solana/web3.js": "^1.34.0",
"@solendprotocol/solend-sdk": "^0.4.9",
"@tippyjs/react": "^4.2.5",
+ "@uxd-protocol/uxd-client": "2.0.1",
+ "@uxdprotocol/uxd-staking-client": "2.0.10",
"axios": "^0.21.1",
"bignumber.js": "^9.0.1",
"buffer-layout": "^1.2.2",
"classnames": "^2.3.1",
"dayjs": "^1.10.7",
+ "decimal.js": "^10.3.1",
"immer": "^9.0.1",
+ "jsbi": "^4.3.0",
"next": "^12.1.0",
"next-themes": "^0.0.14",
"next-transpile-modules": "^8.0.0",
@@ -74,6 +90,7 @@
"@types/jest": "^27.0.3",
"@types/node": "^14.14.25",
"@types/react": "^17.0.1",
+ "@types/react-virtualized": "^9.21.15",
"@typescript-eslint/eslint-plugin": "^5.7.0",
"@typescript-eslint/parser": "^5.7.0",
"eslint": "^8.4.1",
@@ -84,8 +101,10 @@
"jest": "^27.4.5",
"lint-staged": "^10.0.10",
"next-router-mock": "^0.6.3",
+ "patch-package": "^6.4.7",
"postcss": "^8.2.12",
"postcss-preset-env": "^6.7.0",
+ "postinstall-postinstall": "^2.1.0",
"prettier": "^2.0.2",
"tailwindcss": "^2.2.19",
"twin.macro": "^2.4.0",
diff --git a/pages/_app.tsx b/pages/_app.tsx
index aba76e0137..d9fda4dc35 100644
--- a/pages/_app.tsx
+++ b/pages/_app.tsx
@@ -1,54 +1,52 @@
-import { ThemeProvider } from 'next-themes'
-import '../styles/index.css'
-import useWallet from '../hooks/useWallet'
-import Notifications from '../components/Notification'
-import NavBar from '../components/NavBar'
-import PageBodyContainer from '../components/PageBodyContainer'
-import useHydrateStore from '../hooks/useHydrateStore'
-import useRealm from '../hooks/useRealm'
-import { getResourcePathPart } from '../tools/core/resources'
-import handleRouterHistory from '@hooks/handleRouterHistory'
-import Footer from '@components/Footer'
-import { useEffect } from 'react'
-import useDepositStore from 'VoteStakeRegistry/stores/useDepositStore'
-import useWalletStore from 'stores/useWalletStore'
-import { useVoteRegistry } from 'VoteStakeRegistry/hooks/useVoteRegistry'
-import ErrorBoundary from '@components/ErrorBoundary'
-import { WalletIdentityProvider } from '@cardinal/namespaces-components'
-import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore'
-import useMarketStore from 'Strategies/store/marketStore'
-import handleGovernanceAssetsStore from '@hooks/handleGovernanceAssetsStore'
-import tokenService from '@utils/services/token'
+import { ThemeProvider } from 'next-themes';
+import '../styles/index.css';
+import useWallet from '../hooks/useWallet';
+import Notifications from '../components/Notification';
+import NavBar from '../components/NavBar';
+import PageBodyContainer from '../components/PageBodyContainer';
+import useHydrateStore from '../hooks/useHydrateStore';
+import useRealm from '../hooks/useRealm';
+import { getResourcePathPart } from '../tools/core/resources';
+import handleRouterHistory from '@hooks/handleRouterHistory';
+import { useEffect } from 'react';
+import useDepositStore from 'VoteStakeRegistry/stores/useDepositStore';
+import useWalletStore from 'stores/useWalletStore';
+import { useVoteRegistry } from 'VoteStakeRegistry/hooks/useVoteRegistry';
+import ErrorBoundary from '@components/ErrorBoundary';
+import useVoteStakeRegistryClientStore from 'VoteStakeRegistry/stores/voteStakeRegistryClientStore';
+import useMarketStore from 'Strategies/store/marketStore';
+import handleGovernanceAssetsStore from '@hooks/handleGovernanceAssetsStore';
+import tokenService from '@utils/services/token';
function App({ Component, pageProps }) {
- useHydrateStore()
- useWallet()
- handleRouterHistory()
- useVoteRegistry()
- handleGovernanceAssetsStore()
+ useHydrateStore();
+ useWallet();
+ handleRouterHistory();
+ useVoteRegistry();
+ handleGovernanceAssetsStore();
useEffect(() => {
- tokenService.fetchSolanaTokenList()
- }, [])
- const { loadMarket } = useMarketStore()
- const { getOwnedDeposits, resetDepositState } = useDepositStore()
- const { realm, realmInfo, symbol, ownTokenRecord } = useRealm()
- const wallet = useWalletStore((s) => s.current)
- const connection = useWalletStore((s) => s.connection)
- const client = useVoteStakeRegistryClientStore((s) => s.state.client)
- const realmName = realmInfo?.displayName ?? realm?.account?.name
+ tokenService.fetchSolanaTokenList();
+ }, []);
+ const { loadMarket } = useMarketStore();
+ const { getOwnedDeposits, resetDepositState } = useDepositStore();
+ const { realm, realmInfo, symbol, ownTokenRecord } = useRealm();
+ const wallet = useWalletStore((s) => s.current);
+ const connection = useWalletStore((s) => s.connection);
+ const client = useVoteStakeRegistryClientStore((s) => s.state.client);
+ const realmName = realmInfo?.displayName ?? realm?.account?.name;
- const title = realmName ? `${realmName}` : 'Solana Governance'
+ const title = realmName ? `${realmName}` : 'Solana Governance';
// Note: ?v==${Date.now()} is added to the url to force favicon refresh.
// Without it browsers would cache the last used and won't change it for different realms
// https://stackoverflow.com/questions/2208933/how-do-i-force-a-favicon-refresh
- const faviconSelector = symbol ?? 'SOLANA'
+ const faviconSelector = symbol ?? 'SOLANA';
const faviconUrl = `/realms/${getResourcePathPart(
- faviconSelector as string
- )}/favicon.ico?v=${Date.now()}`
+ faviconSelector as string,
+ )}/favicon.ico?v=${Date.now()}`;
useEffect(() => {
- loadMarket(connection, connection.cluster)
- }, [connection.cluster])
+ loadMarket(connection, connection.cluster);
+ }, [connection.cluster]);
useEffect(() => {
if (
realm?.account.config.useCommunityVoterWeightAddin &&
@@ -62,57 +60,56 @@ function App({ Component, pageProps }) {
walletPk: wallet!.publicKey!,
client: client!,
connection: connection.current,
- })
+ });
} else if (!wallet?.connected) {
- resetDepositState()
+ resetDepositState();
}
}, [
realm?.pubkey.toBase58(),
ownTokenRecord?.pubkey.toBase58(),
wallet?.connected,
client,
- ])
+ ]);
//remove Do not add