@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 +1 -0
- package/build/builders/FeeAssetBuilder.spec.d.ts +1 -0
- package/build/builders/FunctionCallBuilder.d.ts +4 -0
- package/build/builders/functionCalls/Wormhole/Ntt.d.ts +4 -0
- package/build/builders/functionCalls/Wormhole/Ntt.spec.d.ts +1 -0
- package/build/builders/functionCalls/Wormhole/index.d.ts +5 -0
- package/build/builders/index.d.ts +1 -0
- package/build/builders/utils/amount.d.ts +10 -0
- package/build/chains/near/index.d.ts +2 -1
- package/build/chains/near/testnet.d.ts +8 -0
- package/build/clients/chain/hydration/client.d.ts +7 -0
- package/build/clients/ntt/NttNearClient.d.ts +25 -0
- package/build/clients/ntt/index.d.ts +2 -1
- package/build/configs/near/templates.d.ts +8 -0
- package/build/index.cjs +1 -1
- package/build/index.d.ts +1 -0
- package/build/index.mjs +1 -1
- package/build/testnet/index.d.ts +1 -0
- package/build/testnet/near.d.ts +15 -0
- package/build/testnet/near.spec.d.ts +1 -0
- package/package.json +2 -2
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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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;
|
|
@@ -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;
|