diff --git a/packages/cardano-services-client/src/TxSubmitProvider/BlockfrostTxSubmitProvider.ts b/packages/cardano-services-client/src/TxSubmitProvider/BlockfrostTxSubmitProvider.ts index 8c964a85849..4f0a2a6a1e3 100644 --- a/packages/cardano-services-client/src/TxSubmitProvider/BlockfrostTxSubmitProvider.ts +++ b/packages/cardano-services-client/src/TxSubmitProvider/BlockfrostTxSubmitProvider.ts @@ -10,7 +10,7 @@ export class BlockfrostTxSubmitProvider extends BlockfrostProvider implements Tx async submitTx({ signedTransaction }: SubmitTxArgs): Promise { // @ todo handle context and resolutions await this.request('tx/submit', { - body: signedTransaction, + body: Buffer.from(signedTransaction, 'hex'), headers: { 'Content-Type': 'application/cbor' }, method: 'POST' }); diff --git a/packages/cardano-services-client/test/TxSubmitProvider/BlockfrostTxSubmitProvider.test.ts b/packages/cardano-services-client/test/TxSubmitProvider/BlockfrostTxSubmitProvider.test.ts index 92bca225185..578cfd62693 100644 --- a/packages/cardano-services-client/test/TxSubmitProvider/BlockfrostTxSubmitProvider.test.ts +++ b/packages/cardano-services-client/test/TxSubmitProvider/BlockfrostTxSubmitProvider.test.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import { BlockfrostClient, BlockfrostTxSubmitProvider } from '../../src'; +import { HexBlob } from '@cardano-sdk/util'; import { ProviderError } from '@cardano-sdk/core'; import { logger } from '@cardano-sdk/util-dev'; import { mockResponses } from '../util'; @@ -17,7 +18,7 @@ describe('blockfrostTxSubmitProvider', () => { describe('submitTx', () => { it('wraps error in UnknownTxSubmissionError', async () => { mockResponses(request, [['tx/submit', new Error('some error')]]); - await expect(provider.submitTx({ signedTransaction: null as any })).rejects.toThrowError(ProviderError); + await expect(provider.submitTx({ signedTransaction: HexBlob('abc') })).rejects.toThrowError(ProviderError); }); }); });