-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: improve did logic to interact with did registry obtained fr…
…om did
- Loading branch information
Showing
10 changed files
with
231 additions
and
70 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
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 |
---|---|---|
@@ -1,6 +1,51 @@ | ||
export const REGISTRY: Map<string, string[]> = new Map<string, string[]>(); | ||
REGISTRY.set('0x9e55c', ['0x54358D929CCf45C7cCEE8Ca60FCD0C0402489F54']); | ||
export const DEFAULT_REGISTRY: Map<string, string> = new Map<string, string>(); | ||
DEFAULT_REGISTRY.set('0x9e55c', '0x54358D929CCf45C7cCEE8Ca60FCD0C0402489F54'); | ||
import { DidSpec } from 'src/interfaces/did/did.generics'; | ||
|
||
type didversionType = Map<string, boolean>; | ||
type didType = Map<string, didversionType>; | ||
type didRegistryType = Map<string, didType>; | ||
type chainregistryType = Map<string, didRegistryType>; | ||
|
||
export const DID_LAC1_NAME = 'lac1'; | ||
export const DID_CODE = new Map<string, string>([[DID_LAC1_NAME, '0001']]); | ||
export const OPEN_PROTESTESNET_CHAIN_ID = '0x9e55c'; | ||
|
||
export const SUPPORTED_DID_TYPES = new Map<string, didversionType>([ | ||
['0001', new Map([['0001', true]])] | ||
]); | ||
|
||
// setting for open protestnet | ||
export const CHAIN_REGISTRY: chainregistryType = new Map< | ||
string, | ||
didRegistryType | ||
>(); | ||
const openProtestnetSupportedRegistries: didRegistryType = new Map< | ||
string, | ||
didType | ||
>(); | ||
openProtestnetSupportedRegistries.set( | ||
'0x54358D929CCf45C7cCEE8Ca60FCD0C0402489F54', | ||
new Map([['0001', new Map([['0001', true]])]]) | ||
); | ||
CHAIN_REGISTRY.set( | ||
OPEN_PROTESTESNET_CHAIN_ID, | ||
openProtestnetSupportedRegistries | ||
); | ||
|
||
export const DEFAULT_DID_REGISTRY: Map<string, DidSpec> = new Map< | ||
string, | ||
DidSpec | ||
>([ | ||
[ | ||
OPEN_PROTESTESNET_CHAIN_ID, | ||
{ | ||
didType: '0001', | ||
didVersion: '0001', | ||
didRegistryAddress: '0x54358D929CCf45C7cCEE8Ca60FCD0C0402489F54', | ||
didMethod: 'lac1' | ||
} | ||
] | ||
]); | ||
|
||
// WIP: for did:web | ||
export const DOMAIN_NAMES: string[] = ['lacchain.id', 'another.lacchain.id']; | ||
export const DEFAULT_DOMAIN_NAME = 'lacchain.id'; |
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,14 @@ | ||
export interface DidSpec { | ||
didMethod: string; | ||
didType: string; | ||
didVersion: string; | ||
didRegistryAddress: string; | ||
} | ||
|
||
export interface DidRegistryParams { | ||
didMethod: string; | ||
didType: string; | ||
didVersion: string; | ||
didRegistryAddress: string; | ||
chainId: string; | ||
} |
Oops, something went wrong.