@dedot/chaintypes 0.101.0 → 0.102.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.
@@ -2587,6 +2587,11 @@ export interface ChainErrors<Rv extends RpcVersion> extends GenericChainErrors<R
2587
2587
  **/
2588
2588
  CannotCreatePool: GenericPalletError<Rv>;
2589
2589
 
2590
+ /**
2591
+ * Slippage protection.
2592
+ **/
2593
+ SlippageLimit: GenericPalletError<Rv>;
2594
+
2590
2595
  /**
2591
2596
  * Generic pallet error
2592
2597
  **/
@@ -2910,14 +2910,7 @@ export interface ChainEvents<Rv extends RpcVersion> extends GenericChainEvents<R
2910
2910
  Rv,
2911
2911
  'Liquidation',
2912
2912
  'Liquidated',
2913
- {
2914
- liquidator: AccountId32;
2915
- evmAddress: H160;
2916
- collateralAsset: number;
2917
- debtAsset: number;
2918
- debtToCover: bigint;
2919
- profit: bigint;
2920
- }
2913
+ { user: H160; collateralAsset: number; debtAsset: number; debtToCover: bigint; profit: bigint }
2921
2914
  >;
2922
2915
 
2923
2916
  /**
@@ -3500,7 +3493,6 @@ export interface ChainEvents<Rv extends RpcVersion> extends GenericChainEvents<R
3500
3493
  >;
3501
3494
 
3502
3495
  /**
3503
- * Deprecated. Use pallet_amm::Event::Swapped instead.
3504
3496
  * The DCA trade is successfully executed
3505
3497
  **/
3506
3498
  TradeExecuted: GenericPalletEvent<
@@ -4337,13 +4329,17 @@ export interface ChainEvents<Rv extends RpcVersion> extends GenericChainEvents<R
4337
4329
  /**
4338
4330
  * Trade executed.
4339
4331
  *
4340
- * Swapped2 is a fixed and renamed version of original Swapped,
4332
+ * Swapped3 is a fixed and renamed version of original Swapped,
4341
4333
  * as Swapped contained wrong input/output amounts for XYK buy trade
4334
+ *
4335
+ * Swapped3 is a fixed and renamed version of original Swapped3,
4336
+ * as Swapped contained wrong filler account on AAVE trades
4337
+ *
4342
4338
  **/
4343
- Swapped2: GenericPalletEvent<
4339
+ Swapped3: GenericPalletEvent<
4344
4340
  Rv,
4345
4341
  'Broadcast',
4346
- 'Swapped2',
4342
+ 'Swapped3',
4347
4343
  {
4348
4344
  swapper: AccountId32;
4349
4345
  filler: AccountId32;
@@ -23,7 +23,7 @@ export interface VersionedHydrationApi<Rv extends RpcVersion> extends GenericSub
23
23
 
24
24
  /**
25
25
  * @name: HydrationApi
26
- * @specVersion: 308
26
+ * @specVersion: 313
27
27
  **/
28
28
  export interface HydrationApi {
29
29
  legacy: VersionedHydrationApi<RpcLegacy>;
@@ -1267,6 +1267,12 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
1267
1267
  **/
1268
1268
  aaveManagerAccount: GenericStorageQuery<Rv, () => AccountId32>;
1269
1269
 
1270
+ /**
1271
+ *
1272
+ * @param {Callback<bigint> =} callback
1273
+ **/
1274
+ extraGas: GenericStorageQuery<Rv, () => bigint>;
1275
+
1270
1276
  /**
1271
1277
  * Generic pallet storage query
1272
1278
  **/
@@ -1752,6 +1758,13 @@ export interface ChainStorage<Rv extends RpcVersion> extends GenericChainStorage
1752
1758
  [AccountId32, number]
1753
1759
  >;
1754
1760
 
1761
+ /**
1762
+ * Block number when we switched to 6 sec. blocks.
1763
+ *
1764
+ * @param {Callback<number> =} callback
1765
+ **/
1766
+ sixSecBlocksSince: GenericStorageQuery<Rv, () => number>;
1767
+
1755
1768
  /**
1756
1769
  * Generic pallet storage query
1757
1770
  **/
@@ -46,6 +46,7 @@ import type {
46
46
  XcmVersionedXcm,
47
47
  XcmVersionedAssets,
48
48
  XcmVersionedLocation,
49
+ SpConsensusSlotsSlot,
49
50
  XcmRuntimeApisDryRunCallDryRunEffects,
50
51
  XcmRuntimeApisDryRunError,
51
52
  HydradxRuntimeOriginCaller,
@@ -745,6 +746,33 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
745
746
  **/
746
747
  [method: string]: GenericRuntimeApiMethod<Rv>;
747
748
  };
749
+ /**
750
+ * @runtimeapi: AuraUnincludedSegmentApi - 0xd7bdd8a272ca0d65
751
+ **/
752
+ auraUnincludedSegmentApi: {
753
+ /**
754
+ * Whether it is legal to extend the chain, assuming the given block is the most
755
+ * recently included one as-of the relay parent that will be built against, and
756
+ * the given slot.
757
+ *
758
+ * This should be consistent with the logic the runtime uses when validating blocks to
759
+ * avoid issues.
760
+ *
761
+ * When the unincluded segment is empty, i.e. `included_hash == at`, where at is the block
762
+ * whose state we are querying against, this must always return `true` as long as the slot
763
+ * is more recent than the included block itself.
764
+ *
765
+ * @callname: AuraUnincludedSegmentApi_can_build_upon
766
+ * @param {H256} included_hash
767
+ * @param {SpConsensusSlotsSlot} slot
768
+ **/
769
+ canBuildUpon: GenericRuntimeApiMethod<Rv, (includedHash: H256, slot: SpConsensusSlotsSlot) => Promise<boolean>>;
770
+
771
+ /**
772
+ * Generic runtime api call
773
+ **/
774
+ [method: string]: GenericRuntimeApiMethod<Rv>;
775
+ };
748
776
  /**
749
777
  * @runtimeapi: DryRunApi - 0x91b1c8b16328eb92
750
778
  **/
package/hydration/tx.d.ts CHANGED
@@ -5963,6 +5963,32 @@ export interface ChainTx<Rv extends RpcVersion> extends GenericChainTx<Rv, TxCal
5963
5963
  >
5964
5964
  >;
5965
5965
 
5966
+ /**
5967
+ * Dispatch a call with extra gas.
5968
+ *
5969
+ * This allows executing calls with additional weight (gas) limit.
5970
+ * The extra gas is not refunded, even if not used.
5971
+ *
5972
+ * @param {HydradxRuntimeRuntimeCallLike} call
5973
+ * @param {bigint} extraGas
5974
+ **/
5975
+ dispatchWithExtraGas: GenericTxCall<
5976
+ Rv,
5977
+ (
5978
+ call: HydradxRuntimeRuntimeCallLike,
5979
+ extraGas: bigint,
5980
+ ) => ChainSubmittableExtrinsic<
5981
+ Rv,
5982
+ {
5983
+ pallet: 'Dispatcher';
5984
+ palletCall: {
5985
+ name: 'DispatchWithExtraGas';
5986
+ params: { call: HydradxRuntimeRuntimeCallLike; extraGas: bigint };
5987
+ };
5988
+ }
5989
+ >
5990
+ >;
5991
+
5966
5992
  /**
5967
5993
  * Generic pallet tx call
5968
5994
  **/
@@ -9224,6 +9250,34 @@ export interface ChainTx<Rv extends RpcVersion> extends GenericChainTx<Rv, TxCal
9224
9250
  >
9225
9251
  >;
9226
9252
 
9253
+ /**
9254
+ *
9255
+ * @param {number} assetA
9256
+ * @param {number} assetB
9257
+ * @param {bigint} amountA
9258
+ * @param {bigint} amountBMaxLimit
9259
+ * @param {bigint} minShares
9260
+ **/
9261
+ addLiquidityWithLimits: GenericTxCall<
9262
+ Rv,
9263
+ (
9264
+ assetA: number,
9265
+ assetB: number,
9266
+ amountA: bigint,
9267
+ amountBMaxLimit: bigint,
9268
+ minShares: bigint,
9269
+ ) => ChainSubmittableExtrinsic<
9270
+ Rv,
9271
+ {
9272
+ pallet: 'Xyk';
9273
+ palletCall: {
9274
+ name: 'AddLiquidityWithLimits';
9275
+ params: { assetA: number; assetB: number; amountA: bigint; amountBMaxLimit: bigint; minShares: bigint };
9276
+ };
9277
+ }
9278
+ >
9279
+ >;
9280
+
9227
9281
  /**
9228
9282
  * Remove liquidity from specific liquidity pool in the form of burning shares.
9229
9283
  *
@@ -9234,21 +9288,49 @@ export interface ChainTx<Rv extends RpcVersion> extends GenericChainTx<Rv, TxCal
9234
9288
  *
9235
9289
  * @param {number} assetA
9236
9290
  * @param {number} assetB
9237
- * @param {bigint} liquidityAmount
9291
+ * @param {bigint} shareAmount
9238
9292
  **/
9239
9293
  removeLiquidity: GenericTxCall<
9240
9294
  Rv,
9241
9295
  (
9242
9296
  assetA: number,
9243
9297
  assetB: number,
9244
- liquidityAmount: bigint,
9298
+ shareAmount: bigint,
9245
9299
  ) => ChainSubmittableExtrinsic<
9246
9300
  Rv,
9247
9301
  {
9248
9302
  pallet: 'Xyk';
9249
9303
  palletCall: {
9250
9304
  name: 'RemoveLiquidity';
9251
- params: { assetA: number; assetB: number; liquidityAmount: bigint };
9305
+ params: { assetA: number; assetB: number; shareAmount: bigint };
9306
+ };
9307
+ }
9308
+ >
9309
+ >;
9310
+
9311
+ /**
9312
+ *
9313
+ * @param {number} assetA
9314
+ * @param {number} assetB
9315
+ * @param {bigint} shareAmount
9316
+ * @param {bigint} minAmountA
9317
+ * @param {bigint} minAmountB
9318
+ **/
9319
+ removeLiquidityWithLimits: GenericTxCall<
9320
+ Rv,
9321
+ (
9322
+ assetA: number,
9323
+ assetB: number,
9324
+ shareAmount: bigint,
9325
+ minAmountA: bigint,
9326
+ minAmountB: bigint,
9327
+ ) => ChainSubmittableExtrinsic<
9328
+ Rv,
9329
+ {
9330
+ pallet: 'Xyk';
9331
+ palletCall: {
9332
+ name: 'RemoveLiquidityWithLimits';
9333
+ params: { assetA: number; assetB: number; shareAmount: bigint; minAmountA: bigint; minAmountB: bigint };
9252
9334
  };
9253
9335
  }
9254
9336
  >
@@ -6598,7 +6598,14 @@ export type PalletDispatcherCall =
6598
6598
  * This is intented to be mainly used in testnet environments, where the manager account
6599
6599
  * can be different.
6600
6600
  **/
6601
- | { name: 'NoteAaveManager'; params: { account: AccountId32 } };
6601
+ | { name: 'NoteAaveManager'; params: { account: AccountId32 } }
6602
+ /**
6603
+ * Dispatch a call with extra gas.
6604
+ *
6605
+ * This allows executing calls with additional weight (gas) limit.
6606
+ * The extra gas is not refunded, even if not used.
6607
+ **/
6608
+ | { name: 'DispatchWithExtraGas'; params: { call: HydradxRuntimeRuntimeCall; extraGas: bigint } };
6602
6609
 
6603
6610
  export type PalletDispatcherCallLike =
6604
6611
  | { name: 'DispatchAsTreasury'; params: { call: HydradxRuntimeRuntimeCallLike } }
@@ -6611,7 +6618,14 @@ export type PalletDispatcherCallLike =
6611
6618
  * This is intented to be mainly used in testnet environments, where the manager account
6612
6619
  * can be different.
6613
6620
  **/
6614
- | { name: 'NoteAaveManager'; params: { account: AccountId32Like } };
6621
+ | { name: 'NoteAaveManager'; params: { account: AccountId32Like } }
6622
+ /**
6623
+ * Dispatch a call with extra gas.
6624
+ *
6625
+ * This allows executing calls with additional weight (gas) limit.
6626
+ * The extra gas is not refunded, even if not used.
6627
+ **/
6628
+ | { name: 'DispatchWithExtraGas'; params: { call: HydradxRuntimeRuntimeCallLike; extraGas: bigint } };
6615
6629
 
6616
6630
  /**
6617
6631
  * Contains a variant per dispatchable extrinsic that this pallet has.
@@ -9732,6 +9746,10 @@ export type PalletXykCall =
9732
9746
  * Emits `LiquidityAdded` event when successful.
9733
9747
  **/
9734
9748
  | { name: 'AddLiquidity'; params: { assetA: number; assetB: number; amountA: bigint; amountBMaxLimit: bigint } }
9749
+ | {
9750
+ name: 'AddLiquidityWithLimits';
9751
+ params: { assetA: number; assetB: number; amountA: bigint; amountBMaxLimit: bigint; minShares: bigint };
9752
+ }
9735
9753
  /**
9736
9754
  * Remove liquidity from specific liquidity pool in the form of burning shares.
9737
9755
  *
@@ -9740,7 +9758,11 @@ export type PalletXykCall =
9740
9758
  * Emits 'LiquidityRemoved' when successful.
9741
9759
  * Emits 'PoolDestroyed' when pool is destroyed.
9742
9760
  **/
9743
- | { name: 'RemoveLiquidity'; params: { assetA: number; assetB: number; liquidityAmount: bigint } }
9761
+ | { name: 'RemoveLiquidity'; params: { assetA: number; assetB: number; shareAmount: bigint } }
9762
+ | {
9763
+ name: 'RemoveLiquidityWithLimits';
9764
+ params: { assetA: number; assetB: number; shareAmount: bigint; minAmountA: bigint; minAmountB: bigint };
9765
+ }
9744
9766
  /**
9745
9767
  * Trade asset in for asset out.
9746
9768
  *
@@ -9784,6 +9806,10 @@ export type PalletXykCallLike =
9784
9806
  * Emits `LiquidityAdded` event when successful.
9785
9807
  **/
9786
9808
  | { name: 'AddLiquidity'; params: { assetA: number; assetB: number; amountA: bigint; amountBMaxLimit: bigint } }
9809
+ | {
9810
+ name: 'AddLiquidityWithLimits';
9811
+ params: { assetA: number; assetB: number; amountA: bigint; amountBMaxLimit: bigint; minShares: bigint };
9812
+ }
9787
9813
  /**
9788
9814
  * Remove liquidity from specific liquidity pool in the form of burning shares.
9789
9815
  *
@@ -9792,7 +9818,11 @@ export type PalletXykCallLike =
9792
9818
  * Emits 'LiquidityRemoved' when successful.
9793
9819
  * Emits 'PoolDestroyed' when pool is destroyed.
9794
9820
  **/
9795
- | { name: 'RemoveLiquidity'; params: { assetA: number; assetB: number; liquidityAmount: bigint } }
9821
+ | { name: 'RemoveLiquidity'; params: { assetA: number; assetB: number; shareAmount: bigint } }
9822
+ | {
9823
+ name: 'RemoveLiquidityWithLimits';
9824
+ params: { assetA: number; assetB: number; shareAmount: bigint; minAmountA: bigint; minAmountB: bigint };
9825
+ }
9796
9826
  /**
9797
9827
  * Trade asset in for asset out.
9798
9828
  *
@@ -14340,14 +14370,7 @@ export type PalletLiquidationEvent =
14340
14370
  **/
14341
14371
  {
14342
14372
  name: 'Liquidated';
14343
- data: {
14344
- liquidator: AccountId32;
14345
- evmAddress: H160;
14346
- collateralAsset: number;
14347
- debtAsset: number;
14348
- debtToCover: bigint;
14349
- profit: bigint;
14350
- };
14373
+ data: { user: H160; collateralAsset: number; debtAsset: number; debtToCover: bigint; profit: bigint };
14351
14374
  };
14352
14375
 
14353
14376
  /**
@@ -14747,7 +14770,6 @@ export type PalletDcaEvent =
14747
14770
  **/
14748
14771
  | { name: 'ExecutionPlanned'; data: { id: number; who: AccountId32; block: number } }
14749
14772
  /**
14750
- * Deprecated. Use pallet_amm::Event::Swapped instead.
14751
14773
  * The DCA trade is successfully executed
14752
14774
  **/
14753
14775
  | { name: 'TradeExecuted'; data: { id: number; who: AccountId32; amountIn: bigint; amountOut: bigint } }
@@ -15281,11 +15303,15 @@ export type PalletBroadcastEvent =
15281
15303
  /**
15282
15304
  * Trade executed.
15283
15305
  *
15284
- * Swapped2 is a fixed and renamed version of original Swapped,
15306
+ * Swapped3 is a fixed and renamed version of original Swapped,
15285
15307
  * as Swapped contained wrong input/output amounts for XYK buy trade
15308
+ *
15309
+ * Swapped3 is a fixed and renamed version of original Swapped3,
15310
+ * as Swapped contained wrong filler account on AAVE trades
15311
+ *
15286
15312
  **/
15287
15313
  {
15288
- name: 'Swapped2';
15314
+ name: 'Swapped3';
15289
15315
  data: {
15290
15316
  swapper: AccountId32;
15291
15317
  filler: AccountId32;
@@ -17656,7 +17682,11 @@ export type PalletXykError =
17656
17682
  /**
17657
17683
  * Pool cannot be created due to outside factors.
17658
17684
  **/
17659
- | 'CannotCreatePool';
17685
+ | 'CannotCreatePool'
17686
+ /**
17687
+ * Slippage protection.
17688
+ **/
17689
+ | 'SlippageLimit';
17660
17690
 
17661
17691
  /**
17662
17692
  * The `Error` enum of this pallet.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dedot/chaintypes",
3
- "version": "0.101.0",
3
+ "version": "0.102.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": "aea5fdeae906d7f82b60fc7b7dded85b7a595821",
28
+ "gitHead": "27fb2c2baa10743f7d7782653f59cd99f4a81bc2",
29
29
  "module": "./index.js",
30
30
  "types": "./index.d.ts",
31
31
  "exports": {