|
121 | 121 | import ConnectWalletButton from "../element/authButtons/ConnectWalletButton.vue";
|
122 | 122 | import { mapGetters, mapMutations, mapActions, mapState } from "vuex";
|
123 | 123 | import { getCosmosBlockchainLabel, getCosmosChainConfig, getCosmosCoinLogo } from '@hypersign-protocol/hypersign-kyc-chains-metadata/cosmos/wallet/cosmos-wallet-utils'
|
124 |
| -import { createNonSigningClient } from '../../utils/cosmos-client' |
| 124 | +import { createNonSigningClient, calculateFee } from '../../utils/cosmos-client' |
125 | 125 | import { getSupportedChains } from '@hypersign-protocol/hypersign-kyc-chains-metadata/blockchain'
|
126 | 126 | import { smartContractExecuteRPC } from '@hypersign-protocol/hypersign-kyc-chains-metadata/cosmos/contract/execute'
|
127 | 127 | import { smartContractQueryRPC } from '@hypersign-protocol/hypersign-kyc-chains-metadata/cosmos/contract/query'
|
@@ -182,6 +182,7 @@ export default {
|
182 | 182 | this.reset();
|
183 | 183 |
|
184 | 184 | const { interchain } = this.allSupportedChains
|
| 185 | + console.log(interchain) |
185 | 186 | const interchainOptions = []
|
186 | 187 | interchain.forEach(chain => {
|
187 | 188 | const chainLabel = getCosmosBlockchainLabel(chain)
|
@@ -414,17 +415,19 @@ export default {
|
414 | 415 | ...proof
|
415 | 416 | });
|
416 | 417 |
|
417 |
| - console.log(smartContractMsg) |
418 |
| -
|
419 |
| -
|
420 | 418 | const chainConfig = this.chainConfig
|
421 | 419 | const chainCoinDenom = chainConfig["feeCurrencies"][0]["coinMinimalDenom"]
|
| 420 | + const gasPriceAvg = chainConfig["gasPriceStep"]["average"] |
| 421 | + const fee = calculateFee(500_000, (gasPriceAvg + chainCoinDenom).toString()) |
| 422 | +
|
422 | 423 | const result = await smartContractExecuteRPC(
|
423 | 424 | this.getCosmosConnection.signingClient,
|
424 | 425 | chainCoinDenom,
|
425 | 426 | this.getBlockchainUser.walletAddress,
|
426 | 427 | HYPERSIGN_KYC_FACTORY_CONTRACT_ADDRESS,
|
427 |
| - smartContractMsg); |
| 428 | + smartContractMsg, |
| 429 | + fee |
| 430 | + ); |
428 | 431 |
|
429 | 432 | if (result) {
|
430 | 433 | console.log(result)
|
|
0 commit comments