@galacticcouncil/sdk 1.2.0 → 1.2.2
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.
|
@@ -2,7 +2,7 @@ import type { HydradxRuntimeXcmAssetLocation, PalletStableswapPoolInfo } from '@
|
|
|
2
2
|
import { ITuple } from '@polkadot/types-codec/types';
|
|
3
3
|
import { u32, u64 } from '@polkadot/types-codec';
|
|
4
4
|
import { ApiPromise } from '@polkadot/api';
|
|
5
|
-
import { Asset, AssetMetadata,
|
|
5
|
+
import { Asset, AssetMetadata, ExternalAsset } from '../types';
|
|
6
6
|
import { PolkadotApiClient } from './PolkadotApi';
|
|
7
7
|
export declare class AssetClient extends PolkadotApiClient {
|
|
8
8
|
private SUPPORTED_TYPES;
|
|
@@ -11,10 +11,14 @@ export declare class AssetClient extends PolkadotApiClient {
|
|
|
11
11
|
safeBondsQuery(): Promise<Map<string, ITuple<[u32, u64]>>>;
|
|
12
12
|
metadataQuery(): Promise<Map<string, AssetMetadata>>;
|
|
13
13
|
locationsQuery(): Promise<Map<string, HydradxRuntimeXcmAssetLocation>>;
|
|
14
|
-
private
|
|
15
|
-
private
|
|
14
|
+
private getToken;
|
|
15
|
+
private getBond;
|
|
16
16
|
private getShares;
|
|
17
|
-
|
|
17
|
+
private getExternal;
|
|
18
|
+
private normalizeMetadata;
|
|
19
|
+
private getSupportedAssets;
|
|
20
|
+
getOnChainAssets(external?: ExternalAsset[]): Promise<Asset[]>;
|
|
21
|
+
private isValidAsset;
|
|
18
22
|
private isSupportedAsset;
|
|
19
23
|
private parseLocation;
|
|
20
24
|
}
|
package/build/types/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { OmniPoolClient } from './omni/OmniPoolClient';
|
|
|
3
3
|
import { XykPoolClient } from './xyk/XykPoolClient';
|
|
4
4
|
import { StableSwapClient } from './stable/StableSwapClient';
|
|
5
5
|
import { AssetClient } from '../client';
|
|
6
|
-
import { Hop, PoolBase, IPoolService, PoolType, Transaction, PoolFees, Pool, Asset,
|
|
6
|
+
import { Hop, PoolBase, IPoolService, PoolType, Transaction, PoolFees, Pool, Asset, ExternalAsset } from '../types';
|
|
7
7
|
import { BigNumber } from '../utils/bignumber';
|
|
8
8
|
import { ApiPromise } from '@polkadot/api';
|
|
9
9
|
export declare class PoolService implements IPoolService {
|
|
@@ -16,7 +16,7 @@ export declare class PoolService implements IPoolService {
|
|
|
16
16
|
protected onChainAssets: Asset[];
|
|
17
17
|
protected onChainAssetsLoaded: boolean;
|
|
18
18
|
constructor(api: ApiPromise);
|
|
19
|
-
syncRegistry(external?:
|
|
19
|
+
syncRegistry(external?: ExternalAsset[]): Promise<void>;
|
|
20
20
|
getPools(includeOnly: PoolType[]): Promise<PoolBase[]>;
|
|
21
21
|
unsubscribe(): void;
|
|
22
22
|
private withMetadata;
|
package/build/types/types.d.ts
CHANGED
|
@@ -117,15 +117,19 @@ export type Amount = {
|
|
|
117
117
|
amount: BigNumber;
|
|
118
118
|
decimals: number;
|
|
119
119
|
};
|
|
120
|
-
export interface Asset extends
|
|
120
|
+
export interface Asset extends AssetMetadata {
|
|
121
|
+
id: string;
|
|
122
|
+
name: string;
|
|
121
123
|
icon: string;
|
|
122
124
|
type: string;
|
|
123
125
|
existentialDeposit: string;
|
|
126
|
+
isSufficient: boolean;
|
|
124
127
|
origin?: number;
|
|
125
128
|
meta?: Record<string, string>;
|
|
126
129
|
}
|
|
127
|
-
export interface
|
|
130
|
+
export interface ExternalAsset extends AssetMetadata {
|
|
128
131
|
id: string;
|
|
132
|
+
origin: number;
|
|
129
133
|
name: string;
|
|
130
134
|
}
|
|
131
135
|
export interface AssetMetadata {
|