Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade aries-framework packages to 0.4.2 #7

Merged
merged 4 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.