@dhedge/backend-flatcoin-core 0.1.39 → 0.1.41
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/contracts/index.d.ts +1 -0
- package/dist/contracts/index.js +3 -1
- 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,6 @@
|
|
|
1
1
|
export { FlatcoinV1 } from './abi/flatcoin-v1';
|
|
2
2
|
export { Viewer } from './abi/viewer';
|
|
3
|
+
export { ViewerGetPositionData } from './abi/viewer-get-position-data';
|
|
3
4
|
export { FlatcoinErrors } from './abi/flatcoin-errors';
|
|
4
5
|
export { LeverageModule } from './abi/leverage-module';
|
|
5
6
|
export { LiquidationModule } from './abi/liquidation-module';
|
package/dist/contracts/index.js
CHANGED
|
@@ -14,11 +14,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.LimitOrder = exports.LiquidateWithoutPriceFeeds = exports.Liquidate = exports.LiquidationModule = exports.LeverageModule = exports.FlatcoinErrors = exports.Viewer = exports.FlatcoinV1 = void 0;
|
|
17
|
+
exports.LimitOrder = exports.LiquidateWithoutPriceFeeds = exports.Liquidate = exports.LiquidationModule = exports.LeverageModule = exports.FlatcoinErrors = exports.ViewerGetPositionData = exports.Viewer = exports.FlatcoinV1 = void 0;
|
|
18
18
|
var flatcoin_v1_1 = require("./abi/flatcoin-v1");
|
|
19
19
|
Object.defineProperty(exports, "FlatcoinV1", { enumerable: true, get: function () { return flatcoin_v1_1.FlatcoinV1; } });
|
|
20
20
|
var viewer_1 = require("./abi/viewer");
|
|
21
21
|
Object.defineProperty(exports, "Viewer", { enumerable: true, get: function () { return viewer_1.Viewer; } });
|
|
22
|
+
var viewer_get_position_data_1 = require("./abi/viewer-get-position-data");
|
|
23
|
+
Object.defineProperty(exports, "ViewerGetPositionData", { enumerable: true, get: function () { return viewer_get_position_data_1.ViewerGetPositionData; } });
|
|
22
24
|
var flatcoin_errors_1 = require("./abi/flatcoin-errors");
|
|
23
25
|
Object.defineProperty(exports, "FlatcoinErrors", { enumerable: true, get: function () { return flatcoin_errors_1.FlatcoinErrors; } });
|
|
24
26
|
var leverage_module_1 = require("./abi/leverage-module");
|
|
@@ -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);
|