Skip to content

Commit 9c3010f

Browse files
authored
Merge pull request #1781 from oasisprotocol/generate-openapi
Update API bindings
2 parents 2ec80c5 + d8fedad commit 9c3010f

5 files changed

Lines changed: 12 additions & 8 deletions

File tree

.changelog/1781.internal.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update API bindings

src/app/components/ConsensusTransactionMethod/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,4 +383,5 @@ export type ConsensusTxMethodFilterOption = ConsensusTxMethod | 'any'
383383

384384
export const getConsensusTransactionMethodFilteringParam = (
385385
method: ConsensusTxMethodFilterOption,
386-
): Partial<GetConsensusTransactionsParams> => (method === 'any' ? {} : { method })
386+
): Partial<GetConsensusTransactionsParams> =>
387+
method === 'any' ? {} : { method: method as unknown as ConsensusTxMethod[] }

src/app/components/RuntimeTransactionMethod/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export const getRuntimeTransactionMethodFilteringParam = (
165165
//
166166
// For more details, see the API spec at
167167
// https://github.com/oasisprotocol/nexus/blob/main/api/spec/v1.yaml
168-
return { method: 'native_transfers' }
168+
return { method: 'native_transfers' as unknown as string[] }
169169
case 'evm.Call':
170170
// Searching for contract calls is tricky, because some of them
171171
// should be classified as transfers. (See above.)
@@ -176,9 +176,9 @@ export const getRuntimeTransactionMethodFilteringParam = (
176176
//
177177
// For more details, see the API spec at
178178
// https://github.com/oasisprotocol/nexus/blob/main/api/spec/v1.yaml
179-
return { method: 'evm.Call_no_native' }
179+
return { method: 'evm.Call_no_native' as unknown as string[] }
180180
default:
181181
// For other (normal) methods, we can simply pass on the wanted method name.
182-
return { method }
182+
return { method: method as unknown as string[] }
183183
}
184184
}

src/app/pages/ConsensusAccountDetailsPage/ConsensusAccountTransactionsCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { FC } from 'react'
2-
import { useGetConsensusTransactions } from '../../../oasis-nexus/api'
2+
import { ConsensusTxMethod, useGetConsensusTransactions } from '../../../oasis-nexus/api'
33
import { NUMBER_OF_ITEMS_ON_SEPARATE_PAGE as limit } from '../../config'
44
import { ConsensusTransactions } from '../../components/Transactions'
55
import { useSearchParamsPagination } from '../../components/Table/useSearchParamsPagination'
@@ -42,7 +42,7 @@ const ConsensusAccountTransactions: FC<ConsensusAccountDetailsContext> = ({ scop
4242
limit,
4343
offset,
4444
rel: address,
45-
method: method === 'any' ? undefined : method,
45+
method: method === 'any' ? undefined : (method as unknown as ConsensusTxMethod[]),
4646
})
4747
const { isLoading, data } = transactionsQuery
4848
const transactions = data?.data.transactions

src/oasis-nexus/generated/api.ts

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)