Skip to content

Commit

Permalink
Review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
ly0va committed May 25, 2021
1 parent 2ba4a9b commit 17eea41
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 2 additions & 0 deletions sdk/zksync.js/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,14 @@ export interface Signature {

export type Ratio = [BigNumberish, BigNumberish];

/// represents ratio between tokens themself
export type TokenRatio = {
type: 'Token';
[token: string]: string | number;
[token: number]: string | number;
};

/// represents ratio between lowest token denominations (wei, satoshi, etc.)
export type WeiRatio = {
type: 'Wei';
[token: string]: BigNumberish;
Expand Down
8 changes: 2 additions & 6 deletions sdk/zksync.js/src/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,12 +470,8 @@ export class Wallet {
ratio = [order.ratio[sell], order.ratio[buy]];
} else if (order.ratio.type == 'Token') {
ratio = [
isNFT(sell)
? BigNumber.from(order.ratio[sell])
: this.provider.tokenSet.parseToken(sell, order.ratio[sell].toString()),
isNFT(buy)
? BigNumber.from(order.ratio[buy])
: this.provider.tokenSet.parseToken(buy, order.ratio[buy].toString())
this.provider.tokenSet.parseToken(sell, order.ratio[sell].toString()),
this.provider.tokenSet.parseToken(buy, order.ratio[buy].toString())
];
}

Expand Down

0 comments on commit 17eea41

Please sign in to comment.