Skip to content

Commit

Permalink
chore: upgrade aries-framework packages to 0.4.2 (#7)
Browse files Browse the repository at this point in the history
* feat: add credentials and proofs modules with dedicated functions

Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>

* chore: upgrade aries-framework packages to 0.4.2

Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>

* refactor: remove isWalletImportable method

Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>

---------

Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>
  • Loading branch information
sairanjit authored Oct 6, 2023
1 parent 8c59f0a commit dd93fbc
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 77 deletions.
12 changes: 6 additions & 6 deletions packages/ssi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
"release": "release-it"
},
"dependencies": {
"@aries-framework/anoncreds": "0.4.1",
"@aries-framework/anoncreds-rs": "0.4.1",
"@aries-framework/askar": "0.4.1",
"@aries-framework/core": "0.4.1",
"@aries-framework/indy-vdr": "0.4.1",
"@aries-framework/anoncreds": "0.4.2",
"@aries-framework/anoncreds-rs": "0.4.2",
"@aries-framework/askar": "0.4.2",
"@aries-framework/core": "0.4.2",
"@aries-framework/indy-vdr": "0.4.2",
"@aries-framework/push-notifications": "^0.6.0",
"@aries-framework/react-hooks": "0.5.0",
"@aries-framework/react-native": "0.4.1"
"@aries-framework/react-native": "0.4.2"
},
"peerDependencies": {
"@hyperledger/anoncreds-react-native": "^0.1.0",
Expand Down
12 changes: 10 additions & 2 deletions packages/ssi/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,13 @@ import {
GetCredentialFormatDataReturn,
ProofFormatPayload,
AgentMessage,
AutoAcceptProof
AutoAcceptProof,
ConnectionType
} from '@aries-framework/core'
import {
GetCredentialsForRequestReturn,
ProofFormatDataMessagePayload
} from '@aries-framework/core/build/modules/proofs/protocol/ProofProtocolOptions'
// Indy VDR
import { IndyVdrPoolConfig } from '@aries-framework/indy-vdr'

Expand Down Expand Up @@ -75,7 +80,10 @@ export {
GetCredentialFormatDataReturn,
ProofFormatPayload,
AgentMessage,
AutoAcceptProof
AutoAcceptProof,
ConnectionType,
GetCredentialsForRequestReturn,
ProofFormatDataMessagePayload
}
// Anoncreds
export {
Expand Down
33 changes: 0 additions & 33 deletions packages/ssi/src/wallet/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,39 +52,6 @@ export const isWalletPinCorrect = async (walletConfig: WalletConfig) => {
}
}

/**
* Checks if a wallet can be imported successfully with the given configuration.
*
* @param walletConfig The configuration for the wallet.
* @param importConfig The configuration for importing the wallet.
* @returns A Promise that resolves to a boolean indicating whether the wallet can be imported successfully.
*/
export const isWalletImportable = async (
walletConfig: WalletConfig,
importConfig: WalletExportImportConfig
): Promise<boolean> => {
const fileSystem = new agentDependencies.FileSystem()
try {
const tempImportPath = fileSystem.tempPath + '/importTemp'
// Add temp path to wallet config
walletConfig.storage = {
type: 'sqlite',
path: tempImportPath
}
// NOTE: a custom wallet is used to check if the wallet passphrase is correct and can be imported successfully.
const askarWallet = new AskarWallet(new ConsoleLogger(LogLevel.off), fileSystem, new SigningProviderRegistry([]))
await askarWallet.import(walletConfig, importConfig)

await fileSystem.delete(importConfig.path)
return true
} catch (e) {
// eslint-disable-next-line no-console
console.log('Error importing wallet', e)
await fileSystem.delete(importConfig.path)
return false
}
}

/**
* Imports a wallet with an agent.
*
Expand Down
116 changes: 80 additions & 36 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dd93fbc

Please sign in to comment.