Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Andi sytling #15

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
refactoring and tx expiration increase to match modal display
  • Loading branch information
marc0olo committed Sep 7, 2023
commit 565ac4f92b671da569b8d8a01cd8d977169bdc95
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NEXT_PUBLIC_APP_NAME=NFT Manager
NEXT_PUBLIC_APP_DESCRIPTION=The NFT manager is a platform for managing AtomicAssets NFT collections, based upon the open source collection-manager project by Facings.
NEXT_PUBLIC_APP_DESCRIPTION=Create and update your NFT collections on XPR Network. Easily airdrop NFTs to a set of recipients or put existing NFTs on sale!
NEXT_PUBLIC_FAVICON=https://soon.market/favicon.png
NEXT_PUBLIC_META_ICON=https://media.soon.market/images/soon-logo.png
NEXT_PUBLIC_APP_URL=https://manager.soon.market
2 changes: 2 additions & 0 deletions src/components/Card/components/CardContent.tsx
Original file line number Diff line number Diff line change
@@ -34,6 +34,8 @@ export function CardContent({
<div className="p-2 text-center">Single Sale</div>
)}

{!saleInfo && id && <div className="p-2 text-center">#{id}</div>}

{withThumbnail && (
<div className="aspect-square bg-neutral-700 relative">
{video && (
11 changes: 8 additions & 3 deletions src/pages/[chainKey]/about.tsx
Original file line number Diff line number Diff line change
@@ -43,23 +43,28 @@ export default function About() {
className="underline"
>
https://github.com/kryptokrauts/nft-manager
</a> (this project)<br />
</a>{' '}
(this project)
<br />
<a
href="https://github.com/FACINGS/collection-manager"
target="_blank"
rel="noreferrer"
className="underline"
>
https://github.com/FACINGS/collection-manager
</a> (original)<br />
</a>{' '}
(original)
<br />
<a
href="https://github.com/Jackthegr8at/nfts_platform"
target="_blank"
rel="noreferrer"
className="underline"
>
https://github.com/Jackthegr8at/nfts_platform
</a> (some tool logic that has been adapted)
</a>{' '}
(some tool logic that has been adapted)
</p>
</section>

37 changes: 36 additions & 1 deletion src/services/asset/burnAssetService.ts
Original file line number Diff line number Diff line change
@@ -4,6 +4,24 @@ interface BurnAssetServiceProps {
asset_id: string;
}

interface ActionProps {
account: string;
name: string;
authorization: {
actor: string;
permission: string;
}[];
data: {
asset_owner: string;
asset_id: string;
};
}

interface BurnMultipleAssetProps {
activeUser: any;
actions: ActionProps[];
}

export async function burnAssetService({
activeUser,
asset_owner,
@@ -30,7 +48,24 @@ export async function burnAssetService({
},
{
blocksBehind: 3,
expireSeconds: 30,
expireSeconds: 120,
}
);

return response;
}

export async function burnMultipleAssetService({
activeUser,
actions,
}: BurnMultipleAssetProps) {
const response = await activeUser.signTransaction(
{
actions,
},
{
blocksBehind: 3,
expireSeconds: 120,
}
);

2 changes: 1 addition & 1 deletion src/services/asset/createAssetService.ts
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ export async function createAssetService({
},
{
blocksBehind: 3,
expireSeconds: 30,
expireSeconds: 120,
}
);

33 changes: 0 additions & 33 deletions src/services/asset/massburnAssetService.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/services/asset/transferAssetService.ts
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ export async function transferAssetService({
},
{
blocksBehind: 3,
expireSeconds: 30,
expireSeconds: 120,
}
);

2 changes: 1 addition & 1 deletion src/services/asset/updateMutableDataService.ts
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ export async function updateMutableDataService({
},
{
blocksBehind: 3,
expireSeconds: 30,
expireSeconds: 120,
}
);

2 changes: 1 addition & 1 deletion src/services/collection/createCollectionService.ts
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@ export async function createCollectionService({
},
{
blocksBehind: 3,
expireSeconds: 30,
expireSeconds: 120,
}
);

2 changes: 1 addition & 1 deletion src/services/collection/editCollectionService.ts
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ export async function editCollectionService({
},
{
blocksBehind: 3,
expireSeconds: 30,
expireSeconds: 120,
}
);

Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ interface CancelSalesAssetProps {
actions: ActionProps[];
}

export async function CancelSalesAssetService({
export async function CancelSalesService({
activeUser,
actions,
}: CancelSalesAssetProps) {
@@ -24,7 +24,7 @@ export async function CancelSalesAssetService({
},
{
blocksBehind: 3,
expireSeconds: 30,
expireSeconds: 120,
}
);

Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@ export async function CreateSaleService({
},
{
blocksBehind: 3,
expireSeconds: 30,
expireSeconds: 120,
}
);
return response;
2 changes: 1 addition & 1 deletion src/services/schema/createSchemaService.ts
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ export async function createSchemaService({
},
{
blocksBehind: 3,
expireSeconds: 30,
expireSeconds: 120,
}
);

2 changes: 1 addition & 1 deletion src/services/schema/editSchemaService.ts
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ export async function editSchemaService({
},
{
blocksBehind: 3,
expireSeconds: 30,
expireSeconds: 120,
}
);

2 changes: 1 addition & 1 deletion src/services/template/createTemplateService.ts
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ export async function createTemplateService({
},
{
blocksBehind: 3,
expireSeconds: 30,
expireSeconds: 120,
}
);

2 changes: 1 addition & 1 deletion src/services/template/lockTemplateService.ts
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ export async function lockTemplateService({
},
{
blocksBehind: 3,
expireSeconds: 30,
expireSeconds: 120,
}
);

14 changes: 9 additions & 5 deletions src/tools/default/burn/index.tsx
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ import { Header } from '@components/Header';
import chainsConfig from '@configs/chainsConfig';
import { ipfsEndpoint, chainKeyDefault, appName } from '@configs/globalsConfig';

import { burnAssetService } from '@services/asset/massburnAssetService';
import { burnMultipleAssetService } from '@services/asset/burnAssetService';
import {
getInventoryService,
AssetProps,
@@ -72,7 +72,7 @@ function Burn({ ual }) {

const getViewLink = (asset) => {
if (chainKey == 'xpr') {
return `https://soon.market/nft/templates/${asset.template.template_id}/${asset.asset_id}?utm_medium=card&utm_source=nft-manager`;
return `https://soon.market/nft/templates/${asset.template.template_id}/${asset.asset_id}?utm_medium=burn-nfts-card&utm_source=nft-manager`;
}
return `/${chainKey}/collection/${asset.collection.collection_name}/asset/${asset.asset_id}`;
};
@@ -218,7 +218,7 @@ function Burn({ ual }) {
actions.push(action);
});

await burnAssetService({
await burnMultipleAssetService({
activeUser: ual.activeUser,
actions: actions,
});
@@ -312,7 +312,9 @@ function Burn({ ual }) {
<main className="container">
<h2 className="headline-2 mt-4 md:mt-8">Burn one or multiple NFTs</h2>
<ol className="list-decimal pl-6 body-1 text-neutral-200 mt-2">
<li className="pl-1">Select the NFTs by clicking on their pictures.</li>
<li className="pl-1">
Select the NFTs by clicking on their pictures.
</li>
<li className="pl-1">Click the "Burn NFT(s)" button.</li>
</ol>
<br />
@@ -399,7 +401,9 @@ function Burn({ ual }) {
}`}
disabled={selectedAssets.length === 0}
>
{isSaved ? 'Saved' : `Burn NFT${selectedAssets.length > 1 ? 's': ''}`}
{isSaved
? 'Saved'
: `Burn NFT${selectedAssets.length > 1 ? 's' : ''}`}
</button>
)}
</form>
10 changes: 6 additions & 4 deletions src/tools/default/cancel-sales/index.tsx
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ import { ipfsEndpoint, chainKeyDefault, appName } from '@configs/globalsConfig';

import { SaleProps, getSalesService } from '@services/sales/getSalesService';
import { getAccountStatsService } from '@services/account/getAccountStatsService';
import { CancelSalesAssetService } from '@services/asset/masscancelSalesService';
import { CancelSalesService } from '@services/sales/cancelSalesService';

interface ModalProps {
title: string;
@@ -65,7 +65,7 @@ function CancelSales({ ual }) {

const getViewLink = (sale) => {
if (chainKey == 'xpr') {
return `https://soon.market/sales/${sale.sale_id}`;
return `https://soon.market/sales/${sale.sale_id}?utm_medium=cancel-sales-card&utm_source=nft-manager`;
}
return undefined;
};
@@ -207,7 +207,7 @@ function CancelSales({ ual }) {
actions.push(action);
});

await CancelSalesAssetService({
await CancelSalesService({
activeUser: ual.activeUser,
actions: actions,
});
@@ -378,7 +378,9 @@ function CancelSales({ ual }) {
}`}
disabled={selectedSales.length === 0}
>
{isSaved ? 'Saved' : `Cancel Sale${selectedSales.length > 1 ? 's' : ''}`}
{isSaved
? 'Saved'
: `Cancel Sale${selectedSales.length > 1 ? 's' : ''}`}
</button>
)}
</form>
Loading