Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import type { SafeMessage, SafeMessageListPage } from './types/safe-messages'
import { DEFAULT_BASE_URL } from './config'
import type { DelegateResponse, DelegatesRequest } from './types/delegates'
import type { GetEmailResponse } from './types/emails'
import type { RelayCountResponse, RelayTransactionResponse } from './types/relay'
import type { RelayCountResponse, RelayTransactionRequest, RelayTransactionResponse } from './types/relay'

export * from './types/safe-info'
export * from './types/safe-apps'
Expand Down Expand Up @@ -56,9 +56,10 @@ export const setBaseUrl = (url: string): void => {
*/
export function relayTransaction(
chainId: string,
body: operations['relay_transaction']['parameters']['body'],
tx: Omit<RelayTransactionRequest, 'version'>,
): Promise<RelayTransactionResponse> {
return postEndpoint(baseUrl, '/v1/chains/{chainId}/relay', { path: { chainId }, body })
const VERSION = '1'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, wait, it's the version of the contract, not the API, isn't it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

return postEndpoint(baseUrl, '/v1/chains/{chainId}/relay', { path: { chainId }, body: { ...tx, version: VERSION } })
}

/**
Expand Down