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

Extend Http base class with config interface and add optional chaining to the Client #344

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

letelete
Copy link

@letelete letelete commented Aug 18, 2022

This PR is a proposal for implementing fluent interface experience provided by the SDK.

Chained methods (withLocale) are optional, don't break usage of the SDK, and are backward compatible.

Moreover, a configuration can be overridden on endpoint calls by passing particular params (eg. locale).

This proposal suggests a base PoC for refactoring the SDK and enabling the user to provide initial configuration on the makeClient function call level such as Bearer token, Currency, and more...

@letelete letelete changed the title Extend Http base class with locale interface and add optional chaining to the Client Extend Http base class with config interface and add optional chaining to the Client Aug 19, 2022
public async accountInfo(options: AccountInfoOptions): Promise<IAccountResult>
export default class Account<ClientOptions extends AllowedClientBuilderOptions> extends Http {
public async contractTest(options: AccountContractTestOptions<ClientOptions>): Promise<string> {
return options.locale ?? 'asd'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@letelete this seems like a leftover from local testing ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants