From 5a903f691e19af66042d372e93c4d42fb30b62d8 Mon Sep 17 00:00:00 2001 From: Serkan Reis Date: Sat, 4 Feb 2023 19:18:41 +0300 Subject: [PATCH] Execute Create Badge init --- contracts/badgeHub/contract.ts | 7 +++---- pages/contracts/badgeHub/execute.tsx | 6 +++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/contracts/badgeHub/contract.ts b/contracts/badgeHub/contract.ts index 6ed35f2..468a3b4 100644 --- a/contracts/badgeHub/contract.ts +++ b/contracts/badgeHub/contract.ts @@ -6,7 +6,6 @@ import type { SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate' import type { Coin } from '@cosmjs/proto-signing' import { coin } from '@cosmjs/proto-signing' import type { logs } from '@cosmjs/stargate' -import type { Timestamp } from '@stargazezone/types/contracts/minter/shared-types' export interface InstantiateResponse { readonly contractAddress: string @@ -48,7 +47,7 @@ export interface Badge { metadata: Metadata transferrable: boolean rule: Rule - expiry?: Timestamp + expiry?: number max_supply?: number } @@ -95,7 +94,7 @@ export interface CreateBadgeMessage { metadata: Metadata transferrable: boolean rule: Rule - expiry?: Timestamp + expiry?: number max_supply?: number } } @@ -277,7 +276,7 @@ export const badgeHub = (client: SigningCosmWasmClient, txSigner: string): Badge }, 'auto', '', - [coin(315, 'ustars')], + [coin(912, 'ustars')], ) return res.transactionHash diff --git a/pages/contracts/badgeHub/execute.tsx b/pages/contracts/badgeHub/execute.tsx index cf192f6..8deb29a 100644 --- a/pages/contracts/badgeHub/execute.tsx +++ b/pages/contracts/badgeHub/execute.tsx @@ -4,7 +4,7 @@ import { ContractPageHeader } from 'components/ContractPageHeader' import { ExecuteCombobox } from 'components/contracts/badgeHub/ExecuteCombobox' import { useExecuteComboboxState } from 'components/contracts/badgeHub/ExecuteCombobox.hooks' import { FormControl } from 'components/FormControl' -import { AddressInput } from 'components/forms/FormInput' +import { AddressInput, NumberInput } from 'components/forms/FormInput' import { useInputState, useNumberInputState } from 'components/forms/FormInput.hooks' import { InputDateTime } from 'components/InputDateTime' import { JsonPreview } from 'components/JsonPreview' @@ -26,6 +26,7 @@ import { useMutation } from 'react-query' import { withMetadata } from 'utils/layout' import { links } from 'utils/links' +import { TextInput } from '../../../components/forms/FormInput' import { MetadataAttributes } from '../../../components/forms/MetadataAttributes' import { useMetadataAttributesState } from '../../../components/forms/MetadataAttributes.hooks' @@ -209,6 +210,7 @@ const BadgeHubExecutePage: NextPage = () => { rule: { by_key: keyState.value, }, + expiry: timestamp ? timestamp.getTime() * 1000000 : undefined, max_supply: maxSupplyState.value, }, metadata: { @@ -316,6 +318,8 @@ const BadgeHubExecutePage: NextPage = () => { /> )} + {showBadgeField && } + {showBadgeField && } {/* TODO: Fix address execute message */}