mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-28 00:28:04 +03:00
History schema change
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.5.16",
|
||||
"version": "0.5.17",
|
||||
"description": "Orion Protocol SDK",
|
||||
"main": "./lib/esm/index.js",
|
||||
"module": "./lib/esm/index.js",
|
||||
|
||||
@@ -141,10 +141,11 @@ export default async function fetchWithValidation<DataOut, DataIn, ErrorOut, Err
|
||||
|
||||
const payload = schema.safeParse(json);
|
||||
if (!payload.success) {
|
||||
const issuesMessages = payload.error.issues.map((issue) => issue.message).join(', ');
|
||||
return err({
|
||||
type: 'payloadParseError' as const,
|
||||
url,
|
||||
message: 'Can\'t recognize response payload',
|
||||
message: `Can't recognize response payload: ${issuesMessages}`,
|
||||
error: payload.error,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -6,14 +6,12 @@ const historySchema = z.array(z.object(
|
||||
amountNumber: z.string(),
|
||||
asset: z.string(),
|
||||
assetAddress: z.string(),
|
||||
contractBalance: z.string().optional(),
|
||||
contractBalance: z.string().nullable().optional(),
|
||||
createdAt: z.number(),
|
||||
transactionHash: z.string(),
|
||||
type: z.string(),
|
||||
type: z.enum(['deposit', 'withdrawal']),
|
||||
user: z.string(),
|
||||
walletBalance: z.string().optional(),
|
||||
__v: z.number(),
|
||||
_id: z.string(),
|
||||
walletBalance: z.string().nullable().optional(),
|
||||
},
|
||||
));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user