Skip to content

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.

3 participants