-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #252 from proximax-foundry/develop
Release 1.6.0
- Loading branch information
Showing
27 changed files
with
4,589 additions
and
3,995 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { firstValueFrom } from "rxjs"; | ||
import { | ||
PaginationQueryParams, | ||
HarvesterHttp, | ||
Address, | ||
PublicAccount, | ||
HarvesterInfo, | ||
HarvesterSearch | ||
} from "tsjs-xpx-chain-sdk"; | ||
|
||
export class HarvesterAPI { | ||
harvesterHttp: HarvesterHttp; | ||
|
||
constructor(endpoint: string) { | ||
this.harvesterHttp = new HarvesterHttp(endpoint); | ||
} | ||
|
||
/** | ||
* Get account harvesters info | ||
* @param accountId - account Id. | ||
*/ | ||
getAccountHarvestingHarvesterInfo(accountId: Address | PublicAccount): Promise<HarvesterInfo[]> { | ||
return firstValueFrom(this.harvesterHttp.getAccountHarvestingHarvesterInfo(accountId)); | ||
} | ||
|
||
/** | ||
* Search harvesters | ||
* @param qp - Pagination query params. | ||
*/ | ||
searchHarvesters(qp: PaginationQueryParams): Promise<HarvesterSearch> { | ||
return firstValueFrom(this.harvesterHttp | ||
.searchHarvesters(qp)); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { firstValueFrom } from "rxjs"; | ||
import { | ||
PaginationQueryParams, | ||
LiquidityProviderSearch, | ||
LiquidityProvider, | ||
LiquidityProviderHttp, | ||
} from "tsjs-xpx-chain-sdk"; | ||
|
||
export class LiquidityProviderAPI { | ||
liquidityProviderHttp: LiquidityProviderHttp; | ||
|
||
constructor(endpoint: string) { | ||
this.liquidityProviderHttp = new LiquidityProviderHttp(endpoint); | ||
} | ||
|
||
/** | ||
* Get Liquidity Provider info | ||
* @param providerKey - provider key. | ||
*/ | ||
getLiquidityProvider(providerKey: string): Promise<LiquidityProvider> { | ||
return firstValueFrom(this.liquidityProviderHttp.getLiquidityProvider(providerKey)); | ||
} | ||
|
||
/** | ||
* Search liquidity provider | ||
* @param qp - Drive query params. | ||
*/ | ||
searchLiquidityProviders(): Promise<LiquidityProviderSearch> { | ||
return firstValueFrom(this.liquidityProviderHttp | ||
.searchLiquidityProviders()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import { firstValueFrom } from "rxjs"; | ||
import { | ||
StorageHttp, | ||
DriveQueryParams, | ||
ReplicatorQueryParams, | ||
DownloadChannelQueryParams, | ||
DriveInfo, | ||
DownloadChannel, | ||
Replicator, | ||
DriveInfoSearch, | ||
DownloadChannelSearch, | ||
ReplicatorSearch, | ||
} from "tsjs-xpx-chain-sdk"; | ||
|
||
export class StorageAPI { | ||
storageHttp: StorageHttp; | ||
|
||
constructor(endpoint: string) { | ||
this.storageHttp = new StorageHttp(endpoint); | ||
} | ||
|
||
/** | ||
* Get drive info | ||
* @param accountId - account id. | ||
*/ | ||
getBcDrive(accountId: string): Promise<DriveInfo | undefined> { | ||
return firstValueFrom(this.storageHttp.getBcDrive(accountId)); | ||
} | ||
|
||
/** | ||
* Get download channel | ||
* @param channelId - Channel id. | ||
*/ | ||
getDownloadChannel(channelId: string): Promise<DownloadChannel | undefined> { | ||
return firstValueFrom(this.storageHttp | ||
.getDownloadChannel(channelId)); | ||
} | ||
|
||
/** | ||
* Get replicator from account | ||
* @param accountId - Transaction id or hash. | ||
*/ | ||
getReplicator(accountId: string): Promise<Replicator | undefined> { | ||
return firstValueFrom(this.storageHttp | ||
.getReplicator(accountId)); | ||
} | ||
|
||
/** | ||
* Search drives info | ||
* @param qp - Drive query params. | ||
*/ | ||
searchBcDrives(qp: DriveQueryParams): Promise<DriveInfoSearch> { | ||
return firstValueFrom(this.storageHttp | ||
.searchBcDrives(qp)); | ||
} | ||
|
||
/** | ||
* Search download channels info | ||
* @param qp - download channels query params. | ||
*/ | ||
searchDownloadChannels(qp: DownloadChannelQueryParams): Promise<DownloadChannelSearch> { | ||
return firstValueFrom(this.storageHttp | ||
.searchDownloadChannels(qp)); | ||
} | ||
|
||
/** | ||
* Search replicators | ||
* @param qp - Replicators query params. | ||
*/ | ||
searchReplicators(qp: ReplicatorQueryParams): Promise<ReplicatorSearch> { | ||
return firstValueFrom(this.storageHttp | ||
.searchReplicators(qp)); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.