openwallet-foundation / bifold-wallet

Aries Mobile Agent React Native - Part of the Aries Bifold effort to provide SSI capabilities in a production ready app.
Apache License 2.0
136 stars 134 forks source link

chore: move ledgers to di #1141

Closed jleach closed 1 month ago

jleach commented 1 month ago

Summary of Changes

Move the ledgers from config so they are managed and access through dependency injection (di).

import { TOKENS, useContainer } from '../container-api'
...
const container = useContainer()
const indyLedgers = container.resolve(TOKENS.UTIL_LEDGERS)

Related Issues

n/a

Pull Request Checklist

Tick all boxes below to demonstrate that you have completed the respective task. If the item does not apply to your this PR check it anyway to make it apparent that there's nothing to do.

If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!

Pro Tip 🤓

PR template adapted from the Python attrs project.

thiagoromanos commented 1 month ago

Is there a way to inject the agent modules (getAgentModules from /utils/agent.ts), which is the one that uses those ledger configs? If it's possible, even the agent modules would be injectable, allowing us to use a custom did resolver for example.

sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud