@dedot/chaintypes 0.49.0 → 0.50.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.
- package/package.json +2 -2
- package/westend-asset-hub/consts.d.ts +25 -1
- package/westend-asset-hub/errors.d.ts +69 -0
- package/westend-asset-hub/events.d.ts +155 -85
- package/westend-asset-hub/index.d.ts +1 -1
- package/westend-asset-hub/query.d.ts +81 -8
- package/westend-asset-hub/runtime.d.ts +28 -17
- package/westend-asset-hub/tx.d.ts +275 -9
- package/westend-asset-hub/types.d.ts +465 -96
|
@@ -13,6 +13,7 @@ import type {
|
|
|
13
13
|
BytesLike,
|
|
14
14
|
AccountId32Like,
|
|
15
15
|
AccountId32,
|
|
16
|
+
U256,
|
|
16
17
|
H160,
|
|
17
18
|
FixedBytes,
|
|
18
19
|
} from 'dedot/codecs';
|
|
@@ -53,7 +54,9 @@ import type {
|
|
|
53
54
|
PalletRevivePrimitivesContractResult,
|
|
54
55
|
PalletRevivePrimitivesContractResultInstantiateReturnValue,
|
|
55
56
|
PalletRevivePrimitivesCode,
|
|
56
|
-
|
|
57
|
+
PalletRevivePrimitivesEthTransactInfo,
|
|
58
|
+
PalletRevivePrimitivesEthTransactError,
|
|
59
|
+
PalletReviveEvmApiRpcTypesGenGenericTransaction,
|
|
57
60
|
PalletRevivePrimitivesCodeUploadReturnValue,
|
|
58
61
|
PalletRevivePrimitivesContractAccessError,
|
|
59
62
|
} from './types';
|
|
@@ -91,7 +94,7 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
|
|
|
91
94
|
/**
|
|
92
95
|
* Whether it is legal to extend the chain, assuming the given block is the most
|
|
93
96
|
* recently included one as-of the relay parent that will be built against, and
|
|
94
|
-
* the given slot.
|
|
97
|
+
* the given relay chain slot.
|
|
95
98
|
*
|
|
96
99
|
* This should be consistent with the logic the runtime uses when validating blocks to
|
|
97
100
|
* avoid issues.
|
|
@@ -748,6 +751,24 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
|
|
|
748
751
|
**/
|
|
749
752
|
[method: string]: GenericRuntimeApiMethod<Rv>;
|
|
750
753
|
};
|
|
754
|
+
/**
|
|
755
|
+
* @runtimeapi: AssetRewards - 0x65f855d6e093c2f1
|
|
756
|
+
**/
|
|
757
|
+
assetRewards: {
|
|
758
|
+
/**
|
|
759
|
+
* Get the cost of creating a pool.
|
|
760
|
+
*
|
|
761
|
+
* This is especially useful when the cost is dynamic.
|
|
762
|
+
*
|
|
763
|
+
* @callname: AssetRewards_pool_creation_cost
|
|
764
|
+
**/
|
|
765
|
+
poolCreationCost: GenericRuntimeApiMethod<Rv, () => Promise<bigint>>;
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* Generic runtime api call
|
|
769
|
+
**/
|
|
770
|
+
[method: string]: GenericRuntimeApiMethod<Rv>;
|
|
771
|
+
};
|
|
751
772
|
/**
|
|
752
773
|
* @runtimeapi: GetCoreSelectorApi - 0x695c80446b8b3d4e
|
|
753
774
|
**/
|
|
@@ -876,12 +897,12 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
|
|
|
876
897
|
**/
|
|
877
898
|
reviveApi: {
|
|
878
899
|
/**
|
|
879
|
-
* Returns the free balance of the given `[H160]` address.
|
|
900
|
+
* Returns the free balance of the given `[H160]` address, using EVM decimals.
|
|
880
901
|
*
|
|
881
902
|
* @callname: ReviveApi_balance
|
|
882
903
|
* @param {H160} address
|
|
883
904
|
**/
|
|
884
|
-
balance: GenericRuntimeApiMethod<Rv, (address: H160) => Promise<
|
|
905
|
+
balance: GenericRuntimeApiMethod<Rv, (address: H160) => Promise<U256>>;
|
|
885
906
|
|
|
886
907
|
/**
|
|
887
908
|
* Returns the nonce of the given `[H160]` address.
|
|
@@ -949,23 +970,13 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
|
|
|
949
970
|
* See [`crate::Pallet::bare_eth_transact`]
|
|
950
971
|
*
|
|
951
972
|
* @callname: ReviveApi_eth_transact
|
|
952
|
-
* @param {
|
|
953
|
-
* @param {H160 | undefined} dest
|
|
954
|
-
* @param {bigint} value
|
|
955
|
-
* @param {BytesLike} input
|
|
956
|
-
* @param {SpWeightsWeightV2Weight | undefined} gas_limit
|
|
957
|
-
* @param {bigint | undefined} storage_deposit_limit
|
|
973
|
+
* @param {PalletReviveEvmApiRpcTypesGenGenericTransaction} tx
|
|
958
974
|
**/
|
|
959
975
|
ethTransact: GenericRuntimeApiMethod<
|
|
960
976
|
Rv,
|
|
961
977
|
(
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
value: bigint,
|
|
965
|
-
input: BytesLike,
|
|
966
|
-
gasLimit?: SpWeightsWeightV2Weight | undefined,
|
|
967
|
-
storageDepositLimit?: bigint | undefined,
|
|
968
|
-
) => Promise<PalletRevivePrimitivesEthContractResult>
|
|
978
|
+
tx: PalletReviveEvmApiRpcTypesGenGenericTransaction,
|
|
979
|
+
) => Promise<Result<PalletRevivePrimitivesEthTransactInfo, PalletRevivePrimitivesEthTransactError>>
|
|
969
980
|
>;
|
|
970
981
|
|
|
971
982
|
/**
|
|
@@ -43,6 +43,7 @@ import type {
|
|
|
43
43
|
PalletNftsPriceWithDirection,
|
|
44
44
|
PalletNftsPreSignedMint,
|
|
45
45
|
PalletNftsPreSignedAttributes,
|
|
46
|
+
FrameSupportScheduleDispatchTime,
|
|
46
47
|
PalletStateTrieMigrationMigrationLimits,
|
|
47
48
|
PalletStateTrieMigrationMigrationTask,
|
|
48
49
|
PalletStateTrieMigrationProgress,
|
|
@@ -9026,7 +9027,7 @@ export interface ChainTx<Rv extends RpcVersion> extends GenericChainTx<Rv, TxCal
|
|
|
9026
9027
|
*
|
|
9027
9028
|
* # Parameters
|
|
9028
9029
|
*
|
|
9029
|
-
* * `payload`: The
|
|
9030
|
+
* * `payload`: The encoded [`crate::evm::TransactionSigned`].
|
|
9030
9031
|
* * `gas_limit`: The gas limit enforced during contract execution.
|
|
9031
9032
|
* * `storage_deposit_limit`: The maximum balance that can be charged to the caller for
|
|
9032
9033
|
* storage usage.
|
|
@@ -9039,22 +9040,16 @@ export interface ChainTx<Rv extends RpcVersion> extends GenericChainTx<Rv, TxCal
|
|
|
9039
9040
|
* signer and validating the transaction.
|
|
9040
9041
|
*
|
|
9041
9042
|
* @param {BytesLike} payload
|
|
9042
|
-
* @param {SpWeightsWeightV2Weight} gasLimit
|
|
9043
|
-
* @param {bigint} storageDepositLimit
|
|
9044
9043
|
**/
|
|
9045
9044
|
ethTransact: GenericTxCall<
|
|
9046
9045
|
Rv,
|
|
9047
|
-
(
|
|
9048
|
-
payload: BytesLike,
|
|
9049
|
-
gasLimit: SpWeightsWeightV2Weight,
|
|
9050
|
-
storageDepositLimit: bigint,
|
|
9051
|
-
) => ChainSubmittableExtrinsic<
|
|
9046
|
+
(payload: BytesLike) => ChainSubmittableExtrinsic<
|
|
9052
9047
|
Rv,
|
|
9053
9048
|
{
|
|
9054
9049
|
pallet: 'Revive';
|
|
9055
9050
|
palletCall: {
|
|
9056
9051
|
name: 'EthTransact';
|
|
9057
|
-
params: { payload: BytesLike
|
|
9052
|
+
params: { payload: BytesLike };
|
|
9058
9053
|
};
|
|
9059
9054
|
}
|
|
9060
9055
|
>
|
|
@@ -9372,6 +9367,277 @@ export interface ChainTx<Rv extends RpcVersion> extends GenericChainTx<Rv, TxCal
|
|
|
9372
9367
|
**/
|
|
9373
9368
|
[callName: string]: GenericTxCall<Rv, TxCall<Rv>>;
|
|
9374
9369
|
};
|
|
9370
|
+
/**
|
|
9371
|
+
* Pallet `AssetRewards`'s transaction calls
|
|
9372
|
+
**/
|
|
9373
|
+
assetRewards: {
|
|
9374
|
+
/**
|
|
9375
|
+
* Create a new reward pool.
|
|
9376
|
+
*
|
|
9377
|
+
* Parameters:
|
|
9378
|
+
* - `origin`: must be `Config::CreatePoolOrigin`;
|
|
9379
|
+
* - `staked_asset_id`: the asset to be staked in the pool;
|
|
9380
|
+
* - `reward_asset_id`: the asset to be distributed as rewards;
|
|
9381
|
+
* - `reward_rate_per_block`: the amount of reward tokens distributed per block;
|
|
9382
|
+
* - `expiry`: the block number at which the pool will cease to accumulate rewards. The
|
|
9383
|
+
* [`DispatchTime::After`] variant evaluated at the execution time.
|
|
9384
|
+
* - `admin`: the account allowed to extend the pool expiration, increase the rewards rate
|
|
9385
|
+
* and receive the unutilized reward tokens back after the pool completion. If `None`,
|
|
9386
|
+
* the caller is set as an admin.
|
|
9387
|
+
*
|
|
9388
|
+
* @param {StagingXcmV5Location} stakedAssetId
|
|
9389
|
+
* @param {StagingXcmV5Location} rewardAssetId
|
|
9390
|
+
* @param {bigint} rewardRatePerBlock
|
|
9391
|
+
* @param {FrameSupportScheduleDispatchTime} expiry
|
|
9392
|
+
* @param {AccountId32Like | undefined} admin
|
|
9393
|
+
**/
|
|
9394
|
+
createPool: GenericTxCall<
|
|
9395
|
+
Rv,
|
|
9396
|
+
(
|
|
9397
|
+
stakedAssetId: StagingXcmV5Location,
|
|
9398
|
+
rewardAssetId: StagingXcmV5Location,
|
|
9399
|
+
rewardRatePerBlock: bigint,
|
|
9400
|
+
expiry: FrameSupportScheduleDispatchTime,
|
|
9401
|
+
admin: AccountId32Like | undefined,
|
|
9402
|
+
) => ChainSubmittableExtrinsic<
|
|
9403
|
+
Rv,
|
|
9404
|
+
{
|
|
9405
|
+
pallet: 'AssetRewards';
|
|
9406
|
+
palletCall: {
|
|
9407
|
+
name: 'CreatePool';
|
|
9408
|
+
params: {
|
|
9409
|
+
stakedAssetId: StagingXcmV5Location;
|
|
9410
|
+
rewardAssetId: StagingXcmV5Location;
|
|
9411
|
+
rewardRatePerBlock: bigint;
|
|
9412
|
+
expiry: FrameSupportScheduleDispatchTime;
|
|
9413
|
+
admin: AccountId32Like | undefined;
|
|
9414
|
+
};
|
|
9415
|
+
};
|
|
9416
|
+
}
|
|
9417
|
+
>
|
|
9418
|
+
>;
|
|
9419
|
+
|
|
9420
|
+
/**
|
|
9421
|
+
* Stake additional tokens in a pool.
|
|
9422
|
+
*
|
|
9423
|
+
* A freeze is placed on the staked tokens.
|
|
9424
|
+
*
|
|
9425
|
+
* @param {number} poolId
|
|
9426
|
+
* @param {bigint} amount
|
|
9427
|
+
**/
|
|
9428
|
+
stake: GenericTxCall<
|
|
9429
|
+
Rv,
|
|
9430
|
+
(
|
|
9431
|
+
poolId: number,
|
|
9432
|
+
amount: bigint,
|
|
9433
|
+
) => ChainSubmittableExtrinsic<
|
|
9434
|
+
Rv,
|
|
9435
|
+
{
|
|
9436
|
+
pallet: 'AssetRewards';
|
|
9437
|
+
palletCall: {
|
|
9438
|
+
name: 'Stake';
|
|
9439
|
+
params: { poolId: number; amount: bigint };
|
|
9440
|
+
};
|
|
9441
|
+
}
|
|
9442
|
+
>
|
|
9443
|
+
>;
|
|
9444
|
+
|
|
9445
|
+
/**
|
|
9446
|
+
* Unstake tokens from a pool.
|
|
9447
|
+
*
|
|
9448
|
+
* Removes the freeze on the staked tokens.
|
|
9449
|
+
*
|
|
9450
|
+
* Parameters:
|
|
9451
|
+
* - origin: must be the `staker` if the pool is still active. Otherwise, any account.
|
|
9452
|
+
* - pool_id: the pool to unstake from.
|
|
9453
|
+
* - amount: the amount of tokens to unstake.
|
|
9454
|
+
* - staker: the account to unstake from. If `None`, the caller is used.
|
|
9455
|
+
*
|
|
9456
|
+
* @param {number} poolId
|
|
9457
|
+
* @param {bigint} amount
|
|
9458
|
+
* @param {AccountId32Like | undefined} staker
|
|
9459
|
+
**/
|
|
9460
|
+
unstake: GenericTxCall<
|
|
9461
|
+
Rv,
|
|
9462
|
+
(
|
|
9463
|
+
poolId: number,
|
|
9464
|
+
amount: bigint,
|
|
9465
|
+
staker: AccountId32Like | undefined,
|
|
9466
|
+
) => ChainSubmittableExtrinsic<
|
|
9467
|
+
Rv,
|
|
9468
|
+
{
|
|
9469
|
+
pallet: 'AssetRewards';
|
|
9470
|
+
palletCall: {
|
|
9471
|
+
name: 'Unstake';
|
|
9472
|
+
params: { poolId: number; amount: bigint; staker: AccountId32Like | undefined };
|
|
9473
|
+
};
|
|
9474
|
+
}
|
|
9475
|
+
>
|
|
9476
|
+
>;
|
|
9477
|
+
|
|
9478
|
+
/**
|
|
9479
|
+
* Harvest unclaimed pool rewards.
|
|
9480
|
+
*
|
|
9481
|
+
* Parameters:
|
|
9482
|
+
* - origin: must be the `staker` if the pool is still active. Otherwise, any account.
|
|
9483
|
+
* - pool_id: the pool to harvest from.
|
|
9484
|
+
* - staker: the account for which to harvest rewards. If `None`, the caller is used.
|
|
9485
|
+
*
|
|
9486
|
+
* @param {number} poolId
|
|
9487
|
+
* @param {AccountId32Like | undefined} staker
|
|
9488
|
+
**/
|
|
9489
|
+
harvestRewards: GenericTxCall<
|
|
9490
|
+
Rv,
|
|
9491
|
+
(
|
|
9492
|
+
poolId: number,
|
|
9493
|
+
staker: AccountId32Like | undefined,
|
|
9494
|
+
) => ChainSubmittableExtrinsic<
|
|
9495
|
+
Rv,
|
|
9496
|
+
{
|
|
9497
|
+
pallet: 'AssetRewards';
|
|
9498
|
+
palletCall: {
|
|
9499
|
+
name: 'HarvestRewards';
|
|
9500
|
+
params: { poolId: number; staker: AccountId32Like | undefined };
|
|
9501
|
+
};
|
|
9502
|
+
}
|
|
9503
|
+
>
|
|
9504
|
+
>;
|
|
9505
|
+
|
|
9506
|
+
/**
|
|
9507
|
+
* Modify a pool reward rate.
|
|
9508
|
+
*
|
|
9509
|
+
* Currently the reward rate can only be increased.
|
|
9510
|
+
*
|
|
9511
|
+
* Only the pool admin may perform this operation.
|
|
9512
|
+
*
|
|
9513
|
+
* @param {number} poolId
|
|
9514
|
+
* @param {bigint} newRewardRatePerBlock
|
|
9515
|
+
**/
|
|
9516
|
+
setPoolRewardRatePerBlock: GenericTxCall<
|
|
9517
|
+
Rv,
|
|
9518
|
+
(
|
|
9519
|
+
poolId: number,
|
|
9520
|
+
newRewardRatePerBlock: bigint,
|
|
9521
|
+
) => ChainSubmittableExtrinsic<
|
|
9522
|
+
Rv,
|
|
9523
|
+
{
|
|
9524
|
+
pallet: 'AssetRewards';
|
|
9525
|
+
palletCall: {
|
|
9526
|
+
name: 'SetPoolRewardRatePerBlock';
|
|
9527
|
+
params: { poolId: number; newRewardRatePerBlock: bigint };
|
|
9528
|
+
};
|
|
9529
|
+
}
|
|
9530
|
+
>
|
|
9531
|
+
>;
|
|
9532
|
+
|
|
9533
|
+
/**
|
|
9534
|
+
* Modify a pool admin.
|
|
9535
|
+
*
|
|
9536
|
+
* Only the pool admin may perform this operation.
|
|
9537
|
+
*
|
|
9538
|
+
* @param {number} poolId
|
|
9539
|
+
* @param {AccountId32Like} newAdmin
|
|
9540
|
+
**/
|
|
9541
|
+
setPoolAdmin: GenericTxCall<
|
|
9542
|
+
Rv,
|
|
9543
|
+
(
|
|
9544
|
+
poolId: number,
|
|
9545
|
+
newAdmin: AccountId32Like,
|
|
9546
|
+
) => ChainSubmittableExtrinsic<
|
|
9547
|
+
Rv,
|
|
9548
|
+
{
|
|
9549
|
+
pallet: 'AssetRewards';
|
|
9550
|
+
palletCall: {
|
|
9551
|
+
name: 'SetPoolAdmin';
|
|
9552
|
+
params: { poolId: number; newAdmin: AccountId32Like };
|
|
9553
|
+
};
|
|
9554
|
+
}
|
|
9555
|
+
>
|
|
9556
|
+
>;
|
|
9557
|
+
|
|
9558
|
+
/**
|
|
9559
|
+
* Set when the pool should expire.
|
|
9560
|
+
*
|
|
9561
|
+
* Currently the expiry block can only be extended.
|
|
9562
|
+
*
|
|
9563
|
+
* Only the pool admin may perform this operation.
|
|
9564
|
+
*
|
|
9565
|
+
* @param {number} poolId
|
|
9566
|
+
* @param {FrameSupportScheduleDispatchTime} newExpiry
|
|
9567
|
+
**/
|
|
9568
|
+
setPoolExpiryBlock: GenericTxCall<
|
|
9569
|
+
Rv,
|
|
9570
|
+
(
|
|
9571
|
+
poolId: number,
|
|
9572
|
+
newExpiry: FrameSupportScheduleDispatchTime,
|
|
9573
|
+
) => ChainSubmittableExtrinsic<
|
|
9574
|
+
Rv,
|
|
9575
|
+
{
|
|
9576
|
+
pallet: 'AssetRewards';
|
|
9577
|
+
palletCall: {
|
|
9578
|
+
name: 'SetPoolExpiryBlock';
|
|
9579
|
+
params: { poolId: number; newExpiry: FrameSupportScheduleDispatchTime };
|
|
9580
|
+
};
|
|
9581
|
+
}
|
|
9582
|
+
>
|
|
9583
|
+
>;
|
|
9584
|
+
|
|
9585
|
+
/**
|
|
9586
|
+
* Convenience method to deposit reward tokens into a pool.
|
|
9587
|
+
*
|
|
9588
|
+
* This method is not strictly necessary (tokens could be transferred directly to the
|
|
9589
|
+
* pool pot address), but is provided for convenience so manual derivation of the
|
|
9590
|
+
* account id is not required.
|
|
9591
|
+
*
|
|
9592
|
+
* @param {number} poolId
|
|
9593
|
+
* @param {bigint} amount
|
|
9594
|
+
**/
|
|
9595
|
+
depositRewardTokens: GenericTxCall<
|
|
9596
|
+
Rv,
|
|
9597
|
+
(
|
|
9598
|
+
poolId: number,
|
|
9599
|
+
amount: bigint,
|
|
9600
|
+
) => ChainSubmittableExtrinsic<
|
|
9601
|
+
Rv,
|
|
9602
|
+
{
|
|
9603
|
+
pallet: 'AssetRewards';
|
|
9604
|
+
palletCall: {
|
|
9605
|
+
name: 'DepositRewardTokens';
|
|
9606
|
+
params: { poolId: number; amount: bigint };
|
|
9607
|
+
};
|
|
9608
|
+
}
|
|
9609
|
+
>
|
|
9610
|
+
>;
|
|
9611
|
+
|
|
9612
|
+
/**
|
|
9613
|
+
* Cleanup a pool.
|
|
9614
|
+
*
|
|
9615
|
+
* Origin must be the pool admin.
|
|
9616
|
+
*
|
|
9617
|
+
* Cleanup storage, release any associated storage cost and return the remaining reward
|
|
9618
|
+
* tokens to the admin.
|
|
9619
|
+
*
|
|
9620
|
+
* @param {number} poolId
|
|
9621
|
+
**/
|
|
9622
|
+
cleanupPool: GenericTxCall<
|
|
9623
|
+
Rv,
|
|
9624
|
+
(poolId: number) => ChainSubmittableExtrinsic<
|
|
9625
|
+
Rv,
|
|
9626
|
+
{
|
|
9627
|
+
pallet: 'AssetRewards';
|
|
9628
|
+
palletCall: {
|
|
9629
|
+
name: 'CleanupPool';
|
|
9630
|
+
params: { poolId: number };
|
|
9631
|
+
};
|
|
9632
|
+
}
|
|
9633
|
+
>
|
|
9634
|
+
>;
|
|
9635
|
+
|
|
9636
|
+
/**
|
|
9637
|
+
* Generic pallet tx call
|
|
9638
|
+
**/
|
|
9639
|
+
[callName: string]: GenericTxCall<Rv, TxCall<Rv>>;
|
|
9640
|
+
};
|
|
9375
9641
|
/**
|
|
9376
9642
|
* Pallet `StateTrieMigration`'s transaction calls
|
|
9377
9643
|
**/
|