Match inputs with query types

This commit is contained in:
Serkan Reis 2023-10-07 12:50:45 +03:00
parent 51acae6a78
commit 3325a93edb
2 changed files with 12 additions and 6 deletions

View File

@ -203,7 +203,7 @@ export const RoyaltyRegistry = (client: SigningCosmWasmClient, txSigner: string)
txSigner, txSigner,
contractAddress, contractAddress,
{ {
set_collection_royalty_default: { collection, recipient, share: share / 100 }, set_collection_royalty_default: { collection, recipient, share: (share / 100).toString() },
}, },
'auto', 'auto',
) )
@ -223,7 +223,7 @@ export const RoyaltyRegistry = (client: SigningCosmWasmClient, txSigner: string)
update_collection_royalty_default: { update_collection_royalty_default: {
collection, collection,
recipient, recipient,
share_delta: shareDelta ? shareDelta / 100 : undefined, share_delta: shareDelta ? (shareDelta / 100).toString() : undefined,
decrement, decrement,
}, },
}, },
@ -242,7 +242,7 @@ export const RoyaltyRegistry = (client: SigningCosmWasmClient, txSigner: string)
txSigner, txSigner,
contractAddress, contractAddress,
{ {
set_collection_royalty_protocol: { collection, protocol, recipient, share: share / 100 }, set_collection_royalty_protocol: { collection, protocol, recipient, share: (share / 100).toString() },
}, },
'auto', 'auto',
) )
@ -264,7 +264,7 @@ export const RoyaltyRegistry = (client: SigningCosmWasmClient, txSigner: string)
collection, collection,
protocol, protocol,
recipient, recipient,
share_delta: shareDelta ? shareDelta / 100 : undefined, share_delta: shareDelta ? (shareDelta / 100).toString() : undefined,
decrement, decrement,
}, },
}, },

View File

@ -124,10 +124,16 @@ const RoyaltyRegistryQueryPage: NextPage = () => {
))} ))}
</select> </select>
</FormControl> </FormControl>
<Conditional test={type === 'collection_royalty_default'}> <Conditional
test={
type === 'collection_royalty_default' ||
type === 'royalty_payment' ||
type === 'collection_royalty_protocol'
}
>
<AddressInput {...collectionAddressState} /> <AddressInput {...collectionAddressState} />
</Conditional> </Conditional>
<Conditional test={type === 'collection_royalty_protocol'}> <Conditional test={type === 'collection_royalty_protocol' || type === 'royalty_payment'}>
<AddressInput {...protocolAddressState} /> <AddressInput {...protocolAddressState} />
</Conditional> </Conditional>
</div> </div>