diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 5322063c..a6666aff 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -32201,7 +32201,30 @@ paths: type: string format: uint64 default_mint_value: - type: string + type: object + properties: + number_attribute_value: + type: object + properties: + value: + type: string + format: uint64 + string_attribute_value: + type: object + properties: + value: + type: string + boolean_attribute_value: + type: object + properties: + value: + type: boolean + float_attribute_value: + type: object + properties: + value: + type: number + format: double hidden_to_marketplace: type: boolean uri_retrieval_method: @@ -32249,7 +32272,30 @@ paths: type: string format: uint64 default_mint_value: - type: string + type: object + properties: + number_attribute_value: + type: object + properties: + value: + type: string + format: uint64 + string_attribute_value: + type: object + properties: + value: + type: string + boolean_attribute_value: + type: object + properties: + value: + type: boolean + float_attribute_value: + type: object + properties: + value: + type: number + format: double hidden_to_marketplace: type: boolean token_attributes: @@ -32283,7 +32329,30 @@ paths: type: string format: uint64 default_mint_value: - type: string + type: object + properties: + number_attribute_value: + type: object + properties: + value: + type: string + format: uint64 + string_attribute_value: + type: object + properties: + value: + type: string + boolean_attribute_value: + type: object + properties: + value: + type: boolean + float_attribute_value: + type: object + properties: + value: + type: number + format: double hidden_to_marketplace: type: boolean actions: diff --git a/vue/src/store/generated/sixnft/sixnft.nftmngr/index.ts b/vue/src/store/generated/sixnft/sixnft.nftmngr/index.ts index 384a18a8..1cff6851 100755 --- a/vue/src/store/generated/sixnft/sixnft.nftmngr/index.ts +++ b/vue/src/store/generated/sixnft/sixnft.nftmngr/index.ts @@ -24,7 +24,7 @@ import { UpdatedOpenseaAttributes } from "./module/types/nftmngr/tx" import { UpdatedOriginData } from "./module/types/nftmngr/tx" -export { Action, ActionByRefId, DefaultMintValue, AttributeDefinition, DisplayOption, NftAttributeValue, NumberAttributeValue, StringAttributeValue, BooleanAttributeValue, FloatAttributeValue, NftData, NFTSchema, OnChainData, OnOffSwitch, OpenseaDisplayOption, OriginData, Params, Status, OpenseaAttribute, UpdatedOpenseaAttributes, UpdatedOriginData }; +export { Action, ActionByRefId, DefaultMintValue, AttributeDefinition, DisplayOption, NftAttributeValue, NumberAttributeValue, StringAttributeValue, BooleanAttributeValue, FloatAttributeValue, NftData, NFTSchema, OnChainData, OnOffSwitch, OpenseaDisplayOption, Organization, OriginData, Params, Status, OpenseaAttribute, UpdatedOpenseaAttributes, UpdatedOriginData }; async function initTxClient(vuexGetters) { return await txClient(vuexGetters['common/wallet/signer'], { @@ -423,6 +423,8 @@ export default { } }, + + async sendMsgCreateNFTSchema({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) @@ -483,6 +485,7 @@ export default { } } }, + async MsgCreateNFTSchema({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) diff --git a/vue/src/store/generated/sixnft/sixnft.nftmngr/module/index.ts b/vue/src/store/generated/sixnft/sixnft.nftmngr/module/index.ts index 8d190ff7..b16e6d95 100755 --- a/vue/src/store/generated/sixnft/sixnft.nftmngr/module/index.ts +++ b/vue/src/store/generated/sixnft/sixnft.nftmngr/module/index.ts @@ -4,15 +4,17 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; -import { MsgPerformActionByAdmin } from "./types/nftmngr/tx"; import { MsgCreateNFTSchema } from "./types/nftmngr/tx"; import { MsgCreateMetadata } from "./types/nftmngr/tx"; +import { MsgPerformActionByAdmin } from "./types/nftmngr/tx"; +import { MsgSetNFTAttribute } from "./types/nftmngr/tx"; const types = [ - ["/sixnft.nftmngr.MsgPerformActionByAdmin", MsgPerformActionByAdmin], ["/sixnft.nftmngr.MsgCreateNFTSchema", MsgCreateNFTSchema], ["/sixnft.nftmngr.MsgCreateMetadata", MsgCreateMetadata], + ["/sixnft.nftmngr.MsgPerformActionByAdmin", MsgPerformActionByAdmin], + ["/sixnft.nftmngr.MsgSetNFTAttribute", MsgSetNFTAttribute], ]; export const MissingWalletError = new Error("wallet is required"); @@ -45,9 +47,10 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), - msgPerformActionByAdmin: (data: MsgPerformActionByAdmin): EncodeObject => ({ typeUrl: "/sixnft.nftmngr.MsgPerformActionByAdmin", value: MsgPerformActionByAdmin.fromPartial( data ) }), msgCreateNFTSchema: (data: MsgCreateNFTSchema): EncodeObject => ({ typeUrl: "/sixnft.nftmngr.MsgCreateNFTSchema", value: MsgCreateNFTSchema.fromPartial( data ) }), msgCreateMetadata: (data: MsgCreateMetadata): EncodeObject => ({ typeUrl: "/sixnft.nftmngr.MsgCreateMetadata", value: MsgCreateMetadata.fromPartial( data ) }), + msgPerformActionByAdmin: (data: MsgPerformActionByAdmin): EncodeObject => ({ typeUrl: "/sixnft.nftmngr.MsgPerformActionByAdmin", value: MsgPerformActionByAdmin.fromPartial( data ) }), + msgSetNFTAttribute: (data: MsgSetNFTAttribute): EncodeObject => ({ typeUrl: "/sixnft.nftmngr.MsgSetNFTAttribute", value: MsgSetNFTAttribute.fromPartial( data ) }), }; }; diff --git a/vue/src/store/generated/sixnft/sixnft.nftmngr/module/rest.ts b/vue/src/store/generated/sixnft/sixnft.nftmngr/module/rest.ts index dbf54d5f..8fc42b47 100644 --- a/vue/src/store/generated/sixnft/sixnft.nftmngr/module/rest.ts +++ b/vue/src/store/generated/sixnft/sixnft.nftmngr/module/rest.ts @@ -765,7 +765,6 @@ export class Api extends HttpClient diff --git a/x/nftmngr/keeper/validate.go b/x/nftmngr/keeper/validate.go index aaa086da..f4d2effa 100644 --- a/x/nftmngr/keeper/validate.go +++ b/x/nftmngr/keeper/validate.go @@ -23,7 +23,7 @@ func CreateNftAttrValueMap(nftAttrValues []*types.NftAttributeValue) map[string] func ValidateRequiredAttributes(schemaAttributes []*types.AttributeDefinition, mapAttributeValues map[string]*types.NftAttributeValue) (bool, string) { for _, schemaAttribute := range schemaAttributes { - if schemaAttribute.Required { + if schemaAttribute.Required && (schemaAttribute.DefaultMintValue == nil || schemaAttribute.DefaultMintValue.GetValue() == nil) { if _, ok := mapAttributeValues[schemaAttribute.Name]; !ok { return false, schemaAttribute.Name }