diff --git a/VoterWeightPlugins/clients/PythVoterWeightPluginClient.ts b/VoterWeightPlugins/clients/PythVoterWeightPluginClient.ts index 9c7c39836b..238783579d 100644 --- a/VoterWeightPlugins/clients/PythVoterWeightPluginClient.ts +++ b/VoterWeightPlugins/clients/PythVoterWeightPluginClient.ts @@ -1,13 +1,13 @@ import {Client} from "@solana/governance-program-library"; import {PublicKey, TransactionInstruction} from "@solana/web3.js"; import BN from "bn.js"; -import {PythClient, StakeAccount, StakeConnection} from "@pythnetwork/staking"; -import {Provider, Wallet} from "@coral-xyz/anchor"; +import {Program, Provider, Wallet} from "@coral-xyz/anchor"; import {VoterWeightAction} from "@solana/spl-governance"; import {convertVoterWeightActionToType} from "../lib/utils"; import queryClient from "@hooks/queries/queryClient"; +import { getMaxVoterWeightRecordAddress, getVoterWeightRecordAddress, PythStakingClient, StakeAccountPositions } from "@pythnetwork/staking-sdk"; -// A wrapper for the PythClient from @pythnetwork/staking, that implements the generic plugin client interface +// A wrapper for the PythClient from @pythnetwork/staking-sdk, that implements the generic plugin client interface export class PythVoterWeightPluginClient extends Client { readonly requiresInputVoterWeight = false; // The pyth plugin does not have a registrar account @@ -16,23 +16,36 @@ export class PythVoterWeightPluginClient extends Client { } async getMaxVoterWeightRecordPDA() { - const maxVoterWeightPk = (await this.client.program.methods.updateMaxVoterWeight().pubkeys()).maxVoterRecord - - if (!maxVoterWeightPk) return null; + const [address, bump] = getMaxVoterWeightRecordAddress(); return { - maxVoterWeightPk, - maxVoterWeightRecordBump: 0 // This is wrong for Pyth - but it doesn't matter as it is not used + maxVoterWeightPk: address, + maxVoterWeightRecordBump: bump, } } + async getMaxVoterWeightRecord(realm: PublicKey, mint: PublicKey) { + const {maxVoterWeightPk} = await this.getMaxVoterWeightRecordPDA(); + return this.client.stakingProgram.account.maxVoterWeightRecord.fetch( + maxVoterWeightPk, + ); + } + async getVoterWeightRecordPDA(realm: PublicKey, mint: PublicKey, voter: PublicKey) { - const { voterWeightAccount } = await this.getUpdateVoterWeightPks([], voter, VoterWeightAction.CastVote, PublicKey.default); + const stakeAccount = await this.getStakeAccount(voter) + const [address, bump] = getVoterWeightRecordAddress(stakeAccount); return { - voterWeightPk: voterWeightAccount, - voterWeightRecordBump: 0 // This is wrong for Pyth - but it doesn't matter as it is not used - }; + voterWeightPk: address, + voterWeightRecordBump: bump, + } + } + + async getVoterWeightRecord(realm: PublicKey, mint: PublicKey, walletPk: PublicKey) { + const {voterWeightPk} = await this.getVoterWeightRecordPDA(realm, mint, walletPk); + return this.client.stakingProgram.account.voterWeightRecord.fetch( + voterWeightPk, + ); } // NO-OP Pyth records are created through the Pyth dApp. @@ -45,54 +58,64 @@ export class PythVoterWeightPluginClient extends Client { return null; } - private async getStakeAccount(voter: PublicKey): Promise { + private async getStakeAccount(voter: PublicKey): Promise { return queryClient.fetchQuery({ - queryKey: ['pyth getStakeAccount', voter], - queryFn: () => this.client.getMainAccount(voter), + queryKey: ['pyth getStakeAccount', voter.toBase58()], + queryFn: () => this.client.getMainStakeAccount(voter).then(x => x?.stakeAccountPosition), }) } - private async getUpdateVoterWeightPks(instructions: TransactionInstruction[], voter: PublicKey, action: VoterWeightAction, target?: PublicKey) { + async updateVoterWeightRecord( + voter: PublicKey, + realm: PublicKey, + mint: PublicKey, + action: VoterWeightAction, + inputRecordCallback?: () => Promise, + target?: PublicKey + ) { const stakeAccount = await this.getStakeAccount(voter) - if (!stakeAccount) throw new Error("Stake account not found for voter " + voter.toString()); - return this.client.withUpdateVoterWeight( - instructions, + const ix = await this.client.getUpdateVoterWeightInstruction( stakeAccount, { [convertVoterWeightActionToType(action)]: {} } as any, - target - ); - } - - async updateVoterWeightRecord(voter: PublicKey, realm: PublicKey, mint: PublicKey, action: VoterWeightAction, inputRecordCallback?: () => Promise, target?: PublicKey) { - const instructions: TransactionInstruction[] = []; - await this.getUpdateVoterWeightPks(instructions, voter, action, target); - - return { pre: instructions }; + target, + ) + + return { pre: [ix] }; } // NO-OP async updateMaxVoterWeightRecord(): Promise { return null; } async calculateVoterWeight(voter: PublicKey): Promise { - const stakeAccount = await this.getStakeAccount(voter) - - if (stakeAccount) { - return stakeAccount.getVoterWeight(await this.client.getTime()).toBN() - } else { - return new BN(0) - } + const voterWeight = await this.client.getVoterWeight(voter); + return new BN(voterWeight.toString()); } - constructor(program: typeof PythClient.prototype.program, private client: StakeConnection, devnet:boolean) { - super(program, devnet); + + constructor( + program: Program, + private client: PythStakingClient + ) { + super(program); } - static async connect(provider: Provider, devnet = false, wallet: Wallet): Promise { - const pythClient = await PythClient.connect( - provider.connection, - wallet - ) + static async connect(provider: Provider, programId: PublicKey, wallet: Wallet): Promise { + const pythClient = new PythStakingClient({ + connection: provider.connection, + wallet, + }) + + const dummyProgram = new Program( + { + version: "", + name: 'unrecognised', + accounts: [], + instructions: [] + }, + programId, + provider + ); - return new PythVoterWeightPluginClient(pythClient.program, pythClient, devnet); + return new PythVoterWeightPluginClient(dummyProgram, pythClient); } } \ No newline at end of file diff --git a/VoterWeightPlugins/clients/index.ts b/VoterWeightPlugins/clients/index.ts index b24542a753..8c8a1a4325 100644 --- a/VoterWeightPlugins/clients/index.ts +++ b/VoterWeightPlugins/clients/index.ts @@ -36,7 +36,7 @@ export const loadClient = ( case 'gateway': return GatewayClient.connect(provider) case 'pyth': - return PythVoterWeightPluginClient.connect(provider, undefined, signer) + return PythVoterWeightPluginClient.connect(provider, programId, signer) case 'VSR': return VsrClient.connect(provider, programId) case 'HeliumVSR': diff --git a/hooks/PythNetwork/useScalingFactor.ts b/hooks/PythNetwork/useScalingFactor.ts index 7f76becfe7..b14f0ecb82 100644 --- a/hooks/PythNetwork/useScalingFactor.ts +++ b/hooks/PythNetwork/useScalingFactor.ts @@ -1,10 +1,10 @@ import NodeWallet from "@coral-xyz/anchor/dist/cjs/nodewallet"; import { determineVotingPowerType } from "@hooks/queries/governancePower"; import useSelectedRealmPubkey from "@hooks/selectedRealm/useSelectedRealmPubkey"; -import { PythClient } from "@pythnetwork/staking"; import { useConnection } from "@solana/wallet-adapter-react"; import { useAsync } from "react-async-hook"; import { useQuery } from "@tanstack/react-query"; +import { PythStakingClient } from "@pythnetwork/staking-sdk"; /** * Returns undefined for everything except the Pyth DAO @@ -20,7 +20,9 @@ export default function usePythScalingFactor(): number | undefined { const { data: scalingFactor } = useQuery(["pyth-scaling-factor"], async (): Promise => { - const pythClient = await PythClient.connect(connection, {} as NodeWallet) + const pythClient = new PythStakingClient({ + connection, + }) return pythClient.getScalingFactor() }, { enabled: plugin == "pyth" }) diff --git a/hooks/queries/governancePower.tsx b/hooks/queries/governancePower.tsx index 12918efad4..8e3fdebf18 100644 --- a/hooks/queries/governancePower.tsx +++ b/hooks/queries/governancePower.tsx @@ -16,7 +16,7 @@ import { StakeConnection } from "@parcl-oss/staking" import { LegacyVoterWeightAdapter, } from '@models/voteWeights' -import { PythClient } from '@pythnetwork/staking' +import { PythStakingClient } from "@pythnetwork/staking-sdk"; import NodeWallet from '@coral-xyz/anchor/dist/cjs/nodewallet' import { findPluginName } from '@constants/plugins' import { useRealmVoterWeightPlugins } from '@hooks/useRealmVoterWeightPlugins' @@ -102,17 +102,12 @@ export const getPythGovPower = async ( ): Promise => { if (!user) return new BN(0) - const pythClient = await PythClient.connect( + const pythClient = new PythStakingClient({ connection, - new NodeWallet(new Keypair()) - ) - const stakeAccount = await pythClient.getMainAccount(user) + }) + const voterWeight = await pythClient.getVoterWeight(user) - if (stakeAccount) { - return stakeAccount.getVoterWeight(await pythClient.getTime()).toBN() - } else { - return new BN(0) - } + return new BN(voterWeight.toString()) } export const getParclGovPower = async ( diff --git a/package.json b/package.json index 651344a47c..419623344c 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,8 @@ "@project-serum/serum": "0.13.65", "@project-serum/sol-wallet-adapter": "0.2.6", "@pythnetwork/client": "2.17.0", - "@pythnetwork/staking": "2.3.1", + "@pythnetwork/staking-sdk": "0.0.2", + "@pythnetwork/staking-wasm": "0.3.5", "@radix-ui/react-accordion": "1.0.0", "@radix-ui/react-aspect-ratio": "1.0.0", "@radix-ui/react-dialog": "1.0.0", @@ -228,6 +229,7 @@ "@types/bn.js": "5.1.0", "@project-serum/sol-wallet-adapter": "0.2.6", "@project-serum/serum": "0.13.65", + "@pythnetwork/staking-sdk/@coral-xyz/anchor": "0.30.1", "@coral-xyz/anchor": "0.29.0", "@coral-xyz/borsh": "0.27.0", "bignumber.js": "9.0.2", diff --git a/pages/dao/[symbol]/proposal/components/instructions/Pyth/PythRecoverAccount.tsx b/pages/dao/[symbol]/proposal/components/instructions/Pyth/PythRecoverAccount.tsx index 22c6f2c5b6..2ddcac791a 100644 --- a/pages/dao/[symbol]/proposal/components/instructions/Pyth/PythRecoverAccount.tsx +++ b/pages/dao/[symbol]/proposal/components/instructions/Pyth/PythRecoverAccount.tsx @@ -13,8 +13,7 @@ import { NewProposalContext } from '../../../new' import useLegacyConnectionContext from '@hooks/useLegacyConnectionContext' import { PublicKey } from '@solana/web3.js' import { AssetAccount } from '@utils/uiTypes/assets' -import { StakeConnection, STAKING_ADDRESS } from '@pythnetwork/staking' -import { Wallet } from '@coral-xyz/anchor' +import { PythStakingClient } from '@pythnetwork/staking-sdk' export interface PythRecoverAccountForm { governedAccount: AssetAccount | null @@ -52,14 +51,12 @@ const PythRecoverAccount = ({ form.governedAccount?.governance?.account && wallet?.publicKey ) { - const stakeConnection = await StakeConnection.createStakeConnection( - connection.current, - {} as Wallet, - STAKING_ADDRESS - ) + const pythClient = new PythStakingClient({ + connection: connection.current, + }) const stakeAccountPublicKey = new PublicKey(form.stakeAccount) - const instruction = await stakeConnection.buildRecoverAccountInstruction( + const instruction = await pythClient.getRecoverAccountInstruction( stakeAccountPublicKey, form.governedAccount.governance.pubkey ) diff --git a/pages/dao/[symbol]/proposal/components/instructions/Pyth/PythUpdatePoolAuthority.tsx b/pages/dao/[symbol]/proposal/components/instructions/Pyth/PythUpdatePoolAuthority.tsx index 5d5a32fff7..6a050cfc68 100644 --- a/pages/dao/[symbol]/proposal/components/instructions/Pyth/PythUpdatePoolAuthority.tsx +++ b/pages/dao/[symbol]/proposal/components/instructions/Pyth/PythUpdatePoolAuthority.tsx @@ -13,8 +13,7 @@ import { NewProposalContext } from '../../../new' import useLegacyConnectionContext from '@hooks/useLegacyConnectionContext' import { PublicKey, TransactionInstruction } from '@solana/web3.js' import { AssetAccount } from '@utils/uiTypes/assets' -import { StakeConnection, STAKING_ADDRESS } from '@pythnetwork/staking' -import { Wallet } from '@coral-xyz/anchor' +import { PythStakingClient, getConfigAddress } from '@pythnetwork/staking-sdk' export interface PythUpdatePoolAuthorityForm { governedAccount: AssetAccount | null @@ -54,19 +53,19 @@ const PythUpdatePoolAuthority = ({ form.governedAccount?.governance?.account && wallet?.publicKey ) { - const stakeConnection = await StakeConnection.createStakeConnection( - connection.current, - {} as Wallet, - STAKING_ADDRESS - ) + const pythClient = new PythStakingClient({ + connection: connection.current, + }) + + const [configAddress, _] = getConfigAddress(); const poolAuthorityPublicKey = new PublicKey(form.poolAuthority) const instruction : TransactionInstruction = { keys: [ {pubkey : form.governedAccount.governance.pubkey, isSigner: true, isWritable: false}, - {pubkey : stakeConnection.configAddress, isSigner: false, isWritable: true}, + {pubkey : configAddress, isSigner: false, isWritable: true}, ], - programId : stakeConnection.program.programId, + programId : pythClient.stakingProgram.programId, data : Buffer.concat([INSTRUCTION_DISCRIMINATOR, poolAuthorityPublicKey.toBuffer()]) } diff --git a/yarn.lock b/yarn.lock index 7dd9d510ff..68e3a9c97b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -709,7 +709,7 @@ dependencies: ajv "^8.12.0" -"@coral-xyz/anchor-30@npm:@coral-xyz/anchor@0.30.1", "switchboard-anchor@npm:@coral-xyz/anchor@0.30.1": +"@coral-xyz/anchor-30@npm:@coral-xyz/anchor@0.30.1": version "0.30.1" resolved "https://registry.yarnpkg.com/@coral-xyz/anchor/-/anchor-0.30.1.tgz#17f3e9134c28cd0ea83574c6bab4e410bcecec5d" integrity sha512-gDXFoF5oHgpriXAaLpxyWBHdCs8Awgf/gLHIo6crv7Aqm937CNdY+x+6hoj7QR5vaJV7MxWSQ0NGFzL3kPbWEQ== @@ -755,6 +755,27 @@ superstruct "^0.15.4" toml "^3.0.0" +"@coral-xyz/anchor@0.30.1", "@coral-xyz/anchor@^0.30.1": + version "0.30.1" + resolved "https://registry.yarnpkg.com/@coral-xyz/anchor/-/anchor-0.30.1.tgz#17f3e9134c28cd0ea83574c6bab4e410bcecec5d" + integrity sha512-gDXFoF5oHgpriXAaLpxyWBHdCs8Awgf/gLHIo6crv7Aqm937CNdY+x+6hoj7QR5vaJV7MxWSQ0NGFzL3kPbWEQ== + dependencies: + "@coral-xyz/anchor-errors" "^0.30.1" + "@coral-xyz/borsh" "^0.30.1" + "@noble/hashes" "^1.3.1" + "@solana/web3.js" "^1.68.0" + bn.js "^5.1.2" + bs58 "^4.0.1" + buffer-layout "^1.2.2" + camelcase "^6.3.0" + cross-fetch "^3.1.5" + crypto-hash "^1.3.0" + eventemitter3 "^4.0.7" + pako "^2.0.3" + snake-case "^3.0.4" + superstruct "^0.15.4" + toml "^3.0.0" + "@coral-xyz/borsh@0.27.0", "@coral-xyz/borsh@^0.26.0", "@coral-xyz/borsh@^0.28.0", "@coral-xyz/borsh@^0.29.0", "@coral-xyz/borsh@^0.30.1": version "0.27.0" resolved "https://registry.yarnpkg.com/@coral-xyz/borsh/-/borsh-0.27.0.tgz#700c647ea5262b1488957ac7fb4e8acf72c72b63" @@ -3213,7 +3234,7 @@ "@coral-xyz/borsh" "^0.28.0" buffer "^6.0.1" -"@pythnetwork/solana-utils@^0.4.1": +"@pythnetwork/solana-utils@0.4.2", "@pythnetwork/solana-utils@^0.4.1": version "0.4.2" resolved "https://registry.yarnpkg.com/@pythnetwork/solana-utils/-/solana-utils-0.4.2.tgz#3e220eed518c02ad702ebb023488afd7c5649a87" integrity sha512-hKo7Bcs/kDWA5Fnqhg9zJSB94NMoUDIDjHjSi/uvZOzwizISUQI6oY3LWd2CXzNh4f8djjY2BS5iNHaM4cm8Bw== @@ -3223,26 +3244,21 @@ bs58 "^5.0.0" jito-ts "^3.0.1" -"@pythnetwork/staking-wasm@*": - version "0.3.4" - resolved "https://registry.yarnpkg.com/@pythnetwork/staking-wasm/-/staking-wasm-0.3.4.tgz#29c0f47467249a4c66814a8aab9eadf2cc008add" - integrity sha512-0ZdaWmueVO5hucdVH4UDfHyBuxtW6UDcrpEFtD/3pq4naQjcgu1u6rK8iL2pgKi8W2UlsB4vwJqay2Sf1sA4mw== - -"@pythnetwork/staking@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@pythnetwork/staking/-/staking-2.3.1.tgz#53f7ae9f9941fbea7e1464fe822fad60d2be8b63" - integrity sha512-TX5irBFy+1dhOxdRjC6NbcSCw33ZiAq9lbTb32mA/dnD6HgK9qPNg1TyflM3Bqa76VqlBP8uiGGKQYSuaCFAWw== +"@pythnetwork/staking-sdk@0.0.2": + version "0.0.2" + resolved "https://registry.yarnpkg.com/@pythnetwork/staking-sdk/-/staking-sdk-0.0.2.tgz#38dfd6f8356c6544875c6d06aafa55886b7bc1a5" + integrity sha512-IfHJIJ5ZwF8x86/10/5Gs9SUAj4fgW013OiWekfzXhogI2MT27TFQqpaCGj8ndJ4XVlzMk3MDGRuOmujtGCVGA== dependencies: - "@coral-xyz/anchor" "^0.29.0" - "@pythnetwork/solana-utils" "^0.4.1" - "@pythnetwork/staking-wasm" "*" - "@solana/spl-governance" "0.3.26" - "@solana/spl-token" "^0.1.8" - "@solana/web3.js" "^1.87.5" - encoding "^0.1.13" - ethers "^6.10.0" - ts-node "^10.7.0" - typescript "^4.3.5" + "@coral-xyz/anchor" "^0.30.1" + "@pythnetwork/solana-utils" "0.4.2" + "@solana/spl-governance" "^0.3.28" + "@solana/spl-token" "^0.3.7" + "@solana/web3.js" "^1.95.3" + +"@pythnetwork/staking-wasm@0.3.5": + version "0.3.5" + resolved "https://registry.yarnpkg.com/@pythnetwork/staking-wasm/-/staking-wasm-0.3.5.tgz#a5e524a721df9613a1f33a1a1c708de0bfcfe89f" + integrity sha512-iQpPPn6kPuc9Q1MO+PMAKAhkuv6AOUHiAZJizCbPm3aO7kS2YxRKsRSMsky9FY1GHHatSx13LX9epsJXi/MmKg== "@radix-ui/number@1.0.0": version "1.0.0" @@ -4853,7 +4869,7 @@ "@solana/spl-token-metadata" "^0.1.3" buffer "^6.0.3" -"@solana/spl-token@^0.3.11", "@solana/spl-token@^0.3.4", "@solana/spl-token@^0.3.5", "@solana/spl-token@^0.3.6", "@solana/spl-token@^0.3.8", "@solana/spl-token@^0.3.9": +"@solana/spl-token@^0.3.11", "@solana/spl-token@^0.3.4", "@solana/spl-token@^0.3.5", "@solana/spl-token@^0.3.6", "@solana/spl-token@^0.3.7", "@solana/spl-token@^0.3.8", "@solana/spl-token@^0.3.9": version "0.3.11" resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.3.11.tgz#cdc10f9472b29b39c8983c92592cadd06627fb9a" integrity sha512-bvohO3rIMSVL24Pb+I4EYTJ6cL82eFpInEXD/I8K8upOGjpqHsKUoAempR/RnUlI1qSFNyFlWJfu6MNUgfbCQQ== @@ -5368,7 +5384,7 @@ "@solana/wallet-standard-core" "^1.1.1" "@solana/wallet-standard-wallet-adapter" "^1.1.2" -"@solana/web3.js@1.56.0", "@solana/web3.js@1.78.8", "@solana/web3.js@^1.17.0", "@solana/web3.js@^1.21.0", "@solana/web3.js@^1.22.0", "@solana/web3.js@^1.30.2", "@solana/web3.js@^1.31.0", "@solana/web3.js@^1.32.0", "@solana/web3.js@^1.35.1", "@solana/web3.js@^1.36.0", "@solana/web3.js@^1.43.4", "@solana/web3.js@^1.44.3", "@solana/web3.js@^1.50.1", "@solana/web3.js@^1.53.0", "@solana/web3.js@^1.54.0", "@solana/web3.js@^1.56.2", "@solana/web3.js@^1.59.1", "@solana/web3.js@^1.63.0", "@solana/web3.js@^1.63.1", "@solana/web3.js@^1.66.2", "@solana/web3.js@^1.68.0", "@solana/web3.js@^1.73.0", "@solana/web3.js@^1.73.2", "@solana/web3.js@^1.77.3", "@solana/web3.js@^1.87.5", "@solana/web3.js@^1.87.6", "@solana/web3.js@^1.89.1", "@solana/web3.js@^1.90.0", "@solana/web3.js@^1.91.6", "@solana/web3.js@^1.91.8", "@solana/web3.js@^1.93.0", "@solana/web3.js@^1.95.0", "@solana/web3.js@^1.95.2", "@solana/web3.js@~1.77.3": +"@solana/web3.js@1.56.0", "@solana/web3.js@1.78.8", "@solana/web3.js@^1.17.0", "@solana/web3.js@^1.21.0", "@solana/web3.js@^1.22.0", "@solana/web3.js@^1.30.2", "@solana/web3.js@^1.31.0", "@solana/web3.js@^1.32.0", "@solana/web3.js@^1.35.1", "@solana/web3.js@^1.36.0", "@solana/web3.js@^1.43.4", "@solana/web3.js@^1.44.3", "@solana/web3.js@^1.50.1", "@solana/web3.js@^1.53.0", "@solana/web3.js@^1.54.0", "@solana/web3.js@^1.56.2", "@solana/web3.js@^1.59.1", "@solana/web3.js@^1.63.0", "@solana/web3.js@^1.63.1", "@solana/web3.js@^1.66.2", "@solana/web3.js@^1.68.0", "@solana/web3.js@^1.73.0", "@solana/web3.js@^1.73.2", "@solana/web3.js@^1.77.3", "@solana/web3.js@^1.87.5", "@solana/web3.js@^1.87.6", "@solana/web3.js@^1.89.1", "@solana/web3.js@^1.90.0", "@solana/web3.js@^1.91.6", "@solana/web3.js@^1.91.8", "@solana/web3.js@^1.93.0", "@solana/web3.js@^1.95.0", "@solana/web3.js@^1.95.2", "@solana/web3.js@^1.95.3", "@solana/web3.js@~1.77.3": version "1.78.8" resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.78.8.tgz#d635bcccaac9e36270c6b16340bfeb5502737831" integrity sha512-y6kMa0ohRjamBGtxIGX4TkdAzL8Cs2bzM4JDPCyYLFPdo7kWk0Cx+BkbhX8hEV4IfvCONF92KIniV7hDvHuq8A== @@ -16290,7 +16306,7 @@ string-similarity@^4.0.3: resolved "https://registry.yarnpkg.com/string-similarity/-/string-similarity-4.0.4.tgz#42d01ab0b34660ea8a018da8f56a3309bb8b2a5b" integrity sha512-/q/8Q4Bl4ZKAPjj8WerIBJWALKkaPRfrvhfF8k/B23i4nzrlRj2/go1m90In7nG/3XDSbOo0+pu6RvCTM9RGMQ== -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": 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== @@ -16308,6 +16324,15 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + 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-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" @@ -16429,7 +16454,7 @@ stringify-object@^3.3.0: is-obj "^1.0.1" is-regexp "^1.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm: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== @@ -16457,6 +16482,13 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.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.1: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -16603,6 +16635,27 @@ supports-preserve-symlinks-flag@^1.0.0: resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== +"switchboard-anchor@npm:@coral-xyz/anchor@0.30.1": + version "0.30.1" + resolved "https://registry.yarnpkg.com/@coral-xyz/anchor/-/anchor-0.30.1.tgz#17f3e9134c28cd0ea83574c6bab4e410bcecec5d" + integrity sha512-gDXFoF5oHgpriXAaLpxyWBHdCs8Awgf/gLHIo6crv7Aqm937CNdY+x+6hoj7QR5vaJV7MxWSQ0NGFzL3kPbWEQ== + dependencies: + "@coral-xyz/anchor-errors" "^0.30.1" + "@coral-xyz/borsh" "^0.30.1" + "@noble/hashes" "^1.3.1" + "@solana/web3.js" "^1.68.0" + bn.js "^5.1.2" + bs58 "^4.0.1" + buffer-layout "^1.2.2" + camelcase "^6.3.0" + cross-fetch "^3.1.5" + crypto-hash "^1.3.0" + eventemitter3 "^4.0.7" + pako "^2.0.3" + snake-case "^3.0.4" + superstruct "^0.15.4" + toml "^3.0.0" + swr@1.3.0, swr@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/swr/-/swr-1.3.0.tgz#c6531866a35b4db37b38b72c45a63171faf9f4e8" @@ -17826,7 +17879,7 @@ workerpool@6.2.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm: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== @@ -17852,6 +17905,15 @@ wrap-ansi@^5.1.0: string-width "^3.0.0" strip-ansi "^5.0.0" +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" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"