added test method

This commit is contained in:
Alex Kraiz
2023-10-02 10:38:05 +04:00
parent e4009d297b
commit cf33e8b841
4 changed files with 23 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@orionprotocol/sdk",
"version": "0.19.89-rc18",
"version": "0.19.89-rc19",
"description": "Orion Protocol SDK",
"main": "./lib/index.cjs",
"module": "./lib/index.js",

View File

@@ -4,6 +4,7 @@ import {
listAmountResponseSchema,
listNFTOrderResponseSchema,
listPoolResponseSchema,
testIncrementorSchema,
veORNInfoResponseSchema,
votingInfoResponseSchema
} from './schemas/index.js';
@@ -187,6 +188,17 @@ class IntegratorService {
});
}
readonly testRetrieve = () => {
return fetchWithValidation(this.apiUrl, testIncrementorSchema, {
method: 'POST',
body: this.makeRPCPayload({
model: 'Incrementer',
method: 'retrieve',
params: [],
}),
});
}
private readonly getK = (time: number) => {
const currentTime = time < LOCK_START_TIME ? LOCK_START_TIME : time;

View File

@@ -5,3 +5,4 @@ export { default as listPoolResponseSchema } from './list-pool-response-schema.j
export { default as veORNInfoResponseSchema } from './veORN-info-schema.js';
export { default as listAmountResponseSchema } from './list-amount-schema.js';
export { default as votingInfoResponseSchema } from './voting-info-schema.js';
export { default as testIncrementorSchema } from './test-incrementor-schema.js';

View File

@@ -0,0 +1,9 @@
import { z } from 'zod';
import infoSchema from './info-schema.js';
const testIncrementorSchema = z.object({
result: z.number().int(),
info: infoSchema,
});
export default testIncrementorSchema;