diff --git a/src/components/endpoints/Assets.vue b/src/components/endpoints/Assets.vue index 40002b5c..82190abc 100644 --- a/src/components/endpoints/Assets.vue +++ b/src/components/endpoints/Assets.vue @@ -2,7 +2,7 @@ import { getState, setState } from '@/stores' import Notifications from '@/components/Notification.vue' import useNotifications from '@/compositions/useNotifications' -import { ref } from 'vue' +import { ref, toRaw } from 'vue' import { createBlockScoutLink } from '@/utils/createLinks' import Lsp4MetadataForm from '@/components/shared/Lsp4MetadataForm.vue' import LSP8Mintable from '@lukso/lsp-smart-contracts/artifacts/LSP8Mintable.json' @@ -45,11 +45,15 @@ const lsp4Metadata = ref({ }, ], }) - +const creators = ref() const tokenAddress = ref() -const handleNewLsp4Metadata = (metadata: Lsp4Metadata) => { +const handleNewLsp4Metadata = ( + metadata: Lsp4Metadata, + newCreators: string[] +) => { lsp4Metadata.value = metadata + creators.value = newCreators } const handleStandardSelected = (standard: string) => { @@ -72,37 +76,43 @@ const create = async () => { const { deployERC20Token } = useERC20() let deployedAsset + let digitalAssetData switch (token.value.type) { case ContractStandard.LSP7: - deployedAsset = await deployLSP7DigitalAsset({ + digitalAssetData = { isNFT: token.value.isNonDivisible, controllerAddress: erc725AccountAddress, name: token.value.name, symbol: token.value.symbol, - creators: [erc725AccountAddress], + creators: toRaw(creators.value), digitalAssetMetadata: { LSP4Metadata: { ...lsp4Metadata.value, }, }, - }) + } + console.log(digitalAssetData) + deployedAsset = await deployLSP7DigitalAsset(digitalAssetData) console.log('Deployed asset', deployedAsset.LSP7DigitalAsset) addTokenToLocalStore( (tokenAddress.value = deployedAsset.LSP7DigitalAsset.address) ) break case ContractStandard.LSP8: - deployedAsset = await deployLSP8IdentifiableDigitalAsset({ + digitalAssetData = { controllerAddress: erc725AccountAddress, name: token.value.name, symbol: token.value.symbol, - creators: [erc725AccountAddress], + creators: toRaw(creators.value), digitalAssetMetadata: { LSP4Metadata: { ...lsp4Metadata.value, }, }, - }) + } + console.log(digitalAssetData) + deployedAsset = + await deployLSP8IdentifiableDigitalAsset(digitalAssetData) console.log( 'Deployed asset', deployedAsset.LSP8IdentifiableDigitalAsset diff --git a/src/components/endpoints/Mint.vue b/src/components/endpoints/Mint.vue index 258a12cd..f921d5c0 100644 --- a/src/components/endpoints/Mint.vue +++ b/src/components/endpoints/Mint.vue @@ -36,6 +36,7 @@ const lsp4Metadata = ref({ }, ], }) +const creators = ref([getState('address')]) const metadataJsonUrl = '0x6f357c6a6143da573459ba01321df3eb223e96b0015c2914a1907df319804573d538c311697066733a2f2f516d51357071797167637a6d6b736e4e434a734a76333453664469776e4676426d64456f74704254337642464865' @@ -45,6 +46,14 @@ watchEffect(() => { mintToken.value = getState('tokenAddress') }) +const handleNewLsp4Metadata = ( + metadata: Lsp4Metadata, + newCreators: string[] +) => { + lsp4Metadata.value = metadata + creators.value = newCreators +} + const handleTokenSelected = (info: TokenInfo) => { tokenType.value = info.type === LSPType.LSP7DigitalAsset @@ -213,7 +222,7 @@ const mint = async () => {
- +
+
+ +
+ + +
+ +
diff --git a/src/compositions/useLspFactory.ts b/src/compositions/useLspFactory.ts index 4df2404f..0a4a783b 100644 --- a/src/compositions/useLspFactory.ts +++ b/src/compositions/useLspFactory.ts @@ -62,22 +62,7 @@ const uploadUniversalProfileMetaData = async ( ) } -export function useLspFactory(): { - deployUniversalProfile: ( - profileDeploymentOptions: ProfileDeploymentOptions, - contractDeploymentOptions?: ContractDeploymentOptions | undefined - ) => Promise - uploadUniversalProfileMetaData: ( - profileData: ProfileDataBeforeUpload, - uploadOptions?: UploadOptions - ) => Promise - deployLSP7DigitalAsset: ( - digitalAssetDeploymentOptions: LSP7DigitalAssetDeploymentOptions - ) => Promise - deployLSP8IdentifiableDigitalAsset: ( - digitalAssetDeploymentOptions: DigitalAssetDeploymentOptions - ) => Promise -} { +export function useLspFactory() { const hasExtension = !!getProvider() if (!hasExtension) { throw new Error('Extension not installed')