mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-14 06:02:36 +03:00
Added HistoryTransactionStatus
package.json version 0.16.0-rc.8 was updated
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.16.0-rc.8",
|
||||
"version": "0.16.0-rc.9",
|
||||
"description": "Orion Protocol SDK",
|
||||
"main": "./lib/esm/index.js",
|
||||
"module": "./lib/esm/index.js",
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
import { z } from 'zod';
|
||||
import { HistoryTransactionStatus } from '../../../types';
|
||||
|
||||
export enum historyTransactionType {
|
||||
WITHDRAW = 'withdrawal',
|
||||
DEPOSIT = 'deposit',
|
||||
}
|
||||
|
||||
const cfdHistoryItem = z.object({
|
||||
_id: z.string(),
|
||||
@@ -29,13 +35,14 @@ const cfdHistorySchema = z.object({
|
||||
const {
|
||||
createdAt, reason, transactionHash, amountNumber,
|
||||
} = item;
|
||||
const type = historyTransactionType[reason];
|
||||
|
||||
return {
|
||||
type: reason === 'WITHDRAW' ? 'withdrawal' : 'deposit',
|
||||
type,
|
||||
date: createdAt,
|
||||
token: 'USDT',
|
||||
amount: amountNumber,
|
||||
status: 'Done',
|
||||
status: HistoryTransactionStatus.DONE,
|
||||
transactionHash,
|
||||
user: item.address,
|
||||
};
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { z } from 'zod';
|
||||
import { HistoryTransactionStatus } from '../../../types';
|
||||
|
||||
const historySchema = z.array(z.object(
|
||||
{
|
||||
@@ -23,7 +24,7 @@ const historySchema = z.array(z.object(
|
||||
date: createdAt * 1000,
|
||||
token: item.asset,
|
||||
amount: item.amountNumber,
|
||||
status: 'Done',
|
||||
status: HistoryTransactionStatus.DONE,
|
||||
transactionHash,
|
||||
user,
|
||||
};
|
||||
|
||||
@@ -212,3 +212,10 @@ export type BalanceIssue = {
|
||||
}
|
||||
|
||||
export type Exchange = typeof exchanges[number];
|
||||
|
||||
export enum HistoryTransactionStatus {
|
||||
PENDING = 'Pending',
|
||||
DONE = 'Done',
|
||||
APPROVING = 'Approving',
|
||||
CANCELLED = 'Cancelled',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user