diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c3834b2e..ed02f35c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,8 +13,8 @@ defaults: env: CARGO_TERM_COLOR: always - RUST_TOOLCHAIN: 1.67.0 - SOLANA_VERSION: "1.14.16" + RUST_TOOLCHAIN: 1.70.0 + SOLANA_VERSION: "1.16.27" jobs: fmt-clippy: @@ -99,7 +99,7 @@ jobs: - uses: ./.github/actions/setup-solana/ - name: install anchor cli - run: cargo install --git https://github.com/coral-xyz/anchor --tag v0.26.0 anchor-cli --locked + run: cargo install --git https://github.com/coral-xyz/anchor --tag v0.29.0 anchor-cli --locked - name: Setup node uses: actions/setup-node@v2 diff --git a/Cargo.lock b/Cargo.lock index 073f1b11..048e075e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -66,9 +66,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72832d73be48bac96a5d7944568f305d829ed55b0ce3b483647089dfaf6cf704" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "getrandom 0.2.9", @@ -577,7 +577,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" dependencies = [ "borsh-derive 0.10.3", - "hashbrown 0.12.3", + "hashbrown 0.13.2", ] [[package]] @@ -1079,6 +1079,7 @@ dependencies = [ name = "drift-vaults" version = "0.1.0" dependencies = [ + "ahash 0.8.6", "anchor-lang", "anchor-spl", "bytemuck", @@ -1443,7 +1444,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.4", + "ahash 0.8.6", ] [[package]] @@ -2911,9 +2912,9 @@ dependencies = [ [[package]] name = "solana-address-lookup-table-program" -version = "1.16.27" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cf919521094c0489485589d01674e993ebb1d518abc8da439e31d7f5a72406f" +checksum = "18a216474b9d25153d629aa7f4fb2246bc875ebe90e1155380e0436c209e62d5" dependencies = [ "bincode", "bytemuck", @@ -2932,11 +2933,11 @@ dependencies = [ [[package]] name = "solana-frozen-abi" -version = "1.16.27" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a96a0a64cbc75e06c8eb49d6cd0a87054c48dbf59100d9959389aba51fb501" +checksum = "a7077f6495ccc313dff49c3e3f3ed03e49058258bae7fee77ac29ba0a474ba82" dependencies = [ - "ahash 0.8.4", + "ahash 0.8.6", "blake3", "block-buffer 0.10.4", "bs58 0.4.0", @@ -2965,9 +2966,9 @@ dependencies = [ [[package]] name = "solana-frozen-abi-macro" -version = "1.16.27" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ae9765c963bebbf609dcdc82cfb969746cbdf6d65cfc9d94112e984475ae4ac" +checksum = "f516f992211a2ab70de5c367190575c97e02d156f9f1d8b76886d673f30e88a2" dependencies = [ "proc-macro2", "quote", @@ -2977,9 +2978,9 @@ dependencies = [ [[package]] name = "solana-logger" -version = "1.16.27" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c039e4336890c7a0667207caeb452187efa0602d80eca61a854f2e39915e972" +checksum = "7b64def674bfaa4a3f8be7ba19c03c9caec4ec028ba62b9a427ec1bf608a2486" dependencies = [ "env_logger", "lazy_static", @@ -2988,9 +2989,9 @@ dependencies = [ [[package]] name = "solana-measure" -version = "1.16.27" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f188a8cf40c33a33cdf5396af88df194648ef52914fcfb5ce81e4cf03ab99ff" +checksum = "932db6604bcf8ba3bba68e80564d7eaa0dd7b9667407e15c3557caa83203aee7" dependencies = [ "log", "solana-sdk", @@ -2998,9 +2999,9 @@ dependencies = [ [[package]] name = "solana-metrics" -version = "1.16.27" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b0e6253c106dbe0a6736c9b6929b8284aa959f79486006330884252e486b515" +checksum = "5d81931f224798c0e52062b0683a07eebe1c1904954c8765773c9802a28fbd0c" dependencies = [ "crossbeam-channel", "gethostname", @@ -3012,9 +3013,9 @@ dependencies = [ [[package]] name = "solana-program" -version = "1.16.27" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20c16757f43d4384907f6e81924e155b8bd8228efcdcf9ea38bd4e18ea100804" +checksum = "3e92350aa5b42564681655331e7e0b9d5c99a442de317ceeb4741efbbe9a6c05" dependencies = [ "ark-bn254", "ark-ec", @@ -3067,9 +3068,9 @@ dependencies = [ [[package]] name = "solana-program-runtime" -version = "1.16.27" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd12d233724478c7ccf84d953a4abe891552d78bd41e2c594c098f76dde5a06" +checksum = "3da0e9dd63326ded2055b42e54aa37baa6aeb8adaea658a0059c234af6d05c02" dependencies = [ "base64 0.21.5", "bincode", @@ -3095,9 +3096,9 @@ dependencies = [ [[package]] name = "solana-sdk" -version = "1.16.27" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf179cda65775982e5f31da8d58dfa4349c3b5ae1573ceb507c7fc91df66690" +checksum = "2087e15c92d4d6b3f085dc12fbe9614141c811f90a54cc418240ac30b608133f" dependencies = [ "assert_matches", "base64 0.21.5", @@ -3148,9 +3149,9 @@ dependencies = [ [[package]] name = "solana-sdk-macro" -version = "1.16.27" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f188d6fe76183137a4922274acbe76fc4fcc474b3fad860bb2612cb225e6e2a" +checksum = "2e0e0e7ee984b0f9179a1d4f4e9e67ce675de2324b5a98b61d2bdb61be3c19bb" dependencies = [ "bs58 0.4.0", "proc-macro2", @@ -3167,9 +3168,9 @@ checksum = "7e0461f3afb29d8591300b3dd09b5472b3772d65688a2826ad960b8c0d5fa605" [[package]] name = "solana-zk-token-sdk" -version = "1.16.27" +version = "1.16.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9513c4f1595b61f8a39a14c27535da2b2145c20c6b35ab491a1830981972b2bd" +checksum = "1457c85ab70a518438b9ac2b0c56037b9f6693060dfb617bbb93c7116e4f0c22" dependencies = [ "aes-gcm-siv", "base64 0.21.5", diff --git a/README.md b/README.md index 6aeedebb..4c9c0c5a 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,14 @@ soon^TM # Development -Developed using Anchor 0.26.0: +* anchor 0.29.0 +* rust 1.70.0 +* solana 1.16.27 + ``` -avm use 0.26.0 +avm use 0.29.0 +rustup default 1.70.0 +sh -c "$(curl -sSfL https://release.solana.com/v1.16.27/install)" ``` ## Run tests @@ -22,4 +27,4 @@ yarn build cd .. export ANCHOR_WALLET=~/.config/solana/id.json anchor test -``` \ No newline at end of file +``` diff --git a/package.json b/package.json index 725e2981..39be8024 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "anchor-tests": "yarn update-types && yarn update-idl && yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts" }, "devDependencies": { - "@coral-xyz/anchor": "^0.26.0", + "@coral-xyz/anchor": "^0.29.0", "@drift-labs/competitions-sdk": "0.2.330", "@drift-labs/sdk": "2.84.0-beta.2", "@solana/web3.js": "1.73.2", diff --git a/programs/drift_vaults/Cargo.toml b/programs/drift_vaults/Cargo.toml index 3ad49643..2c1f2146 100644 --- a/programs/drift_vaults/Cargo.toml +++ b/programs/drift_vaults/Cargo.toml @@ -20,4 +20,5 @@ drift = { git = "https://github.com/drift-labs/protocol-v2.git", rev = "a95009", drift-competitions = { git = "https://github.com/drift-labs/drift-competitions.git", rev = "c8baa6", features = ["cpi"]} bytemuck = { version = "1.4.0" } static_assertions = "1.1.0" -drift-macros = { git = "https://github.com/drift-labs/drift-macros.git", rev = "c57d87" } \ No newline at end of file +drift-macros = { git = "https://github.com/drift-labs/drift-macros.git", rev = "c57d87" } +ahash = "=0.8.6" diff --git a/ts/sdk/.gitignore b/ts/sdk/.gitignore index ff692989..47b31d34 100644 --- a/ts/sdk/.gitignore +++ b/ts/sdk/.gitignore @@ -1,4 +1,4 @@ .env lib node_modules -*.txt +_scripts diff --git a/ts/sdk/package.json b/ts/sdk/package.json index 3692fc86..91fd07e0 100644 --- a/ts/sdk/package.json +++ b/ts/sdk/package.json @@ -7,8 +7,8 @@ "lib": "lib" }, "dependencies": { - "@coral-xyz/anchor": "^0.26.0", - "@drift-labs/competitions-sdk": "0.2.325", + "@coral-xyz/anchor": "0.28.0", + "@drift-labs/competitions-sdk": "0.2.330", "@drift-labs/sdk": "2.84.0-beta.2", "@solana/web3.js": "1.73.2", "commander": "^11.0.0", diff --git a/ts/sdk/src/utils.ts b/ts/sdk/src/utils.ts index c760a794..dd5722c3 100644 --- a/ts/sdk/src/utils.ts +++ b/ts/sdk/src/utils.ts @@ -10,7 +10,7 @@ export const getDriftVaultProgram = ( connection: Connection, wallet: IWallet ): anchor.Program => { - const provider = new AnchorProvider(connection, wallet, {}); + const provider = new AnchorProvider(connection, wallet as anchor.Wallet, {}); anchor.setProvider(provider); const vaultProgram = new anchor.Program(IDL, VAULT_PROGRAM_ID, provider); diff --git a/ts/sdk/src/vaultClient.ts b/ts/sdk/src/vaultClient.ts index db109a2b..8c65f08d 100644 --- a/ts/sdk/src/vaultClient.ts +++ b/ts/sdk/src/vaultClient.ts @@ -398,6 +398,7 @@ export class VaultClient { amount: BN, withdrawUnit: WithdrawUnit ): Promise { + this.program.idl.types; // @ts-ignore const vaultAccount = (await this.program.account.vault.fetch( vault diff --git a/ts/sdk/yarn.lock b/ts/sdk/yarn.lock index 80249210..6ae5ac2c 100644 --- a/ts/sdk/yarn.lock +++ b/ts/sdk/yarn.lock @@ -23,13 +23,12 @@ dependencies: regenerator-runtime "^0.14.0" -"@coral-xyz/anchor@0.28.1-beta.2": - version "0.28.1-beta.2" - resolved "https://registry.yarnpkg.com/@coral-xyz/anchor/-/anchor-0.28.1-beta.2.tgz#4ddd4b2b66af04407be47cf9524147793ec514a0" - integrity sha512-xreUcOFF8+IQKWOBUrDKJbIw2ftpRVybFlEPVrbSlOBCbreCWrQ5754Gt9cHIcuBDAzearCDiBqzsGQdNgPJiw== +"@coral-xyz/anchor@0.28.0", "@coral-xyz/anchor@^0.28.0": + version "0.28.0" + resolved "https://registry.yarnpkg.com/@coral-xyz/anchor/-/anchor-0.28.0.tgz#8345c3c9186a91f095f704d7b90cd256f7e8b2dc" + integrity sha512-kQ02Hv2ZqxtWP30WN1d4xxT4QqlOXYDxmEd3k/bbneqhV3X5QMO4LAtoUFs7otxyivOgoqam5Il5qx81FuI4vw== dependencies: "@coral-xyz/borsh" "^0.28.0" - "@noble/hashes" "^1.3.1" "@solana/web3.js" "^1.68.0" base64-js "^1.5.1" bn.js "^5.1.2" @@ -39,6 +38,7 @@ cross-fetch "^3.1.5" crypto-hash "^1.3.0" eventemitter3 "^4.0.7" + js-sha256 "^0.9.0" pako "^2.0.3" snake-case "^3.0.4" superstruct "^0.15.4" @@ -85,27 +85,6 @@ superstruct "^0.15.4" toml "^3.0.0" -"@coral-xyz/anchor@^0.28.0": - version "0.28.0" - resolved "https://registry.yarnpkg.com/@coral-xyz/anchor/-/anchor-0.28.0.tgz#8345c3c9186a91f095f704d7b90cd256f7e8b2dc" - integrity sha512-kQ02Hv2ZqxtWP30WN1d4xxT4QqlOXYDxmEd3k/bbneqhV3X5QMO4LAtoUFs7otxyivOgoqam5Il5qx81FuI4vw== - dependencies: - "@coral-xyz/borsh" "^0.28.0" - "@solana/web3.js" "^1.68.0" - base64-js "^1.5.1" - 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" - js-sha256 "^0.9.0" - pako "^2.0.3" - snake-case "^3.0.4" - superstruct "^0.15.4" - toml "^3.0.0" - "@coral-xyz/borsh@^0.26.0": version "0.26.0" resolved "https://registry.yarnpkg.com/@coral-xyz/borsh/-/borsh-0.26.0.tgz#d054f64536d824634969e74138f9f7c52bbbc0d5" @@ -137,13 +116,13 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@drift-labs/competitions-sdk@0.2.325": - version "0.2.325" - resolved "https://registry.yarnpkg.com/@drift-labs/competitions-sdk/-/competitions-sdk-0.2.325.tgz#e625d3fb81db0f4c0f94f29a9a0b2e267b8959a0" - integrity sha512-VW+t0x2+RDI+jEdlOltuuPQweN34nkt1GpcpRJJGcgqnSrlUSqxA7PnFEhRTaHA8CEoh8WeG3SbgTAVsL48uVQ== +"@drift-labs/competitions-sdk@0.2.330": + version "0.2.330" + resolved "https://registry.yarnpkg.com/@drift-labs/competitions-sdk/-/competitions-sdk-0.2.330.tgz#2a6809ad99237e24bb84a64b929482722fde9022" + integrity sha512-6cwez9QWPQT9+DBYZ89FFRnRTj5yoefsa1e02c6HRz94zXOlhOmUAq6b+Hx4WHfhCr1i0lGamoMNFptfGCdz7Q== dependencies: "@coral-xyz/anchor" "^0.26.0" - "@drift-labs/sdk" "2.83.0-beta.13" + "@drift-labs/sdk" "2.84.0-beta.2" "@solana/web3.js" "1.73.2" "@switchboard-xyz/solana.js" "^2.7.1" cerializr "^3.1.4" @@ -152,21 +131,6 @@ ts-node "^10.9.1" typescript "^5.1.6" -"@drift-labs/sdk@2.83.0-beta.13": - version "2.83.0-beta.13" - resolved "https://registry.yarnpkg.com/@drift-labs/sdk/-/sdk-2.83.0-beta.13.tgz#25a78962ed59eb22c2f24927cf3a126e06dc91c0" - integrity sha512-iLVsxEAGDmxDv75mYoyAAtjJrkyaSA872/XUaqZucO51aSjS5Mhw/HTdSDaa3AnSkhsb0jqKpHI5+l8Fd5znEQ== - dependencies: - "@coral-xyz/anchor" "0.28.1-beta.2" - "@ellipsis-labs/phoenix-sdk" "^1.4.2" - "@project-serum/serum" "^0.13.38" - "@pythnetwork/client" "2.5.3" - "@solana/spl-token" "^0.3.7" - "@solana/web3.js" "1.91.7" - strict-event-emitter-types "^2.0.0" - uuid "^8.3.2" - zstddec "^0.1.0" - "@drift-labs/sdk@2.84.0-beta.2": version "2.84.0-beta.2" resolved "https://registry.yarnpkg.com/@drift-labs/sdk/-/sdk-2.84.0-beta.2.tgz#48f32ac6c7a4160719cfe0ca0a2517144763c9db" diff --git a/yarn.lock b/yarn.lock index e70359a3..e816ee18 100644 --- a/yarn.lock +++ b/yarn.lock @@ -44,7 +44,7 @@ dependencies: regenerator-runtime "^0.14.0" -"@coral-xyz/anchor@0.29.0": +"@coral-xyz/anchor@0.29.0", "@coral-xyz/anchor@^0.29.0": version "0.29.0" resolved "https://registry.yarnpkg.com/@coral-xyz/anchor/-/anchor-0.29.0.tgz#bd0be95bedfb30a381c3e676e5926124c310ff12" integrity sha512-eny6QNG0WOwqV0zQ7cs/b1tIuzZGmP7U7EcH+ogt4Gdbl8HDmIYVMh/9aTmYZPaFWjtUaI8qSn73uYEXWfATdA==