@dedot/chaintypes 0.176.0 → 0.178.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.
@@ -1,8 +1,13 @@
1
1
  // Generated by dedot cli
2
2
 
3
3
  import type { GenericChainViewFunctions, GenericViewFunction, RpcVersion } from 'dedot/types';
4
- import type { AccountId32Like } from 'dedot/codecs';
5
- import type { AssetHubWestendRuntimeRuntimeCallLike, AssetHubWestendRuntimeProxyType } from './types.js';
4
+ import type { Result, AccountId32Like } from 'dedot/codecs';
5
+ import type {
6
+ AssetHubWestendRuntimeRuntimeCallLike,
7
+ AssetHubWestendRuntimeProxyType,
8
+ StagingXcmV5Location,
9
+ PalletAssetConversionError,
10
+ } from './types.js';
6
11
 
7
12
  export interface ChainViewFunctions<Rv extends RpcVersion> extends GenericChainViewFunctions<Rv> {
8
13
  /**
@@ -36,6 +41,78 @@ export interface ChainViewFunctions<Rv extends RpcVersion> extends GenericChainV
36
41
  **/
37
42
  [name: string]: GenericViewFunction<Rv>;
38
43
  };
44
+ /**
45
+ * Pallet `AssetConversion`'s view functions
46
+ **/
47
+ assetConversion: {
48
+ /**
49
+ * Returns the balance of each asset in the pool.
50
+ * The tuple result is in the order requested (not necessarily the same as pool order).
51
+ *
52
+ * @param {StagingXcmV5Location} asset1
53
+ * @param {StagingXcmV5Location} asset2
54
+ **/
55
+ getReserves: GenericViewFunction<
56
+ Rv,
57
+ (
58
+ asset1: StagingXcmV5Location,
59
+ asset2: StagingXcmV5Location,
60
+ ) => Promise<Result<[bigint, bigint], PalletAssetConversionError>>
61
+ >;
62
+
63
+ /**
64
+ * Gets a quote for swapping an exact amount of `asset1` for `asset2`.
65
+ *
66
+ * If `include_fee` is true, the quote will include the liquidity provider fee.
67
+ * If the pool does not exist or has no liquidity, `None` is returned.
68
+ * Note that the price may have changed by the time the transaction is executed.
69
+ * (Use `amount_out_min` to control slippage.)
70
+ * Returns `Some(quoted_amount)` on success.
71
+ *
72
+ * @param {StagingXcmV5Location} asset1
73
+ * @param {StagingXcmV5Location} asset2
74
+ * @param {bigint} amount
75
+ * @param {boolean} includeFee
76
+ **/
77
+ quotePriceExactTokensForTokens: GenericViewFunction<
78
+ Rv,
79
+ (
80
+ asset1: StagingXcmV5Location,
81
+ asset2: StagingXcmV5Location,
82
+ amount: bigint,
83
+ includeFee: boolean,
84
+ ) => Promise<bigint | undefined>
85
+ >;
86
+
87
+ /**
88
+ * Gets a quote for swapping `amount` of `asset1` for an exact amount of `asset2`.
89
+ *
90
+ * If `include_fee` is true, the quote will include the liquidity provider fee.
91
+ * If the pool does not exist or has no liquidity, `None` is returned.
92
+ * Note that the price may have changed by the time the transaction is executed.
93
+ * (Use `amount_in_max` to control slippage.)
94
+ * Returns `Some(quoted_amount)` on success.
95
+ *
96
+ * @param {StagingXcmV5Location} asset1
97
+ * @param {StagingXcmV5Location} asset2
98
+ * @param {bigint} amount
99
+ * @param {boolean} includeFee
100
+ **/
101
+ quotePriceTokensForExactTokens: GenericViewFunction<
102
+ Rv,
103
+ (
104
+ asset1: StagingXcmV5Location,
105
+ asset2: StagingXcmV5Location,
106
+ amount: bigint,
107
+ includeFee: boolean,
108
+ ) => Promise<bigint | undefined>
109
+ >;
110
+
111
+ /**
112
+ * Generic pallet view function
113
+ **/
114
+ [name: string]: GenericViewFunction<Rv>;
115
+ };
39
116
  /**
40
117
  * Pallet `VoterList`'s view functions
41
118
  **/