@galacticcouncil/xc-cfg 0.1.0
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/README.md +17 -0
- package/build/index.cjs +1 -0
- package/build/index.mjs +1 -0
- package/build/types/assets.d.ts +72 -0
- package/build/types/builders/AssetMinBuilder.d.ts +13 -0
- package/build/types/builders/BalanceBuilder.d.ts +10 -0
- package/build/types/builders/ContractBuilder.d.ts +14 -0
- package/build/types/builders/ExtrinsicBuilder.d.ts +64 -0
- package/build/types/builders/FeeAmountBuilder.d.ts +19 -0
- package/build/types/builders/FeeAssetBuilder.d.ts +8 -0
- package/build/types/builders/MoveBuilder.d.ts +4 -0
- package/build/types/builders/ProgramBuilder.d.ts +4 -0
- package/build/types/builders/balance/evm.d.ts +8 -0
- package/build/types/builders/balance/solana.d.ts +8 -0
- package/build/types/builders/balance/substrate.d.ts +24 -0
- package/build/types/builders/balance/sui.d.ts +6 -0
- package/build/types/builders/contracts/Batch.d.ts +4 -0
- package/build/types/builders/contracts/Erc20.d.ts +4 -0
- package/build/types/builders/contracts/Snowbridge.d.ts +4 -0
- package/build/types/builders/contracts/Wormhole/TokenBridge.d.ts +15 -0
- package/build/types/builders/contracts/Wormhole/TokenBridge.spec.d.ts +1 -0
- package/build/types/builders/contracts/Wormhole/TokenRelayer.d.ts +4 -0
- package/build/types/builders/contracts/Wormhole/index.d.ts +19 -0
- package/build/types/builders/contracts/Xtokens.d.ts +5 -0
- package/build/types/builders/contracts/Xtokens.utils.d.ts +45 -0
- package/build/types/builders/extrinsics/assetConversion.d.ts +8 -0
- package/build/types/builders/extrinsics/assets.d.ts +4 -0
- package/build/types/builders/extrinsics/balances.d.ts +4 -0
- package/build/types/builders/extrinsics/router.d.ts +8 -0
- package/build/types/builders/extrinsics/utility.d.ts +6 -0
- package/build/types/builders/extrinsics/xcm/builder/buildERC20TransferFromPara.d.ts +132 -0
- package/build/types/builders/extrinsics/xcm/builder/buildParaERC20Received.d.ts +77 -0
- package/build/types/builders/extrinsics/xcm/builder/const.d.ts +13 -0
- package/build/types/builders/extrinsics/xcm/builder/index.d.ts +3 -0
- package/build/types/builders/extrinsics/xcm/ethereumXcm.d.ts +4 -0
- package/build/types/builders/extrinsics/xcm/index.d.ts +7 -0
- package/build/types/builders/extrinsics/xcm/polkadotXcm.d.ts +20 -0
- package/build/types/builders/extrinsics/xcm/polkadotXcm.utils.d.ts +322 -0
- package/build/types/builders/extrinsics/xcm/types.d.ts +18 -0
- package/build/types/builders/extrinsics/xcm/utils/account.d.ts +14 -0
- package/build/types/builders/extrinsics/xcm/utils/fee.d.ts +1 -0
- package/build/types/builders/extrinsics/xcm/utils/guard.d.ts +4 -0
- package/build/types/builders/extrinsics/xcm/utils/index.d.ts +5 -0
- package/build/types/builders/extrinsics/xcm/utils/instructions.d.ts +65 -0
- package/build/types/builders/extrinsics/xcm/utils/location.d.ts +12 -0
- package/build/types/builders/extrinsics/xcm/xTokens.d.ts +7 -0
- package/build/types/builders/extrinsics/xcm/xTokens.utils.d.ts +23 -0
- package/build/types/builders/extrinsics/xcm/xTransfer.d.ts +4 -0
- package/build/types/builders/extrinsics/xcm/xTransfer.utils.d.ts +13 -0
- package/build/types/builders/extrinsics/xcm/xcmPallet.d.ts +11 -0
- package/build/types/builders/extrinsics/xcm/xcmPallet.utils.d.ts +24 -0
- package/build/types/builders/index.d.ts +9 -0
- package/build/types/builders/moves/Wormhole/TokenBridge.d.ts +10 -0
- package/build/types/builders/moves/Wormhole/index.d.ts +9 -0
- package/build/types/builders/programs/Wormhole/TokenBridge.d.ts +13 -0
- package/build/types/builders/programs/Wormhole/index.d.ts +14 -0
- package/build/types/builders/utils/amount.d.ts +1 -0
- package/build/types/builders/utils/asset.d.ts +2 -0
- package/build/types/builders/utils/index.d.ts +2 -0
- package/build/types/chains/chains.spec.d.ts +1 -0
- package/build/types/chains/evm/index.d.ts +4 -0
- package/build/types/chains/evm/mainnet.d.ts +2 -0
- package/build/types/chains/index.d.ts +8 -0
- package/build/types/chains/kusama/assethub.d.ts +2 -0
- package/build/types/chains/kusama/basilisk.d.ts +2 -0
- package/build/types/chains/kusama/index.d.ts +10 -0
- package/build/types/chains/kusama/integritee.d.ts +2 -0
- package/build/types/chains/kusama/karura.d.ts +2 -0
- package/build/types/chains/kusama/kusama.d.ts +2 -0
- package/build/types/chains/kusama/robonomics.d.ts +2 -0
- package/build/types/chains/kusama/tinkernet.d.ts +2 -0
- package/build/types/chains/polkadot/acala.d.ts +2 -0
- package/build/types/chains/polkadot/ajuna.d.ts +2 -0
- package/build/types/chains/polkadot/assethub.d.ts +3 -0
- package/build/types/chains/polkadot/astar.d.ts +2 -0
- package/build/types/chains/polkadot/bifrost.d.ts +2 -0
- package/build/types/chains/polkadot/centrifuge.d.ts +2 -0
- package/build/types/chains/polkadot/crust.d.ts +2 -0
- package/build/types/chains/polkadot/darwinia.d.ts +2 -0
- package/build/types/chains/polkadot/energywebx.d.ts +2 -0
- package/build/types/chains/polkadot/hydration.d.ts +2 -0
- package/build/types/chains/polkadot/index.d.ts +25 -0
- package/build/types/chains/polkadot/interlay.d.ts +2 -0
- package/build/types/chains/polkadot/kilt.d.ts +2 -0
- package/build/types/chains/polkadot/laos.d.ts +2 -0
- package/build/types/chains/polkadot/moonbeam.d.ts +2 -0
- package/build/types/chains/polkadot/mythos.d.ts +2 -0
- package/build/types/chains/polkadot/neuroweb.d.ts +2 -0
- package/build/types/chains/polkadot/nodle.d.ts +2 -0
- package/build/types/chains/polkadot/pendulum.d.ts +2 -0
- package/build/types/chains/polkadot/phala.d.ts +2 -0
- package/build/types/chains/polkadot/polkadot.d.ts +3 -0
- package/build/types/chains/polkadot/unique.d.ts +2 -0
- package/build/types/chains/polkadot/zeitgeist.d.ts +2 -0
- package/build/types/chains/solana/index.d.ts +4 -0
- package/build/types/chains/solana/mainnet.d.ts +2 -0
- package/build/types/chains/sui/index.d.ts +4 -0
- package/build/types/chains/sui/mainnet.d.ts +2 -0
- package/build/types/clients/base.d.ts +8 -0
- package/build/types/clients/chain/assethub.d.ts +13 -0
- package/build/types/clients/chain/hydration.d.ts +8 -0
- package/build/types/clients/chain/index.d.ts +2 -0
- package/build/types/clients/index.d.ts +2 -0
- package/build/types/configs/HydrationConfigService.d.ts +5 -0
- package/build/types/configs/HydrationConfigService.utils.d.ts +5 -0
- package/build/types/configs/evm/ethereum/index.d.ts +2 -0
- package/build/types/configs/evm/ethereum/templates.d.ts +3 -0
- package/build/types/configs/evm/index.d.ts +2 -0
- package/build/types/configs/index.d.ts +3 -0
- package/build/types/configs/kusama/assethub/index.d.ts +2 -0
- package/build/types/configs/kusama/assethub/templates.d.ts +3 -0
- package/build/types/configs/kusama/basilisk/configs.d.ts +3 -0
- package/build/types/configs/kusama/basilisk/index.d.ts +2 -0
- package/build/types/configs/kusama/basilisk/templates.d.ts +2 -0
- package/build/types/configs/kusama/index.d.ts +2 -0
- package/build/types/configs/kusama/integritee.d.ts +2 -0
- package/build/types/configs/kusama/karura.d.ts +2 -0
- package/build/types/configs/kusama/robonomics.d.ts +2 -0
- package/build/types/configs/kusama/tinkernet.d.ts +2 -0
- package/build/types/configs/polkadot/acala.d.ts +2 -0
- package/build/types/configs/polkadot/ajuna.d.ts +2 -0
- package/build/types/configs/polkadot/assethub/index.d.ts +3 -0
- package/build/types/configs/polkadot/assethub/templates.d.ts +6 -0
- package/build/types/configs/polkadot/astar.d.ts +2 -0
- package/build/types/configs/polkadot/bifrost.d.ts +2 -0
- package/build/types/configs/polkadot/centrifuge.d.ts +2 -0
- package/build/types/configs/polkadot/crust.d.ts +2 -0
- package/build/types/configs/polkadot/darwinia.d.ts +2 -0
- package/build/types/configs/polkadot/energywebx.d.ts +2 -0
- package/build/types/configs/polkadot/hydration/configs.d.ts +3 -0
- package/build/types/configs/polkadot/hydration/index.d.ts +2 -0
- package/build/types/configs/polkadot/hydration/templates.d.ts +13 -0
- package/build/types/configs/polkadot/index.d.ts +2 -0
- package/build/types/configs/polkadot/interlay.d.ts +2 -0
- package/build/types/configs/polkadot/kilt.d.ts +2 -0
- package/build/types/configs/polkadot/laos.d.ts +2 -0
- package/build/types/configs/polkadot/moonbeam/index.d.ts +2 -0
- package/build/types/configs/polkadot/moonbeam/templates.d.ts +3 -0
- package/build/types/configs/polkadot/mythos.d.ts +2 -0
- package/build/types/configs/polkadot/neuroweb.d.ts +2 -0
- package/build/types/configs/polkadot/nodle.d.ts +2 -0
- package/build/types/configs/polkadot/pendulum.d.ts +2 -0
- package/build/types/configs/polkadot/phala.d.ts +2 -0
- package/build/types/configs/polkadot/unique.d.ts +2 -0
- package/build/types/configs/polkadot/zeitgeist.d.ts +2 -0
- package/build/types/configs/solana/index.d.ts +2 -0
- package/build/types/configs/solana/solana.d.ts +2 -0
- package/build/types/configs/sui/index.d.ts +2 -0
- package/build/types/configs/sui/sui.d.ts +2 -0
- package/build/types/dex/assethub.d.ts +9 -0
- package/build/types/dex/hydration.d.ts +16 -0
- package/build/types/dex/index.d.ts +2 -0
- package/build/types/index.d.ts +9 -0
- package/build/types/resolvers/acala.d.ts +6 -0
- package/build/types/resolvers/hydration.d.ts +4 -0
- package/build/types/resolvers/index.d.ts +2 -0
- package/build/types/tags.d.ts +6 -0
- package/build/types/utils/papi.d.ts +17 -0
- package/build/types/utils/xcm-encoder.d.ts +86 -0
- package/build/types/validations/base.d.ts +9 -0
- package/build/types/validations/chain/assethub.d.ts +8 -0
- package/build/types/validations/chain/hydration.d.ts +9 -0
- package/build/types/validations/chain/index.d.ts +2 -0
- package/build/types/validations/index.d.ts +2 -0
- package/package.json +39 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AnyChain } from '@galacticcouncil/xc-core';
|
|
2
|
+
import { acala } from './acala';
|
|
3
|
+
import { ajuna } from './ajuna';
|
|
4
|
+
import { assetHub, assetHubCex } from './assethub';
|
|
5
|
+
import { astar } from './astar';
|
|
6
|
+
import { bifrost } from './bifrost';
|
|
7
|
+
import { centrifuge } from './centrifuge';
|
|
8
|
+
import { crust } from './crust';
|
|
9
|
+
import { darwinia } from './darwinia';
|
|
10
|
+
import { hydration } from './hydration';
|
|
11
|
+
import { interlay } from './interlay';
|
|
12
|
+
import { kilt_chain } from './kilt';
|
|
13
|
+
import { laos_chain } from './laos';
|
|
14
|
+
import { moonbeam } from './moonbeam';
|
|
15
|
+
import { mythos } from './mythos';
|
|
16
|
+
import { neuroweb } from './neuroweb';
|
|
17
|
+
import { nodle } from './nodle';
|
|
18
|
+
import { pendulum } from './pendulum';
|
|
19
|
+
import { phala } from './phala';
|
|
20
|
+
import { polkadot, polkadotCex } from './polkadot';
|
|
21
|
+
import { unique } from './unique';
|
|
22
|
+
import { zeitgeist } from './zeitgeist';
|
|
23
|
+
import { energywebx } from './energywebx';
|
|
24
|
+
export declare const polkadotChains: AnyChain[];
|
|
25
|
+
export { acala, ajuna, assetHub, assetHubCex, astar, bifrost, centrifuge, crust, darwinia, hydration, kilt_chain, laos_chain, neuroweb, interlay, moonbeam, mythos, nodle, pendulum, phala, polkadot, polkadotCex, unique, zeitgeist, energywebx, };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Asset, Parachain } from '@galacticcouncil/xc-core';
|
|
2
|
+
export declare class BaseClient {
|
|
3
|
+
readonly chain: Parachain;
|
|
4
|
+
constructor(chain: Parachain);
|
|
5
|
+
getSystemAccountBalance(address: string): Promise<bigint>;
|
|
6
|
+
getTokensAccountsBalance(address: string, asset: string): Promise<bigint>;
|
|
7
|
+
calculateDestinationFee(xcm: any, asset: Asset): Promise<bigint>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Asset, Parachain } from '@galacticcouncil/xc-core';
|
|
2
|
+
import { BaseClient } from '../base';
|
|
3
|
+
export declare class AssethubClient extends BaseClient {
|
|
4
|
+
constructor(chain: Parachain);
|
|
5
|
+
checkIfSufficient(asset: Asset): Promise<boolean>;
|
|
6
|
+
checkIfFrozen(address: string, asset: Asset): Promise<boolean>;
|
|
7
|
+
getAssetMin(asset: Asset): Promise<bigint>;
|
|
8
|
+
getBridgeDeliveryFee(options?: {
|
|
9
|
+
defaultFee: bigint;
|
|
10
|
+
}): Promise<bigint>;
|
|
11
|
+
calculateDeliveryFee(xcm: any, destParachainId: number): Promise<bigint>;
|
|
12
|
+
calculateDestinationFee(xcm: any, asset: Asset): Promise<bigint>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Asset, Parachain } from '@galacticcouncil/xc-core';
|
|
2
|
+
import { BaseClient } from '../base';
|
|
3
|
+
export declare class HydrationClient extends BaseClient {
|
|
4
|
+
constructor(chain: Parachain);
|
|
5
|
+
checkIfSufficient(asset: Asset): Promise<boolean>;
|
|
6
|
+
getFeeAsset(address: string): Promise<string>;
|
|
7
|
+
getAssetBalance(address: string, asset: string): Promise<bigint>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ExternalAsset } from '@galacticcouncil/sdk-next';
|
|
2
|
+
import { Asset, ChainAssetData } from '@galacticcouncil/xc-core';
|
|
3
|
+
export declare function toAsset(external: ExternalAsset): Asset;
|
|
4
|
+
export declare function toHubAsset(external: ExternalAsset): ChainAssetData;
|
|
5
|
+
export declare function toHydrationAsset(external: ExternalAsset): ChainAssetData;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AnyChain, Asset, AssetRoute } from '@galacticcouncil/xc-core';
|
|
2
|
+
export declare const extraFee = 0;
|
|
3
|
+
export declare function toParaReservesWithSwapTemplate(asset: Asset, destination: AnyChain, destinationFee: number): AssetRoute;
|
|
4
|
+
export declare function toParaStablesTemplate(asset: Asset, destination: AnyChain, destinationFee: number): AssetRoute;
|
|
5
|
+
export declare function toHydrationExtTemplate(asset: Asset): AssetRoute;
|
|
6
|
+
export declare function toMoonbeamExtTemplate(asset: Asset): AssetRoute;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AnyChain, Asset, AssetRoute, ExtrinsicConfigBuilder } from '@galacticcouncil/xc-core';
|
|
2
|
+
export declare const MRL_EXECUTION_FEE = 0.9;
|
|
3
|
+
export declare const MRL_XCM_FEE = 1;
|
|
4
|
+
export declare const CEX_EXECUTION_FEE = 0.03;
|
|
5
|
+
export declare function toTransferTemplate(asset: Asset, destination: AnyChain, destinationFee: number): AssetRoute;
|
|
6
|
+
export declare function toHubExtTemplate(asset: Asset): AssetRoute;
|
|
7
|
+
export declare function toHubWithCexFwdTemplate(asset: Asset, hubFee: number, hubTransfer: ExtrinsicConfigBuilder): AssetRoute;
|
|
8
|
+
export declare function toParaErc20Template(asset: Asset, destination: AnyChain, destinationFee: number): AssetRoute;
|
|
9
|
+
export declare function toMoonbeamErc20Template(asset: Asset): AssetRoute;
|
|
10
|
+
export declare function toZeitgeistErc20Template(asset: Asset): AssetRoute;
|
|
11
|
+
export declare function viaWormholeBridgeTemplate(assetIn: Asset, assetOut: Asset, to: AnyChain): AssetRoute;
|
|
12
|
+
export declare function viaWormholeRelayerTemplate(assetIn: Asset, assetOut: Asset, to: AnyChain): AssetRoute;
|
|
13
|
+
export declare function viaSnowbridgeTemplate(assetIn: Asset, assetOut: Asset, to: AnyChain): AssetRoute;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AnyChain, Asset, AssetAmount, Dex, Parachain, SwapQuote } from '@galacticcouncil/xc-core';
|
|
2
|
+
import { AssethubClient } from '../clients';
|
|
3
|
+
export declare class AssethubDex implements Dex {
|
|
4
|
+
readonly chain: Parachain;
|
|
5
|
+
readonly client: AssethubClient;
|
|
6
|
+
constructor(chain: AnyChain);
|
|
7
|
+
getCalldata(_account: string, _assetIn: Asset, _assetOut: Asset, _amountOut: AssetAmount): Promise<string>;
|
|
8
|
+
getQuote(assetIn: Asset, assetOut: Asset, amountOut: AssetAmount): Promise<SwapQuote>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AnyChain, Asset, AssetAmount, Dex, Parachain, SwapQuote } from '@galacticcouncil/xc-core';
|
|
2
|
+
import { pool, sor, tx } from '@galacticcouncil/sdk-next';
|
|
3
|
+
import { HydrationClient } from '../clients';
|
|
4
|
+
type PoolContext = pool.PoolContextProvider;
|
|
5
|
+
export declare class HydrationDex implements Dex {
|
|
6
|
+
readonly chain: Parachain;
|
|
7
|
+
readonly client: HydrationClient;
|
|
8
|
+
readonly poolCtx: PoolContext;
|
|
9
|
+
readonly txBuilder: tx.TxBuilderFactory;
|
|
10
|
+
readonly getCtx: (x: number) => Promise<sor.TradeRouter>;
|
|
11
|
+
constructor(chain: AnyChain, poolCtx: PoolContext);
|
|
12
|
+
getCalldata(account: string, assetIn: Asset, assetOut: Asset, amountOut: AssetAmount, slippage?: number): Promise<string>;
|
|
13
|
+
getQuote(assetIn: Asset, assetOut: Asset, amountOut: AssetAmount, fallbackPrice?: boolean): Promise<SwapQuote>;
|
|
14
|
+
private getFallbackPrice;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { assetsMap } from './assets';
|
|
2
|
+
export { chainsMap } from './chains';
|
|
3
|
+
export { routesMap } from './configs';
|
|
4
|
+
export { validations } from './validations';
|
|
5
|
+
export * as builders from './builders';
|
|
6
|
+
export * as clients from './clients';
|
|
7
|
+
export * as dex from './dex';
|
|
8
|
+
export * as tags from './tags';
|
|
9
|
+
export { HydrationConfigService } from './configs/HydrationConfigService';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PolkadotClient, TypedApi } from 'polkadot-api';
|
|
2
|
+
import { hydration } from '@galacticcouncil/descriptors';
|
|
3
|
+
/**
|
|
4
|
+
* Helper to get TypedApi from PolkadotClient using Hydration descriptor
|
|
5
|
+
*
|
|
6
|
+
* This uses the Hydration descriptor which works for Hydration and compatible chains.
|
|
7
|
+
* The descriptor provides full type safety for queries, transactions, and runtime APIs.
|
|
8
|
+
*
|
|
9
|
+
* @param client - PolkadotClient instance
|
|
10
|
+
* @returns TypedApi with Hydration types
|
|
11
|
+
*/
|
|
12
|
+
export declare function getTypedApi(client: PolkadotClient): TypedApi<typeof hydration>;
|
|
13
|
+
/**
|
|
14
|
+
* Type alias for Hydration TypedApi
|
|
15
|
+
* Use this when you need to type function parameters or return values
|
|
16
|
+
*/
|
|
17
|
+
export type HydrationApi = TypedApi<typeof hydration>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { XcmV4Instruction, XcmV3Junctions } from '@galacticcouncil/descriptors';
|
|
2
|
+
/**
|
|
3
|
+
* XCM Encoder utility for converting plain JavaScript objects
|
|
4
|
+
* to PAPI-compatible encoded structures.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* This class provides two sets of encoding methods:
|
|
8
|
+
*
|
|
9
|
+
* **For Typed API (chains with descriptors like Hydration):**
|
|
10
|
+
* - Use methods without suffix: `encodeXcm()`, `encodeAssetId()`, etc.
|
|
11
|
+
* - These use chain-specific type descriptors from @galacticcouncil/descriptors
|
|
12
|
+
* - Use when calling typed API methods on chains with custom descriptors
|
|
13
|
+
*
|
|
14
|
+
* **For Unsafe API (chains like Asset Hub):**
|
|
15
|
+
* - Use methods with "ForUnsafeApi" suffix: `encodeXcmForUnsafeApi()`, etc.
|
|
16
|
+
* - These return generic { type, value } enum structures
|
|
17
|
+
* - Use when calling `getUnsafeApi()` or working with chains without descriptors
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* // Typed API (Hydration)
|
|
21
|
+
* const versionedXcm = XcmEncoder.encodeXcm(xcm);
|
|
22
|
+
* await api.apis.XcmPaymentApi.query_xcm_weight(versionedXcm);
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* // Unsafe API (Asset Hub)
|
|
26
|
+
* const versionedXcm = XcmEncoder.encodeXcmForUnsafeApi(xcm);
|
|
27
|
+
* await unsafeApi.apis.XcmPaymentApi.query_xcm_weight(versionedXcm);
|
|
28
|
+
*/
|
|
29
|
+
export declare class XcmEncoder {
|
|
30
|
+
static encodeXcm(plainXcm: any): {
|
|
31
|
+
type: "V4";
|
|
32
|
+
value: XcmV4Instruction[];
|
|
33
|
+
} & {
|
|
34
|
+
type: "V4";
|
|
35
|
+
};
|
|
36
|
+
static encodeAssetId(location: any): {
|
|
37
|
+
type: "V4";
|
|
38
|
+
value: {
|
|
39
|
+
parents: number;
|
|
40
|
+
interior: XcmV3Junctions;
|
|
41
|
+
};
|
|
42
|
+
} & {
|
|
43
|
+
type: "V4";
|
|
44
|
+
};
|
|
45
|
+
static encodeVersionedLocation(location: any): {
|
|
46
|
+
type: "V4";
|
|
47
|
+
value: {
|
|
48
|
+
parents: number;
|
|
49
|
+
interior: XcmV3Junctions;
|
|
50
|
+
};
|
|
51
|
+
} & {
|
|
52
|
+
type: "V4";
|
|
53
|
+
};
|
|
54
|
+
static encodeLocation(location: any): any;
|
|
55
|
+
/**
|
|
56
|
+
* Encodes XCM for unsafe API calls.
|
|
57
|
+
* Returns generic { type, value } enum structures instead of typed descriptors.
|
|
58
|
+
*/
|
|
59
|
+
static encodeXcmForUnsafeApi(plainXcm: any): {
|
|
60
|
+
type: string;
|
|
61
|
+
value: any;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Encodes asset ID for unsafe API calls.
|
|
65
|
+
*/
|
|
66
|
+
static encodeAssetIdForUnsafeApi(location: any): {
|
|
67
|
+
type: string;
|
|
68
|
+
value: any;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Encodes versioned location for unsafe API calls.
|
|
72
|
+
*/
|
|
73
|
+
static encodeVersionedLocationForUnsafeApi(location: any): {
|
|
74
|
+
type: string;
|
|
75
|
+
value: any;
|
|
76
|
+
};
|
|
77
|
+
static encodeLocationForUnsafeApi(location: any): any;
|
|
78
|
+
private static encodeInstructionsCore;
|
|
79
|
+
private static encodeLocationCore;
|
|
80
|
+
private static encodeJunctionCore;
|
|
81
|
+
private static encodeNetworkIdCore;
|
|
82
|
+
private static encodeAssetCore;
|
|
83
|
+
private static encodeAssetFilterCore;
|
|
84
|
+
private static encodeWeightLimitCore;
|
|
85
|
+
private static encodeInstructionCore;
|
|
86
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AnyChain, AssetAmount, TransferCtx, TransferValidation } from '@galacticcouncil/xc-core';
|
|
2
|
+
export declare class FeeValidation extends TransferValidation {
|
|
3
|
+
validate(ctx: TransferCtx): Promise<void>;
|
|
4
|
+
}
|
|
5
|
+
export declare class DestFeeValidation extends TransferValidation {
|
|
6
|
+
protected skipFor(ctx: TransferCtx): Promise<boolean>;
|
|
7
|
+
validate(ctx: TransferCtx): Promise<void>;
|
|
8
|
+
getMin(chain: AnyChain, destFee: AssetAmount): Promise<bigint>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TransferCtx, TransferValidation } from '@galacticcouncil/xc-core';
|
|
2
|
+
export declare class HubEdValidation extends TransferValidation {
|
|
3
|
+
protected skipFor(ctx: TransferCtx): Promise<boolean>;
|
|
4
|
+
validate(ctx: TransferCtx): Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
export declare class HubFrozenValidation extends TransferValidation {
|
|
7
|
+
validate(ctx: TransferCtx): Promise<void>;
|
|
8
|
+
}
|