From 8c084d14f80605c784e4b961fc91ff954a0d6379 Mon Sep 17 00:00:00 2001 From: Steven Luscher Date: Wed, 6 Nov 2024 06:42:17 -0800 Subject: [PATCH] Lock web3.js to version 1.x for compatibility (#595) --- content/courses/intro-to-solana/intro-to-cryptography.md | 4 ++-- content/courses/intro-to-solana/intro-to-reading-data.md | 2 +- .../native-onchain-development/cross-program-invocations.md | 2 +- content/courses/state-compression/compressed-nfts.md | 2 +- content/courses/token-extensions/close-mint.md | 2 +- content/courses/token-extensions/default-account-state.md | 2 +- content/courses/token-extensions/immutable-owner.md | 2 +- content/courses/token-extensions/interest-bearing-token.md | 2 +- content/courses/token-extensions/non-transferable-token.md | 2 +- content/courses/token-extensions/permanent-delegate.md | 2 +- content/courses/token-extensions/required-memo.md | 2 +- content/courses/token-extensions/transfer-fee.md | 2 +- content/courses/tokens-and-nfts/nfts-with-metaplex.md | 2 +- content/courses/tokens-and-nfts/token-program.md | 2 +- content/guides/getstarted/full-stack-solana-development.md | 2 +- content/guides/getstarted/local-rust-hello-world.md | 2 +- content/guides/javascript/compressed-nfts.md | 2 +- content/guides/wallets/add-solana-wallet-adapter-to-nextjs.md | 2 +- docs/clients/javascript.md | 4 ++-- 19 files changed, 21 insertions(+), 21 deletions(-) diff --git a/content/courses/intro-to-solana/intro-to-cryptography.md b/content/courses/intro-to-solana/intro-to-cryptography.md index 396e3032a..f88af61a3 100644 --- a/content/courses/intro-to-solana/intro-to-cryptography.md +++ b/content/courses/intro-to-solana/intro-to-cryptography.md @@ -102,7 +102,7 @@ You can use the Solana blockchain from either the browser or node.js with the to install `@solana/web3.js` ```shell -npm i @solana/web3.js +npm i @solana/web3.js@1 ``` We'll cover a lot of @@ -171,7 +171,7 @@ Make a new directory, install TypeScript, Solana web3.js and esrun: mkdir generate-keypair cd generate-keypair npm init -y -npm install typescript @solana/web3.js esrun @solana-developers/helpers +npm install typescript @solana/web3.js@1 esrun @solana-developers/helpers@2 ``` Make a new file called `generate-keypair.ts` diff --git a/content/courses/intro-to-solana/intro-to-reading-data.md b/content/courses/intro-to-solana/intro-to-reading-data.md index 11c129b67..4a8dcb97a 100644 --- a/content/courses/intro-to-solana/intro-to-reading-data.md +++ b/content/courses/intro-to-solana/intro-to-reading-data.md @@ -57,7 +57,7 @@ Solana. We'll also install TypeScript and `esrun`, so we can run `.ts` files on the command line: ```bash -npm install typescript @solana/web3.js esrun +npm install typescript @solana/web3.js@1 esrun ``` ### Connect to the Network diff --git a/content/courses/native-onchain-development/cross-program-invocations.md b/content/courses/native-onchain-development/cross-program-invocations.md index 693c95bcd..ec5190f71 100644 --- a/content/courses/native-onchain-development/cross-program-invocations.md +++ b/content/courses/native-onchain-development/cross-program-invocations.md @@ -895,7 +895,7 @@ npm init -y Install all the required dependencies. ```bash -npm i @solana/web3.js @solana-developers/helpers@2.5.2 +npm i @solana/web3.js@1 @solana-developers/helpers@2.5.2 npm i --save-dev esrun ``` diff --git a/content/courses/state-compression/compressed-nfts.md b/content/courses/state-compression/compressed-nfts.md index d196ffefa..89513bc5f 100644 --- a/content/courses/state-compression/compressed-nfts.md +++ b/content/courses/state-compression/compressed-nfts.md @@ -647,7 +647,7 @@ cd cnft-demo Install all the required dependencies ```bash -npm i @solana/web3.js @solana-developers/helpers@2.5.2 @metaplex-foundation/mpl-token-metadata @metaplex-foundation/mpl-bubblegum @metaplex-foundation/digital-asset-standard-api @metaplex-foundation/umi-bundle-defaults +npm i @solana/web3.js@1 @solana-developers/helpers@2.5.2 @metaplex-foundation/mpl-token-metadata @metaplex-foundation/mpl-bubblegum @metaplex-foundation/digital-asset-standard-api @metaplex-foundation/umi-bundle-defaults npm i --save-dev esrun ``` diff --git a/content/courses/token-extensions/close-mint.md b/content/courses/token-extensions/close-mint.md index 8c3cd9caa..08ecd4ca6 100644 --- a/content/courses/token-extensions/close-mint.md +++ b/content/courses/token-extensions/close-mint.md @@ -213,7 +213,7 @@ Next, we'll need to add our dependencies. Run the following to install the required packages: ```bash -npm i @solana-developers/helpers @solana/spl-token @solana/web3.js esrun dotenv typescript +npm i @solana-developers/helpers@2 @solana/spl-token @solana/web3.js@1 esrun dotenv typescript ``` Create a directory named `src`. In this directory, create a file named diff --git a/content/courses/token-extensions/default-account-state.md b/content/courses/token-extensions/default-account-state.md index c0a19a134..2286a04bd 100644 --- a/content/courses/token-extensions/default-account-state.md +++ b/content/courses/token-extensions/default-account-state.md @@ -223,7 +223,7 @@ Next, we'll need to add our dependencies. Run the following to install the required packages: ```bash -npm i @solana-developers/helpers @solana/spl-token @solana/web3.js esrun dotenv typescript +npm i @solana-developers/helpers@2 @solana/spl-token @solana/web3.js@1 esrun dotenv typescript ``` Create a directory named `src`. In this directory, create a file named diff --git a/content/courses/token-extensions/immutable-owner.md b/content/courses/token-extensions/immutable-owner.md index d5eb17192..bfd83f4f3 100644 --- a/content/courses/token-extensions/immutable-owner.md +++ b/content/courses/token-extensions/immutable-owner.md @@ -139,7 +139,7 @@ Next, we'll need to add our dependencies. Run the following to install the required packages: ```bash -npm i @solana-developers/helpers @solana/spl-token @solana/web3.js esrun dotenv typescript +npm i @solana-developers/helpers@2 @solana/spl-token @solana/web3.js@1 esrun dotenv typescript ``` Create a directory named `src`. In this directory, create a file named diff --git a/content/courses/token-extensions/interest-bearing-token.md b/content/courses/token-extensions/interest-bearing-token.md index 29cfa7735..316d440b6 100644 --- a/content/courses/token-extensions/interest-bearing-token.md +++ b/content/courses/token-extensions/interest-bearing-token.md @@ -213,7 +213,7 @@ Next, we'll need to add our dependencies. Run the following to install the required packages: ```bash -npm i @solana-developers/helpers @solana/spl-token @solana/web3.js esrun dotenv typescript +npm i @solana-developers/helpers@2 @solana/spl-token @solana/web3.js@1 esrun dotenv typescript ``` Create a directory named `src`. In this directory, create a file named diff --git a/content/courses/token-extensions/non-transferable-token.md b/content/courses/token-extensions/non-transferable-token.md index c62ceceb0..34bc4dfe7 100644 --- a/content/courses/token-extensions/non-transferable-token.md +++ b/content/courses/token-extensions/non-transferable-token.md @@ -127,7 +127,7 @@ Next, we'll need to add our dependencies. Run the following to install the required packages: ```bash -npm i @solana-developers/helpers @solana/spl-token @solana/web3.js esrun dotenv typescript +npm i @solana-developers/helpers@2 @solana/spl-token @solana/web3.js@1 esrun dotenv typescript ``` Create a directory named `src`. In this directory, create a file named diff --git a/content/courses/token-extensions/permanent-delegate.md b/content/courses/token-extensions/permanent-delegate.md index 5576ca0af..2474c1cfe 100644 --- a/content/courses/token-extensions/permanent-delegate.md +++ b/content/courses/token-extensions/permanent-delegate.md @@ -250,7 +250,7 @@ Next, we'll need to add our dependencies. Run the following to install the required packages: ```bash -npm i @solana-developers/helpers @solana/spl-token @solana/web3.js esrun +npm i @solana-developers/helpers@2 @solana/spl-token @solana/web3.js@1 esrun ``` Create a directory named `src`. In this directory, create a file named diff --git a/content/courses/token-extensions/required-memo.md b/content/courses/token-extensions/required-memo.md index 43bab1061..54baeaeb6 100644 --- a/content/courses/token-extensions/required-memo.md +++ b/content/courses/token-extensions/required-memo.md @@ -177,7 +177,7 @@ Next, we'll need to add our dependencies. Run the following to install the required packages: ```bash -npm i @solana-developers/helpers @solana/spl-token @solana/web3.js esrun dotenv typescript +npm i @solana-developers/helpers@2 @solana/spl-token @solana/web3.js@1 esrun dotenv typescript ``` Create a directory named `src`. In this directory, create a file named diff --git a/content/courses/token-extensions/transfer-fee.md b/content/courses/token-extensions/transfer-fee.md index f7d574865..6b150d899 100644 --- a/content/courses/token-extensions/transfer-fee.md +++ b/content/courses/token-extensions/transfer-fee.md @@ -459,7 +459,7 @@ Next, we'll need to add our dependencies. Run the following to install the required packages: ```bash -npm i @solana-developers/helpers @solana/spl-token @solana/web3.js esrun dotenv typescript +npm i @solana-developers/helpers@2 @solana/spl-token @solana/web3.js@1 esrun dotenv typescript ``` Create a directory named `src`. In this directory, create a file named diff --git a/content/courses/tokens-and-nfts/nfts-with-metaplex.md b/content/courses/tokens-and-nfts/nfts-with-metaplex.md index acb80f9ef..01e9fe72d 100644 --- a/content/courses/tokens-and-nfts/nfts-with-metaplex.md +++ b/content/courses/tokens-and-nfts/nfts-with-metaplex.md @@ -345,7 +345,7 @@ Solana. To begin, make a new folder and install the relevant dependencies: ```bash -npm i @solana/web3.js npm i @solana/web3.js npm i @solana-developers/helpers npm i @metaplex-foundation/mpl-token-metadata npm i @metaplex-foundation/umi-bundle-defaults npm i @metaplex-foundation/umi-uploader-irys npm i --save-dev esrun +npm i @solana/web3.js@1 @solana-developers/helpers@2 @metaplex-foundation/mpl-token-metadata @metaplex-foundation/umi-bundle-defaults @metaplex-foundation/umi-uploader-irys esrun ``` Then create a file called `create-metaplex-collection.ts`, and add our imports: diff --git a/content/courses/tokens-and-nfts/token-program.md b/content/courses/tokens-and-nfts/token-program.md index cfcd7e625..6c05a868f 100644 --- a/content/courses/tokens-and-nfts/token-program.md +++ b/content/courses/tokens-and-nfts/token-program.md @@ -464,7 +464,7 @@ Assuming you already have a `.env` file with a `SECRET_KEY` setup per [Cryptography fundamentals](/content/courses/intro-to-solana/intro-to-cryptography.md). ```bash -npm i @solana/web3.js @solana/spl-token @solana-developers/helpers esrun +npm i @solana/web3.js@1 @solana/spl-token @solana-developers/helpers@2 esrun ``` #### Create the Token Mint diff --git a/content/guides/getstarted/full-stack-solana-development.md b/content/guides/getstarted/full-stack-solana-development.md index 0923ba17b..a6050f6b3 100644 --- a/content/guides/getstarted/full-stack-solana-development.md +++ b/content/guides/getstarted/full-stack-solana-development.md @@ -1085,7 +1085,7 @@ Throw this command into your terminal to install all the `wallet-adapter` stuff we need: ```shell -yarn add react @solana/web3.js \ +yarn add react @solana/web3.js@1 \ @solana/wallet-adapter-base @solana/wallet-adapter-react \ @solana/wallet-adapter-react-ui @solana/wallet-adapter-wallets ``` diff --git a/content/guides/getstarted/local-rust-hello-world.md b/content/guides/getstarted/local-rust-hello-world.md index 5b87bfa4e..56da11d31 100644 --- a/content/guides/getstarted/local-rust-hello-world.md +++ b/content/guides/getstarted/local-rust-hello-world.md @@ -251,7 +251,7 @@ For macOS you can Install the Solana web3.js library and the Solana helpers library: ```shell -npm install @solana/web3.js @solana-developers/helpers +npm install @solana/web3.js@1 @solana-developers/helpers@2 ``` Create a new file called `client.mjs` and add the following code: diff --git a/content/guides/javascript/compressed-nfts.md b/content/guides/javascript/compressed-nfts.md index 65f1cc431..8e0e6c214 100644 --- a/content/guides/javascript/compressed-nfts.md +++ b/content/guides/javascript/compressed-nfts.md @@ -139,7 +139,7 @@ Using your preferred package manager (e.g. npm, yarn, pnpm, etc), install these packages into your project: ```shell -yarn add @solana/web3.js @solana/spl-token @solana/spl-account-compression +yarn add @solana/web3.js@1 @solana/spl-token @solana/spl-account-compression ``` ```shell diff --git a/content/guides/wallets/add-solana-wallet-adapter-to-nextjs.md b/content/guides/wallets/add-solana-wallet-adapter-to-nextjs.md index e0e8f5d1c..867e1d038 100644 --- a/content/guides/wallets/add-solana-wallet-adapter-to-nextjs.md +++ b/content/guides/wallets/add-solana-wallet-adapter-to-nextjs.md @@ -85,7 +85,7 @@ Install these packages to your Next.js project using your preferred node package manager: ```shell -npm install @solana/web3.js \ +npm install @solana/web3.js@1 \ @solana/wallet-adapter-base \ @solana/wallet-adapter-react \ @solana/wallet-adapter-react-ui \ diff --git a/docs/clients/javascript.md b/docs/clients/javascript.md index 27509f0b9..8aeb577ab 100644 --- a/docs/clients/javascript.md +++ b/docs/clients/javascript.md @@ -34,13 +34,13 @@ For the full list of terms, see #### yarn ```shell -yarn add @solana/web3.js +yarn add @solana/web3.js@1 ``` #### npm ```shell -npm install --save @solana/web3.js +npm install --save @solana/web3.js@1 ``` #### Bundle