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 esm #522

Merged
merged 4 commits into from
Sep 5, 2024
Merged
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/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 { 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 All @@ -20,7 +20,7 @@
this.api = api;
this.wallet = wallet;
this.storages = createStorages(this.api);
this.priceProviderType = priceProviderType || PriceProviderType.ORACLE;

Check failure on line 23 in packages/sdk-loan/src/loan.ts

View workflow job for this annotation

GitHub Actions / linting

Unsafe assignment of an `any` value

Check failure on line 23 in packages/sdk-loan/src/loan.ts

View workflow job for this annotation

GitHub Actions / linting

Unsafe member access .ORACLE on an `any` value
}

get isReady$() {
Expand All @@ -32,10 +32,10 @@
}

private subscribeLoanTypes = memoize(() => {
return this.storages.allCollateralParams().observable.pipe(

Check failure on line 35 in packages/sdk-loan/src/loan.ts

View workflow job for this annotation

GitHub Actions / linting

Unsafe return of an `any` typed value

Check failure on line 35 in packages/sdk-loan/src/loan.ts

View workflow job for this annotation

GitHub Actions / linting

Unsafe call of an `any` typed value

Check failure on line 35 in packages/sdk-loan/src/loan.ts

View workflow job for this annotation

GitHub Actions / linting

Unsafe member access .observable on an `any` value
map((items) => {
return items.map(([key, rawValue]) => {

Check failure on line 37 in packages/sdk-loan/src/loan.ts

View workflow job for this annotation

GitHub Actions / linting

Unsafe return of an `any` typed value

Check failure on line 37 in packages/sdk-loan/src/loan.ts

View workflow job for this annotation

GitHub Actions / linting

Unsafe call of an `any` typed value
const value = rawValue.unwrapOrDefault();

Check failure on line 38 in packages/sdk-loan/src/loan.ts

View workflow job for this annotation

GitHub Actions / linting

Unsafe assignment of an `any` value

Check failure on line 38 in packages/sdk-loan/src/loan.ts

View workflow job for this annotation

GitHub Actions / linting

Unsafe call of an `any` typed value

Check failure on line 38 in packages/sdk-loan/src/loan.ts

View workflow job for this annotation

GitHub Actions / linting

Unsafe member access .unwrapOrDefault on an `any` value
const { stableToken } = this.wallet.getPresetTokens();
const interestRatePerSec = FixedPointNumber.fromInner(value.interestRatePerSec.toString());

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
Loading