@@ -14,7 +14,13 @@ import DeveloperBoard from '@mui/icons-material/DeveloperBoard'
1414import DeveloperBoardOffIcon from '@mui/icons-material/DeveloperBoardOff'
1515import LockIcon from '@mui/icons-material/Lock'
1616import { MethodIcon } from '../ConsensusTransactionMethod'
17- import { GetRuntimeTransactionsParams , Layer , RuntimeTransaction } from '../../../oasis-nexus/api'
17+ import {
18+ GetRuntimeTransactionsParams ,
19+ KnownRuntimeTxMethod ,
20+ knownRuntimeTxMethods ,
21+ Layer ,
22+ RuntimeTransaction ,
23+ } from '../../../oasis-nexus/api'
1824import { paraTimesConfig } from '../../../config'
1925import { exhaustedTypeWarning } from '../../../types/errors'
2026import { RuntimeTxMethodFilteringType } from '../../hooks/useCommonParams'
@@ -72,31 +78,6 @@ const getRuntimeTransactionLabel = (t: TFunction, method: KnownRuntimeTxMethod)
7278 }
7379}
7480
75- const knownRuntimeTxMethods = [
76- 'accounts.Transfer' ,
77- 'evm.Call' ,
78- 'evm.Create' ,
79- 'consensus.Deposit' ,
80- 'consensus.Withdraw' ,
81- 'consensus.Delegate' ,
82- 'consensus.Undelegate' ,
83- 'rofl.Create' ,
84- 'rofl.Register' ,
85- 'rofl.Remove' ,
86- 'rofl.Update' ,
87- 'roflmarket.ProviderCreate' ,
88- 'roflmarket.ProviderUpdate' ,
89- 'roflmarket.ProviderUpdateOffers' ,
90- 'roflmarket.ProviderRemove' ,
91- 'roflmarket.InstanceCreate' ,
92- 'roflmarket.InstanceTopUp' ,
93- 'roflmarket.InstanceCancel' ,
94- 'roflmarket.InstanceExecuteCmds' ,
95- 'roflmarket.InstanceChangeAdmin' ,
96- '' ,
97- ] as const
98- export type KnownRuntimeTxMethod = ( typeof knownRuntimeTxMethods ) [ number ]
99-
10081export type RuntimeTxMethodFilterOption = {
10182 value : RuntimeTxMethodFilteringType
10283 label : string
@@ -115,7 +96,7 @@ export const getRuntimeTxMethodOptions = (t: TFunction, layer: Layer) => {
11596}
11697
11798export const getRuntimeRoflUpdatesMethodOptions = ( t : TFunction ) => {
118- const options = [ 'rofl.Create' , 'rofl.Remove' , 'rofl.Update' ] as const
99+ const options = [ 'rofl.Create' , 'rofl.Remove' , 'rofl.Update' ] satisfies KnownRuntimeTxMethod [ ]
119100
120101 return options . map (
121102 ( method ) : RuntimeTxMethodFilterOption => ( {
@@ -131,27 +112,7 @@ export const getRuntimeRoflUpdatesMethodOptions = (t: TFunction) => {
131112 * May be undefined if the transaction was malformed.
132113 *
133114 * In theory, this could be any string as the runtimes evolve.
134- * In practice, the nexus currently expects only the following methods:
135- * - "accounts.Transfer"
136- * - "consensus.Deposit"
137- * - "consensus.Withdraw"
138- * - "consensus.Delegate"
139- * - "consensus.Undelegate"
140- * - "evm.Create"
141- * - "evm.Call"
142- * - "rofl.Create"
143- * - "rofl.Update"
144- * - "rofl.Remove"
145- * - "rofl.Register"
146- * - "roflmarket.ProviderCreate"
147- * - "roflmarket.ProviderUpdate"
148- * - "roflmarket.ProviderUpdateOffers"
149- * - "roflmarket.ProviderRemove"
150- * - "roflmarket.InstanceCreate"
151- * - "roflmarket.InstanceTopUp"
152- * - "roflmarket.InstanceCancel"
153- * - "roflmarket.InstanceExecuteCmds"
154- * - "roflmarket.InstanceChangeAdmin"
115+ * In practice, the nexus currently expects only KnownRuntimeTxMethod.
155116 */
156117const getRuntimeTransactionIcon = ( method : KnownRuntimeTxMethod , label : string , truncate ?: boolean ) => {
157118 const props = {
0 commit comments