@cityofzion/bs-ethereum 3.1.7 → 3.1.8

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 = TBSEthereumName, A extends TB
16
16
  networkUrls: 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
25
  walletConnectService: IWalletConnectService<N>;
26
- fullTransactionsDataService: IFullTransactionsDataService;
26
+ fullTransactionsDataService: IFullTransactionsDataService<N>;
27
27
  constructor(name: N, network?: TBSNetwork<A>, getLedgerTransport?: TGetLedgerTransport<N>);
28
28
  _generateSigner(account: TBSAccount<N>): Promise<ethers.Signer & TypedDataSigner>;
29
29
  _buildTransferParams(intent: TTransferIntent): Promise<{
@@ -41,7 +41,7 @@ export declare class BSEthereum<N extends string = TBSEthereumName, A extends TB
41
41
  generateAccountFromPublicKey(publicKey: string): Promise<TBSAccount<N>>;
42
42
  decrypt(json: string, password: string): Promise<TBSAccount<N>>;
43
43
  encrypt(key: string, password: string): Promise<string>;
44
- transfer({ senderAccount, intents }: TTransferParams<N>): Promise<TTransactionDefault[]>;
44
+ transfer({ senderAccount, intents }: TTransferParams<N>): Promise<TTransactionDefault<N>[]>;
45
45
  calculateTransferFee(params: TTransferParams<N>): Promise<string>;
46
46
  resolveNameServiceDomain(domainName: string): Promise<string>;
47
47
  }
@@ -241,6 +241,8 @@ class BSEthereum {
241
241
  const { receiverAddress, token } = intent;
242
242
  const tokenHash = token.hash;
243
243
  transactions.push({
244
+ blockchain: this.name,
245
+ isPending: true,
244
246
  txId,
245
247
  txIdUrl: this.explorerService.buildTransactionUrl(txId),
246
248
  date: new Date().toJSON(),
@@ -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<TTransactionDefault>;
15
- getTransactionsByAddress(params: TGetTransactionsByAddressParams): Promise<TGetTransactionsByAddressResponse<TTransactionDefault>>;
14
+ getTransaction(hash: string): Promise<TTransactionDefault<N>>;
15
+ getTransactionsByAddress(params: TGetTransactionsByAddressParams): Promise<TGetTransactionsByAddressResponse<N, TTransactionDefault<N>>>;
16
16
  getContract(hash: string): Promise<TContractResponse>;
17
17
  }
@@ -167,6 +167,8 @@ class MoralisBDSEthereum extends RpcBDSEthereum_1.RpcBDSEthereum {
167
167
  await Promise.allSettled(promises);
168
168
  }
169
169
  return {
170
+ blockchain: this._service.name,
171
+ isPending: false,
170
172
  txId: hash,
171
173
  txIdUrl: this._service.explorerService.buildTransactionUrl(hash),
172
174
  block: Number(data.block_number),
@@ -253,6 +255,8 @@ class MoralisBDSEthereum extends RpcBDSEthereum_1.RpcBDSEthereum {
253
255
  });
254
256
  await Promise.allSettled(nftPromises);
255
257
  transactions.splice(index, 0, {
258
+ blockchain: this._service.name,
259
+ isPending: false,
256
260
  txId: item.hash,
257
261
  txIdUrl: this._service.explorerService.buildTransactionUrl(item.hash),
258
262
  block: Number(item.block_number),
@@ -1,13 +1,13 @@
1
1
  import { type TBalanceResponse, type IBlockchainDataService, type TBSNetworkId, type TBSToken, type TContractResponse, type TGetTransactionsByAddressParams, type TGetTransactionsByAddressResponse, type TTransactionDefault } from '@cityofzion/blockchain-service';
2
2
  import type { 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<TTransactionDefault>;
10
- getTransactionsByAddress(_params: TGetTransactionsByAddressParams): Promise<TGetTransactionsByAddressResponse<TTransactionDefault>>;
9
+ getTransaction(hash: string): Promise<TTransactionDefault<N>>;
10
+ getTransactionsByAddress(_params: TGetTransactionsByAddressParams): Promise<TGetTransactionsByAddressResponse<N, TTransactionDefault<N>>>;
11
11
  getContract(_hash: string): Promise<TContractResponse>;
12
12
  getTokenInfo(hash: string): Promise<TBSToken>;
13
13
  getBalance(address: string): Promise<TBalanceResponse[]>;
@@ -39,6 +39,8 @@ class RpcBDSEthereum {
39
39
  const toUrl = this._service.explorerService.buildAddressUrl(transaction.to);
40
40
  const timestamp = transaction.timestamp ?? 0;
41
41
  return {
42
+ blockchain: this._service.name,
43
+ isPending: false,
42
44
  txId: hash,
43
45
  txIdUrl: this._service.explorerService.buildTransactionUrl(hash),
44
46
  block: receipt.blockNumber,
@@ -1,11 +1,11 @@
1
1
  import { type IFullTransactionsDataService, type TBSNetworkId, type TExportFullTransactionsByAddressParams, type TGetFullTransactionsByAddressParams, type TGetTransactionsByAddressResponse, type TTransactionDefault } 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
  constructor(service: IBSEthereum<N, A>);
9
- getFullTransactionsByAddress({ nextPageParams, ...params }: TGetFullTransactionsByAddressParams): Promise<TGetTransactionsByAddressResponse<TTransactionDefault>>;
9
+ getFullTransactionsByAddress({ nextPageParams, ...params }: TGetFullTransactionsByAddressParams): Promise<TGetTransactionsByAddressResponse<N, TTransactionDefault<N>>>;
10
10
  exportFullTransactionsByAddress(params: TExportFullTransactionsByAddressParams): Promise<string>;
11
11
  }
@@ -41,6 +41,8 @@ class MoralisFullTransactionsDataServiceEthereum {
41
41
  const itemPromises = items.map(async ({ networkFeeAmount, ...item }, index) => {
42
42
  const txId = item.transactionID;
43
43
  const newItem = {
44
+ blockchain: __classPrivateFieldGet(this, _MoralisFullTransactionsDataServiceEthereum_service, "f").name,
45
+ isPending: false,
44
46
  txId,
45
47
  txIdUrl: __classPrivateFieldGet(this, _MoralisFullTransactionsDataServiceEthereum_service, "f").explorerService.buildTransactionUrl(txId),
46
48
  block: item.block,
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 TBSEthereumName = 'ethereum' | 'polygon' | 'base' | 'arbitrum';
6
- export interface IBSEthereum<N extends string = TBSEthereumName, A extends TBSNetworkId = TBSEthereumNetworkId> extends IBlockchainService<N, A>, IBSWithNameService, IBSWithNft, IBSWithFee<N>, IBSWithLedger<N>, IBSWithExplorer, IBSWithEncryption<N>, IBSWithWalletConnect<N>, IBSWithFullTransactions {
6
+ export interface IBSEthereum<N extends string = TBSEthereumName, A extends TBSNetworkId = TBSEthereumNetworkId> extends IBlockchainService<N, A>, IBSWithNameService, IBSWithNft, 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": "3.1.7",
3
+ "version": "3.1.8",
4
4
  "repository": "https://github.com/CityOfZion/blockchain-services",
5
5
  "license": "GPL-3.0-only",
6
6
  "author": "Coz",
@@ -19,7 +19,7 @@
19
19
  "@ledgerhq/hw-app-eth": "~7.3.0",
20
20
  "axios": "~1.13.5",
21
21
  "ethers": "5.8.0",
22
- "@cityofzion/blockchain-service": "3.1.7"
22
+ "@cityofzion/blockchain-service": "3.1.8"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@ledgerhq/hw-transport": "~6.32.0",