@super-protocol/sdk-js 0.14.2-beta.0 → 0.15.0
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/build/contracts/app.json +39 -580
- package/build/models/Order.d.ts +0 -4
- package/build/models/Order.js +0 -16
- package/build/models/Provider.d.ts +0 -2
- package/build/models/Provider.js +0 -14
- package/build/models/TeeOffer.d.ts +0 -7
- package/build/models/TeeOffer.js +0 -27
- package/build/staticModels/Consensus.d.ts +1 -4
- package/build/staticModels/Consensus.js +0 -67
- package/build/staticModels/Orders.d.ts +0 -1
- package/build/staticModels/Orders.js +0 -44
- package/build/types/Order.d.ts +0 -6
- package/build/types/Order.js +0 -2
- package/package.json +1 -1
package/build/contracts/app.json
CHANGED
|
@@ -1648,7 +1648,7 @@
|
|
|
1648
1648
|
},
|
|
1649
1649
|
{
|
|
1650
1650
|
"internalType": "bool",
|
|
1651
|
-
"name": "
|
|
1651
|
+
"name": "assignedToEpoch",
|
|
1652
1652
|
"type": "bool"
|
|
1653
1653
|
},
|
|
1654
1654
|
{
|
|
@@ -2224,29 +2224,6 @@
|
|
|
2224
2224
|
"stateMutability": "nonpayable",
|
|
2225
2225
|
"type": "function"
|
|
2226
2226
|
},
|
|
2227
|
-
{
|
|
2228
|
-
"inputs": [
|
|
2229
|
-
{
|
|
2230
|
-
"internalType": "address",
|
|
2231
|
-
"name": "funder",
|
|
2232
|
-
"type": "address"
|
|
2233
|
-
},
|
|
2234
|
-
{
|
|
2235
|
-
"internalType": "address",
|
|
2236
|
-
"name": "beneficiary",
|
|
2237
|
-
"type": "address"
|
|
2238
|
-
},
|
|
2239
|
-
{
|
|
2240
|
-
"internalType": "uint256",
|
|
2241
|
-
"name": "amount",
|
|
2242
|
-
"type": "uint256"
|
|
2243
|
-
}
|
|
2244
|
-
],
|
|
2245
|
-
"name": "replenishForByApp",
|
|
2246
|
-
"outputs": [],
|
|
2247
|
-
"stateMutability": "nonpayable",
|
|
2248
|
-
"type": "function"
|
|
2249
|
-
},
|
|
2250
2227
|
{
|
|
2251
2228
|
"inputs": [
|
|
2252
2229
|
{
|
|
@@ -4276,16 +4253,6 @@
|
|
|
4276
4253
|
"internalType": "bytes32",
|
|
4277
4254
|
"name": "externalId",
|
|
4278
4255
|
"type": "bytes32"
|
|
4279
|
-
},
|
|
4280
|
-
{
|
|
4281
|
-
"internalType": "uint256",
|
|
4282
|
-
"name": "expectedPrice",
|
|
4283
|
-
"type": "uint256"
|
|
4284
|
-
},
|
|
4285
|
-
{
|
|
4286
|
-
"internalType": "uint256",
|
|
4287
|
-
"name": "maxPriceSlippage",
|
|
4288
|
-
"type": "uint256"
|
|
4289
4256
|
}
|
|
4290
4257
|
],
|
|
4291
4258
|
"internalType": "struct OrderInfo",
|
|
@@ -4396,16 +4363,6 @@
|
|
|
4396
4363
|
"internalType": "bytes32",
|
|
4397
4364
|
"name": "externalId",
|
|
4398
4365
|
"type": "bytes32"
|
|
4399
|
-
},
|
|
4400
|
-
{
|
|
4401
|
-
"internalType": "uint256",
|
|
4402
|
-
"name": "expectedPrice",
|
|
4403
|
-
"type": "uint256"
|
|
4404
|
-
},
|
|
4405
|
-
{
|
|
4406
|
-
"internalType": "uint256",
|
|
4407
|
-
"name": "maxPriceSlippage",
|
|
4408
|
-
"type": "uint256"
|
|
4409
4366
|
}
|
|
4410
4367
|
],
|
|
4411
4368
|
"internalType": "struct OrderInfo",
|
|
@@ -4516,16 +4473,6 @@
|
|
|
4516
4473
|
"internalType": "bytes32",
|
|
4517
4474
|
"name": "externalId",
|
|
4518
4475
|
"type": "bytes32"
|
|
4519
|
-
},
|
|
4520
|
-
{
|
|
4521
|
-
"internalType": "uint256",
|
|
4522
|
-
"name": "expectedPrice",
|
|
4523
|
-
"type": "uint256"
|
|
4524
|
-
},
|
|
4525
|
-
{
|
|
4526
|
-
"internalType": "uint256",
|
|
4527
|
-
"name": "maxPriceSlippage",
|
|
4528
|
-
"type": "uint256"
|
|
4529
4476
|
}
|
|
4530
4477
|
],
|
|
4531
4478
|
"internalType": "struct OrderInfo",
|
|
@@ -4648,16 +4595,6 @@
|
|
|
4648
4595
|
"internalType": "bytes32",
|
|
4649
4596
|
"name": "externalId",
|
|
4650
4597
|
"type": "bytes32"
|
|
4651
|
-
},
|
|
4652
|
-
{
|
|
4653
|
-
"internalType": "uint256",
|
|
4654
|
-
"name": "expectedPrice",
|
|
4655
|
-
"type": "uint256"
|
|
4656
|
-
},
|
|
4657
|
-
{
|
|
4658
|
-
"internalType": "uint256",
|
|
4659
|
-
"name": "maxPriceSlippage",
|
|
4660
|
-
"type": "uint256"
|
|
4661
4598
|
}
|
|
4662
4599
|
],
|
|
4663
4600
|
"internalType": "struct OrderInfo",
|
|
@@ -4793,30 +4730,6 @@
|
|
|
4793
4730
|
"name": "OrderProfitUnlocked",
|
|
4794
4731
|
"type": "event"
|
|
4795
4732
|
},
|
|
4796
|
-
{
|
|
4797
|
-
"inputs": [
|
|
4798
|
-
{
|
|
4799
|
-
"internalType": "uint256",
|
|
4800
|
-
"name": "orderId",
|
|
4801
|
-
"type": "uint256"
|
|
4802
|
-
}
|
|
4803
|
-
],
|
|
4804
|
-
"name": "isOrderProfitAvailable",
|
|
4805
|
-
"outputs": [
|
|
4806
|
-
{
|
|
4807
|
-
"internalType": "bool",
|
|
4808
|
-
"name": "available",
|
|
4809
|
-
"type": "bool"
|
|
4810
|
-
},
|
|
4811
|
-
{
|
|
4812
|
-
"internalType": "uint256",
|
|
4813
|
-
"name": "profit",
|
|
4814
|
-
"type": "uint256"
|
|
4815
|
-
}
|
|
4816
|
-
],
|
|
4817
|
-
"stateMutability": "view",
|
|
4818
|
-
"type": "function"
|
|
4819
|
-
},
|
|
4820
4733
|
{
|
|
4821
4734
|
"inputs": [
|
|
4822
4735
|
{
|
|
@@ -4884,25 +4797,6 @@
|
|
|
4884
4797
|
"stateMutability": "nonpayable",
|
|
4885
4798
|
"type": "function"
|
|
4886
4799
|
},
|
|
4887
|
-
{
|
|
4888
|
-
"inputs": [
|
|
4889
|
-
{
|
|
4890
|
-
"internalType": "uint256[]",
|
|
4891
|
-
"name": "orderIds",
|
|
4892
|
-
"type": "uint256[]"
|
|
4893
|
-
}
|
|
4894
|
-
],
|
|
4895
|
-
"name": "unlockProfitByList",
|
|
4896
|
-
"outputs": [
|
|
4897
|
-
{
|
|
4898
|
-
"internalType": "uint256",
|
|
4899
|
-
"name": "ulockedIndex",
|
|
4900
|
-
"type": "uint256"
|
|
4901
|
-
}
|
|
4902
|
-
],
|
|
4903
|
-
"stateMutability": "nonpayable",
|
|
4904
|
-
"type": "function"
|
|
4905
|
-
},
|
|
4906
4800
|
{
|
|
4907
4801
|
"anonymous": false,
|
|
4908
4802
|
"inputs": [
|
|
@@ -5420,16 +5314,6 @@
|
|
|
5420
5314
|
"internalType": "bytes32",
|
|
5421
5315
|
"name": "externalId",
|
|
5422
5316
|
"type": "bytes32"
|
|
5423
|
-
},
|
|
5424
|
-
{
|
|
5425
|
-
"internalType": "uint256",
|
|
5426
|
-
"name": "expectedPrice",
|
|
5427
|
-
"type": "uint256"
|
|
5428
|
-
},
|
|
5429
|
-
{
|
|
5430
|
-
"internalType": "uint256",
|
|
5431
|
-
"name": "maxPriceSlippage",
|
|
5432
|
-
"type": "uint256"
|
|
5433
5317
|
}
|
|
5434
5318
|
],
|
|
5435
5319
|
"internalType": "struct OrderInfo",
|
|
@@ -6163,24 +6047,6 @@
|
|
|
6163
6047
|
"stateMutability": "nonpayable",
|
|
6164
6048
|
"type": "function"
|
|
6165
6049
|
},
|
|
6166
|
-
{
|
|
6167
|
-
"inputs": [
|
|
6168
|
-
{
|
|
6169
|
-
"internalType": "address",
|
|
6170
|
-
"name": "providerAuth",
|
|
6171
|
-
"type": "address"
|
|
6172
|
-
},
|
|
6173
|
-
{
|
|
6174
|
-
"internalType": "uint256",
|
|
6175
|
-
"name": "amount",
|
|
6176
|
-
"type": "uint256"
|
|
6177
|
-
}
|
|
6178
|
-
],
|
|
6179
|
-
"name": "refillProviderSecurityDepoFor",
|
|
6180
|
-
"outputs": [],
|
|
6181
|
-
"stateMutability": "nonpayable",
|
|
6182
|
-
"type": "function"
|
|
6183
|
-
},
|
|
6184
6050
|
{
|
|
6185
6051
|
"inputs": [
|
|
6186
6052
|
{
|
|
@@ -6234,154 +6100,6 @@
|
|
|
6234
6100
|
"stateMutability": "nonpayable",
|
|
6235
6101
|
"type": "function"
|
|
6236
6102
|
},
|
|
6237
|
-
{
|
|
6238
|
-
"inputs": [
|
|
6239
|
-
{
|
|
6240
|
-
"internalType": "address",
|
|
6241
|
-
"name": "authority",
|
|
6242
|
-
"type": "address"
|
|
6243
|
-
},
|
|
6244
|
-
{
|
|
6245
|
-
"internalType": "uint256",
|
|
6246
|
-
"name": "orderId",
|
|
6247
|
-
"type": "uint256"
|
|
6248
|
-
}
|
|
6249
|
-
],
|
|
6250
|
-
"name": "addLockedOrder",
|
|
6251
|
-
"outputs": [],
|
|
6252
|
-
"stateMutability": "nonpayable",
|
|
6253
|
-
"type": "function"
|
|
6254
|
-
},
|
|
6255
|
-
{
|
|
6256
|
-
"inputs": [
|
|
6257
|
-
{
|
|
6258
|
-
"internalType": "address",
|
|
6259
|
-
"name": "authority",
|
|
6260
|
-
"type": "address"
|
|
6261
|
-
},
|
|
6262
|
-
{
|
|
6263
|
-
"internalType": "uint256",
|
|
6264
|
-
"name": "tcbId",
|
|
6265
|
-
"type": "uint256"
|
|
6266
|
-
}
|
|
6267
|
-
],
|
|
6268
|
-
"name": "addLockedTcb",
|
|
6269
|
-
"outputs": [],
|
|
6270
|
-
"stateMutability": "nonpayable",
|
|
6271
|
-
"type": "function"
|
|
6272
|
-
},
|
|
6273
|
-
{
|
|
6274
|
-
"inputs": [
|
|
6275
|
-
{
|
|
6276
|
-
"internalType": "uint256[]",
|
|
6277
|
-
"name": "orderIds",
|
|
6278
|
-
"type": "uint256[]"
|
|
6279
|
-
}
|
|
6280
|
-
],
|
|
6281
|
-
"name": "getAvaliableOrderRewardsAmount",
|
|
6282
|
-
"outputs": [
|
|
6283
|
-
{
|
|
6284
|
-
"internalType": "uint256",
|
|
6285
|
-
"name": "amount",
|
|
6286
|
-
"type": "uint256"
|
|
6287
|
-
}
|
|
6288
|
-
],
|
|
6289
|
-
"stateMutability": "view",
|
|
6290
|
-
"type": "function"
|
|
6291
|
-
},
|
|
6292
|
-
{
|
|
6293
|
-
"inputs": [
|
|
6294
|
-
{
|
|
6295
|
-
"internalType": "uint256[]",
|
|
6296
|
-
"name": "tcbIds",
|
|
6297
|
-
"type": "uint256[]"
|
|
6298
|
-
}
|
|
6299
|
-
],
|
|
6300
|
-
"name": "getAvaliableTcbRewardsAmount",
|
|
6301
|
-
"outputs": [
|
|
6302
|
-
{
|
|
6303
|
-
"internalType": "uint256",
|
|
6304
|
-
"name": "amount",
|
|
6305
|
-
"type": "uint256"
|
|
6306
|
-
}
|
|
6307
|
-
],
|
|
6308
|
-
"stateMutability": "view",
|
|
6309
|
-
"type": "function"
|
|
6310
|
-
},
|
|
6311
|
-
{
|
|
6312
|
-
"inputs": [
|
|
6313
|
-
{
|
|
6314
|
-
"internalType": "address",
|
|
6315
|
-
"name": "authority",
|
|
6316
|
-
"type": "address"
|
|
6317
|
-
}
|
|
6318
|
-
],
|
|
6319
|
-
"name": "getOrdersLockedProfitList",
|
|
6320
|
-
"outputs": [
|
|
6321
|
-
{
|
|
6322
|
-
"internalType": "uint256[]",
|
|
6323
|
-
"name": "",
|
|
6324
|
-
"type": "uint256[]"
|
|
6325
|
-
}
|
|
6326
|
-
],
|
|
6327
|
-
"stateMutability": "view",
|
|
6328
|
-
"type": "function"
|
|
6329
|
-
},
|
|
6330
|
-
{
|
|
6331
|
-
"inputs": [
|
|
6332
|
-
{
|
|
6333
|
-
"internalType": "address",
|
|
6334
|
-
"name": "authority",
|
|
6335
|
-
"type": "address"
|
|
6336
|
-
}
|
|
6337
|
-
],
|
|
6338
|
-
"name": "getTcbLockedProfitList",
|
|
6339
|
-
"outputs": [
|
|
6340
|
-
{
|
|
6341
|
-
"internalType": "uint256[]",
|
|
6342
|
-
"name": "",
|
|
6343
|
-
"type": "uint256[]"
|
|
6344
|
-
}
|
|
6345
|
-
],
|
|
6346
|
-
"stateMutability": "view",
|
|
6347
|
-
"type": "function"
|
|
6348
|
-
},
|
|
6349
|
-
{
|
|
6350
|
-
"inputs": [
|
|
6351
|
-
{
|
|
6352
|
-
"internalType": "address",
|
|
6353
|
-
"name": "authority",
|
|
6354
|
-
"type": "address"
|
|
6355
|
-
},
|
|
6356
|
-
{
|
|
6357
|
-
"internalType": "uint256",
|
|
6358
|
-
"name": "orderId",
|
|
6359
|
-
"type": "uint256"
|
|
6360
|
-
}
|
|
6361
|
-
],
|
|
6362
|
-
"name": "removeLockedOrder",
|
|
6363
|
-
"outputs": [],
|
|
6364
|
-
"stateMutability": "nonpayable",
|
|
6365
|
-
"type": "function"
|
|
6366
|
-
},
|
|
6367
|
-
{
|
|
6368
|
-
"inputs": [
|
|
6369
|
-
{
|
|
6370
|
-
"internalType": "address",
|
|
6371
|
-
"name": "authority",
|
|
6372
|
-
"type": "address"
|
|
6373
|
-
},
|
|
6374
|
-
{
|
|
6375
|
-
"internalType": "uint256",
|
|
6376
|
-
"name": "tcbId",
|
|
6377
|
-
"type": "uint256"
|
|
6378
|
-
}
|
|
6379
|
-
],
|
|
6380
|
-
"name": "removeLockedTcb",
|
|
6381
|
-
"outputs": [],
|
|
6382
|
-
"stateMutability": "nonpayable",
|
|
6383
|
-
"type": "function"
|
|
6384
|
-
},
|
|
6385
6103
|
{
|
|
6386
6104
|
"inputs": [
|
|
6387
6105
|
{
|
|
@@ -7121,35 +6839,16 @@
|
|
|
7121
6839
|
"inputs": [
|
|
7122
6840
|
{
|
|
7123
6841
|
"internalType": "uint256",
|
|
7124
|
-
"name": "
|
|
6842
|
+
"name": "optionId",
|
|
7125
6843
|
"type": "uint256"
|
|
7126
6844
|
}
|
|
7127
6845
|
],
|
|
7128
|
-
"name": "
|
|
6846
|
+
"name": "isOptionExists",
|
|
7129
6847
|
"outputs": [
|
|
7130
6848
|
{
|
|
7131
|
-
"internalType": "
|
|
6849
|
+
"internalType": "bool",
|
|
7132
6850
|
"name": "",
|
|
7133
|
-
"type": "
|
|
7134
|
-
}
|
|
7135
|
-
],
|
|
7136
|
-
"stateMutability": "view",
|
|
7137
|
-
"type": "function"
|
|
7138
|
-
},
|
|
7139
|
-
{
|
|
7140
|
-
"inputs": [
|
|
7141
|
-
{
|
|
7142
|
-
"internalType": "uint256",
|
|
7143
|
-
"name": "optionId",
|
|
7144
|
-
"type": "uint256"
|
|
7145
|
-
}
|
|
7146
|
-
],
|
|
7147
|
-
"name": "isOptionExists",
|
|
7148
|
-
"outputs": [
|
|
7149
|
-
{
|
|
7150
|
-
"internalType": "bool",
|
|
7151
|
-
"name": "",
|
|
7152
|
-
"type": "bool"
|
|
6851
|
+
"type": "bool"
|
|
7153
6852
|
}
|
|
7154
6853
|
],
|
|
7155
6854
|
"stateMutability": "view",
|
|
@@ -7677,25 +7376,6 @@
|
|
|
7677
7376
|
"stateMutability": "nonpayable",
|
|
7678
7377
|
"type": "function"
|
|
7679
7378
|
},
|
|
7680
|
-
{
|
|
7681
|
-
"anonymous": false,
|
|
7682
|
-
"inputs": [
|
|
7683
|
-
{
|
|
7684
|
-
"indexed": false,
|
|
7685
|
-
"internalType": "uint256",
|
|
7686
|
-
"name": "tcbId",
|
|
7687
|
-
"type": "uint256"
|
|
7688
|
-
},
|
|
7689
|
-
{
|
|
7690
|
-
"indexed": false,
|
|
7691
|
-
"internalType": "uint256",
|
|
7692
|
-
"name": "rewards",
|
|
7693
|
-
"type": "uint256"
|
|
7694
|
-
}
|
|
7695
|
-
],
|
|
7696
|
-
"name": "TcbRewardUnlocked",
|
|
7697
|
-
"type": "event"
|
|
7698
|
-
},
|
|
7699
7379
|
{
|
|
7700
7380
|
"anonymous": false,
|
|
7701
7381
|
"inputs": [
|
|
@@ -7740,19 +7420,6 @@
|
|
|
7740
7420
|
"name": "WarningMessage",
|
|
7741
7421
|
"type": "event"
|
|
7742
7422
|
},
|
|
7743
|
-
{
|
|
7744
|
-
"inputs": [
|
|
7745
|
-
{
|
|
7746
|
-
"internalType": "uint256",
|
|
7747
|
-
"name": "tcbId",
|
|
7748
|
-
"type": "uint256"
|
|
7749
|
-
}
|
|
7750
|
-
],
|
|
7751
|
-
"name": "_unlockTcbReward",
|
|
7752
|
-
"outputs": [],
|
|
7753
|
-
"stateMutability": "nonpayable",
|
|
7754
|
-
"type": "function"
|
|
7755
|
-
},
|
|
7756
7423
|
{
|
|
7757
7424
|
"inputs": [
|
|
7758
7425
|
{
|
|
@@ -7848,7 +7515,7 @@
|
|
|
7848
7515
|
"type": "uint256"
|
|
7849
7516
|
}
|
|
7850
7517
|
],
|
|
7851
|
-
"name": "
|
|
7518
|
+
"name": "getTeeOfferLastTcbReward",
|
|
7852
7519
|
"outputs": [
|
|
7853
7520
|
{
|
|
7854
7521
|
"internalType": "uint256",
|
|
@@ -7867,7 +7534,7 @@
|
|
|
7867
7534
|
"type": "uint256"
|
|
7868
7535
|
}
|
|
7869
7536
|
],
|
|
7870
|
-
"name": "
|
|
7537
|
+
"name": "getTeeOfferViolationRate",
|
|
7871
7538
|
"outputs": [
|
|
7872
7539
|
{
|
|
7873
7540
|
"internalType": "uint256",
|
|
@@ -7886,33 +7553,28 @@
|
|
|
7886
7553
|
"type": "uint256"
|
|
7887
7554
|
}
|
|
7888
7555
|
],
|
|
7889
|
-
"name": "
|
|
7890
|
-
"outputs": [
|
|
7891
|
-
"stateMutability": "nonpayable",
|
|
7892
|
-
"type": "function"
|
|
7893
|
-
},
|
|
7894
|
-
{
|
|
7895
|
-
"inputs": [
|
|
7556
|
+
"name": "getTeeVerifiedBenchmark",
|
|
7557
|
+
"outputs": [
|
|
7896
7558
|
{
|
|
7897
7559
|
"internalType": "uint256",
|
|
7898
|
-
"name": "
|
|
7560
|
+
"name": "",
|
|
7899
7561
|
"type": "uint256"
|
|
7900
7562
|
}
|
|
7901
7563
|
],
|
|
7902
|
-
"
|
|
7903
|
-
"
|
|
7904
|
-
|
|
7905
|
-
|
|
7906
|
-
|
|
7907
|
-
"type": "bool"
|
|
7908
|
-
},
|
|
7564
|
+
"stateMutability": "view",
|
|
7565
|
+
"type": "function"
|
|
7566
|
+
},
|
|
7567
|
+
{
|
|
7568
|
+
"inputs": [
|
|
7909
7569
|
{
|
|
7910
7570
|
"internalType": "uint256",
|
|
7911
|
-
"name": "
|
|
7571
|
+
"name": "teeOfferId",
|
|
7912
7572
|
"type": "uint256"
|
|
7913
7573
|
}
|
|
7914
7574
|
],
|
|
7915
|
-
"
|
|
7575
|
+
"name": "incrTeeOfferViolationRate",
|
|
7576
|
+
"outputs": [],
|
|
7577
|
+
"stateMutability": "nonpayable",
|
|
7916
7578
|
"type": "function"
|
|
7917
7579
|
},
|
|
7918
7580
|
{
|
|
@@ -7969,25 +7631,6 @@
|
|
|
7969
7631
|
"stateMutability": "nonpayable",
|
|
7970
7632
|
"type": "function"
|
|
7971
7633
|
},
|
|
7972
|
-
{
|
|
7973
|
-
"inputs": [
|
|
7974
|
-
{
|
|
7975
|
-
"internalType": "uint256[]",
|
|
7976
|
-
"name": "tcbIds",
|
|
7977
|
-
"type": "uint256[]"
|
|
7978
|
-
}
|
|
7979
|
-
],
|
|
7980
|
-
"name": "unlockTcbRewardByList",
|
|
7981
|
-
"outputs": [
|
|
7982
|
-
{
|
|
7983
|
-
"internalType": "uint256",
|
|
7984
|
-
"name": "ulockedIndex",
|
|
7985
|
-
"type": "uint256"
|
|
7986
|
-
}
|
|
7987
|
-
],
|
|
7988
|
-
"stateMutability": "nonpayable",
|
|
7989
|
-
"type": "function"
|
|
7990
|
-
},
|
|
7991
7634
|
{
|
|
7992
7635
|
"inputs": [
|
|
7993
7636
|
{
|
|
@@ -8682,16 +8325,6 @@
|
|
|
8682
8325
|
"internalType": "bytes32",
|
|
8683
8326
|
"name": "externalId",
|
|
8684
8327
|
"type": "bytes32"
|
|
8685
|
-
},
|
|
8686
|
-
{
|
|
8687
|
-
"internalType": "uint256",
|
|
8688
|
-
"name": "expectedPrice",
|
|
8689
|
-
"type": "uint256"
|
|
8690
|
-
},
|
|
8691
|
-
{
|
|
8692
|
-
"internalType": "uint256",
|
|
8693
|
-
"name": "maxPriceSlippage",
|
|
8694
|
-
"type": "uint256"
|
|
8695
8328
|
}
|
|
8696
8329
|
],
|
|
8697
8330
|
"internalType": "struct OrderInfo",
|
|
@@ -8778,16 +8411,6 @@
|
|
|
8778
8411
|
"internalType": "bytes32",
|
|
8779
8412
|
"name": "externalId",
|
|
8780
8413
|
"type": "bytes32"
|
|
8781
|
-
},
|
|
8782
|
-
{
|
|
8783
|
-
"internalType": "uint256",
|
|
8784
|
-
"name": "expectedPrice",
|
|
8785
|
-
"type": "uint256"
|
|
8786
|
-
},
|
|
8787
|
-
{
|
|
8788
|
-
"internalType": "uint256",
|
|
8789
|
-
"name": "maxPriceSlippage",
|
|
8790
|
-
"type": "uint256"
|
|
8791
8414
|
}
|
|
8792
8415
|
],
|
|
8793
8416
|
"internalType": "struct OrderInfo[]",
|
|
@@ -9587,7 +9210,7 @@
|
|
|
9587
9210
|
},
|
|
9588
9211
|
{
|
|
9589
9212
|
"internalType": "bool",
|
|
9590
|
-
"name": "
|
|
9213
|
+
"name": "assignedToEpoch",
|
|
9591
9214
|
"type": "bool"
|
|
9592
9215
|
},
|
|
9593
9216
|
{
|
|
@@ -9657,30 +9280,6 @@
|
|
|
9657
9280
|
"stateMutability": "view",
|
|
9658
9281
|
"type": "function"
|
|
9659
9282
|
},
|
|
9660
|
-
{
|
|
9661
|
-
"inputs": [
|
|
9662
|
-
{
|
|
9663
|
-
"internalType": "uint256",
|
|
9664
|
-
"name": "tcbId",
|
|
9665
|
-
"type": "uint256"
|
|
9666
|
-
}
|
|
9667
|
-
],
|
|
9668
|
-
"name": "isTcbProfitAvailable",
|
|
9669
|
-
"outputs": [
|
|
9670
|
-
{
|
|
9671
|
-
"internalType": "bool",
|
|
9672
|
-
"name": "",
|
|
9673
|
-
"type": "bool"
|
|
9674
|
-
},
|
|
9675
|
-
{
|
|
9676
|
-
"internalType": "uint256",
|
|
9677
|
-
"name": "",
|
|
9678
|
-
"type": "uint256"
|
|
9679
|
-
}
|
|
9680
|
-
],
|
|
9681
|
-
"stateMutability": "view",
|
|
9682
|
-
"type": "function"
|
|
9683
|
-
},
|
|
9684
9283
|
{
|
|
9685
9284
|
"inputs": [
|
|
9686
9285
|
{
|
|
@@ -9931,29 +9530,6 @@
|
|
|
9931
9530
|
"stateMutability": "nonpayable",
|
|
9932
9531
|
"type": "function"
|
|
9933
9532
|
},
|
|
9934
|
-
{
|
|
9935
|
-
"inputs": [
|
|
9936
|
-
{
|
|
9937
|
-
"internalType": "address",
|
|
9938
|
-
"name": "funder",
|
|
9939
|
-
"type": "address"
|
|
9940
|
-
},
|
|
9941
|
-
{
|
|
9942
|
-
"internalType": "address",
|
|
9943
|
-
"name": "depositOwner",
|
|
9944
|
-
"type": "address"
|
|
9945
|
-
},
|
|
9946
|
-
{
|
|
9947
|
-
"internalType": "uint256",
|
|
9948
|
-
"name": "amount",
|
|
9949
|
-
"type": "uint256"
|
|
9950
|
-
}
|
|
9951
|
-
],
|
|
9952
|
-
"name": "replenishForByApp",
|
|
9953
|
-
"outputs": [],
|
|
9954
|
-
"stateMutability": "nonpayable",
|
|
9955
|
-
"type": "function"
|
|
9956
|
-
},
|
|
9957
9533
|
{
|
|
9958
9534
|
"inputs": [
|
|
9959
9535
|
{
|
|
@@ -10742,16 +10318,6 @@
|
|
|
10742
10318
|
"internalType": "bytes32",
|
|
10743
10319
|
"name": "externalId",
|
|
10744
10320
|
"type": "bytes32"
|
|
10745
|
-
},
|
|
10746
|
-
{
|
|
10747
|
-
"internalType": "uint256",
|
|
10748
|
-
"name": "expectedPrice",
|
|
10749
|
-
"type": "uint256"
|
|
10750
|
-
},
|
|
10751
|
-
{
|
|
10752
|
-
"internalType": "uint256",
|
|
10753
|
-
"name": "maxPriceSlippage",
|
|
10754
|
-
"type": "uint256"
|
|
10755
10321
|
}
|
|
10756
10322
|
],
|
|
10757
10323
|
"internalType": "struct OrderInfo",
|
|
@@ -10867,16 +10433,6 @@
|
|
|
10867
10433
|
"internalType": "bytes32",
|
|
10868
10434
|
"name": "externalId",
|
|
10869
10435
|
"type": "bytes32"
|
|
10870
|
-
},
|
|
10871
|
-
{
|
|
10872
|
-
"internalType": "uint256",
|
|
10873
|
-
"name": "expectedPrice",
|
|
10874
|
-
"type": "uint256"
|
|
10875
|
-
},
|
|
10876
|
-
{
|
|
10877
|
-
"internalType": "uint256",
|
|
10878
|
-
"name": "maxPriceSlippage",
|
|
10879
|
-
"type": "uint256"
|
|
10880
10436
|
}
|
|
10881
10437
|
],
|
|
10882
10438
|
"internalType": "struct OrderInfo",
|
|
@@ -11002,16 +10558,6 @@
|
|
|
11002
10558
|
"internalType": "bytes32",
|
|
11003
10559
|
"name": "externalId",
|
|
11004
10560
|
"type": "bytes32"
|
|
11005
|
-
},
|
|
11006
|
-
{
|
|
11007
|
-
"internalType": "uint256",
|
|
11008
|
-
"name": "expectedPrice",
|
|
11009
|
-
"type": "uint256"
|
|
11010
|
-
},
|
|
11011
|
-
{
|
|
11012
|
-
"internalType": "uint256",
|
|
11013
|
-
"name": "maxPriceSlippage",
|
|
11014
|
-
"type": "uint256"
|
|
11015
10561
|
}
|
|
11016
10562
|
],
|
|
11017
10563
|
"internalType": "struct OrderInfo",
|
|
@@ -11268,16 +10814,6 @@
|
|
|
11268
10814
|
"internalType": "bytes32",
|
|
11269
10815
|
"name": "externalId",
|
|
11270
10816
|
"type": "bytes32"
|
|
11271
|
-
},
|
|
11272
|
-
{
|
|
11273
|
-
"internalType": "uint256",
|
|
11274
|
-
"name": "expectedPrice",
|
|
11275
|
-
"type": "uint256"
|
|
11276
|
-
},
|
|
11277
|
-
{
|
|
11278
|
-
"internalType": "uint256",
|
|
11279
|
-
"name": "maxPriceSlippage",
|
|
11280
|
-
"type": "uint256"
|
|
11281
10817
|
}
|
|
11282
10818
|
],
|
|
11283
10819
|
"internalType": "struct OrderInfo",
|
|
@@ -11492,30 +11028,6 @@
|
|
|
11492
11028
|
"stateMutability": "view",
|
|
11493
11029
|
"type": "function"
|
|
11494
11030
|
},
|
|
11495
|
-
{
|
|
11496
|
-
"inputs": [
|
|
11497
|
-
{
|
|
11498
|
-
"internalType": "uint256",
|
|
11499
|
-
"name": "",
|
|
11500
|
-
"type": "uint256"
|
|
11501
|
-
}
|
|
11502
|
-
],
|
|
11503
|
-
"name": "isOrderProfitAvailable",
|
|
11504
|
-
"outputs": [
|
|
11505
|
-
{
|
|
11506
|
-
"internalType": "bool",
|
|
11507
|
-
"name": "",
|
|
11508
|
-
"type": "bool"
|
|
11509
|
-
},
|
|
11510
|
-
{
|
|
11511
|
-
"internalType": "uint256",
|
|
11512
|
-
"name": "",
|
|
11513
|
-
"type": "uint256"
|
|
11514
|
-
}
|
|
11515
|
-
],
|
|
11516
|
-
"stateMutability": "view",
|
|
11517
|
-
"type": "function"
|
|
11518
|
-
},
|
|
11519
11031
|
{
|
|
11520
11032
|
"inputs": [
|
|
11521
11033
|
{
|
|
@@ -11680,78 +11192,6 @@
|
|
|
11680
11192
|
"stateMutability": "view",
|
|
11681
11193
|
"type": "function"
|
|
11682
11194
|
},
|
|
11683
|
-
{
|
|
11684
|
-
"inputs": [
|
|
11685
|
-
{
|
|
11686
|
-
"internalType": "address",
|
|
11687
|
-
"name": "authority",
|
|
11688
|
-
"type": "address"
|
|
11689
|
-
},
|
|
11690
|
-
{
|
|
11691
|
-
"internalType": "uint256",
|
|
11692
|
-
"name": "orderId",
|
|
11693
|
-
"type": "uint256"
|
|
11694
|
-
}
|
|
11695
|
-
],
|
|
11696
|
-
"name": "addLockedOrder",
|
|
11697
|
-
"outputs": [],
|
|
11698
|
-
"stateMutability": "nonpayable",
|
|
11699
|
-
"type": "function"
|
|
11700
|
-
},
|
|
11701
|
-
{
|
|
11702
|
-
"inputs": [
|
|
11703
|
-
{
|
|
11704
|
-
"internalType": "address",
|
|
11705
|
-
"name": "authority",
|
|
11706
|
-
"type": "address"
|
|
11707
|
-
},
|
|
11708
|
-
{
|
|
11709
|
-
"internalType": "uint256",
|
|
11710
|
-
"name": "tcbId",
|
|
11711
|
-
"type": "uint256"
|
|
11712
|
-
}
|
|
11713
|
-
],
|
|
11714
|
-
"name": "addLockedTcb",
|
|
11715
|
-
"outputs": [],
|
|
11716
|
-
"stateMutability": "nonpayable",
|
|
11717
|
-
"type": "function"
|
|
11718
|
-
},
|
|
11719
|
-
{
|
|
11720
|
-
"inputs": [
|
|
11721
|
-
{
|
|
11722
|
-
"internalType": "address",
|
|
11723
|
-
"name": "authority",
|
|
11724
|
-
"type": "address"
|
|
11725
|
-
},
|
|
11726
|
-
{
|
|
11727
|
-
"internalType": "uint256",
|
|
11728
|
-
"name": "orderId",
|
|
11729
|
-
"type": "uint256"
|
|
11730
|
-
}
|
|
11731
|
-
],
|
|
11732
|
-
"name": "removeLockedOrder",
|
|
11733
|
-
"outputs": [],
|
|
11734
|
-
"stateMutability": "nonpayable",
|
|
11735
|
-
"type": "function"
|
|
11736
|
-
},
|
|
11737
|
-
{
|
|
11738
|
-
"inputs": [
|
|
11739
|
-
{
|
|
11740
|
-
"internalType": "address",
|
|
11741
|
-
"name": "authority",
|
|
11742
|
-
"type": "address"
|
|
11743
|
-
},
|
|
11744
|
-
{
|
|
11745
|
-
"internalType": "uint256",
|
|
11746
|
-
"name": "tcbId",
|
|
11747
|
-
"type": "uint256"
|
|
11748
|
-
}
|
|
11749
|
-
],
|
|
11750
|
-
"name": "removeLockedTcb",
|
|
11751
|
-
"outputs": [],
|
|
11752
|
-
"stateMutability": "nonpayable",
|
|
11753
|
-
"type": "function"
|
|
11754
|
-
},
|
|
11755
11195
|
{
|
|
11756
11196
|
"inputs": [
|
|
11757
11197
|
{
|
|
@@ -12449,6 +11889,25 @@
|
|
|
12449
11889
|
"stateMutability": "nonpayable",
|
|
12450
11890
|
"type": "function"
|
|
12451
11891
|
},
|
|
11892
|
+
{
|
|
11893
|
+
"inputs": [
|
|
11894
|
+
{
|
|
11895
|
+
"internalType": "uint256",
|
|
11896
|
+
"name": "offerId",
|
|
11897
|
+
"type": "uint256"
|
|
11898
|
+
}
|
|
11899
|
+
],
|
|
11900
|
+
"name": "getTeeOfferLastTcbReward",
|
|
11901
|
+
"outputs": [
|
|
11902
|
+
{
|
|
11903
|
+
"internalType": "uint256",
|
|
11904
|
+
"name": "",
|
|
11905
|
+
"type": "uint256"
|
|
11906
|
+
}
|
|
11907
|
+
],
|
|
11908
|
+
"stateMutability": "view",
|
|
11909
|
+
"type": "function"
|
|
11910
|
+
},
|
|
12452
11911
|
{
|
|
12453
11912
|
"inputs": [
|
|
12454
11913
|
{
|
package/build/models/Order.d.ts
CHANGED
|
@@ -26,10 +26,6 @@ declare class Order {
|
|
|
26
26
|
* Check if order is in `processing` state
|
|
27
27
|
*/
|
|
28
28
|
isOrderProcessing(): Promise<boolean>;
|
|
29
|
-
/**
|
|
30
|
-
* Function for fetching avaliable for unlock order profit.
|
|
31
|
-
*/
|
|
32
|
-
isOrderProfitAvailable(): Promise<string>;
|
|
33
29
|
/**
|
|
34
30
|
* Function for fetching order price
|
|
35
31
|
*/
|
package/build/models/Order.js
CHANGED
|
@@ -112,22 +112,6 @@ var Order = /** @class */ (function () {
|
|
|
112
112
|
});
|
|
113
113
|
});
|
|
114
114
|
};
|
|
115
|
-
/**
|
|
116
|
-
* Function for fetching avaliable for unlock order profit.
|
|
117
|
-
*/
|
|
118
|
-
Order.prototype.isOrderProfitAvailable = function () {
|
|
119
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
120
|
-
var _a, profit;
|
|
121
|
-
return __generator(this, function (_b) {
|
|
122
|
-
switch (_b.label) {
|
|
123
|
-
case 0: return [4 /*yield*/, Order.contract.methods.isOrderProfitAvailable(this.id).call()];
|
|
124
|
-
case 1:
|
|
125
|
-
_a = _b.sent(), profit = _a[1];
|
|
126
|
-
return [2 /*return*/, profit];
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
};
|
|
131
115
|
/**
|
|
132
116
|
* Function for fetching order price
|
|
133
117
|
*/
|
package/build/models/Provider.js
CHANGED
|
@@ -201,20 +201,6 @@ var Provider = /** @class */ (function () {
|
|
|
201
201
|
});
|
|
202
202
|
});
|
|
203
203
|
};
|
|
204
|
-
Provider.prototype.getOrdersLockedProfitList = function () {
|
|
205
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
206
|
-
return __generator(this, function (_a) {
|
|
207
|
-
return [2 /*return*/, Provider.contractProviders.methods.getOrdersLockedProfitList(this.providerId)];
|
|
208
|
-
});
|
|
209
|
-
});
|
|
210
|
-
};
|
|
211
|
-
Provider.prototype.getTcbLockedProfitList = function () {
|
|
212
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
213
|
-
return __generator(this, function (_a) {
|
|
214
|
-
return [2 /*return*/, Provider.contractProviders.methods.getTcbLockedProfitList(this.providerId)];
|
|
215
|
-
});
|
|
216
|
-
});
|
|
217
|
-
};
|
|
218
204
|
return Provider;
|
|
219
205
|
}());
|
|
220
206
|
exports.default = Provider;
|
|
@@ -57,13 +57,6 @@ declare class TeeOffer {
|
|
|
57
57
|
* Function for fetching TEE offer hardware info from blockchain
|
|
58
58
|
*/
|
|
59
59
|
getHardwareInfo(): Promise<HardwareInfo>;
|
|
60
|
-
/**
|
|
61
|
-
* Function for fetching TEE offer options info from blockchain
|
|
62
|
-
* @param begin - The first element of range.
|
|
63
|
-
* @param end - One past the final element in the range.
|
|
64
|
-
* @returns {Promise<TeeOfferOption[]>}
|
|
65
|
-
*/
|
|
66
|
-
getOptions(begin?: number, end?: number): Promise<TeeOfferOption[]>;
|
|
67
60
|
/**
|
|
68
61
|
* Function for fetching tee offer slot by id
|
|
69
62
|
* @param optionId - Slot ID
|
package/build/models/TeeOffer.js
CHANGED
|
@@ -178,33 +178,6 @@ var TeeOffer = /** @class */ (function () {
|
|
|
178
178
|
});
|
|
179
179
|
});
|
|
180
180
|
};
|
|
181
|
-
/**
|
|
182
|
-
* Function for fetching TEE offer options info from blockchain
|
|
183
|
-
* @param begin - The first element of range.
|
|
184
|
-
* @param end - One past the final element in the range.
|
|
185
|
-
* @returns {Promise<TeeOfferOption[]>}
|
|
186
|
-
*/
|
|
187
|
-
TeeOffer.prototype.getOptions = function (begin, end) {
|
|
188
|
-
if (begin === void 0) { begin = 0; }
|
|
189
|
-
if (end === void 0) { end = 999999; }
|
|
190
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
191
|
-
var optionsCount, teeOfferOption;
|
|
192
|
-
return __generator(this, function (_a) {
|
|
193
|
-
switch (_a.label) {
|
|
194
|
-
case 0: return [4 /*yield*/, TeeOffer.contract.methods.getTeeOfferOptionsCount(this.id).call()];
|
|
195
|
-
case 1:
|
|
196
|
-
optionsCount = +(_a.sent());
|
|
197
|
-
if (optionsCount === 0) {
|
|
198
|
-
return [2 /*return*/, []];
|
|
199
|
-
}
|
|
200
|
-
return [4 /*yield*/, TeeOffer.contract.methods.getTeeOfferOptions(this.id, begin, end).call()];
|
|
201
|
-
case 2:
|
|
202
|
-
teeOfferOption = _a.sent();
|
|
203
|
-
return [2 /*return*/, (0, utils_1.tupleToObjectsArray)(teeOfferOption, TeeOfferOption_1.TeeOfferOptionStructure)];
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
});
|
|
207
|
-
};
|
|
208
181
|
/**
|
|
209
182
|
* Function for fetching tee offer slot by id
|
|
210
183
|
* @param optionId - Slot ID
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EpochInfo } from "../types/Consensus";
|
|
2
|
-
import {
|
|
2
|
+
import { BlockInfo } from "../types/Web3";
|
|
3
3
|
import { ConsensusConstants } from "../types/Consensus";
|
|
4
4
|
declare class Consensus {
|
|
5
5
|
private static readonly logger;
|
|
@@ -10,7 +10,6 @@ declare class Consensus {
|
|
|
10
10
|
* @returns list of tcb ids
|
|
11
11
|
*/
|
|
12
12
|
static getAllTcbs(): Promise<string[]>;
|
|
13
|
-
static unlockProfitByTcbList(tcbIds: string[], transactionOptions?: TransactionOptions): Promise<void>;
|
|
14
13
|
static getEpochTime(time: number): Promise<{
|
|
15
14
|
epochStart: number;
|
|
16
15
|
epochEnd: number;
|
|
@@ -27,11 +26,9 @@ declare class Consensus {
|
|
|
27
26
|
static onTcbInitialized(callback: onTcbInitializedCallback): () => void;
|
|
28
27
|
static onTcbBenchmarkChanged(callback: onTcbBenchmarkChangedCallback): () => void;
|
|
29
28
|
static onRewardsClaimed(callback: onRewardsClaimedCallback): () => void;
|
|
30
|
-
static onTcbRewardUnlocked(callback: onTcbRewardUnlockedCallback): () => void;
|
|
31
29
|
}
|
|
32
30
|
export type onRewardsClaimedCallback = (tcbId: string, amount: string, claimer: string, block?: BlockInfo) => void;
|
|
33
31
|
export type onTcbBenchmarkChangedCallback = (tcbId: string, provider: string, block?: BlockInfo) => void;
|
|
34
|
-
export type onTcbRewardUnlockedCallback = (tcbId: string, rewards: string, block?: BlockInfo) => void;
|
|
35
32
|
export type onTcbInitializedCallback = (tcbId: string, provider: string, block?: BlockInfo) => void;
|
|
36
33
|
export type onTcbCompletedCallback = (tcbId: string, provider: string, block?: BlockInfo) => void;
|
|
37
34
|
export type onTcbBannedCallback = (tcbId: string, provider: string, block?: BlockInfo) => void;
|
|
@@ -40,12 +40,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
40
40
|
};
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
42
|
var logger_1 = __importDefault(require("../logger"));
|
|
43
|
-
var TCB_1 = __importDefault(require("../models/TCB"));
|
|
44
43
|
var utils_1 = require("../utils");
|
|
45
44
|
var Superpro_1 = __importDefault(require("./Superpro"));
|
|
46
45
|
var BlockchainConnector_1 = __importDefault(require("../connectors/BlockchainConnector"));
|
|
47
46
|
var BlockchainEventsListener_1 = __importDefault(require("../connectors/BlockchainEventsListener"));
|
|
48
|
-
var TxManager_1 = __importDefault(require("../utils/TxManager"));
|
|
49
47
|
var Consensus_1 = require("../types/Consensus");
|
|
50
48
|
var Consensus = /** @class */ (function () {
|
|
51
49
|
function Consensus() {
|
|
@@ -82,49 +80,6 @@ var Consensus = /** @class */ (function () {
|
|
|
82
80
|
});
|
|
83
81
|
});
|
|
84
82
|
};
|
|
85
|
-
Consensus.unlockProfitByTcbList = function (tcbIds, transactionOptions) {
|
|
86
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
87
|
-
var contract, executedCount, e_1, _i, tcbIds_1, tcbId;
|
|
88
|
-
return __generator(this, function (_a) {
|
|
89
|
-
switch (_a.label) {
|
|
90
|
-
case 0:
|
|
91
|
-
contract = BlockchainConnector_1.default.getInstance().getContract(transactionOptions);
|
|
92
|
-
(0, utils_1.checkIfActionAccountInitialized)(transactionOptions);
|
|
93
|
-
_a.label = 1;
|
|
94
|
-
case 1:
|
|
95
|
-
_a.trys.push([1, 3, , 4]);
|
|
96
|
-
return [4 /*yield*/, TxManager_1.default.dryRun(contract.methods.unlockTcbRewardByList, [tcbIds], transactionOptions)];
|
|
97
|
-
case 2:
|
|
98
|
-
executedCount = +(_a.sent());
|
|
99
|
-
return [3 /*break*/, 4];
|
|
100
|
-
case 3:
|
|
101
|
-
e_1 = _a.sent();
|
|
102
|
-
executedCount = 0;
|
|
103
|
-
return [3 /*break*/, 4];
|
|
104
|
-
case 4:
|
|
105
|
-
if (!(executedCount === tcbIds.length)) return [3 /*break*/, 6];
|
|
106
|
-
return [4 /*yield*/, TxManager_1.default.execute(contract.methods.unlockTcbRewardByList, [tcbIds], transactionOptions)];
|
|
107
|
-
case 5:
|
|
108
|
-
_a.sent();
|
|
109
|
-
return [3 /*break*/, 10];
|
|
110
|
-
case 6:
|
|
111
|
-
_i = 0, tcbIds_1 = tcbIds;
|
|
112
|
-
_a.label = 7;
|
|
113
|
-
case 7:
|
|
114
|
-
if (!(_i < tcbIds_1.length)) return [3 /*break*/, 10];
|
|
115
|
-
tcbId = tcbIds_1[_i];
|
|
116
|
-
return [4 /*yield*/, new TCB_1.default(tcbId).unlockRewards()];
|
|
117
|
-
case 8:
|
|
118
|
-
_a.sent();
|
|
119
|
-
_a.label = 9;
|
|
120
|
-
case 9:
|
|
121
|
-
_i++;
|
|
122
|
-
return [3 /*break*/, 7];
|
|
123
|
-
case 10: return [2 /*return*/];
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
|
-
};
|
|
128
83
|
Consensus.getEpochTime = function (time) {
|
|
129
84
|
return __awaiter(this, void 0, void 0, function () {
|
|
130
85
|
var contract, _a, epochStart, epochEnd, epochIndex;
|
|
@@ -318,28 +273,6 @@ var Consensus = /** @class */ (function () {
|
|
|
318
273
|
});
|
|
319
274
|
return function () { return subscription.unsubscribe(); };
|
|
320
275
|
};
|
|
321
|
-
Consensus.onTcbRewardUnlocked = function (callback) {
|
|
322
|
-
var _this = this;
|
|
323
|
-
var contract = BlockchainEventsListener_1.default.getInstance().getContract();
|
|
324
|
-
var logger = this.logger.child({ method: "onTcbRewardUnlocked" });
|
|
325
|
-
var subscription = contract.events
|
|
326
|
-
.TcbRewardUnlocked()
|
|
327
|
-
.on("data", function (event) { return __awaiter(_this, void 0, void 0, function () {
|
|
328
|
-
return __generator(this, function (_a) {
|
|
329
|
-
callback(event.returnValues.tcbId, event.returnValues.rewards, {
|
|
330
|
-
index: event.blockNumber,
|
|
331
|
-
hash: event.blockHash,
|
|
332
|
-
});
|
|
333
|
-
return [2 /*return*/];
|
|
334
|
-
});
|
|
335
|
-
}); })
|
|
336
|
-
.on("error", function (error, receipt) {
|
|
337
|
-
if (receipt)
|
|
338
|
-
return; // Used to avoid logging of transaction rejected
|
|
339
|
-
logger.warn(error);
|
|
340
|
-
});
|
|
341
|
-
return function () { return subscription.unsubscribe(); };
|
|
342
|
-
};
|
|
343
276
|
Consensus.logger = logger_1.default.child({ className: "Consensus" });
|
|
344
277
|
return Consensus;
|
|
345
278
|
}());
|
|
@@ -51,7 +51,6 @@ declare class Orders {
|
|
|
51
51
|
* @param transactionOptions - object what contains alternative action account or gas limit (optional)
|
|
52
52
|
*/
|
|
53
53
|
static refillOrderDeposit(orderId: string, amount: string, transactionOptions?: TransactionOptions): Promise<void>;
|
|
54
|
-
static unlockProfitByOrderList(orderIds: string[], transactionOptions?: TransactionOptions): Promise<void>;
|
|
55
54
|
/**
|
|
56
55
|
* Function for adding event listeners on order created event in orders factory contract
|
|
57
56
|
* @param callback - function for processing created order
|
|
@@ -64,7 +64,6 @@ var Superpro_1 = __importDefault(require("./Superpro"));
|
|
|
64
64
|
var TxManager_1 = __importDefault(require("../utils/TxManager"));
|
|
65
65
|
var BlockchainConnector_1 = __importDefault(require("../connectors/BlockchainConnector"));
|
|
66
66
|
var BlockchainEventsListener_1 = __importDefault(require("../connectors/BlockchainEventsListener"));
|
|
67
|
-
var Order_2 = __importDefault(require("../models/Order"));
|
|
68
67
|
var Orders = /** @class */ (function () {
|
|
69
68
|
function Orders() {
|
|
70
69
|
}
|
|
@@ -279,49 +278,6 @@ var Orders = /** @class */ (function () {
|
|
|
279
278
|
});
|
|
280
279
|
});
|
|
281
280
|
};
|
|
282
|
-
Orders.unlockProfitByOrderList = function (orderIds, transactionOptions) {
|
|
283
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
284
|
-
var contract, executedCount, e_1, _i, orderIds_1, orderId;
|
|
285
|
-
return __generator(this, function (_a) {
|
|
286
|
-
switch (_a.label) {
|
|
287
|
-
case 0:
|
|
288
|
-
contract = BlockchainConnector_1.default.getInstance().getContract(transactionOptions);
|
|
289
|
-
(0, utils_2.checkIfActionAccountInitialized)(transactionOptions);
|
|
290
|
-
_a.label = 1;
|
|
291
|
-
case 1:
|
|
292
|
-
_a.trys.push([1, 3, , 4]);
|
|
293
|
-
return [4 /*yield*/, TxManager_1.default.dryRun(contract.methods.unlockProfitByList, [orderIds], transactionOptions)];
|
|
294
|
-
case 2:
|
|
295
|
-
executedCount = +(_a.sent());
|
|
296
|
-
return [3 /*break*/, 4];
|
|
297
|
-
case 3:
|
|
298
|
-
e_1 = _a.sent();
|
|
299
|
-
executedCount = 0;
|
|
300
|
-
return [3 /*break*/, 4];
|
|
301
|
-
case 4:
|
|
302
|
-
if (!(executedCount === orderIds.length)) return [3 /*break*/, 6];
|
|
303
|
-
return [4 /*yield*/, TxManager_1.default.execute(contract.methods.unlockProfitByList, [orderIds], transactionOptions)];
|
|
304
|
-
case 5:
|
|
305
|
-
_a.sent();
|
|
306
|
-
return [3 /*break*/, 10];
|
|
307
|
-
case 6:
|
|
308
|
-
_i = 0, orderIds_1 = orderIds;
|
|
309
|
-
_a.label = 7;
|
|
310
|
-
case 7:
|
|
311
|
-
if (!(_i < orderIds_1.length)) return [3 /*break*/, 10];
|
|
312
|
-
orderId = orderIds_1[_i];
|
|
313
|
-
return [4 /*yield*/, new Order_2.default(orderId).unlockProfit()];
|
|
314
|
-
case 8:
|
|
315
|
-
_a.sent();
|
|
316
|
-
_a.label = 9;
|
|
317
|
-
case 9:
|
|
318
|
-
_i++;
|
|
319
|
-
return [3 /*break*/, 7];
|
|
320
|
-
case 10: return [2 /*return*/];
|
|
321
|
-
}
|
|
322
|
-
});
|
|
323
|
-
});
|
|
324
|
-
};
|
|
325
281
|
/**
|
|
326
282
|
* Function for adding event listeners on order created event in orders factory contract
|
|
327
283
|
* @param callback - function for processing created order
|
package/build/types/Order.d.ts
CHANGED
|
@@ -43,8 +43,6 @@ export declare const OrderInfoStructure: {
|
|
|
43
43
|
optionsCount: StringConstructor[];
|
|
44
44
|
};
|
|
45
45
|
externalId: typeof parseBytes32String;
|
|
46
|
-
expectedPrice: StringConstructor;
|
|
47
|
-
maxPriceSlippage: StringConstructor;
|
|
48
46
|
};
|
|
49
47
|
export declare const OrderInfoStructureArray: {
|
|
50
48
|
offerId: StringConstructor;
|
|
@@ -63,8 +61,6 @@ export declare const OrderInfoStructureArray: {
|
|
|
63
61
|
optionsCount: StringConstructor[];
|
|
64
62
|
};
|
|
65
63
|
externalId: typeof parseBytes32String;
|
|
66
|
-
expectedPrice: StringConstructor;
|
|
67
|
-
maxPriceSlippage: StringConstructor;
|
|
68
64
|
}[];
|
|
69
65
|
export type OrderSlots = {
|
|
70
66
|
slotId: string;
|
|
@@ -81,8 +77,6 @@ export type OrderInfo = {
|
|
|
81
77
|
args: OrderArgs;
|
|
82
78
|
slots: OrderSlots;
|
|
83
79
|
externalId: string;
|
|
84
|
-
expectedPrice: string;
|
|
85
|
-
maxPriceSlippage: string;
|
|
86
80
|
};
|
|
87
81
|
export type ExtendedOrderInfo = OrderInfo & {
|
|
88
82
|
blocking: boolean;
|
package/build/types/Order.js
CHANGED
|
@@ -37,8 +37,6 @@ exports.OrderInfoStructure = {
|
|
|
37
37
|
args: exports.OrderArgsStructure,
|
|
38
38
|
slots: exports.OrderSlotsStructure,
|
|
39
39
|
externalId: utils_1.parseBytes32String,
|
|
40
|
-
expectedPrice: String,
|
|
41
|
-
maxPriceSlippage: String,
|
|
42
40
|
};
|
|
43
41
|
// Array of order info structures
|
|
44
42
|
exports.OrderInfoStructureArray = [exports.OrderInfoStructure];
|