diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index c276d483..30c5c054 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -30287,6 +30287,16 @@ paths: in: query required: false type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean tags: - Query '/sixnft/evmsupport/address_binding/{ethAddress}/{nativeAddress}': @@ -30738,6 +30748,16 @@ paths: in: query required: false type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean tags: - Query '/sixnft/nftmngr/action_by_ref_id/{refId}': @@ -31303,6 +31323,16 @@ paths: in: query required: false type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean tags: - Query '/sixnft/nftmngr/nft_data/{nftSchemaCode}/{tokenId}': @@ -32131,6 +32161,16 @@ paths: in: query required: false type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean tags: - Query '/sixnft/nftmngr/nft_schema/{code}': @@ -32885,6 +32925,16 @@ paths: in: query required: false type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean tags: - Query '/sixnft/nftmngr/organization/{name}': @@ -33481,6 +33531,16 @@ paths: in: query required: false type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean tags: - Query '/sixnft/nftoracle/action_request/{id}': @@ -33772,6 +33832,16 @@ paths: in: query required: false type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean tags: - Query '/sixnft/nftoracle/mint_request/{id}': diff --git a/initiate.sh b/initiate.sh index aea8934d..928207fc 100755 --- a/initiate.sh +++ b/initiate.sh @@ -231,7 +231,7 @@ ignite scaffold message performActionByAdmin nft_schema_code token_id action \ # Test create action -sixnftd tx nftmngr perform-action-by-admin buakaw1 1 use10percentdiscount --from alice --gas auto --gas-adjustment 1.5 --gas-prices 0.1stake +sixnftd tx nftmngr perform-action-by-nftadmin buakaw1 1 use10percentdiscount --from alice --gas auto --gas-adjustment 1.5 --gas-prices 0.1stake # Create evm_support module diff --git a/retest_action.sh b/retest_action.sh index 6ec77d05..9bd03f47 100755 --- a/retest_action.sh +++ b/retest_action.sh @@ -17,6 +17,6 @@ read echo "Value before action >>" sixnftd query nftmngr show-nft-data buakaw1 1 --output json | jq '.nftData.onchain_attributes[] | select(.name=="percent_discount_10").number_attribute_value.value' -sixnftd tx nftmngr perform-action-by-admin buakaw1 1 use10percentdiscount --from alice --gas auto --gas-adjustment 1.5 --gas-prices 0.1stake -y +sixnftd tx nftmngr perform-action-by-nftadmin buakaw1 1 use10percentdiscount --from alice --gas auto --gas-adjustment 1.5 --gas-prices 0.1stake -y echo "Value after action" sixnftd query nftmngr show-nft-data buakaw1 1 --output json | jq '.nftData.onchain_attributes[] | select(.name=="percent_discount_10").number_attribute_value.value' \ No newline at end of file diff --git a/scripts/menu_local.sh b/scripts/menu_local.sh index 68d04d16..0b53c70c 100755 --- a/scripts/menu_local.sh +++ b/scripts/menu_local.sh @@ -50,7 +50,7 @@ case $choice in if [ -z "$schema_code" ]; then schema_code=$default_schema_code fi - sixnftd tx nftmngr perform-action-by-admin ${schema_code} ${token_id} ${action} --from alice --gas auto --gas-adjustment 1.5 --gas-prices 0.1stake -y + sixnftd tx nftmngr perform-action-by-nftadmin ${schema_code} ${token_id} ${action} --from alice --gas auto --gas-adjustment 1.5 --gas-prices 0.1stake -y ;; 5) echo "Set NFT Attribute" read -p "Enter Schema Code: " schema_code diff --git a/scripts/menu_testnet.sh b/scripts/menu_testnet.sh index 9172ab7b..30647f45 100755 --- a/scripts/menu_testnet.sh +++ b/scripts/menu_testnet.sh @@ -50,7 +50,7 @@ case $choice in if [ -z "$schema_code" ]; then schema_code=$default_schema_code fi - sixnftd tx nftmngr perform-action-by-admin ${schema_code} ${token_id} ${action} --from alice --gas auto --gas-adjustment 1.5 --gas-prices 0.1stake -y --node http://sixnft.fivenet.sixprotocol.net:26657 + sixnftd tx nftmngr perform-action-by-nftadmin ${schema_code} ${token_id} ${action} --from alice --gas auto --gas-adjustment 1.5 --gas-prices 0.1stake -y --node http://sixnft.fivenet.sixprotocol.net:26657 ;; 5) echo "Set NFT Attribute" read -p "Enter Schema Code: " schema_code diff --git a/vue/src/store/generated/index.ts b/vue/src/store/generated/index.ts index 5a765f62..35b9f813 100644 --- a/vue/src/store/generated/index.ts +++ b/vue/src/store/generated/index.ts @@ -1,68 +1,16 @@ // THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. -import CosmosCosmosSdkCosmosAuthV1Beta1 from './cosmos/cosmos-sdk/cosmos.auth.v1beta1' -import CosmosCosmosSdkCosmosBankV1Beta1 from './cosmos/cosmos-sdk/cosmos.bank.v1beta1' -import CosmosCosmosSdkCosmosBaseTendermintV1Beta1 from './cosmos/cosmos-sdk/cosmos.base.tendermint.v1beta1' -import CosmosCosmosSdkCosmosCrisisV1Beta1 from './cosmos/cosmos-sdk/cosmos.crisis.v1beta1' -import CosmosCosmosSdkCosmosDistributionV1Beta1 from './cosmos/cosmos-sdk/cosmos.distribution.v1beta1' -import CosmosCosmosSdkCosmosEvidenceV1Beta1 from './cosmos/cosmos-sdk/cosmos.evidence.v1beta1' -import CosmosCosmosSdkCosmosFeegrantV1Beta1 from './cosmos/cosmos-sdk/cosmos.feegrant.v1beta1' -import CosmosCosmosSdkCosmosGovV1Beta1 from './cosmos/cosmos-sdk/cosmos.gov.v1beta1' -import CosmosCosmosSdkCosmosMintV1Beta1 from './cosmos/cosmos-sdk/cosmos.mint.v1beta1' -import CosmosCosmosSdkCosmosParamsV1Beta1 from './cosmos/cosmos-sdk/cosmos.params.v1beta1' -import CosmosCosmosSdkCosmosSlashingV1Beta1 from './cosmos/cosmos-sdk/cosmos.slashing.v1beta1' -import CosmosCosmosSdkCosmosStakingV1Beta1 from './cosmos/cosmos-sdk/cosmos.staking.v1beta1' -import CosmosCosmosSdkCosmosTxV1Beta1 from './cosmos/cosmos-sdk/cosmos.tx.v1beta1' -import CosmosCosmosSdkCosmosUpgradeV1Beta1 from './cosmos/cosmos-sdk/cosmos.upgrade.v1beta1' -import CosmosCosmosSdkCosmosVestingV1Beta1 from './cosmos/cosmos-sdk/cosmos.vesting.v1beta1' -import CosmosIbcGoIbcApplicationsTransferV1 from './cosmos/ibc-go/ibc.applications.transfer.v1' -import CosmosIbcGoIbcCoreChannelV1 from './cosmos/ibc-go/ibc.core.channel.v1' -import CosmosIbcGoIbcCoreClientV1 from './cosmos/ibc-go/ibc.core.client.v1' -import CosmosIbcGoIbcCoreConnectionV1 from './cosmos/ibc-go/ibc.core.connection.v1' -import CosmosIbcGoIbcCorePortV1 from './cosmos/ibc-go/ibc.core.port.v1' -import SixnftSixnftAdmin from './sixnft/sixnft.admin' -import SixnftSixnftEvmsupport from './sixnft/sixnft.evmsupport' -import SixnftSixnftNftmngr from './sixnft/sixnft.nftmngr' -import SixnftSixnftNftoracle from './sixnft/sixnft.nftoracle' -import SixnftSixnftTest from './sixnft/sixnft.test' -import ThesixnetworkSixnftSixnftAdmin from './thesixnetwork/sixnft/sixnft.admin' -import ThesixnetworkSixnftSixnftEvmsupport from './thesixnetwork/sixnft/sixnft.evmsupport' -import ThesixnetworkSixnftSixnftNftadmin from './thesixnetwork/sixnft/sixnft.nftadmin' -import ThesixnetworkSixnftSixnftNftmngr from './thesixnetwork/sixnft/sixnft.nftmngr' -import ThesixnetworkSixnftSixnftNftoracle from './thesixnetwork/sixnft/sixnft.nftoracle' +import SixnftEvmsupport from './sixnft.evmsupport' +import SixnftNftadmin from './sixnft.nftadmin' +import SixnftNftmngr from './sixnft.nftmngr' +import SixnftNftoracle from './sixnft.nftoracle' export default { - CosmosCosmosSdkCosmosAuthV1Beta1: load(CosmosCosmosSdkCosmosAuthV1Beta1, 'cosmos.auth.v1beta1'), - CosmosCosmosSdkCosmosBankV1Beta1: load(CosmosCosmosSdkCosmosBankV1Beta1, 'cosmos.bank.v1beta1'), - CosmosCosmosSdkCosmosBaseTendermintV1Beta1: load(CosmosCosmosSdkCosmosBaseTendermintV1Beta1, 'cosmos.base.tendermint.v1beta1'), - CosmosCosmosSdkCosmosCrisisV1Beta1: load(CosmosCosmosSdkCosmosCrisisV1Beta1, 'cosmos.crisis.v1beta1'), - CosmosCosmosSdkCosmosDistributionV1Beta1: load(CosmosCosmosSdkCosmosDistributionV1Beta1, 'cosmos.distribution.v1beta1'), - CosmosCosmosSdkCosmosEvidenceV1Beta1: load(CosmosCosmosSdkCosmosEvidenceV1Beta1, 'cosmos.evidence.v1beta1'), - CosmosCosmosSdkCosmosFeegrantV1Beta1: load(CosmosCosmosSdkCosmosFeegrantV1Beta1, 'cosmos.feegrant.v1beta1'), - CosmosCosmosSdkCosmosGovV1Beta1: load(CosmosCosmosSdkCosmosGovV1Beta1, 'cosmos.gov.v1beta1'), - CosmosCosmosSdkCosmosMintV1Beta1: load(CosmosCosmosSdkCosmosMintV1Beta1, 'cosmos.mint.v1beta1'), - CosmosCosmosSdkCosmosParamsV1Beta1: load(CosmosCosmosSdkCosmosParamsV1Beta1, 'cosmos.params.v1beta1'), - CosmosCosmosSdkCosmosSlashingV1Beta1: load(CosmosCosmosSdkCosmosSlashingV1Beta1, 'cosmos.slashing.v1beta1'), - CosmosCosmosSdkCosmosStakingV1Beta1: load(CosmosCosmosSdkCosmosStakingV1Beta1, 'cosmos.staking.v1beta1'), - CosmosCosmosSdkCosmosTxV1Beta1: load(CosmosCosmosSdkCosmosTxV1Beta1, 'cosmos.tx.v1beta1'), - CosmosCosmosSdkCosmosUpgradeV1Beta1: load(CosmosCosmosSdkCosmosUpgradeV1Beta1, 'cosmos.upgrade.v1beta1'), - CosmosCosmosSdkCosmosVestingV1Beta1: load(CosmosCosmosSdkCosmosVestingV1Beta1, 'cosmos.vesting.v1beta1'), - CosmosIbcGoIbcApplicationsTransferV1: load(CosmosIbcGoIbcApplicationsTransferV1, 'ibc.applications.transfer.v1'), - CosmosIbcGoIbcCoreChannelV1: load(CosmosIbcGoIbcCoreChannelV1, 'ibc.core.channel.v1'), - CosmosIbcGoIbcCoreClientV1: load(CosmosIbcGoIbcCoreClientV1, 'ibc.core.client.v1'), - CosmosIbcGoIbcCoreConnectionV1: load(CosmosIbcGoIbcCoreConnectionV1, 'ibc.core.connection.v1'), - CosmosIbcGoIbcCorePortV1: load(CosmosIbcGoIbcCorePortV1, 'ibc.core.port.v1'), - SixnftSixnftAdmin: load(SixnftSixnftAdmin, 'sixnft.admin'), - SixnftSixnftEvmsupport: load(SixnftSixnftEvmsupport, 'sixnft.evmsupport'), - SixnftSixnftNftmngr: load(SixnftSixnftNftmngr, 'sixnft.nftmngr'), - SixnftSixnftNftoracle: load(SixnftSixnftNftoracle, 'sixnft.nftoracle'), - SixnftSixnftTest: load(SixnftSixnftTest, 'sixnft.test'), - ThesixnetworkSixnftSixnftAdmin: load(ThesixnetworkSixnftSixnftAdmin, 'sixnft.admin'), - ThesixnetworkSixnftSixnftEvmsupport: load(ThesixnetworkSixnftSixnftEvmsupport, 'sixnft.evmsupport'), - ThesixnetworkSixnftSixnftNftadmin: load(ThesixnetworkSixnftSixnftNftadmin, 'sixnft.nftadmin'), - ThesixnetworkSixnftSixnftNftmngr: load(ThesixnetworkSixnftSixnftNftmngr, 'sixnft.nftmngr'), - ThesixnetworkSixnftSixnftNftoracle: load(ThesixnetworkSixnftSixnftNftoracle, 'sixnft.nftoracle'), + SixnftEvmsupport: load(SixnftEvmsupport, 'sixnft.evmsupport'), + SixnftNftadmin: load(SixnftNftadmin, 'sixnft.nftadmin'), + SixnftNftmngr: load(SixnftNftmngr, 'sixnft.nftmngr'), + SixnftNftoracle: load(SixnftNftoracle, 'sixnft.nftoracle'), } @@ -82,4 +30,4 @@ function load(mod, fullns) { }) } } -} +} \ No newline at end of file diff --git a/vue/src/store/generated/package.json b/vue/src/store/generated/package.json index 343a2b57..66b60ff5 100644 --- a/vue/src/store/generated/package.json +++ b/vue/src/store/generated/package.json @@ -1,8 +1,8 @@ { - "name": "thesixnetwork-sixnft-js", - "version": "0.1.0", - "description": "Autogenerated cosmos modules vuex store", - "author": "Starport Codegen ", + "name": "thesixnetwork-sixnft-vue", + "version": "0.0.1", + "description": "Autogenerated Vue Utils", + "author": "Ignite Codegen ", "license": "Apache-2.0", "licenses": [ { @@ -10,8 +10,17 @@ "url": "http://www.apache.org/licenses/LICENSE-2.0" } ], - "main": "index.js", + "main": "index.ts", "publishConfig": { "access": "public" + }, + "dependencies": { + "thesixnetwork-sixnft-client": "0.0.1", + "buffer": "^6.0.3" + }, + "peerDependencies": { + "@cosmjs/proto-signing": "0.27.0", + "@cosmjs/stargate": "0.27.0", + "vue": "3.2.31" } } diff --git a/vue/src/store/generated/sixnft.nftadmin/index.ts b/vue/src/store/generated/sixnft.nftadmin/index.ts index 0b8784c9..3231c5c5 100755 --- a/vue/src/store/generated/sixnft.nftadmin/index.ts +++ b/vue/src/store/generated/sixnft.nftadmin/index.ts @@ -163,16 +163,16 @@ export default { }, - async sendMsgRevokePermission({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgMint({ rootGetters }, { value, fee = [], memo = '' }) { try { const client=await initClient(rootGetters) - const result = await client.SixnftNftadmin.tx.sendMsgRevokePermission({ value, fee: {amount: fee, gas: "200000"}, memo }) + const result = await client.SixnftNftadmin.tx.sendMsgMint({ value, fee: {amount: fee, gas: "200000"}, memo }) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevokePermission:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgMint:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgRevokePermission:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgMint:Send Could not broadcast Tx: '+ e.message) } } }, @@ -189,43 +189,43 @@ export default { } } }, - async sendMsgMint({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgBurn({ rootGetters }, { value, fee = [], memo = '' }) { try { const client=await initClient(rootGetters) - const result = await client.SixnftNftadmin.tx.sendMsgMint({ value, fee: {amount: fee, gas: "200000"}, memo }) + const result = await client.SixnftNftadmin.tx.sendMsgBurn({ value, fee: {amount: fee, gas: "200000"}, memo }) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgMint:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgBurn:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgMint:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgBurn:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgBurn({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgRevokePermission({ rootGetters }, { value, fee = [], memo = '' }) { try { const client=await initClient(rootGetters) - const result = await client.SixnftNftadmin.tx.sendMsgBurn({ value, fee: {amount: fee, gas: "200000"}, memo }) + const result = await client.SixnftNftadmin.tx.sendMsgRevokePermission({ value, fee: {amount: fee, gas: "200000"}, memo }) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgBurn:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRevokePermission:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgBurn:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgRevokePermission:Send Could not broadcast Tx: '+ e.message) } } }, - async MsgRevokePermission({ rootGetters }, { value }) { + async MsgMint({ rootGetters }, { value }) { try { const client=initClient(rootGetters) - const msg = await client.SixnftNftadmin.tx.msgRevokePermission({value}) + const msg = await client.SixnftNftadmin.tx.msgMint({value}) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRevokePermission:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgMint:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgRevokePermission:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgMint:Create Could not create message: ' + e.message) } } }, @@ -242,29 +242,29 @@ export default { } } }, - async MsgMint({ rootGetters }, { value }) { + async MsgBurn({ rootGetters }, { value }) { try { const client=initClient(rootGetters) - const msg = await client.SixnftNftadmin.tx.msgMint({value}) + const msg = await client.SixnftNftadmin.tx.msgBurn({value}) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgMint:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgBurn:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgMint:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgBurn:Create Could not create message: ' + e.message) } } }, - async MsgBurn({ rootGetters }, { value }) { + async MsgRevokePermission({ rootGetters }, { value }) { try { const client=initClient(rootGetters) - const msg = await client.SixnftNftadmin.tx.msgBurn({value}) + const msg = await client.SixnftNftadmin.tx.msgRevokePermission({value}) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgBurn:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRevokePermission:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgBurn:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgRevokePermission:Create Could not create message: ' + e.message) } } }, diff --git a/vue/src/store/generated/sixnft.nftmngr/index.ts b/vue/src/store/generated/sixnft.nftmngr/index.ts index 3ddbe7ec..9e5d1d40 100755 --- a/vue/src/store/generated/sixnft.nftmngr/index.ts +++ b/vue/src/store/generated/sixnft.nftmngr/index.ts @@ -418,186 +418,186 @@ export default { }, - async sendMsgAddAttribute({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCreateMetadata({ rootGetters }, { value, fee = [], memo = '' }) { try { const client=await initClient(rootGetters) - const result = await client.SixnftNftmngr.tx.sendMsgAddAttribute({ value, fee: {amount: fee, gas: "200000"}, memo }) + const result = await client.SixnftNftmngr.tx.sendMsgCreateMetadata({ value, fee: {amount: fee, gas: "200000"}, memo }) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgAddAttribute:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCreateMetadata:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgAddAttribute:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgCreateMetadata:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgAddTokenAttribute({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgPerformActionByAdmin({ rootGetters }, { value, fee = [], memo = '' }) { try { const client=await initClient(rootGetters) - const result = await client.SixnftNftmngr.tx.sendMsgAddTokenAttribute({ value, fee: {amount: fee, gas: "200000"}, memo }) + const result = await client.SixnftNftmngr.tx.sendMsgPerformActionByAdmin({ value, fee: {amount: fee, gas: "200000"}, memo }) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgAddTokenAttribute:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgPerformActionByAdmin:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgAddTokenAttribute:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgPerformActionByAdmin:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgCreateMetadata({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCreateNFTSchema({ rootGetters }, { value, fee = [], memo = '' }) { try { const client=await initClient(rootGetters) - const result = await client.SixnftNftmngr.tx.sendMsgCreateMetadata({ value, fee: {amount: fee, gas: "200000"}, memo }) + const result = await client.SixnftNftmngr.tx.sendMsgCreateNFTSchema({ value, fee: {amount: fee, gas: "200000"}, memo }) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateMetadata:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCreateNFTSchema:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgCreateMetadata:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgCreateNFTSchema:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgAddAction({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgAddTokenAttribute({ rootGetters }, { value, fee = [], memo = '' }) { try { const client=await initClient(rootGetters) - const result = await client.SixnftNftmngr.tx.sendMsgAddAction({ value, fee: {amount: fee, gas: "200000"}, memo }) + const result = await client.SixnftNftmngr.tx.sendMsgAddTokenAttribute({ value, fee: {amount: fee, gas: "200000"}, memo }) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgAddAction:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgAddTokenAttribute:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgAddAction:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgAddTokenAttribute:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgPerformActionByAdmin({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgSetNFTAttribute({ rootGetters }, { value, fee = [], memo = '' }) { try { const client=await initClient(rootGetters) - const result = await client.SixnftNftmngr.tx.sendMsgPerformActionByAdmin({ value, fee: {amount: fee, gas: "200000"}, memo }) + const result = await client.SixnftNftmngr.tx.sendMsgSetNFTAttribute({ value, fee: {amount: fee, gas: "200000"}, memo }) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgPerformActionByAdmin:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSetNFTAttribute:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgPerformActionByAdmin:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgSetNFTAttribute:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgCreateNFTSchema({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgAddAction({ rootGetters }, { value, fee = [], memo = '' }) { try { const client=await initClient(rootGetters) - const result = await client.SixnftNftmngr.tx.sendMsgCreateNFTSchema({ value, fee: {amount: fee, gas: "200000"}, memo }) + const result = await client.SixnftNftmngr.tx.sendMsgAddAction({ value, fee: {amount: fee, gas: "200000"}, memo }) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateNFTSchema:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgAddAction:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgCreateNFTSchema:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgAddAction:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgSetNFTAttribute({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgAddAttribute({ rootGetters }, { value, fee = [], memo = '' }) { try { const client=await initClient(rootGetters) - const result = await client.SixnftNftmngr.tx.sendMsgSetNFTAttribute({ value, fee: {amount: fee, gas: "200000"}, memo }) + const result = await client.SixnftNftmngr.tx.sendMsgAddAttribute({ value, fee: {amount: fee, gas: "200000"}, memo }) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSetNFTAttribute:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgAddAttribute:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgSetNFTAttribute:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgAddAttribute:Send Could not broadcast Tx: '+ e.message) } } }, - async MsgAddAttribute({ rootGetters }, { value }) { + async MsgCreateMetadata({ rootGetters }, { value }) { try { const client=initClient(rootGetters) - const msg = await client.SixnftNftmngr.tx.msgAddAttribute({value}) + const msg = await client.SixnftNftmngr.tx.msgCreateMetadata({value}) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgAddAttribute:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCreateMetadata:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgAddAttribute:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgCreateMetadata:Create Could not create message: ' + e.message) } } }, - async MsgAddTokenAttribute({ rootGetters }, { value }) { + async MsgPerformActionByAdmin({ rootGetters }, { value }) { try { const client=initClient(rootGetters) - const msg = await client.SixnftNftmngr.tx.msgAddTokenAttribute({value}) + const msg = await client.SixnftNftmngr.tx.msgPerformActionByAdmin({value}) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgAddTokenAttribute:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgPerformActionByAdmin:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgAddTokenAttribute:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgPerformActionByAdmin:Create Could not create message: ' + e.message) } } }, - async MsgCreateMetadata({ rootGetters }, { value }) { + async MsgCreateNFTSchema({ rootGetters }, { value }) { try { const client=initClient(rootGetters) - const msg = await client.SixnftNftmngr.tx.msgCreateMetadata({value}) + const msg = await client.SixnftNftmngr.tx.msgCreateNFTSchema({value}) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateMetadata:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCreateNFTSchema:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgCreateMetadata:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgCreateNFTSchema:Create Could not create message: ' + e.message) } } }, - async MsgAddAction({ rootGetters }, { value }) { + async MsgAddTokenAttribute({ rootGetters }, { value }) { try { const client=initClient(rootGetters) - const msg = await client.SixnftNftmngr.tx.msgAddAction({value}) + const msg = await client.SixnftNftmngr.tx.msgAddTokenAttribute({value}) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgAddAction:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgAddTokenAttribute:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgAddAction:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgAddTokenAttribute:Create Could not create message: ' + e.message) } } }, - async MsgPerformActionByAdmin({ rootGetters }, { value }) { + async MsgSetNFTAttribute({ rootGetters }, { value }) { try { const client=initClient(rootGetters) - const msg = await client.SixnftNftmngr.tx.msgPerformActionByAdmin({value}) + const msg = await client.SixnftNftmngr.tx.msgSetNFTAttribute({value}) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgPerformActionByAdmin:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSetNFTAttribute:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgPerformActionByAdmin:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgSetNFTAttribute:Create Could not create message: ' + e.message) } } }, - async MsgCreateNFTSchema({ rootGetters }, { value }) { + async MsgAddAction({ rootGetters }, { value }) { try { const client=initClient(rootGetters) - const msg = await client.SixnftNftmngr.tx.msgCreateNFTSchema({value}) + const msg = await client.SixnftNftmngr.tx.msgAddAction({value}) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateNFTSchema:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgAddAction:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgCreateNFTSchema:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgAddAction:Create Could not create message: ' + e.message) } } }, - async MsgSetNFTAttribute({ rootGetters }, { value }) { + async MsgAddAttribute({ rootGetters }, { value }) { try { const client=initClient(rootGetters) - const msg = await client.SixnftNftmngr.tx.msgSetNFTAttribute({value}) + const msg = await client.SixnftNftmngr.tx.msgAddAttribute({value}) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSetNFTAttribute:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgAddAttribute:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgSetNFTAttribute:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgAddAttribute:Create Could not create message: ' + e.message) } } }, diff --git a/vue/src/store/generated/sixnft.nftoracle/index.ts b/vue/src/store/generated/sixnft.nftoracle/index.ts index 1e2e417d..ae13e8e8 100755 --- a/vue/src/store/generated/sixnft.nftoracle/index.ts +++ b/vue/src/store/generated/sixnft.nftoracle/index.ts @@ -266,108 +266,108 @@ export default { }, - async sendMsgCreateMintRequest({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgSubmitMintResponse({ rootGetters }, { value, fee = [], memo = '' }) { try { const client=await initClient(rootGetters) - const result = await client.SixnftNftoracle.tx.sendMsgCreateMintRequest({ value, fee: {amount: fee, gas: "200000"}, memo }) + const result = await client.SixnftNftoracle.tx.sendMsgSubmitMintResponse({ value, fee: {amount: fee, gas: "200000"}, memo }) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateMintRequest:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSubmitMintResponse:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgCreateMintRequest:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgSubmitMintResponse:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgCreateActionRequest({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgSubmitActionResponse({ rootGetters }, { value, fee = [], memo = '' }) { try { const client=await initClient(rootGetters) - const result = await client.SixnftNftoracle.tx.sendMsgCreateActionRequest({ value, fee: {amount: fee, gas: "200000"}, memo }) + const result = await client.SixnftNftoracle.tx.sendMsgSubmitActionResponse({ value, fee: {amount: fee, gas: "200000"}, memo }) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateActionRequest:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSubmitActionResponse:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgCreateActionRequest:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgSubmitActionResponse:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgSubmitActionResponse({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCreateMintRequest({ rootGetters }, { value, fee = [], memo = '' }) { try { const client=await initClient(rootGetters) - const result = await client.SixnftNftoracle.tx.sendMsgSubmitActionResponse({ value, fee: {amount: fee, gas: "200000"}, memo }) + const result = await client.SixnftNftoracle.tx.sendMsgCreateMintRequest({ value, fee: {amount: fee, gas: "200000"}, memo }) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitActionResponse:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCreateMintRequest:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgSubmitActionResponse:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgCreateMintRequest:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgSubmitMintResponse({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCreateActionRequest({ rootGetters }, { value, fee = [], memo = '' }) { try { const client=await initClient(rootGetters) - const result = await client.SixnftNftoracle.tx.sendMsgSubmitMintResponse({ value, fee: {amount: fee, gas: "200000"}, memo }) + const result = await client.SixnftNftoracle.tx.sendMsgCreateActionRequest({ value, fee: {amount: fee, gas: "200000"}, memo }) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitMintResponse:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCreateActionRequest:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgSubmitMintResponse:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgCreateActionRequest:Send Could not broadcast Tx: '+ e.message) } } }, - async MsgCreateMintRequest({ rootGetters }, { value }) { + async MsgSubmitMintResponse({ rootGetters }, { value }) { try { const client=initClient(rootGetters) - const msg = await client.SixnftNftoracle.tx.msgCreateMintRequest({value}) + const msg = await client.SixnftNftoracle.tx.msgSubmitMintResponse({value}) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateMintRequest:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSubmitMintResponse:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgCreateMintRequest:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgSubmitMintResponse:Create Could not create message: ' + e.message) } } }, - async MsgCreateActionRequest({ rootGetters }, { value }) { + async MsgSubmitActionResponse({ rootGetters }, { value }) { try { const client=initClient(rootGetters) - const msg = await client.SixnftNftoracle.tx.msgCreateActionRequest({value}) + const msg = await client.SixnftNftoracle.tx.msgSubmitActionResponse({value}) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateActionRequest:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgSubmitActionResponse:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgCreateActionRequest:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgSubmitActionResponse:Create Could not create message: ' + e.message) } } }, - async MsgSubmitActionResponse({ rootGetters }, { value }) { + async MsgCreateMintRequest({ rootGetters }, { value }) { try { const client=initClient(rootGetters) - const msg = await client.SixnftNftoracle.tx.msgSubmitActionResponse({value}) + const msg = await client.SixnftNftoracle.tx.msgCreateMintRequest({value}) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitActionResponse:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCreateMintRequest:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgSubmitActionResponse:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgCreateMintRequest:Create Could not create message: ' + e.message) } } }, - async MsgSubmitMintResponse({ rootGetters }, { value }) { + async MsgCreateActionRequest({ rootGetters }, { value }) { try { const client=initClient(rootGetters) - const msg = await client.SixnftNftoracle.tx.msgSubmitMintResponse({value}) + const msg = await client.SixnftNftoracle.tx.msgCreateActionRequest({value}) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgSubmitMintResponse:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCreateActionRequest:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgSubmitMintResponse:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgCreateActionRequest:Create Could not create message: ' + e.message) } } }, diff --git a/x/nftmngr/keeper/msg_server_add_attribute.go b/x/nftmngr/keeper/msg_server_add_attribute.go index f09d98bd..bb2c93bb 100644 --- a/x/nftmngr/keeper/msg_server_add_attribute.go +++ b/x/nftmngr/keeper/msg_server_add_attribute.go @@ -38,6 +38,10 @@ func (k msgServer) AddAttribute(goCtx context.Context, msg *types.MsgAddAttribut // append new nft_attributes to array of OnchainData.NftAttributes schema.OnchainData.NftAttributes = append(schema.OnchainData.NftAttributes, &new_add_attribute) + // count the index of new attribute + index := MergeAndCountAllAttributes(schema.OriginData.OriginAttributes, schema.OnchainData.NftAttributes, schema.OnchainData.TokenAttributes) + // set new index to new attribute + new_add_attribute.Index = uint64(index-1) // set schema k.Keeper.SetNFTSchema(ctx, schema) @@ -100,3 +104,17 @@ func (k Keeper) ValidateAttributeDefinition(attribute *types.AttributeDefinition // } return nil } + +// merge all attributes and count the index +func MergeAndCountAllAttributes(originAttributes []*types.AttributeDefinition, onchainNFTAttributes []*types.AttributeDefinition, onchainTokenAttribute []*types.AttributeDefinition) int { + // length or originAttributes + length_originAttributes := len(originAttributes) + // length or onchainNFTAttributes + length_onchainNFTAttributes := len(onchainNFTAttributes) + // length or onchainTokenAttribute + length_onchainTokenAttribute := len(onchainTokenAttribute) + + // length of all attributes + length_allAttributes := length_originAttributes + length_onchainNFTAttributes + length_onchainTokenAttribute + return length_allAttributes +} \ No newline at end of file diff --git a/x/nftmngr/keeper/msg_server_create_nft_schema.go b/x/nftmngr/keeper/msg_server_create_nft_schema.go index 7c0fa964..7ff1dc5d 100644 --- a/x/nftmngr/keeper/msg_server_create_nft_schema.go +++ b/x/nftmngr/keeper/msg_server_create_nft_schema.go @@ -143,4 +143,4 @@ func MergeAllSchemaAttributesAndAlterOrderIndex(originAttributes []*types.Attrib index++ } return mergedAttributes -} +} \ No newline at end of file