Skip to content

Commit

Permalink
Merge pull request #220 from proximax-foundry/develop
Browse files Browse the repository at this point in the history
Release v1.4.0
  • Loading branch information
shinneng authored Aug 1, 2023
2 parents 9a46f29 + 0d273b2 commit 2f6eb0c
Show file tree
Hide file tree
Showing 53 changed files with 5,076 additions and 1,836 deletions.
2,233 changes: 781 additions & 1,452 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "explorer-vite",
"version": "1.3.0",
"version": "1.4.0",
"private": true,
"scripts": {
"dev": "vite ",
Expand Down Expand Up @@ -28,8 +28,8 @@
"mitt": "^3.0.0",
"primeicons": "^5.0.0",
"primevue": "^3.21.0",
"rxjs": "^7.8.0",
"tsjs-xpx-chain-sdk": "^0.9.20",
"rxjs": "^7.8.1",
"tsjs-xpx-chain-sdk": "^0.10.1",
"utf-8-validate": "^5.0.10",
"v-tooltip": "^2.1.3",
"vite-plugin-node-polyfills": "^0.7.0",
Expand Down Expand Up @@ -57,5 +57,8 @@
"typescript": "~4.7.4",
"vite": "^4.0.0",
"vue-tsc": "^1.0.12"
},
"overrides": {
"semver":"^7.5.3"
}
}
7 changes: 7 additions & 0 deletions src/assets/img/transform_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 19 additions & 24 deletions src/models/REST/account.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { lastValueFrom } from "rxjs";
import {
AccountHttp,
NetworkHttp,
Expand All @@ -21,81 +22,75 @@ export class AccountAPI {
}

getAccountInfo(address: Address): Promise<AccountInfo> {
return this.accountHttp.getAccountInfo(address).toPromise();
return lastValueFrom(this.accountHttp.getAccountInfo(address));
}

aggregateBondedTransactions(
publicAccount: PublicAccount,
queryParams?: TransactionQueryParams
): Promise<AggregateTransaction[]> {
return this.accountHttp
.aggregateBondedTransactions(publicAccount, queryParams)
.toPromise();
return lastValueFrom(this.accountHttp
.aggregateBondedTransactions(publicAccount, queryParams));
}

getAccountRestrictions(address: Address): Promise<AccountRestrictionsInfo> {
return this.accountHttp.getAccountRestrictions(address).toPromise();
return lastValueFrom(this.accountHttp.getAccountRestrictions(address));
}

getAccountRestrictionsFromAccounts(
addresses: Address[]
): Promise<AccountRestrictionsInfo[]> {
return this.accountHttp
.getAccountRestrictionsFromAccounts(addresses)
.toPromise();
return lastValueFrom(this.accountHttp
.getAccountRestrictionsFromAccounts(addresses));
}

getAccountsInfo(addresses: Address[]): Promise<AccountInfo[]> {
return this.accountHttp.getAccountsInfo(addresses).toPromise();
return lastValueFrom(this.accountHttp.getAccountsInfo(addresses));
}

getAccountsNames(addresses: Address[]): Promise<AccountNames[]> {
return this.accountHttp.getAccountsNames(addresses).toPromise();
return lastValueFrom(this.accountHttp.getAccountsNames(addresses));
}

getMultisigAccountGraphInfo(
address: Address
): Promise<MultisigAccountGraphInfo> {
return this.accountHttp.getMultisigAccountGraphInfo(address).toPromise();
return lastValueFrom(this.accountHttp.getMultisigAccountGraphInfo(address));
}

getMultisigAccountInfo(address: Address): Promise<MultisigAccountInfo> {
return this.accountHttp.getMultisigAccountInfo(address).toPromise();
return lastValueFrom(this.accountHttp.getMultisigAccountInfo(address));
}

transactions(
publicAccount: PublicAccount,
queryParams?: TransactionQueryParams
): Promise<Transaction[]> {
return this.accountHttp
.transactions(publicAccount, queryParams)
.toPromise();
return lastValueFrom(this.accountHttp
.transactions(publicAccount, queryParams));
}

incomingTransactions(
accountId: Address | PublicAccount,
queryParams?: TransactionQueryParams
): Promise<Transaction[]> {
return this.accountHttp
.incomingTransactions(accountId, queryParams)
.toPromise();
return lastValueFrom(this.accountHttp
.incomingTransactions(accountId, queryParams));
}

outgoingTransactions(
publicAccount: PublicAccount,
queryParams?: TransactionQueryParams
): Promise<Transaction[]> {
return this.accountHttp
.outgoingTransactions(publicAccount, queryParams)
.toPromise();
return lastValueFrom(this.accountHttp
.outgoingTransactions(publicAccount, queryParams));
}

unconfirmedTransactions(
publicAccount: PublicAccount,
queryParams?: TransactionQueryParams
): Promise<Transaction[]> {
return this.accountHttp
.unconfirmedTransactions(publicAccount, queryParams)
.toPromise();
return lastValueFrom(this.accountHttp
.unconfirmedTransactions(publicAccount, queryParams));
}
}
13 changes: 7 additions & 6 deletions src/models/REST/asset.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { lastValueFrom } from "rxjs";
import {
MosaicHttp,
NetworkHttp,
Expand All @@ -19,29 +20,29 @@ export class AssetAPI {
}

getMosaic(mosaicId: MosaicId): Promise<MosaicInfo> {
return this.mosaicHttp.getMosaic(mosaicId).toPromise();
return lastValueFrom(this.mosaicHttp.getMosaic(mosaicId));
}

getMosaicRichlist(
mosaicId: MosaicId,
queryParams?: PageQueryParams
): Promise<RichlistEntry[]> {
return this.mosaicHttp.getMosaicRichlist(mosaicId, queryParams).toPromise();
return lastValueFrom(this.mosaicHttp.getMosaicRichlist(mosaicId, queryParams));
}

getMosaics(mosaicIds: MosaicId[]): Promise<MosaicInfo[]> {
return this.mosaicHttp.getMosaics(mosaicIds).toPromise();
return lastValueFrom(this.mosaicHttp.getMosaics(mosaicIds));
}

getMosaicsNames(mosaicIds: MosaicId[]): Promise<MosaicNames[]> {
return this.mosaicHttp.getMosaicsNames(mosaicIds).toPromise();
return lastValueFrom(this.mosaicHttp.getMosaicsNames(mosaicIds));
}

getMosaicLevy(mosaicId: MosaicId): Promise<MosaicLevy> {
return this.mosaicHttp.getMosaicLevy(mosaicId).toPromise();
return lastValueFrom(this.mosaicHttp.getMosaicLevy(mosaicId));
}

searchMosaics(queryParams: MosaicQueryParams): Promise<MosaicSearch> {
return this.mosaicHttp.searchMosaics(queryParams).toPromise();
return lastValueFrom(this.mosaicHttp.searchMosaics(queryParams));
}
}
16 changes: 8 additions & 8 deletions src/models/REST/block.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { lastValueFrom } from "rxjs";
import {
BlockHttp,
NetworkHttp,
Expand All @@ -16,39 +17,38 @@ export class BlockAPI {
}

getBlockByHeight(height: number): Promise<BlockInfo> {
return this.blockHttp.getBlockByHeight(height).toPromise();
return lastValueFrom(this.blockHttp.getBlockByHeight(height));
}

getBlockReceipts(height: number): Promise<Statement> {
return this.blockHttp.getBlockReceipts(height).toPromise();
return lastValueFrom(this.blockHttp.getBlockReceipts(height));
}

getBlockTransactions(height: number): Promise<Transaction[]> {
return this.blockHttp.getBlockTransactions(height).toPromise();
return lastValueFrom(this.blockHttp.getBlockTransactions(height));
}

getBlocksByHeightWithLimit(
height: number,
limitType?: LimitType
): Promise<BlockInfo[]> {
return this.blockHttp
.getBlocksByHeightWithLimit(height, limitType)
.toPromise();
return lastValueFrom(this.blockHttp
.getBlocksByHeightWithLimit(height, limitType));
}

/**
* @param height - The height of the block.
* @param hash - The hash of the receipt statement or resolution.
*/
getMerkleReceipts(height: number, hash: string): Promise<MerkleProofInfo> {
return this.blockHttp.getMerkleReceipts(height, hash).toPromise();
return lastValueFrom(this.blockHttp.getMerkleReceipts(height, hash));
}

/**
* @param height - The height of the block.
* @param hash - The hash of the transaction.
*/
getMerkleTransaction(height: number, hash: string): Promise<MerkleProofInfo> {
return this.blockHttp.getMerkleTransaction(height, hash).toPromise();
return lastValueFrom(this.blockHttp.getMerkleTransaction(height, hash));
}
}
8 changes: 4 additions & 4 deletions src/models/REST/chain.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { lastValueFrom } from "rxjs";
import { ChainHttp, BlockchainScore } from "tsjs-xpx-chain-sdk";

export class ChainAPI {
Expand All @@ -8,13 +9,12 @@ export class ChainAPI {
}

getBlockchainHeight(): Promise<number> {
return this.chainHttp
.getBlockchainHeight()
.toPromise()
return lastValueFrom(this.chainHttp
.getBlockchainHeight())
.then((blockNum) => blockNum.compact());
}

getBlockchainScore(): Promise<BlockchainScore> {
return this.chainHttp.getBlockchainScore().toPromise();
return lastValueFrom(this.chainHttp.getBlockchainScore());
}
}
3 changes: 2 additions & 1 deletion src/models/REST/chainConfig.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { lastValueFrom } from "rxjs";
import { ChainConfigHttp, ChainConfig } from "tsjs-xpx-chain-sdk";

export class ChainConfigAPI {
Expand All @@ -8,6 +9,6 @@ export class ChainConfigAPI {
}

getChainConfig(height: number): Promise<ChainConfig> {
return this.chainConfigHttp.getChainConfig(height).toPromise();
return lastValueFrom(this.chainConfigHttp.getChainConfig(height));
}
}
5 changes: 3 additions & 2 deletions src/models/REST/diagnostic.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { lastValueFrom } from "rxjs";
import {
DiagnosticHttp,
BlockchainStorageInfo,
Expand All @@ -12,10 +13,10 @@ export class DiagnosticAPI {
}

getServerInfo(): Promise<ServerInfo> {
return this.diagnosticHttp.getServerInfo().toPromise();
return lastValueFrom(this.diagnosticHttp.getServerInfo());
}

getDiagnosticStorage(): Promise<BlockchainStorageInfo> {
return this.diagnosticHttp.getDiagnosticStorage().toPromise();
return lastValueFrom(this.diagnosticHttp.getDiagnosticStorage());
}
}
7 changes: 4 additions & 3 deletions src/models/REST/exchange.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { lastValueFrom } from "rxjs";
import {
ExchangeHttp,
NetworkHttp,
Expand All @@ -19,17 +20,17 @@ export class ExchangeAPI {
getAccountExchanges(
accountId: Address | PublicAccount
): Promise<AccountExchanges | undefined> {
return this.exchangeHttp.getAccountExchanges(accountId).toPromise();
return lastValueFrom(this.exchangeHttp.getAccountExchanges(accountId));
}

getExchangeOffers(
offerType: ExchangeOfferType,
mosaicId: MosaicId
): Promise<MosaicExchange[]> {
return this.exchangeHttp.getExchangeOffers(offerType, mosaicId).toPromise();
return lastValueFrom(this.exchangeHttp.getExchangeOffers(offerType, mosaicId));
}

getExchangeList(): Promise<MosaicId[]> {
return this.exchangeHttp.getOfferList().toPromise();
return lastValueFrom(this.exchangeHttp.getOfferList());
}
}
7 changes: 4 additions & 3 deletions src/models/REST/metadata.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { lastValueFrom } from "rxjs";
import {
MetadataHttp,
NetworkHttp,
Expand All @@ -19,16 +20,16 @@ export class MetadataAPI {
*
*/
getMetadata(compositeHash: string): Promise<MetadataEntry> {
return this.metadataHttp.getMetadata(compositeHash).toPromise();
return lastValueFrom(this.metadataHttp.getMetadata(compositeHash));
}

getMetadatas(compositeHashes: string[]): Promise<MetadataEntry[]> {
return this.metadataHttp.getMetadatas(compositeHashes).toPromise();
return lastValueFrom(this.metadataHttp.getMetadatas(compositeHashes));
}

searchMetadatas(
metadataQueryParams: MetadataQueryParams
): Promise<MetadataSearch> {
return this.metadataHttp.searchMetadata(metadataQueryParams).toPromise();
return lastValueFrom(this.metadataHttp.searchMetadata(metadataQueryParams));
}
}
19 changes: 9 additions & 10 deletions src/models/REST/namespace.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { lastValueFrom } from "rxjs";
import {
NamespaceHttp,
NetworkHttp,
Expand All @@ -17,36 +18,34 @@ export class NamespaceAPI {
}

getLinkedAddress(namespaceId: NamespaceId): Promise<Address> {
return this.namespaceHttp.getLinkedAddress(namespaceId).toPromise();
return lastValueFrom(this.namespaceHttp.getLinkedAddress(namespaceId));
}

getLinkedMosaicId(namespaceId: NamespaceId): Promise<MosaicId> {
return this.namespaceHttp.getLinkedMosaicId(namespaceId).toPromise();
return lastValueFrom(this.namespaceHttp.getLinkedMosaicId(namespaceId));
}

getNamespace(namespaceId: NamespaceId): Promise<NamespaceInfo> {
return this.namespaceHttp.getNamespace(namespaceId).toPromise();
return lastValueFrom(this.namespaceHttp.getNamespace(namespaceId));
}

getNamespacesFromAccount(
address: Address,
queryParams?: QueryParams
): Promise<NamespaceInfo[]> {
return this.namespaceHttp
.getNamespacesFromAccount(address, queryParams)
.toPromise();
return lastValueFrom(this.namespaceHttp
.getNamespacesFromAccount(address, queryParams));
}

getNamespacesFromAccounts(
addresses: Address[],
queryParams?: QueryParams
): Promise<NamespaceInfo[]> {
return this.namespaceHttp
.getNamespacesFromAccounts(addresses, queryParams)
.toPromise();
return lastValueFrom(this.namespaceHttp
.getNamespacesFromAccounts(addresses, queryParams));
}

getNamespacesName(namespaceIds: NamespaceId[]): Promise<NamespaceName[]> {
return this.namespaceHttp.getNamespacesName(namespaceIds).toPromise();
return lastValueFrom(this.namespaceHttp.getNamespacesName(namespaceIds));
}
}
Loading

0 comments on commit 2f6eb0c

Please sign in to comment.