Added sourceNetworkCode filter to getSummaryRedeem

This commit is contained in:
Aleksandr Kraiz
2022-05-13 21:38:21 +04:00
parent a07a91f951
commit cd7ce6d384
2 changed files with 14 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@orionprotocol/sdk",
"version": "0.5.14",
"version": "0.5.15",
"description": "Orion Protocol SDK",
"main": "./lib/esm/index.js",
"module": "./lib/esm/index.js",

View File

@@ -92,10 +92,19 @@ class OrionBlockchain {
return `https://${this.apiUrl}/`;
}
private getSummaryRedeem = (brokerAddress: string) => fetchWithValidation(
`https://${this.apiUrl}/api/atomic/summary-redeem/${brokerAddress}`,
atomicSummarySchema,
);
private getSummaryRedeem = (brokerAddress: string, unshifted?: 1 | 0, sourceNetworkCode?: string) => {
const url = new URL(`https://${this.apiUrl}/api/atomic/summary-redeem/${brokerAddress}`);
if (unshifted) {
url.searchParams.append('unshifted', unshifted.toString());
}
if (sourceNetworkCode) {
url.searchParams.append('sourceNetworkCode', sourceNetworkCode);
}
return fetchWithValidation(
url.toString(),
atomicSummarySchema,
);
};
private getSummaryClaim = (brokerAddress: string) => fetchWithValidation(
`https://${this.apiUrl}/api/atomic/summary-claim/${brokerAddress}`,