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

Commit c83f99c

Browse files
lambdahandsemmanueldenloyemycodecraftingGregory Rocco
authored
v0.2.0 (#202)
* populate tzip-16 contract data when contracts are originated The spec only requires that the 'description' and 'interfaces' fields to be defined IIRC * Remove update operators from market contract This should resolve issue #130 * remove dead code * Update metadata definition given Eugene's comments * replaced nested code with async/await syntax * feat: Update client/package.json version, use in splash page * take out nested try/catch block * remove more dead code * form JSON correctly * update faucet storage in contracts/src/nft-contracts-tzip16.ts * move example metadata definition from ligo to typescript * feat: Scaffold notifications, file upload as thunk * update contracts given Michael/Eli's suggestions (will update tests) * modify tests to reflect changes in contract's entrypoints * feat: Upload artifact files on token creation submit * more cleanup as per Michael's comments * take out tzip12 contracts and related files/tests * take out old contracts in `contracts/bin` * combine market_case_1.ts/market_case_1.test.ts -> nft_market.test.ts also put some important code into beforeEach block * wip: Upgrade to edonet * wip: Bypass typescript, 'edo2net' in wallet requestPermissions for Thanos * fix - incorrectly used error fa2_insufficient_balance should be fa2_token_undefined * Put required price and amount given in the "WRONG_TEZ_PRICE" error. * make sure tez doesn't get stuck on Sell/Cancel entry-points * Transfers of zero amount MUST be treated as normal transfers. In case of a zero amount transfer, the token_id validity remains unverified. This has been addressed. * wrap entrypoint name in parentheses * include tz files * chore: Remove unused environment variables from bin/dev-*/env scripts * fix: Resolve issues with notification delivery * fix(temp): Workaround edonet compatibility issues by referring to edo2net in client * feat: Initial video NFT upload & display * feat: Play/pause video on hover in token grid * chore: Cleanup unused actions, IPFS form display * fix: Readd bootstrap functions that were cleared during contracts/ refactor * fix: Work around edo2net edge case that broke sandbox * fix: Use createReadStream for non-pinata uploads * fix: Fix token_metadata_map -> token_info regression * doc: Update delphinet -> edonet in README * Fix wallet connect (#203) * Fix issue where already connected wallets would not auto reconnect * fix: Fix redux warning, resolve disconnect issue, fix FOUC on reconnect * refactor: Move wallet reconnect attempt state out of component and into system SDK Co-authored-by: Philip Diaz <philip@tqgroup.io> * Fixing yarn log:api to follow api-server and not bcd api * fix: Update max request size in local nginx gateway * chore: Bump server package.json version * updated shield Co-authored-by: Emmanuel Denloye-Ito <eod8tb@virginia.edu> Co-authored-by: Joshua Dechant <josh@codecrafting.org> Co-authored-by: Gregory Rocco <gregoryrocco@MBPSprueSupreme.nyc.rr.com>
1 parent 361fb6a commit c83f99c

File tree

83 files changed

+2509
-7630
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+2509
-7630
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
![OpenMinter header](/docs/assets/minterhead.png)
22

3-
[![](https://img.shields.io/badge/license-MIT-brightgreen)](LICENSE) [![](https://img.shields.io/badge/Docker-20.10.x-blue)](https://www.docker.com/) [![](https://img.shields.io/badge/version-v0.1.2-orange)](https://github.com/tqtezos/minter)
3+
[![](https://img.shields.io/badge/license-MIT-brightgreen)](LICENSE) [![](https://img.shields.io/badge/Docker-20.10.x-blue)](https://www.docker.com/) [![](https://img.shields.io/badge/version-v0.2.0-orange)](https://github.com/tqtezos/minter)
44

55
## Notice
66

7-
This software is in beta. At the moment, the smart contracts
7+
This software is in beta. At the moment, the smart contracts
88
that OpenMinter uses have **not** been formally audited. Please
9-
use this software at your own risk.
9+
use this software at your own risk.
1010

1111
## OpenMinter
1212

@@ -17,7 +17,7 @@ contracts, see their NFTs across contracts, and enable marketplace
1717
capabilities to trade them.
1818

1919
OpenMinter supports the following networks and software components:
20-
#### 🌐 Mainnet and Delphinet networks (Edonet soon)
20+
#### 🌐 Mainnet and Edonet networks
2121
#### 📦 Sandboxed development via [Flextesa][flextesa]
2222
#### 🎨 Creating multimedia NFTs
2323
#### 👛 Various wallets via [Beacon](https://www.walletbeacon.io/)
@@ -57,7 +57,7 @@ the `minter-ui-dev` and `minter-api-dev` Docker images.
5757
### Configuration
5858

5959
The Minter can be configured to run on three different networks: `sandbox`,
60-
`testnet` (currently set to delphinet), and `mainnet`.
60+
`testnet` (currently set to edonet), and `mainnet`.
6161

6262
Each network has its own configuration file in the `config` folder under
6363
`minter.<network>.json`. The schema of these files can be defined as this

bin/dev-mainnet/env

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
TEZOS_RPC_URL=https://mainnet-tezos.giganode.io
2-
3-
BCD_API_URL=https://api.better-call.dev
4-
BCD_GUI_URL=https://better-call.dev
5-
62
BCD_NETWORK="mainnet"
7-
83
TZ_NETWORK=mainnet

bin/dev-sandbox/env

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,9 @@ TEZOS_RPC_PROTO=http
44

55
TEZOS_RPC_URL=${TEZOS_RPC_PROTO}://${TEZOS_RPC_HOST}:20000
66

7-
BCD_API_PORT=14000
8-
BCD_GUI_PORT=8009
9-
10-
BCD_API_URL=http://bcdapi:${BCD_API_PORT}
11-
BCD_GUI_URL=http://localhost:${BCD_GUI_PORT}
12-
137
BCD_NETWORK="sandboxnet"
148

15-
FLEXTESA_DOCKER_IMG=registry.gitlab.com/tezos/flextesa:00b415f2-run
9+
FLEXTESA_DOCKER_IMG=registry.gitlab.com/tezos/flextesa:56f651af-run
1610

1711
TZ_INDEX_DB_PATH=$PROJECT_ROOT_DIR/.tzindex
1812
FLEXTESA_DATA_DIR=$PROJECT_ROOT_DIR/.flextesa

bin/dev-testnet/env

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,2 @@
1-
TEZOS_RPC_URL=https://delphinet-tezos.giganode.io
2-
3-
BCD_API_URL=https://api.better-call.dev
4-
BCD_GUI_URL=https://better-call.dev
5-
6-
BCD_NETWORK="delphinet"
7-
1+
TEZOS_RPC_URL=https://edonet-tezos.giganode.io
82
TZ_NETWORK=testnet

client/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"name": "client",
3-
"version": "0.1.0",
3+
"version": "0.2.0",
44
"private": true,
55
"dependencies": {
66
"@chakra-ui/react": "1.1.2",
77
"@emotion/core": "10.0.28",
88
"@emotion/react": "11.1.4",
99
"@emotion/styled": "11.0.0",
1010
"@reduxjs/toolkit": "1.5.0",
11-
"@taquito/beacon-wallet": "8.0.0-beta.5",
12-
"@taquito/tzip16": "8.0.0-beta.5",
13-
"@taquito/taquito": "8.0.0-beta.5",
11+
"@taquito/beacon-wallet": "8.0.3-beta.0",
12+
"@taquito/tzip16": "8.0.3-beta.0",
13+
"@taquito/taquito": "8.0.3-beta.0",
1414
"@types/lodash": "4.14.165",
1515
"@types/react": "16.9.12",
1616
"@types/react-dom": "16.9.0",

client/src/components/App/index.tsx

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,35 @@
1-
import React from 'react';
1+
import React, { useEffect } from 'react';
22
import { Switch, Route } from 'wouter';
33
import SplashPage from '../SplashPage';
44
import CreateNonFungiblePage from '../CreateNonFungiblePage';
55
import CollectionsCatalog from '../Collections/Catalog';
66
import CollectionsTokenDetail from '../Collections/TokenDetail';
77
import Header from '../common/Header';
88
import { Flex } from '@chakra-ui/react';
9+
import Notifications from '../common/Notifications';
10+
import { useSelector, useDispatch } from '../../reducer';
11+
import { reconnectWallet } from '../../reducer/async/wallet';
912

1013
export default function App() {
14+
const dispatch = useDispatch();
15+
const walletReconnectAttempted = useSelector(
16+
s => s.system.walletReconnectAttempted
17+
);
18+
19+
useEffect(() => {
20+
if (!walletReconnectAttempted) {
21+
dispatch(reconnectWallet());
22+
}
23+
}, [walletReconnectAttempted, dispatch]);
24+
25+
if (!walletReconnectAttempted) {
26+
return null;
27+
}
28+
1129
return (
1230
<Flex pos="absolute" w="100%" h="100%">
1331
<Flex justifyContent="space-between" width="100%" flexDir="column">
1432
<Header />
15-
1633
<Switch>
1734
<Route path="/">
1835
<SplashPage />
@@ -32,6 +49,7 @@ export default function App() {
3249
)}
3350
</Route>
3451
</Switch>
52+
<Notifications />
3553
</Flex>
3654
</Flex>
3755
);

client/src/components/Collections/Catalog/TokenGrid.tsx

Lines changed: 56 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState } from 'react';
1+
import React, { useEffect, useState } from 'react';
22
import { useLocation } from 'wouter';
33
import { AspectRatio, Box, Flex, Grid, Image, Text } from '@chakra-ui/react';
44
import { Wind, HelpCircle } from 'react-feather';
@@ -11,32 +11,71 @@ interface TokenTileProps extends Token {
1111
selectedCollection: string;
1212
}
1313

14+
function MediaNotFound() {
15+
return (
16+
<Flex
17+
flexDir="column"
18+
align="center"
19+
justify="center"
20+
flex="1"
21+
bg="gray.100"
22+
color="gray.300"
23+
height="100%"
24+
>
25+
<HelpCircle size="70px" />
26+
</Flex>
27+
);
28+
}
29+
1430
function TokenImage(props: { src: string }) {
1531
const [errored, setErrored] = useState(false);
32+
const [obj, setObj] = useState<{ url: string; type: string } | null>(null);
33+
useEffect(() => {
34+
(async () => {
35+
let blob;
36+
try {
37+
blob = await fetch(props.src).then(r => r.blob());
38+
} catch (e) {
39+
return setErrored(true);
40+
}
41+
setObj({
42+
url: URL.createObjectURL(blob),
43+
type: blob.type
44+
});
45+
})();
46+
}, [props.src]);
1647

1748
if (errored) {
49+
return <MediaNotFound />;
50+
}
51+
52+
if (!obj) return null;
53+
54+
if (/^image\/.*/.test(obj.type)) {
1855
return (
19-
<Flex
20-
flexDir="column"
21-
align="center"
22-
justify="center"
56+
<Image
57+
src={props.src}
58+
objectFit="contain"
2359
flex="1"
24-
bg="gray.100"
25-
color="gray.300"
60+
onError={() => setErrored(true)}
61+
/>
62+
);
63+
}
64+
65+
if (/^video\/.*/.test(obj.type)) {
66+
return (
67+
<video
68+
loop
69+
onClick={e => e.preventDefault()}
70+
onMouseEnter={e => e.currentTarget.play()}
71+
onMouseLeave={e => e.currentTarget.pause()}
2672
>
27-
<HelpCircle size="70px" />
28-
</Flex>
73+
<source src={obj.url} type={obj.type} />
74+
</video>
2975
);
3076
}
3177

32-
return (
33-
<Image
34-
src={props.src}
35-
objectFit="contain"
36-
flex="1"
37-
onError={() => setErrored(true)}
38-
/>
39-
);
78+
return <MediaNotFound />;
4079
}
4180

4281
function TokenTile(props: TokenTileProps) {

client/src/components/Collections/TokenDetail/index.tsx

Lines changed: 72 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -43,49 +43,72 @@ function NotFound() {
4343
);
4444
}
4545

46-
function TokenImage(props: { src: string }) {
47-
const [errored, setErrored] = useState(false);
48-
49-
if (errored) {
50-
return (
51-
<AspectRatio
52-
ratio={4 / 3}
53-
width="100%"
54-
borderRadius="3px"
55-
bg="gray.100"
56-
overflow="hidden"
57-
>
58-
<Flex flexDir="column" align="center" justify="center">
59-
<Box color="gray.300" pb={10}>
60-
<HelpCircle size="100px" />
61-
</Box>
62-
<Heading color="gray.300" size="xl">
63-
Image not found
64-
</Heading>
65-
</Flex>
66-
</AspectRatio>
67-
);
68-
}
69-
46+
function MediaNotFound() {
7047
return (
7148
<AspectRatio
72-
ratio={1}
49+
ratio={4 / 3}
7350
width="100%"
7451
borderRadius="3px"
75-
boxShadow="0 0 5px rgba(0,0,0,.15)"
52+
bg="gray.100"
7653
overflow="hidden"
7754
>
78-
<Box>
79-
<Image
80-
src={props.src}
81-
objectFit="contain"
82-
onError={() => setErrored(true)}
83-
/>
84-
</Box>
55+
<Flex flexDir="column" align="center" justify="center">
56+
<Box color="gray.300" pb={10}>
57+
<HelpCircle size="100px" />
58+
</Box>
59+
<Heading color="gray.300" size="xl">
60+
Image not found
61+
</Heading>
62+
</Flex>
8563
</AspectRatio>
8664
);
8765
}
8866

67+
function TokenImage(props: { src: string }) {
68+
const [errored, setErrored] = useState(false);
69+
const [obj, setObj] = useState<{ url: string; type: string } | null>(null);
70+
useEffect(() => {
71+
(async () => {
72+
let blob;
73+
try {
74+
blob = await fetch(props.src).then(r => r.blob());
75+
} catch (e) {
76+
return setErrored(true);
77+
}
78+
setObj({
79+
url: URL.createObjectURL(blob),
80+
type: blob.type
81+
});
82+
})();
83+
}, [props.src]);
84+
85+
if (errored) {
86+
return <MediaNotFound />;
87+
}
88+
if (!obj) return null;
89+
90+
if (/^image\/.*/.test(obj.type)) {
91+
return (
92+
<Image
93+
src={props.src}
94+
objectFit="contain"
95+
flex="1"
96+
onError={() => setErrored(true)}
97+
/>
98+
);
99+
}
100+
101+
if (/^video\/.*/.test(obj.type)) {
102+
return (
103+
<video controls>
104+
<source src={obj.url} type={obj.type} />
105+
</video>
106+
);
107+
}
108+
109+
return <MediaNotFound />;
110+
}
111+
89112
interface TokenDetailProps {
90113
contractAddress: string;
91114
tokenId: number;
@@ -134,9 +157,22 @@ function TokenDetail({ contractAddress, tokenId }: TokenDetailProps) {
134157
</MinterButton>
135158
</Flex>
136159
<Flex align="center" justify="center" flex="1" px={16}>
137-
<TokenImage
138-
src={ipfsUriToGatewayUrl(system.config.network, token.artifactUri)}
139-
/>
160+
<AspectRatio
161+
ratio={1}
162+
width="100%"
163+
borderRadius="3px"
164+
boxShadow="0 0 5px rgba(0,0,0,.15)"
165+
overflow="hidden"
166+
>
167+
<Box>
168+
<TokenImage
169+
src={ipfsUriToGatewayUrl(
170+
system.config.network,
171+
token.artifactUri
172+
)}
173+
/>
174+
</Box>
175+
</AspectRatio>
140176
</Flex>
141177
</Flex>
142178
<Flex w="50%" h="100%" flexDir="column">

0 commit comments

Comments
 (0)