diff --git a/sdk/zksync.js/src/types.ts b/sdk/zksync.js/src/types.ts index 76d2a3f00f..dd642ba498 100644 --- a/sdk/zksync.js/src/types.ts +++ b/sdk/zksync.js/src/types.ts @@ -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; diff --git a/sdk/zksync.js/src/wallet.ts b/sdk/zksync.js/src/wallet.ts index 6aaaec68ed..7f3b48882e 100644 --- a/sdk/zksync.js/src/wallet.ts +++ b/sdk/zksync.js/src/wallet.ts @@ -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()) ]; }