@galacticcouncil/xc-cfg 2.7.0 → 2.8.0-pr373-0c7d788

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/build/assets.d.ts CHANGED
@@ -52,6 +52,7 @@ export declare const weth: Asset;
52
52
  export declare const weth_wh: Asset;
53
53
  export declare const wbtc: Asset;
54
54
  export declare const wbtc_wh: Asset;
55
+ export declare const wnear: Asset;
55
56
  export declare const wsol: Asset;
56
57
  export declare const wsteth: Asset;
57
58
  export declare const wud: Asset;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import { Wormhole } from './functionCalls/Wormhole';
2
+ export declare function FunctionCallBuilder(): {
3
+ Wormhole: typeof Wormhole;
4
+ };
@@ -0,0 +1,4 @@
1
+ import { FunctionCallConfigBuilder } from '@galacticcouncil/xc-core';
2
+ export declare const Ntt: () => {
3
+ transfer: () => FunctionCallConfigBuilder;
4
+ };
@@ -0,0 +1,5 @@
1
+ export declare function Wormhole(): {
2
+ Ntt: () => {
3
+ transfer: () => import("@galacticcouncil/xc-core").FunctionCallConfigBuilder;
4
+ };
5
+ };
@@ -2,6 +2,7 @@ export * from './ContractBuilder';
2
2
  export * from './ExtrinsicBuilder';
3
3
  export * from './FeeAmountBuilder';
4
4
  export * from './FeeAssetBuilder';
5
+ export * from './FunctionCallBuilder';
5
6
  export * from './MoveBuilder';
6
7
  export * from './ProgramBuilder';
7
8
  export { XcmVersion, XcmTransferType } from './extrinsics/xcm';
@@ -1 +1,11 @@
1
+ /**
2
+ * Floors an amount to a coarser precision.
3
+ *
4
+ * - Untouched when its own precision is already at most `precision`
5
+ *
6
+ * @param amount - amount in `decimals`
7
+ * @param decimals - decimals of the amount
8
+ * @param precision - decimals to keep
9
+ */
10
+ export declare function floorToPrecision(amount: bigint, decimals: number, precision: number): bigint;
1
11
  export declare function padFeeByPercentage(fee: bigint, padPercent: bigint): bigint;
@@ -1,4 +1,5 @@
1
1
  import { AnyChain } from '@galacticcouncil/xc-core';
2
2
  import { near_chain } from './mainnet';
3
+ import { near_testnet } from './testnet';
3
4
  export declare const nearChains: AnyChain[];
4
- export { near_chain };
5
+ export { near_chain, near_testnet };
@@ -0,0 +1,8 @@
1
+ import { NearChain } from '@galacticcouncil/xc-core';
2
+ /**
3
+ * NEAR testnet.
4
+ *
5
+ * - Test chain: kept out of the ui, its routes are registered on demand
6
+ * (see `testnet.registerNear`)
7
+ */
8
+ export declare const near_testnet: NearChain;
@@ -5,6 +5,13 @@ import { AssetDepositLimit, GlobalWithdrawLimit } from './circuit-breaker';
5
5
  export declare class HydrationClient extends BaseClient<typeof hydration> {
6
6
  constructor(chain: AnyParachain);
7
7
  checkIfSufficient(asset: Asset): Promise<boolean>;
8
+ /**
9
+ * Fee currency of an account, `0` (hdx) when it set none.
10
+ *
11
+ * - Keyed by the substrate account, an h160 resolves to its own
12
+ *
13
+ * @param address - ss58 or h160
14
+ */
8
15
  getFeeAsset(address: string): Promise<string>;
9
16
  getAssetBalance(address: string, asset: string): Promise<bigint>;
10
17
  getSystemAccountBalance(address: string): Promise<bigint>;
@@ -0,0 +1,25 @@
1
+ import { AnyChain, Asset, NearChain } from '@galacticcouncil/xc-core';
2
+ import { ExecutorBudget } from '../wormhole';
3
+ import { NttClient, NttRateLimit } from './types';
4
+ /**
5
+ * The whm near-ntt contract - manager & transceiver in one, always locking.
6
+ *
7
+ * - Its views report capacity alone, so the limits are read from storage
8
+ * - Rpc nodes serve storage only while the contract holds under their view
9
+ * limit (50kB by default), and every executed inbound transfer adds to it -
10
+ * a view of the full limit is due before this outgrows it
11
+ */
12
+ export declare class NttNearClient implements NttClient {
13
+ private readonly chain;
14
+ private readonly asset?;
15
+ constructor(chain: NearChain, asset?: Asset | undefined);
16
+ getOutboundLimit(): Promise<NttRateLimit>;
17
+ getInboundLimit(from: AnyChain): Promise<NttRateLimit>;
18
+ /** No executor serves NEAR - redeems are the recipient's own `complete`. */
19
+ getRedeemBudget(): Promise<ExecutorBudget>;
20
+ /** Custody is the contract's own token balance, released by ft_transfer. */
21
+ getCustody(): Promise<bigint>;
22
+ private getLimit;
23
+ /** Stored limit, or undefined for a chain the contract has no peer on. */
24
+ private readLimit;
25
+ }
@@ -1,10 +1,11 @@
1
1
  import { AnyChain, Asset } from '@galacticcouncil/xc-core';
2
2
  import { NttEvmClient } from './NttEvmClient';
3
+ import { NttNearClient } from './NttNearClient';
3
4
  import { NttSolanaClient } from './NttSolanaClient';
4
5
  import { NttSuiClient } from './NttSuiClient';
5
6
  import { NttClient } from './types';
6
7
  export * from './types';
7
- export { NttEvmClient, NttSolanaClient, NttSuiClient };
8
+ export { NttEvmClient, NttNearClient, NttSolanaClient, NttSuiClient };
8
9
  /**
9
10
  * Ntt deployment on a chain, for an asset.
10
11
  *
@@ -0,0 +1,8 @@
1
+ import { Asset, AssetRoute } from '@galacticcouncil/xc-core';
2
+ /**
3
+ * Ntt transfer out of a NEAR locking manager, redeemed on hydration.
4
+ *
5
+ * - Paid in near gas, whatever the source asset
6
+ * - A native near source is wrapped into the locked token first
7
+ */
8
+ export declare function toHydrationViaNttTemplate(assetIn: Asset, assetOut: Asset): AssetRoute;