From f76bd30ab7beb30f9e1bab4b5aa5e4b038a476de Mon Sep 17 00:00:00 2001
From: SpaghettiOverload
Date: Wed, 25 Jan 2023 12:43:36 +0200
Subject: [PATCH] CUDOS-2076 missing Msgs - Marketplace
---
public/locales/en/message_contents.json | 14 +++-
public/locales/en/message_labels.json | 16 +++-
src/components/addressbook_details/index.tsx | 38 ++-------
src/components/index.ts | 4 +
src/components/msg/index.ts | 24 ++++++
.../__snapshots__/index.test.tsx.snap | 24 ++++++
.../msg/marketplace/add_admin/index.test.tsx | 44 ++++++++++
.../msg/marketplace/add_admin/index.tsx | 40 +++++++++
.../buy_nft/__snapshots__/index.test.tsx.snap | 30 +++++++
.../msg/marketplace/buy_nft/index.test.tsx | 48 +++++++++++
.../msg/marketplace/buy_nft/index.tsx | 39 +++++++++
.../__snapshots__/index.test.tsx.snap | 47 +++++++++++
.../create_collection/index.test.tsx | 52 ++++++++++++
.../marketplace/create_collection/index.tsx | 48 +++++++++++
.../__snapshots__/index.test.tsx.snap | 41 ++++++++++
.../msg/marketplace/mint_nft/index.test.tsx | 53 ++++++++++++
.../msg/marketplace/mint_nft/index.tsx | 46 +++++++++++
.../__snapshots__/index.test.tsx.snap | 47 +++++++++++
.../publish_collection/index.test.tsx | 52 ++++++++++++
.../marketplace/publish_collection/index.tsx | 48 +++++++++++
.../__snapshots__/index.test.tsx.snap | 27 ++++++
.../marketplace/publish_nft/index.test.tsx | 48 +++++++++++
.../msg/marketplace/publish_nft/index.tsx | 37 +++++++++
.../__snapshots__/index.test.tsx.snap | 24 ++++++
.../marketplace/remove_admin/index.test.tsx | 44 ++++++++++
.../msg/marketplace/remove_admin/index.tsx | 40 +++++++++
.../__snapshots__/index.test.tsx.snap | 25 ++++++
.../msg/marketplace/remove_nft/index.test.tsx | 45 ++++++++++
.../msg/marketplace/remove_nft/index.tsx | 32 ++++++++
.../__snapshots__/index.test.tsx.snap | 29 +++++++
.../unverify_collection/index.test.tsx | 45 ++++++++++
.../marketplace/unverify_collection/index.tsx | 43 ++++++++++
.../__snapshots__/index.test.tsx.snap | 26 ++++++
.../marketplace/update_price/index.test.tsx | 47 +++++++++++
.../msg/marketplace/update_price/index.tsx | 33 ++++++++
.../__snapshots__/index.test.tsx.snap | 47 +++++++++++
.../update_royalties/index.test.tsx | 52 ++++++++++++
.../marketplace/update_royalties/index.tsx | 48 +++++++++++
.../__snapshots__/index.test.tsx.snap | 29 +++++++
.../verify_collection/index.test.tsx | 45 ++++++++++
.../marketplace/verify_collection/index.tsx | 43 ++++++++++
src/components/msg/utils.tsx | 82 ++++++++++++++++++-
src/components/nft_details/index.tsx | 21 +++++
src/components/royalties_details/index.tsx | 32 ++++++++
.../styled_typography_pair/index.tsx | 26 ++++++
.../styled_typography_pair/styles.ts | 10 +++
src/models/index.ts | 24 ++++++
src/models/msg/marketplace/msg_add_admin.ts | 28 +++++++
src/models/msg/marketplace/msg_buy_nft.ts | 54 ++++++++++++
.../msg/marketplace/msg_create_collection.ts | 35 ++++++++
src/models/msg/marketplace/msg_mint_nft.ts | 41 ++++++++++
.../msg/marketplace/msg_publish_collection.ts | 35 ++++++++
src/models/msg/marketplace/msg_publish_nft.ts | 35 ++++++++
.../msg/marketplace/msg_remove_admin.ts | 28 +++++++
src/models/msg/marketplace/msg_remove_nft.ts | 28 +++++++
.../marketplace/msg_unverify_collection.ts | 38 +++++++++
.../msg/marketplace/msg_update_price.ts | 32 ++++++++
.../msg/marketplace/msg_update_royalties.ts | 35 ++++++++
.../msg/marketplace/msg_verify_collection.ts | 38 +++++++++
src/models/msg/types.ts | 19 ++++-
60 files changed, 2166 insertions(+), 39 deletions(-)
create mode 100644 src/components/msg/marketplace/add_admin/__snapshots__/index.test.tsx.snap
create mode 100644 src/components/msg/marketplace/add_admin/index.test.tsx
create mode 100644 src/components/msg/marketplace/add_admin/index.tsx
create mode 100644 src/components/msg/marketplace/buy_nft/__snapshots__/index.test.tsx.snap
create mode 100644 src/components/msg/marketplace/buy_nft/index.test.tsx
create mode 100644 src/components/msg/marketplace/buy_nft/index.tsx
create mode 100644 src/components/msg/marketplace/create_collection/__snapshots__/index.test.tsx.snap
create mode 100644 src/components/msg/marketplace/create_collection/index.test.tsx
create mode 100644 src/components/msg/marketplace/create_collection/index.tsx
create mode 100644 src/components/msg/marketplace/mint_nft/__snapshots__/index.test.tsx.snap
create mode 100644 src/components/msg/marketplace/mint_nft/index.test.tsx
create mode 100644 src/components/msg/marketplace/mint_nft/index.tsx
create mode 100644 src/components/msg/marketplace/publish_collection/__snapshots__/index.test.tsx.snap
create mode 100644 src/components/msg/marketplace/publish_collection/index.test.tsx
create mode 100644 src/components/msg/marketplace/publish_collection/index.tsx
create mode 100644 src/components/msg/marketplace/publish_nft/__snapshots__/index.test.tsx.snap
create mode 100644 src/components/msg/marketplace/publish_nft/index.test.tsx
create mode 100644 src/components/msg/marketplace/publish_nft/index.tsx
create mode 100644 src/components/msg/marketplace/remove_admin/__snapshots__/index.test.tsx.snap
create mode 100644 src/components/msg/marketplace/remove_admin/index.test.tsx
create mode 100644 src/components/msg/marketplace/remove_admin/index.tsx
create mode 100644 src/components/msg/marketplace/remove_nft/__snapshots__/index.test.tsx.snap
create mode 100644 src/components/msg/marketplace/remove_nft/index.test.tsx
create mode 100644 src/components/msg/marketplace/remove_nft/index.tsx
create mode 100644 src/components/msg/marketplace/unverify_collection/__snapshots__/index.test.tsx.snap
create mode 100644 src/components/msg/marketplace/unverify_collection/index.test.tsx
create mode 100644 src/components/msg/marketplace/unverify_collection/index.tsx
create mode 100644 src/components/msg/marketplace/update_price/__snapshots__/index.test.tsx.snap
create mode 100644 src/components/msg/marketplace/update_price/index.test.tsx
create mode 100644 src/components/msg/marketplace/update_price/index.tsx
create mode 100644 src/components/msg/marketplace/update_royalties/__snapshots__/index.test.tsx.snap
create mode 100644 src/components/msg/marketplace/update_royalties/index.test.tsx
create mode 100644 src/components/msg/marketplace/update_royalties/index.tsx
create mode 100644 src/components/msg/marketplace/verify_collection/__snapshots__/index.test.tsx.snap
create mode 100644 src/components/msg/marketplace/verify_collection/index.test.tsx
create mode 100644 src/components/msg/marketplace/verify_collection/index.tsx
create mode 100644 src/components/nft_details/index.tsx
create mode 100644 src/components/royalties_details/index.tsx
create mode 100644 src/components/styled_typography_pair/index.tsx
create mode 100644 src/components/styled_typography_pair/styles.ts
create mode 100644 src/models/msg/marketplace/msg_add_admin.ts
create mode 100644 src/models/msg/marketplace/msg_buy_nft.ts
create mode 100644 src/models/msg/marketplace/msg_create_collection.ts
create mode 100644 src/models/msg/marketplace/msg_mint_nft.ts
create mode 100644 src/models/msg/marketplace/msg_publish_collection.ts
create mode 100644 src/models/msg/marketplace/msg_publish_nft.ts
create mode 100644 src/models/msg/marketplace/msg_remove_admin.ts
create mode 100644 src/models/msg/marketplace/msg_remove_nft.ts
create mode 100644 src/models/msg/marketplace/msg_unverify_collection.ts
create mode 100644 src/models/msg/marketplace/msg_update_price.ts
create mode 100644 src/models/msg/marketplace/msg_update_royalties.ts
create mode 100644 src/models/msg/marketplace/msg_verify_collection.ts
diff --git a/public/locales/en/message_contents.json b/public/locales/en/message_contents.json
index beb8ba9714..9f2aaa2a84 100644
--- a/public/locales/en/message_contents.json
+++ b/public/locales/en/message_contents.json
@@ -65,5 +65,17 @@
"MsgSendToCosmosClaim": "<0>{{ethSender}}0> sent <1>{{amount}}1> to <2>{{receiver}}2>",
"txCreateAddress": "<0>{{creator}}0> created an addressbook record with the following details - <1>1>",
"txUpdateAddress": "<0>{{creator}}0> updated an addressbook record. New details - <1>1>",
- "txDeleteAddress": "<0>{{creator}}0> deleted the following addressbook record - <1>1>"
+ "txDeleteAddress": "<0>{{creator}}0> deleted the following addressbook record - <1>1>",
+ "txCreateCollection": "<0>{{creator}}0> created '<3>{{collectionId}}3>' collection. <1>1><2>2>",
+ "txPublishCollection": "<0>{{creator}}0> published '<3>{{collectionId}}3>' collection. <1>1><2>2>",
+ "txUpdateRoyalties": "<0>{{creator}}0> updated royalties for collection with ID: '<3>{{collectionId}}3>' <1>1><2>2>",
+ "txVerifyCollection": "Marketplace admin: <1>{{admin}}1> verified collection with ID: <2>{{collectionId}}2> created by: <0>{{creator}}0>",
+ "txUnverifyCollection": "Marketplace admin: <1>{{admin}}1> unverified collection with ID: <2>{{collectionId}}2> created by: <0>{{creator}}0>",
+ "txAddAdmin": "<0>{{creator}}0> added <1>{{address}}1> as marketplace admin",
+ "txRemoveAdmin": "<0>{{creator}}0> removed <1>{{address}}1> from marketplace admins",
+ "txMintNft": "<0>{{creator}}0> minted an NFT to <1>{{recipient}}1> <2>2>",
+ "txPublishNft": "<0>{{creator}}0> published for sale NFT with ID: <3>{{tokenId}}3> from collection ID: <2>{{denomId}}2> for <1>{{price}}1>",
+ "txRemoveNft": "<0>{{creator}}0> removed from sale NFT with ID: <1>{{id}}1>",
+ "txUpdatePrice": "<0>{{creator}}0> updated the price of NFT with ID: <2>{{id}}2>. New price: <1>{{price}}1>",
+ "txBuyNft": "<0>{{buyer}}0> purchased NFT with ID: <3>{{id}}3> from <1>{{seller}}1> for <2>{{price}}2>"
}
diff --git a/public/locales/en/message_labels.json b/public/locales/en/message_labels.json
index 94acda2300..671f44b8bc 100644
--- a/public/locales/en/message_labels.json
+++ b/public/locales/en/message_labels.json
@@ -65,6 +65,18 @@
"txClearContractAdmin": "Clear Contract Admin",
"MsgSendToCosmosClaim": "Gravity Bridge - Ethereum to Cosmos",
"txCreateAddress": "New Address Book Record",
- "txUpdateAddress": "Updating Address Book Record",
- "txDeleteAddress": "Deleting Address Book Record"
+ "txUpdateAddress": "Update Address Book Record",
+ "txDeleteAddress": "Delete Address Book Record",
+ "txCreateCollection": "Create NFT Collection",
+ "txPublishCollection": "Publish NFT Collection",
+ "txUpdateRoyalties": "Update NFT Collection Royalties",
+ "txVerifyCollection": "Verify NFT Collection",
+ "txUnverifyCollection": "Unverify NFT Collection",
+ "txAddAdmin": "Add Marketplace Admin",
+ "txRemoveAdmin": "Remove Marketplace Admin",
+ "txMintNft": "Mint NFT",
+ "txPublishNft": "Publish NFT for sale",
+ "txRemoveNft": "Remove NFT from sale",
+ "txUpdatePrice": "Update NFT price",
+ "txBuyNft": "Buy NFT"
}
diff --git a/src/components/addressbook_details/index.tsx b/src/components/addressbook_details/index.tsx
index 2db96255b2..198907d0a2 100644
--- a/src/components/addressbook_details/index.tsx
+++ b/src/components/addressbook_details/index.tsx
@@ -1,41 +1,13 @@
import React from 'react';
-import {
- Typography,
- Box,
-} from '@material-ui/core';
-import { addressBookDetails } from './styles';
-
-interface AddressBookDetailsValue {
- network: string;
- label: string;
- value: string;
-}
-
-const StyledTypography = ({
- text,
- content,
-}: {
- text: string,
- content: string
-}) => {
- return (
-
-
- {text}
-
-
- {content}
-
-
- );
-};
+import { AddressBookDetailsValue } from '@src/models/msg/types';
+import StyledTypographyPair from '../styled_typography_pair';
const AddressBookDetails = ({ content }: { content: AddressBookDetailsValue }) => {
return (
<>
- {content.network ? : null}
- {content.label ? : null}
- {content.value ? : null}
+ {content.network ? : null}
+ {content.label ? : null}
+ {content.value ? : null}
>
);
};
diff --git a/src/components/index.ts b/src/components/index.ts
index 94cf1f4477..e48fa64ee5 100644
--- a/src/components/index.ts
+++ b/src/components/index.ts
@@ -34,6 +34,8 @@ import {
ContractOverview, ContractMessages, ContractMessagesList, SingleContractMessageMobile,
} from './cosmwasm';
import AddressBookDetails from './addressbook_details';
+import RoyaltiesDetails from './royalties_details';
+import NftDetails from './nft_details';
export {
Layout,
@@ -73,4 +75,6 @@ export {
ContractMessagesList,
SingleContractMessageMobile,
AddressBookDetails,
+ RoyaltiesDetails,
+ NftDetails,
};
diff --git a/src/components/msg/index.ts b/src/components/msg/index.ts
index 221ba62fa4..ce443b0dce 100644
--- a/src/components/msg/index.ts
+++ b/src/components/msg/index.ts
@@ -82,6 +82,18 @@ import SendToCosmos from './gravity/send_to_cosmos';
import CreateAddress from './addressbook/create_address';
import UpdateAddress from './addressbook/update_address';
import DeleteAddress from './addressbook/delete_address';
+import CreateCollection from './marketplace/create_collection';
+import PublishCollection from './marketplace/publish_collection';
+import VerifyCollection from './marketplace/verify_collection';
+import UnverifyCollection from './marketplace/unverify_collection';
+import AddAdmin from './marketplace/add_admin';
+import MintNft from './marketplace/mint_nft';
+import PublishNft from './marketplace/publish_nft';
+import RemoveNft from './marketplace/remove_nft';
+import UpdatePrice from './marketplace/update_price';
+import UpdateRoyalties from './marketplace/update_royalties';
+import BuyNft from './marketplace/buy_nft';
+import RemoveAdmin from './marketplace/remove_admin';
export {
getMessageModelByType,
@@ -159,4 +171,16 @@ export {
CreateAddress,
UpdateAddress,
DeleteAddress,
+ CreateCollection,
+ PublishCollection,
+ VerifyCollection,
+ UnverifyCollection,
+ AddAdmin,
+ MintNft,
+ PublishNft,
+ RemoveNft,
+ UpdatePrice,
+ UpdateRoyalties,
+ BuyNft,
+ RemoveAdmin,
};
diff --git a/src/components/msg/marketplace/add_admin/__snapshots__/index.test.tsx.snap b/src/components/msg/marketplace/add_admin/__snapshots__/index.test.tsx.snap
new file mode 100644
index 0000000000..750d13680f
--- /dev/null
+++ b/src/components/msg/marketplace/add_admin/__snapshots__/index.test.tsx.snap
@@ -0,0 +1,24 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`screen: TransactionDetails/MsgAddAdmin matches snapshot 1`] = `
+
+
,
+ ,
+ ]
+ }
+ i18nKey="message_contents:txAddAdmin"
+ id="message_contents:txAddAdmin"
+ />
+
+`;
diff --git a/src/components/msg/marketplace/add_admin/index.test.tsx b/src/components/msg/marketplace/add_admin/index.test.tsx
new file mode 100644
index 0000000000..443baaf25f
--- /dev/null
+++ b/src/components/msg/marketplace/add_admin/index.test.tsx
@@ -0,0 +1,44 @@
+import React from 'react';
+import { RecoilRoot } from 'recoil';
+import renderer from 'react-test-renderer';
+import { MockTheme } from '@tests/utils';
+import { MsgAddAdmin } from '@models';
+import AddAdmin from '.';
+
+jest.mock('@components', () => ({
+ Name: (props) => ,
+}));
+
+jest.mock('next-translate/Trans', () => (
+ (props) =>
+));
+
+// ==================================
+// unit tests
+// ==================================
+describe('screen: TransactionDetails/MsgAddAdmin', () => {
+ it('matches snapshot', () => {
+ const message = new MsgAddAdmin({
+ category: 'marketplace',
+ type: 'MsgAddAdmin',
+ creator: 'creator',
+ address: 'address',
+ });
+ const component = renderer.create(
+
+
+
+
+ ,
+ );
+ const tree = component.toJSON();
+ expect(tree).toMatchSnapshot();
+ expect(component.root.findByProps({ id: 'message_contents:txAddAdmin' }).props.i18nKey).toEqual('message_contents:txAddAdmin');
+ });
+
+ afterEach(() => {
+ jest.clearAllMocks();
+ });
+});
diff --git a/src/components/msg/marketplace/add_admin/index.tsx b/src/components/msg/marketplace/add_admin/index.tsx
new file mode 100644
index 0000000000..a7c0f59bc6
--- /dev/null
+++ b/src/components/msg/marketplace/add_admin/index.tsx
@@ -0,0 +1,40 @@
+import React from 'react';
+import Trans from 'next-translate/Trans';
+import { Typography } from '@material-ui/core';
+import {
+ Name,
+} from '@components';
+import { MsgAddAdmin } from '@models';
+
+const AddAdmin = (props: {
+ message: MsgAddAdmin;
+}) => {
+ const { message } = props;
+ const {
+ creator, address,
+ } = message;
+
+ return (
+
+
+ ),
+ (
+
+ ),
+ ]}
+ />
+
+ );
+};
+
+export default AddAdmin;
diff --git a/src/components/msg/marketplace/buy_nft/__snapshots__/index.test.tsx.snap b/src/components/msg/marketplace/buy_nft/__snapshots__/index.test.tsx.snap
new file mode 100644
index 0000000000..7fbddddc08
--- /dev/null
+++ b/src/components/msg/marketplace/buy_nft/__snapshots__/index.test.tsx.snap
@@ -0,0 +1,30 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`screen: TransactionDetails/MsgBuyNft matches snapshot 1`] = `
+
+
,
+ ,
+ ]
+ }
+ i18nKey="message_contents:txBuyNft"
+ id="message_contents:txBuyNft"
+ values={
+ Object {
+ "id": undefined,
+ "price": "1 acudos",
+ }
+ }
+ />
+
+`;
diff --git a/src/components/msg/marketplace/buy_nft/index.test.tsx b/src/components/msg/marketplace/buy_nft/index.test.tsx
new file mode 100644
index 0000000000..a8a6aaa5dd
--- /dev/null
+++ b/src/components/msg/marketplace/buy_nft/index.test.tsx
@@ -0,0 +1,48 @@
+import React from 'react';
+import { RecoilRoot } from 'recoil';
+import renderer from 'react-test-renderer';
+import { MockTheme } from '@tests/utils';
+import { MsgBuyNft } from '@models';
+import { formatToken } from '@src/utils/format_token';
+import BuyNft from '.';
+
+jest.mock('@components', () => ({
+ Name: (props) => ,
+}));
+
+jest.mock('next-translate/Trans', () => (
+ (props) =>
+));
+
+// ==================================
+// unit tests
+// ==================================
+describe('screen: TransactionDetails/MsgBuyNft', () => {
+ it('matches snapshot', () => {
+ const message = new MsgBuyNft({
+ category: 'marketplace',
+ type: 'MsgBuyNft',
+ seller: 'seller',
+ buyer: 'buyer',
+ id: 'id',
+ price: formatToken('1', 'acudos'),
+ });
+
+ const component = renderer.create(
+
+
+
+
+ ,
+ );
+ const tree = component.toJSON();
+ expect(tree).toMatchSnapshot();
+ expect(component.root.findByProps({ id: 'message_contents:txBuyNft' }).props.i18nKey).toEqual('message_contents:txBuyNft');
+ });
+
+ afterEach(() => {
+ jest.clearAllMocks();
+ });
+});
diff --git a/src/components/msg/marketplace/buy_nft/index.tsx b/src/components/msg/marketplace/buy_nft/index.tsx
new file mode 100644
index 0000000000..187e3274d5
--- /dev/null
+++ b/src/components/msg/marketplace/buy_nft/index.tsx
@@ -0,0 +1,39 @@
+import React from 'react';
+import Trans from 'next-translate/Trans';
+import { Typography } from '@material-ui/core';
+import { Name } from '@components';
+import { MsgBuyNft } from '@models';
+
+const BuyNft = (props: {
+ message: MsgBuyNft;
+}) => {
+ const { message } = props;
+
+ return (
+
+
+ ),
+ (
+
+ ),
+ ]}
+ values={{
+ price: `${message.price.value} ${message.price.displayDenom}`,
+ id: message.id,
+ }}
+ />
+
+ );
+};
+
+export default BuyNft;
diff --git a/src/components/msg/marketplace/create_collection/__snapshots__/index.test.tsx.snap b/src/components/msg/marketplace/create_collection/__snapshots__/index.test.tsx.snap
new file mode 100644
index 0000000000..4cd76e8bea
--- /dev/null
+++ b/src/components/msg/marketplace/create_collection/__snapshots__/index.test.tsx.snap
@@ -0,0 +1,47 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`screen: TransactionDetails/MsgCreateCollection matches snapshot 1`] = `
+
+
,
+ ,
+ ,
+ ]
+ }
+ i18nKey="message_contents:txCreateCollection"
+ id="message_contents:txCreateCollection"
+ values={
+ Object {
+ "collectionId": "collectionId",
+ }
+ }
+ />
+
+`;
diff --git a/src/components/msg/marketplace/create_collection/index.test.tsx b/src/components/msg/marketplace/create_collection/index.test.tsx
new file mode 100644
index 0000000000..655619eb51
--- /dev/null
+++ b/src/components/msg/marketplace/create_collection/index.test.tsx
@@ -0,0 +1,52 @@
+import React from 'react';
+import { RecoilRoot } from 'recoil';
+import renderer from 'react-test-renderer';
+import { MockTheme } from '@tests/utils';
+import { MsgCreateCollection } from '@models';
+import CreateCollection from '.';
+
+jest.mock('@components', () => ({
+ Name: (props) => ,
+}));
+
+jest.mock('next-translate/Trans', () => (
+ (props) =>
+));
+
+// ==================================
+// unit tests
+// ==================================
+describe('screen: TransactionDetails/MsgCreateCollection', () => {
+ it('matches snapshot', () => {
+ const message = new MsgCreateCollection({
+ category: 'marketplace',
+ type: 'MsgCreateCollection',
+ creator: 'Creator',
+ collectionId: 'collectionId',
+ mintRoyalties: [{
+ address: 'address',
+ percent: 'percent',
+ }],
+ resaleRoyalties: [{
+ address: 'address',
+ percent: 'percent',
+ }],
+ });
+ const component = renderer.create(
+
+
+
+
+ ,
+ );
+ const tree = component.toJSON();
+ expect(tree).toMatchSnapshot();
+ expect(component.root.findByProps({ id: 'message_contents:txCreateCollection' }).props.i18nKey).toEqual('message_contents:txCreateCollection');
+ });
+
+ afterEach(() => {
+ jest.clearAllMocks();
+ });
+});
diff --git a/src/components/msg/marketplace/create_collection/index.tsx b/src/components/msg/marketplace/create_collection/index.tsx
new file mode 100644
index 0000000000..1cefdb18fb
--- /dev/null
+++ b/src/components/msg/marketplace/create_collection/index.tsx
@@ -0,0 +1,48 @@
+import React from 'react';
+import Trans from 'next-translate/Trans';
+import { Typography } from '@material-ui/core';
+import {
+ Name,
+ RoyaltiesDetails,
+} from '@components';
+import { MsgCreateCollection } from '@models';
+
+const CreateCollection = (props: {
+ message: MsgCreateCollection;
+}) => {
+ const { message } = props;
+ const { creator } = message;
+
+ return (
+
+
+ ),
+ (
+
+ ),
+ (
+
+ ),
+ ]}
+ values={{
+ collectionId: message.collectionId,
+ }}
+ />
+
+ );
+};
+
+export default CreateCollection;
diff --git a/src/components/msg/marketplace/mint_nft/__snapshots__/index.test.tsx.snap b/src/components/msg/marketplace/mint_nft/__snapshots__/index.test.tsx.snap
new file mode 100644
index 0000000000..158e542757
--- /dev/null
+++ b/src/components/msg/marketplace/mint_nft/__snapshots__/index.test.tsx.snap
@@ -0,0 +1,41 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`screen: TransactionDetails/MsgMintNft matches snapshot 1`] = `
+
+
,
+ ,
+ ,
+ ]
+ }
+ i18nKey="message_contents:txMintNft"
+ id="message_contents:txMintNft"
+ />
+
+`;
diff --git a/src/components/msg/marketplace/mint_nft/index.test.tsx b/src/components/msg/marketplace/mint_nft/index.test.tsx
new file mode 100644
index 0000000000..1020871087
--- /dev/null
+++ b/src/components/msg/marketplace/mint_nft/index.test.tsx
@@ -0,0 +1,53 @@
+import React from 'react';
+import { RecoilRoot } from 'recoil';
+import renderer from 'react-test-renderer';
+import { MockTheme } from '@tests/utils';
+import { MsgMintNft } from '@models';
+import { formatToken } from '@src/utils/format_token';
+import MintNft from '.';
+
+jest.mock('@components', () => ({
+ Name: (props) => ,
+}));
+
+jest.mock('next-translate/Trans', () => (
+ (props) =>
+));
+
+// ==================================
+// unit tests
+// ==================================
+describe('screen: TransactionDetails/MsgMintNft', () => {
+ it('matches snapshot', () => {
+ const message = new MsgMintNft({
+ category: 'marketplace',
+ type: 'MsgMintNft',
+ creator: 'creator',
+ recipient: 'recipient',
+ mintedNftData: {
+ denomId: 'denomId',
+ uid: 'uid',
+ uri: 'uri',
+ data: 'data',
+ name: 'name',
+ price: formatToken('1', 'acudos'),
+ },
+ });
+ const component = renderer.create(
+
+
+
+
+ ,
+ );
+ const tree = component.toJSON();
+ expect(tree).toMatchSnapshot();
+ expect(component.root.findByProps({ id: 'message_contents:txMintNft' }).props.i18nKey).toEqual('message_contents:txMintNft');
+ });
+
+ afterEach(() => {
+ jest.clearAllMocks();
+ });
+});
diff --git a/src/components/msg/marketplace/mint_nft/index.tsx b/src/components/msg/marketplace/mint_nft/index.tsx
new file mode 100644
index 0000000000..866aab7593
--- /dev/null
+++ b/src/components/msg/marketplace/mint_nft/index.tsx
@@ -0,0 +1,46 @@
+import React from 'react';
+import Trans from 'next-translate/Trans';
+import { Typography } from '@material-ui/core';
+import {
+ Name,
+ NftDetails,
+} from '@components';
+import { MsgMintNft } from '@models';
+
+const MintNft = (props: {
+ message: MsgMintNft;
+}) => {
+ const { message } = props;
+ const {
+ creator, recipient, mintedNftData,
+ } = message;
+
+ return (
+
+
+ ),
+ (
+
+ ),
+ (
+
+ ),
+ ]}
+ />
+
+ );
+};
+
+export default MintNft;
diff --git a/src/components/msg/marketplace/publish_collection/__snapshots__/index.test.tsx.snap b/src/components/msg/marketplace/publish_collection/__snapshots__/index.test.tsx.snap
new file mode 100644
index 0000000000..d55d930a8e
--- /dev/null
+++ b/src/components/msg/marketplace/publish_collection/__snapshots__/index.test.tsx.snap
@@ -0,0 +1,47 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`screen: TransactionDetails/MsgPublishCollection matches snapshot 1`] = `
+
+
,
+ ,
+ ,
+ ]
+ }
+ i18nKey="message_contents:txPublishCollection"
+ id="message_contents:txPublishCollection"
+ values={
+ Object {
+ "collectionId": "collectionId",
+ }
+ }
+ />
+
+`;
diff --git a/src/components/msg/marketplace/publish_collection/index.test.tsx b/src/components/msg/marketplace/publish_collection/index.test.tsx
new file mode 100644
index 0000000000..d3a8fd1813
--- /dev/null
+++ b/src/components/msg/marketplace/publish_collection/index.test.tsx
@@ -0,0 +1,52 @@
+import React from 'react';
+import { RecoilRoot } from 'recoil';
+import renderer from 'react-test-renderer';
+import { MockTheme } from '@tests/utils';
+import { MsgPublishCollection } from '@models';
+import PublishCollection from '.';
+
+jest.mock('@components', () => ({
+ Name: (props) => ,
+}));
+
+jest.mock('next-translate/Trans', () => (
+ (props) =>
+));
+
+// ==================================
+// unit tests
+// ==================================
+describe('screen: TransactionDetails/MsgPublishCollection', () => {
+ it('matches snapshot', () => {
+ const message = new MsgPublishCollection({
+ category: 'marketplace',
+ type: 'MsgPublishCollection',
+ creator: 'Creator',
+ collectionId: 'collectionId',
+ mintRoyalties: [{
+ address: 'address',
+ percent: 'percent',
+ }],
+ resaleRoyalties: [{
+ address: 'address',
+ percent: 'percent',
+ }],
+ });
+ const component = renderer.create(
+
+
+
+
+ ,
+ );
+ const tree = component.toJSON();
+ expect(tree).toMatchSnapshot();
+ expect(component.root.findByProps({ id: 'message_contents:txPublishCollection' }).props.i18nKey).toEqual('message_contents:txPublishCollection');
+ });
+
+ afterEach(() => {
+ jest.clearAllMocks();
+ });
+});
diff --git a/src/components/msg/marketplace/publish_collection/index.tsx b/src/components/msg/marketplace/publish_collection/index.tsx
new file mode 100644
index 0000000000..0288abcb57
--- /dev/null
+++ b/src/components/msg/marketplace/publish_collection/index.tsx
@@ -0,0 +1,48 @@
+import React from 'react';
+import Trans from 'next-translate/Trans';
+import { Typography } from '@material-ui/core';
+import {
+ Name,
+ RoyaltiesDetails,
+} from '@components';
+import { MsgPublishCollection } from '@models';
+
+const PublishCollection = (props: {
+ message: MsgPublishCollection;
+}) => {
+ const { message } = props;
+ const { creator } = message;
+
+ return (
+
+
+ ),
+ (
+
+ ),
+ (
+
+ ),
+ ]}
+ values={{
+ collectionId: message.collectionId,
+ }}
+ />
+
+ );
+};
+
+export default PublishCollection;
diff --git a/src/components/msg/marketplace/publish_nft/__snapshots__/index.test.tsx.snap b/src/components/msg/marketplace/publish_nft/__snapshots__/index.test.tsx.snap
new file mode 100644
index 0000000000..a0c352c529
--- /dev/null
+++ b/src/components/msg/marketplace/publish_nft/__snapshots__/index.test.tsx.snap
@@ -0,0 +1,27 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`screen: TransactionDetails/MsgPublishNft matches snapshot 1`] = `
+
+
,
+ ]
+ }
+ i18nKey="message_contents:txPublishNft"
+ id="message_contents:txPublishNft"
+ values={
+ Object {
+ "denomId": "denomId",
+ "price": "1 acudos",
+ "tokenId": "tokenId",
+ }
+ }
+ />
+
+`;
diff --git a/src/components/msg/marketplace/publish_nft/index.test.tsx b/src/components/msg/marketplace/publish_nft/index.test.tsx
new file mode 100644
index 0000000000..ba577770ef
--- /dev/null
+++ b/src/components/msg/marketplace/publish_nft/index.test.tsx
@@ -0,0 +1,48 @@
+import React from 'react';
+import { RecoilRoot } from 'recoil';
+import renderer from 'react-test-renderer';
+import { MockTheme } from '@tests/utils';
+import { MsgPublishNft } from '@models';
+import { formatToken } from '@src/utils/format_token';
+import PublishNft from '.';
+
+jest.mock('@components', () => ({
+ Name: (props) => ,
+}));
+
+jest.mock('next-translate/Trans', () => (
+ (props) =>
+));
+
+// ==================================
+// unit tests
+// ==================================
+describe('screen: TransactionDetails/MsgPublishNft', () => {
+ it('matches snapshot', () => {
+ const message = new MsgPublishNft({
+ category: 'marketplace',
+ type: 'MsgPublishNft',
+ creator: 'creator',
+ denomId: 'denomId',
+ tokenId: 'tokenId',
+ price: formatToken('1', 'acudos'),
+ });
+
+ const component = renderer.create(
+
+
+
+
+ ,
+ );
+ const tree = component.toJSON();
+ expect(tree).toMatchSnapshot();
+ expect(component.root.findByProps({ id: 'message_contents:txPublishNft' }).props.i18nKey).toEqual('message_contents:txPublishNft');
+ });
+
+ afterEach(() => {
+ jest.clearAllMocks();
+ });
+});
diff --git a/src/components/msg/marketplace/publish_nft/index.tsx b/src/components/msg/marketplace/publish_nft/index.tsx
new file mode 100644
index 0000000000..e0b08fceae
--- /dev/null
+++ b/src/components/msg/marketplace/publish_nft/index.tsx
@@ -0,0 +1,37 @@
+import React from 'react';
+import Trans from 'next-translate/Trans';
+import { Typography } from '@material-ui/core';
+import { Name } from '@components';
+import { MsgPublishNft } from '@models';
+
+const MintNft = (props: {
+ message: MsgPublishNft;
+}) => {
+ const { message } = props;
+ const {
+ creator, price, denomId, tokenId,
+ } = message;
+
+ return (
+
+
+ ),
+ ]}
+ values={{
+ price: `${price.value} ${price.displayDenom}`,
+ denomId,
+ tokenId,
+ }}
+ />
+
+ );
+};
+
+export default MintNft;
diff --git a/src/components/msg/marketplace/remove_admin/__snapshots__/index.test.tsx.snap b/src/components/msg/marketplace/remove_admin/__snapshots__/index.test.tsx.snap
new file mode 100644
index 0000000000..252ce4c8ad
--- /dev/null
+++ b/src/components/msg/marketplace/remove_admin/__snapshots__/index.test.tsx.snap
@@ -0,0 +1,24 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`screen: TransactionDetails/MsgRemoveAdmin matches snapshot 1`] = `
+
+
,
+ ,
+ ]
+ }
+ i18nKey="message_contents:txRemoveAdmin"
+ id="message_contents:txRemoveAdmin"
+ />
+
+`;
diff --git a/src/components/msg/marketplace/remove_admin/index.test.tsx b/src/components/msg/marketplace/remove_admin/index.test.tsx
new file mode 100644
index 0000000000..80aef7c99d
--- /dev/null
+++ b/src/components/msg/marketplace/remove_admin/index.test.tsx
@@ -0,0 +1,44 @@
+import React from 'react';
+import { RecoilRoot } from 'recoil';
+import renderer from 'react-test-renderer';
+import { MockTheme } from '@tests/utils';
+import { MsgRemoveAdmin } from '@models';
+import RemoveAdmin from '.';
+
+jest.mock('@components', () => ({
+ Name: (props) => ,
+}));
+
+jest.mock('next-translate/Trans', () => (
+ (props) =>
+));
+
+// ==================================
+// unit tests
+// ==================================
+describe('screen: TransactionDetails/MsgRemoveAdmin', () => {
+ it('matches snapshot', () => {
+ const message = new MsgRemoveAdmin({
+ category: 'marketplace',
+ type: 'MsgRemoveAdmin',
+ creator: 'creator',
+ address: 'address',
+ });
+ const component = renderer.create(
+
+
+
+
+ ,
+ );
+ const tree = component.toJSON();
+ expect(tree).toMatchSnapshot();
+ expect(component.root.findByProps({ id: 'message_contents:txRemoveAdmin' }).props.i18nKey).toEqual('message_contents:txRemoveAdmin');
+ });
+
+ afterEach(() => {
+ jest.clearAllMocks();
+ });
+});
diff --git a/src/components/msg/marketplace/remove_admin/index.tsx b/src/components/msg/marketplace/remove_admin/index.tsx
new file mode 100644
index 0000000000..e8ad53cb54
--- /dev/null
+++ b/src/components/msg/marketplace/remove_admin/index.tsx
@@ -0,0 +1,40 @@
+import React from 'react';
+import Trans from 'next-translate/Trans';
+import { Typography } from '@material-ui/core';
+import {
+ Name,
+} from '@components';
+import { MsgRemoveAdmin } from '@models';
+
+const RemoveAdmin = (props: {
+ message: MsgRemoveAdmin;
+}) => {
+ const { message } = props;
+ const {
+ creator, address,
+ } = message;
+
+ return (
+
+
+ ),
+ (
+
+ ),
+ ]}
+ />
+
+ );
+};
+
+export default RemoveAdmin;
diff --git a/src/components/msg/marketplace/remove_nft/__snapshots__/index.test.tsx.snap b/src/components/msg/marketplace/remove_nft/__snapshots__/index.test.tsx.snap
new file mode 100644
index 0000000000..b291793bfd
--- /dev/null
+++ b/src/components/msg/marketplace/remove_nft/__snapshots__/index.test.tsx.snap
@@ -0,0 +1,25 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`screen: TransactionDetails/MsgRemoveNft matches snapshot 1`] = `
+
+
,
+ ]
+ }
+ i18nKey="message_contents:txRemoveNft"
+ id="message_contents:txRemoveNft"
+ values={
+ Object {
+ "id": "id",
+ }
+ }
+ />
+
+`;
diff --git a/src/components/msg/marketplace/remove_nft/index.test.tsx b/src/components/msg/marketplace/remove_nft/index.test.tsx
new file mode 100644
index 0000000000..b8fa8c87d9
--- /dev/null
+++ b/src/components/msg/marketplace/remove_nft/index.test.tsx
@@ -0,0 +1,45 @@
+import React from 'react';
+import { RecoilRoot } from 'recoil';
+import renderer from 'react-test-renderer';
+import { MockTheme } from '@tests/utils';
+import { MsgRemoveNft } from '@models';
+import RemoveNft from '.';
+
+jest.mock('@components', () => ({
+ Name: (props) => ,
+}));
+
+jest.mock('next-translate/Trans', () => (
+ (props) =>
+));
+
+// ==================================
+// unit tests
+// ==================================
+describe('screen: TransactionDetails/MsgRemoveNft', () => {
+ it('matches snapshot', () => {
+ const message = new MsgRemoveNft({
+ category: 'marketplace',
+ type: 'MsgRemoveNft',
+ creator: 'creator',
+ id: 'id',
+ });
+
+ const component = renderer.create(
+
+
+
+
+ ,
+ );
+ const tree = component.toJSON();
+ expect(tree).toMatchSnapshot();
+ expect(component.root.findByProps({ id: 'message_contents:txRemoveNft' }).props.i18nKey).toEqual('message_contents:txRemoveNft');
+ });
+
+ afterEach(() => {
+ jest.clearAllMocks();
+ });
+});
diff --git a/src/components/msg/marketplace/remove_nft/index.tsx b/src/components/msg/marketplace/remove_nft/index.tsx
new file mode 100644
index 0000000000..b238e6f981
--- /dev/null
+++ b/src/components/msg/marketplace/remove_nft/index.tsx
@@ -0,0 +1,32 @@
+import React from 'react';
+import Trans from 'next-translate/Trans';
+import { Typography } from '@material-ui/core';
+import { Name } from '@components';
+import { MsgRemoveNft } from '@models';
+
+const RemoveNft = (props: {
+ message: MsgRemoveNft;
+}) => {
+ const { message } = props;
+
+ return (
+
+
+ ),
+ ]}
+ values={{
+ id: message.id,
+ }}
+ />
+
+ );
+};
+
+export default RemoveNft;
diff --git a/src/components/msg/marketplace/unverify_collection/__snapshots__/index.test.tsx.snap b/src/components/msg/marketplace/unverify_collection/__snapshots__/index.test.tsx.snap
new file mode 100644
index 0000000000..ce887f8cc0
--- /dev/null
+++ b/src/components/msg/marketplace/unverify_collection/__snapshots__/index.test.tsx.snap
@@ -0,0 +1,29 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`screen: TransactionDetails/MsgUnverifyCollection matches snapshot 1`] = `
+
+
,
+ ,
+ ]
+ }
+ i18nKey="message_contents:txUnverifyCollection"
+ id="message_contents:txUnverifyCollection"
+ values={
+ Object {
+ "collectionId": "collectionId",
+ }
+ }
+ />
+
+`;
diff --git a/src/components/msg/marketplace/unverify_collection/index.test.tsx b/src/components/msg/marketplace/unverify_collection/index.test.tsx
new file mode 100644
index 0000000000..1a999b7be9
--- /dev/null
+++ b/src/components/msg/marketplace/unverify_collection/index.test.tsx
@@ -0,0 +1,45 @@
+import React from 'react';
+import { RecoilRoot } from 'recoil';
+import renderer from 'react-test-renderer';
+import { MockTheme } from '@tests/utils';
+import { MsgUnverifyCollection } from '@models';
+import UnverifyCollection from '.';
+
+jest.mock('@components', () => ({
+ Name: (props) => ,
+}));
+
+jest.mock('next-translate/Trans', () => (
+ (props) =>
+));
+
+// ==================================
+// unit tests
+// ==================================
+describe('screen: TransactionDetails/MsgUnverifyCollection', () => {
+ it('matches snapshot', () => {
+ const message = new MsgUnverifyCollection({
+ category: 'marketplace',
+ type: 'MsgUnverifyCollection',
+ creator: 'Creator',
+ collectionId: 'collectionId',
+ admin: 'admin',
+ });
+ const component = renderer.create(
+
+
+
+
+ ,
+ );
+ const tree = component.toJSON();
+ expect(tree).toMatchSnapshot();
+ expect(component.root.findByProps({ id: 'message_contents:txUnverifyCollection' }).props.i18nKey).toEqual('message_contents:txUnverifyCollection');
+ });
+
+ afterEach(() => {
+ jest.clearAllMocks();
+ });
+});
diff --git a/src/components/msg/marketplace/unverify_collection/index.tsx b/src/components/msg/marketplace/unverify_collection/index.tsx
new file mode 100644
index 0000000000..0713ffeb97
--- /dev/null
+++ b/src/components/msg/marketplace/unverify_collection/index.tsx
@@ -0,0 +1,43 @@
+import React from 'react';
+import Trans from 'next-translate/Trans';
+import { Typography } from '@material-ui/core';
+import {
+ Name,
+} from '@components';
+import { MsgUnverifyCollection } from '@models';
+
+const UnverifyCollection = (props: {
+ message: MsgUnverifyCollection;
+}) => {
+ const { message } = props;
+ const {
+ creator, admin,
+ } = message;
+
+ return (
+
+
+ ),
+ (
+
+ ),
+ ]}
+ values={{
+ collectionId: message.collectionId,
+ }}
+ />
+
+ );
+};
+
+export default UnverifyCollection;
diff --git a/src/components/msg/marketplace/update_price/__snapshots__/index.test.tsx.snap b/src/components/msg/marketplace/update_price/__snapshots__/index.test.tsx.snap
new file mode 100644
index 0000000000..03f3f31869
--- /dev/null
+++ b/src/components/msg/marketplace/update_price/__snapshots__/index.test.tsx.snap
@@ -0,0 +1,26 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`screen: TransactionDetails/MsgUpdatePrice matches snapshot 1`] = `
+
+
,
+ ]
+ }
+ i18nKey="message_contents:txUpdatePrice"
+ id="message_contents:txUpdatePrice"
+ values={
+ Object {
+ "id": "id",
+ "price": "1 acudos",
+ }
+ }
+ />
+
+`;
diff --git a/src/components/msg/marketplace/update_price/index.test.tsx b/src/components/msg/marketplace/update_price/index.test.tsx
new file mode 100644
index 0000000000..186cb3777c
--- /dev/null
+++ b/src/components/msg/marketplace/update_price/index.test.tsx
@@ -0,0 +1,47 @@
+import React from 'react';
+import { RecoilRoot } from 'recoil';
+import renderer from 'react-test-renderer';
+import { MockTheme } from '@tests/utils';
+import { MsgUpdatePrice } from '@models';
+import { formatToken } from '@src/utils/format_token';
+import UpdatePrice from '.';
+
+jest.mock('@components', () => ({
+ Name: (props) => ,
+}));
+
+jest.mock('next-translate/Trans', () => (
+ (props) =>
+));
+
+// ==================================
+// unit tests
+// ==================================
+describe('screen: TransactionDetails/MsgUpdatePrice', () => {
+ it('matches snapshot', () => {
+ const message = new MsgUpdatePrice({
+ category: 'marketplace',
+ type: 'MsgUpdatePrice',
+ creator: 'creator',
+ id: 'id',
+ price: formatToken('1', 'acudos'),
+ });
+
+ const component = renderer.create(
+
+
+
+
+ ,
+ );
+ const tree = component.toJSON();
+ expect(tree).toMatchSnapshot();
+ expect(component.root.findByProps({ id: 'message_contents:txUpdatePrice' }).props.i18nKey).toEqual('message_contents:txUpdatePrice');
+ });
+
+ afterEach(() => {
+ jest.clearAllMocks();
+ });
+});
diff --git a/src/components/msg/marketplace/update_price/index.tsx b/src/components/msg/marketplace/update_price/index.tsx
new file mode 100644
index 0000000000..06888c23c6
--- /dev/null
+++ b/src/components/msg/marketplace/update_price/index.tsx
@@ -0,0 +1,33 @@
+import React from 'react';
+import Trans from 'next-translate/Trans';
+import { Typography } from '@material-ui/core';
+import { Name } from '@components';
+import { MsgUpdatePrice } from '@models';
+
+const UpdatePrice = (props: {
+ message: MsgUpdatePrice;
+}) => {
+ const { message } = props;
+
+ return (
+
+
+ ),
+ ]}
+ values={{
+ price: `${message.price.value} ${message.price.displayDenom}`,
+ id: message.id,
+ }}
+ />
+
+ );
+};
+
+export default UpdatePrice;
diff --git a/src/components/msg/marketplace/update_royalties/__snapshots__/index.test.tsx.snap b/src/components/msg/marketplace/update_royalties/__snapshots__/index.test.tsx.snap
new file mode 100644
index 0000000000..f7cbedaa9e
--- /dev/null
+++ b/src/components/msg/marketplace/update_royalties/__snapshots__/index.test.tsx.snap
@@ -0,0 +1,47 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`screen: TransactionDetails/MsgPublishCollection matches snapshot 1`] = `
+
+
,
+ ,
+ ,
+ ]
+ }
+ i18nKey="message_contents:txUpdateRoyalties"
+ id="message_contents:txUpdateRoyalties"
+ values={
+ Object {
+ "collectionId": "collectionId",
+ }
+ }
+ />
+
+`;
diff --git a/src/components/msg/marketplace/update_royalties/index.test.tsx b/src/components/msg/marketplace/update_royalties/index.test.tsx
new file mode 100644
index 0000000000..0feee59c13
--- /dev/null
+++ b/src/components/msg/marketplace/update_royalties/index.test.tsx
@@ -0,0 +1,52 @@
+import React from 'react';
+import { RecoilRoot } from 'recoil';
+import renderer from 'react-test-renderer';
+import { MockTheme } from '@tests/utils';
+import { MsgUpdateRoyalties } from '@models';
+import UpdateRoyalties from '.';
+
+jest.mock('@components', () => ({
+ Name: (props) => ,
+}));
+
+jest.mock('next-translate/Trans', () => (
+ (props) =>
+));
+
+// ==================================
+// unit tests
+// ==================================
+describe('screen: TransactionDetails/MsgPublishCollection', () => {
+ it('matches snapshot', () => {
+ const message = new MsgUpdateRoyalties({
+ category: 'marketplace',
+ type: 'MsgUpdateRoyalties',
+ creator: 'Creator',
+ collectionId: 'collectionId',
+ mintRoyalties: [{
+ address: 'address',
+ percent: 'percent',
+ }],
+ resaleRoyalties: [{
+ address: 'address',
+ percent: 'percent',
+ }],
+ });
+ const component = renderer.create(
+
+
+
+
+ ,
+ );
+ const tree = component.toJSON();
+ expect(tree).toMatchSnapshot();
+ expect(component.root.findByProps({ id: 'message_contents:txUpdateRoyalties' }).props.i18nKey).toEqual('message_contents:txUpdateRoyalties');
+ });
+
+ afterEach(() => {
+ jest.clearAllMocks();
+ });
+});
diff --git a/src/components/msg/marketplace/update_royalties/index.tsx b/src/components/msg/marketplace/update_royalties/index.tsx
new file mode 100644
index 0000000000..7f6083b68e
--- /dev/null
+++ b/src/components/msg/marketplace/update_royalties/index.tsx
@@ -0,0 +1,48 @@
+import React from 'react';
+import Trans from 'next-translate/Trans';
+import { Typography } from '@material-ui/core';
+import {
+ Name,
+ RoyaltiesDetails,
+} from '@components';
+import { MsgUpdateRoyalties } from '@models';
+
+const UpdateRoyalties = (props: {
+ message: MsgUpdateRoyalties;
+}) => {
+ const { message } = props;
+ const { creator } = message;
+
+ return (
+
+
+ ),
+ (
+
+ ),
+ (
+
+ ),
+ ]}
+ values={{
+ collectionId: message.collectionId,
+ }}
+ />
+
+ );
+};
+
+export default UpdateRoyalties;
diff --git a/src/components/msg/marketplace/verify_collection/__snapshots__/index.test.tsx.snap b/src/components/msg/marketplace/verify_collection/__snapshots__/index.test.tsx.snap
new file mode 100644
index 0000000000..022e14859b
--- /dev/null
+++ b/src/components/msg/marketplace/verify_collection/__snapshots__/index.test.tsx.snap
@@ -0,0 +1,29 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`screen: TransactionDetails/MsgVerifyCollection matches snapshot 1`] = `
+
+
,
+ ,
+ ]
+ }
+ i18nKey="message_contents:txVerifyCollection"
+ id="message_contents:txVerifyCollection"
+ values={
+ Object {
+ "collectionId": "collectionId",
+ }
+ }
+ />
+
+`;
diff --git a/src/components/msg/marketplace/verify_collection/index.test.tsx b/src/components/msg/marketplace/verify_collection/index.test.tsx
new file mode 100644
index 0000000000..154ca91490
--- /dev/null
+++ b/src/components/msg/marketplace/verify_collection/index.test.tsx
@@ -0,0 +1,45 @@
+import React from 'react';
+import { RecoilRoot } from 'recoil';
+import renderer from 'react-test-renderer';
+import { MockTheme } from '@tests/utils';
+import { MsgVerifyCollection } from '@models';
+import VerifyCollection from '.';
+
+jest.mock('@components', () => ({
+ Name: (props) => ,
+}));
+
+jest.mock('next-translate/Trans', () => (
+ (props) =>
+));
+
+// ==================================
+// unit tests
+// ==================================
+describe('screen: TransactionDetails/MsgVerifyCollection', () => {
+ it('matches snapshot', () => {
+ const message = new MsgVerifyCollection({
+ category: 'marketplace',
+ type: 'MsgVerifyCollection',
+ creator: 'Creator',
+ collectionId: 'collectionId',
+ admin: 'admin',
+ });
+ const component = renderer.create(
+
+
+
+
+ ,
+ );
+ const tree = component.toJSON();
+ expect(tree).toMatchSnapshot();
+ expect(component.root.findByProps({ id: 'message_contents:txVerifyCollection' }).props.i18nKey).toEqual('message_contents:txVerifyCollection');
+ });
+
+ afterEach(() => {
+ jest.clearAllMocks();
+ });
+});
diff --git a/src/components/msg/marketplace/verify_collection/index.tsx b/src/components/msg/marketplace/verify_collection/index.tsx
new file mode 100644
index 0000000000..3c47712bf1
--- /dev/null
+++ b/src/components/msg/marketplace/verify_collection/index.tsx
@@ -0,0 +1,43 @@
+import React from 'react';
+import Trans from 'next-translate/Trans';
+import { Typography } from '@material-ui/core';
+import {
+ Name,
+} from '@components';
+import { MsgVerifyCollection } from '@models';
+
+const VerifyCollection = (props: {
+ message: MsgVerifyCollection;
+}) => {
+ const { message } = props;
+ const {
+ creator, admin,
+ } = message;
+
+ return (
+
+
+ ),
+ (
+
+ ),
+ ]}
+ values={{
+ collectionId: message.collectionId,
+ }}
+ />
+
+ );
+};
+
+export default VerifyCollection;
diff --git a/src/components/msg/utils.tsx b/src/components/msg/utils.tsx
index bd690b2a12..06df13c3b0 100644
--- a/src/components/msg/utils.tsx
+++ b/src/components/msg/utils.tsx
@@ -475,7 +475,82 @@ const getDataByType = (type: string) => {
model: MODELS.MsgDeleteAddress,
content: COMPONENTS.DeleteAddress,
tagTheme: 'twentyOne',
- tagDisplay: 'txDeleteAddress',
+ tagDisplay: 'txCreateCollection',
+ },
+ // ========================
+ // Marketplace
+ // ========================
+ '/cudoventures.cudosnode.marketplace.MsgCreateCollection': {
+ model: MODELS.MsgCreateCollection,
+ content: COMPONENTS.CreateCollection,
+ tagTheme: 'twentyTwo',
+ tagDisplay: 'txCreateCollection',
+ },
+ '/cudoventures.cudosnode.marketplace.MsgPublishCollection': {
+ model: MODELS.MsgPublishCollection,
+ content: COMPONENTS.PublishCollection,
+ tagTheme: 'twentyTwo',
+ tagDisplay: 'txPublishCollection',
+ },
+ '/cudoventures.cudosnode.marketplace.MsgVerifyCollection': {
+ model: MODELS.MsgVerifyCollection,
+ content: COMPONENTS.VerifyCollection,
+ tagTheme: 'twentyTwo',
+ tagDisplay: 'txPublishCollection',
+ },
+ '/cudoventures.cudosnode.marketplace.MsgUnverifyCollection': {
+ model: MODELS.MsgUnverifyCollection,
+ content: COMPONENTS.UnverifyCollection,
+ tagTheme: 'twentyTwo',
+ tagDisplay: 'txUnverifyCollection',
+ },
+ '/cudoventures.cudosnode.marketplace.MsgAddAdmin': {
+ model: MODELS.MsgAddAdmin,
+ content: COMPONENTS.AddAdmin,
+ tagTheme: 'twentyTwo',
+ tagDisplay: 'txAddAdmin',
+ },
+ '/cudoventures.cudosnode.marketplace.MsgMintNft': {
+ model: MODELS.MsgMintNft,
+ content: COMPONENTS.MintNft,
+ tagTheme: 'twentyTwo',
+ tagDisplay: 'txMintNft',
+ },
+ '/cudoventures.cudosnode.marketplace.MsgPublishNft': {
+ model: MODELS.MsgPublishNft,
+ content: COMPONENTS.PublishNft,
+ tagTheme: 'twentyTwo',
+ tagDisplay: 'txPublishNft',
+ },
+ '/cudoventures.cudosnode.marketplace.MsgRemoveNft': {
+ model: MODELS.MsgRemoveNft,
+ content: COMPONENTS.RemoveNft,
+ tagTheme: 'twentyTwo',
+ tagDisplay: 'txRemoveNft',
+ },
+ '/cudoventures.cudosnode.marketplace.MsgUpdatePrice': {
+ model: MODELS.MsgUpdatePrice,
+ content: COMPONENTS.UpdatePrice,
+ tagTheme: 'twentyTwo',
+ tagDisplay: 'txUpdatePrice',
+ },
+ '/cudoventures.cudosnode.marketplace.MsgUpdateRoyalties': {
+ model: MODELS.MsgUpdateRoyalties,
+ content: COMPONENTS.UpdateRoyalties,
+ tagTheme: 'twentyTwo',
+ tagDisplay: 'txUpdateRoyalties',
+ },
+ '/cudoventures.cudosnode.marketplace.MsgBuyNft': {
+ model: MODELS.MsgBuyNft,
+ content: COMPONENTS.BuyNft,
+ tagTheme: 'twentyTwo',
+ tagDisplay: 'txBuyNft',
+ },
+ '/cudoventures.cudosnode.marketplace.MsgRemoveAdmin': {
+ model: MODELS.MsgRemoveAdmin,
+ content: COMPONENTS.RemoveAdmin,
+ tagTheme: 'twentyTwo',
+ tagDisplay: 'txRemoveAdmin',
},
};
@@ -543,7 +618,10 @@ export const convertMsgsToModels = (transaction: any) => {
const model = getMessageModelByType(msg?.['@type']);
if (model === MODELS.MsgWithdrawDelegatorReward
|| model === MODELS.MsgWithdrawValidatorCommission
- || model === MODELS.MsgInstantiateContract) {
+ || model === MODELS.MsgInstantiateContract
+ || model === MODELS.MsgVerifyCollection
+ || model === MODELS.MsgUnverifyCollection
+ || model === MODELS.MsgBuyNft) {
const log = R.pathOr(null, ['logs', i], transaction);
return model.fromJson(msg, log);
}
diff --git a/src/components/nft_details/index.tsx b/src/components/nft_details/index.tsx
new file mode 100644
index 0000000000..ab28eeb80f
--- /dev/null
+++ b/src/components/nft_details/index.tsx
@@ -0,0 +1,21 @@
+import React from 'react';
+import { MintedNft } from '@src/models/msg/types';
+import { Typography } from '@material-ui/core';
+import StyledTypographyPair from '../styled_typography_pair';
+import { title } from '../styled_typography_pair/styles';
+
+const NftDetails = ({ content }: { content: MintedNft }) => {
+ return (
+ <>
+ NFT DETAILS
+ {content.denomId ? : null}
+ {content.name ? : null}
+ {content.price.value ? : null}
+ {content.uid ? : null}
+ {content.uri ? : null}
+ {content.data ? : null}
+ >
+ );
+};
+
+export default NftDetails;
diff --git a/src/components/royalties_details/index.tsx b/src/components/royalties_details/index.tsx
new file mode 100644
index 0000000000..e6168b3009
--- /dev/null
+++ b/src/components/royalties_details/index.tsx
@@ -0,0 +1,32 @@
+import React from 'react';
+import {
+ Typography,
+ Box,
+} from '@material-ui/core';
+import { Royalties } from '@src/models/msg/types';
+import Name from '../name';
+import {
+ holder, title,
+} from '../styled_typography_pair/styles';
+
+const RoyaltiesDetails = ({
+ type, royalties,
+}: { type: 'Mint' | 'Resale', royalties: Royalties[] }) => {
+ return !royalties.length ? null : (
+ <>
+ {`${type} Royalties`}
+ {royalties.map((royaltie) => {
+ return (
+
+
+
+ {`${parseFloat(royaltie.percent)} %`}
+
+
+ );
+ })}
+ >
+ );
+};
+
+export default RoyaltiesDetails;
diff --git a/src/components/styled_typography_pair/index.tsx b/src/components/styled_typography_pair/index.tsx
new file mode 100644
index 0000000000..58cc3e9d6b
--- /dev/null
+++ b/src/components/styled_typography_pair/index.tsx
@@ -0,0 +1,26 @@
+import {
+ Typography,
+ Box,
+} from '@material-ui/core';
+import { holder } from './styles';
+
+const StyledTypographyPair = ({
+ text,
+ content,
+}: {
+ text: string,
+ content: string
+}) => {
+ return (
+
+
+ {text}
+
+
+ {content}
+
+
+ );
+};
+
+export default StyledTypographyPair;
diff --git a/src/components/styled_typography_pair/styles.ts b/src/components/styled_typography_pair/styles.ts
new file mode 100644
index 0000000000..31d246fc23
--- /dev/null
+++ b/src/components/styled_typography_pair/styles.ts
@@ -0,0 +1,10 @@
+export const holder = {
+ gap: '10px',
+ width: '100%',
+ display: 'flex',
+};
+
+export const title = {
+ marginTop: '10px',
+ fontWeight: 900,
+};
diff --git a/src/models/index.ts b/src/models/index.ts
index f7000516ef..dcd5c69c9d 100644
--- a/src/models/index.ts
+++ b/src/models/index.ts
@@ -79,6 +79,18 @@ import MsgSendToCosmosClaim from './msg/gravity/msg_send_to_cosmos_claim';
import MsgCreateAddress from './msg/addressbook/msg_create_address';
import MsgUpdateAddress from './msg/addressbook/msg_update_address';
import MsgDeleteAddress from './msg/addressbook/msg_delete_address';
+import MsgCreateCollection from './msg/marketplace/msg_create_collection';
+import MsgPublishCollection from './msg/marketplace/msg_publish_collection';
+import MsgVerifyCollection from './msg/marketplace/msg_verify_collection';
+import MsgUnverifyCollection from './msg/marketplace/msg_unverify_collection';
+import MsgAddAdmin from './msg/marketplace/msg_add_admin';
+import MsgMintNft from './msg/marketplace/msg_mint_nft';
+import MsgPublishNft from './msg/marketplace/msg_publish_nft';
+import MsgRemoveNft from './msg/marketplace/msg_remove_nft';
+import MsgUpdatePrice from './msg/marketplace/msg_update_price';
+import MsgUpdateRoyalties from './msg/marketplace/msg_update_royalties';
+import MsgBuyNft from './msg/marketplace/msg_buy_nft';
+import MsgRemoveAdmin from './msg/marketplace/msg_remove_admin';
export {
BigDipperNetwork,
@@ -162,4 +174,16 @@ export {
MsgCreateAddress,
MsgUpdateAddress,
MsgDeleteAddress,
+ MsgCreateCollection,
+ MsgPublishCollection,
+ MsgVerifyCollection,
+ MsgUnverifyCollection,
+ MsgAddAdmin,
+ MsgMintNft,
+ MsgPublishNft,
+ MsgRemoveNft,
+ MsgUpdatePrice,
+ MsgUpdateRoyalties,
+ MsgBuyNft,
+ MsgRemoveAdmin,
};
diff --git a/src/models/msg/marketplace/msg_add_admin.ts b/src/models/msg/marketplace/msg_add_admin.ts
new file mode 100644
index 0000000000..f8928449c3
--- /dev/null
+++ b/src/models/msg/marketplace/msg_add_admin.ts
@@ -0,0 +1,28 @@
+import { Categories } from '../types';
+
+class MsgAddAdmin {
+ public category: Categories;
+ public type: string;
+ public json: any;
+ public creator: string;
+ public address: string;
+
+ constructor(payload: any) {
+ this.category = 'marketplace';
+ this.type = payload.type;
+ this.json = payload.json;
+ this.creator = payload.creator;
+ this.address = payload.address;
+ }
+
+ static fromJson(json: any) {
+ return new MsgAddAdmin({
+ json,
+ type: json['@type'],
+ creator: json.creator,
+ address: json.address,
+ });
+ }
+}
+
+export default MsgAddAdmin;
diff --git a/src/models/msg/marketplace/msg_buy_nft.ts b/src/models/msg/marketplace/msg_buy_nft.ts
new file mode 100644
index 0000000000..455b7b8c60
--- /dev/null
+++ b/src/models/msg/marketplace/msg_buy_nft.ts
@@ -0,0 +1,54 @@
+import { formatToken } from '@src/utils/format_token';
+import { Categories } from '../types';
+
+class MsgBuyNft {
+ public category: Categories;
+ public type: string;
+ public json: any;
+ public seller: string;
+ public buyer: string;
+ public id: string;
+ public price: TokenUnit;
+
+ constructor(payload: any) {
+ this.category = 'marketplace';
+ this.type = payload.type;
+ this.json = payload.json;
+ this.seller = payload.seller;
+ this.buyer = payload.buyer;
+ this.id = payload.id;
+ this.price = payload.price;
+ }
+
+ static getPriceFromSaleEvents(events: any): TokenUnit {
+ const salePrice = events
+ .attributes.find((attribute: { key: string; }) => attribute.key === 'price')
+ .value || undefined;
+ const splitPrice = salePrice.split(/(\d+)/);
+ return formatToken(splitPrice[1], splitPrice[2]);
+ }
+
+ static getSellerFromSaleEvents(events: any) {
+ return events
+ .attributes.find((attribute: { key: string; }) => attribute.key === 'owner')
+ .value || undefined;
+ }
+
+ static getSaleEventsFromLog(log: any) {
+ return log.events.find((event: { type: string; }) => event.type === 'buy_nft');
+ }
+
+ static fromJson(json: any, log?: any) {
+ const saleEvents = this.getSaleEventsFromLog(log);
+ return new MsgBuyNft({
+ json,
+ type: json['@type'],
+ seller: this.getSellerFromSaleEvents(saleEvents),
+ buyer: json.creator,
+ id: json.id,
+ price: this.getPriceFromSaleEvents(saleEvents),
+ });
+ }
+}
+
+export default MsgBuyNft;
diff --git a/src/models/msg/marketplace/msg_create_collection.ts b/src/models/msg/marketplace/msg_create_collection.ts
new file mode 100644
index 0000000000..5301363a64
--- /dev/null
+++ b/src/models/msg/marketplace/msg_create_collection.ts
@@ -0,0 +1,35 @@
+import { Royalties } from '@src/models/msg/types';
+import { Categories } from '../types';
+
+class MsgCreateCollection {
+ public category: Categories;
+ public type: string;
+ public json: any;
+ public creator: string;
+ public collectionId: string;
+ public mintRoyalties: Royalties[];
+ public resaleRoyalties: Royalties[];
+
+ constructor(payload: any) {
+ this.category = 'marketplace';
+ this.type = payload.type;
+ this.json = payload.json;
+ this.creator = payload.creator;
+ this.collectionId = payload.collectionId;
+ this.mintRoyalties = payload.mintRoyalties;
+ this.resaleRoyalties = payload.resaleRoyalties;
+ }
+
+ static fromJson(json: any) {
+ return new MsgCreateCollection({
+ json,
+ type: json['@type'],
+ creator: json.creator,
+ collectionId: json.id,
+ mintRoyalties: json.mintRoyalties,
+ resaleRoyalties: json.resaleRoyalties,
+ });
+ }
+}
+
+export default MsgCreateCollection;
diff --git a/src/models/msg/marketplace/msg_mint_nft.ts b/src/models/msg/marketplace/msg_mint_nft.ts
new file mode 100644
index 0000000000..04c6204d07
--- /dev/null
+++ b/src/models/msg/marketplace/msg_mint_nft.ts
@@ -0,0 +1,41 @@
+import { formatToken } from '@src/utils/format_token';
+import {
+ Categories, MintedNft,
+} from '../types';
+
+class MsgMintNft {
+ public category: Categories;
+ public type: string;
+ public json: any;
+ public mintedNftData: MintedNft;
+ public creator: string;
+ public recipient: string;
+
+ constructor(payload: any) {
+ this.category = 'marketplace';
+ this.type = payload.type;
+ this.json = payload.json;
+ this.creator = payload.creator;
+ this.recipient = payload.recipient;
+ this.mintedNftData = payload.mintedNftData;
+ }
+
+ static fromJson(json: any) {
+ return new MsgMintNft({
+ json,
+ type: json['@type'],
+ creator: json.creator,
+ recipient: json.recipient,
+ mintedNftData: {
+ denomId: json.denomId,
+ uid: json.uid,
+ uri: json.uri,
+ data: json.data,
+ name: json.name,
+ price: formatToken(json.price.amount, json.price.denom),
+ },
+ });
+ }
+}
+
+export default MsgMintNft;
diff --git a/src/models/msg/marketplace/msg_publish_collection.ts b/src/models/msg/marketplace/msg_publish_collection.ts
new file mode 100644
index 0000000000..e62551489a
--- /dev/null
+++ b/src/models/msg/marketplace/msg_publish_collection.ts
@@ -0,0 +1,35 @@
+import { Royalties } from '@src/models/msg/types';
+import { Categories } from '../types';
+
+class MsgPublishCollection {
+ public category: Categories;
+ public type: string;
+ public json: any;
+ public creator: string;
+ public collectionId: string;
+ public mintRoyalties: Royalties[];
+ public resaleRoyalties: Royalties[];
+
+ constructor(payload: any) {
+ this.category = 'marketplace';
+ this.type = payload.type;
+ this.json = payload.json;
+ this.creator = payload.creator;
+ this.collectionId = payload.collectionId;
+ this.mintRoyalties = payload.mintRoyalties;
+ this.resaleRoyalties = payload.resaleRoyalties;
+ }
+
+ static fromJson(json: any) {
+ return new MsgPublishCollection({
+ json,
+ type: json['@type'],
+ creator: json.creator,
+ collectionId: json.denomId,
+ mintRoyalties: json.mintRoyalties,
+ resaleRoyalties: json.resaleRoyalties,
+ });
+ }
+}
+
+export default MsgPublishCollection;
diff --git a/src/models/msg/marketplace/msg_publish_nft.ts b/src/models/msg/marketplace/msg_publish_nft.ts
new file mode 100644
index 0000000000..a750e3f914
--- /dev/null
+++ b/src/models/msg/marketplace/msg_publish_nft.ts
@@ -0,0 +1,35 @@
+import { formatToken } from '@src/utils/format_token';
+import { Categories } from '../types';
+
+class MsgPublishNft {
+ public category: Categories;
+ public type: string;
+ public json: any;
+ public creator: string;
+ public denomId: string;
+ public tokenId: string;
+ public price: TokenUnit
+
+ constructor(payload: any) {
+ this.category = 'marketplace';
+ this.type = payload.type;
+ this.json = payload.json;
+ this.creator = payload.creator;
+ this.denomId = payload.denomId;
+ this.tokenId = payload.tokenId;
+ this.price = payload.price;
+ }
+
+ static fromJson(json: any) {
+ return new MsgPublishNft({
+ json,
+ type: json['@type'],
+ creator: json.creator,
+ denomId: json.denomId,
+ tokenId: json.tokenId,
+ price: formatToken(json.price.amount, json.price.denom),
+ });
+ }
+}
+
+export default MsgPublishNft;
diff --git a/src/models/msg/marketplace/msg_remove_admin.ts b/src/models/msg/marketplace/msg_remove_admin.ts
new file mode 100644
index 0000000000..5243f019c5
--- /dev/null
+++ b/src/models/msg/marketplace/msg_remove_admin.ts
@@ -0,0 +1,28 @@
+import { Categories } from '../types';
+
+class MsgRemoveAdmin {
+ public category: Categories;
+ public type: string;
+ public json: any;
+ public creator: string;
+ public address: string;
+
+ constructor(payload: any) {
+ this.category = 'marketplace';
+ this.type = payload.type;
+ this.json = payload.json;
+ this.creator = payload.creator;
+ this.address = payload.address;
+ }
+
+ static fromJson(json: any) {
+ return new MsgRemoveAdmin({
+ json,
+ type: json['@type'],
+ creator: json.creator,
+ address: json.address,
+ });
+ }
+}
+
+export default MsgRemoveAdmin;
diff --git a/src/models/msg/marketplace/msg_remove_nft.ts b/src/models/msg/marketplace/msg_remove_nft.ts
new file mode 100644
index 0000000000..297ec059c5
--- /dev/null
+++ b/src/models/msg/marketplace/msg_remove_nft.ts
@@ -0,0 +1,28 @@
+import { Categories } from '../types';
+
+class MsgRemoveNft {
+ public category: Categories;
+ public type: string;
+ public json: any;
+ public creator: string;
+ public id: string;
+
+ constructor(payload: any) {
+ this.category = 'marketplace';
+ this.type = payload.type;
+ this.json = payload.json;
+ this.creator = payload.creator;
+ this.id = payload.id;
+ }
+
+ static fromJson(json: any) {
+ return new MsgRemoveNft({
+ json,
+ type: json['@type'],
+ creator: json.creator,
+ id: json.id,
+ });
+ }
+}
+
+export default MsgRemoveNft;
diff --git a/src/models/msg/marketplace/msg_unverify_collection.ts b/src/models/msg/marketplace/msg_unverify_collection.ts
new file mode 100644
index 0000000000..fb32fa494e
--- /dev/null
+++ b/src/models/msg/marketplace/msg_unverify_collection.ts
@@ -0,0 +1,38 @@
+import { Categories } from '../types';
+
+class MsgUnverifyCollection {
+ public category: Categories;
+ public type: string;
+ public json: any;
+ public creator: string;
+ public admin: string;
+ public collectionId: string;
+
+ constructor(payload: any) {
+ this.category = 'marketplace';
+ this.type = payload.type;
+ this.json = payload.json;
+ this.creator = payload.creator;
+ this.admin = payload.admin;
+ this.collectionId = payload.collectionId;
+ }
+
+ static getAdminFromLog(log: any) {
+ return log
+ .events.find((event: { type: string; }) => event.type === 'message')
+ .attributes.find((attribute: { key: string; }) => attribute.key === 'sender')
+ .value || undefined;
+ }
+
+ static fromJson(json: any, log?: any) {
+ return new MsgUnverifyCollection({
+ json,
+ type: json['@type'],
+ creator: json.creator,
+ admin: this.getAdminFromLog(log),
+ collectionId: json.id,
+ });
+ }
+}
+
+export default MsgUnverifyCollection;
diff --git a/src/models/msg/marketplace/msg_update_price.ts b/src/models/msg/marketplace/msg_update_price.ts
new file mode 100644
index 0000000000..3eb7961fe4
--- /dev/null
+++ b/src/models/msg/marketplace/msg_update_price.ts
@@ -0,0 +1,32 @@
+import { formatToken } from '@src/utils/format_token';
+import { Categories } from '../types';
+
+class MsgUpdatePrice {
+ public category: Categories;
+ public type: string;
+ public json: any;
+ public creator: string;
+ public id: string;
+ public price: TokenUnit;
+
+ constructor(payload: any) {
+ this.category = 'marketplace';
+ this.type = payload.type;
+ this.json = payload.json;
+ this.creator = payload.creator;
+ this.id = payload.id;
+ this.price = payload.price;
+ }
+
+ static fromJson(json: any) {
+ return new MsgUpdatePrice({
+ json,
+ type: json['@type'],
+ creator: json.creator,
+ id: json.id,
+ price: formatToken(json.price.amount, json.price.denom),
+ });
+ }
+}
+
+export default MsgUpdatePrice;
diff --git a/src/models/msg/marketplace/msg_update_royalties.ts b/src/models/msg/marketplace/msg_update_royalties.ts
new file mode 100644
index 0000000000..bce57a29ce
--- /dev/null
+++ b/src/models/msg/marketplace/msg_update_royalties.ts
@@ -0,0 +1,35 @@
+import { Royalties } from '@src/models/msg/types';
+import { Categories } from '../types';
+
+class MsgUpdateRoyalties {
+ public category: Categories;
+ public type: string;
+ public json: any;
+ public creator: string;
+ public collectionId: string;
+ public mintRoyalties: Royalties[];
+ public resaleRoyalties: Royalties[];
+
+ constructor(payload: any) {
+ this.category = 'marketplace';
+ this.type = payload.type;
+ this.json = payload.json;
+ this.creator = payload.creator;
+ this.collectionId = payload.collectionId;
+ this.mintRoyalties = payload.mintRoyalties;
+ this.resaleRoyalties = payload.resaleRoyalties;
+ }
+
+ static fromJson(json: any) {
+ return new MsgUpdateRoyalties({
+ json,
+ type: json['@type'],
+ creator: json.creator,
+ collectionId: json.id,
+ mintRoyalties: json.mintRoyalties,
+ resaleRoyalties: json.resaleRoyalties,
+ });
+ }
+}
+
+export default MsgUpdateRoyalties;
diff --git a/src/models/msg/marketplace/msg_verify_collection.ts b/src/models/msg/marketplace/msg_verify_collection.ts
new file mode 100644
index 0000000000..34b1d8560a
--- /dev/null
+++ b/src/models/msg/marketplace/msg_verify_collection.ts
@@ -0,0 +1,38 @@
+import { Categories } from '../types';
+
+class MsgVerifyCollection {
+ public category: Categories;
+ public type: string;
+ public json: any;
+ public creator: string;
+ public admin: string;
+ public collectionId: string;
+
+ constructor(payload: any) {
+ this.category = 'marketplace';
+ this.type = payload.type;
+ this.json = payload.json;
+ this.creator = payload.creator;
+ this.admin = payload.admin;
+ this.collectionId = payload.collectionId;
+ }
+
+ static getAdminFromLog(log: any) {
+ return log
+ .events.find((event: { type: string; }) => event.type === 'message')
+ .attributes.find((attribute: { key: string; }) => attribute.key === 'sender')
+ .value || undefined;
+ }
+
+ static fromJson(json: any, log?: any) {
+ return new MsgVerifyCollection({
+ json,
+ type: json['@type'],
+ creator: json.creator,
+ admin: this.getAdminFromLog(log),
+ collectionId: json.id,
+ });
+ }
+}
+
+export default MsgVerifyCollection;
diff --git a/src/models/msg/types.ts b/src/models/msg/types.ts
index b676f5fdb9..58e6f3bff6 100644
--- a/src/models/msg/types.ts
+++ b/src/models/msg/types.ts
@@ -1,3 +1,20 @@
export type BaseCategories = 'bank' | 'crisis' | 'distribution' | 'governance' | 'slashing' | 'staking' | 'profiles' | 'ibc' | 'ibc-transfer' | 'authz' | 'feegrant' | 'vesting' | 'others'
-export type CustomCategories = 'cosmwasm' | 'gravity' | 'addressbook'; // custom modules
+export type CustomCategories = 'cosmwasm' | 'gravity' | 'addressbook' | 'marketplace'; // custom modules
export type Categories = BaseCategories | CustomCategories
+export interface MintedNft {
+ denomId: string;
+ uid: string;
+ uri: string;
+ data: string;
+ name: string;
+ price: TokenUnit;
+}
+export interface AddressBookDetailsValue {
+ network: string;
+ label: string;
+ value: string;
+}
+export interface Royalties {
+ address: string;
+ percent: string;
+}