@dhedge/backend-flatcoin-core 0.1.39 → 0.1.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contracts/abi/viewer-get-position-data.d.ts +20 -0
- package/dist/contracts/abi/viewer-get-position-data.js +81 -0
- package/dist/contracts/abi/viewer.js +10 -0
- package/dist/repository/limit-order.repository.d.ts +1 -1
- package/dist/repository/limit-order.repository.js +2 -2
- package/dist/repository/position.repository.d.ts +1 -1
- package/dist/repository/position.repository.js +3 -3
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const ViewerGetPositionData: {
|
|
2
|
+
inputs: {
|
|
3
|
+
internalType: string;
|
|
4
|
+
name: string;
|
|
5
|
+
type: string;
|
|
6
|
+
}[];
|
|
7
|
+
name: string;
|
|
8
|
+
outputs: {
|
|
9
|
+
components: {
|
|
10
|
+
internalType: string;
|
|
11
|
+
name: string;
|
|
12
|
+
type: string;
|
|
13
|
+
}[];
|
|
14
|
+
internalType: string;
|
|
15
|
+
name: string;
|
|
16
|
+
type: string;
|
|
17
|
+
}[];
|
|
18
|
+
stateMutability: string;
|
|
19
|
+
type: string;
|
|
20
|
+
}[];
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ViewerGetPositionData = void 0;
|
|
4
|
+
exports.ViewerGetPositionData = [
|
|
5
|
+
{
|
|
6
|
+
inputs: [
|
|
7
|
+
{
|
|
8
|
+
internalType: 'uint256',
|
|
9
|
+
name: 'tokenId',
|
|
10
|
+
type: 'uint256',
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
name: 'getPositionData',
|
|
14
|
+
outputs: [
|
|
15
|
+
{
|
|
16
|
+
components: [
|
|
17
|
+
{
|
|
18
|
+
internalType: 'uint256',
|
|
19
|
+
name: 'tokenId',
|
|
20
|
+
type: 'uint256',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
internalType: 'uint256',
|
|
24
|
+
name: 'lastPrice',
|
|
25
|
+
type: 'uint256',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
internalType: 'uint256',
|
|
29
|
+
name: 'marginDeposited',
|
|
30
|
+
type: 'uint256',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
internalType: 'uint256',
|
|
34
|
+
name: 'additionalSize',
|
|
35
|
+
type: 'uint256',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
internalType: 'int256',
|
|
39
|
+
name: 'entryCumulativeFunding',
|
|
40
|
+
type: 'int256',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
internalType: 'int256',
|
|
44
|
+
name: 'profitLoss',
|
|
45
|
+
type: 'int256',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
internalType: 'int256',
|
|
49
|
+
name: 'accruedFunding',
|
|
50
|
+
type: 'int256',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
internalType: 'int256',
|
|
54
|
+
name: 'marginAfterSettlement',
|
|
55
|
+
type: 'int256',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
internalType: 'uint256',
|
|
59
|
+
name: 'liquidationPrice',
|
|
60
|
+
type: 'uint256',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
internalType: 'uint256',
|
|
64
|
+
name: 'limitOrderPriceLowerThreshold',
|
|
65
|
+
type: 'uint256',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
internalType: 'uint256',
|
|
69
|
+
name: 'limitOrderPriceUpperThreshold',
|
|
70
|
+
type: 'uint256',
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
internalType: 'struct FlatcoinStructs.LeveragePositionData',
|
|
74
|
+
name: 'positionData',
|
|
75
|
+
type: 'tuple',
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
stateMutability: 'view',
|
|
79
|
+
type: 'function',
|
|
80
|
+
},
|
|
81
|
+
];
|
|
@@ -75,6 +75,16 @@ exports.Viewer = [
|
|
|
75
75
|
name: 'liquidationPrice',
|
|
76
76
|
type: 'uint256',
|
|
77
77
|
},
|
|
78
|
+
{
|
|
79
|
+
internalType: 'uint256',
|
|
80
|
+
name: 'limitOrderPriceLowerThreshold',
|
|
81
|
+
type: 'uint256',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
internalType: 'uint256',
|
|
85
|
+
name: 'limitOrderPriceUpperThreshold',
|
|
86
|
+
type: 'uint256',
|
|
87
|
+
},
|
|
78
88
|
],
|
|
79
89
|
internalType: 'struct FlatcoinStructs.LeveragePositionData[]',
|
|
80
90
|
name: 'positionData',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Repository } from 'typeorm';
|
|
2
|
-
import { LimitOrderEntity } from '../entity
|
|
2
|
+
import { LimitOrderEntity } from '../entity';
|
|
3
3
|
export declare class LimitOrderRepository {
|
|
4
4
|
private repository;
|
|
5
5
|
constructor(repository: Repository<LimitOrderEntity>);
|
|
@@ -17,7 +17,7 @@ const common_1 = require("@nestjs/common");
|
|
|
17
17
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
18
|
const typeorm_2 = require("typeorm");
|
|
19
19
|
const constants_1 = require("../constants");
|
|
20
|
-
const
|
|
20
|
+
const entity_1 = require("../entity");
|
|
21
21
|
let LimitOrderRepository = class LimitOrderRepository {
|
|
22
22
|
constructor(repository) {
|
|
23
23
|
this.repository = repository;
|
|
@@ -48,6 +48,6 @@ let LimitOrderRepository = class LimitOrderRepository {
|
|
|
48
48
|
exports.LimitOrderRepository = LimitOrderRepository;
|
|
49
49
|
exports.LimitOrderRepository = LimitOrderRepository = __decorate([
|
|
50
50
|
(0, common_1.Injectable)(),
|
|
51
|
-
__param(0, (0, typeorm_1.InjectRepository)(
|
|
51
|
+
__param(0, (0, typeorm_1.InjectRepository)(entity_1.LimitOrderEntity)),
|
|
52
52
|
__metadata("design:paramtypes", [typeorm_2.Repository])
|
|
53
53
|
], LimitOrderRepository);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Repository } from 'typeorm';
|
|
2
2
|
import { BigNumber } from 'ethers';
|
|
3
|
-
import { PositionEntity } from '../entity
|
|
3
|
+
import { PositionEntity } from '../entity';
|
|
4
4
|
export declare class PositionRepository {
|
|
5
5
|
private repository;
|
|
6
6
|
constructor(repository: Repository<PositionEntity>);
|
|
@@ -17,7 +17,7 @@ const common_1 = require("@nestjs/common");
|
|
|
17
17
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
18
|
const typeorm_2 = require("typeorm");
|
|
19
19
|
const constants_1 = require("../constants");
|
|
20
|
-
const
|
|
20
|
+
const entity_1 = require("../entity");
|
|
21
21
|
let PositionRepository = class PositionRepository {
|
|
22
22
|
constructor(repository) {
|
|
23
23
|
this.repository = repository;
|
|
@@ -38,7 +38,7 @@ let PositionRepository = class PositionRepository {
|
|
|
38
38
|
async updateLiquidationPrice(tokenId, liqPrice) {
|
|
39
39
|
await this.repository
|
|
40
40
|
.createQueryBuilder()
|
|
41
|
-
.update(
|
|
41
|
+
.update(entity_1.PositionEntity)
|
|
42
42
|
.set({ liquidationPrice: liqPrice })
|
|
43
43
|
.where('token_id = :tokenId', { tokenId: tokenId })
|
|
44
44
|
.execute();
|
|
@@ -63,6 +63,6 @@ let PositionRepository = class PositionRepository {
|
|
|
63
63
|
exports.PositionRepository = PositionRepository;
|
|
64
64
|
exports.PositionRepository = PositionRepository = __decorate([
|
|
65
65
|
(0, common_1.Injectable)(),
|
|
66
|
-
__param(0, (0, typeorm_1.InjectRepository)(
|
|
66
|
+
__param(0, (0, typeorm_1.InjectRepository)(entity_1.PositionEntity)),
|
|
67
67
|
__metadata("design:paramtypes", [typeorm_2.Repository])
|
|
68
68
|
], PositionRepository);
|