diff --git a/contracts/royaltyRegistry/contract.ts b/contracts/royaltyRegistry/contract.ts index c4688a5..9ebe5fb 100644 --- a/contracts/royaltyRegistry/contract.ts +++ b/contracts/royaltyRegistry/contract.ts @@ -203,7 +203,7 @@ export const RoyaltyRegistry = (client: SigningCosmWasmClient, txSigner: string) txSigner, contractAddress, { - set_collection_royalty_default: { collection, recipient, share }, + set_collection_royalty_default: { collection, recipient, share: share / 100 }, }, 'auto', ) @@ -220,7 +220,12 @@ export const RoyaltyRegistry = (client: SigningCosmWasmClient, txSigner: string) txSigner, contractAddress, { - update_collection_royalty_default: { collection, recipient, share_delta: shareDelta, decrement }, + update_collection_royalty_default: { + collection, + recipient, + share_delta: shareDelta ? shareDelta / 100 : undefined, + decrement, + }, }, 'auto', ) @@ -237,7 +242,7 @@ export const RoyaltyRegistry = (client: SigningCosmWasmClient, txSigner: string) txSigner, contractAddress, { - set_collection_royalty_protocol: { collection, protocol, recipient, share }, + set_collection_royalty_protocol: { collection, protocol, recipient, share: share / 100 }, }, 'auto', ) @@ -259,7 +264,7 @@ export const RoyaltyRegistry = (client: SigningCosmWasmClient, txSigner: string) collection, protocol, recipient, - share_delta: shareDelta, + share_delta: shareDelta ? shareDelta / 100 : undefined, decrement, }, }, @@ -328,7 +333,7 @@ export const RoyaltyRegistry = (client: SigningCosmWasmClient, txSigner: string) sender: txSigner, contract: contractAddress, msg: { - set_collection_royalty_default: { collection, recipient, share }, + set_collection_royalty_default: { collection, recipient, share: share / 100 }, }, funds: [], } @@ -344,7 +349,12 @@ export const RoyaltyRegistry = (client: SigningCosmWasmClient, txSigner: string) sender: txSigner, contract: contractAddress, msg: { - update_collection_royalty_default: { collection, recipient, share_delta: shareDelta, decrement }, + update_collection_royalty_default: { + collection, + recipient, + share_delta: shareDelta ? shareDelta / 100 : undefined, + decrement, + }, }, funds: [], } @@ -355,7 +365,7 @@ export const RoyaltyRegistry = (client: SigningCosmWasmClient, txSigner: string) sender: txSigner, contract: contractAddress, msg: { - set_collection_royalty_protocol: { collection, protocol, recipient, share }, + set_collection_royalty_protocol: { collection, protocol, recipient, share: share / 100 }, }, funds: [], } @@ -376,7 +386,7 @@ export const RoyaltyRegistry = (client: SigningCosmWasmClient, txSigner: string) collection, protocol, recipient, - share_delta: shareDelta, + share_delta: shareDelta ? shareDelta / 100 : undefined, decrement, }, }, diff --git a/pages/contracts/royaltyRegistry/execute.tsx b/pages/contracts/royaltyRegistry/execute.tsx index 0bd241c..7c316d1 100644 --- a/pages/contracts/royaltyRegistry/execute.tsx +++ b/pages/contracts/royaltyRegistry/execute.tsx @@ -1,10 +1,11 @@ +import clsx from 'clsx' import { Button } from 'components/Button' import { Conditional } from 'components/Conditional' import { ContractPageHeader } from 'components/ContractPageHeader' import { ExecuteCombobox } from 'components/contracts/royaltyRegistry/ExecuteCombobox' import { useExecuteComboboxState } from 'components/contracts/royaltyRegistry/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 { JsonPreview } from 'components/JsonPreview' import { LinkTabs } from 'components/LinkTabs' @@ -69,14 +70,16 @@ const RoyaltyRegistryExecutePage: NextPage = () => { id: 'share', name: 'share', title: 'Share', - subtitle: 'Share', + subtitle: 'Share percentage', + placeholder: '4%', }) const shareDeltaState = useNumberInputState({ id: 'share-delta', name: 'share-delta', title: 'Share Delta', - subtitle: 'Share delta', + subtitle: 'The change of share percentage', + placeholder: '1%', }) const [decrement, setDecrement] = useState(false) @@ -152,10 +155,41 @@ const RoyaltyRegistryExecutePage: NextPage = () => {