Browse Source

Merge pull request #313 from metaplex-foundation/core-candy-machine/sdk-pages

migrate getting started page to sdk page
Tony Boyle 10 months ago
parent
commit
d208499825

+ 7 - 5
src/components/products/coreCandyMachine/index.js

@@ -20,11 +20,13 @@ export const coreCandyMachine = {
           title: 'Introduction',
           links: [
             { title: 'Overview', href: '/core-candy-machine' },
-            {
-              title: 'Getting Started',
-              href: '/core-candy-machine/getting-started',
-              // Subpages: /js /rust, etc.
-            },
+          ],
+        },
+        {
+          title: 'SDK',
+          links: [
+            { title: 'Javascript SDK', href: '/core-candy-machine/sdk/javascript' },
+            { title: 'Rust SDK', href: '/core-candy-machine/sdk/rust' },
           ],
         },
         {

+ 6 - 0
src/middleware.js

@@ -19,6 +19,11 @@ const redirectRules = {
     'guides/javascript/how-to-create-a-core-nft-asset':
       '/core/guides/javascript/how-to-create-a-core-nft-asset-with-javascript',
   },
+  '/core-candy-machine': {
+    '/getting-started': '/core-candy-machine/sdk',
+    '/getting-started/js': '/core-candy-machine/sdk/javascript',
+    '/getting-started/rust': '/core-candy-machine/sdk/rust',
+  },
   '/mpl-hybrid': {
     'guides/mpl-404-hyrbid-ui-template':
       '/mpl-hybrid/guides/mpl-404-hybrid-ui-template',
@@ -54,5 +59,6 @@ export const config = {
     '/core/:path*',
     '/mpl-hybrid/:path*',
     '/guides/javascript/how-to-create-an-spl-token-on-solana',
+    '/core-candy-machine/:path*',
   ],
 }

+ 0 - 18
src/pages/core-candy-machine/getting-started/index.md

@@ -1,18 +0,0 @@
----
-title: Getting Started
-metaTitle: Getting Started | Core Candy Machine
-description: The starting point in getting to know the Core Candy Machine program and packages.
----
-
-Select the language / library you want to use below to get started with Core Candy Machines.
-
-{% quick-links %}
-
-{% quick-link title="JavaScript" icon="JavaScript" href="/core-candy-machine/getting-started/js" description="Get started with our JavaScript library based on the Umi framework." /%}
-
-{% quick-link title="Rust" icon="Rust" href="/core-candy-machine/getting-started/rust" description="Get started using our Rust crate." /%}
-
-<!-- {% quick-link title="Sugar" icon="SolidCake" href="/core-candy-machine/sugar/getting-started" description="Get started using the command-line tool Sugar." /%} -->
-
-{% /quick-links %}
-

+ 0 - 41
src/pages/core-candy-machine/getting-started/js.md

@@ -1,41 +0,0 @@
----
-title: Getting Started using JavaScript
-metaTitle: Javascript SDK | Core Candy Machine
-description: Get started using Javascript with the latest mpl-core-candy-machine packages for Core Candy Machine.
----
-
-Metaplex provides a JavaScript library that can be used to interact with the Core Candy Machine program. Thanks to the [Umi framework](https://github.com/metaplex-foundation/umi), it ships without many opinionated dependencies and, thus, provides a lightweight library that can be used in any JavaScript project.
-
-To get started, you'll need to [install the Umi framework](https://github.com/metaplex-foundation/umi/blob/main/docs/installation.md) and the Core Candy Machine JavaScript library.
-
-```sh
-npm install \
-  @metaplex-foundation/umi \
-  @metaplex-foundation/umi-bundle-defaults \
-  @metaplex-foundation/mpl-core-candy-machine
-```
-
-Next, you may create your `Umi` instance and install the `mplCore` plugin like so.
-
-```ts
-import { createUmi } from '@metaplex-foundation/umi-bundle-defaults'
-import { 
-  mplCandyMachine as mplCoreCandyMachine 
-} from "@metaplex-foundation/mpl-core-candy-machine";
-
-// Use the RPC endpoint of your choice.
-const umi = createUmi('http://127.0.0.1:8899').use(mplCoreCandyMachine())
-```
-
-Then you want to tell Umi which wallet to use. This can either be a [keypair](/umi/connecting-to-umi#connecting-w-a-secret-key) or the [solana wallet adapter](/umi/connecting-to-umi#connecting-w-wallet-adapter).
-
-That's it, you can now start interacting with the `Core Candy Machine` program.
-
-
-
-🔗 **Helpful Links:**
-
-- [Umi Framework](https://github.com/metaplex-foundation/umi)
-- [GitHub Repository](https://github.com/metaplex-foundation/mpl-core-candy-machine)
-- [NPM Package](https://www.npmjs.com/package/@metaplex-foundation/mpl-core-candy-machine)
-- [API References](https://mpl-core.typedoc.metaplex.com/)

+ 0 - 21
src/pages/core-candy-machine/getting-started/rust.md

@@ -1,21 +0,0 @@
----
-title: Getting Started with Rust SDK
-metaTitle: Rust SDK | Core Candy Machine
-description: Get Started with the mpl-core-candy-machine Rust SDK for the Core Candy Machine program from Metaplex.
----
-
-Metaplex provides a Rust library that can be used to interact with the Core Candy Machine program on both a client and program level.
-
-## Solana Program
-
-To get started, you'll need to [install the Core Candy Machine Crate](https://crates.io/crates/mpl-core-candy-machine-core/).
-
-```sh
-cargo add mpl-core-candy-machine-core
-```
-
-
-🔗 **Helpful Links:**
-- [Rust Crate](https://crates.io/crates/mpl-core-candy-machine-core/)
-- [GitHub Repository](https://github.com/metaplex-foundation/mpl-core-candy-machine)
-- [API References](https://docs.rs/mpl-core-candy-machine-core/)

+ 15 - 0
src/pages/core-candy-machine/sdk/index.md

@@ -0,0 +1,15 @@
+---
+title: MPL Core Candy Machine SDKs
+metaTitle: SDKs | Core Candy Machine
+description: Find out about the SDKs available for the MPL Core Candy Machine program.
+---
+
+Select the language / library you want to use below to get started with the new MPL Core Candy Machine program.
+
+{% quick-links %}
+
+{% quick-link title="JavaScript" icon="JavaScript" href="/core-candy-machine/sdk/javascript" description="Get started with our JavaScript library for MPL-Core Candy Machine based on the Umi framework." /%}
+
+{% quick-link title="Rust" icon="Rust" href="/core-candy-machine/sdk/rust" description="Get started using our MPL Core Candy Machine Rust SDK crate." /%}
+
+{% /quick-links %}

+ 49 - 0
src/pages/core-candy-machine/sdk/javascript.md

@@ -0,0 +1,49 @@
+---
+title: MPL Core Candy Machine Javascript SDK
+metaTitle: Javascript SDK | MPL Core Candy Machine
+description: Learn how to set up your project to run the MPL Core Candy Machine Javascript SDK.
+---
+
+Metaplex provides a JavaScript library that can be used to interact with the MPL Core Candy Machine program. Thanks to the [Umi Framework](/umi), it ships without many opinionated dependencies thus providing a lightweight library that can be used in any JavaScript project.
+
+To get started, you'll need to [install the Umi framework](/umi/getting-started) and the MPL-Core JavaScript library.
+
+## Installation
+
+Installation can be executed with any of the JS package managers, npm, yarn, bun etc...
+
+```sh
+npm install @metaplex-foundation/mpl-core-candy-machine
+```
+
+{% quick-links %}
+
+{% quick-link title="typedoc" target="_blank" icon="JavaScript" href="https://mpl-core-candy-machine.typedoc.metaplex.com/" description="MPL Core Candy Machine Javascript SDK generated package API documentation." /%}
+
+{% quick-link title="npmjs.com" target="_blank" icon="JavaScript" href="https://www.npmjs.com/package/@metaplex-foundation/mpl-core-candy-machine" description="MPL Core Candy Machine Javascript SDK on NPM." /%}
+
+{% /quick-links %}
+
+## Umi Setup
+
+An `umi` instance is required to interact with the Metaplex Javascript SDKs. If you haven't set up and configured an `umi` instance yet then you can get checkout the [Umi Getting Started](/umi/getting-started) page and configure your RPC endpoint and your `umi` identity/signer.
+
+During the initialization of the `umi` instance you can add the mpl-core package to `umi` using
+
+```js
+.use(mplCandyMachine())
+```
+
+You can add the `mpCandyMachine()` package anywhere in your umi instance creation with `.use()`.
+
+```ts
+import { createUmi } from '@metaplex-foundation/umi-bundle-defaults'
+import { mplCandyMachine } from '@metaplex-foundation/mpl-core-candy-machine'
+
+// Use the RPC endpoint of your choice.
+const umi = createUmi('http://api.devnet.solana.com')
+... // additional umi settings, packages, and signers
+.use(mplCandyMachine())
+```
+
+From here your `umi` instance will have access to the mpl-core package and you start to explore the mpl-core feature set.

+ 45 - 0
src/pages/core-candy-machine/sdk/rust.md

@@ -0,0 +1,45 @@
+---
+title: Core Candy Machine Rust SDK
+metaTitle: Core Candy Machine Rust SDK | Core Candy Machine
+description: Get Started with the mpl-core-candy-machine Rust SDK for the Core Candy Machine program from Metaplex.
+---
+
+## Core Candy Machine
+
+The Core Candy Machine is the heart of the Candymachine which allows initialization and filling of a Core Candy Machine
+
+### Installation
+
+The MPL-Core Rust SDK can be used in both scripts/desktop/mobile applications as well as with Solana onchain programs.
+
+```rust
+cargo add mpl-core-candy-machine-core
+```
+
+{% quick-links %}
+
+{% quick-link title="crates.io" target="_blank" icon="Rust" href="https://crates.io/crates/mpl-core-candy-machine-core" description="Get started with our Rust SDK for MPL Core Candy Machine." /%}
+
+{% quick-link title="docs.rs" target="_blank" icon="Rust" href="https://docs.rs/mpl-core-candy-machine-core/" description="The Rust SDK typedoc platform for Core Candy Machine crate." /%}
+
+{% /quick-links %}
+
+## Core Candy Guards
+
+The Core Candy Guards crate allows the creating and management of Core Candy Guards that can be wrapped over a Core Candy Machine.
+
+### Installation
+
+The MPL-Core Rust SDK can be used in both scripts/desktop/mobile applications as well as with Solana onchain programs.
+
+```rust
+cargo add mpl-core-candy-guard
+```
+
+{% quick-links %}
+
+{% quick-link title="crates.io" target="_blank" icon="Rust" href="https://crates.io/crates/mpl-core-candy-guard" description="Get started with our Rust SDK for Core Candy Guards." /%}
+
+{% quick-link title="docs.rs" target="_blank" icon="Rust" href="https://docs.rs/mpl-core-candy-guard" description="The Rust SDK typedoc platform for Core Candy Guards crate." /%}
+
+{% /quick-links %}