WalletConnect/WalletConnectSharp

Chia React dApp to C#

Blackcode opened this issue · 1 comments

The dapp react is working on Chia blockchain (https://github.com/Chia-Network/chia-wallet-connect-dapp-test/) but I have not managed to do the same from c#.

Is there any way to do it?

I have tried the example code but does not work.

var options = new SignClientOptions()
{
ProjectId = "a97dbb2756d03b9160843f6ec3ecb989",
Metadata = new Metadata()
{
Description = "HDDCoin Marketplace wallet connection",
Icons = new[] { "https://s2.coinmarketcap.com/static/img/coins/200x200/17674.png" },
Name = "HDDCoin Market",
Url = "https://hddcoin.org/"
},
Storage = new InMemoryStorage()
};
var client = await WalletConnectSignClient.Init(options);
var connectData = await client.Connect(new ConnectOptions()
{
RequiredNamespaces = new RequiredNamespaces()
{
{
"chia", new RequiredNamespace()
{
Methods = new[]
{
"chia_getWallets"
},
Chains = new[]
{
"chia:mainnet"
},
Events = new[]
{
"chainChanged", "accountsChanged"
}
}
}
}
});
Console.WriteLine(connectData.Uri);
await connectData.Approval;
Console.WriteLine("Connected");
while (true)
{
await Task.Delay(2000);
}

Solved by removing the events from the connectOptions. Now it bypasses the Approval

Events = new[]
{
"chainChanged", "accountsChanged"
}