@dedot/chaintypes 0.99.0 → 0.100.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.
@@ -0,0 +1,968 @@
1
+ // Generated by dedot cli
2
+
3
+ import type { GenericRuntimeApis, GenericRuntimeApiMethod, RpcVersion } from 'dedot/types';
4
+ import type {
5
+ RuntimeVersion,
6
+ Header,
7
+ DispatchError,
8
+ Result,
9
+ H256,
10
+ Bytes,
11
+ BytesLike,
12
+ AccountId32Like,
13
+ H160,
14
+ U256,
15
+ Permill,
16
+ AccountId32,
17
+ FixedBytes,
18
+ } from 'dedot/codecs';
19
+ import type {
20
+ SpRuntimeBlock,
21
+ SpRuntimeExtrinsicInclusionMode,
22
+ SpCoreOpaqueMetadata,
23
+ SpRuntimeTransactionValidityTransactionValidityError,
24
+ FpSelfContainedUncheckedExtrinsic,
25
+ SpInherentsInherentData,
26
+ SpInherentsCheckInherentsResult,
27
+ SpRuntimeTransactionValidityValidTransaction,
28
+ SpRuntimeTransactionValidityTransactionSource,
29
+ SpCoreCryptoKeyTypeId,
30
+ SpConsensusSlotsSlotDuration,
31
+ SpConsensusAuraSr25519AppSr25519Public,
32
+ CumulusPrimitivesCoreCollationInfo,
33
+ PalletCurrenciesRpcRuntimeApiAccountData,
34
+ PalletTransactionPaymentRuntimeDispatchInfo,
35
+ PalletTransactionPaymentFeeDetails,
36
+ SpWeightsWeightV2Weight,
37
+ EvmBackendBasic,
38
+ FpEvmExecutionInfoV2,
39
+ FpEvmExecutionInfoV2H160,
40
+ EthereumBlock,
41
+ EthereumReceiptReceiptV3,
42
+ FpRpcTransactionStatus,
43
+ EthereumTransactionTransactionV2,
44
+ XcmVersionedAssetId,
45
+ XcmRuntimeApisFeesError,
46
+ XcmVersionedXcm,
47
+ XcmVersionedAssets,
48
+ XcmVersionedLocation,
49
+ SpConsensusSlotsSlot,
50
+ XcmRuntimeApisDryRunCallDryRunEffects,
51
+ XcmRuntimeApisDryRunError,
52
+ HydradxRuntimeOriginCaller,
53
+ HydradxRuntimeRuntimeCallLike,
54
+ XcmRuntimeApisDryRunXcmDryRunEffects,
55
+ XcmRuntimeApisConversionsError,
56
+ HydradxTraitsOracleOraclePeriod,
57
+ HydradxRuntimeEvmAaveTradeExecutorPoolData,
58
+ } from './types.js';
59
+
60
+ export interface RuntimeApis<Rv extends RpcVersion> extends GenericRuntimeApis<Rv> {
61
+ /**
62
+ * @runtimeapi: Core - 0xdf6acb689907609b
63
+ **/
64
+ core: {
65
+ /**
66
+ * Returns the version of the runtime.
67
+ *
68
+ * @callname: Core_version
69
+ **/
70
+ version: GenericRuntimeApiMethod<Rv, () => Promise<RuntimeVersion>>;
71
+
72
+ /**
73
+ * Execute the given block.
74
+ *
75
+ * @callname: Core_execute_block
76
+ * @param {SpRuntimeBlock} block
77
+ **/
78
+ executeBlock: GenericRuntimeApiMethod<Rv, (block: SpRuntimeBlock) => Promise<[]>>;
79
+
80
+ /**
81
+ * Initialize a block with the given header and return the runtime executive mode.
82
+ *
83
+ * @callname: Core_initialize_block
84
+ * @param {Header} header
85
+ **/
86
+ initializeBlock: GenericRuntimeApiMethod<Rv, (header: Header) => Promise<SpRuntimeExtrinsicInclusionMode>>;
87
+
88
+ /**
89
+ * Generic runtime api call
90
+ **/
91
+ [method: string]: GenericRuntimeApiMethod<Rv>;
92
+ };
93
+ /**
94
+ * @runtimeapi: Metadata - 0x37e397fc7c91f5e4
95
+ **/
96
+ metadata: {
97
+ /**
98
+ * Returns the metadata of a runtime.
99
+ *
100
+ * @callname: Metadata_metadata
101
+ **/
102
+ metadata: GenericRuntimeApiMethod<Rv, () => Promise<SpCoreOpaqueMetadata>>;
103
+
104
+ /**
105
+ * Returns the metadata at a given version.
106
+ *
107
+ * If the given `version` isn't supported, this will return `None`.
108
+ * Use [`Self::metadata_versions`] to find out about supported metadata version of the runtime.
109
+ *
110
+ * @callname: Metadata_metadata_at_version
111
+ * @param {number} version
112
+ **/
113
+ metadataAtVersion: GenericRuntimeApiMethod<Rv, (version: number) => Promise<SpCoreOpaqueMetadata | undefined>>;
114
+
115
+ /**
116
+ * Returns the supported metadata versions.
117
+ *
118
+ * This can be used to call `metadata_at_version`.
119
+ *
120
+ * @callname: Metadata_metadata_versions
121
+ **/
122
+ metadataVersions: GenericRuntimeApiMethod<Rv, () => Promise<Array<number>>>;
123
+
124
+ /**
125
+ * Generic runtime api call
126
+ **/
127
+ [method: string]: GenericRuntimeApiMethod<Rv>;
128
+ };
129
+ /**
130
+ * @runtimeapi: BlockBuilder - 0x40fe3ad401f8959a
131
+ **/
132
+ blockBuilder: {
133
+ /**
134
+ * Apply the given extrinsic.
135
+ *
136
+ * Returns an inclusion outcome which specifies if this extrinsic is included in
137
+ * this block or not.
138
+ *
139
+ * @callname: BlockBuilder_apply_extrinsic
140
+ * @param {FpSelfContainedUncheckedExtrinsic} extrinsic
141
+ **/
142
+ applyExtrinsic: GenericRuntimeApiMethod<
143
+ Rv,
144
+ (
145
+ extrinsic: FpSelfContainedUncheckedExtrinsic,
146
+ ) => Promise<Result<Result<[], DispatchError>, SpRuntimeTransactionValidityTransactionValidityError>>
147
+ >;
148
+
149
+ /**
150
+ * Finish the current block.
151
+ *
152
+ * @callname: BlockBuilder_finalize_block
153
+ **/
154
+ finalizeBlock: GenericRuntimeApiMethod<Rv, () => Promise<Header>>;
155
+
156
+ /**
157
+ * Generate inherent extrinsics. The inherent data will vary from chain to chain.
158
+ *
159
+ * @callname: BlockBuilder_inherent_extrinsics
160
+ * @param {SpInherentsInherentData} inherent
161
+ **/
162
+ inherentExtrinsics: GenericRuntimeApiMethod<
163
+ Rv,
164
+ (inherent: SpInherentsInherentData) => Promise<Array<FpSelfContainedUncheckedExtrinsic>>
165
+ >;
166
+
167
+ /**
168
+ * Check that the inherents are valid. The inherent data will vary from chain to chain.
169
+ *
170
+ * @callname: BlockBuilder_check_inherents
171
+ * @param {SpRuntimeBlock} block
172
+ * @param {SpInherentsInherentData} data
173
+ **/
174
+ checkInherents: GenericRuntimeApiMethod<
175
+ Rv,
176
+ (block: SpRuntimeBlock, data: SpInherentsInherentData) => Promise<SpInherentsCheckInherentsResult>
177
+ >;
178
+
179
+ /**
180
+ * Generic runtime api call
181
+ **/
182
+ [method: string]: GenericRuntimeApiMethod<Rv>;
183
+ };
184
+ /**
185
+ * @runtimeapi: TaggedTransactionQueue - 0xd2bc9897eed08f15
186
+ **/
187
+ taggedTransactionQueue: {
188
+ /**
189
+ * Validate the transaction.
190
+ *
191
+ * This method is invoked by the transaction pool to learn details about given transaction.
192
+ * The implementation should make sure to verify the correctness of the transaction
193
+ * against current state. The given `block_hash` corresponds to the hash of the block
194
+ * that is used as current state.
195
+ *
196
+ * Note that this call may be performed by the pool multiple times and transactions
197
+ * might be verified in any possible order.
198
+ *
199
+ * @callname: TaggedTransactionQueue_validate_transaction
200
+ * @param {SpRuntimeTransactionValidityTransactionSource} source
201
+ * @param {FpSelfContainedUncheckedExtrinsic} tx
202
+ * @param {H256} block_hash
203
+ **/
204
+ validateTransaction: GenericRuntimeApiMethod<
205
+ Rv,
206
+ (
207
+ source: SpRuntimeTransactionValidityTransactionSource,
208
+ tx: FpSelfContainedUncheckedExtrinsic,
209
+ blockHash: H256,
210
+ ) => Promise<
211
+ Result<SpRuntimeTransactionValidityValidTransaction, SpRuntimeTransactionValidityTransactionValidityError>
212
+ >
213
+ >;
214
+
215
+ /**
216
+ * Generic runtime api call
217
+ **/
218
+ [method: string]: GenericRuntimeApiMethod<Rv>;
219
+ };
220
+ /**
221
+ * @runtimeapi: OffchainWorkerApi - 0xf78b278be53f454c
222
+ **/
223
+ offchainWorkerApi: {
224
+ /**
225
+ * Starts the off-chain task for given block header.
226
+ *
227
+ * @callname: OffchainWorkerApi_offchain_worker
228
+ * @param {Header} header
229
+ **/
230
+ offchainWorker: GenericRuntimeApiMethod<Rv, (header: Header) => Promise<[]>>;
231
+
232
+ /**
233
+ * Generic runtime api call
234
+ **/
235
+ [method: string]: GenericRuntimeApiMethod<Rv>;
236
+ };
237
+ /**
238
+ * @runtimeapi: SessionKeys - 0xab3c0572291feb8b
239
+ **/
240
+ sessionKeys: {
241
+ /**
242
+ * Generate a set of session keys with optionally using the given seed.
243
+ * The keys should be stored within the keystore exposed via runtime
244
+ * externalities.
245
+ *
246
+ * The seed needs to be a valid `utf8` string.
247
+ *
248
+ * Returns the concatenated SCALE encoded public keys.
249
+ *
250
+ * @callname: SessionKeys_generate_session_keys
251
+ * @param {BytesLike | undefined} seed
252
+ **/
253
+ generateSessionKeys: GenericRuntimeApiMethod<Rv, (seed?: BytesLike | undefined) => Promise<Bytes>>;
254
+
255
+ /**
256
+ * Decode the given public session keys.
257
+ *
258
+ * Returns the list of public raw public keys + key type.
259
+ *
260
+ * @callname: SessionKeys_decode_session_keys
261
+ * @param {BytesLike} encoded
262
+ **/
263
+ decodeSessionKeys: GenericRuntimeApiMethod<
264
+ Rv,
265
+ (encoded: BytesLike) => Promise<Array<[Bytes, SpCoreCryptoKeyTypeId]> | undefined>
266
+ >;
267
+
268
+ /**
269
+ * Generic runtime api call
270
+ **/
271
+ [method: string]: GenericRuntimeApiMethod<Rv>;
272
+ };
273
+ /**
274
+ * @runtimeapi: AuraApi - 0xdd718d5cc53262d4
275
+ **/
276
+ auraApi: {
277
+ /**
278
+ * Returns the slot duration for Aura.
279
+ *
280
+ * Currently, only the value provided by this type at genesis will be used.
281
+ *
282
+ * @callname: AuraApi_slot_duration
283
+ **/
284
+ slotDuration: GenericRuntimeApiMethod<Rv, () => Promise<SpConsensusSlotsSlotDuration>>;
285
+
286
+ /**
287
+ * Return the current set of authorities.
288
+ *
289
+ * @callname: AuraApi_authorities
290
+ **/
291
+ authorities: GenericRuntimeApiMethod<Rv, () => Promise<Array<SpConsensusAuraSr25519AppSr25519Public>>>;
292
+
293
+ /**
294
+ * Generic runtime api call
295
+ **/
296
+ [method: string]: GenericRuntimeApiMethod<Rv>;
297
+ };
298
+ /**
299
+ * @runtimeapi: CollectCollationInfo - 0xea93e3f16f3d6962
300
+ **/
301
+ collectCollationInfo: {
302
+ /**
303
+ * Collect information about a collation.
304
+ *
305
+ * The given `header` is the header of the built block for that
306
+ * we are collecting the collation info for.
307
+ *
308
+ * @callname: CollectCollationInfo_collect_collation_info
309
+ * @param {Header} header
310
+ **/
311
+ collectCollationInfo: GenericRuntimeApiMethod<Rv, (header: Header) => Promise<CumulusPrimitivesCoreCollationInfo>>;
312
+
313
+ /**
314
+ * Generic runtime api call
315
+ **/
316
+ [method: string]: GenericRuntimeApiMethod<Rv>;
317
+ };
318
+ /**
319
+ * @runtimeapi: CurrenciesApi - 0x9af86751b70c112d
320
+ **/
321
+ currenciesApi: {
322
+ /**
323
+ *
324
+ * @callname: CurrenciesApi_account
325
+ * @param {number} asset_id
326
+ * @param {AccountId32Like} who
327
+ **/
328
+ account: GenericRuntimeApiMethod<
329
+ Rv,
330
+ (assetId: number, who: AccountId32Like) => Promise<PalletCurrenciesRpcRuntimeApiAccountData>
331
+ >;
332
+
333
+ /**
334
+ *
335
+ * @callname: CurrenciesApi_accounts
336
+ * @param {AccountId32Like} who
337
+ **/
338
+ accounts: GenericRuntimeApiMethod<
339
+ Rv,
340
+ (who: AccountId32Like) => Promise<Array<[number, PalletCurrenciesRpcRuntimeApiAccountData]>>
341
+ >;
342
+
343
+ /**
344
+ *
345
+ * @callname: CurrenciesApi_free_balance
346
+ * @param {number} asset_id
347
+ * @param {AccountId32Like} who
348
+ **/
349
+ freeBalance: GenericRuntimeApiMethod<Rv, (assetId: number, who: AccountId32Like) => Promise<bigint>>;
350
+
351
+ /**
352
+ * Generic runtime api call
353
+ **/
354
+ [method: string]: GenericRuntimeApiMethod<Rv>;
355
+ };
356
+ /**
357
+ * @runtimeapi: AccountNonceApi - 0xbc9d89904f5b923f
358
+ **/
359
+ accountNonceApi: {
360
+ /**
361
+ * Get current account nonce of given `AccountId`.
362
+ *
363
+ * @callname: AccountNonceApi_account_nonce
364
+ * @param {AccountId32Like} account
365
+ **/
366
+ accountNonce: GenericRuntimeApiMethod<Rv, (account: AccountId32Like) => Promise<number>>;
367
+
368
+ /**
369
+ * Generic runtime api call
370
+ **/
371
+ [method: string]: GenericRuntimeApiMethod<Rv>;
372
+ };
373
+ /**
374
+ * @runtimeapi: TransactionPaymentApi - 0x37c8bb1350a9a2a8
375
+ **/
376
+ transactionPaymentApi: {
377
+ /**
378
+ *
379
+ * @callname: TransactionPaymentApi_query_info
380
+ * @param {FpSelfContainedUncheckedExtrinsic} uxt
381
+ * @param {number} len
382
+ **/
383
+ queryInfo: GenericRuntimeApiMethod<
384
+ Rv,
385
+ (uxt: FpSelfContainedUncheckedExtrinsic, len: number) => Promise<PalletTransactionPaymentRuntimeDispatchInfo>
386
+ >;
387
+
388
+ /**
389
+ *
390
+ * @callname: TransactionPaymentApi_query_fee_details
391
+ * @param {FpSelfContainedUncheckedExtrinsic} uxt
392
+ * @param {number} len
393
+ **/
394
+ queryFeeDetails: GenericRuntimeApiMethod<
395
+ Rv,
396
+ (uxt: FpSelfContainedUncheckedExtrinsic, len: number) => Promise<PalletTransactionPaymentFeeDetails>
397
+ >;
398
+
399
+ /**
400
+ *
401
+ * @callname: TransactionPaymentApi_query_weight_to_fee
402
+ * @param {SpWeightsWeightV2Weight} weight
403
+ **/
404
+ queryWeightToFee: GenericRuntimeApiMethod<Rv, (weight: SpWeightsWeightV2Weight) => Promise<bigint>>;
405
+
406
+ /**
407
+ *
408
+ * @callname: TransactionPaymentApi_query_length_to_fee
409
+ * @param {number} length
410
+ **/
411
+ queryLengthToFee: GenericRuntimeApiMethod<Rv, (length: number) => Promise<bigint>>;
412
+
413
+ /**
414
+ * Generic runtime api call
415
+ **/
416
+ [method: string]: GenericRuntimeApiMethod<Rv>;
417
+ };
418
+ /**
419
+ * @runtimeapi: EthereumRuntimeRPCApi - 0x582211f65bb14b89
420
+ **/
421
+ ethereumRuntimeRPCApi: {
422
+ /**
423
+ * Returns runtime defined pallet_evm::ChainId.
424
+ *
425
+ * @callname: EthereumRuntimeRPCApi_chain_id
426
+ **/
427
+ chainId: GenericRuntimeApiMethod<Rv, () => Promise<bigint>>;
428
+
429
+ /**
430
+ * Returns pallet_evm::Accounts by address.
431
+ *
432
+ * @callname: EthereumRuntimeRPCApi_account_basic
433
+ * @param {H160} address
434
+ **/
435
+ accountBasic: GenericRuntimeApiMethod<Rv, (address: H160) => Promise<EvmBackendBasic>>;
436
+
437
+ /**
438
+ * Returns FixedGasPrice::min_gas_price
439
+ *
440
+ * @callname: EthereumRuntimeRPCApi_gas_price
441
+ **/
442
+ gasPrice: GenericRuntimeApiMethod<Rv, () => Promise<U256>>;
443
+
444
+ /**
445
+ * For a given account address, returns pallet_evm::AccountCodes.
446
+ *
447
+ * @callname: EthereumRuntimeRPCApi_account_code_at
448
+ * @param {H160} address
449
+ **/
450
+ accountCodeAt: GenericRuntimeApiMethod<Rv, (address: H160) => Promise<Bytes>>;
451
+
452
+ /**
453
+ * Returns the converted FindAuthor::find_author authority id.
454
+ *
455
+ * @callname: EthereumRuntimeRPCApi_author
456
+ **/
457
+ author: GenericRuntimeApiMethod<Rv, () => Promise<H160>>;
458
+
459
+ /**
460
+ * For a given account address and index, returns pallet_evm::AccountStorages.
461
+ *
462
+ * @callname: EthereumRuntimeRPCApi_storage_at
463
+ * @param {H160} address
464
+ * @param {U256} index
465
+ **/
466
+ storageAt: GenericRuntimeApiMethod<Rv, (address: H160, index: U256) => Promise<H256>>;
467
+
468
+ /**
469
+ *
470
+ * @callname: EthereumRuntimeRPCApi_call
471
+ * @param {H160} from
472
+ * @param {H160} to
473
+ * @param {BytesLike} data
474
+ * @param {U256} value
475
+ * @param {U256} gas_limit
476
+ * @param {U256 | undefined} max_fee_per_gas
477
+ * @param {U256 | undefined} max_priority_fee_per_gas
478
+ * @param {U256 | undefined} nonce
479
+ * @param {boolean} estimate
480
+ * @param {Array<[H160, Array<H256>]> | undefined} access_list
481
+ **/
482
+ call: GenericRuntimeApiMethod<
483
+ Rv,
484
+ (
485
+ from: H160,
486
+ to: H160,
487
+ data: BytesLike,
488
+ value: U256,
489
+ gasLimit: U256,
490
+ maxFeePerGas: U256 | undefined,
491
+ maxPriorityFeePerGas: U256 | undefined,
492
+ nonce: U256 | undefined,
493
+ estimate: boolean,
494
+ accessList?: Array<[H160, Array<H256>]> | undefined,
495
+ ) => Promise<Result<FpEvmExecutionInfoV2, DispatchError>>
496
+ >;
497
+
498
+ /**
499
+ *
500
+ * @callname: EthereumRuntimeRPCApi_create
501
+ * @param {H160} from
502
+ * @param {BytesLike} data
503
+ * @param {U256} value
504
+ * @param {U256} gas_limit
505
+ * @param {U256 | undefined} max_fee_per_gas
506
+ * @param {U256 | undefined} max_priority_fee_per_gas
507
+ * @param {U256 | undefined} nonce
508
+ * @param {boolean} estimate
509
+ * @param {Array<[H160, Array<H256>]> | undefined} access_list
510
+ **/
511
+ create: GenericRuntimeApiMethod<
512
+ Rv,
513
+ (
514
+ from: H160,
515
+ data: BytesLike,
516
+ value: U256,
517
+ gasLimit: U256,
518
+ maxFeePerGas: U256 | undefined,
519
+ maxPriorityFeePerGas: U256 | undefined,
520
+ nonce: U256 | undefined,
521
+ estimate: boolean,
522
+ accessList?: Array<[H160, Array<H256>]> | undefined,
523
+ ) => Promise<Result<FpEvmExecutionInfoV2H160, DispatchError>>
524
+ >;
525
+
526
+ /**
527
+ * Return the current block.
528
+ *
529
+ * @callname: EthereumRuntimeRPCApi_current_block
530
+ **/
531
+ currentBlock: GenericRuntimeApiMethod<Rv, () => Promise<EthereumBlock | undefined>>;
532
+
533
+ /**
534
+ * Return the current receipt.
535
+ *
536
+ * @callname: EthereumRuntimeRPCApi_current_receipts
537
+ **/
538
+ currentReceipts: GenericRuntimeApiMethod<Rv, () => Promise<Array<EthereumReceiptReceiptV3> | undefined>>;
539
+
540
+ /**
541
+ * Return the current transaction status.
542
+ *
543
+ * @callname: EthereumRuntimeRPCApi_current_transaction_statuses
544
+ **/
545
+ currentTransactionStatuses: GenericRuntimeApiMethod<Rv, () => Promise<Array<FpRpcTransactionStatus> | undefined>>;
546
+
547
+ /**
548
+ *
549
+ * @callname: EthereumRuntimeRPCApi_current_all
550
+ **/
551
+ currentAll: GenericRuntimeApiMethod<
552
+ Rv,
553
+ () => Promise<
554
+ [
555
+ EthereumBlock | undefined,
556
+ Array<EthereumReceiptReceiptV3> | undefined,
557
+ Array<FpRpcTransactionStatus> | undefined,
558
+ ]
559
+ >
560
+ >;
561
+
562
+ /**
563
+ * Receives a `Vec<OpaqueExtrinsic>` and filters all the ethereum transactions.
564
+ *
565
+ * @callname: EthereumRuntimeRPCApi_extrinsic_filter
566
+ * @param {Array<FpSelfContainedUncheckedExtrinsic>} xts
567
+ **/
568
+ extrinsicFilter: GenericRuntimeApiMethod<
569
+ Rv,
570
+ (xts: Array<FpSelfContainedUncheckedExtrinsic>) => Promise<Array<EthereumTransactionTransactionV2>>
571
+ >;
572
+
573
+ /**
574
+ * Return the elasticity multiplier.
575
+ *
576
+ * @callname: EthereumRuntimeRPCApi_elasticity
577
+ **/
578
+ elasticity: GenericRuntimeApiMethod<Rv, () => Promise<Permill | undefined>>;
579
+
580
+ /**
581
+ * Used to determine if gas limit multiplier for non-transactional calls (eth_call/estimateGas)
582
+ * is supported.
583
+ *
584
+ * @callname: EthereumRuntimeRPCApi_gas_limit_multiplier_support
585
+ **/
586
+ gasLimitMultiplierSupport: GenericRuntimeApiMethod<Rv, () => Promise<[]>>;
587
+
588
+ /**
589
+ * Return the pending block.
590
+ *
591
+ * @callname: EthereumRuntimeRPCApi_pending_block
592
+ * @param {Array<FpSelfContainedUncheckedExtrinsic>} xts
593
+ **/
594
+ pendingBlock: GenericRuntimeApiMethod<
595
+ Rv,
596
+ (
597
+ xts: Array<FpSelfContainedUncheckedExtrinsic>,
598
+ ) => Promise<[EthereumBlock | undefined, Array<FpRpcTransactionStatus> | undefined]>
599
+ >;
600
+
601
+ /**
602
+ * Initialize the pending block.
603
+ * The behavior should be the same as the runtime api Core_initialize_block but
604
+ * for a "pending" block.
605
+ * If your project don't need to have a different behavior to initialize "pending" blocks,
606
+ * you can copy your Core_initialize_block implementation.
607
+ *
608
+ * @callname: EthereumRuntimeRPCApi_initialize_pending_block
609
+ * @param {Header} header
610
+ **/
611
+ initializePendingBlock: GenericRuntimeApiMethod<Rv, (header: Header) => Promise<[]>>;
612
+
613
+ /**
614
+ * Generic runtime api call
615
+ **/
616
+ [method: string]: GenericRuntimeApiMethod<Rv>;
617
+ };
618
+ /**
619
+ * @runtimeapi: ConvertTransactionRuntimeApi - 0xe65b00e46cedd0aa
620
+ **/
621
+ convertTransactionRuntimeApi: {
622
+ /**
623
+ *
624
+ * @callname: ConvertTransactionRuntimeApi_convert_transaction
625
+ * @param {EthereumTransactionTransactionV2} transaction
626
+ **/
627
+ convertTransaction: GenericRuntimeApiMethod<
628
+ Rv,
629
+ (transaction: EthereumTransactionTransactionV2) => Promise<FpSelfContainedUncheckedExtrinsic>
630
+ >;
631
+
632
+ /**
633
+ * Generic runtime api call
634
+ **/
635
+ [method: string]: GenericRuntimeApiMethod<Rv>;
636
+ };
637
+ /**
638
+ * @runtimeapi: EvmAccountsApi - 0x0bb67a52fcd040ff
639
+ **/
640
+ evmAccountsApi: {
641
+ /**
642
+ * get the EVM address from the substrate address.
643
+ *
644
+ * @callname: EvmAccountsApi_evm_address
645
+ * @param {AccountId32Like} account_id
646
+ **/
647
+ evmAddress: GenericRuntimeApiMethod<Rv, (accountId: AccountId32Like) => Promise<H160>>;
648
+
649
+ /**
650
+ * Return the Substrate address bound to the EVM account. If not bound, returns `None`.
651
+ *
652
+ * @callname: EvmAccountsApi_bound_account_id
653
+ * @param {H160} evm_address
654
+ **/
655
+ boundAccountId: GenericRuntimeApiMethod<Rv, (evmAddress: H160) => Promise<AccountId32 | undefined>>;
656
+
657
+ /**
658
+ * Get the Substrate address from the EVM address.
659
+ * Returns the truncated version of the address if the address wasn't bind.
660
+ *
661
+ * @callname: EvmAccountsApi_account_id
662
+ * @param {H160} evm_address
663
+ **/
664
+ accountId: GenericRuntimeApiMethod<Rv, (evmAddress: H160) => Promise<AccountId32>>;
665
+
666
+ /**
667
+ * Generic runtime api call
668
+ **/
669
+ [method: string]: GenericRuntimeApiMethod<Rv>;
670
+ };
671
+ /**
672
+ * @runtimeapi: XcmPaymentApi - 0x6ff52ee858e6c5bd
673
+ **/
674
+ xcmPaymentApi: {
675
+ /**
676
+ * Returns a list of acceptable payment assets.
677
+ *
678
+ * # Arguments
679
+ *
680
+ * * `xcm_version`: Version.
681
+ *
682
+ * @callname: XcmPaymentApi_query_acceptable_payment_assets
683
+ * @param {number} xcm_version
684
+ **/
685
+ queryAcceptablePaymentAssets: GenericRuntimeApiMethod<
686
+ Rv,
687
+ (xcmVersion: number) => Promise<Result<Array<XcmVersionedAssetId>, XcmRuntimeApisFeesError>>
688
+ >;
689
+
690
+ /**
691
+ * Returns a weight needed to execute a XCM.
692
+ *
693
+ * # Arguments
694
+ *
695
+ * * `message`: `VersionedXcm`.
696
+ *
697
+ * @callname: XcmPaymentApi_query_xcm_weight
698
+ * @param {XcmVersionedXcm} message
699
+ **/
700
+ queryXcmWeight: GenericRuntimeApiMethod<
701
+ Rv,
702
+ (message: XcmVersionedXcm) => Promise<Result<SpWeightsWeightV2Weight, XcmRuntimeApisFeesError>>
703
+ >;
704
+
705
+ /**
706
+ * Converts a weight into a fee for the specified `AssetId`.
707
+ *
708
+ * # Arguments
709
+ *
710
+ * * `weight`: convertible `Weight`.
711
+ * * `asset`: `VersionedAssetId`.
712
+ *
713
+ * @callname: XcmPaymentApi_query_weight_to_asset_fee
714
+ * @param {SpWeightsWeightV2Weight} weight
715
+ * @param {XcmVersionedAssetId} asset
716
+ **/
717
+ queryWeightToAssetFee: GenericRuntimeApiMethod<
718
+ Rv,
719
+ (weight: SpWeightsWeightV2Weight, asset: XcmVersionedAssetId) => Promise<Result<bigint, XcmRuntimeApisFeesError>>
720
+ >;
721
+
722
+ /**
723
+ * Get delivery fees for sending a specific `message` to a `destination`.
724
+ * These always come in a specific asset, defined by the chain.
725
+ *
726
+ * # Arguments
727
+ * * `message`: The message that'll be sent, necessary because most delivery fees are based on the
728
+ * size of the message.
729
+ * * `destination`: The destination to send the message to. Different destinations may use
730
+ * different senders that charge different fees.
731
+ *
732
+ * @callname: XcmPaymentApi_query_delivery_fees
733
+ * @param {XcmVersionedLocation} destination
734
+ * @param {XcmVersionedXcm} message
735
+ **/
736
+ queryDeliveryFees: GenericRuntimeApiMethod<
737
+ Rv,
738
+ (
739
+ destination: XcmVersionedLocation,
740
+ message: XcmVersionedXcm,
741
+ ) => Promise<Result<XcmVersionedAssets, XcmRuntimeApisFeesError>>
742
+ >;
743
+
744
+ /**
745
+ * Generic runtime api call
746
+ **/
747
+ [method: string]: GenericRuntimeApiMethod<Rv>;
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
+ };
776
+ /**
777
+ * @runtimeapi: DryRunApi - 0x91b1c8b16328eb92
778
+ **/
779
+ dryRunApi: {
780
+ /**
781
+ * Dry run call.
782
+ *
783
+ * @callname: DryRunApi_dry_run_call
784
+ * @param {HydradxRuntimeOriginCaller} origin
785
+ * @param {HydradxRuntimeRuntimeCallLike} call
786
+ **/
787
+ dryRunCall: GenericRuntimeApiMethod<
788
+ Rv,
789
+ (
790
+ origin: HydradxRuntimeOriginCaller,
791
+ call: HydradxRuntimeRuntimeCallLike,
792
+ ) => Promise<Result<XcmRuntimeApisDryRunCallDryRunEffects, XcmRuntimeApisDryRunError>>
793
+ >;
794
+
795
+ /**
796
+ * Dry run XCM program
797
+ *
798
+ * @callname: DryRunApi_dry_run_xcm
799
+ * @param {XcmVersionedLocation} origin_location
800
+ * @param {XcmVersionedXcm} xcm
801
+ **/
802
+ dryRunXcm: GenericRuntimeApiMethod<
803
+ Rv,
804
+ (
805
+ originLocation: XcmVersionedLocation,
806
+ xcm: XcmVersionedXcm,
807
+ ) => Promise<Result<XcmRuntimeApisDryRunXcmDryRunEffects, XcmRuntimeApisDryRunError>>
808
+ >;
809
+
810
+ /**
811
+ * Generic runtime api call
812
+ **/
813
+ [method: string]: GenericRuntimeApiMethod<Rv>;
814
+ };
815
+ /**
816
+ * @runtimeapi: LocationToAccountApi - 0x9ffb505aa738d69c
817
+ **/
818
+ locationToAccountApi: {
819
+ /**
820
+ * Converts `Location` to `AccountId`.
821
+ *
822
+ * @callname: LocationToAccountApi_convert_location
823
+ * @param {XcmVersionedLocation} location
824
+ **/
825
+ convertLocation: GenericRuntimeApiMethod<
826
+ Rv,
827
+ (location: XcmVersionedLocation) => Promise<Result<AccountId32, XcmRuntimeApisConversionsError>>
828
+ >;
829
+
830
+ /**
831
+ * Generic runtime api call
832
+ **/
833
+ [method: string]: GenericRuntimeApiMethod<Rv>;
834
+ };
835
+ /**
836
+ * @runtimeapi: ChainlinkAdapterApi - 0x2b5f5bcd2460e4f0
837
+ **/
838
+ chainlinkAdapterApi: {
839
+ /**
840
+ *
841
+ * @callname: ChainlinkAdapterApi_encode_oracle_address
842
+ * @param {number} asset_id_a
843
+ * @param {number} asset_id_b
844
+ * @param {HydradxTraitsOracleOraclePeriod} period
845
+ * @param {FixedBytes<8>} source
846
+ **/
847
+ encodeOracleAddress: GenericRuntimeApiMethod<
848
+ Rv,
849
+ (
850
+ assetIdA: number,
851
+ assetIdB: number,
852
+ period: HydradxTraitsOracleOraclePeriod,
853
+ source: FixedBytes<8>,
854
+ ) => Promise<H160>
855
+ >;
856
+
857
+ /**
858
+ *
859
+ * @callname: ChainlinkAdapterApi_decode_oracle_address
860
+ * @param {H160} oracle_address
861
+ **/
862
+ decodeOracleAddress: GenericRuntimeApiMethod<
863
+ Rv,
864
+ (oracleAddress: H160) => Promise<[number, number, HydradxTraitsOracleOraclePeriod, FixedBytes<8>] | undefined>
865
+ >;
866
+
867
+ /**
868
+ * Generic runtime api call
869
+ **/
870
+ [method: string]: GenericRuntimeApiMethod<Rv>;
871
+ };
872
+ /**
873
+ * @runtimeapi: AaveTradeExecutor - 0xa2b2b484fcb86943
874
+ **/
875
+ aaveTradeExecutor: {
876
+ /**
877
+ *
878
+ * @callname: AaveTradeExecutor_pairs
879
+ **/
880
+ pairs: GenericRuntimeApiMethod<Rv, () => Promise<Array<[number, number]>>>;
881
+
882
+ /**
883
+ *
884
+ * @callname: AaveTradeExecutor_liquidity_depth
885
+ * @param {number} asset_in
886
+ * @param {number} asset_out
887
+ **/
888
+ liquidityDepth: GenericRuntimeApiMethod<Rv, (assetIn: number, assetOut: number) => Promise<bigint | undefined>>;
889
+
890
+ /**
891
+ *
892
+ * @callname: AaveTradeExecutor_pool
893
+ * @param {number} reserve
894
+ * @param {number} atoken
895
+ **/
896
+ pool: GenericRuntimeApiMethod<
897
+ Rv,
898
+ (reserve: number, atoken: number) => Promise<HydradxRuntimeEvmAaveTradeExecutorPoolData>
899
+ >;
900
+
901
+ /**
902
+ *
903
+ * @callname: AaveTradeExecutor_pools
904
+ **/
905
+ pools: GenericRuntimeApiMethod<Rv, () => Promise<Array<HydradxRuntimeEvmAaveTradeExecutorPoolData>>>;
906
+
907
+ /**
908
+ * Generic runtime api call
909
+ **/
910
+ [method: string]: GenericRuntimeApiMethod<Rv>;
911
+ };
912
+ /**
913
+ * @runtimeapi: GenesisBuilder - 0xfbc577b9d747efd6
914
+ **/
915
+ genesisBuilder: {
916
+ /**
917
+ * Build `RuntimeGenesisConfig` from a JSON blob not using any defaults and store it in the
918
+ * storage.
919
+ *
920
+ * In the case of a FRAME-based runtime, this function deserializes the full `RuntimeGenesisConfig` from the given JSON blob and
921
+ * puts it into the storage. If the provided JSON blob is incorrect or incomplete or the
922
+ * deserialization fails, an error is returned.
923
+ *
924
+ * Please note that provided JSON blob must contain all `RuntimeGenesisConfig` fields, no
925
+ * defaults will be used.
926
+ *
927
+ * @callname: GenesisBuilder_build_state
928
+ * @param {BytesLike} json
929
+ **/
930
+ buildState: GenericRuntimeApiMethod<Rv, (json: BytesLike) => Promise<Result<[], string>>>;
931
+
932
+ /**
933
+ * Returns a JSON blob representation of the built-in `RuntimeGenesisConfig` identified by
934
+ * `id`.
935
+ *
936
+ * If `id` is `None` the function returns JSON blob representation of the default
937
+ * `RuntimeGenesisConfig` struct of the runtime. Implementation must provide default
938
+ * `RuntimeGenesisConfig`.
939
+ *
940
+ * Otherwise function returns a JSON representation of the built-in, named
941
+ * `RuntimeGenesisConfig` preset identified by `id`, or `None` if such preset does not
942
+ * exist. Returned `Vec<u8>` contains bytes of JSON blob (patch) which comprises a list of
943
+ * (potentially nested) key-value pairs that are intended for customizing the default
944
+ * runtime genesis config. The patch shall be merged (rfc7386) with the JSON representation
945
+ * of the default `RuntimeGenesisConfig` to create a comprehensive genesis config that can
946
+ * be used in `build_state` method.
947
+ *
948
+ * @callname: GenesisBuilder_get_preset
949
+ * @param {string | undefined} id
950
+ **/
951
+ getPreset: GenericRuntimeApiMethod<Rv, (id?: string | undefined) => Promise<Bytes | undefined>>;
952
+
953
+ /**
954
+ * Returns a list of identifiers for available builtin `RuntimeGenesisConfig` presets.
955
+ *
956
+ * The presets from the list can be queried with [`GenesisBuilder::get_preset`] method. If
957
+ * no named presets are provided by the runtime the list is empty.
958
+ *
959
+ * @callname: GenesisBuilder_preset_names
960
+ **/
961
+ presetNames: GenericRuntimeApiMethod<Rv, () => Promise<Array<string>>>;
962
+
963
+ /**
964
+ * Generic runtime api call
965
+ **/
966
+ [method: string]: GenericRuntimeApiMethod<Rv>;
967
+ };
968
+ }