Hello I am facing issues in getproviders here it is not returning any instance. I am not even getting an error export async function getProviders(wallet ) {
try {
const zkConfigPath = path.resolve(
currentDir,
“contract-nft-verification”,
“src”,
“managed”,
“NFTVerification”
);
const walletProvider = await getWalletProvider(wallet );
console.log(walletProvider);
return {
privateStateProvider: levelPrivateStateProvider({
privateStateStoreName: "counter-private-state",
}),
publicDataProvider: indexerPublicDataProvider(
config.indexer,
config.indexerWS
),
zkConfigProvider: new NodeZkConfigProvider(zkConfigPath),
proofProvider: httpClientProofProvider(config.proofServer),
walletProvider,
midnightProvider: walletProvider,
};
} catch (err) {
console.error(“
Failed to initialize providers:”, err);
throw err;
}
} This is the corresponding getwalletprovider async function getWalletProvider(wallet) {
const state = await Rx.firstValueFrom(wallet.state());
return {
coinPublicKey: state.coinPublicKey,
encryptionPublicKey: state.encryptionPublicKey,
async balanceTx(tx, newCoins) {
return wallet
.balanceTransaction(
ZswapTransaction.deserialize(tx.serialize(), getZswapNetworkId()),
newCoins
)
.then((tx) => wallet.proveTransaction(tx))
.then((zswapTx) =>
Transaction.deserialize(zswapTx.serialize(getZswapNetworkId()), getLedgerNetworkId())
)
.then(createBalancedTx);
},
submitTx(tx) {
return wallet.submitTransaction(tx);
},
};
}
This is the corresponding config file
const config = {
indexer: “https://indexer.testnet-02.midnight.network/api/v1/graphql”,
indexerWS: “wss://indexer.testnet-02.midnight.network/api/v1/graphql/ws”,
node: “https://rpc.testnet-02.midnight.network/”,
proofServer: “http://127.0.0.1:6300/”,
};