-
Notifications
You must be signed in to change notification settings - Fork 74
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
refactor: currency types #1238
refactor: currency types #1238
Conversation
packages/advanced-logic/src/extensions/payment-network/near/any-to-near-testnet.ts
Outdated
Show resolved
Hide resolved
@@ -41,8 +41,7 @@ export default class HttpRequestNetwork extends RequestNetwork { | |||
nodeConnectionConfig?: Partial<NodeConnectionConfig>; | |||
signatureProvider?: SignatureProviderTypes.ISignatureProvider; | |||
useMockStorage?: boolean; | |||
currencies?: CurrencyInput[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaking: I suggest to remove this parameter as it's redundant with currencyManager
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed it's redundant, but is the currencyManager
the better choice? I'm not super familiar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
between the two? I would say yes: it enables injecting your own implementation, and the CurrencyManager contains more than just a list of currencies. For instance, it contains the list of Aggregators for conversion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. 👍 Thanks for explaining
c33e957
to
0def2ba
Compare
d68636a
to
8e03773
Compare
Apply suggestions from code review
060bdc0
to
c165aba
Compare
Move all types to the
types
package for better consistency with other types and as a first step to reduce unnecessary dependencies to the currency package.BREAKING: types must be updated with
CurrencyTypes
prefix, imported from@requestnetwork/types
package.BREAKING: the
currencies
field has been removed from theRequestNetwork
client parameters. UsecurrencyManager: new CurrencyManager(CURRENCIES)
instead.