OP-3922 update create link / sunscribe methods

This commit is contained in:
Demid
2023-05-17 17:17:20 +03:00
parent 116013f1d5
commit e9b1da8375
3 changed files with 9 additions and 11 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@orionprotocol/sdk",
"version": "0.19.1",
"version": "0.19.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@orionprotocol/sdk",
"version": "0.19.1",
"version": "0.19.2",
"license": "ISC",
"dependencies": {
"@babel/runtime": "^7.21.0",

View File

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

View File

@@ -133,30 +133,28 @@ class ReferralSystem {
);
createReferralLink = (
payload: CreateLinkPayloadType,
signature: SignatureType
payload: CreateLinkPayloadType
) =>
fetchWithValidation(`${this.apiUrl}/referer/create`, linkSchema, {
fetchWithValidation(`${this.apiUrl}/referer/create2`, linkSchema, {
headers: {
'Content-type': 'application/json',
},
method: 'POST',
body: JSON.stringify({payload, signature}),
body: JSON.stringify(payload),
});
subscribeToReferral = (
payload: SubscribePayloadType,
signature: SignatureType
payload: SubscribePayloadType
) =>
fetchWithValidation(
`${this.apiUrl}/referer/subscribe`,
`${this.apiUrl}/referer/subscribe2`,
linkSchema,
{
headers: {
'Content-type': 'application/json',
},
method: 'POST',
body: JSON.stringify({payload, signature}),
body: JSON.stringify(payload),
},
errorSchema
);