mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-26 07:37:44 +03:00
merged with main, removed debug, version up
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.16.0-rc.25",
|
||||
"version": "0.16.0-rc.26",
|
||||
"description": "Orion Protocol SDK",
|
||||
"main": "./lib/esm/index.js",
|
||||
"module": "./lib/esm/index.js",
|
||||
|
||||
@@ -55,18 +55,6 @@ export const signCFDOrder = async (
|
||||
isPersonalSign: usePersonalSign,
|
||||
};
|
||||
|
||||
const serialize = (o: any) => Object.keys(o).map(key => `${key}=${o[key]}`).join(';\n ');
|
||||
const debug = (name: string, o: any, title?: string) => {
|
||||
if(title) {
|
||||
console.log(`[SDK] ${title}:`)
|
||||
}
|
||||
console.log(`[SDK] ${name}:\n ${serialize(o)}`)
|
||||
console.log('[SDK] =====================================\n\n')
|
||||
}
|
||||
|
||||
debug('CFDOrder', order, 'Signing CFDOrder');
|
||||
debug('DomainData', getDomainData(chainId));
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
||||
const typedDataSigner = signer as SignerWithTypedDataSign;
|
||||
const signature = usePersonalSign
|
||||
@@ -89,8 +77,6 @@ export const signCFDOrder = async (
|
||||
signature: fixedSignature,
|
||||
};
|
||||
|
||||
debug('SignedOrder', signedOrder);
|
||||
|
||||
return signedOrder;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import fetchWithValidation from '../../fetchWithValidation';
|
||||
import { errorSchema } from './schemas';
|
||||
import distinctAnalyticsSchema from './schemas/distinctAnalyticsSchema';
|
||||
import linkSchema from './schemas/linkSchema';
|
||||
|
||||
@@ -90,6 +91,7 @@ class ReferralSystem {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ payload, signature }),
|
||||
},
|
||||
errorSchema,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
8
src/services/ReferralSystem/schemas/errorSchema.ts
Normal file
8
src/services/ReferralSystem/schemas/errorSchema.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
const errorSchema = z.object({
|
||||
status: z.string(),
|
||||
message: z.string(),
|
||||
});
|
||||
|
||||
export default errorSchema;
|
||||
@@ -1,2 +1,3 @@
|
||||
export { default as linkSchema } from './linkSchema';
|
||||
export { default as distinctAnalyticsSchema } from './distinctAnalyticsSchema';
|
||||
export { default as errorSchema } from './errorSchema';
|
||||
|
||||
Reference in New Issue
Block a user