@dhedge/backend-flatcoin-core 0.3.19 → 0.3.21
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/flatcoin-errors.js +44 -0
- package/dist/contracts/abi/v2/order-announcement-module.d.ts +51 -0
- package/dist/contracts/abi/v2/order-announcement-module.js +107 -0
- package/dist/contracts/abi/v2/order-execution-module.d.ts +35 -0
- package/dist/contracts/abi/v2/order-execution-module.js +87 -0
- package/dist/entity/multichain-config.d.ts +2 -0
- package/dist/entity/multichain-config.js +8 -0
- package/package.json +1 -1
|
@@ -521,4 +521,48 @@ exports.FlatcoinErrors = [
|
|
|
521
521
|
name: 'DelayedOrderInvalid',
|
|
522
522
|
type: 'error',
|
|
523
523
|
},
|
|
524
|
+
{ inputs: [], name: 'NotInitializing', type: 'error' },
|
|
525
|
+
{
|
|
526
|
+
inputs: [{ internalType: 'address', name: 'account', type: 'address' }],
|
|
527
|
+
name: 'AddressInsufficientBalance',
|
|
528
|
+
type: 'error',
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
inputs: [{ internalType: 'uint256', name: 'tokenId', type: 'uint256' }],
|
|
532
|
+
name: 'LimitOrderInvalid',
|
|
533
|
+
type: 'error',
|
|
534
|
+
},
|
|
535
|
+
{ inputs: [], name: 'ReentrancyGuardReentrantCall', type: 'error' },
|
|
536
|
+
{
|
|
537
|
+
inputs: [{ internalType: 'address', name: 'token', type: 'address' }],
|
|
538
|
+
name: 'SafeERC20FailedOperation',
|
|
539
|
+
type: 'error',
|
|
540
|
+
},
|
|
541
|
+
{ inputs: [{ internalType: 'address', name: 'target', type: 'address' }], name: 'AddressEmptyCode', type: 'error' },
|
|
542
|
+
{
|
|
543
|
+
inputs: [{ internalType: 'address', name: 'account', type: 'address' }],
|
|
544
|
+
name: 'AddressInsufficientBalance',
|
|
545
|
+
type: 'error',
|
|
546
|
+
},
|
|
547
|
+
{ inputs: [], name: 'FailedInnerCall', type: 'error' },
|
|
548
|
+
{ inputs: [], name: 'InvalidInitialization', type: 'error' },
|
|
549
|
+
{
|
|
550
|
+
inputs: [
|
|
551
|
+
{ internalType: 'uint256', name: 'stopLossPrice', type: 'uint256' },
|
|
552
|
+
{ internalType: 'uint256', name: 'profitTakePrice', type: 'uint256' },
|
|
553
|
+
],
|
|
554
|
+
name: 'InvalidLimitOrderPrices',
|
|
555
|
+
type: 'error',
|
|
556
|
+
},
|
|
557
|
+
{ inputs: [], name: 'MaxPositionsReached', type: 'error' },
|
|
558
|
+
{
|
|
559
|
+
inputs: [{ internalType: 'address', name: 'caller', type: 'address' }],
|
|
560
|
+
name: 'OnlyAuthorizedCaller',
|
|
561
|
+
type: 'error',
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
inputs: [{ internalType: 'address', name: 'account', type: 'address' }],
|
|
565
|
+
name: 'UnauthorizedReceiver',
|
|
566
|
+
type: 'error',
|
|
567
|
+
},
|
|
524
568
|
];
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export declare const OrderAnnouncementModule: ({
|
|
2
|
+
inputs: never[];
|
|
3
|
+
stateMutability: string;
|
|
4
|
+
type: string;
|
|
5
|
+
anonymous?: undefined;
|
|
6
|
+
name?: undefined;
|
|
7
|
+
outputs?: undefined;
|
|
8
|
+
} | {
|
|
9
|
+
anonymous: boolean;
|
|
10
|
+
inputs: {
|
|
11
|
+
indexed: boolean;
|
|
12
|
+
internalType: string;
|
|
13
|
+
name: string;
|
|
14
|
+
type: string;
|
|
15
|
+
}[];
|
|
16
|
+
name: string;
|
|
17
|
+
type: string;
|
|
18
|
+
stateMutability?: undefined;
|
|
19
|
+
outputs?: undefined;
|
|
20
|
+
} | {
|
|
21
|
+
inputs: {
|
|
22
|
+
internalType: string;
|
|
23
|
+
name: string;
|
|
24
|
+
type: string;
|
|
25
|
+
}[];
|
|
26
|
+
name: string;
|
|
27
|
+
outputs: {
|
|
28
|
+
components: {
|
|
29
|
+
internalType: string;
|
|
30
|
+
name: string;
|
|
31
|
+
type: string;
|
|
32
|
+
}[];
|
|
33
|
+
internalType: string;
|
|
34
|
+
name: string;
|
|
35
|
+
type: string;
|
|
36
|
+
}[];
|
|
37
|
+
stateMutability: string;
|
|
38
|
+
type: string;
|
|
39
|
+
anonymous?: undefined;
|
|
40
|
+
} | {
|
|
41
|
+
inputs: never[];
|
|
42
|
+
name: string;
|
|
43
|
+
outputs: {
|
|
44
|
+
internalType: string;
|
|
45
|
+
name: string;
|
|
46
|
+
type: string;
|
|
47
|
+
}[];
|
|
48
|
+
stateMutability: string;
|
|
49
|
+
type: string;
|
|
50
|
+
anonymous?: undefined;
|
|
51
|
+
})[];
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OrderAnnouncementModule = void 0;
|
|
4
|
+
exports.OrderAnnouncementModule = [
|
|
5
|
+
{ inputs: [], stateMutability: 'nonpayable', type: 'constructor' },
|
|
6
|
+
{
|
|
7
|
+
anonymous: false,
|
|
8
|
+
inputs: [
|
|
9
|
+
{ indexed: false, internalType: 'address', name: 'account', type: 'address' },
|
|
10
|
+
{ indexed: false, internalType: 'uint256', name: 'tokenId', type: 'uint256' },
|
|
11
|
+
{ indexed: false, internalType: 'uint256', name: 'stopLossPrice', type: 'uint256' },
|
|
12
|
+
{ indexed: false, internalType: 'uint256', name: 'profitTakePrice', type: 'uint256' },
|
|
13
|
+
],
|
|
14
|
+
name: 'LimitOrderAnnounced',
|
|
15
|
+
type: 'event',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
anonymous: false,
|
|
19
|
+
inputs: [
|
|
20
|
+
{ indexed: false, internalType: 'address', name: 'account', type: 'address' },
|
|
21
|
+
{ indexed: false, internalType: 'uint256', name: 'tokenId', type: 'uint256' },
|
|
22
|
+
],
|
|
23
|
+
name: 'LimitOrderCancelled',
|
|
24
|
+
type: 'event',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
anonymous: false,
|
|
28
|
+
inputs: [
|
|
29
|
+
{ indexed: false, internalType: 'address', name: 'account', type: 'address' },
|
|
30
|
+
{ indexed: false, internalType: 'enum OrderType', name: 'orderType', type: 'uint8' },
|
|
31
|
+
{ indexed: false, internalType: 'uint256', name: 'keeperFee', type: 'uint256' },
|
|
32
|
+
],
|
|
33
|
+
name: 'OrderAnnounced',
|
|
34
|
+
type: 'event',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
inputs: [
|
|
38
|
+
{ internalType: 'uint256', name: 'tokenId_', type: 'uint256' },
|
|
39
|
+
{ internalType: 'address', name: 'positionOwner_', type: 'address' },
|
|
40
|
+
{ internalType: 'uint256', name: 'stopLossPrice_', type: 'uint256' },
|
|
41
|
+
{ internalType: 'uint256', name: 'profitTakePrice_', type: 'uint256' },
|
|
42
|
+
],
|
|
43
|
+
name: 'createLimitOrder',
|
|
44
|
+
outputs: [],
|
|
45
|
+
stateMutability: 'nonpayable',
|
|
46
|
+
type: 'function',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
inputs: [{ internalType: 'uint256', name: 'tokenId_', type: 'uint256' }],
|
|
50
|
+
name: 'deleteLimitOrder',
|
|
51
|
+
outputs: [],
|
|
52
|
+
stateMutability: 'nonpayable',
|
|
53
|
+
type: 'function',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
inputs: [{ internalType: 'address', name: 'account_', type: 'address' }],
|
|
57
|
+
name: 'deleteOrder',
|
|
58
|
+
outputs: [],
|
|
59
|
+
stateMutability: 'nonpayable',
|
|
60
|
+
type: 'function',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
inputs: [{ internalType: 'address', name: 'account_', type: 'address' }],
|
|
64
|
+
name: 'getAnnouncedOrder',
|
|
65
|
+
outputs: [
|
|
66
|
+
{
|
|
67
|
+
components: [
|
|
68
|
+
{ internalType: 'enum OrderType', name: 'orderType', type: 'uint8' },
|
|
69
|
+
{ internalType: 'uint256', name: 'keeperFee', type: 'uint256' },
|
|
70
|
+
{ internalType: 'uint64', name: 'executableAtTime', type: 'uint64' },
|
|
71
|
+
{ internalType: 'bytes', name: 'orderData', type: 'bytes' },
|
|
72
|
+
],
|
|
73
|
+
internalType: 'struct Order',
|
|
74
|
+
name: 'order_',
|
|
75
|
+
type: 'tuple',
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
stateMutability: 'view',
|
|
79
|
+
type: 'function',
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
inputs: [{ internalType: 'uint256', name: 'tokenId_', type: 'uint256' }],
|
|
83
|
+
name: 'getLimitOrder',
|
|
84
|
+
outputs: [
|
|
85
|
+
{
|
|
86
|
+
components: [
|
|
87
|
+
{ internalType: 'enum OrderType', name: 'orderType', type: 'uint8' },
|
|
88
|
+
{ internalType: 'uint256', name: 'keeperFee', type: 'uint256' },
|
|
89
|
+
{ internalType: 'uint64', name: 'executableAtTime', type: 'uint64' },
|
|
90
|
+
{ internalType: 'bytes', name: 'orderData', type: 'bytes' },
|
|
91
|
+
],
|
|
92
|
+
internalType: 'struct Order',
|
|
93
|
+
name: 'order_',
|
|
94
|
+
type: 'tuple',
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
stateMutability: 'view',
|
|
98
|
+
type: 'function',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
inputs: [],
|
|
102
|
+
name: 'minExecutabilityAge',
|
|
103
|
+
outputs: [{ internalType: 'uint64', name: '', type: 'uint64' }],
|
|
104
|
+
stateMutability: 'view',
|
|
105
|
+
type: 'function',
|
|
106
|
+
},
|
|
107
|
+
];
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare const OrderExecutionModule: ({
|
|
2
|
+
inputs: never[];
|
|
3
|
+
stateMutability: string;
|
|
4
|
+
type: string;
|
|
5
|
+
anonymous?: undefined;
|
|
6
|
+
name?: undefined;
|
|
7
|
+
outputs?: undefined;
|
|
8
|
+
} | {
|
|
9
|
+
anonymous: boolean;
|
|
10
|
+
inputs: {
|
|
11
|
+
indexed: boolean;
|
|
12
|
+
internalType: string;
|
|
13
|
+
name: string;
|
|
14
|
+
type: string;
|
|
15
|
+
}[];
|
|
16
|
+
name: string;
|
|
17
|
+
type: string;
|
|
18
|
+
stateMutability?: undefined;
|
|
19
|
+
outputs?: undefined;
|
|
20
|
+
} | {
|
|
21
|
+
inputs: {
|
|
22
|
+
internalType: string;
|
|
23
|
+
name: string;
|
|
24
|
+
type: string;
|
|
25
|
+
}[];
|
|
26
|
+
name: string;
|
|
27
|
+
outputs: {
|
|
28
|
+
internalType: string;
|
|
29
|
+
name: string;
|
|
30
|
+
type: string;
|
|
31
|
+
}[];
|
|
32
|
+
stateMutability: string;
|
|
33
|
+
type: string;
|
|
34
|
+
anonymous?: undefined;
|
|
35
|
+
})[];
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OrderExecutionModule = void 0;
|
|
4
|
+
exports.OrderExecutionModule = [
|
|
5
|
+
{ inputs: [], stateMutability: 'nonpayable', type: 'constructor' },
|
|
6
|
+
{
|
|
7
|
+
anonymous: false,
|
|
8
|
+
inputs: [
|
|
9
|
+
{ indexed: false, internalType: 'uint256', name: 'tokenId', type: 'uint256' },
|
|
10
|
+
{
|
|
11
|
+
indexed: false,
|
|
12
|
+
internalType: 'enum OrderExecutionModule.LimitOrderExecutionType',
|
|
13
|
+
name: 'executionType',
|
|
14
|
+
type: 'uint8',
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
name: 'LimitOrderExecuted',
|
|
18
|
+
type: 'event',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
anonymous: false,
|
|
22
|
+
inputs: [
|
|
23
|
+
{ indexed: false, internalType: 'address', name: 'account', type: 'address' },
|
|
24
|
+
{ indexed: false, internalType: 'enum OrderType', name: 'orderType', type: 'uint8' },
|
|
25
|
+
],
|
|
26
|
+
name: 'OrderCancelled',
|
|
27
|
+
type: 'event',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
anonymous: false,
|
|
31
|
+
inputs: [
|
|
32
|
+
{ indexed: false, internalType: 'address', name: 'account', type: 'address' },
|
|
33
|
+
{ indexed: false, internalType: 'enum OrderType', name: 'orderType', type: 'uint8' },
|
|
34
|
+
{ indexed: false, internalType: 'uint256', name: 'keeperFee', type: 'uint256' },
|
|
35
|
+
],
|
|
36
|
+
name: 'OrderExecuted',
|
|
37
|
+
type: 'event',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
inputs: [{ internalType: 'address', name: 'account_', type: 'address' }],
|
|
41
|
+
name: 'cancelExistingOrder',
|
|
42
|
+
outputs: [],
|
|
43
|
+
stateMutability: 'nonpayable',
|
|
44
|
+
type: 'function',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
inputs: [{ internalType: 'address', name: 'account_', type: 'address' }],
|
|
48
|
+
name: 'cancelOrderByModule',
|
|
49
|
+
outputs: [],
|
|
50
|
+
stateMutability: 'nonpayable',
|
|
51
|
+
type: 'function',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
inputs: [
|
|
55
|
+
{ internalType: 'uint256', name: 'tokenId_', type: 'uint256' },
|
|
56
|
+
{ internalType: 'bytes[]', name: 'priceUpdateData_', type: 'bytes[]' },
|
|
57
|
+
],
|
|
58
|
+
name: 'executeLimitOrder',
|
|
59
|
+
outputs: [],
|
|
60
|
+
stateMutability: 'payable',
|
|
61
|
+
type: 'function',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
inputs: [
|
|
65
|
+
{ internalType: 'address', name: 'account_', type: 'address' },
|
|
66
|
+
{ internalType: 'bytes[]', name: 'priceUpdateData_', type: 'bytes[]' },
|
|
67
|
+
],
|
|
68
|
+
name: 'executeOrder',
|
|
69
|
+
outputs: [],
|
|
70
|
+
stateMutability: 'payable',
|
|
71
|
+
type: 'function',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
inputs: [{ internalType: 'address', name: 'account_', type: 'address' }],
|
|
75
|
+
name: 'hasOrderExpired',
|
|
76
|
+
outputs: [{ internalType: 'bool', name: 'expired_', type: 'bool' }],
|
|
77
|
+
stateMutability: 'view',
|
|
78
|
+
type: 'function',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
inputs: [],
|
|
82
|
+
name: 'maxExecutabilityAge',
|
|
83
|
+
outputs: [{ internalType: 'uint64', name: '', type: 'uint64' }],
|
|
84
|
+
stateMutability: 'view',
|
|
85
|
+
type: 'function',
|
|
86
|
+
},
|
|
87
|
+
];
|
|
@@ -70,6 +70,14 @@ __decorate([
|
|
|
70
70
|
(0, typeorm_1.Column)({ name: 'limit_order_contract', nullable: false }),
|
|
71
71
|
__metadata("design:type", String)
|
|
72
72
|
], MultichainConfig.prototype, "limitOrderContract", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, typeorm_1.Column)({ name: 'order_announcement_module_contract', nullable: true }),
|
|
75
|
+
__metadata("design:type", String)
|
|
76
|
+
], MultichainConfig.prototype, "orderAnnouncementModuleContract", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, typeorm_1.Column)({ name: 'order_execution_module_contract', nullable: true }),
|
|
79
|
+
__metadata("design:type", String)
|
|
80
|
+
], MultichainConfig.prototype, "orderExecutionModuleContract", void 0);
|
|
73
81
|
exports.MultichainConfig = MultichainConfig = __decorate([
|
|
74
82
|
(0, typeorm_1.Entity)({ name: 'multichain_config' })
|
|
75
83
|
], MultichainConfig);
|