Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Commit

Permalink
0.6.0 Release (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
obstropolos committed Apr 19, 2021
1 parent 9f8b418 commit cfa6b8e
Show file tree
Hide file tree
Showing 45 changed files with 1,767 additions and 2,810 deletions.
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
"@emotion/react": "11.1.4",
"@emotion/styled": "11.0.0",
"@reduxjs/toolkit": "1.5.0",
"@taquito/beacon-wallet": "8.0.6-beta.0",
"@taquito/signer": "8.0.6-beta.0",
"@taquito/taquito": "8.0.6-beta.0",
"@taquito/tzip16": "8.0.6-beta.0",
"@taquito/tzip12": "8.0.6-beta.0",
"@taquito/beacon-wallet": "8.1.0",
"@taquito/signer": "8.1.0",
"@taquito/taquito": "8.1.0",
"@taquito/tzip16": "8.1.0",
"@taquito/tzip12": "8.1.0",
"@tqtezos/minter-contracts": "1.0.3",
"@types/lodash": "4.14.165",
"@types/react": "16.9.12",
"@types/react-dom": "16.9.0",
Expand Down
6 changes: 3 additions & 3 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
name="OpenMinter"
content="Create NFTs on Tezos"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
Expand Down
Binary file added public/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/logo192.png
Binary file not shown.
62 changes: 20 additions & 42 deletions scripts/bootstrap-contracts-config.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,14 @@
import fs from 'fs';
import path from 'path';
import { $log } from '@tsed/logger';
import axios from 'axios';
import retry from 'async-retry';
import Configstore from 'configstore';
import { MichelsonMap, TezosToolkit } from '@taquito/taquito';
import { InMemorySigner } from '@taquito/signer';

interface BoostrapStorageCallback {
(): object;
}

interface BootstrapContractParams {
configKey: string;
contractFilename: string;
contractGitHash: string;
contractAlias: string;
initStorage: BoostrapStorageCallback;
}

interface ContractCodeResponse {
code: string;
url: string;
}
import {
Fa2MultiNftFaucetCode,
FixedPriceSaleMarketTezCode
} from '@tqtezos/minter-contracts';

function toHexString(input: string) {
return Buffer.from(input).toString('hex');
Expand Down Expand Up @@ -63,16 +49,6 @@ async function getContractAddress(
.catch(() => '');
}

async function fetchContractCode(
contractFilename: string,
contractGitHash: string
): Promise<ContractCodeResponse> {
const rawRepoUrl = 'https://raw.githubusercontent.com/tqtezos/minter-sdk';
const contractCodeUrl = `${rawRepoUrl}/${contractGitHash}/contracts/bin/${contractFilename}`;
const response = await axios.get(contractCodeUrl);
return { code: response.data, url: contractCodeUrl };
}

async function waitForNetwork(toolkit: TezosToolkit): Promise<void> {
await retry(async () => await toolkit.rpc.getBlockHeader({ block: '2' }), {
retries: 8
Expand Down Expand Up @@ -115,6 +91,17 @@ function readEnv(): string {
return env;
}

interface BoostrapStorageCallback {
(): object;
}

interface BootstrapContractParams {
configKey: string;
contractAlias: string;
contractCode: object[];
initStorage: BoostrapStorageCallback;
}

async function bootstrapContract(
config: Configstore,
toolkit: TezosToolkit,
Expand All @@ -130,18 +117,11 @@ async function bootstrapContract(

let contract;
try {
const { code, url: contractCodeUrl } = await fetchContractCode(
params.contractFilename,
params.contractGitHash
);

$log.info(
`Originating ${params.contractAlias} contract from ${contractCodeUrl} ...`
);
$log.info(`Originating ${params.contractAlias} contract...`);

const storage = params.initStorage();
const origOp = await toolkit.contract.originate({
code: code,
code: params.contractCode,
storage: storage
});

Expand Down Expand Up @@ -176,18 +156,16 @@ async function bootstrap(env: string) {
await bootstrapContract(bootstrappedConfig, toolkit, {
configKey: 'contracts.nftFaucet',
contractAlias: 'nftFaucet',
contractFilename: 'fa2_multi_nft_faucet.tz',
contractGitHash: 'aec441412d53653fa0048fee7c12c1eb1365909b',
contractCode: Fa2MultiNftFaucetCode.code,
initStorage: initStorageNftFaucet
});

// bootstrap marketplace fixed price (tez)
await bootstrapContract(bootstrappedConfig, toolkit, {
configKey: 'contracts.marketplace.fixedPrice.tez',
contractAlias: 'fixedPriceMarketTez',
contractFilename: 'fixed_price_sale_market_tez.tz',
contractGitHash: '8f67bb8c2abc12b8e6f8e529e1412262972deab3',
initStorage: () => new MichelsonMap()
contractCode: FixedPriceSaleMarketTezCode.code,
initStorage: () => ({ sales: new MichelsonMap() })
});
}

Expand Down
17 changes: 15 additions & 2 deletions src/components/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,28 @@ import { Switch, Route } from 'wouter';
import SplashPage from '../SplashPage';
import CreateNonFungiblePage from '../CreateNonFungiblePage';
import CollectionsCatalog from '../Collections/Catalog';
import CollectionDisplay from '../Collections/Catalog/CollectionDisplay';
import CollectionsTokenDetail from '../Collections/TokenDetail';
import MarketplaceCatalog from '../Marketplace/Catalog';
import Header from '../common/Header';
import { Flex } from '@chakra-ui/react';
import Notifications from '../common/Notifications';
import { useSelector, useDispatch } from '../../reducer';
import { reconnectWallet } from '../../reducer/async/wallet';
import { getMarketplaceNftsQuery } from '../../reducer/async/queries';

export default function App() {
const dispatch = useDispatch();
const walletReconnectAttempted = useSelector(
s => s.system.walletReconnectAttempted
const state = useSelector(
s => s
);

let walletReconnectAttempted = state.system.walletReconnectAttempted

useEffect(() => {
dispatch(getMarketplaceNftsQuery(state.marketplace.marketplace.address));
}, [ state.marketplace.marketplace.address, dispatch ]);

useEffect(() => {
if (!walletReconnectAttempted) {
dispatch(reconnectWallet());
Expand Down Expand Up @@ -44,6 +52,11 @@ export default function App() {
<Route path="/marketplace">
<MarketplaceCatalog />
</Route>
<Route path="/collection/:contractAddress">
{({ contractAddress }) => (
<CollectionDisplay address={contractAddress} ownedOnly={false} />
)}
</Route>
<Route path="/collection/:contractAddress/token/:tokenId">
{({ contractAddress, tokenId }) => (
<CollectionsTokenDetail
Expand Down
Loading

0 comments on commit cfa6b8e

Please sign in to comment.