Skip to content

Commit

Permalink
install new pyth sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
keyvankhademi committed Sep 25, 2024
1 parent 75be84c commit 43030bb
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 28 deletions.
2 changes: 1 addition & 1 deletion VoterWeightPlugins/clients/PythVoterWeightPluginClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ 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<any> {
readonly requiresInputVoterWeight = false;
// The pyth plugin does not have a registrar account
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
114 changes: 88 additions & 26 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@
dependencies:
ajv "^8.12.0"

"@coral-xyz/anchor-30@npm:@coral-xyz/[email protected]", "switchboard-anchor@npm:@coral-xyz/[email protected]":
"@coral-xyz/anchor-30@npm:@coral-xyz/[email protected]":
version "0.30.1"
resolved "https://registry.yarnpkg.com/@coral-xyz/anchor/-/anchor-0.30.1.tgz#17f3e9134c28cd0ea83574c6bab4e410bcecec5d"
integrity sha512-gDXFoF5oHgpriXAaLpxyWBHdCs8Awgf/gLHIo6crv7Aqm937CNdY+x+6hoj7QR5vaJV7MxWSQ0NGFzL3kPbWEQ==
Expand Down Expand Up @@ -755,6 +755,27 @@
superstruct "^0.15.4"
toml "^3.0.0"

"@coral-xyz/[email protected]", "@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/[email protected]", "@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"
Expand Down Expand Up @@ -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==
Expand All @@ -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/[email protected]":
version "2.3.1"
resolved "https://registry.yarnpkg.com/@pythnetwork/staking/-/staking-2.3.1.tgz#53f7ae9f9941fbea7e1464fe822fad60d2be8b63"
integrity sha512-TX5irBFy+1dhOxdRjC6NbcSCw33ZiAq9lbTb32mA/dnD6HgK9qPNg1TyflM3Bqa76VqlBP8uiGGKQYSuaCFAWw==
"@pythnetwork/[email protected]":
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/[email protected]":
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/[email protected]":
version "1.0.0"
Expand Down Expand Up @@ -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==
Expand Down Expand Up @@ -5368,7 +5384,7 @@
"@solana/wallet-standard-core" "^1.1.1"
"@solana/wallet-standard-wallet-adapter" "^1.1.2"

"@solana/[email protected]", "@solana/[email protected]", "@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/[email protected]", "@solana/[email protected]", "@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==
Expand Down Expand Up @@ -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==
Expand All @@ -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"
Expand Down Expand Up @@ -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==
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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/[email protected]":
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"

[email protected], swr@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/swr/-/swr-1.3.0.tgz#c6531866a35b4db37b38b72c45a63171faf9f4e8"
Expand Down Expand Up @@ -17826,7 +17879,7 @@ [email protected]:
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==
Expand All @@ -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"
Expand Down

0 comments on commit 43030bb

Please sign in to comment.