Skip to content

Commit

Permalink
Fix esm (#522)
Browse files Browse the repository at this point in the history
* fix lodash

* fix esm
  • Loading branch information
ntduan authored Sep 5, 2024
1 parent 8e794fa commit fb2aff8
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/sdk-core/src/converter.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AcalaPrimitivesCurrencyCurrencyId, AcalaPrimitivesCurrencyTokenSymbol } from '@polkadot/types/lookup';
import { isArray } from 'lodash';
import isArray from 'lodash/isArray.js';
import {
ConvertToCurrencyIdFailed,
ConvertToCurrencyNameFailed,
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-core/src/fixed-point-number.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BigNumber } from 'bignumber.js';
import { isNumber } from 'lodash';
import isNumber from 'lodash/isNumber.js';

/**
* @constant
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-loan/src/loan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { GlobalLoan, LoanSDKParams, LoanTypes, UserLoan } from './types.js';
import { map } from 'rxjs/operators';
import { combineLatest, firstValueFrom, Observable } from 'rxjs';
import { memoize } from '@polkadot/util';
import { PriceProviderType } from '@acala-network/sdk/wallet/price-provider/types.js';
import { PriceProviderType } from '@acala-network/sdk/wallet/price-provider/types';
import { LoanCalculator } from './loan-calculator.js';

const YEAR_SECONDS = 365 * 24 * 60 * 60; // second of one year
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-loan/src/storages.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Storage } from '@acala-network/sdk/utils/storage/index.js';
import { Storage } from '@acala-network/sdk/utils/storage/index';
import { AnyApi, Token } from '@acala-network/sdk-core';
import {
AcalaPrimitivesPosition,
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-loan/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Wallet } from '@acala-network/sdk';
import { AnyApi, FixedPointNumber, Token } from '@acala-network/sdk-core';
import { PriceProviderType } from '@acala-network/sdk/wallet/price-provider/types.js';
import { PriceProviderType } from '@acala-network/sdk/wallet/price-provider/types';

export interface LoanSDKParams {
api: AnyApi;
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-payment/src/Payment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Wallet } from '@acala-network/sdk';
import { AggregateDex } from '@acala-network/sdk-swap';
import { PaymentConfig, PaymentMethod, PaymentMethodTypes, Tx } from './types.js';
import { AnyApi, Token } from '@acala-network/sdk-core';
import { isEmpty } from 'lodash';
import isEmpty from 'lodash/isEmpty.js';
import { toPromise } from './utils/index.js';
import { Storages, createStorages } from './storage.js';
import { NotReady } from './error.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-payment/src/storage.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AnyApi } from '@acala-network/sdk-core';
import { Storage } from '@acala-network/sdk/utils/storage/index.js';
import { Storage } from '@acala-network/sdk/utils/storage/index';
import { AcalaPrimitivesCurrencyCurrencyId } from '@polkadot/types/lookup';
import { Option, Vec, StorageKey } from '@polkadot/types';

Expand Down
4 changes: 2 additions & 2 deletions packages/sdk-swap/src/dex-providers/acala/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import {
Token,
unzipDexShareName
} from '@acala-network/sdk-core';
import { Wallet } from '@acala-network/sdk/wallet/index.js';
import { Wallet } from '@acala-network/sdk/wallet/index';
import { AcalaPrimitivesTradingPair, ModuleDexTradingPairStatus } from '@polkadot/types/lookup';
import { SubmittableExtrinsic } from '@polkadot/api/types';
import { StorageKey } from '@polkadot/types';
import { combineLatest, Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { Storage } from '@acala-network/sdk/utils/storage/index.js';
import { Storage } from '@acala-network/sdk/utils/storage/index';
import { AmountTooSmall, InsufficientLiquidityError, ParamsNotAcceptableForDexProvider } from '../../errors.js';
import {
BaseSwap,
Expand Down
10 changes: 10 additions & 0 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@
"require": "./dist/cjs/*.js",
"import": "./dist/esm/*.js",
"default": "./dist/esm/*.js"
},
"./utils/storage": {
"require": "./dist/cjs/utils/storage/index.js",
"import": "./dist/esm/utils/storage/index.js",
"default": "./dist/esm/utils/storage/index.js"
},
"./wallet/wallet": {
"require": "./dist/cjs/wallet/wallet.js",
"import": "./dist/esm/wallet/wallet.js",
"default": "./dist/esm/wallet/wallet.js"
}
},
"repository": "https://github.com/AcalaNetwork/acala.js.git",
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/wallet/balance-adapter/erc20-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { from, Observable, Subject } from 'rxjs';
import { filter, finalize, shareReplay } from 'rxjs/operators';
import { BalanceData } from '../types.js';
import { AnyFunction } from '@polkadot/types/types';
import { NotERC20TokenName } from '@acala-network/sdk-core/errors.js';
import { NotERC20TokenName } from '@acala-network/sdk-core/errors';

export class ERC20Adapter {
private provider: EvmRpcProvider;
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk/src/wallet/token-provider/acala.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { filter, map, shareReplay, take } from 'rxjs/operators';
import { TokenProvider, TokenProviderConfigs } from './type.js';
import { Storage } from '../../utils/storage/index.js';
import { createTokenList } from './create-token-list.js';
import { ChainType } from '@acala-network/sdk/types.js';
import { getChainType } from '@acala-network/sdk/utils/get-chain-type.js';
import { ChainType } from '../../types.js';
import { getChainType } from '../../utils/get-chain-type.js';
import { TokenRecord } from '../types.js';
import { CurrencyNotFound } from '../errors.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/wormhole-portal/src/wormhole-portal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {

import { combineLatest, firstValueFrom, from, Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { BaseSDK } from '@acala-network/sdk/types.js';
import { BaseSDK } from '@acala-network/sdk/types';
import { SupportChain } from './consts/index.js';
import {
ConvertAssetsShouldNotEqual,
Expand Down

0 comments on commit fb2aff8

Please sign in to comment.