mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-15 14:42:38 +03:00
Добавлен новый метод для получения адреса реферрала
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user