@cityofzion/bs-ethereum 2.16.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,14 +16,14 @@ export declare class BSEthereum<N extends string = string, A extends string = TB
16
16
  rpcNetworkUrls: string[];
17
17
  readonly defaultNetwork: TBSNetwork<A>;
18
18
  readonly availableNetworks: TBSNetwork<A>[];
19
- blockchainDataService: IBlockchainDataService;
19
+ blockchainDataService: IBlockchainDataService<N>;
20
20
  exchangeDataService: IExchangeDataService;
21
21
  ledgerService: EthersLedgerServiceEthereum<N>;
22
22
  nftDataService: INftDataService;
23
23
  explorerService: IExplorerService;
24
24
  tokenService: ITokenService;
25
- walletConnectService: IWalletConnectService;
26
- fullTransactionsDataService: IFullTransactionsDataService;
25
+ walletConnectService: IWalletConnectService<N>;
26
+ fullTransactionsDataService: IFullTransactionsDataService<N>;
27
27
  constructor(name: N, evm?: TSupportedEVM, network?: TBSNetwork<A>, getLedgerTransport?: TGetLedgerTransport<N>);
28
28
  protected _buildTransferParams(intent: TIntentTransferParam): Promise<{
29
29
  transactionParams: ethers.utils.Deferrable<ethers.providers.TransactionRequest>;
@@ -11,7 +11,7 @@ export declare class MoralisBDSEthereum<N extends string, A extends TBSNetworkId
11
11
  constructor(service: IBSEthereum<N, A>);
12
12
  getBalance(address: string): Promise<TBalanceResponse[]>;
13
13
  getTokenInfo(hash: string): Promise<TBSToken>;
14
- getTransaction(hash: string): Promise<TTransaction>;
15
- getTransactionsByAddress(params: TGetTransactionsByAddressParams): Promise<TGetTransactionsByAddressResponse>;
14
+ getTransaction(hash: string): Promise<TTransaction<N>>;
15
+ getTransactionsByAddress(params: TGetTransactionsByAddressParams): Promise<TGetTransactionsByAddressResponse<N>>;
16
16
  getContract(hash: string): Promise<TContractResponse>;
17
17
  }
@@ -326,7 +326,7 @@ class MoralisBDSEthereum extends RpcBDSEthereum_1.RpcBDSEthereum {
326
326
  yield Promise.allSettled(promises);
327
327
  return {
328
328
  nextPageParams: data.cursor,
329
- data: transactions,
329
+ transactions,
330
330
  };
331
331
  });
332
332
  }
@@ -1,13 +1,13 @@
1
1
  import { TBalanceResponse, IBlockchainDataService, TBSNetworkId, TBSToken, type TContractResponse, type TGetTransactionsByAddressParams, type TGetTransactionsByAddressResponse, type TTransaction } from '@cityofzion/blockchain-service';
2
2
  import { IBSEthereum } from '../../types';
3
- export declare class RpcBDSEthereum<N extends string, A extends TBSNetworkId, S extends IBSEthereum<N, A> = IBSEthereum<N, A>> implements IBlockchainDataService {
3
+ export declare class RpcBDSEthereum<N extends string, A extends TBSNetworkId, S extends IBSEthereum<N, A> = IBSEthereum<N, A>> implements IBlockchainDataService<N> {
4
4
  #private;
5
5
  readonly maxTimeToConfirmTransactionInMs: number;
6
6
  readonly _tokenCache: Map<string, TBSToken>;
7
7
  readonly _service: S;
8
8
  constructor(service: S);
9
- getTransaction(hash: string): Promise<TTransaction>;
10
- getTransactionsByAddress(_params: TGetTransactionsByAddressParams): Promise<TGetTransactionsByAddressResponse>;
9
+ getTransaction(hash: string): Promise<TTransaction<N>>;
10
+ getTransactionsByAddress(_params: TGetTransactionsByAddressParams): Promise<TGetTransactionsByAddressResponse<N>>;
11
11
  getContract(_hash: string): Promise<TContractResponse>;
12
12
  getTokenInfo(hash: string): Promise<TBSToken>;
13
13
  getBalance(address: string): Promise<TBalanceResponse[]>;
@@ -1,12 +1,12 @@
1
1
  import { type IFullTransactionsDataService, type TBSNetworkId, type TExportFullTransactionsByAddressParams, type TGetFullTransactionsByAddressParams, type TGetTransactionsByAddressResponse } from '@cityofzion/blockchain-service';
2
2
  import type { IBSEthereum, TBSEthereumNetworkId } from '../../types';
3
- export declare class MoralisFullTransactionsDataServiceEthereum<N extends string, A extends TBSNetworkId> implements IFullTransactionsDataService {
3
+ export declare class MoralisFullTransactionsDataServiceEthereum<N extends string, A extends TBSNetworkId> implements IFullTransactionsDataService<N> {
4
4
  #private;
5
5
  static readonly SUPPORTED_NETWORKS_IDS: TBSEthereumNetworkId[];
6
6
  static readonly ERC721_STANDARDS: string[];
7
7
  static readonly ERC1155_STANDARDS: string[];
8
8
  static readonly ERC20_STANDARDS: string[];
9
9
  constructor(service: IBSEthereum<N, A>);
10
- getFullTransactionsByAddress({ nextPageParams, ...params }: TGetFullTransactionsByAddressParams): Promise<TGetTransactionsByAddressResponse>;
10
+ getFullTransactionsByAddress({ nextPageParams, ...params }: TGetFullTransactionsByAddressParams): Promise<TGetTransactionsByAddressResponse<N>>;
11
11
  exportFullTransactionsByAddress(params: TExportFullTransactionsByAddressParams): Promise<string>;
12
12
  }
@@ -46,7 +46,7 @@ class MoralisFullTransactionsDataServiceEthereum {
46
46
  var _b, _c;
47
47
  var { nextPageParams } = _a, params = __rest(_a, ["nextPageParams"]);
48
48
  blockchain_service_1.BSFullTransactionsByAddressHelper.validateFullTransactionsByAddressParams(Object.assign({ service: __classPrivateFieldGet(this, _MoralisFullTransactionsDataServiceEthereum_service, "f"), supportedNetworksIds: MoralisFullTransactionsDataServiceEthereum.SUPPORTED_NETWORKS_IDS }, params));
49
- const data = [];
49
+ const transactions = [];
50
50
  const response = yield dora_ts_1.api.EthereumREST.getFullTransactionsByAddress({
51
51
  address: params.address,
52
52
  timestampFrom: params.dateFrom,
@@ -135,10 +135,10 @@ class MoralisFullTransactionsDataServiceEthereum {
135
135
  });
136
136
  }));
137
137
  yield Promise.allSettled(eventPromises);
138
- data.splice(index, 0, newItem);
138
+ transactions.splice(index, 0, newItem);
139
139
  }));
140
140
  yield Promise.allSettled(itemPromises);
141
- return { nextPageParams: response.nextCursor, data };
141
+ return { nextPageParams: response.nextCursor, transactions };
142
142
  });
143
143
  }
144
144
  exportFullTransactionsByAddress(params) {
@@ -1,7 +1,7 @@
1
1
  import { IWalletConnectService, TBSNetworkId, TWalletConnectServiceRequestMethodParams } from '@cityofzion/blockchain-service';
2
2
  import { IBSEthereum } from '../../types';
3
3
  import { ethers } from 'ethers';
4
- export declare class WalletConnectServiceEthereum<N extends string, A extends TBSNetworkId> implements IWalletConnectService {
4
+ export declare class WalletConnectServiceEthereum<N extends string, A extends TBSNetworkId> implements IWalletConnectService<N> {
5
5
  #private;
6
6
  readonly namespace: string;
7
7
  readonly chain: string;
package/dist/types.d.ts CHANGED
@@ -3,7 +3,7 @@ import { TypedDataSigner } from '@ethersproject/abstract-signer';
3
3
  import { ethers } from 'ethers';
4
4
  export type TBSEthereumNetworkId = TBSNetworkId<'1' | '10' | '25' | '56' | '137' | '250' | '1101' | '8453' | '80002' | '42161' | '42220' | '43114' | '59144' | '11155111'>;
5
5
  export type TSupportedEVM = 'ethereum' | 'polygon' | 'base' | 'arbitrum';
6
- export interface IBSEthereum<N extends string = string, A extends string = TBSEthereumNetworkId> extends IBlockchainService<N, A>, IBSWithNft, IBSWithNameService, IBSWithFee<N>, IBSWithLedger<N>, IBSWithExplorer, IBSWithEncryption<N>, IBSWithWalletConnect, IBSWithFullTransactions {
6
+ export interface IBSEthereum<N extends string = string, A extends string = TBSEthereumNetworkId> extends IBlockchainService<N, A>, IBSWithNft, IBSWithNameService, IBSWithFee<N>, IBSWithLedger<N>, IBSWithExplorer, IBSWithEncryption<N>, IBSWithWalletConnect<N>, IBSWithFullTransactions<N> {
7
7
  generateSigner(account: TBSAccount<N>): Promise<ethers.Signer & TypedDataSigner>;
8
8
  }
9
9
  export type TMoralisBDSEthereumNativeBalanceApiResponse = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cityofzion/bs-ethereum",
3
- "version": "2.16.0",
3
+ "version": "3.0.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": "https://github.com/CityOfZion/blockchain-services",
@@ -19,7 +19,7 @@
19
19
  "@ledgerhq/hw-app-eth": "~7.3.0",
20
20
  "axios": "~1.13.2",
21
21
  "ethers": "5.8.0",
22
- "@cityofzion/blockchain-service": "1.23.0"
22
+ "@cityofzion/blockchain-service": "3.0.0"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@ledgerhq/hw-transport": "~6.32.0",
@@ -34,10 +34,11 @@
34
34
  "typescript": "~5.9.2"
35
35
  },
36
36
  "scripts": {
37
- "build": "rm -rf ./dist && tsc --project tsconfig.build.json",
37
+ "build": "rm -rf ./dist && npm run typecheck && tsc --project tsconfig.build.json",
38
38
  "test": "jest -i --config jest.config.ts",
39
39
  "lint": "eslint .",
40
40
  "format": "eslint --fix",
41
- "package": "npm run build && npm pack"
41
+ "package": "npm run build && npm pack",
42
+ "typecheck": "tsc --noEmit"
42
43
  }
43
44
  }