@galacticcouncil/sdk 0.0.1-beta.12 → 0.0.1-beta.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +4 -4
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/types/client/{capi.d.ts → cApi.d.ts} +0 -0
- package/dist/types/client/polkadotApi.d.ts +1 -0
- package/dist/types/pool/lbp/lbpPolkadotApiClient.d.ts +5 -0
- package/dist/types/pool/polkadotApiPoolService.d.ts +8 -4
- package/dist/types/pool/xyk/xykPolkadotApiClient.d.ts +4 -0
- package/dist/types/types.d.ts +1 -1
- package/package.json +1 -1
- package/dist/types/client/polkadot.d.ts +0 -14
- package/dist/types/client/types.d.ts +0 -7
- package/dist/types/pool/polkadotPoolService.d.ts +0 -7
- package/dist/types/pool/xyk/xykPolkadotClient.d.ts +0 -8
|
File without changes
|
|
@@ -10,6 +10,7 @@ export declare class PolkadotApiClient {
|
|
|
10
10
|
getStorageKey(asset: [StorageKey<AnyTuple>, Codec], index: number): string;
|
|
11
11
|
getStorageEntryArray(asset: [StorageKey<AnyTuple>, Codec]): string[];
|
|
12
12
|
getPoolTokens(poolAddress: string, assetKeys: string[]): Promise<PoolToken[]>;
|
|
13
|
+
syncPoolTokens(poolAddress: string, poolTokens: PoolToken[]): Promise<PoolToken[]>;
|
|
13
14
|
getAssetMetadata(tokenKey: string): Promise<AssetMetadata>;
|
|
14
15
|
getAccountBalance(accountId: string, tokenKey: string): Promise<string>;
|
|
15
16
|
getSystemAccountBalance(accountId: string): Promise<string>;
|
|
@@ -12,7 +12,12 @@ interface LbpPoolData {
|
|
|
12
12
|
}
|
|
13
13
|
export declare class LbpPolkadotApiClient extends PolkadotApiClient {
|
|
14
14
|
private readonly MAX_FINAL_WEIGHT;
|
|
15
|
+
private poolsData;
|
|
16
|
+
private pools;
|
|
17
|
+
private _poolsLoaded;
|
|
15
18
|
getPools(): Promise<PoolBase[]>;
|
|
19
|
+
loadPools(): Promise<PoolBase[]>;
|
|
20
|
+
syncPools(): Promise<PoolBase[]>;
|
|
16
21
|
getLinearWeight(poolEntry: LbpPoolData): Promise<string>;
|
|
17
22
|
getRepayFee(): PoolFee;
|
|
18
23
|
isRepayFeeApplied(assetKey: string, poolEntry: LbpPoolData): Promise<boolean>;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { Hop, PoolBase, PoolService, Transaction } from '../types';
|
|
2
|
-
import {
|
|
1
|
+
import { Hop, PoolBase, PoolService, PoolType, Transaction } from '../types';
|
|
2
|
+
import { XykPolkadotApiClient } from './xyk/xykPolkadotApiClient';
|
|
3
|
+
import { LbpPolkadotApiClient } from './lbp/lbpPolkadotApiClient';
|
|
3
4
|
import { BigNumber } from '../utils/bignumber';
|
|
5
|
+
import { ApiPromise } from '@polkadot/api';
|
|
4
6
|
export declare class PolkadotApiPoolService implements PoolService {
|
|
5
|
-
|
|
7
|
+
protected readonly api: ApiPromise;
|
|
8
|
+
protected readonly xykClient: XykPolkadotApiClient;
|
|
9
|
+
protected readonly lbpClient: LbpPolkadotApiClient;
|
|
6
10
|
constructor(api: ApiPromise);
|
|
7
|
-
getPools(): Promise<PoolBase[]>;
|
|
11
|
+
getPools(includeOnly: PoolType[]): Promise<PoolBase[]>;
|
|
8
12
|
buildBuyTx(assetIn: string, assetOut: string, amountOut: BigNumber, maxAmountIn: BigNumber, route: Hop[]): Transaction;
|
|
9
13
|
buildSellTx(assetIn: string, assetOut: string, amountIn: BigNumber, minAmountOut: BigNumber, route: Hop[]): Transaction;
|
|
10
14
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { PolkadotApiClient } from '../../client';
|
|
2
2
|
import { PoolBase, PoolFee } from '../../types';
|
|
3
3
|
export declare class XykPolkadotApiClient extends PolkadotApiClient {
|
|
4
|
+
private pools;
|
|
5
|
+
private _poolsLoaded;
|
|
4
6
|
getPools(): Promise<PoolBase[]>;
|
|
7
|
+
loadPools(): Promise<PoolBase[]>;
|
|
8
|
+
syncPools(): Promise<PoolBase[]>;
|
|
5
9
|
getTradeFee(): PoolFee;
|
|
6
10
|
}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -64,7 +64,7 @@ export interface Pool extends PoolBase {
|
|
|
64
64
|
calculateTradeFee(amount: BigNumber): BigNumber;
|
|
65
65
|
}
|
|
66
66
|
export interface PoolService {
|
|
67
|
-
getPools(): Promise<PoolBase[]>;
|
|
67
|
+
getPools(includeOnly?: PoolType[]): Promise<PoolBase[]>;
|
|
68
68
|
buildBuyTx(assetIn: string, assetOut: string, amountOut: BigNumber, maxAmountIn: BigNumber, route: Hop[]): Transaction;
|
|
69
69
|
buildSellTx(assetIn: string, assetOut: string, amountIn: BigNumber, minAmountOut: BigNumber, route: Hop[]): Transaction;
|
|
70
70
|
}
|
package/package.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ApiPromise } from '@polkadot/api';
|
|
2
|
-
import type { StorageKey } from '@polkadot/types';
|
|
3
|
-
import type { AnyTuple, Codec } from '@polkadot/types/types';
|
|
4
|
-
import type { AssetMetadata } from '@polkadot/types/interfaces';
|
|
5
|
-
import '@polkadot/api-augment';
|
|
6
|
-
export declare class PolkadotClient {
|
|
7
|
-
protected readonly api: ApiPromise;
|
|
8
|
-
constructor(api: ApiPromise);
|
|
9
|
-
getStorageKey(asset: [StorageKey<AnyTuple>, Codec], index: number): string;
|
|
10
|
-
getStorageEntryArray(asset: [StorageKey<AnyTuple>, Codec]): string[];
|
|
11
|
-
getAssetMetadata(tokenKey: string): Promise<AssetMetadata>;
|
|
12
|
-
getSystemAccountBalance(accountId: string): Promise<string>;
|
|
13
|
-
getTokenAccountBalance(accountId: string, tokenKey: string): Promise<string>;
|
|
14
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { PolkadotClient } from '../../client';
|
|
2
|
-
import { PoolBase, PoolToken } from '../../types';
|
|
3
|
-
export declare class XykPolkadotClient extends PolkadotClient {
|
|
4
|
-
getPools(): Promise<PoolBase[]>;
|
|
5
|
-
getPoolTokens(poolAddress: string, assetKeys: string[]): Promise<PoolToken[]>;
|
|
6
|
-
getBalance(poolAddress: string, assetKey: string): Promise<string>;
|
|
7
|
-
getTradeFee(): string;
|
|
8
|
-
}
|