diff --git a/docs/rpc.md b/docs/rpc.md index 545d24c..aa3330f 100644 --- a/docs/rpc.md +++ b/docs/rpc.md @@ -8,27 +8,22 @@ When creating a new Umi instance via the default bundle, you must pass the RPC's ```ts import { createUmi } from '@metaplex-foundation/umi-bundle-defaults'; +import { Connection } from '@solana/web3.js'; +// Pass in your RPC endpoint. const umi = createUmi("https://api.mainnet-beta.solana.com"); -``` -```ts -import { createUmi } from '@metaplex-foundation/umi-bundle-defaults'; -import { Connection } from '@solana/web3.js'; +// Or an explicit Connection instance from web3.js. const umi = createUmi(new Connection("https://api.mainnet-beta.solana.com")); ``` Alternatively, you may set or update the RPC implementation explicitly by the using the plugin they provide. For instance, the `web3JsRpc` plugin will set the RPC implementation to use the `@solana/web3.js` library. -```ts -import { web3JsRpc } from '@metaplex-foundation/umi-rpc-web3js'; - -umi.use(web3JsRpc("https://api.mainnet-beta.solana.com")); -``` ```ts import { web3JsRpc } from '@metaplex-foundation/umi-rpc-web3js'; import { Connection } from '@solana/web3.js'; +umi.use(web3JsRpc("https://api.mainnet-beta.solana.com")); umi.use(web3JsRpc(new Connection("https://api.mainnet-beta.solana.com"))); ```