diff --git a/package.json b/package.json index 4cb557a..f52d72d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@orionprotocol/sdk", - "version": "0.15.25", + "version": "0.15.26-rc.0", "description": "Orion Protocol SDK", "main": "./lib/esm/index.js", "module": "./lib/esm/index.js", diff --git a/src/OrionUnit/index.ts b/src/OrionUnit/index.ts index 7e8c720..e305cf1 100644 --- a/src/OrionUnit/index.ts +++ b/src/OrionUnit/index.ts @@ -145,7 +145,7 @@ export default class OrionUnit { this.orionAnalytics = new OrionAnalytics(orionAnalyticsUrl); this.exchange = new Exchange(this); this.farmingManager = new FarmingManager(this); - this.referralSystem = new ReferralSystem(`${options?.api ?? customApi}/referral-api/referer`); + this.referralSystem = new ReferralSystem(`${options?.api ?? customApi}/referral-api`); } get siblings() { diff --git a/src/services/ReferralSystem/index.ts b/src/services/ReferralSystem/index.ts index 7db8219..42af467 100644 --- a/src/services/ReferralSystem/index.ts +++ b/src/services/ReferralSystem/index.ts @@ -28,14 +28,24 @@ class ReferralSystem { this.subscribeToReferral = this.subscribeToReferral.bind(this); } - getLink = (refererAddress: string) => fetchWithValidation(`${this.apiUrl}/view/link`, linkSchema, { + getLink = (refererAddress: string) => fetchWithValidation(`${this.apiUrl}/referer/view/link`, linkSchema, { headers: { 'referer-address': refererAddress, }, }); + getMyReferral = (myWalletAddress: string) => fetchWithValidation( + `${this.apiUrl}/referral/view/link`, + linkSchema, + { + headers: { + referral: myWalletAddress, + }, + }, + ); + getSubscribersList = (refererAddress: string) => fetchWithValidation( - `${this.apiUrl}/view/distinct-analytics`, + `${this.apiUrl}/referer/view/distinct-analytics`, distinctAnalyticsSchema, { headers: { @@ -45,7 +55,7 @@ class ReferralSystem { ); createReferralLink = (payload: CreateLinkPayloadType, signature: SignatureType) => fetchWithValidation( - `${this.apiUrl}/create`, + `${this.apiUrl}/referer/create`, linkSchema, { headers: { @@ -57,7 +67,7 @@ class ReferralSystem { ); subscribeToReferral = (payload: SubscribePayloadType, signature: SignatureType) => fetchWithValidation( - `${this.apiUrl}/subscribe`, + `${this.apiUrl}/referer/subscribe`, linkSchema, { headers: {