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

fix: fix return types for token mixins #465

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core-sdk/src/erc1155/mixin.ts
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it was correct before

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class ERC1155Mixin extends BaseCoreSDK {
/* -------------------------------------------------------------------------- */
public async erc1155BalanceOf(
args: Omit<Parameters<typeof balanceOf>[0], "web3Lib">
): Promise<ReturnType<typeof balanceOf>> {
): ReturnType<typeof balanceOf> {
return balanceOf({ web3Lib: this._web3Lib, ...args });
}
}
14 changes: 7 additions & 7 deletions packages/core-sdk/src/erc20/mixin.ts
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it was correct before

Original file line number Diff line number Diff line change
Expand Up @@ -15,43 +15,43 @@ export class ERC20Mixin extends BaseCoreSDK {
/* -------------------------------------------------------------------------- */
public async erc20Approve(
args: Omit<Parameters<typeof approve>[0], "web3Lib">
): Promise<ReturnType<typeof approve>> {
): ReturnType<typeof approve> {
return approve({ web3Lib: this._web3Lib, ...args });
}

public async erc20GetAllowance(
args: Omit<Parameters<typeof getAllowance>[0], "web3Lib">
): Promise<ReturnType<typeof getAllowance>> {
): ReturnType<typeof getAllowance> {
return getAllowance({ web3Lib: this._web3Lib, ...args });
}

public async erc20GetDecimals(
args: Omit<Parameters<typeof getDecimals>[0], "web3Lib">
): Promise<ReturnType<typeof getDecimals>> {
): ReturnType<typeof getDecimals> {
return getDecimals({ web3Lib: this._web3Lib, ...args });
}

public async erc20GetSymbol(
args: Omit<Parameters<typeof getSymbol>[0], "web3Lib">
): Promise<ReturnType<typeof getSymbol>> {
): ReturnType<typeof getSymbol> {
return getSymbol({ web3Lib: this._web3Lib, ...args });
}

public async erc20GetName(
args: Omit<Parameters<typeof getName>[0], "web3Lib">
): Promise<ReturnType<typeof getName>> {
): ReturnType<typeof getName> {
return getName({ web3Lib: this._web3Lib, ...args });
}

public async erc20EnsureAllowance(
args: Omit<Parameters<typeof ensureAllowance>[0], "web3Lib">
): Promise<ReturnType<typeof ensureAllowance>> {
): ReturnType<typeof ensureAllowance> {
return ensureAllowance({ web3Lib: this._web3Lib, ...args });
}

public async erc20BalanceOf(
args: Omit<Parameters<typeof balanceOf>[0], "web3Lib">
): Promise<ReturnType<typeof balanceOf>> {
): ReturnType<typeof balanceOf> {
return balanceOf({ web3Lib: this._web3Lib, ...args });
}
}
6 changes: 3 additions & 3 deletions packages/core-sdk/src/erc721/mixin.ts
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it was correct before

Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ export class ERC721Mixin extends BaseCoreSDK {
/* -------------------------------------------------------------------------- */
public async erc721BalanceOf(
args: Omit<Parameters<typeof balanceOf>[0], "web3Lib">
): Promise<ReturnType<typeof balanceOf>> {
): ReturnType<typeof balanceOf> {
return balanceOf({ web3Lib: this._web3Lib, ...args });
}

public async erc721OwnerOf(
args: Omit<Parameters<typeof ownerOf>[0], "web3Lib">
): Promise<ReturnType<typeof ownerOf>> {
): ReturnType<typeof ownerOf> {
return ownerOf({ web3Lib: this._web3Lib, ...args });
}

public async erc721TokenOfOwnerByIndex(
args: Omit<Parameters<typeof tokenOfOwnerByIndex>[0], "web3Lib">
): Promise<ReturnType<typeof tokenOfOwnerByIndex>> {
): ReturnType<typeof tokenOfOwnerByIndex> {
return tokenOfOwnerByIndex({ web3Lib: this._web3Lib, ...args });
}
}