-
Notifications
You must be signed in to change notification settings - Fork 6
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
28 changed files
with
1,259 additions
and
164 deletions.
There are no files selected for viewing
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
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
49 changes: 49 additions & 0 deletions
49
ethr-did/src/main/java/me/uport/sdk/ethrdid/EthrDIDNetwork.kt
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,49 @@ | ||
package me.uport.sdk.ethrdid | ||
|
||
import me.uport.sdk.core.EthNetwork | ||
import me.uport.sdk.jsonrpc.JsonRPC | ||
|
||
/** | ||
* Encapsulates the configuration necessary to resolve an ethr-did (ERC1056) | ||
* | ||
* You can specify multiple of these configurations to an [EthrDIDResolver.Builder] to allow it to resolve ethr-DIDs | ||
* anchored in the respective networks. | ||
* example: `did:ethr:rinkeby:0xcf03dd0a894ef79cb5b601a43c4b25e3ae4c67ed` | ||
* | ||
* Please see https://github.com/uport-project/ethr-did-registry#contract-deployments for the known registry addresses. | ||
*/ | ||
class EthrDIDNetwork ( | ||
/** | ||
* name of the ethereum network (ex: "mainnet", "rinkeby") | ||
*/ | ||
val name: String, | ||
|
||
/** | ||
* address of the ERC1056 contract. | ||
* The default for the more popular networks is "0xdca7ef03e98e0dc2b855be647c39abe984fcf21b" | ||
*/ | ||
val registryAddress: String, | ||
|
||
/** | ||
* A JsonRPC instance | ||
* | ||
* for example JsonRPC("https://rinkeby.infura.io/v3/<your infura api key>") | ||
*/ | ||
val rpc: JsonRPC, | ||
|
||
/** | ||
* The chain ID (see EIP-155 https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md) | ||
*/ | ||
val chainId: String? = null | ||
) | ||
|
||
/** | ||
* converts a network description to an [EthrDIDNetwork] instance | ||
*/ | ||
fun EthNetwork.toEthrDIDNetwork() = | ||
EthrDIDNetwork( | ||
name = name, | ||
chainId = networkId, | ||
registryAddress = ethrDidRegistry, | ||
rpc = JsonRPC(rpcUrl) | ||
) |
Oops, something went wrong.