mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-14 06:02:36 +03:00
OP-3268 [CFD] Deposit amount
Added CFDContracts endpoint package.json version update
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.16.0-rc.0",
|
||||
"version": "0.16.0-rc.1",
|
||||
"description": "Orion Protocol SDK",
|
||||
"main": "./lib/esm/index.js",
|
||||
"module": "./lib/esm/index.js",
|
||||
|
||||
@@ -15,6 +15,7 @@ import redeemOrderSchema from '../OrionAggregator/schemas/redeemOrderSchema';
|
||||
import { sourceAtomicHistorySchema, targetAtomicHistorySchema } from './schemas/atomicHistorySchema';
|
||||
import { makePartial } from '../../utils';
|
||||
import { networkCodes } from '../../constants';
|
||||
import CFDContractsSchema from './schemas/CFDContractsSchema';
|
||||
|
||||
interface IAdminAuthHeaders {
|
||||
auth: string;
|
||||
@@ -90,6 +91,7 @@ class OrionBlockchain {
|
||||
this.getBlockNumber = this.getBlockNumber.bind(this);
|
||||
this.getRedeemOrderBySecretHash = this.getRedeemOrderBySecretHash.bind(this);
|
||||
this.claimOrder = this.claimOrder.bind(this);
|
||||
this.getCFDContracts = this.getCFDContracts.bind(this);
|
||||
}
|
||||
|
||||
get orionBlockchainWsUrl() {
|
||||
@@ -377,6 +379,11 @@ class OrionBlockchain {
|
||||
body: JSON.stringify(secretHashes),
|
||||
},
|
||||
);
|
||||
|
||||
getCFDContracts = () => fetchWithValidation(
|
||||
`${this.apiUrl}/api/cfd/contracts`,
|
||||
CFDContractsSchema,
|
||||
);
|
||||
}
|
||||
|
||||
export * as schemas from './schemas';
|
||||
|
||||
17
src/services/OrionBlockchain/schemas/CFDContractsSchema.ts
Normal file
17
src/services/OrionBlockchain/schemas/CFDContractsSchema.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
const CFDContractsSchema = z.array(z.object({
|
||||
name: z.string(),
|
||||
alias: z.string(),
|
||||
address: z.string(),
|
||||
leverage: z.number(),
|
||||
soLevel: z.number(),
|
||||
shortFR: z.number(),
|
||||
longFR: z.number(),
|
||||
shortFRStored: z.number(),
|
||||
longFRStored: z.number(),
|
||||
lastFRPriceUpdateTime: z.number(),
|
||||
priceIndex: z.number(),
|
||||
}));
|
||||
|
||||
export default CFDContractsSchema;
|
||||
Reference in New Issue
Block a user