@dedot/api 0.6.1 → 0.7.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,6 +1,6 @@
1
- import type { AccountId32, AccountId32Like, Bytes, BytesLike, DispatchError, H256, Header, Result, RuntimeVersion, UncheckedExtrinsic, UncheckedExtrinsicLike } from '@dedot/codecs';
1
+ import type { AccountId32, AccountId32Like, Bytes, BytesLike, DispatchError, FixedBytes, H160, H256, Header, Result, RuntimeVersion, UncheckedExtrinsic, UncheckedExtrinsicLike } from '@dedot/codecs';
2
2
  import type { GenericRuntimeApiMethod, GenericRuntimeApis, RpcVersion } from '@dedot/types';
3
- import type { FrameSupportTokensFungibleUnionOfNativeOrWithId, KitchensinkRuntimeRuntimeCallLike, PalletContractsPrimitivesCode, PalletContractsPrimitivesCodeUploadReturnValue, PalletContractsPrimitivesContractAccessError, PalletContractsPrimitivesContractResult, PalletContractsPrimitivesContractResultResult, PalletContractsWasmDeterminism, PalletTransactionPaymentFeeDetails, PalletTransactionPaymentRuntimeDispatchInfo, SpAuthorityDiscoveryAppPublic, SpConsensusBabeAppPublic, SpConsensusBabeBabeConfiguration, SpConsensusBabeEpoch, SpConsensusBabeOpaqueKeyOwnershipProof, SpConsensusBeefyEcdsaCryptoPublic, SpConsensusBeefyEquivocationProof, SpConsensusBeefyOpaqueKeyOwnershipProof, SpConsensusBeefyValidatorSet, SpConsensusGrandpaAppPublic, SpConsensusGrandpaEquivocationProof, SpConsensusGrandpaOpaqueKeyOwnershipProof, SpConsensusSlotsEquivocationProof, SpConsensusSlotsSlot, SpCoreCryptoKeyTypeId, SpCoreOpaqueMetadata, SpInherentsCheckInherentsResult, SpInherentsInherentData, SpMixnetMixnode, SpMixnetMixnodesErr, SpMixnetSessionStatus, SpMmrPrimitivesEncodableOpaqueLeaf, SpMmrPrimitivesError, SpMmrPrimitivesProof, SpRuntimeBlock, SpRuntimeExtrinsicInclusionMode, SpRuntimeTransactionValidityTransactionSource, SpRuntimeTransactionValidityTransactionValidityError, SpRuntimeTransactionValidityValidTransaction, SpStatementStoreRuntimeApiInvalidStatement, SpStatementStoreRuntimeApiStatementSource, SpStatementStoreRuntimeApiValidStatement, SpStatementStoreStatement, SpWeightsWeightV2Weight } from './types.js';
3
+ import type { FrameSupportTokensFungibleUnionOfNativeOrWithId, KitchensinkRuntimeRuntimeCallLike, PalletContractsPrimitivesCode, PalletContractsPrimitivesCodeUploadReturnValue, PalletContractsPrimitivesContractAccessError, PalletContractsPrimitivesContractResult, PalletContractsPrimitivesContractResultResult, PalletContractsWasmDeterminism, PalletRevivePrimitivesCode, PalletRevivePrimitivesCodeUploadReturnValue, PalletRevivePrimitivesContractAccessError, PalletRevivePrimitivesContractResult, PalletRevivePrimitivesContractResultInstantiateReturnValue, PalletRevivePrimitivesEthContractResult, PalletTransactionPaymentFeeDetails, PalletTransactionPaymentRuntimeDispatchInfo, SpAuthorityDiscoveryAppPublic, SpConsensusBabeAppPublic, SpConsensusBabeBabeConfiguration, SpConsensusBabeEpoch, SpConsensusBabeOpaqueKeyOwnershipProof, SpConsensusBeefyDoubleVotingProof, SpConsensusBeefyEcdsaCryptoPublic, SpConsensusBeefyForkVotingProofOpaqueValue, SpConsensusBeefyFutureBlockVotingProof, SpConsensusBeefyValidatorSet, SpConsensusGrandpaAppPublic, SpConsensusGrandpaEquivocationProof, SpConsensusSlotsEquivocationProof, SpConsensusSlotsSlot, SpCoreCryptoKeyTypeId, SpCoreOpaqueMetadata, SpInherentsCheckInherentsResult, SpInherentsInherentData, SpMixnetMixnode, SpMixnetMixnodesErr, SpMixnetSessionStatus, SpMmrPrimitivesEncodableOpaqueLeaf, SpMmrPrimitivesError, SpMmrPrimitivesLeafProof, SpRuntimeBlock, SpRuntimeExtrinsicInclusionMode, SpRuntimeOpaqueValue, SpRuntimeTransactionValidityTransactionSource, SpRuntimeTransactionValidityTransactionValidityError, SpRuntimeTransactionValidityValidTransaction, SpStatementStoreRuntimeApiInvalidStatement, SpStatementStoreRuntimeApiStatementSource, SpStatementStoreRuntimeApiValidStatement, SpStatementStoreStatement, SpWeightsWeightV2Weight } from './types.js';
4
4
  export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<Rv> {
5
5
  /**
6
6
  * @runtimeapi: Core - 0xdf6acb689907609b
@@ -190,9 +190,9 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
190
190
  *
191
191
  * @callname: GrandpaApi_submit_report_equivocation_unsigned_extrinsic
192
192
  * @param {SpConsensusGrandpaEquivocationProof} equivocation_proof
193
- * @param {SpConsensusGrandpaOpaqueKeyOwnershipProof} key_owner_proof
193
+ * @param {SpRuntimeOpaqueValue} key_owner_proof
194
194
  **/
195
- submitReportEquivocationUnsignedExtrinsic: GenericRuntimeApiMethod<Rv, (equivocationProof: SpConsensusGrandpaEquivocationProof, keyOwnerProof: SpConsensusGrandpaOpaqueKeyOwnershipProof) => Promise<[] | undefined>>;
195
+ submitReportEquivocationUnsignedExtrinsic: GenericRuntimeApiMethod<Rv, (equivocationProof: SpConsensusGrandpaEquivocationProof, keyOwnerProof: SpRuntimeOpaqueValue) => Promise<[] | undefined>>;
196
196
  /**
197
197
  * Generates a proof of key ownership for the given authority in the
198
198
  * given set. An example usage of this module is coupled with the
@@ -210,7 +210,7 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
210
210
  * @param {bigint} set_id
211
211
  * @param {SpConsensusGrandpaAppPublic} authority_id
212
212
  **/
213
- generateKeyOwnershipProof: GenericRuntimeApiMethod<Rv, (setId: bigint, authorityId: SpConsensusGrandpaAppPublic) => Promise<SpConsensusGrandpaOpaqueKeyOwnershipProof | undefined>>;
213
+ generateKeyOwnershipProof: GenericRuntimeApiMethod<Rv, (setId: bigint, authorityId: SpConsensusGrandpaAppPublic) => Promise<SpRuntimeOpaqueValue | undefined>>;
214
214
  /**
215
215
  * Get current GRANDPA authority set id.
216
216
  *
@@ -249,6 +249,68 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
249
249
  * @param {bigint} new_funds
250
250
  **/
251
251
  balanceToPoints: GenericRuntimeApiMethod<Rv, (poolId: number, newFunds: bigint) => Promise<bigint>>;
252
+ /**
253
+ * Returns the pending slash for a given pool.
254
+ *
255
+ * @callname: NominationPoolsApi_pool_pending_slash
256
+ * @param {number} pool_id
257
+ **/
258
+ poolPendingSlash: GenericRuntimeApiMethod<Rv, (poolId: number) => Promise<bigint>>;
259
+ /**
260
+ * Returns the pending slash for a given pool member.
261
+ *
262
+ * @callname: NominationPoolsApi_member_pending_slash
263
+ * @param {AccountId32Like} member
264
+ **/
265
+ memberPendingSlash: GenericRuntimeApiMethod<Rv, (member: AccountId32Like) => Promise<bigint>>;
266
+ /**
267
+ * Returns true if the pool with `pool_id` needs migration.
268
+ *
269
+ * This can happen when the `pallet-nomination-pools` has switched to using strategy
270
+ * [`DelegateStake`](pallet_nomination_pools::adapter::DelegateStake) but the pool
271
+ * still has funds that were staked using the older strategy
272
+ * [TransferStake](pallet_nomination_pools::adapter::TransferStake). Use
273
+ * [`migrate_pool_to_delegate_stake`](pallet_nomination_pools::Call::migrate_pool_to_delegate_stake)
274
+ * to migrate the pool.
275
+ *
276
+ * @callname: NominationPoolsApi_pool_needs_delegate_migration
277
+ * @param {number} pool_id
278
+ **/
279
+ poolNeedsDelegateMigration: GenericRuntimeApiMethod<Rv, (poolId: number) => Promise<boolean>>;
280
+ /**
281
+ * Returns true if the delegated funds of the pool `member` needs migration.
282
+ *
283
+ * Once a pool has successfully migrated to the strategy
284
+ * [`DelegateStake`](pallet_nomination_pools::adapter::DelegateStake), the funds of the
285
+ * member can be migrated from pool account to the member's account. Use
286
+ * [`migrate_delegation`](pallet_nomination_pools::Call::migrate_delegation)
287
+ * to migrate the funds of the pool member.
288
+ *
289
+ * @callname: NominationPoolsApi_member_needs_delegate_migration
290
+ * @param {AccountId32Like} member
291
+ **/
292
+ memberNeedsDelegateMigration: GenericRuntimeApiMethod<Rv, (member: AccountId32Like) => Promise<boolean>>;
293
+ /**
294
+ * Returns the total contribution of a pool member including any balance that is unbonding.
295
+ *
296
+ * @callname: NominationPoolsApi_member_total_balance
297
+ * @param {AccountId32Like} who
298
+ **/
299
+ memberTotalBalance: GenericRuntimeApiMethod<Rv, (who: AccountId32Like) => Promise<bigint>>;
300
+ /**
301
+ * Total balance contributed to the pool.
302
+ *
303
+ * @callname: NominationPoolsApi_pool_balance
304
+ * @param {number} pool_id
305
+ **/
306
+ poolBalance: GenericRuntimeApiMethod<Rv, (poolId: number) => Promise<bigint>>;
307
+ /**
308
+ * Returns the bonded account and reward account associated with the pool_id.
309
+ *
310
+ * @callname: NominationPoolsApi_pool_accounts
311
+ * @param {number} pool_id
312
+ **/
313
+ poolAccounts: GenericRuntimeApiMethod<Rv, (poolId: number) => Promise<[AccountId32, AccountId32]>>;
252
314
  /**
253
315
  * Generic runtime api call
254
316
  **/
@@ -266,13 +328,21 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
266
328
  **/
267
329
  nominationsQuota: GenericRuntimeApiMethod<Rv, (balance: bigint) => Promise<number>>;
268
330
  /**
269
- * Returns the page count of exposures for a validator in a given era.
331
+ * Returns the page count of exposures for a validator `account` in a given era.
270
332
  *
271
333
  * @callname: StakingApi_eras_stakers_page_count
272
334
  * @param {number} era
273
335
  * @param {AccountId32Like} account
274
336
  **/
275
337
  erasStakersPageCount: GenericRuntimeApiMethod<Rv, (era: number, account: AccountId32Like) => Promise<number>>;
338
+ /**
339
+ * Returns true if validator `account` has pages to be claimed for the given era.
340
+ *
341
+ * @callname: StakingApi_pending_rewards
342
+ * @param {number} era
343
+ * @param {AccountId32Like} account
344
+ **/
345
+ pendingRewards: GenericRuntimeApiMethod<Rv, (era: number, account: AccountId32Like) => Promise<boolean>>;
276
346
  /**
277
347
  * Generic runtime api call
278
348
  **/
@@ -454,6 +524,95 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
454
524
  **/
455
525
  [method: string]: GenericRuntimeApiMethod<Rv>;
456
526
  };
527
+ /**
528
+ * @runtimeapi: ReviveApi - 0x8c403e5c4a9fd442
529
+ **/
530
+ reviveApi: {
531
+ /**
532
+ * Returns the free balance of the given `[H160]` address.
533
+ *
534
+ * @callname: ReviveApi_balance
535
+ * @param {H160} address
536
+ **/
537
+ balance: GenericRuntimeApiMethod<Rv, (address: H160) => Promise<bigint>>;
538
+ /**
539
+ * Returns the nonce of the given `[H160]` address.
540
+ *
541
+ * @callname: ReviveApi_nonce
542
+ * @param {H160} address
543
+ **/
544
+ nonce: GenericRuntimeApiMethod<Rv, (address: H160) => Promise<number>>;
545
+ /**
546
+ * Perform a call from a specified account to a given contract.
547
+ *
548
+ * See [`crate::Pallet::bare_call`].
549
+ *
550
+ * @callname: ReviveApi_call
551
+ * @param {AccountId32Like} origin
552
+ * @param {H160} dest
553
+ * @param {bigint} value
554
+ * @param {SpWeightsWeightV2Weight | undefined} gas_limit
555
+ * @param {bigint | undefined} storage_deposit_limit
556
+ * @param {BytesLike} input_data
557
+ **/
558
+ call: GenericRuntimeApiMethod<Rv, (origin: AccountId32Like, dest: H160, value: bigint, gasLimit: SpWeightsWeightV2Weight | undefined, storageDepositLimit: bigint | undefined, inputData: BytesLike) => Promise<PalletRevivePrimitivesContractResult>>;
559
+ /**
560
+ * Instantiate a new contract.
561
+ *
562
+ * See `[crate::Pallet::bare_instantiate]`.
563
+ *
564
+ * @callname: ReviveApi_instantiate
565
+ * @param {AccountId32Like} origin
566
+ * @param {bigint} value
567
+ * @param {SpWeightsWeightV2Weight | undefined} gas_limit
568
+ * @param {bigint | undefined} storage_deposit_limit
569
+ * @param {PalletRevivePrimitivesCode} code
570
+ * @param {BytesLike} data
571
+ * @param {FixedBytes<32> | undefined} salt
572
+ **/
573
+ instantiate: GenericRuntimeApiMethod<Rv, (origin: AccountId32Like, value: bigint, gasLimit: SpWeightsWeightV2Weight | undefined, storageDepositLimit: bigint | undefined, code: PalletRevivePrimitivesCode, data: BytesLike, salt?: FixedBytes<32> | undefined) => Promise<PalletRevivePrimitivesContractResultInstantiateReturnValue>>;
574
+ /**
575
+ * Perform an Ethereum call.
576
+ *
577
+ * See [`crate::Pallet::bare_eth_transact`]
578
+ *
579
+ * @callname: ReviveApi_eth_transact
580
+ * @param {H160} origin
581
+ * @param {H160 | undefined} dest
582
+ * @param {bigint} value
583
+ * @param {BytesLike} input
584
+ * @param {SpWeightsWeightV2Weight | undefined} gas_limit
585
+ * @param {bigint | undefined} storage_deposit_limit
586
+ **/
587
+ ethTransact: GenericRuntimeApiMethod<Rv, (origin: H160, dest: H160 | undefined, value: bigint, input: BytesLike, gasLimit?: SpWeightsWeightV2Weight | undefined, storageDepositLimit?: bigint | undefined) => Promise<PalletRevivePrimitivesEthContractResult>>;
588
+ /**
589
+ * Upload new code without instantiating a contract from it.
590
+ *
591
+ * See [`crate::Pallet::bare_upload_code`].
592
+ *
593
+ * @callname: ReviveApi_upload_code
594
+ * @param {AccountId32Like} origin
595
+ * @param {BytesLike} code
596
+ * @param {bigint | undefined} storage_deposit_limit
597
+ **/
598
+ uploadCode: GenericRuntimeApiMethod<Rv, (origin: AccountId32Like, code: BytesLike, storageDepositLimit?: bigint | undefined) => Promise<Result<PalletRevivePrimitivesCodeUploadReturnValue, DispatchError>>>;
599
+ /**
600
+ * Query a given storage key in a given contract.
601
+ *
602
+ * Returns `Ok(Some(Vec<u8>))` if the storage value exists under the given key in the
603
+ * specified account and `Ok(None)` if it doesn't. If the account specified by the address
604
+ * doesn't exist, or doesn't have a contract then `Err` is returned.
605
+ *
606
+ * @callname: ReviveApi_get_storage
607
+ * @param {H160} address
608
+ * @param {FixedBytes<32>} key
609
+ **/
610
+ getStorage: GenericRuntimeApiMethod<Rv, (address: H160, key: FixedBytes<32>) => Promise<Result<Bytes | undefined, PalletRevivePrimitivesContractAccessError>>>;
611
+ /**
612
+ * Generic runtime api call
613
+ **/
614
+ [method: string]: GenericRuntimeApiMethod<Rv>;
615
+ };
457
616
  /**
458
617
  * @runtimeapi: TransactionPaymentApi - 0x37c8bb1350a9a2a8
459
618
  **/
@@ -642,8 +801,8 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
642
801
  **/
643
802
  validatorSet: GenericRuntimeApiMethod<Rv, () => Promise<SpConsensusBeefyValidatorSet | undefined>>;
644
803
  /**
645
- * Submits an unsigned extrinsic to report an equivocation. The caller
646
- * must provide the equivocation proof and a key ownership proof
804
+ * Submits an unsigned extrinsic to report a double voting equivocation. The caller
805
+ * must provide the double voting proof and a key ownership proof
647
806
  * (should be obtained using `generate_key_ownership_proof`). The
648
807
  * extrinsic will be unsigned and should only be accepted for local
649
808
  * authorship (not to be broadcast to the network). This method returns
@@ -651,11 +810,41 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
651
810
  * reporting is disabled for the given runtime (i.e. this method is
652
811
  * hardcoded to return `None`). Only useful in an offchain context.
653
812
  *
654
- * @callname: BeefyApi_submit_report_equivocation_unsigned_extrinsic
655
- * @param {SpConsensusBeefyEquivocationProof} equivocation_proof
656
- * @param {SpConsensusBeefyOpaqueKeyOwnershipProof} key_owner_proof
813
+ * @callname: BeefyApi_submit_report_double_voting_unsigned_extrinsic
814
+ * @param {SpConsensusBeefyDoubleVotingProof} equivocation_proof
815
+ * @param {SpRuntimeOpaqueValue} key_owner_proof
657
816
  **/
658
- submitReportEquivocationUnsignedExtrinsic: GenericRuntimeApiMethod<Rv, (equivocationProof: SpConsensusBeefyEquivocationProof, keyOwnerProof: SpConsensusBeefyOpaqueKeyOwnershipProof) => Promise<[] | undefined>>;
817
+ submitReportDoubleVotingUnsignedExtrinsic: GenericRuntimeApiMethod<Rv, (equivocationProof: SpConsensusBeefyDoubleVotingProof, keyOwnerProof: SpRuntimeOpaqueValue) => Promise<[] | undefined>>;
818
+ /**
819
+ * Submits an unsigned extrinsic to report a fork voting equivocation. The caller
820
+ * must provide the fork voting proof (the ancestry proof should be obtained using
821
+ * `generate_ancestry_proof`) and a key ownership proof (should be obtained using
822
+ * `generate_key_ownership_proof`). The extrinsic will be unsigned and should only
823
+ * be accepted for local authorship (not to be broadcast to the network). This method
824
+ * returns `None` when creation of the extrinsic fails, e.g. if equivocation
825
+ * reporting is disabled for the given runtime (i.e. this method is
826
+ * hardcoded to return `None`). Only useful in an offchain context.
827
+ *
828
+ * @callname: BeefyApi_submit_report_fork_voting_unsigned_extrinsic
829
+ * @param {SpConsensusBeefyForkVotingProofOpaqueValue} equivocation_proof
830
+ * @param {SpRuntimeOpaqueValue} key_owner_proof
831
+ **/
832
+ submitReportForkVotingUnsignedExtrinsic: GenericRuntimeApiMethod<Rv, (equivocationProof: SpConsensusBeefyForkVotingProofOpaqueValue, keyOwnerProof: SpRuntimeOpaqueValue) => Promise<[] | undefined>>;
833
+ /**
834
+ * Submits an unsigned extrinsic to report a future block voting equivocation. The caller
835
+ * must provide the future block voting proof and a key ownership proof
836
+ * (should be obtained using `generate_key_ownership_proof`).
837
+ * The extrinsic will be unsigned and should only be accepted for local
838
+ * authorship (not to be broadcast to the network). This method returns
839
+ * `None` when creation of the extrinsic fails, e.g. if equivocation
840
+ * reporting is disabled for the given runtime (i.e. this method is
841
+ * hardcoded to return `None`). Only useful in an offchain context.
842
+ *
843
+ * @callname: BeefyApi_submit_report_future_block_voting_unsigned_extrinsic
844
+ * @param {SpConsensusBeefyFutureBlockVotingProof} equivocation_proof
845
+ * @param {SpRuntimeOpaqueValue} key_owner_proof
846
+ **/
847
+ submitReportFutureBlockVotingUnsignedExtrinsic: GenericRuntimeApiMethod<Rv, (equivocationProof: SpConsensusBeefyFutureBlockVotingProof, keyOwnerProof: SpRuntimeOpaqueValue) => Promise<[] | undefined>>;
659
848
  /**
660
849
  * Generates a proof of key ownership for the given authority in the
661
850
  * given set. An example usage of this module is coupled with the
@@ -673,7 +862,16 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
673
862
  * @param {bigint} set_id
674
863
  * @param {SpConsensusBeefyEcdsaCryptoPublic} authority_id
675
864
  **/
676
- generateKeyOwnershipProof: GenericRuntimeApiMethod<Rv, (setId: bigint, authorityId: SpConsensusBeefyEcdsaCryptoPublic) => Promise<SpConsensusBeefyOpaqueKeyOwnershipProof | undefined>>;
865
+ generateKeyOwnershipProof: GenericRuntimeApiMethod<Rv, (setId: bigint, authorityId: SpConsensusBeefyEcdsaCryptoPublic) => Promise<SpRuntimeOpaqueValue | undefined>>;
866
+ /**
867
+ * Generates a proof that the `prev_block_number` is part of the canonical chain at
868
+ * `best_known_block_number`.
869
+ *
870
+ * @callname: BeefyApi_generate_ancestry_proof
871
+ * @param {number} prev_block_number
872
+ * @param {number | undefined} best_known_block_number
873
+ **/
874
+ generateAncestryProof: GenericRuntimeApiMethod<Rv, (prevBlockNumber: number, bestKnownBlockNumber?: number | undefined) => Promise<SpRuntimeOpaqueValue | undefined>>;
677
875
  /**
678
876
  * Generic runtime api call
679
877
  **/
@@ -703,19 +901,19 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
703
901
  * @param {Array<number>} block_numbers
704
902
  * @param {number | undefined} best_known_block_number
705
903
  **/
706
- generateProof: GenericRuntimeApiMethod<Rv, (blockNumbers: Array<number>, bestKnownBlockNumber?: number | undefined) => Promise<Result<[Array<SpMmrPrimitivesEncodableOpaqueLeaf>, SpMmrPrimitivesProof], SpMmrPrimitivesError>>>;
904
+ generateProof: GenericRuntimeApiMethod<Rv, (blockNumbers: Array<number>, bestKnownBlockNumber?: number | undefined) => Promise<Result<[Array<SpMmrPrimitivesEncodableOpaqueLeaf>, SpMmrPrimitivesLeafProof], SpMmrPrimitivesError>>>;
707
905
  /**
708
906
  * Verify MMR proof against on-chain MMR for a batch of leaves.
709
907
  *
710
908
  * Note this function will use on-chain MMR root hash and check if the proof matches the hash.
711
909
  * Note, the leaves should be sorted such that corresponding leaves and leaf indices have the
712
- * same position in both the `leaves` vector and the `leaf_indices` vector contained in the [Proof]
910
+ * same position in both the `leaves` vector and the `leaf_indices` vector contained in the [LeafProof]
713
911
  *
714
912
  * @callname: MmrApi_verify_proof
715
913
  * @param {Array<SpMmrPrimitivesEncodableOpaqueLeaf>} leaves
716
- * @param {SpMmrPrimitivesProof} proof
914
+ * @param {SpMmrPrimitivesLeafProof} proof
717
915
  **/
718
- verifyProof: GenericRuntimeApiMethod<Rv, (leaves: Array<SpMmrPrimitivesEncodableOpaqueLeaf>, proof: SpMmrPrimitivesProof) => Promise<Result<[], SpMmrPrimitivesError>>>;
916
+ verifyProof: GenericRuntimeApiMethod<Rv, (leaves: Array<SpMmrPrimitivesEncodableOpaqueLeaf>, proof: SpMmrPrimitivesLeafProof) => Promise<Result<[], SpMmrPrimitivesError>>>;
719
917
  /**
720
918
  * Verify MMR proof against given root hash for a batch of leaves.
721
919
  *
@@ -723,14 +921,14 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
723
921
  * proof is verified against given MMR root hash.
724
922
  *
725
923
  * Note, the leaves should be sorted such that corresponding leaves and leaf indices have the
726
- * same position in both the `leaves` vector and the `leaf_indices` vector contained in the [Proof]
924
+ * same position in both the `leaves` vector and the `leaf_indices` vector contained in the [LeafProof]
727
925
  *
728
926
  * @callname: MmrApi_verify_proof_stateless
729
927
  * @param {H256} root
730
928
  * @param {Array<SpMmrPrimitivesEncodableOpaqueLeaf>} leaves
731
- * @param {SpMmrPrimitivesProof} proof
929
+ * @param {SpMmrPrimitivesLeafProof} proof
732
930
  **/
733
- verifyProofStateless: GenericRuntimeApiMethod<Rv, (root: H256, leaves: Array<SpMmrPrimitivesEncodableOpaqueLeaf>, proof: SpMmrPrimitivesProof) => Promise<Result<[], SpMmrPrimitivesError>>>;
931
+ verifyProofStateless: GenericRuntimeApiMethod<Rv, (root: H256, leaves: Array<SpMmrPrimitivesEncodableOpaqueLeaf>, proof: SpMmrPrimitivesLeafProof) => Promise<Result<[], SpMmrPrimitivesError>>>;
734
932
  /**
735
933
  * Generic runtime api call
736
934
  **/
@@ -821,27 +1019,50 @@ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<R
821
1019
  **/
822
1020
  genesisBuilder: {
823
1021
  /**
824
- * Creates the default `RuntimeGenesisConfig` and returns it as a JSON blob.
1022
+ * Build `RuntimeGenesisConfig` from a JSON blob not using any defaults and store it in the
1023
+ * storage.
825
1024
  *
826
- * This function instantiates the default `RuntimeGenesisConfig` struct for the runtime and serializes it into a JSON
827
- * blob. It returns a `Vec<u8>` containing the JSON representation of the default `RuntimeGenesisConfig`.
1025
+ * In the case of a FRAME-based runtime, this function deserializes the full
1026
+ * `RuntimeGenesisConfig` from the given JSON blob and puts it into the storage. If the
1027
+ * provided JSON blob is incorrect or incomplete or the deserialization fails, an error
1028
+ * is returned.
828
1029
  *
829
- * @callname: GenesisBuilder_create_default_config
1030
+ * Please note that provided JSON blob must contain all `RuntimeGenesisConfig` fields, no
1031
+ * defaults will be used.
1032
+ *
1033
+ * @callname: GenesisBuilder_build_state
1034
+ * @param {BytesLike} json
830
1035
  **/
831
- createDefaultConfig: GenericRuntimeApiMethod<Rv, () => Promise<Bytes>>;
1036
+ buildState: GenericRuntimeApiMethod<Rv, (json: BytesLike) => Promise<Result<[], string>>>;
832
1037
  /**
833
- * Build `RuntimeGenesisConfig` from a JSON blob not using any defaults and store it in the storage.
1038
+ * Returns a JSON blob representation of the built-in `RuntimeGenesisConfig` identified by
1039
+ * `id`.
834
1040
  *
835
- * This function deserializes the full `RuntimeGenesisConfig` from the given JSON blob and puts it into the storage.
836
- * If the provided JSON blob is incorrect or incomplete or the deserialization fails, an error is returned.
837
- * It is recommended to log any errors encountered during the process.
1041
+ * If `id` is `None` the function should return JSON blob representation of the default
1042
+ * `RuntimeGenesisConfig` struct of the runtime. Implementation must provide default
1043
+ * `RuntimeGenesisConfig`.
838
1044
  *
839
- * Please note that provided json blob must contain all `RuntimeGenesisConfig` fields, no defaults will be used.
1045
+ * Otherwise function returns a JSON representation of the built-in, named
1046
+ * `RuntimeGenesisConfig` preset identified by `id`, or `None` if such preset does not
1047
+ * exist. Returned `Vec<u8>` contains bytes of JSON blob (patch) which comprises a list of
1048
+ * (potentially nested) key-value pairs that are intended for customizing the default
1049
+ * runtime genesis config. The patch shall be merged (rfc7386) with the JSON representation
1050
+ * of the default `RuntimeGenesisConfig` to create a comprehensive genesis config that can
1051
+ * be used in `build_state` method.
840
1052
  *
841
- * @callname: GenesisBuilder_build_config
842
- * @param {BytesLike} json
1053
+ * @callname: GenesisBuilder_get_preset
1054
+ * @param {string | undefined} id
1055
+ **/
1056
+ getPreset: GenericRuntimeApiMethod<Rv, (id?: string | undefined) => Promise<Bytes | undefined>>;
1057
+ /**
1058
+ * Returns a list of identifiers for available builtin `RuntimeGenesisConfig` presets.
1059
+ *
1060
+ * The presets from the list can be queried with [`GenesisBuilder::get_preset`] method. If
1061
+ * no named presets are provided by the runtime the list is empty.
1062
+ *
1063
+ * @callname: GenesisBuilder_preset_names
843
1064
  **/
844
- buildConfig: GenericRuntimeApiMethod<Rv, (json: BytesLike) => Promise<Result<[], string>>>;
1065
+ presetNames: GenericRuntimeApiMethod<Rv, () => Promise<Array<string>>>;
845
1066
  /**
846
1067
  * Generic runtime api call
847
1068
  **/