Skip to content

Commit

Permalink
Feat: replace the confirmation-view endpoint with preview
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh committed Nov 20, 2024
1 parent 34be8d8 commit a6b6bfc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ export function getConfirmationView(
to?: operations['data_decoder']['parameters']['body']['to'],
value?: operations['data_decoder']['parameters']['body']['value'],
): Promise<AnyConfirmationView> {
return postEndpoint(baseUrl, '/v1/chains/{chainId}/safes/{safe_address}/views/transaction-confirmation', {
return postEndpoint(baseUrl, '/v1/chains/{chainId}/transactions/{safe_address}/preview', {
path: { chainId, safe_address: safeAddress },
body: { data, to, value },
})
Expand Down
2 changes: 1 addition & 1 deletion src/types/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export interface paths extends PathRegistry {
}
}
}
'/v1/chains/{chainId}/safes/{safe_address}/views/transaction-confirmation': {
'/v1/chains/{chainId}/transactions/{safe_address}/preview': {
post: operations['get_transaction_confirmation_view']
parameters: {
path: {
Expand Down
14 changes: 5 additions & 9 deletions src/types/decoded-data.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { TokenInfo } from './common'
import type { SwapOrder, TwapOrder } from './transactions'
import type { SwapOrder, TransactionData, TransactionInfo, TwapOrder } from './transactions'

export enum ConfirmationViewTypes {
GENERIC = 'GENERIC',
Expand Down Expand Up @@ -114,11 +114,7 @@ export type AnyStakingConfirmationView =
| NativeStakingValidatorsExitConfirmationView
| NativeStakingWithdrawConfirmationView

/* Union */
export type AnyConfirmationView =
| BaselineConfirmationView
| SwapOrderConfirmationView
| TwapOrderConfirmationView
| NativeStakingDepositConfirmationView
| NativeStakingValidatorsExitConfirmationView
| NativeStakingWithdrawConfirmationView
export type AnyConfirmationView = {
txInfo: TransactionInfo
txData: TransactionData
}

0 comments on commit a6b6bfc

Please sign in to comment.