-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4831 from donald-jackson/kraken-network-deposit-s…
…upport [kraken] add different network support for currency deposit addresses
- Loading branch information
Showing
17 changed files
with
595 additions
and
27 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
...nge-core/src/main/java/org/knowm/xchange/exceptions/DepositAddressAmbiguousException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.knowm.xchange.exceptions; | ||
|
||
import java.util.List; | ||
import lombok.Getter; | ||
|
||
/** Exception indicating a requested deposit address has multiple networks and network required */ | ||
@Getter | ||
public class DepositAddressAmbiguousException extends ExchangeException { | ||
private final List<String> networks; | ||
|
||
public DepositAddressAmbiguousException(List<String> networks) { | ||
super("Deposit Address Not Found"); | ||
this.networks = networks; | ||
} | ||
|
||
public DepositAddressAmbiguousException(List<String> networks, String message) { | ||
super(message); | ||
this.networks = networks; | ||
} | ||
|
||
public DepositAddressAmbiguousException(List<String> networks, String message, Throwable cause) { | ||
super(message, cause); | ||
this.networks = networks; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
xchange-core/src/main/java/org/knowm/xchange/exceptions/DepositAddressCreationException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.knowm.xchange.exceptions; | ||
|
||
/** Exception indicating a deposit address could not be created */ | ||
public class DepositAddressCreationException extends ExchangeException { | ||
|
||
public DepositAddressCreationException() { | ||
super("Deposit Address Could Not Be Created"); | ||
} | ||
|
||
public DepositAddressCreationException(String message) { | ||
super(message); | ||
} | ||
|
||
public DepositAddressCreationException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
xchange-core/src/main/java/org/knowm/xchange/exceptions/DepositAddressNotFoundException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.knowm.xchange.exceptions; | ||
|
||
/** Exception indicating a requested deposit address was not found */ | ||
public class DepositAddressNotFoundException extends ExchangeException { | ||
|
||
public DepositAddressNotFoundException() { | ||
super("Deposit Address Not Found"); | ||
} | ||
|
||
public DepositAddressNotFoundException(String message) { | ||
super(message); | ||
} | ||
|
||
public DepositAddressNotFoundException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...ain/java/org/knowm/xchange/service/account/params/DefaultRequestDepositAddressParams.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.knowm.xchange.service.account.params; | ||
|
||
import lombok.Builder; | ||
import lombok.Value; | ||
import lombok.experimental.NonFinal; | ||
import lombok.extern.jackson.Jacksonized; | ||
import org.knowm.xchange.currency.Currency; | ||
|
||
@Value | ||
@NonFinal | ||
@Builder | ||
@Jacksonized | ||
public class DefaultRequestDepositAddressParams implements RequestDepositAddressParams { | ||
Currency currency; | ||
String network; | ||
|
||
@Builder.Default boolean newAddress = false; | ||
|
||
String[] extraArguments; | ||
|
||
public static DefaultRequestDepositAddressParams create(Currency currency, String... args) { | ||
return DefaultRequestDepositAddressParams.builder() | ||
.currency(currency) | ||
.extraArguments(args) | ||
.build(); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...e/src/main/java/org/knowm/xchange/service/account/params/RequestDepositAddressParams.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.knowm.xchange.service.account.params; | ||
|
||
import org.knowm.xchange.currency.Currency; | ||
|
||
public interface RequestDepositAddressParams { | ||
Currency getCurrency(); | ||
|
||
String getNetwork(); | ||
|
||
boolean isNewAddress(); | ||
|
||
String[] getExtraArguments(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.