Skip to content

Commit

Permalink
refactor: move BlockfrostToCore into client package
Browse files Browse the repository at this point in the history
  • Loading branch information
rhyslbw committed Nov 16, 2024
1 parent f2db32d commit 59d6083
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 10 deletions.
1 change: 1 addition & 0 deletions packages/cardano-services-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"dependencies": {
"@blockfrost/blockfrost-js": "^5.7.0",
"@cardano-sdk/core": "workspace:~",
"@cardano-sdk/crypto": "workspace:~",
"@cardano-sdk/util": "workspace:~",
"axios": "^1.7.4",
"class-validator": "^0.14.0",
Expand Down
1 change: 1 addition & 0 deletions packages/cardano-services-client/src/blockfrost/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './BlockfrostProvider';
export * from './BlockfrostClient';
export * from './BlockfrostToCore';
export * from './const';
1 change: 1 addition & 0 deletions packages/cardano-services-client/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from './AssetInfoProvider';
export * from './blockfrost/BlockfrostToCore';
export * from './HttpProvider';
export * from './TxSubmitProvider';
export * from './StakePoolProvider';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
// eslint-disable-next-line jsdoc/check-param-names
import * as Crypto from '@cardano-sdk/crypto';
import { BlockfrostProvider, BlockfrostProviderDependencies } from '../../util/BlockfrostProvider/BlockfrostProvider';
import {
BlockfrostToCore,
BlockfrostTransactionContent,
blockfrostMetadataToTxMetadata,
blockfrostToProviderError,
fetchByAddressSequentially,
isBlockfrostNotFoundError
} from '../../util';
import { BlockfrostToCore, BlockfrostTransactionContent } from '@cardano-sdk/cardano-services-client';
import {
BlocksByIdsArgs,
Cardano,
Expand All @@ -25,6 +18,12 @@ import {
import { DB_MAX_SAFE_INTEGER } from '../DbSyncChainHistory/queries';
import { Responses } from '@blockfrost/blockfrost-js';
import { Schemas } from '@blockfrost/blockfrost-js/lib/types/open-api';
import {
blockfrostMetadataToTxMetadata,
blockfrostToProviderError,
fetchByAddressSequentially,
isBlockfrostNotFoundError
} from '../../util';
import omit from 'lodash/omit.js';

type WithCertIndex<T> = T & { cert_index: number };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { BlockfrostProvider } from '../../util/BlockfrostProvider/BlockfrostProvider';
import { BlockfrostToCore, blockfrostToProviderError, fetchByAddressSequentially } from '../../util';
import { BlockfrostToCore } from '@cardano-sdk/cardano-services-client';
import { Cardano, Serialization, UtxoByAddressesArgs, UtxoProvider } from '@cardano-sdk/core';
import { PaginationOptions } from '@blockfrost/blockfrost-js/lib/types';
import { Responses } from '@blockfrost/blockfrost-js';
import { Schemas } from '@blockfrost/blockfrost-js/lib/types/open-api';
import { blockfrostToProviderError, fetchByAddressSequentially } from '../../util';

export class BlockfrostUtxoProvider extends BlockfrostProvider implements UtxoProvider {
protected async fetchUtxos(addr: Cardano.PaymentAddress, pagination: PaginationOptions): Promise<Cardano.Utxo[]> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from './BlockfrostClientFactory';
export * from './BlockfrostToCore';
export * from './blockfrostUtil';
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3414,6 +3414,7 @@ __metadata:
dependencies:
"@blockfrost/blockfrost-js": ^5.7.0
"@cardano-sdk/core": "workspace:~"
"@cardano-sdk/crypto": "workspace:~"
"@cardano-sdk/util": "workspace:~"
"@cardano-sdk/util-dev": "workspace:~"
"@types/lodash": ^4.14.182
Expand Down

0 comments on commit 59d6083

Please sign in to comment.