Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ngam committed Sep 16, 2022
1 parent 66b3eaf commit 86bf53c
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 9 deletions.
75 changes: 72 additions & 3 deletions docs/static/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion vue/src/store/generated/sixnft/sixnft.nftmngr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'], {
Expand Down Expand Up @@ -423,6 +423,8 @@ export default {

}
},


async sendMsgCreateNFTSchema({ rootGetters }, { value, fee = [], memo = '' }) {
try {
const txClient=await initTxClient(rootGetters)
Expand Down Expand Up @@ -483,6 +485,7 @@ export default {
}
}
},

async MsgCreateNFTSchema({ rootGetters }, { value }) {
try {
const txClient=await initTxClient(rootGetters)
Expand Down
9 changes: 6 additions & 3 deletions vue/src/store/generated/sixnft/sixnft.nftmngr/module/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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 ) }),

};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,6 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
"pagination.offset"?: string;
"pagination.limit"?: string;
"pagination.count_total"?: boolean;
"pagination.reverse"?: boolean;
},
params: RequestParams = {},
) =>
Expand Down
2 changes: 1 addition & 1 deletion x/nftmngr/keeper/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 86bf53c

Please sign in to comment.