Skip to content

Commit

Permalink
ALL-2997 - Fixed tatumSdk.walletProvider.use() method custom config (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Smrecz authored Oct 10, 2023
1 parent 8e94cf2 commit 28e8a55
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [4.0.16] - 2023.10.10
### Changed
- Fixed `tatumSdk.walletProvider.use()` method to return properly typed extension instance is case of custom typed configurations.

## [4.0.15] - 2023.10.10
### Changed
- Loosen types for extension registration purposes to better support optional config.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tatumio/tatum",
"version": "4.0.15",
"version": "4.0.16",
"description": "Tatum JS SDK",
"author": "Tatum",
"repository": "https://github.com/tatumio/tatum-js",
Expand Down
3 changes: 2 additions & 1 deletion src/e2e/extensions/e2e.extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ export class TestExtension extends TatumSdkExtension {
export class TestWalletProvider extends TatumSdkWalletProvider<string, string> {
private readonly sdkConfig: TatumConfig

constructor(tatumSdkContainer: ITatumSdkContainer, private readonly mockTestExtension?: any) {
constructor(tatumSdkContainer: ITatumSdkContainer, private readonly mockTestExtension?: any, someOtherConfig?: {someConfigValue: boolean}) {
super(tatumSdkContainer)
this.sdkConfig = this.tatumSdkContainer.getConfig()
console.log('someOtherConfig', someOtherConfig)
if(!mockTestExtension){
this.mockTestExtension = {
dummyMethod: jest.fn(),
Expand Down
3 changes: 2 additions & 1 deletion src/service/walletProvider/wallet.provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export class WalletProvider {
* Works are an entrypoint to interact with wallet providers of choice.
* @param type - Wallet Provider type imported to the SDK instance
*/
use<T, P, E extends TatumSdkWalletProvider<T, P>>(type: new (tatumSdkContainer: ITatumSdkContainer, ...args: unknown[]) => E): E {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
use<T, P, E extends TatumSdkWalletProvider<T, P>>(type: new (tatumSdkContainer: ITatumSdkContainer, ...args: any[]) => E): E {
return Container.of(this.id).get(type);
}
}

0 comments on commit 28e8a55

Please sign in to comment.