mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-17 00:31:34 +03:00
referral history search update
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.18.21-rc1",
|
||||
"version": "0.18.21-rc2",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.18.21-rc1",
|
||||
"version": "0.18.21-rc2",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.21.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.18.21-rc1",
|
||||
"version": "0.18.21-rc2",
|
||||
"description": "Orion Protocol SDK",
|
||||
"main": "./lib/index.cjs",
|
||||
"module": "./lib/index.js",
|
||||
|
||||
@@ -65,9 +65,9 @@ class ReferralSystem {
|
||||
});
|
||||
|
||||
getMyReferral = (myWalletAddress: string) =>
|
||||
fetchWithValidation(`${this.apiUrl}/referer/view/link`, linkSchema, {
|
||||
fetchWithValidation(`${this.apiUrl}/referral/view/link`, linkSchema, {
|
||||
headers: {
|
||||
'referer-address': myWalletAddress,
|
||||
referral: myWalletAddress,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -183,7 +183,13 @@ class ReferralSystem {
|
||||
errorSchema
|
||||
);
|
||||
|
||||
getAggregatedHistory = (refererAddress: string, chainId: SupportedChainId | undefined, itemPerPage: number, page: number) => {
|
||||
getAggregatedHistory = (
|
||||
refererAddress: string,
|
||||
chainId: SupportedChainId | undefined,
|
||||
types: string[] | undefined,
|
||||
itemPerPage: number,
|
||||
page: number
|
||||
) => {
|
||||
const queryParams: Record<string, string | number> = {
|
||||
n_per_page: itemPerPage,
|
||||
page,
|
||||
@@ -194,6 +200,10 @@ class ReferralSystem {
|
||||
queryParams['chain_id'] = chainId;
|
||||
}
|
||||
|
||||
if (types !== undefined) {
|
||||
queryParams['history_filter'] = encodeURIComponent(types.join(','));
|
||||
}
|
||||
|
||||
const queryString = Object.entries(queryParams).map(([k, v]) => `${k}=${v}`).join('&')
|
||||
|
||||
return fetchWithValidation(
|
||||
|
||||
Reference in New Issue
Block a user