Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 7 additions & 14 deletions src/modules/minters/minters-deployer.abi.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Address, AddressValue, SmartContractController, SmartContractQuery, U32Value } from '@multiversx/sdk-core';
import { Address, AddressValue, SmartContractController, U32Value } from '@multiversx/sdk-core';
import { Injectable } from '@nestjs/common';
import { MxApiService } from 'src/common';
import { gas } from 'src/config';
Expand Down Expand Up @@ -52,19 +52,12 @@ export class MintersDeployerAbiService {
this.mxApiService.getService(),
MarketplaceUtils.deployerMintersAbiPath,
);
const queryResult = await controller.query({
contract: Address.newFromBech32(process.env.DEPLOYER_ADDRESS),
function: 'getUserNftMinterContracts',
arguments: [new AddressValue(Address.newFromBech32(address))],
});

const getDataQuery = await controller.runQuery(
new SmartContractQuery({
contract: Address.newFromBech32(process.env.DEPLOYER_ADDRESS),
function: 'getUserNftMinterContracts',
arguments: [new Uint8Array(Buffer.from(new AddressValue(Address.newFromBech32(address)).toString()))],
}),
);

const [response] = controller.parseQueryResponse(getDataQuery);

const contractAddresses: AddressValue[] = response.valueOf().toFixed();

return contractAddresses.map((x) => x.valueOf().toBech32());
return queryResult[0].map((x: Address) => x.toBech32());
}
}