Closed as not planned
Closed as not planned
Description
Problem
Request Network uses config variables at runtime. This means that the package MUST contain code to support all possible configurations even if they're not used.
Proposed Solution
Use dependency injection to empower the user to select the features and dependencies they want. This will involve API BREAKING CHANGES and refactoring package boundaries.
Definition of Done
This issue is an EPIC that encompasses the following subtasks:
- SDK - Split
payment-detection
by payment network. Inject payment detectors into the request client. Remove theskipPaymentDetection
flag. #1211 - Inject web3 library: support ethers v5, ethers v6, and viem #1111
- Inject CurrencyManager #1524
- Inject supported chains list #1525
- Make the SDK more permissive: eliminate allowlists for chain, currency, and paymentNetwork #1208
- Fix
request-client.js
to makeepk-signature
depencency injectable (likeweb3-signature
). Unclear why this dependency exists. #1523
Example
In the following code snippet, notice that the currencyManager, chains, and balanceDetectors are all injected.
const requestNetwork = new RequestNetwork({
decryptionProvider,
signatureProvider,
currencyManager,
chains,
// if no compatible balance detector is found, the balance will be null.
balanceDetectors: [
new EvmTheGraphBalanceDetector(chains, currencyManager),
new NearTheGraphBalanceDetector(chains),
new BtcBalanceDetector(),
new SolanaBalanceDetector(),
new SuperfluidBalanceDetector(chains),
// ...
]
})
Reference
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
✅ Done