Eutherpy
Eutherpy

Reputation: 4581

Poloniex C# API - error when trying to withdraw ETH

I am using the Poloniex C# API available here: Poloniex C#.

I am trying to withdraw ETH from my account like this:

private string ETHWithdrawalAddress;

public async void WithdrawETH(double amount)
{
 var addresses = await client.Wallet.GetDepositAddressesAsync();
 ETHWithdrawalAddress = addresses["ETH"];
 await client.Wallet.PostWithdrawalAsync("ETH", amount,   ETHWithdrawalAddress);
}

but I'm receiving this error

Could not create an instance of type Jojatekok.PoloniexAPI.WalletTools.IGeneratedDepositAddress.

Type is an interface or abstract class and cannot be instantiated.

Any help with solving this problem would be appreciated.

Upvotes: 2

Views: 488

Answers (1)

Eutherpy
Eutherpy

Reputation: 4581

I solved the problem by changing the last line of the PostWithdraw() method in the API

PostData<IGeneratedDepositAddress>("withdraw", postData);

to

PostData<GeneratedDepositAddress>("withdraw", postData);

Upvotes: 2

Related Questions