@dedot/chaintypes 0.241.0 → 0.243.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,5 +1,36 @@
1
1
  // Generated by dedot cli
2
2
 
3
3
  import type { GenericChainViewFunctions, GenericViewFunction } from 'dedot/types';
4
+ import type { BasiliskRuntimeRuntimeCallLike, BasiliskRuntimeSystemProxyType } from './types.js';
4
5
 
5
- export interface ChainViewFunctions extends GenericChainViewFunctions {}
6
+ export interface ChainViewFunctions extends GenericChainViewFunctions {
7
+ /**
8
+ * Pallet `Proxy`'s view functions
9
+ **/
10
+ proxy: {
11
+ /**
12
+ * Check if a `RuntimeCall` is allowed for a given `ProxyType`.
13
+ *
14
+ * @param {BasiliskRuntimeRuntimeCallLike} call
15
+ * @param {BasiliskRuntimeSystemProxyType} proxyType
16
+ **/
17
+ checkPermissions: GenericViewFunction<
18
+ (call: BasiliskRuntimeRuntimeCallLike, proxyType: BasiliskRuntimeSystemProxyType) => Promise<boolean>
19
+ >;
20
+
21
+ /**
22
+ * Check if one `ProxyType` is a subset of another `ProxyType`.
23
+ *
24
+ * @param {BasiliskRuntimeSystemProxyType} toCheck
25
+ * @param {BasiliskRuntimeSystemProxyType} against
26
+ **/
27
+ isSuperset: GenericViewFunction<
28
+ (toCheck: BasiliskRuntimeSystemProxyType, against: BasiliskRuntimeSystemProxyType) => Promise<boolean>
29
+ >;
30
+
31
+ /**
32
+ * Generic pallet view function
33
+ **/
34
+ [name: string]: GenericViewFunction;
35
+ };
36
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dedot/chaintypes",
3
- "version": "0.241.0",
3
+ "version": "0.243.0",
4
4
  "description": "Types for substrate-based chains",
5
5
  "author": "Thang X. Vu <thang@dedot.dev>",
6
6
  "homepage": "https://dedot.dev",
@@ -25,7 +25,7 @@
25
25
  "directory": "dist"
26
26
  },
27
27
  "license": "Apache-2.0",
28
- "gitHead": "77e33dfd7ed0f001436caf93080b6f6a6c372c06",
28
+ "gitHead": "22dc2a93f83ef73a621ab1e54eb727cfabecf037",
29
29
  "module": "./index.js",
30
30
  "types": "./index.d.ts",
31
31
  "exports": {
@@ -918,11 +918,6 @@ export interface ChainConsts extends GenericChainConsts {
918
918
  **/
919
919
  defaultMaxRemoveLiquidityLimitPerBlock: [number, number] | undefined;
920
920
 
921
- /**
922
- * Time window for global withdraw accumulator in milliseconds (e.g., 86_400_000 for 24h).
923
- **/
924
- globalWithdrawWindow: bigint;
925
-
926
921
  /**
927
922
  * Generic pallet constant
928
923
  **/
@@ -1483,6 +1483,11 @@ export interface ChainErrors extends GenericChainErrors {
1483
1483
  **/
1484
1484
  ProtocolFeeNotConsumed: GenericPalletError;
1485
1485
 
1486
+ /**
1487
+ * Slip fee configuration exceeds the allowed maximum (50%).
1488
+ **/
1489
+ MaxSlipFeeTooHigh: GenericPalletError;
1490
+
1486
1491
  /**
1487
1492
  * Generic pallet error
1488
1493
  **/
@@ -34,6 +34,7 @@ import type {
34
34
  HydradxRuntimeXcmAssetLocation,
35
35
  PalletClaimsEthereumAddress,
36
36
  PalletOmnipoolTradability,
37
+ PalletOmnipoolSlipFeeConfig,
37
38
  PalletLiquidityMiningLoyaltyCurve,
38
39
  PalletCircuitBreakerGlobalAssetCategory,
39
40
  PalletDynamicFeesAssetFeeConfig,
@@ -1839,6 +1840,11 @@ export interface ChainEvents extends GenericChainEvents {
1839
1840
  **/
1840
1841
  AssetWeightCapUpdated: GenericPalletEvent<'Omnipool', 'AssetWeightCapUpdated', { assetId: number; cap: Permill }>;
1841
1842
 
1843
+ /**
1844
+ * Slip fee configuration was updated.
1845
+ **/
1846
+ SlipFeeSet: GenericPalletEvent<'Omnipool', 'SlipFeeSet', { slipFee?: PalletOmnipoolSlipFeeConfig | undefined }>;
1847
+
1842
1848
  /**
1843
1849
  * Generic pallet event
1844
1850
  **/
@@ -2207,7 +2213,11 @@ export interface ChainEvents extends GenericChainEvents {
2207
2213
  /**
2208
2214
  * Global limit value updated by governance (in reference currency).
2209
2215
  **/
2210
- GlobalLimitUpdated: GenericPalletEvent<'CircuitBreaker', 'GlobalLimitUpdated', { newLimit: bigint }>;
2216
+ GlobalWithdrawLimitConfigUpdated: GenericPalletEvent<
2217
+ 'CircuitBreaker',
2218
+ 'GlobalWithdrawLimitConfigUpdated',
2219
+ { newLimit: bigint; newPeriod: bigint }
2220
+ >;
2211
2221
 
2212
2222
  /**
2213
2223
  * Global withdraw lockdown was set by governance.
@@ -51,7 +51,7 @@ interface ChainKnownTypes extends GenericChainKnownTypes {
51
51
 
52
52
  /**
53
53
  * @name: PaseoHydrationApi
54
- * @specVersion: 396
54
+ * @specVersion: 397
55
55
  **/
56
56
  export interface PaseoHydrationApi extends GenericSubstrateApi {
57
57
  rpc: ChainJsonRpcApis;
@@ -64,6 +64,8 @@ import type {
64
64
  PalletOmnipoolAssetState,
65
65
  PalletOmnipoolTradability,
66
66
  PalletOmnipoolPosition,
67
+ PalletOmnipoolSlipFeeConfig,
68
+ HydraDxMathOmnipoolTypesSignedBalance,
67
69
  PalletLiquidityMiningGlobalFarmData,
68
70
  PalletLiquidityMiningYieldFarmData,
69
71
  PalletLiquidityMiningDepositData,
@@ -71,6 +73,7 @@ import type {
71
73
  PalletCircuitBreakerTradeVolumeLimit,
72
74
  PalletCircuitBreakerLiquidityLimit,
73
75
  PalletCircuitBreakerLockdownStatus,
76
+ PalletCircuitBreakerGlobalWithdrawLimitParameters,
74
77
  PalletCircuitBreakerGlobalAssetCategory,
75
78
  HydradxTraitsRouterTrade,
76
79
  HydradxTraitsRouterAssetPair,
@@ -1343,6 +1346,34 @@ export interface ChainStorage extends GenericChainStorage {
1343
1346
  **/
1344
1347
  nextPositionId: GenericStorageQuery<() => bigint>;
1345
1348
 
1349
+ /**
1350
+ * Global slip fee configuration.
1351
+ * `None` = slip fees disabled (default). `Some(config)` = enabled.
1352
+ * Set via `set_slip_fee` extrinsic (governance).
1353
+ *
1354
+ * @param {Callback<PalletOmnipoolSlipFeeConfig | undefined> =} callback
1355
+ **/
1356
+ slipFee: GenericStorageQuery<() => PalletOmnipoolSlipFeeConfig | undefined>;
1357
+
1358
+ /**
1359
+ * Snapshot of each asset's hub_reserve at the start of the current block.
1360
+ * Lazily populated on first trade per asset per block, cleared in on_finalize.
1361
+ *
1362
+ * @param {number} arg
1363
+ * @param {Callback<bigint | undefined> =} callback
1364
+ **/
1365
+ slipFeeHubReserveAtBlockStart: GenericStorageQuery<(arg: number) => bigint | undefined, number>;
1366
+
1367
+ /**
1368
+ * Cumulative net hub asset delta per asset in the current block.
1369
+ * Negative = net hub asset outflow, positive = net hub asset inflow.
1370
+ * Cleared in on_finalize.
1371
+ *
1372
+ * @param {number} arg
1373
+ * @param {Callback<HydraDxMathOmnipoolTypesSignedBalance> =} callback
1374
+ **/
1375
+ slipFeeDelta: GenericStorageQuery<(arg: number) => HydraDxMathOmnipoolTypesSignedBalance, number>;
1376
+
1346
1377
  /**
1347
1378
  * Generic pallet storage query
1348
1379
  **/
@@ -1552,11 +1583,11 @@ export interface ChainStorage extends GenericChainStorage {
1552
1583
  >;
1553
1584
 
1554
1585
  /**
1555
- * Configured global limit in reference currency
1586
+ * Configured global withdraw limit parameters
1556
1587
  *
1557
- * @param {Callback<bigint | undefined> =} callback
1588
+ * @param {Callback<PalletCircuitBreakerGlobalWithdrawLimitParameters | undefined> =} callback
1558
1589
  **/
1559
- globalWithdrawLimit: GenericStorageQuery<() => bigint | undefined>;
1590
+ globalWithdrawLimitConfig: GenericStorageQuery<() => PalletCircuitBreakerGlobalWithdrawLimitParameters | undefined>;
1560
1591
 
1561
1592
  /**
1562
1593
  * Tuple of (current_accumulator_in_ref, last_update_timestamp_ms)
@@ -48,8 +48,10 @@ import type {
48
48
  HydradxRuntimeXcmAssetLocation,
49
49
  PalletClaimsEcdsaSignature,
50
50
  PalletOmnipoolTradability,
51
+ PalletOmnipoolSlipFeeConfig,
51
52
  PalletLiquidityMiningLoyaltyCurve,
52
53
  HydradxTraitsStableswapAssetAmount,
54
+ PalletCircuitBreakerGlobalWithdrawLimitParameters,
53
55
  PalletCircuitBreakerGlobalAssetCategory,
54
56
  HydradxTraitsRouterTrade,
55
57
  HydradxTraitsRouterAssetPair,
@@ -6153,6 +6155,31 @@ export interface ChainTx<
6153
6155
  >
6154
6156
  >;
6155
6157
 
6158
+ /**
6159
+ * Set or clear slip fee configuration.
6160
+ *
6161
+ * When set to `Some(config)`, slip fees are enabled with the given parameters.
6162
+ * When set to `None`, slip fees are disabled.
6163
+ *
6164
+ * Can only be called by `UpdateTradabilityOrigin`.
6165
+ *
6166
+ * Emits `SlipFeeSet` event.
6167
+ *
6168
+ * @param {PalletOmnipoolSlipFeeConfig | undefined} slipFee
6169
+ **/
6170
+ setSlipFee: GenericTxCall<
6171
+ (slipFee: PalletOmnipoolSlipFeeConfig | undefined) => ChainSubmittableExtrinsic<
6172
+ {
6173
+ pallet: 'Omnipool';
6174
+ palletCall: {
6175
+ name: 'SetSlipFee';
6176
+ params: { slipFee: PalletOmnipoolSlipFeeConfig | undefined };
6177
+ };
6178
+ },
6179
+ ChainKnownTypes
6180
+ >
6181
+ >;
6182
+
6156
6183
  /**
6157
6184
  * Generic pallet tx call
6158
6185
  **/
@@ -7364,15 +7391,15 @@ export interface ChainTx<
7364
7391
  * Set the global withdraw limit (reference currency units)
7365
7392
  * Can be called only by authority origin.
7366
7393
  *
7367
- * @param {bigint} limit
7394
+ * @param {PalletCircuitBreakerGlobalWithdrawLimitParameters} parameters
7368
7395
  **/
7369
- setGlobalWithdrawLimit: GenericTxCall<
7370
- (limit: bigint) => ChainSubmittableExtrinsic<
7396
+ setGlobalWithdrawLimitParams: GenericTxCall<
7397
+ (parameters: PalletCircuitBreakerGlobalWithdrawLimitParameters) => ChainSubmittableExtrinsic<
7371
7398
  {
7372
7399
  pallet: 'CircuitBreaker';
7373
7400
  palletCall: {
7374
- name: 'SetGlobalWithdrawLimit';
7375
- params: { limit: bigint };
7401
+ name: 'SetGlobalWithdrawLimitParams';
7402
+ params: { parameters: PalletCircuitBreakerGlobalWithdrawLimitParameters };
7376
7403
  };
7377
7404
  },
7378
7405
  ChainKnownTypes
@@ -6841,7 +6841,18 @@ export type PalletOmnipoolCall =
6841
6841
  *
6842
6842
  * Emits `TokenRemoved` event when successful.
6843
6843
  **/
6844
- | { name: 'RemoveToken'; params: { assetId: number; beneficiary: AccountId32 } };
6844
+ | { name: 'RemoveToken'; params: { assetId: number; beneficiary: AccountId32 } }
6845
+ /**
6846
+ * Set or clear slip fee configuration.
6847
+ *
6848
+ * When set to `Some(config)`, slip fees are enabled with the given parameters.
6849
+ * When set to `None`, slip fees are disabled.
6850
+ *
6851
+ * Can only be called by `UpdateTradabilityOrigin`.
6852
+ *
6853
+ * Emits `SlipFeeSet` event.
6854
+ **/
6855
+ | { name: 'SetSlipFee'; params: { slipFee?: PalletOmnipoolSlipFeeConfig | undefined } };
6845
6856
 
6846
6857
  export type PalletOmnipoolCallLike =
6847
6858
  /**
@@ -7099,10 +7110,23 @@ export type PalletOmnipoolCallLike =
7099
7110
  *
7100
7111
  * Emits `TokenRemoved` event when successful.
7101
7112
  **/
7102
- | { name: 'RemoveToken'; params: { assetId: number; beneficiary: AccountId32Like } };
7113
+ | { name: 'RemoveToken'; params: { assetId: number; beneficiary: AccountId32Like } }
7114
+ /**
7115
+ * Set or clear slip fee configuration.
7116
+ *
7117
+ * When set to `Some(config)`, slip fees are enabled with the given parameters.
7118
+ * When set to `None`, slip fees are disabled.
7119
+ *
7120
+ * Can only be called by `UpdateTradabilityOrigin`.
7121
+ *
7122
+ * Emits `SlipFeeSet` event.
7123
+ **/
7124
+ | { name: 'SetSlipFee'; params: { slipFee?: PalletOmnipoolSlipFeeConfig | undefined } };
7103
7125
 
7104
7126
  export type PalletOmnipoolTradability = { bits: number };
7105
7127
 
7128
+ export type PalletOmnipoolSlipFeeConfig = { maxSlipFee: Permill };
7129
+
7106
7130
  /**
7107
7131
  * Contains a variant per dispatchable extrinsic that this pallet has.
7108
7132
  **/
@@ -8191,7 +8215,7 @@ export type PalletCircuitBreakerCall =
8191
8215
  * Set the global withdraw limit (reference currency units)
8192
8216
  * Can be called only by authority origin.
8193
8217
  **/
8194
- | { name: 'SetGlobalWithdrawLimit'; params: { limit: bigint } }
8218
+ | { name: 'SetGlobalWithdrawLimitParams'; params: { parameters: PalletCircuitBreakerGlobalWithdrawLimitParameters } }
8195
8219
  /**
8196
8220
  * Reset the global lockdown and accumulator to zero at current block.
8197
8221
  * Can be called only by authority origin.
@@ -8289,7 +8313,7 @@ export type PalletCircuitBreakerCallLike =
8289
8313
  * Set the global withdraw limit (reference currency units)
8290
8314
  * Can be called only by authority origin.
8291
8315
  **/
8292
- | { name: 'SetGlobalWithdrawLimit'; params: { limit: bigint } }
8316
+ | { name: 'SetGlobalWithdrawLimitParams'; params: { parameters: PalletCircuitBreakerGlobalWithdrawLimitParameters } }
8293
8317
  /**
8294
8318
  * Reset the global lockdown and accumulator to zero at current block.
8295
8319
  * Can be called only by authority origin.
@@ -8303,6 +8327,8 @@ export type PalletCircuitBreakerCallLike =
8303
8327
  params: { assetId: number; category?: PalletCircuitBreakerGlobalAssetCategory | undefined };
8304
8328
  };
8305
8329
 
8330
+ export type PalletCircuitBreakerGlobalWithdrawLimitParameters = { limit: bigint; window: bigint };
8331
+
8306
8332
  export type PalletCircuitBreakerGlobalAssetCategory = 'External' | 'Local';
8307
8333
 
8308
8334
  /**
@@ -14847,7 +14873,11 @@ export type PalletOmnipoolEvent =
14847
14873
  /**
14848
14874
  * Asset's weight cap has been updated.
14849
14875
  **/
14850
- | { name: 'AssetWeightCapUpdated'; data: { assetId: number; cap: Permill } };
14876
+ | { name: 'AssetWeightCapUpdated'; data: { assetId: number; cap: Permill } }
14877
+ /**
14878
+ * Slip fee configuration was updated.
14879
+ **/
14880
+ | { name: 'SlipFeeSet'; data: { slipFee?: PalletOmnipoolSlipFeeConfig | undefined } };
14851
14881
 
14852
14882
  /**
14853
14883
  * The `Event` enum of this pallet
@@ -15108,7 +15138,7 @@ export type PalletCircuitBreakerEvent =
15108
15138
  /**
15109
15139
  * Global limit value updated by governance (in reference currency).
15110
15140
  **/
15111
- | { name: 'GlobalLimitUpdated'; data: { newLimit: bigint } }
15141
+ | { name: 'GlobalWithdrawLimitConfigUpdated'; data: { newLimit: bigint; newPeriod: bigint } }
15112
15142
  /**
15113
15143
  * Global withdraw lockdown was set by governance.
15114
15144
  **/
@@ -18163,6 +18193,10 @@ export type PalletOmnipoolAssetState = {
18163
18193
 
18164
18194
  export type PalletOmnipoolPosition = { assetId: number; amount: bigint; shares: bigint; price: [bigint, bigint] };
18165
18195
 
18196
+ export type HydraDxMathOmnipoolTypesSignedBalance =
18197
+ | { type: 'Positive'; value: bigint }
18198
+ | { type: 'Negative'; value: bigint };
18199
+
18166
18200
  /**
18167
18201
  * The `Error` enum of this pallet.
18168
18202
  **/
@@ -18294,7 +18328,11 @@ export type PalletOmnipoolError =
18294
18328
  /**
18295
18329
  * Extra protocol fee has not been consumed.
18296
18330
  **/
18297
- | 'ProtocolFeeNotConsumed';
18331
+ | 'ProtocolFeeNotConsumed'
18332
+ /**
18333
+ * Slip fee configuration exceeds the allowed maximum (50%).
18334
+ **/
18335
+ | 'MaxSlipFeeTooHigh';
18298
18336
 
18299
18337
  /**
18300
18338
  * The `Error` enum of this pallet.