-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: martines3000 <domajnko.martin@gmail.com>
- Loading branch information
1 parent
4c8af21
commit 96ba0ab
Showing
21 changed files
with
287 additions
and
235 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
"@blockchain-lab-um/extended-verification": patch | ||
"@blockchain-lab-um/did-provider-key": patch | ||
"@blockchain-lab-um/veramo-datamanager": patch | ||
"@blockchain-lab-um/utils": patch | ||
--- | ||
|
||
Build packages with Tsup |
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,5 @@ | ||
--- | ||
"@blockchain-lab-um/masca": patch | ||
--- | ||
|
||
Added migration for legacy state when importing state |
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 |
---|---|---|
|
@@ -55,6 +55,9 @@ | |
}, | ||
"a11y": { | ||
"useKeyWithClickEvents": "off" | ||
}, | ||
"performance": { | ||
"noDelete": "off" | ||
} | ||
} | ||
}, | ||
|
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Options, defineConfig } from 'tsup'; | ||
|
||
export default defineConfig((options: Options) => ({ | ||
target: 'es2020', | ||
treeshake: true, | ||
splitting: true, | ||
tsconfig: './tsconfig.build.json', | ||
entry: ['src/**/*.ts'], | ||
format: 'esm', | ||
dts: true, | ||
minify: false, | ||
clean: true, | ||
...options, | ||
})); |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './getLegacyStateV1'; |
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,79 @@ | ||
import { | ||
MascaLegacyAccountStateV1, | ||
MascaLegacyStateV1, | ||
MascaLegacyAccountConfigV1, | ||
PolygonLegacyBaseStateV1, | ||
PolygonLegacyStateV1, | ||
} from '@blockchain-lab-um/masca-types'; | ||
import cloneDeep from 'lodash.clonedeep'; | ||
|
||
const emptyPolygonBaseState: PolygonLegacyBaseStateV1 = { | ||
credentials: {}, | ||
identities: {}, | ||
profiles: {}, | ||
merkleTreeMeta: [], | ||
merkleTree: {}, | ||
}; | ||
|
||
const emptyPolygonState: PolygonLegacyStateV1 = { | ||
polygonid: { | ||
eth: { | ||
main: cloneDeep(emptyPolygonBaseState), | ||
mumbai: cloneDeep(emptyPolygonBaseState), // To satisfy the type checker | ||
}, | ||
polygon: { | ||
main: cloneDeep(emptyPolygonBaseState), | ||
mumbai: cloneDeep(emptyPolygonBaseState), | ||
}, | ||
}, | ||
iden3: { | ||
eth: { | ||
main: cloneDeep(emptyPolygonBaseState), | ||
mumbai: cloneDeep(emptyPolygonBaseState), // To satisfy the type checker | ||
}, | ||
polygon: { | ||
main: cloneDeep(emptyPolygonBaseState), | ||
mumbai: cloneDeep(emptyPolygonBaseState), | ||
}, | ||
}, | ||
}; | ||
|
||
const emptyAccountState = { | ||
polygon: { | ||
state: emptyPolygonState, | ||
}, | ||
veramo: { | ||
credentials: {}, | ||
}, | ||
general: { | ||
account: { | ||
ssi: { | ||
selectedMethod: 'did:ethr', | ||
storesEnabled: { | ||
snap: true, | ||
ceramic: true, | ||
}, | ||
}, | ||
} as MascaLegacyAccountConfigV1, | ||
}, | ||
} as MascaLegacyAccountStateV1; | ||
|
||
export const getLegacyEmptyAccountStateV1 = () => cloneDeep(emptyAccountState); | ||
|
||
const initialSnapState: MascaLegacyStateV1 = { | ||
v1: { | ||
accountState: {}, | ||
currentAccount: '', | ||
config: { | ||
dApp: { | ||
disablePopups: false, | ||
friendlyDapps: ['masca.io'], | ||
}, | ||
snap: { | ||
acceptedTerms: true, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export const getLegacyStateV1 = () => cloneDeep(initialSnapState); |
Oops, something went wrong.