Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/apps/.env.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ DECIMALS=6
DISCORD_CHANNEL=https://discord.com/invite/8jghD8V9PU
FAVICON_PATH=favicons/marketplace
GRAPH_QL_ADMIN_SECRET=hepM3wfsATBoI-ix2uhsAodr1j99MThPF5LBZJI2YtHAax7W9BIP9F8IWuzcNUC4
GRAPH_QL_API=https://hasura.dev.uniquenetwork.dev/v1/graphql
GRAPH_QL_API=https://hasura.quartz.uniquenetwork.dev/v1/graphql
IMAGE_SERVER_URL=https://image-uploader.unique.network
IPFS_GATEWAY=https://ipfs.unique.network/ipfs
MIN_PRICE=0.000001
UNIQUE_SUBSTRATE_API=wss://ws-rc.unique.network
UNIQUE_SUBSTRATE_API=wss://ws-quartz.unique.network
UNQ_TELEGRAM=https://t.me/unique2faucet_opal_bot
UNQ_WALLET="https://wallet-opal.unique.network/#/myStuff/nft?collectionId="
UNQ_SCAN="https://uniquescan.io"
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/webpack.serve.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = merge(
proxy: {
'/v1/graphql/': {
changeOrigin: true,
target: 'https://hasura.dev.uniquenetwork.dev'
target: 'https://hasura.quartz.uniquenetwork.dev'
}
},
static: path.resolve(__dirname, 'build')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface CollectionFormProps {
setTokenPrefix: (tokenPrefix: string) => void;
setVariableSchema: (variableSchema: string) => void;
tokenImg: File | null;
tokenLimit: number;
tokenLimit: number | undefined;
tokenPrefix: string;
variableSchema: string;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/page-builder/src/CollectionFormContext/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function CollectionForm ({ children }: Props): React.ReactElement<Props> | null
const [ownerCanTransfer, setOwnerCanTransfer] = useState<boolean>(false);
const [ownerCanDestroy, setOwnerCanDestroy] = useState<boolean>(true);
const [tokenPrefix, setTokenPrefix] = useState<string>('');
const [tokenLimit, setTokenLimit] = useState<number>(0);
const [tokenLimit, setTokenLimit] = useState<number | undefined>();
const [variableSchema, setVariableSchema] = useState<string>('');
const [tokenImg, setTokenImg] = useState<File | null>(null);

Expand Down
9 changes: 2 additions & 7 deletions packages/page-builder/src/components/CreateNFT/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ interface IValueType {
const transactionText = 'Creating token and saving it to blockchain';

function CreateNFT ({ account, collectionId, collectionInfo, constAttributes, constOnChainSchema, isOwner, resetAttributes, setTokenConstAttributes, setTokenImg, tokenConstAttributes, tokenImg }: CreateNFTProps): React.ReactElement {
const { calculateCreateItemFee, createNft, getDetailedTokenInfo } = useToken();
const { calculateCreateItemFee, createNft } = useToken();
const [createFees, setCreateFees] = useState<BN | null>(null);
const [isDisabled, setIsDisabled] = useState<boolean>(true);
const [imageUploading, setImageUploading] = useState<boolean>(false);
Expand Down Expand Up @@ -172,6 +172,7 @@ function CreateNFT ({ account, collectionId, collectionInfo, constAttributes, co

payload[tokenConstAttributes[key].name] = attributeValue || attributeValue === 0 ? attributeValue : null;
});

const cData = serializeNft(constOnChainSchema, payload);

constData = '0x' + Buffer.from(cData).toString('hex');
Expand Down Expand Up @@ -224,12 +225,6 @@ function CreateNFT ({ account, collectionId, collectionInfo, constAttributes, co
void calculateFee();
}, [calculateFee]);

useEffect(() => {
if (collectionInfo) {
void getDetailedTokenInfo(collectionId, '1');
}
}, [collectionInfo, collectionId, getDetailedTokenInfo]);

if (collectionInfo && !isOwner) {
return (
<div className='create-nft'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ function TokenAttributes ({ account, collectionId, collectionInfo }: TokenAttrib
onKeyDown={onLimitKeyDown}
placeholder='Token limit'
type='number'
value={tokenLimit.toString()}
value={tokenLimit?.toString()}
/>
</div>
</form>
Expand Down
9 changes: 5 additions & 4 deletions packages/react-hooks/src/useToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,12 @@ export function useToken (): UseTokenInterface {
}

try {
const tokenInfo = (await api.rpc.unique.tokenData(collectionId, tokenId)).toHuman() as TokenDetailsInterface;
const tokenInfo = (await api.rpc.unique.tokenData(collectionId, tokenId)) as TokenDetailsInterface;

console.log('tokenInfo', tokenInfo);

return tokenInfo;
return {
owner: tokenInfo?.owner?.toHuman(),
properties: tokenInfo?.properties?.map((x) => ({ key: x.key.toHuman(), value: x?.value?.toJSON() })),
};
} catch (e) {
console.log('getDetailedTokenInfo error', e);

Expand Down