USE_SSH=true yarn deploy
32 | ```
33 |
34 | If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
35 |
--------------------------------------------------------------------------------
/packages/docs/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [require.resolve("@docusaurus/core/lib/babel/preset")],
3 | plugins: [require.resolve("@babel/plugin-transform-modules-commonjs")],
4 | };
5 |
--------------------------------------------------------------------------------
/packages/docs/blog/2021-12-01-open-collective/0.5x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2021-12-01-open-collective/0.5x.png
--------------------------------------------------------------------------------
/packages/docs/blog/2021-12-01-open-collective/OpenSplash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2021-12-01-open-collective/OpenSplash.png
--------------------------------------------------------------------------------
/packages/docs/blog/2021-12-01-open-collective/day_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2021-12-01-open-collective/day_2.png
--------------------------------------------------------------------------------
/packages/docs/blog/2021-12-01-open-collective/final.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2021-12-01-open-collective/final.png
--------------------------------------------------------------------------------
/packages/docs/blog/2021-12-01-open-collective/launch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2021-12-01-open-collective/launch.png
--------------------------------------------------------------------------------
/packages/docs/blog/2021-12-21-governance/actions.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2021-12-21-governance/actions.png
--------------------------------------------------------------------------------
/packages/docs/blog/2021-12-21-governance/add-asset.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2021-12-21-governance/add-asset.png
--------------------------------------------------------------------------------
/packages/docs/blog/2021-12-21-governance/bespoke.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2021-12-21-governance/bespoke.png
--------------------------------------------------------------------------------
/packages/docs/blog/2021-12-21-governance/create-program.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2021-12-21-governance/create-program.png
--------------------------------------------------------------------------------
/packages/docs/blog/2021-12-21-governance/create-realm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2021-12-21-governance/create-realm.png
--------------------------------------------------------------------------------
/packages/docs/blog/2021-12-21-governance/create-secret.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2021-12-21-governance/create-secret.png
--------------------------------------------------------------------------------
/packages/docs/blog/2021-12-21-governance/end-result.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2021-12-21-governance/end-result.png
--------------------------------------------------------------------------------
/packages/docs/blog/2021-12-21-governance/execute.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2021-12-21-governance/execute.png
--------------------------------------------------------------------------------
/packages/docs/blog/2021-12-21-governance/governance-id.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2021-12-21-governance/governance-id.png
--------------------------------------------------------------------------------
/packages/docs/blog/2021-12-21-governance/realm-form.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2021-12-21-governance/realm-form.png
--------------------------------------------------------------------------------
/packages/docs/blog/2021-12-21-governance/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2021-12-21-governance/splash.png
--------------------------------------------------------------------------------
/packages/docs/blog/2021-12-21-governance/upgrade-form.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2021-12-21-governance/upgrade-form.png
--------------------------------------------------------------------------------
/packages/docs/blog/2021-12-21-governance/upgrade.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2021-12-21-governance/upgrade.png
--------------------------------------------------------------------------------
/packages/docs/blog/2021-12-21-governance/vote-in-progress.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2021-12-21-governance/vote-in-progress.png
--------------------------------------------------------------------------------
/packages/docs/blog/2021-12-21-governance/vote.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2021-12-21-governance/vote.png
--------------------------------------------------------------------------------
/packages/docs/blog/2021-12-21-governance/wallet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2021-12-21-governance/wallet.png
--------------------------------------------------------------------------------
/packages/docs/blog/2022-03-31-blockasset-tokens/banner.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2022-03-31-blockasset-tokens/banner.jpg
--------------------------------------------------------------------------------
/packages/docs/blog/2022-03-31-blockasset-tokens/blockasset.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2022-03-31-blockasset-tokens/blockasset.png
--------------------------------------------------------------------------------
/packages/docs/blog/2022-03-31-blockasset-tokens/sqrt-plot-sm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2022-03-31-blockasset-tokens/sqrt-plot-sm.png
--------------------------------------------------------------------------------
/packages/docs/blog/2022-04-05-funding/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2022-04-05-funding/logo.png
--------------------------------------------------------------------------------
/packages/docs/blog/2022-04-05-funding/splash.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2022-04-05-funding/splash.jpg
--------------------------------------------------------------------------------
/packages/docs/blog/2022-04-12-create-a-token/create-a-token.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2022-04-12-create-a-token/create-a-token.png
--------------------------------------------------------------------------------
/packages/docs/blog/2022-04-12-create-a-token/disburse.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2022-04-12-create-a-token/disburse.png
--------------------------------------------------------------------------------
/packages/docs/blog/2022-04-12-create-a-token/fully-managed-done.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2022-04-12-create-a-token/fully-managed-done.png
--------------------------------------------------------------------------------
/packages/docs/blog/2022-04-12-create-a-token/fully-managed-info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2022-04-12-create-a-token/fully-managed-info.png
--------------------------------------------------------------------------------
/packages/docs/blog/2022-04-12-create-a-token/fully-managed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2022-04-12-create-a-token/fully-managed.png
--------------------------------------------------------------------------------
/packages/docs/blog/2022-04-12-create-a-token/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2022-04-12-create-a-token/logo.png
--------------------------------------------------------------------------------
/packages/docs/blog/2022-04-12-create-a-token/price-sensitivity.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2022-04-12-create-a-token/price-sensitivity.png
--------------------------------------------------------------------------------
/packages/docs/blog/2022-04-12-create-a-token/self-managed-done.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2022-04-12-create-a-token/self-managed-done.png
--------------------------------------------------------------------------------
/packages/docs/blog/2022-04-12-create-a-token/self-managed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2022-04-12-create-a-token/self-managed.png
--------------------------------------------------------------------------------
/packages/docs/blog/2022-04-12-create-a-token/social-token-info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2022-04-12-create-a-token/social-token-info.png
--------------------------------------------------------------------------------
/packages/docs/blog/2022-04-25-solana-composability/eth-accounts.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2022-04-25-solana-composability/eth-accounts.png
--------------------------------------------------------------------------------
/packages/docs/blog/2022-04-25-solana-composability/hero.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2022-04-25-solana-composability/hero.png
--------------------------------------------------------------------------------
/packages/docs/blog/2022-04-25-solana-composability/token-system.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2022-04-25-solana-composability/token-system.png
--------------------------------------------------------------------------------
/packages/docs/blog/2022-06-24-genopets-launch/hero.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2022-06-24-genopets-launch/hero.png
--------------------------------------------------------------------------------
/packages/docs/blog/2022-06-24-genopets-launch/ki-price.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2022-06-24-genopets-launch/ki-price.jpeg
--------------------------------------------------------------------------------
/packages/docs/blog/2022-06-24-genopets-launch/ki.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2022-06-24-genopets-launch/ki.jpeg
--------------------------------------------------------------------------------
/packages/docs/blog/2022-06-8-metaplex-partnership/dynamic-mint-history.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2022-06-8-metaplex-partnership/dynamic-mint-history.jpeg
--------------------------------------------------------------------------------
/packages/docs/blog/2022-06-8-metaplex-partnership/hero.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2022-06-8-metaplex-partnership/hero.jpg
--------------------------------------------------------------------------------
/packages/docs/blog/2022-08-25-sunsetting-wumbo/hero.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2022-08-25-sunsetting-wumbo/hero.jpg
--------------------------------------------------------------------------------
/packages/docs/blog/2022-08-25-sunsetting-wumbo/wumboExtensionCard.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2022-08-25-sunsetting-wumbo/wumboExtensionCard.jpg
--------------------------------------------------------------------------------
/packages/docs/blog/2022-08-25-sunsetting-wumbo/wumboExtensionCardRemove.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2022-08-25-sunsetting-wumbo/wumboExtensionCardRemove.jpg
--------------------------------------------------------------------------------
/packages/docs/blog/2022-1-19-buy-open/OpenSplash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2022-1-19-buy-open/OpenSplash.png
--------------------------------------------------------------------------------
/packages/docs/blog/2022-1-19-wumbo-beta-open-dist/wumopen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/blog/2022-1-19-wumbo-beta-open-dist/wumopen.png
--------------------------------------------------------------------------------
/packages/docs/blog/authors.yml:
--------------------------------------------------------------------------------
1 | noah:
2 | name: Noah Prince
3 | title: Strata Co-Founder, CEO
4 | url: https://twitter.com/redacted_noah
5 | image_url: https://github.com/ChewingGlass.png
6 |
7 | bry:
8 | name: Bryan Zettler
9 | title: Strata Co-Founder
10 | url: https://twitter.com/BryZettler
11 | image_url: https://github.com/bryzettler.png
12 |
13 | frank:
14 | name: Frank De Czito
15 | title: Global Marketing
16 | image_url: https://wum.bo/frank.png
17 |
18 | mark:
19 | name: Mark Roszak
20 | title: Legal Counsel
21 | url: https://www.linkedin.com/in/mark-roszak-a95a026/
22 | image_url: https://media-exp1.licdn.com/dms/image/C4E03AQG6IqCJ-i-iLg/profile-displayphoto-shrink_800_800/0/1517708146489?e=1647475200&v=beta&t=2GSfpwBu5No0NJq6POnHRywsZvn4EQMddmL8y87UPVQ
23 |
--------------------------------------------------------------------------------
/packages/docs/docs/curve_configurator.md:
--------------------------------------------------------------------------------
1 | ---
2 | sidebar_position: 3
3 | ---
4 |
5 | # Curve Configurator
6 |
7 | A playground to test and plot different curve parameters
8 |
9 | ## Curve Configurator
10 | ```jsx async
11 | var maxTime = 24 * 60 * 60; // 24 hours,
12 | var curveConfig = new TimeDecayExponentialCurveConfig({
13 | c: 0.01,
14 | k0: 2,
15 | k1: 0,
16 | interval: maxTime,
17 | d: 0.5
18 | })
19 | ```
20 | import { CurveConfiguratorFromVariables } from "@site/src/components/CurveConfigurator";
21 |
22 |
23 |
24 | ## LBC Configurator
25 |
26 | ```jsx async
27 | var maxTime = 24 * 60 * 60; // 24 hours
28 | var startSupply = 0;
29 | var endSupply = 5000;
30 | var { curveConfig, reserves, supply } = MarketplaceSdk.lbcCurve({
31 | interval: maxTime,
32 | startPrice: 5,
33 | minPrice: 0.5,
34 | targetMintDecimals: 0,
35 | maxSupply: endSupply
36 | });
37 | var supplyOffset = supply; // So that ticks format correctly
38 | ```
39 |
40 |
--------------------------------------------------------------------------------
/packages/docs/docs/launchpad/dynamic-mint-history.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/docs/launchpad/dynamic-mint-history.jpeg
--------------------------------------------------------------------------------
/packages/docs/docs/launchpad/lbp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/docs/launchpad/lbp.png
--------------------------------------------------------------------------------
/packages/docs/docs/learn/1_hour.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/docs/learn/1_hour.png
--------------------------------------------------------------------------------
/packages/docs/docs/learn/2_hours.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/docs/learn/2_hours.png
--------------------------------------------------------------------------------
/packages/docs/docs/learn/30_seconds.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/docs/learn/30_seconds.png
--------------------------------------------------------------------------------
/packages/docs/docs/learn/_category_.json:
--------------------------------------------------------------------------------
1 | {
2 | "label": "Concepts",
3 | "position": 2
4 | }
5 |
--------------------------------------------------------------------------------
/packages/docs/docs/learn/day_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/docs/learn/day_2.png
--------------------------------------------------------------------------------
/packages/docs/docs/learn/final.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/docs/learn/final.png
--------------------------------------------------------------------------------
/packages/docs/docs/learn/injection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/docs/learn/injection.png
--------------------------------------------------------------------------------
/packages/docs/docs/learn/launch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/docs/learn/launch.png
--------------------------------------------------------------------------------
/packages/docs/docs/learn/visualization.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/docs/learn/visualization.png
--------------------------------------------------------------------------------
/packages/docs/docs/playground.md:
--------------------------------------------------------------------------------
1 | ---
2 | sidebar_position: 3
3 | ---
4 |
5 | # Playground
6 |
7 | A playground to test and work with your strata data.
8 |
9 | :::warning
10 | Any changes made here in mainnet (or devnet) are final. Use with care
11 | :::
12 |
13 | import { NetworkSelect } from "@site/src/components/NetworkSelect";
14 |
15 |
16 |
17 |
18 | ```jsx async allowMainnet
19 |
20 | ```
21 |
22 | ## Trade Interface
23 |
24 | ```jsx async
25 | var tokenBonding = new PublicKey("")
26 | ```
27 | ```jsx live allowMainnet
28 | function TokenDisplay() {
29 | const { targetMint } = useVariables(); // Getting token bonding from above code;
30 |
31 | if (tokenBonding) {
32 | return
33 | }
34 |
35 | return Please run the code block above
36 | }
37 | ```
--------------------------------------------------------------------------------
/packages/docs/src/components/BuyOpen/styles.module.css:
--------------------------------------------------------------------------------
1 | .container {
2 | margin-bottom: var(--ifm-leading);
3 | border-radius: var(--ifm-global-radius);
4 | box-shadow: var(--ifm-global-shadow-lw);
5 | border: 1px solid #ccc;
6 | overflow: hidden;
7 | padding: 12px;
8 | }
9 |
--------------------------------------------------------------------------------
/packages/docs/src/components/ClaimBwum/styles.module.css:
--------------------------------------------------------------------------------
1 | .container {
2 | margin-bottom: var(--ifm-leading);
3 | border-radius: var(--ifm-global-radius);
4 | box-shadow: var(--ifm-global-shadow-lw);
5 | border: 1px solid #ccc;
6 | overflow: hidden;
7 | padding: 12px;
8 | }
9 |
--------------------------------------------------------------------------------
/packages/docs/src/components/ClaimOpen/styles.module.css:
--------------------------------------------------------------------------------
1 | .container {
2 | margin-bottom: var(--ifm-leading);
3 | border-radius: var(--ifm-global-radius);
4 | box-shadow: var(--ifm-global-shadow-lw);
5 | border: 1px solid #ccc;
6 | overflow: hidden;
7 | padding: 12px;
8 | }
9 |
--------------------------------------------------------------------------------
/packages/docs/src/components/CloseOutWumbo/styles.module.css:
--------------------------------------------------------------------------------
1 | .container {
2 | margin-bottom: var(--ifm-leading);
3 | border-radius: var(--ifm-global-radius);
4 | box-shadow: var(--ifm-global-shadow-lw);
5 | border: 1px solid #ccc;
6 | overflow: hidden;
7 | padding: 12px;
8 | }
9 |
--------------------------------------------------------------------------------
/packages/docs/src/components/HomepageFeatures.module.css:
--------------------------------------------------------------------------------
1 | .features {
2 | display: flex;
3 | align-items: center;
4 | padding: 2rem 0;
5 | width: 100%;
6 | }
7 |
8 | .featureSvg {
9 | height: 200px;
10 | width: 200px;
11 | }
12 |
--------------------------------------------------------------------------------
/packages/docs/src/components/NetworkSelect/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { WalletAdapterNetwork } from "@solana/wallet-adapter-base";
3 | import { VStack, Heading, Select } from "@chakra-ui/react";
4 | import { useEndpoint } from "@strata-foundation/react";
5 |
6 | export const NetworkSelect = () => {
7 | const { cluster, setClusterOrEndpoint } = useEndpoint();
8 |
9 | return (
10 |
11 | Network
12 |
20 |
21 | );
22 | };
--------------------------------------------------------------------------------
/packages/docs/src/components/QueryStringSetter/index.tsx:
--------------------------------------------------------------------------------
1 | import React, { useEffect } from "react";
2 | import { Text, Input, Box } from "@chakra-ui/react";
3 | import { useQueryString } from "@strata-foundation/react";
4 | import { useVariablesContext } from "../../theme/Root/variables";
5 |
6 | export function QueryStringSetter({
7 | name,
8 | label,
9 | conv = (v) => v,
10 | }: {
11 | label: string;
12 | name: string;
13 | conv: (input: any) => any;
14 | }) {
15 | const [passedValue, setPassedValue] = useQueryString(name, "");
16 | const { setVariables, variables } = useVariablesContext();
17 | useEffect(() => {
18 | setVariables((vars) => {
19 | try {
20 | return {
21 | ...vars,
22 | [name]: conv(passedValue),
23 | [name + "Raw"]: passedValue,
24 | };
25 | } catch (e: any) {
26 | console.error(e);
27 | }
28 | });
29 | }, [passedValue, setVariables]);
30 |
31 | return (
32 |
33 | {label}
34 | setPassedValue(e.target.value)}
36 | value={passedValue}
37 | />
38 |
39 | );
40 | }
41 |
--------------------------------------------------------------------------------
/packages/docs/src/components/UrlDisplay/index.tsx:
--------------------------------------------------------------------------------
1 | import { useVariables } from "../../theme/Root/variables";
2 | import React from "react";
3 | //@ts-ignore
4 | import CodeBlock from "@theme-init/CodeBlock";
5 |
6 | export const UrlDisplay = ({ subs, value }: { value: string, subs: string[] }) => {
7 | const variables = useVariables();
8 |
9 | const subbed = subs.reduce((currValue, name) => {
10 | return currValue.replace(new RegExp(":" + name, 'g'), variables[name])
11 | }, value)
12 |
13 | return
14 | { subbed }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/packages/docs/src/pages/index.module.css:
--------------------------------------------------------------------------------
1 | /**
2 | * CSS files with the .module.css suffix will be treated as CSS modules
3 | * and scoped locally.
4 | */
5 |
6 | .heroBanner {
7 | padding: 4rem 0;
8 | text-align: center;
9 | position: relative;
10 | overflow: hidden;
11 | background: linear-gradient(180deg, #18D2E4 -11.72%, #FFFFFF 100%);
12 | }
13 |
14 | html[data-theme='dark'] .heroBanner {
15 | background: linear-gradient(180deg, #18D2E4 -11.72%, #23273B 100%);
16 | }
17 |
18 | @media screen and (max-width: 966px) {
19 | .heroBanner {
20 | padding: 2rem;
21 | }
22 | }
23 |
24 | .buttons {
25 | display: flex;
26 | align-items: center;
27 | justify-content: center;
28 | }
29 |
--------------------------------------------------------------------------------
/packages/docs/src/pages/markdown-page.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Markdown page example
3 | ---
4 |
5 | # Markdown page example
6 |
7 | You don't need React to write simple standalone pages.
8 |
--------------------------------------------------------------------------------
/packages/docs/src/theme/CodeBlock/index.js:
--------------------------------------------------------------------------------
1 | import CodeBlock from '@theme-init/CodeBlock';
2 | import React from 'react';
3 | import Playground from '@theme/Playground';
4 | import ReactLiveScope from '@theme/ReactLiveScope';
5 | import { useVariablesContext } from '../Root/variables';
6 |
7 | const withLiveEditor = (Component) => {
8 | const WrappedComponent = (props) => {
9 | if (props.live || props.async) {
10 | return ;
11 | }
12 |
13 | return ;
14 | };
15 |
16 | return WrappedComponent;
17 | };
18 |
19 | export default withLiveEditor(CodeBlock);
20 |
--------------------------------------------------------------------------------
/packages/docs/src/theme/ReactLiveScope/styles.module.css:
--------------------------------------------------------------------------------
1 | .container {
2 | display: flex;
3 | flex-direction: row;
4 | justify-content: space-between;
5 | }
6 |
7 | .runButton {
8 | height: 35px;
9 | }
10 |
11 | .buttonIcon {
12 | margin-top:-1px;
13 | width: 12px;
14 | height: 12px;
15 | margin-right: 6px;
16 | }
--------------------------------------------------------------------------------
/packages/docs/src/theme/Root/bufferFill.ts:
--------------------------------------------------------------------------------
1 | import { Buffer } from "buffer";
2 |
3 | if (typeof window !== "undefined") {
4 | //@ts-ignore
5 | window.Buffer = Buffer;
6 | } else {
7 | global.Buffer = Buffer;
8 | }
9 |
--------------------------------------------------------------------------------
/packages/docs/src/theme/Root/wdyr.ts:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | if (process.env.NODE_ENV === "development") {
4 | const whyDidYouRender = require("@welldone-software/why-did-you-render");
5 | whyDidYouRender(React, {
6 | trackAllPureComponents: true,
7 | });
8 | }
9 |
--------------------------------------------------------------------------------
/packages/docs/static/.nojekyll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/static/.nojekyll
--------------------------------------------------------------------------------
/packages/docs/static/img/BuildwithReact.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/static/img/BuildwithReact.png
--------------------------------------------------------------------------------
/packages/docs/static/img/EasytoUse.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/static/img/EasytoUse.png
--------------------------------------------------------------------------------
/packages/docs/static/img/FreeandOpen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/static/img/FreeandOpen.png
--------------------------------------------------------------------------------
/packages/docs/static/img/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/static/img/favicon.ico
--------------------------------------------------------------------------------
/packages/docs/static/img/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/static/img/logo.png
--------------------------------------------------------------------------------
/packages/docs/static/img/tutorial/docsVersionDropdown.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/static/img/tutorial/docsVersionDropdown.png
--------------------------------------------------------------------------------
/packages/docs/static/img/tutorial/localeDropdown.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/docs/static/img/tutorial/localeDropdown.png
--------------------------------------------------------------------------------
/packages/docs/static/learnSTRAT.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Learned Strata Token",
3 | "sumbol": "learnSTRAT",
4 | "description": "Testing",
5 | "image": "https://strataprotocol.com/img/logo.png",
6 | "seller_fee_basis_points": 0
7 | }
--------------------------------------------------------------------------------
/packages/docs/static/luvSTRAT.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Learning Strata Token",
3 | "sumbol": "luvSTRAT",
4 | "description": "Testing",
5 | "image": "https://strataprotocol.com/img/logo.png",
6 | "seller_fee_basis_points": 0
7 | }
--------------------------------------------------------------------------------
/packages/docs/static/tCOLL.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Test Collective",
3 | "sumbol": "tCOLL",
4 | "description": "Testing",
5 | "image": "https://strata-token-metadata.s3.us-east-2.amazonaws.com/logo.png",
6 | "seller_fee_basis_points": 0
7 | }
8 |
--------------------------------------------------------------------------------
/packages/docs/tsconfig.cjs.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.cjs.json",
3 | "include": ["src"],
4 | "compilerOptions": {
5 | "outDir": "lib/cjs",
6 | "jsx": "react"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/packages/docs/tsconfig.esm.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.esm.json",
3 | "include": ["src"],
4 | "compilerOptions": {
5 | "outDir": "lib/esm",
6 | "declarationDir": "lib/types",
7 | "jsx": "react"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/packages/docs/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.root.json",
3 | "references": [
4 | {
5 | "path": "../chat"
6 | },
7 | {
8 | "path": "../chat-ui"
9 | },
10 | {
11 | "path": "../fungible-entangler"
12 | },
13 | {
14 | "path": "../marketplace-sdk"
15 | },
16 | {
17 | "path": "../marketplace-ui"
18 | },
19 | {
20 | "path": "../react"
21 | },
22 | {
23 | "path": "../spl-token-bonding"
24 | },
25 | {
26 | "path": "../spl-token-collective"
27 | },
28 | {
29 | "path": "../spl-utils"
30 | },
31 | {
32 | "path": "./tsconfig.cjs.json"
33 | },
34 | {
35 | "path": "./tsconfig.esm.json"
36 | }
37 | ]
38 | }
39 |
--------------------------------------------------------------------------------
/packages/fungible-entangler/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 | dist
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # next.js
12 | /.next/
13 | /out/
14 |
15 | # production
16 | /build
17 |
18 | # misc
19 | .DS_Store
20 | *.pem
21 |
22 | # debug
23 | npm-debug.log*
24 | yarn-debug.log*
25 | yarn-error.log*
26 |
27 | # local env files
28 | .env.local
29 | .env.development.local
30 | .env.test.local
31 | .env.production.local
32 |
33 | # vercel
34 | .vercel
35 |
36 | # typescript
37 | *.tsbuildinfo
--------------------------------------------------------------------------------
/packages/fungible-entangler/src/utils.ts:
--------------------------------------------------------------------------------
1 | import { MintInfo, u64 } from "@solana/spl-token";
2 | import BN from "bn.js";
3 |
4 | export function toBN(
5 | numberOrBn: BN | number,
6 | mintOrDecimals: MintInfo | number
7 | ): BN {
8 | const decimals: number =
9 | typeof mintOrDecimals === "number"
10 | ? mintOrDecimals
11 | : (mintOrDecimals as MintInfo).decimals;
12 |
13 | if (BN.isBN(numberOrBn)) {
14 | return numberOrBn;
15 | } else {
16 | return new BN(
17 | Math.ceil(Number(numberOrBn) * Math.pow(10, decimals)).toLocaleString(
18 | "fullwide",
19 | { useGrouping: false }
20 | )
21 | );
22 | }
23 | }
24 |
25 | export function amountAsNum(amount: u64, mint: MintInfo): number {
26 | const decimals = new u64(Math.pow(10, mint.decimals).toString());
27 | const decimal = amount.mod(decimals).toNumber() / decimals.toNumber();
28 | return amount.div(decimals).toNumber() + decimal;
29 | }
30 |
31 | export function toNumber(numberOrBn: BN | number, mint: MintInfo): number {
32 | if (BN.isBN(numberOrBn)) {
33 | return amountAsNum(numberOrBn, mint);
34 | } else {
35 | return numberOrBn;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/packages/fungible-entangler/tsconfig.cjs.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.cjs.json",
3 | "include": ["src"],
4 | "compilerOptions": {
5 | "outDir": "lib/cjs"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/packages/fungible-entangler/tsconfig.esm.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.esm.json",
3 | "include": ["src"],
4 | "compilerOptions": {
5 | "outDir": "lib/esm",
6 | "declarationDir": "lib/types"
7 | }
8 | }
--------------------------------------------------------------------------------
/packages/fungible-entangler/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.root.json",
3 | "references": [
4 | {
5 | "path": "../spl-utils"
6 | },
7 | {
8 | "path": "./tsconfig.cjs.json"
9 | },
10 | {
11 | "path": "./tsconfig.esm.json"
12 | }
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/governance-cli/.env.dev:
--------------------------------------------------------------------------------
1 | PROGRAM_ID=TCo1sfSr2nCudbeJPykbif64rG9K1JNMGzrtzvPmp3y
2 | BUFFER=Bov9m9pMKhhbUoVpKX4QVjZ1qzb9ShvvGY32ttgHCoUg
3 | IDL_BUFFER=38DzpCgdyRUxacLL8f9uTAdmXWCxqmtttPwAzxxrDBax
4 | GOVERNANCE_KEY=6yc2jb7LCjYXD3hbRKjYkpx13j4VXYcCBzYsZbmntdVk
5 | NETWORK=https://devnet.genesysgo.net/
6 | WALLET=/Users/nprince/.config/solana/id.json
7 | NAME=Deploy Token Collective master
8 | DESCRIPTION=https://github.com/StrataFoundation/strata/tree/master
9 |
--------------------------------------------------------------------------------
/packages/governance-cli/.env.prod:
--------------------------------------------------------------------------------
1 | PROGRAM_ID=TCo1sfSr2nCudbeJPykbif64rG9K1JNMGzrtzvPmp3y
2 | BUFFER=4Xk75okbZhKFqDm339CNramWNCsAYnySczG5XFbthtc2
3 | IDL_BUFFER=CzqCiPCAoyoLsvGNw6veLUhVxgxSKbcN9MwhLTnqrqYR
4 | GOVERNANCE_KEY=6yc2jb7LCjYXD3hbRKjYkpx13j4VXYcCBzYsZbmntdVk
5 | NETWORK=https://ssc-dao.genesysgo.net
6 | WALLET=/Users/nprince/.config/solana/id.json
7 | NAME=Deploy Token Collective v3.5.0
8 | DESCRIPTION=https://api.github.com/repos/StrataFoundation/strata/releases/63818256
9 | SIGNATORY=
10 | CLIENT_ID=
11 | CLIENT_SECRET=
--------------------------------------------------------------------------------
/packages/governance-cli/.gitignore:
--------------------------------------------------------------------------------
1 | bin
2 | .env.local
--------------------------------------------------------------------------------
/packages/governance-cli/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@strata-foundation/governance-cli",
3 | "version": "3.11.2",
4 | "publishConfig": {
5 | "access": "public",
6 | "registry": "https://registry.npmjs.org/"
7 | },
8 | "bin": {
9 | "create-proposal": "bin/createProposal.js"
10 | },
11 | "scripts": {
12 | "start": "tsc && node bin/createProposal.js",
13 | "close-buffers": "tsc && node bin/closeBuffersProposal.js",
14 | "clean": "npx shx mkdir -p lib && npx shx rm -rf lib",
15 | "package": "npx shx mkdir -p lib/cjs lib/esm",
16 | "prebuild": "npm run clean && npm run package"
17 | },
18 | "dependencies": {
19 | "@project-serum/anchor": "^0.24.2",
20 | "@solana/spl-governance": "^0.3.13",
21 | "@solana/web3.js": "1.22.0",
22 | "@strata-foundation/spl-utils": "^3.11.2",
23 | "axios": "^0.27.2",
24 | "axois": "0.0.1-security",
25 | "borsh": "^0.7.0",
26 | "js-base64": "^3.7.2",
27 | "shelljs": "^0.8.4"
28 | },
29 | "gitHead": "ff670e6a6211209648c56dd69e5f5dfbda631b42"
30 | }
31 |
--------------------------------------------------------------------------------
/packages/governance-cli/src/createIdlUpgradeInstruction.ts:
--------------------------------------------------------------------------------
1 | import { PublicKey, TransactionInstruction } from "@solana/web3.js";
2 | import { idlAddress } from "@project-serum/anchor/dist/cjs/idl";
3 |
4 | export async function createIdlUpgradeInstruction(
5 | programId: PublicKey,
6 | bufferAddress: PublicKey,
7 | upgradeAuthority: PublicKey
8 | ) {
9 | const prefix = Buffer.from("0a69e9a778bcf440", "hex");
10 | const ixn = Buffer.from("03", "hex");
11 | const data = Buffer.concat([prefix.reverse(), ixn]);
12 | const idlAddr = await idlAddress(programId);
13 |
14 | const keys = [
15 | {
16 | pubkey: bufferAddress,
17 | isWritable: true,
18 | isSigner: false,
19 | },
20 | {
21 | pubkey: idlAddr,
22 | isWritable: true,
23 | isSigner: false,
24 | },
25 | {
26 | pubkey: upgradeAuthority,
27 | isWritable: true,
28 | isSigner: true,
29 | },
30 | ];
31 |
32 | return new TransactionInstruction({
33 | keys,
34 | programId,
35 | data,
36 | });
37 | }
38 |
--------------------------------------------------------------------------------
/packages/governance-cli/tsconfig.cjs.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.cjs.json",
3 | "include": ["src"],
4 | "compilerOptions": {
5 | "outDir": "lib/cjs"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/packages/governance-cli/tsconfig.esm.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.esm.json",
3 | "include": ["src"],
4 | "compilerOptions": {
5 | "outDir": "lib/esm"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/packages/governance-cli/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.root.json",
3 | "references": [
4 | {
5 | "path": "../spl-utils"
6 | },
7 | {
8 | "path": "./tsconfig.cjs.json"
9 | },
10 | {
11 | "path": "./tsconfig.esm.json"
12 | }
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/marketplace-sdk/.gitignore:
--------------------------------------------------------------------------------
1 | npm-debug.log
2 | dist/
3 | tmp/
4 | ./node_modules
--------------------------------------------------------------------------------
/packages/marketplace-sdk/src/bootstrap.ts:
--------------------------------------------------------------------------------
1 | import { MarketplaceSdk } from ".";
2 | import fs from "fs";
3 | import * as anchor from "@project-serum/anchor";
4 | import { Keypair } from "@solana/web3.js";
5 |
6 | async function run() {
7 | console.log(process.env.ANCHOR_PROVIDER_URL);
8 | anchor.setProvider(anchor.AnchorProvider.env());
9 | const provider = anchor.getProvider() as anchor.AnchorProvider;
10 | const curveKeypair = Keypair.fromSecretKey(new Uint8Array(JSON.parse(fs.readFileSync(process.env.CURVE_PATH!).toString())));
11 |
12 | const marketplaceSdk = await MarketplaceSdk.init(provider);
13 | if (!(await provider.connection.getAccountInfo(curveKeypair.publicKey))) {
14 | console.log("Creating curve...");
15 | const curve = await marketplaceSdk.createFixedCurve({
16 | keypair: curveKeypair,
17 | });
18 | console.log("Created curve", curve.toBase58());
19 | }
20 | }
21 |
22 |
23 | run().catch((e) => {
24 | console.error(e);
25 | process.exit(1);
26 | });
27 |
--------------------------------------------------------------------------------
/packages/marketplace-sdk/tsconfig.cjs.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.cjs.json",
3 | "include": ["src"],
4 | "compilerOptions": {
5 | "outDir": "lib/cjs"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/packages/marketplace-sdk/tsconfig.esm.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.esm.json",
3 | "include": ["src"],
4 | "compilerOptions": {
5 | "outDir": "lib/esm",
6 | "declarationDir": "lib/types"
7 | }
8 | }
--------------------------------------------------------------------------------
/packages/marketplace-sdk/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.root.json",
3 | "references": [
4 | {
5 | "path": "../fungible-entangler"
6 | },
7 | {
8 | "path": "../spl-token-bonding"
9 | },
10 | {
11 | "path": "../spl-token-collective"
12 | },
13 | {
14 | "path": "../spl-utils"
15 | },
16 | {
17 | "path": "./tsconfig.cjs.json"
18 | },
19 | {
20 | "path": "./tsconfig.esm.json"
21 | }
22 | ]
23 | }
24 |
--------------------------------------------------------------------------------
/packages/marketplace-sdk/vite.config.ts:
--------------------------------------------------------------------------------
1 | import path from "node:path";
2 | import { defineConfig } from "vite";
3 | import dts from "vite-plugin-dts";
4 | import autoExternal from "rollup-plugin-auto-external";
5 |
6 | export default defineConfig({
7 | plugins: [
8 | dts({
9 | insertTypesEntry: true,
10 | }),
11 | autoExternal()
12 | ],
13 | build: {
14 | lib: {
15 | entry: path.resolve(__dirname, "src/index.ts"),
16 | name: "MarketplaceSdk",
17 | formats: ["es", "umd"],
18 | fileName: (format) => `index.${format}.js`,
19 | },
20 | },
21 | });
22 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/.env.development:
--------------------------------------------------------------------------------
1 | NEXT_PUBLIC_SOLANA_URL="https://api.devnet.solana.com"
2 | NEXT_PUBLIC_SITE_URL="https://localhost:3000"
3 | NEXT_PUBLIC_WUMBO_IDENTITY_SERVICE_URL="http://localhost:8082"
4 | NEXT_PUBLIC_GOOGLE_ANALYTICS="G-L4QLBX3394"
5 | NEXT_PUBLIC_ISSUER=https://auth.genesysgo.net/auth/realms/RPCs/protocol/openid-connect
6 | NEXT_PUBLIC_CLIENT_ID=
7 | NEXT_PUBLIC_CLIENT_SECRET=
8 | NEXT_PUBLIC_DOCS_URL=http://localhost:3001/docs
9 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/.env.production:
--------------------------------------------------------------------------------
1 | NEXT_PUBLIC_SITE_URL=https://app.strataprotocol.com
2 | NEXT_PUBLIC_WUMBO_IDENTITY_SERVICE_URL=https://prod-identity.teamwumbo.com
3 | NEXT_PUBLIC_GOOGLE_ANALYTICS=G-L4QLBX3394
4 | NEXT_PUBLIC_ISSUER=https://auth.genesysgo.net/auth/realms/RPCs/protocol/openid-connect
5 | NEXT_PUBLIC_CLIENT_ID=
6 | NEXT_PUBLIC_CLIENT_SECRET=
7 | NEXT_PUBLIC_DOCS_URL=https://docs.strataprotocol.com
8 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "next/core-web-vitals"
3 | }
4 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 | dist
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # next.js
12 | /.next/
13 | /out/
14 |
15 | # production
16 | /build
17 |
18 | # misc
19 | .DS_Store
20 | *.pem
21 |
22 | # debug
23 | npm-debug.log*
24 | yarn-debug.log*
25 | yarn-error.log*
26 |
27 | # local env files
28 | .env.local
29 | .env.development.local
30 | .env.test.local
31 | .env.production.local
32 |
33 | # vercel
34 | .vercel
35 |
36 | # typescript
37 | *.tsbuildinfo
38 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/README.md:
--------------------------------------------------------------------------------
1 | # `@strata-foundation/marketplace-ui`
2 |
3 | Docs at https://strataprotocol.com
4 |
5 | This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
6 |
7 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/next-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 |
4 | // NOTE: This file should not be edited
5 | // see https://nextjs.org/docs/basic-features/typescript for more information.
6 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/next-seo.config.js:
--------------------------------------------------------------------------------
1 | import { SITE_URL } from "./src/constants";
2 |
3 | const defaultSeo = {
4 | title: "Strata Launchpad",
5 | description:
6 | "Strata Launchpad enables anyone to launch a token around a person, idea, or collective in minutes",
7 | openGraph: {
8 | url: SITE_URL,
9 | title: "Strata Launchpad",
10 | description:
11 | "Launch a token around a person, project, idea, or collective in minutes",
12 | images: [
13 | {
14 | url: `${SITE_URL}/seoDefaultCardImage.jpg`,
15 | width: 800,
16 | height: 600,
17 | alt: "Og Image Alt",
18 | type: "image/jpeg",
19 | },
20 | ],
21 | site_name: "StrataLaunchpad",
22 | },
23 | twitter: {
24 | handle: "@StrataProtocol",
25 | site: SITE_URL,
26 | cardType: "summary_large_image",
27 | },
28 | };
29 |
30 | export default defaultSeo;
31 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/pages/api/validate-token.ts:
--------------------------------------------------------------------------------
1 | // Next.js API route support: https://nextjs.org/docs/api-routes/introduction
2 | import type { NextApiRequest, NextApiResponse } from "next";
3 | import axios from "axios";
4 |
5 | export default async function handler(
6 | req: NextApiRequest,
7 | res: NextApiResponse
8 | ) {
9 | try {
10 | const tokenResponse = await axios.post(
11 | `${process.env.ISSUER}/userinfo`,
12 | {},
13 | {
14 | headers: {
15 | authorization: `Bearer ${req.body.access_token}`,
16 | },
17 | }
18 | );
19 | res.status(200).json({ tokenResponse });
20 | } catch (e) {
21 | res.status(401).json(e);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/pages/bounties/[mintKey]/edit.tsx:
--------------------------------------------------------------------------------
1 | import { EditBountyForm } from "../../../src/components/form/EditBountyForm";
2 | import { FormContainer } from "../../../src/components/FormContainer";
3 | import { routes, route } from "../../../src/utils/routes";
4 | import { usePublicKey } from "@strata-foundation/react";
5 | import { NextPage } from "next";
6 | import { useRouter } from "next/router";
7 |
8 | export const EditBounty: NextPage = () => {
9 | const router = useRouter();
10 | const { mintKey: mintKeyRaw } = router.query;
11 | const mintKey = usePublicKey(mintKeyRaw as string);
12 |
13 | return (
14 |
15 | {mintKey && (
16 | {
19 | router.push(
20 | route(routes.bounty, { mintKey: mintKey.toBase58() }),
21 | undefined,
22 | { shallow: true }
23 | );
24 | }}
25 | />
26 | )}
27 |
28 | );
29 | };
30 |
31 | export default EditBounty;
32 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/pages/edit-metadata/index.tsx:
--------------------------------------------------------------------------------
1 | import { EditMetadataForm } from "../../src/components/form/EditMetadataForm";
2 | import { FormContainer } from "../../src/components/FormContainer";
3 | import { route, routes } from "../../src/utils/routes";
4 | import { NextPage } from "next";
5 | import { useRouter } from "next/router";
6 |
7 | export const EditMetadata: NextPage = () => {
8 | const router = useRouter();
9 | return (
10 |
11 | {
15 | router.push(
16 | route(routes.sell, { mint: mintKey.toBase58() }),
17 | undefined,
18 | { shallow: true }
19 | );
20 | }}
21 | />
22 |
23 | );
24 | };
25 |
26 | export default EditMetadata;
27 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/pages/index.tsx:
--------------------------------------------------------------------------------
1 | import { Container } from '@chakra-ui/react';
2 | import type { NextPage } from 'next';
3 | import Head from 'next/head';
4 | import React from 'react';
5 | import { FixedPriceForm } from '../src/components/form/FixedPriceForm';
6 |
7 | const Home: NextPage = () => {
8 | return (
9 |
10 |
11 |
Strata Marketplace
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | );
23 | };
24 |
25 | export default Home;
26 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/pages/launchpad/admin/[mintKey]/index.tsx:
--------------------------------------------------------------------------------
1 | import { NextPage } from "next";
2 | import { TokenAdmin } from "../../../../src/components/admin/TokenAdmin";
3 |
4 | export const TokenAdminPage: NextPage = () => {
5 | return (
6 |
7 | );
8 | };
9 |
10 | export default TokenAdminPage;
--------------------------------------------------------------------------------
/packages/marketplace-ui/pages/launchpad/bounties/new.tsx:
--------------------------------------------------------------------------------
1 | import { BountyForm } from "../../../src/components/form/BountyForm";
2 | import { FormContainer } from "../../../src/components/FormContainer";
3 | import { routes, route } from "../../../src/utils/routes";
4 | import { NextPage } from "next";
5 | import { useRouter } from "next/router";
6 |
7 | export const NewBounty: NextPage = () => {
8 | const router = useRouter();
9 | return (
10 |
11 | {
13 | router.push(
14 | route(routes.bounty, { mintKey: mintKey.toBase58() }),
15 | undefined,
16 | { shallow: true }
17 | );
18 | }}
19 | />
20 |
21 | );
22 | };
23 |
24 | export default NewBounty;
25 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/pages/launchpad/fixed-price/new.tsx:
--------------------------------------------------------------------------------
1 | import { FixedPriceForm } from "../../../src/components/form/FixedPriceForm";
2 | import { FormContainer } from "../../../src/components/FormContainer";
3 | import { NextPage } from "next";
4 |
5 | export const NewSale: NextPage = () => {
6 | return (
7 |
8 |
9 |
10 | );
11 | };
12 |
13 | export default NewSale;
14 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/pages/launchpad/fully-managed/new.tsx:
--------------------------------------------------------------------------------
1 | import { FullyManagedForm } from "../../../src/components/form/FullyManagedForm";
2 | import { FormContainer } from "../../../src/components/FormContainer";
3 | import { NextPage } from "next";
4 |
5 | export const NewFullymanaged: NextPage = () => {
6 | return (
7 |
8 |
9 |
10 | );
11 | };
12 |
13 | export default NewFullymanaged;
14 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/pages/launchpad/lbcs/new.tsx:
--------------------------------------------------------------------------------
1 | import { FormContainer } from "../../../src/components/FormContainer";
2 | import { NextPage } from "next";
3 | import { LbcForm } from "../../../src/components/form/LbcForm";
4 |
5 | export const NewLBC: NextPage = () => {
6 | return (
7 |
8 |
9 |
10 | );
11 | };
12 |
13 | export default NewLBC;
14 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/pages/launchpad/manual/new.tsx:
--------------------------------------------------------------------------------
1 | import { ManualForm } from "../../../src/components/form/ManualForm";
2 | import { FormContainer } from "../../../src/components/FormContainer";
3 | import { NextPage } from "next";
4 |
5 | export const NewFullymanaged: NextPage = () => {
6 | return (
7 |
8 |
9 |
10 | );
11 | };
12 |
13 | export default NewFullymanaged;
14 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/pages/launchpad/metadata.tsx:
--------------------------------------------------------------------------------
1 | import React, { FC } from "react";
2 | import { useRouter } from "next/router";
3 | import { LaunchpadLayout } from "../../src/components/launchpad";
4 |
5 | export const Metadata: FC = () => {
6 | const router = useRouter();
7 | //@ts-ignore
8 | const handleOnNext = async () => {
9 | //@ts-ignore
10 | alert(`Submit form and get mintKey for redirecting here`);
11 | router.push("/launchpad/sell-options");
12 | };
13 |
14 | return (
15 |
22 | Metadata ShortForm Here
23 |
24 | );
25 | };
26 |
27 | export default Metadata;
28 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/pages/launchpad/mytokens.tsx:
--------------------------------------------------------------------------------
1 | import React, { useState } from 'react';
2 | import { MyTokens } from "../../src/components/MyTokens";
3 |
4 |
5 | const MyTokensPage = () => {
6 | return (
7 |
8 | )
9 | };
10 |
11 | export default MyTokensPage;
--------------------------------------------------------------------------------
/packages/marketplace-ui/public/aggressive.svg:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/public/arweave.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/marketplace-ui/public/arweave.png
--------------------------------------------------------------------------------
/packages/marketplace-ui/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/marketplace-ui/public/favicon.ico
--------------------------------------------------------------------------------
/packages/marketplace-ui/public/nft-storage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/marketplace-ui/public/nft-storage.png
--------------------------------------------------------------------------------
/packages/marketplace-ui/public/sell-token-now.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/public/seoDefaultCardImage.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/marketplace-ui/public/seoDefaultCardImage.jpg
--------------------------------------------------------------------------------
/packages/marketplace-ui/public/stable.svg:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/public/swap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrataFoundation/strata/d7f5dc684659d5be8bfda48fffba60403c57e114/packages/marketplace-ui/public/swap.png
--------------------------------------------------------------------------------
/packages/marketplace-ui/public/utility.svg:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/src/components/AsyncButton.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { ButtonProps, Button } from "@chakra-ui/react";
3 | import { useErrorHandler, useProvider } from "@strata-foundation/react";
4 | import { useAsyncCallback } from "react-async-hook";
5 |
6 | export type AsyncButtonProps = {
7 | children: React.ReactNode;
8 | action: () => Promise | undefined;
9 | } & ButtonProps;
10 |
11 | export const AsyncButton = ({
12 | action,
13 | children,
14 | ...props
15 | }: AsyncButtonProps) => {
16 | const { awaitingApproval } = useProvider();
17 | const { execute, loading, error } = useAsyncCallback(action);
18 | const { handleErrors } = useErrorHandler();
19 |
20 | handleErrors(error);
21 |
22 | return (
23 |
31 | );
32 | };
33 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/src/components/FormContainer.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Box, Container, Heading } from "@chakra-ui/react";
3 |
4 | export const FormContainer = ({
5 | children,
6 | title,
7 | }: {
8 | children: React.ReactNode;
9 | title: string;
10 | }) => {
11 | return (
12 |
13 |
14 |
15 | {title}
16 |
17 |
18 | {/* @ts-ignore */}
19 | {children}
20 |
21 |
22 |
23 | );
24 | };
25 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/src/components/MarketplaceProviders.tsx:
--------------------------------------------------------------------------------
1 | import { GraphqlProvider, StrataProviders } from "@strata-foundation/react";
2 | import React, { FC } from "react";
3 | import { MarketplaceSdkProvider } from "../contexts";
4 |
5 | const defaultOnError = (error: Error) => console.log(error);
6 | export const MarketplaceProviders: FC void;
8 | resetCSS?: boolean;
9 | }>> = ({ children, onError = defaultOnError, resetCSS = false }) => (
10 |
11 |
12 | {children}
13 |
14 |
15 | );
16 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/src/components/MetadataMeta.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { NextSeo } from "next-seo";
3 | import { SITE_URL } from "../constants";
4 |
5 | export const MetadataMeta = ({
6 | title,
7 | description,
8 | image,
9 | cardType = "summary",
10 | url,
11 | }: {
12 | title: string;
13 | description: string;
14 | image: string;
15 | cardType?: string;
16 | url: string;
17 | }) => {
18 | return (
19 |
35 | );
36 | };
37 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/src/components/ThemeProvider.tsx:
--------------------------------------------------------------------------------
1 | import React, { FC } from "react";
2 | import {
3 | ChakraProvider, CSSReset
4 | } from "@chakra-ui/react";
5 | import { theme } from "@strata-foundation/react";
6 |
7 | export const ThemeProvider: FC> = ({ children }) => (
8 |
9 | {/* @ts-ignore */}
10 | {children}
11 |
12 | );
13 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/src/components/bounties/BountyCardContribution.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { HStack, VStack, Text, Spinner } from "@chakra-ui/react";
3 | import { roundToDecimals } from "@strata-foundation/react";
4 | import { numberWithCommas } from "../../utils/numberWithCommas";
5 |
6 | export const BountyCardContribution = ({
7 | amount,
8 | symbol,
9 | text = "Contributed",
10 | }: {
11 | amount: number | undefined;
12 | symbol: string | undefined;
13 | text?: string;
14 | }) => {
15 | return (
16 |
23 |
24 |
25 | {typeof amount != "undefined" ? (
26 | numberWithCommas(roundToDecimals(amount, 4))
27 | ) : (
28 |
29 | )}
30 |
31 | {symbol}
32 |
33 | {text}
34 |
35 | );
36 | };
37 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/src/components/bounties/BountyList.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { StackDivider, VStack } from "@chakra-ui/react";
3 |
4 | export const BountyList: React.FC> = ({ children }) => {
5 | return (
6 | }
12 | >
13 | {/* @ts-ignore */}
14 | {children}
15 |
16 | );
17 | };
18 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/src/components/bounties/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./BountyCard";
2 | export * from "./BountyCardContribution";
3 | export * from "./BountyDetail";
4 | export * from "./BountyList";
5 | export * from "./MintSelectModal";
6 | export * from "./TopHolders";
7 | export * from "./AuthorityAndTokenInfo";
8 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/src/components/bufferFill.ts:
--------------------------------------------------------------------------------
1 | import { Buffer } from "buffer";
2 |
3 | // @ts-ignore
4 | if (typeof window != "undefined") {
5 | //@ts-ignore
6 | window.Buffer = Buffer;
7 | }
8 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/src/components/form/Disclosures.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Checkbox, VStack } from "@chakra-ui/react";
3 | import { useFormContext } from "react-hook-form";
4 | import * as yup from "yup";
5 |
6 | export interface IDisclosures {
7 | notASecurity: boolean;
8 | }
9 |
10 | export const disclosuresSchema = yup.object({
11 | notASecurity: yup.boolean().required().isTrue(),
12 | });
13 |
14 | export const Disclosures = ({ fees }: { fees: number }) => {
15 | const {
16 | register,
17 | formState: { errors },
18 | } = useFormContext<{ disclosures: IDisclosures }>();
19 |
20 | return (
21 |
22 |
26 | I represent that I have undertaken sufficient legal analysis to
27 | determine that the token does not constitute a security under U.S. law.
28 |
29 |
30 | );
31 | };
32 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/src/components/form/FormControlWithError.tsx:
--------------------------------------------------------------------------------
1 | import { FormLabel, FormControl, FormHelperText } from "@chakra-ui/react";
2 | import React from "react";
3 |
4 | export interface IFormControlWithErrorProps {
5 | children: React.ReactNode;
6 | errors: any;
7 | id: string;
8 | help?: string;
9 | label?: string;
10 | }
11 | export function FormControlWithError({
12 | id,
13 | label,
14 | help,
15 | children,
16 | errors,
17 | ...rest
18 | }: IFormControlWithErrorProps) {
19 | return (
20 |
21 | {label && {label}}
22 | {children}
23 | {(errors[id] || help) && (
24 |
25 | {errors[id]?.message || help}
26 |
27 | )}
28 |
29 | );
30 | }
31 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/src/components/form/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./BountyForm";
2 | export * from "./EditBountyForm";
3 | export * from "./FormControlWithError";
4 | export * from "./MintSelect";
5 | export * from "./Recipient";
6 | export * from "./FixedPriceForm";
7 | export * from "./ManualForm";
8 | export * from "./FullyManagedForm";
9 | export * from "./TokenMetadataInputs";
10 | export * from "./RadioCard";
11 | export * from "./EditMetadataForm";
12 | export * from "./RoyaltiesInputs";
13 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/src/components/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./bounties";
2 | export * from "./form";
3 | export * from "./sales";
4 | export * from "./BurnButton";
5 | export * from "./Footer";
6 | export * from "./FormContainer";
7 | export * from "./Header";
8 | export * from "./MetadataMeta";
9 | export * from "./Providers";
10 | export * from "./TwitterLink";
11 | export * from "./Wallet";
12 | export * from "./WalletModalButton";
13 | export * from "./AsyncButton";
14 | export * from "./lbc";
15 | export * from "./DisburseFunds";
16 | export * from "./MarketplaceProviders";
17 | export * from "./svgs";
18 | export * from "./Disclaimer";
19 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/src/components/launchpad/index.tsx:
--------------------------------------------------------------------------------
1 | export * from "./LaunchpadLayout";
2 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/src/components/lbc/Branding.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | Text,
3 | Link,
4 | Image,
5 | HStack,
6 | VStack,
7 | Icon,
8 | useColorModeValue,
9 | } from "@chakra-ui/react";
10 | import React from "react";
11 | import { StrataIcon, MetaplexIcon } from "../svgs"
12 |
13 | export const Branding = () => (
14 |
15 |
16 | Powered By
17 |
18 |
19 |
20 |
26 |
27 |
28 |
33 |
34 |
35 |
36 | );
37 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/src/components/lbc/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./BondingPlot";
2 | export * from "./LbcInfo";
3 | export * from "./MintButton";
4 | export * from "./Branding";
5 | export * from "./LbcStatus";
6 | export * from "./mint";
7 | export * from "./TransactionHistory";
8 | export * from "./Lbc";
9 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/src/components/lbc/mint/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./candy-machine";
2 | export * from "./MintedNftNotification";
3 | export * from "./utils";
4 | export * from "./CandyMachineInfo";
5 | export * from "./DynamicPricingCandyMachine";
6 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/src/components/sales/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./SaleItem";
2 | export * from "./SaleItemAdmin";
3 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/src/components/svgs/index.tsx:
--------------------------------------------------------------------------------
1 | export * from "./metaplex";
2 | export * from "./strata";
3 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/src/constants/index.ts:
--------------------------------------------------------------------------------
1 | export const SOLANA_URL =
2 | process.env.NEXT_PUBLIC_SOLANA_URL || "https://devnet.genesysgo.net/";
3 |
4 | export const NFT_STORAGE_API_KEY = process.env.NEXT_PUBLIC_NFT_STORAGE_API_KEY;
5 |
6 | export const SITE_URL =
7 | process.env.NEXT_PUBLIC_SITE_URL || "https://localhost:3000";
8 |
9 | export const WUMBO_IDENTITY_SERVICE_URL =
10 | process.env.NEXT_PUBLIC_WUMBO_IDENTITY_SERVICE_URL || "http://localhost:8082";
11 |
12 | export const GA_TRACKING_ID =
13 | process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS || "G-L4QLBX3394";
14 |
15 | export const IS_PRODUCTION = process.env.NODE_ENV === "production";
16 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/src/contexts/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./marketplaceSdkContext";
2 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/src/hooks/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./useBounties";
2 | export * from "./useTransactions";
3 | export * from "./useLinkTwitter";
4 | export * from "./useLivePrice";
5 | export * from "./useIsBountyAdmin";
6 | export * from "./useBountyInfo";
7 | export * from "./useCandyMachineInfo";
8 | export * from "./useCandyMachine";
9 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/src/hooks/useLivePrice.ts:
--------------------------------------------------------------------------------
1 | import { PublicKey } from "@solana/web3.js";
2 | import { useBondingPricing, useInterval, useSolanaUnixTime } from "@strata-foundation/react";
3 | import { useEffect, useState } from "react";
4 |
5 | export function useLivePrice(tokenBondingKey: PublicKey | undefined) {
6 | const { pricing, loading } =
7 | useBondingPricing(tokenBondingKey);
8 |
9 | const [currentPrice, setCurrentPrice] = useState();
10 | const unixTime = useSolanaUnixTime();
11 | useEffect(() => {
12 | if (pricing) {
13 | setCurrentPrice(
14 | pricing.current(pricing.hierarchy.tokenBonding.baseMint, unixTime)
15 | );
16 | }
17 | }, [unixTime, pricing]);
18 |
19 | return {
20 | loading,
21 | price: currentPrice,
22 | };
23 | }
24 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./components";
2 | export * from "./hooks";
3 | export * from "./utils";
4 | export * from "./contexts";
--------------------------------------------------------------------------------
/packages/marketplace-ui/src/utils/gtag.ts:
--------------------------------------------------------------------------------
1 | import { GA_TRACKING_ID } from "../constants";
2 |
3 | // https://developers.google.com/analytics/devguides/collection/gtagjs/pages
4 | export const pageview = (url: URL): void => {
5 | //@ts-ignore
6 | window.gtag("config", GA_TRACKING_ID, {
7 | page_path: url,
8 | });
9 | };
10 |
11 | type GTagEvent = {
12 | action: string;
13 | category: string;
14 | label: string;
15 | value: number;
16 | };
17 |
18 | // https://developers.google.com/analytics/devguides/collection/gtagjs/events
19 | export const event = ({ action, category, label, value }: GTagEvent): void => {
20 | //@ts-ignore
21 | window.gtag("event", action, {
22 | event_category: category,
23 | event_label: label,
24 | value,
25 | });
26 | };
27 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/src/utils/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./numberWithCommas";
2 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/src/utils/initMiddleware.ts:
--------------------------------------------------------------------------------
1 | // Helper method to wait for a middleware to execute before continuing
2 | // And to throw an error when an error happens in a middleware
3 | export default function initMiddleware(middleware: any) {
4 | return (req: any, res: any) =>
5 | new Promise((resolve, reject) => {
6 | middleware(req, res, (result: any) => {
7 | if (result instanceof Error) {
8 | return reject(result);
9 | }
10 | return resolve(result);
11 | });
12 | });
13 | }
14 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/src/utils/numberWithCommas.tsx:
--------------------------------------------------------------------------------
1 | import { roundToDecimals } from "@strata-foundation/react";
2 |
3 | export function numberWithCommas(x: number, decimals: number = 4): string {
4 | return roundToDecimals(x, decimals).toLocaleString("en-US", {
5 | maximumFractionDigits: decimals
6 | });
7 | }
8 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/src/utils/tokenMetadataServerProps.ts:
--------------------------------------------------------------------------------
1 | import { GetServerSideProps } from "next";
2 |
3 | export const mintMetadataServerSideProps: GetServerSideProps = async (
4 | ) => {
5 | return {
6 | props: {
7 | name: null,
8 | description: null,
9 | image: null,
10 | },
11 | };
12 | };
13 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/styles/globals.css:
--------------------------------------------------------------------------------
1 | html,
2 | body {
3 | padding: 0;
4 | margin: 0;
5 | font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
6 | Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
7 | }
8 |
9 | a {
10 | color: inherit;
11 | text-decoration: none;
12 | }
13 |
14 | * {
15 | box-sizing: border-box;
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/tsconfig.cjs.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.cjs.json",
3 | "include": ["src"],
4 | "compilerOptions": {
5 | "outDir": "lib/cjs",
6 | "jsx": "react"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/tsconfig.esm.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.esm.json",
3 | "include": ["src"],
4 | "compilerOptions": {
5 | "outDir": "lib/esm",
6 | "declarationDir": "lib/types",
7 | "jsx": "react"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/packages/marketplace-ui/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.root.json",
3 | "references": [
4 | {
5 | "path": "../fungible-entangler"
6 | },
7 | {
8 | "path": "../marketplace-sdk"
9 | },
10 | {
11 | "path": "../react"
12 | },
13 | {
14 | "path": "../spl-token-bonding"
15 | },
16 | {
17 | "path": "../spl-token-collective"
18 | },
19 | {
20 | "path": "../spl-utils"
21 | },
22 | {
23 | "path": "./tsconfig.cjs.json"
24 | },
25 | {
26 | "path": "./tsconfig.esm.json"
27 | }
28 | ],
29 | "compilerOptions": {
30 | "allowJs": true,
31 | "forceConsistentCasingInFileNames": true,
32 | "noEmit": true,
33 | "incremental": true,
34 | "jsx": "preserve"
35 | },
36 | "exclude": [
37 | "node_modules"
38 | ]
39 | }
40 |
--------------------------------------------------------------------------------
/packages/react/.gitignore:
--------------------------------------------------------------------------------
1 | npm-debug.log
2 | dist/
3 | tmp/
4 | ./node_modules
5 | yarn-error.log
--------------------------------------------------------------------------------
/packages/react/src/bufferFill.ts:
--------------------------------------------------------------------------------
1 | import { Buffer } from "buffer";
2 |
3 | if (typeof window !== "undefined") {
4 | //@ts-ignore
5 | window.Buffer = Buffer;
6 | } else {
7 | global.Buffer = Buffer;
8 | }
9 |
--------------------------------------------------------------------------------
/packages/react/src/components/Spinner.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Flex, Spinner as ChakraSpinner, SpinnerProps } from "@chakra-ui/react";
3 |
4 | export const Spinner = ({
5 | size = "lg",
6 | thickness = "2px",
7 | emptyColor = "gray.400",
8 | color = "gray.700",
9 | speed = "0.65s",
10 | ...props
11 | }: SpinnerProps) => (
12 |
13 |
21 |
22 | );
23 |
--------------------------------------------------------------------------------
/packages/react/src/components/StrataProviders.tsx:
--------------------------------------------------------------------------------
1 | import React, { FC } from "react";
2 | import { AccountProvider } from "../contexts/accountContext";
3 | import { ErrorHandlerProvider } from "../contexts/errorHandlerContext";
4 | import { ProviderContextProvider } from "../contexts/providerContext";
5 | import { StrataSdksProvider } from "../contexts/strataSdkContext";
6 | import { ThemeProvider } from "../contexts/theme";
7 |
8 | const defaultOnError = (error: Error) => console.log(error);
9 | export const StrataProviders: FC void;
11 | resetCSS?: boolean;
12 | }>> = ({
13 | children,
14 | onError = defaultOnError,
15 | resetCSS = false,
16 | }) => (
17 |
18 |
19 |
20 |
21 |
22 | {children}
23 |
24 |
25 |
26 |
27 |
28 | );
29 |
--------------------------------------------------------------------------------
/packages/react/src/components/Swap/TransactionInfo.tsx:
--------------------------------------------------------------------------------
1 | import { Text, Flex, HStack, Icon, Tooltip } from "@chakra-ui/react";
2 | import React from "react";
3 | import { RiInformationLine } from "react-icons/ri";
4 |
5 | export type TransactionInfoArgs = {
6 | name: string;
7 | tooltip: string;
8 | amount: string;
9 | formRef: React.MutableRefObject;
10 | };
11 |
12 | export const TransactionInfo = ({
13 | name,
14 | tooltip,
15 | amount,
16 | formRef,
17 | }: TransactionInfoArgs) => {
18 | return (
19 |
20 |
21 | {name}
22 |
27 |
28 |
34 |
35 |
36 |
37 | {amount}
38 |
39 | );
40 | };
41 |
--------------------------------------------------------------------------------
/packages/react/src/constants/globals.ts:
--------------------------------------------------------------------------------
1 | export const DEFAULT_COMMITMENT = "confirmed";
2 |
--------------------------------------------------------------------------------
/packages/react/src/contexts/HolaplexGraphqlProvider.tsx:
--------------------------------------------------------------------------------
1 | import { ApolloClient, ApolloProvider, InMemoryCache } from "@apollo/client";
2 | import React from "react";
3 |
4 | const client = new ApolloClient({
5 | uri: "https://graph.holaplex.com/v1",
6 | cache: new InMemoryCache({
7 | resultCaching: false,
8 | }),
9 | });
10 |
11 | export const HolaplexGraphqlProvider = ({
12 | children,
13 | }: {
14 | children: React.ReactNode;
15 | }) => {
16 | //@ts-ignore
17 | return {children};
18 | };
19 |
--------------------------------------------------------------------------------
/packages/react/src/contexts/solPrice.tsx:
--------------------------------------------------------------------------------
1 | import React, { FC, ReactNode, createContext } from "react";
2 | import { PublicKey } from "@solana/web3.js";
3 | import { useCoinGeckoPrice } from "../hooks/useCoinGeckoPrice";
4 | import { useMarketPrice } from "../hooks/useMarketPrice";
5 |
6 | export interface ISolPriceProviderProps {
7 | children: ReactNode;
8 | }
9 |
10 | export const SolPriceContext = createContext(undefined);
11 |
12 | const SOL_TO_USD_MARKET = new PublicKey(
13 | "9wFFyRfZBsuAha4YcuxcXLKwMxJR43S7fPfQLusDBzvT"
14 | );
15 |
16 | export const SolPriceProvider: FC = ({ children }) => {
17 | const coinGeckoPrice = useCoinGeckoPrice();
18 | const marketPrice = useMarketPrice(SOL_TO_USD_MARKET);
19 |
20 | return (
21 |
22 | {children}
23 |
24 | );
25 | };
26 |
--------------------------------------------------------------------------------
/packages/react/src/contexts/tokenList.tsx:
--------------------------------------------------------------------------------
1 | import { TokenListProvider as Provider, TokenInfo, ENV } from "@solana/spl-token-registry";
2 | import React, { useEffect, useState } from "react";
3 |
4 | export const TokenListContext = React.createContext<
5 | Map | undefined
6 | >(undefined);
7 |
8 | export const TokenListProvider: React.FC> = ({ children }) => {
9 | const [tokenMap, setTokenMap] = useState