mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-14 06:02:36 +03:00
Merge pull request #226 from orionprotocol/get-referral-data
get referral data
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.20.32",
|
||||
"version": "0.20.33-rc1",
|
||||
"description": "Orion Protocol SDK",
|
||||
"main": "./lib/index.cjs",
|
||||
"module": "./lib/index.js",
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
type PairStatusEnum,
|
||||
pairStatusSchema,
|
||||
pricesWithQuoteAssetSchema,
|
||||
referralDataSchema,
|
||||
} from './schemas/index.js';
|
||||
import type redeemOrderSchema from '../Aggregator/schemas/redeemOrderSchema.js';
|
||||
import { sourceAtomicHistorySchema, targetAtomicHistorySchema } from './schemas/atomicHistorySchema.js';
|
||||
@@ -258,6 +259,12 @@ class BlockchainService {
|
||||
)
|
||||
};
|
||||
|
||||
getReferralData = (walletAddress: string) => fetchWithValidation(
|
||||
`${this.apiUrl}/api/referral-data/${walletAddress}`,
|
||||
referralDataSchema,
|
||||
{ headers: this.basicAuthHeaders }
|
||||
);
|
||||
|
||||
getGasPriceWei = () => fetchWithValidation(
|
||||
`${this.apiUrl}/api/gasPrice`,
|
||||
z.string(),
|
||||
|
||||
@@ -14,3 +14,4 @@ export { default as userVotesSchema } from './userVotesSchema.js';
|
||||
export { default as userEarnedSchema } from './userEarnedSchema.js';
|
||||
export { default as poolsV3InfoSchema } from './poolsV3InfoSchema.js';
|
||||
export { pricesWithQuoteAssetSchema } from './pricesWithQuoteAssetSchema.js';
|
||||
export { referralDataSchema } from './referralDataSchema.js';
|
||||
@@ -0,0 +1,6 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const referralDataSchema = z.object({
|
||||
referer: z.string(),
|
||||
isReferral: z.boolean(),
|
||||
});
|
||||
Reference in New Issue
Block a user