-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
996 additions
and
67 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
api-schema/src/main/java/org/stellar/anchor/api/sep/sep45/ChallengeRequest.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.stellar.anchor.api.sep.sep45; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
|
||
@Builder | ||
@Data | ||
public class ChallengeRequest { | ||
private String account; | ||
|
||
@JsonProperty("home_domain") | ||
private String homeDomain; | ||
|
||
@JsonProperty("client_domain") | ||
private String clientDomain; | ||
} |
15 changes: 15 additions & 0 deletions
15
api-schema/src/main/java/org/stellar/anchor/api/sep/sep45/ChallengeResponse.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,15 @@ | ||
package org.stellar.anchor.api.sep.sep45; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
|
||
@Builder | ||
@Data | ||
public class ChallengeResponse { | ||
@JsonProperty("authorization_entries") | ||
private String authorizationEntries; | ||
|
||
@JsonProperty("network_passphrase") | ||
private String networkPassphrase; | ||
} |
12 changes: 12 additions & 0 deletions
12
api-schema/src/main/java/org/stellar/anchor/api/sep/sep45/ValidationRequest.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,12 @@ | ||
package org.stellar.anchor.api.sep.sep45; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
|
||
@Builder | ||
@Data | ||
public class ValidationRequest { | ||
@JsonProperty("authorization_entries") | ||
private String authorizationEntries; | ||
} |
10 changes: 10 additions & 0 deletions
10
api-schema/src/main/java/org/stellar/anchor/api/sep/sep45/ValidationResponse.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,10 @@ | ||
package org.stellar.anchor.api.sep.sep45; | ||
|
||
import lombok.Builder; | ||
import lombok.Data; | ||
|
||
@Builder | ||
@Data | ||
public class ValidationResponse { | ||
private String token; | ||
} |
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 |
---|---|---|
|
@@ -10,5 +10,7 @@ public interface AppConfig { | |
|
||
String getHorizonUrl(); | ||
|
||
String getRpcUrl(); | ||
|
||
List<String> getLanguages(); | ||
} |
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
14 changes: 14 additions & 0 deletions
14
core/src/main/java/org/stellar/anchor/config/Sep45Config.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,14 @@ | ||
package org.stellar.anchor.config; | ||
|
||
import java.util.List; | ||
|
||
public interface Sep45Config { | ||
|
||
Boolean getEnabled(); | ||
|
||
String getWebAuthDomain(); | ||
|
||
String getWebAuthContractId(); | ||
|
||
List<String> getHomeDomains(); | ||
} |
2 changes: 1 addition & 1 deletion
2
...a/org/stellar/anchor/horizon/Horizon.java → ...a/org/stellar/anchor/network/Horizon.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
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,30 @@ | ||
package org.stellar.anchor.network; | ||
|
||
import lombok.Getter; | ||
import org.stellar.anchor.config.AppConfig; | ||
import org.stellar.sdk.SorobanServer; | ||
import org.stellar.sdk.Transaction; | ||
import org.stellar.sdk.TransactionBuilderAccount; | ||
import org.stellar.sdk.responses.sorobanrpc.GetLatestLedgerResponse; | ||
import org.stellar.sdk.responses.sorobanrpc.SimulateTransactionResponse; | ||
|
||
@Getter | ||
public class Rpc { | ||
private final SorobanServer rpc; | ||
|
||
public Rpc(AppConfig appConfig) { | ||
this.rpc = new SorobanServer(appConfig.getRpcUrl()); | ||
} | ||
|
||
public TransactionBuilderAccount getAccount(String accountId) { | ||
return rpc.getAccount(accountId); | ||
} | ||
|
||
public SimulateTransactionResponse simulateTransaction(Transaction transaction) { | ||
return rpc.simulateTransaction(transaction); | ||
} | ||
|
||
public GetLatestLedgerResponse getLatestLedger() { | ||
return rpc.getLatestLedger(); | ||
} | ||
} |
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
14 changes: 14 additions & 0 deletions
14
core/src/main/java/org/stellar/anchor/sep45/ISep45Service.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,14 @@ | ||
package org.stellar.anchor.sep45; | ||
|
||
import org.stellar.anchor.api.exception.AnchorException; | ||
import org.stellar.anchor.api.sep.sep45.ChallengeRequest; | ||
import org.stellar.anchor.api.sep.sep45.ChallengeResponse; | ||
import org.stellar.anchor.api.sep.sep45.ValidationRequest; | ||
import org.stellar.anchor.api.sep.sep45.ValidationResponse; | ||
|
||
public interface ISep45Service { | ||
|
||
ChallengeResponse getChallenge(ChallengeRequest request) throws AnchorException; | ||
|
||
ValidationResponse validate(ValidationRequest request) throws AnchorException; | ||
} |
Oops, something went wrong.