@dhedge/backend-flatcoin-core 0.1.22 → 0.1.23

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.
@@ -0,0 +1,24 @@
1
+ export declare const LeverageModule: ({
2
+ anonymous: boolean;
3
+ inputs: {
4
+ indexed: boolean;
5
+ internalType: string;
6
+ name: string;
7
+ type: string;
8
+ }[];
9
+ name: string;
10
+ type: string;
11
+ outputs?: undefined;
12
+ stateMutability?: undefined;
13
+ } | {
14
+ inputs: never[];
15
+ name: string;
16
+ outputs: {
17
+ internalType: string;
18
+ name: string;
19
+ type: string;
20
+ }[];
21
+ stateMutability: string;
22
+ type: string;
23
+ anonymous?: undefined;
24
+ })[];
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LeverageModule = void 0;
4
+ exports.LeverageModule = [
5
+ {
6
+ anonymous: false,
7
+ inputs: [
8
+ {
9
+ indexed: false,
10
+ internalType: 'uint256',
11
+ name: 'tokenId',
12
+ type: 'uint256',
13
+ },
14
+ ],
15
+ name: 'LeverageClose',
16
+ type: 'event',
17
+ },
18
+ {
19
+ anonymous: false,
20
+ inputs: [
21
+ {
22
+ indexed: false,
23
+ internalType: 'address',
24
+ name: 'account',
25
+ type: 'address',
26
+ },
27
+ {
28
+ indexed: false,
29
+ internalType: 'uint256',
30
+ name: 'tokenId',
31
+ type: 'uint256',
32
+ },
33
+ ],
34
+ name: 'LeverageOpen',
35
+ type: 'event',
36
+ },
37
+ {
38
+ anonymous: false,
39
+ inputs: [
40
+ {
41
+ indexed: false,
42
+ internalType: 'uint256',
43
+ name: 'tokenId',
44
+ type: 'uint256',
45
+ },
46
+ ],
47
+ name: 'LeverageAdjust',
48
+ type: 'event',
49
+ },
50
+ {
51
+ inputs: [],
52
+ name: 'tokenIdNext',
53
+ outputs: [
54
+ {
55
+ internalType: 'uint256',
56
+ name: '',
57
+ type: 'uint256',
58
+ },
59
+ ],
60
+ stateMutability: 'view',
61
+ type: 'function',
62
+ },
63
+ ];
@@ -0,0 +1,28 @@
1
+ export declare const LiquidationModule: ({
2
+ anonymous: boolean;
3
+ inputs: {
4
+ indexed: boolean;
5
+ internalType: string;
6
+ name: string;
7
+ type: string;
8
+ }[];
9
+ name: string;
10
+ type: string;
11
+ outputs?: undefined;
12
+ stateMutability?: undefined;
13
+ } | {
14
+ inputs: {
15
+ internalType: string;
16
+ name: string;
17
+ type: string;
18
+ }[];
19
+ name: string;
20
+ outputs: {
21
+ internalType: string;
22
+ name: string;
23
+ type: string;
24
+ }[];
25
+ stateMutability: string;
26
+ type: string;
27
+ anonymous?: undefined;
28
+ })[];
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LiquidationModule = void 0;
4
+ exports.LiquidationModule = [
5
+ {
6
+ anonymous: false,
7
+ inputs: [
8
+ {
9
+ indexed: false,
10
+ internalType: 'uint256',
11
+ name: 'tokenId',
12
+ type: 'uint256',
13
+ },
14
+ {
15
+ indexed: false,
16
+ internalType: 'address',
17
+ name: 'liquidator',
18
+ type: 'address',
19
+ },
20
+ {
21
+ indexed: false,
22
+ internalType: 'uint256',
23
+ name: 'liquidationFee',
24
+ type: 'uint256',
25
+ },
26
+ ],
27
+ name: 'PositionLiquidated',
28
+ type: 'event',
29
+ },
30
+ {
31
+ inputs: [
32
+ {
33
+ internalType: 'uint256',
34
+ name: 'tokenId',
35
+ type: 'uint256',
36
+ },
37
+ ],
38
+ name: 'liquidate',
39
+ outputs: [],
40
+ stateMutability: 'nonpayable',
41
+ type: 'function',
42
+ },
43
+ {
44
+ inputs: [
45
+ {
46
+ internalType: 'uint256',
47
+ name: 'tokenID',
48
+ type: 'uint256',
49
+ },
50
+ {
51
+ internalType: 'bytes[]',
52
+ name: 'priceUpdateData',
53
+ type: 'bytes[]',
54
+ },
55
+ ],
56
+ name: 'liquidate',
57
+ outputs: [],
58
+ stateMutability: 'payable',
59
+ type: 'function',
60
+ },
61
+ {
62
+ inputs: [
63
+ {
64
+ internalType: 'uint256',
65
+ name: 'tokenId',
66
+ type: 'uint256',
67
+ },
68
+ ],
69
+ name: 'canLiquidate',
70
+ outputs: [
71
+ {
72
+ internalType: 'bool',
73
+ name: 'liquidatable',
74
+ type: 'bool',
75
+ },
76
+ ],
77
+ stateMutability: 'view',
78
+ type: 'function',
79
+ },
80
+ {
81
+ inputs: [
82
+ {
83
+ internalType: 'uint256',
84
+ name: 'tokenId',
85
+ type: 'uint256',
86
+ },
87
+ ],
88
+ name: 'liquidationPrice',
89
+ outputs: [
90
+ {
91
+ internalType: 'uint256',
92
+ name: 'liqPrice',
93
+ type: 'uint256',
94
+ },
95
+ ],
96
+ stateMutability: 'view',
97
+ type: 'function',
98
+ },
99
+ ];
@@ -13,6 +13,77 @@ exports.Viewer = [
13
13
  stateMutability: 'nonpayable',
14
14
  type: 'constructor',
15
15
  },
16
+ {
17
+ inputs: [
18
+ {
19
+ internalType: 'uint256',
20
+ name: 'tokenIdFrom',
21
+ type: 'uint256',
22
+ },
23
+ {
24
+ internalType: 'uint256',
25
+ name: 'tokenIdTo',
26
+ type: 'uint256',
27
+ },
28
+ ],
29
+ name: 'getPositionData',
30
+ outputs: [
31
+ {
32
+ components: [
33
+ {
34
+ internalType: 'uint256',
35
+ name: 'tokenId',
36
+ type: 'uint256',
37
+ },
38
+ {
39
+ internalType: 'uint256',
40
+ name: 'lastPrice',
41
+ type: 'uint256',
42
+ },
43
+ {
44
+ internalType: 'uint256',
45
+ name: 'marginDeposited',
46
+ type: 'uint256',
47
+ },
48
+ {
49
+ internalType: 'uint256',
50
+ name: 'additionalSize',
51
+ type: 'uint256',
52
+ },
53
+ {
54
+ internalType: 'int256',
55
+ name: 'entryCumulativeFunding',
56
+ type: 'int256',
57
+ },
58
+ {
59
+ internalType: 'int256',
60
+ name: 'profitLoss',
61
+ type: 'int256',
62
+ },
63
+ {
64
+ internalType: 'int256',
65
+ name: 'accruedFunding',
66
+ type: 'int256',
67
+ },
68
+ {
69
+ internalType: 'int256',
70
+ name: 'marginAfterSettlement',
71
+ type: 'int256',
72
+ },
73
+ {
74
+ internalType: 'uint256',
75
+ name: 'liquidationPrice',
76
+ type: 'uint256',
77
+ },
78
+ ],
79
+ internalType: 'struct FlatcoinStructs.LeveragePositionData[]',
80
+ name: 'positionData',
81
+ type: 'tuple[]',
82
+ },
83
+ ],
84
+ stateMutability: 'view',
85
+ type: 'function',
86
+ },
16
87
  {
17
88
  inputs: [
18
89
  {
@@ -32,7 +103,7 @@ exports.Viewer = [
32
103
  },
33
104
  {
34
105
  internalType: 'uint256',
35
- name: 'lastPrice',
106
+ name: 'entryPrice',
36
107
  type: 'uint256',
37
108
  },
38
109
  {
@@ -1,4 +1,6 @@
1
1
  export { FlatcoinV1 } from './abi/flatcoin-v1';
2
2
  export { Viewer } from './abi/viewer';
3
3
  export { FlatcoinErrors } from './abi/flatcoin-errors';
4
+ export { LeverageModule } from './abi/leverage-module';
5
+ export { LiquidationModule } from './abi/liquidation-module';
4
6
  export * from './helpers';
@@ -14,11 +14,15 @@ 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.FlatcoinErrors = exports.Viewer = exports.FlatcoinV1 = void 0;
17
+ exports.LiquidationModule = exports.LeverageModule = exports.FlatcoinErrors = 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
22
  var flatcoin_errors_1 = require("./abi/flatcoin-errors");
23
23
  Object.defineProperty(exports, "FlatcoinErrors", { enumerable: true, get: function () { return flatcoin_errors_1.FlatcoinErrors; } });
24
+ var leverage_module_1 = require("./abi/leverage-module");
25
+ Object.defineProperty(exports, "LeverageModule", { enumerable: true, get: function () { return leverage_module_1.LeverageModule; } });
26
+ var liquidation_module_1 = require("./abi/liquidation-module");
27
+ Object.defineProperty(exports, "LiquidationModule", { enumerable: true, get: function () { return liquidation_module_1.LiquidationModule; } });
24
28
  __exportStar(require("./helpers"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhedge/backend-flatcoin-core",
3
- "version": "0.1.22",
3
+ "version": "0.1.23",
4
4
  "description": "Backend Flatcoin Core",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",