@reyaxyz/common 0.344.0 → 0.344.1-perpob.195

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.
Files changed (95) hide show
  1. package/README.md +1 -1
  2. package/dist/commands/exposure/command.js +8 -22
  3. package/dist/commands/exposure/command.js.map +1 -1
  4. package/dist/incentives-api-types.js.map +1 -1
  5. package/dist/rest/helpers/constants.js +12 -0
  6. package/dist/rest/helpers/constants.js.map +1 -1
  7. package/dist/trading-api-types.js.map +1 -1
  8. package/dist/transactions/abis/Errors.json +513 -34
  9. package/dist/transactions/abis/OrdersGateway.json +729 -123
  10. package/dist/transactions/abis/PassivePerpProxy.json +537 -0
  11. package/dist/transactions/buildMulticallTx.js.map +1 -1
  12. package/dist/transactions/consts.js +1 -2
  13. package/dist/transactions/consts.js.map +1 -1
  14. package/dist/transactions/contractAddresses.js +33 -4
  15. package/dist/transactions/contractAddresses.js.map +1 -1
  16. package/dist/transactions/executeTransaction.js +8 -123
  17. package/dist/transactions/executeTransaction.js.map +1 -1
  18. package/dist/transactions/sign.js +245 -80
  19. package/dist/transactions/sign.js.map +1 -1
  20. package/dist/types/commands/exposure/command.d.ts +8 -7
  21. package/dist/types/commands/exposure/command.d.ts.map +1 -1
  22. package/dist/types/incentives-api-types.d.ts +6 -2
  23. package/dist/types/incentives-api-types.d.ts.map +1 -1
  24. package/dist/types/rest/helpers/constants.d.ts +1 -1
  25. package/dist/types/rest/helpers/constants.d.ts.map +1 -1
  26. package/dist/types/trading-api-types.d.ts +123 -55
  27. package/dist/types/trading-api-types.d.ts.map +1 -1
  28. package/dist/types/transactions/buildMulticallTx.d.ts +1 -0
  29. package/dist/types/transactions/buildMulticallTx.d.ts.map +1 -1
  30. package/dist/types/transactions/consts.d.ts +0 -1
  31. package/dist/types/transactions/consts.d.ts.map +1 -1
  32. package/dist/types/transactions/contractAddresses.d.ts +1 -1
  33. package/dist/types/transactions/contractAddresses.d.ts.map +1 -1
  34. package/dist/types/transactions/executeTransaction.d.ts +2 -15
  35. package/dist/types/transactions/executeTransaction.d.ts.map +1 -1
  36. package/dist/types/transactions/sign.d.ts +52 -6
  37. package/dist/types/transactions/sign.d.ts.map +1 -1
  38. package/dist/types/types.d.ts +49 -47
  39. package/dist/types/types.d.ts.map +1 -1
  40. package/dist/types/utils/calculate.d.ts +14 -2
  41. package/dist/types/utils/calculate.d.ts.map +1 -1
  42. package/dist/types/utils/consts.d.ts +1 -2
  43. package/dist/types/utils/consts.d.ts.map +1 -1
  44. package/dist/types/utils/layerzero.d.ts +22 -0
  45. package/dist/types/utils/layerzero.d.ts.map +1 -0
  46. package/dist/types/utils/token/batch-token-getters.d.ts +0 -5
  47. package/dist/types/utils/token/batch-token-getters.d.ts.map +1 -1
  48. package/dist/types/utils/token/token-getters.d.ts +0 -2
  49. package/dist/types/utils/token/token-getters.d.ts.map +1 -1
  50. package/dist/types.js +41 -11
  51. package/dist/types.js.map +1 -1
  52. package/dist/utils/calculate.js +137 -16
  53. package/dist/utils/calculate.js.map +1 -1
  54. package/dist/utils/consts.js +1 -7
  55. package/dist/utils/consts.js.map +1 -1
  56. package/dist/utils/layerzero.js +31 -0
  57. package/dist/utils/layerzero.js.map +1 -0
  58. package/dist/utils/token/batch-token-getters.js +13 -64
  59. package/dist/utils/token/batch-token-getters.js.map +1 -1
  60. package/dist/utils/token/token-getters.js +1 -42
  61. package/dist/utils/token/token-getters.js.map +1 -1
  62. package/package.json +2 -2
  63. package/src/commands/exposure/command.ts +8 -38
  64. package/src/incentives-api-types.ts +11 -5
  65. package/src/rest/helpers/constants.ts +22 -0
  66. package/src/trading-api-types.ts +142 -80
  67. package/src/transactions/abis/Errors.json +4362 -3883
  68. package/src/transactions/abis/OrdersGateway.json +730 -124
  69. package/src/transactions/abis/PassivePerpProxy.json +537 -0
  70. package/src/transactions/buildMulticallTx.ts +4 -0
  71. package/src/transactions/consts.ts +0 -1
  72. package/src/transactions/contractAddresses.ts +34 -4
  73. package/src/transactions/executeTransaction.ts +2 -130
  74. package/src/transactions/sign.ts +299 -93
  75. package/src/types.ts +88 -56
  76. package/src/utils/calculate.ts +181 -21
  77. package/src/utils/consts.ts +1 -16
  78. package/src/utils/layerzero.ts +66 -0
  79. package/src/utils/token/batch-token-getters.ts +0 -28
  80. package/src/utils/token/token-getters.ts +0 -29
  81. package/dist/types/utils/layerzero/index.d.ts +0 -3
  82. package/dist/types/utils/layerzero/index.d.ts.map +0 -1
  83. package/dist/types/utils/layerzero/oft-config.d.ts +0 -4
  84. package/dist/types/utils/layerzero/oft-config.d.ts.map +0 -1
  85. package/dist/types/utils/layerzero/types.d.ts +0 -23
  86. package/dist/types/utils/layerzero/types.d.ts.map +0 -1
  87. package/dist/utils/layerzero/index.js +0 -19
  88. package/dist/utils/layerzero/index.js.map +0 -1
  89. package/dist/utils/layerzero/oft-config.js +0 -29
  90. package/dist/utils/layerzero/oft-config.js.map +0 -1
  91. package/dist/utils/layerzero/types.js +0 -3
  92. package/dist/utils/layerzero/types.js.map +0 -1
  93. package/src/utils/layerzero/index.ts +0 -2
  94. package/src/utils/layerzero/oft-config.ts +0 -32
  95. package/src/utils/layerzero/types.ts +0 -25
@@ -1777,39 +1777,6 @@
1777
1777
  }
1778
1778
  ]
1779
1779
  },
1780
- {
1781
- "type": "error",
1782
- "name": "InvalidMatchOrderFees",
1783
- "inputs": [
1784
- {
1785
- "name": "matchOrderFees",
1786
- "type": "tuple",
1787
- "internalType": "struct MatchOrderFees",
1788
- "components": [
1789
- {
1790
- "name": "protocolFeeCredit",
1791
- "type": "uint256",
1792
- "internalType": "uint256"
1793
- },
1794
- {
1795
- "name": "exchangeFeeCredit",
1796
- "type": "uint256",
1797
- "internalType": "uint256"
1798
- },
1799
- {
1800
- "name": "takerFeeDebit",
1801
- "type": "uint256",
1802
- "internalType": "uint256"
1803
- },
1804
- {
1805
- "name": "makerPayments",
1806
- "type": "int256[]",
1807
- "internalType": "int256[]"
1808
- }
1809
- ]
1810
- }
1811
- ]
1812
- },
1813
1780
  {
1814
1781
  "type": "error",
1815
1782
  "name": "InvalidNewParentCollateral",
@@ -3858,7 +3825,8 @@
3858
3825
  "internalType": "uint256"
3859
3826
  }
3860
3827
  ]
3861
- }, {
3828
+ },
3829
+ {
3862
3830
  "type": "error",
3863
3831
  "name": "CamelotSwapMinAmountOutBreached",
3864
3832
  "inputs": [
@@ -3931,6 +3899,517 @@
3931
3899
  "type": "uint256"
3932
3900
  }
3933
3901
  ]
3902
+ },
3903
+ {
3904
+ "type": "error",
3905
+ "name": "BaseDeltaWrongSpacing",
3906
+ "inputs": [
3907
+ {
3908
+ "name": "baseDelta",
3909
+ "type": "int256",
3910
+ "internalType": "SD59x18"
3911
+ },
3912
+ {
3913
+ "name": "baseSpacing",
3914
+ "type": "uint256",
3915
+ "internalType": "UD60x18"
3916
+ }
3917
+ ]
3918
+ },
3919
+ {
3920
+ "type": "error",
3921
+ "name": "CoreOutputLengthMismatch",
3922
+ "inputs": []
3923
+ },
3924
+ {
3925
+ "type": "error",
3926
+ "name": "CounterpartyCannotBeReduceOnly",
3927
+ "inputs": []
3928
+ },
3929
+ {
3930
+ "type": "error",
3931
+ "name": "CounterpartyWrongDirection",
3932
+ "inputs": []
3933
+ },
3934
+ {
3935
+ "type": "error",
3936
+ "name": "FillExceedsOrderBaseDelta",
3937
+ "inputs": [
3938
+ {
3939
+ "name": "fillAmount",
3940
+ "type": "int256",
3941
+ "internalType": "SD59x18"
3942
+ },
3943
+ {
3944
+ "name": "orderBaseDelta",
3945
+ "type": "int256",
3946
+ "internalType": "SD59x18"
3947
+ },
3948
+ {
3949
+ "name": "isCounterparty",
3950
+ "type": "bool",
3951
+ "internalType": "bool"
3952
+ }
3953
+ ]
3954
+ },
3955
+ {
3956
+ "type": "error",
3957
+ "name": "InvalidFillPrice",
3958
+ "inputs": [
3959
+ {
3960
+ "name": "fillPrice",
3961
+ "type": "uint256",
3962
+ "internalType": "UD60x18"
3963
+ },
3964
+ {
3965
+ "name": "orderPrice",
3966
+ "type": "uint256",
3967
+ "internalType": "UD60x18"
3968
+ }
3969
+ ]
3970
+ },
3971
+ {
3972
+ "type": "error",
3973
+ "name": "InvalidTimeInForce",
3974
+ "inputs": [
3975
+ {
3976
+ "name": "timeInForce",
3977
+ "type": "uint8",
3978
+ "internalType": "uint8"
3979
+ }
3980
+ ]
3981
+ },
3982
+ {
3983
+ "type": "error",
3984
+ "name": "InvalidTriggerPrice",
3985
+ "inputs": [
3986
+ {
3987
+ "name": "orderType",
3988
+ "type": "uint8",
3989
+ "internalType": "enum OrderType"
3990
+ },
3991
+ {
3992
+ "name": "triggerPrice",
3993
+ "type": "uint256",
3994
+ "internalType": "uint256"
3995
+ }
3996
+ ]
3997
+ },
3998
+ {
3999
+ "type": "error",
4000
+ "name": "MarketIdMismatch",
4001
+ "inputs": [
4002
+ {
4003
+ "name": "accountOrderMarketId",
4004
+ "type": "uint128",
4005
+ "internalType": "uint128"
4006
+ },
4007
+ {
4008
+ "name": "counterpartyOrderMarketId",
4009
+ "type": "uint128",
4010
+ "internalType": "uint128"
4011
+ }
4012
+ ]
4013
+ },
4014
+ {
4015
+ "type": "error",
4016
+ "name": "MarketSpacingNotConfigured",
4017
+ "inputs": []
4018
+ },
4019
+ {
4020
+ "type": "error",
4021
+ "name": "MarketTypeMismatch",
4022
+ "inputs": [
4023
+ {
4024
+ "name": "accountMarketType",
4025
+ "type": "uint8",
4026
+ "internalType": "enum MarketType"
4027
+ },
4028
+ {
4029
+ "name": "counterpartyMarketType",
4030
+ "type": "uint8",
4031
+ "internalType": "enum MarketType"
4032
+ }
4033
+ ]
4034
+ },
4035
+ {
4036
+ "type": "error",
4037
+ "name": "MaxQuantityExceeded",
4038
+ "inputs": [
4039
+ {
4040
+ "name": "amount",
4041
+ "type": "uint256",
4042
+ "internalType": "uint256"
4043
+ },
4044
+ {
4045
+ "name": "maxQuantity",
4046
+ "type": "uint256",
4047
+ "internalType": "uint256"
4048
+ }
4049
+ ]
4050
+ },
4051
+ {
4052
+ "type": "error",
4053
+ "name": "OrderExpired",
4054
+ "inputs": [
4055
+ {
4056
+ "name": "expiresAfter",
4057
+ "type": "uint256",
4058
+ "internalType": "uint256"
4059
+ }
4060
+ ]
4061
+ },
4062
+ {
4063
+ "type": "error",
4064
+ "name": "PriceWrongSpacing",
4065
+ "inputs": [
4066
+ {
4067
+ "name": "price",
4068
+ "type": "uint256",
4069
+ "internalType": "UD60x18"
4070
+ },
4071
+ {
4072
+ "name": "priceSpacing",
4073
+ "type": "uint256",
4074
+ "internalType": "UD60x18"
4075
+ }
4076
+ ]
4077
+ },
4078
+ {
4079
+ "type": "error",
4080
+ "name": "SameOrderId",
4081
+ "inputs": []
4082
+ },
4083
+ {
4084
+ "type": "error",
4085
+ "name": "SignerNonceAlreadyUsed",
4086
+ "inputs": [
4087
+ {
4088
+ "name": "signer",
4089
+ "type": "address",
4090
+ "internalType": "address"
4091
+ },
4092
+ {
4093
+ "name": "nonce",
4094
+ "type": "uint256",
4095
+ "internalType": "uint256"
4096
+ }
4097
+ ]
4098
+ },
4099
+ {
4100
+ "type": "error",
4101
+ "name": "UnauthorizedMatchingEnginePublisher",
4102
+ "inputs": [
4103
+ {
4104
+ "name": "publisher",
4105
+ "type": "address",
4106
+ "internalType": "address"
4107
+ }
4108
+ ]
4109
+ },
4110
+ {
4111
+ "type": "error",
4112
+ "name": "UnauthorizedSigner",
4113
+ "inputs": [
4114
+ {
4115
+ "name": "addr",
4116
+ "type": "address",
4117
+ "internalType": "address"
4118
+ }
4119
+ ]
4120
+ },
4121
+ {
4122
+ "type": "error",
4123
+ "name": "UnsupportedOrderConfiguration",
4124
+ "inputs": [
4125
+ {
4126
+ "name": "marketType",
4127
+ "type": "uint8",
4128
+ "internalType": "enum MarketType"
4129
+ },
4130
+ {
4131
+ "name": "orderType",
4132
+ "type": "uint8",
4133
+ "internalType": "enum OrderType"
4134
+ },
4135
+ {
4136
+ "name": "reduceOnly",
4137
+ "type": "bool",
4138
+ "internalType": "bool"
4139
+ }
4140
+ ]
4141
+ },
4142
+ {
4143
+ "type": "error",
4144
+ "name": "ZeroAccountId",
4145
+ "inputs": []
4146
+ },
4147
+ {
4148
+ "type": "error",
4149
+ "name": "ZeroAmountIncrementNonce",
4150
+ "inputs": []
4151
+ },
4152
+ {
4153
+ "type": "error",
4154
+ "name": "ZeroBaseDelta",
4155
+ "inputs": []
4156
+ },
4157
+ {
4158
+ "type": "error",
4159
+ "name": "ZeroMarketId",
4160
+ "inputs": []
4161
+ },
4162
+ {
4163
+ "type": "error",
4164
+ "name": "ZeroOrderId",
4165
+ "inputs": []
4166
+ },
4167
+ {
4168
+ "type": "error",
4169
+ "name": "ZeroPrice",
4170
+ "inputs": []
4171
+ },
4172
+ {
4173
+ "type": "error",
4174
+ "name": "ZeroQuantity",
4175
+ "inputs": []
4176
+ },
4177
+ {
4178
+ "type": "error",
4179
+ "name": "FundingRateOutOfBounds",
4180
+ "inputs": [
4181
+ {
4182
+ "name": "marketId",
4183
+ "type": "uint128",
4184
+ "internalType": "uint128"
4185
+ },
4186
+ {
4187
+ "name": "rate",
4188
+ "type": "int256",
4189
+ "internalType": "int256"
4190
+ },
4191
+ {
4192
+ "name": "minRate",
4193
+ "type": "int256",
4194
+ "internalType": "int256"
4195
+ },
4196
+ {
4197
+ "name": "maxRate",
4198
+ "type": "int256",
4199
+ "internalType": "int256"
4200
+ }
4201
+ ]
4202
+ },
4203
+ {
4204
+ "type": "error",
4205
+ "name": "FundingRatePayloadIsInTheFuture",
4206
+ "inputs": [
4207
+ {
4208
+ "name": "marketId",
4209
+ "type": "uint128",
4210
+ "internalType": "uint128"
4211
+ },
4212
+ {
4213
+ "name": "payloadTimestamp",
4214
+ "type": "uint256",
4215
+ "internalType": "uint256"
4216
+ },
4217
+ {
4218
+ "name": "blockTimestamp",
4219
+ "type": "uint256",
4220
+ "internalType": "uint256"
4221
+ }
4222
+ ]
4223
+ },
4224
+ {
4225
+ "type": "error",
4226
+ "name": "FundingRatePayloadOlderThanLatest",
4227
+ "inputs": [
4228
+ {
4229
+ "name": "marketId",
4230
+ "type": "uint128",
4231
+ "internalType": "uint128"
4232
+ },
4233
+ {
4234
+ "name": "payloadTimestamp",
4235
+ "type": "uint256",
4236
+ "internalType": "uint256"
4237
+ },
4238
+ {
4239
+ "name": "latestTimestamp",
4240
+ "type": "uint256",
4241
+ "internalType": "uint256"
4242
+ }
4243
+ ]
4244
+ },
4245
+ {
4246
+ "type": "error",
4247
+ "name": "FundingRateStale",
4248
+ "inputs": [
4249
+ {
4250
+ "name": "marketId",
4251
+ "type": "uint128",
4252
+ "internalType": "uint128"
4253
+ },
4254
+ {
4255
+ "name": "rateTimestamp",
4256
+ "type": "uint256",
4257
+ "internalType": "uint256"
4258
+ },
4259
+ {
4260
+ "name": "blockTimestamp",
4261
+ "type": "uint256",
4262
+ "internalType": "uint256"
4263
+ },
4264
+ {
4265
+ "name": "maxStaleDuration",
4266
+ "type": "uint256",
4267
+ "internalType": "uint256"
4268
+ }
4269
+ ]
4270
+ },
4271
+ {
4272
+ "type": "error",
4273
+ "name": "MarkPricePayloadIsInTheFuture",
4274
+ "inputs": [
4275
+ {
4276
+ "name": "marketId",
4277
+ "type": "uint128",
4278
+ "internalType": "uint128"
4279
+ },
4280
+ {
4281
+ "name": "payloadTimestamp",
4282
+ "type": "uint256",
4283
+ "internalType": "uint256"
4284
+ },
4285
+ {
4286
+ "name": "blockTimestamp",
4287
+ "type": "uint256",
4288
+ "internalType": "uint256"
4289
+ }
4290
+ ]
4291
+ },
4292
+ {
4293
+ "type": "error",
4294
+ "name": "MarkPricePayloadOlderThanLatest",
4295
+ "inputs": [
4296
+ {
4297
+ "name": "marketId",
4298
+ "type": "uint128",
4299
+ "internalType": "uint128"
4300
+ },
4301
+ {
4302
+ "name": "payloadTimestamp",
4303
+ "type": "uint256",
4304
+ "internalType": "uint256"
4305
+ },
4306
+ {
4307
+ "name": "latestTimestamp",
4308
+ "type": "uint256",
4309
+ "internalType": "uint256"
4310
+ }
4311
+ ]
4312
+ },
4313
+ {
4314
+ "type": "error",
4315
+ "name": "MarkPriceStale",
4316
+ "inputs": [
4317
+ {
4318
+ "name": "marketId",
4319
+ "type": "uint128",
4320
+ "internalType": "uint128"
4321
+ },
4322
+ {
4323
+ "name": "priceTimestamp",
4324
+ "type": "uint256",
4325
+ "internalType": "uint256"
4326
+ },
4327
+ {
4328
+ "name": "blockTimestamp",
4329
+ "type": "uint256",
4330
+ "internalType": "uint256"
4331
+ },
4332
+ {
4333
+ "name": "maxStaleDuration",
4334
+ "type": "uint256",
4335
+ "internalType": "uint256"
4336
+ }
4337
+ ]
4338
+ },
4339
+ {
4340
+ "type": "error",
4341
+ "name": "OraclePublisherSignerMismatch",
4342
+ "inputs": [
4343
+ {
4344
+ "name": "expected",
4345
+ "type": "address",
4346
+ "internalType": "address"
4347
+ },
4348
+ {
4349
+ "name": "recovered",
4350
+ "type": "address",
4351
+ "internalType": "address"
4352
+ }
4353
+ ]
4354
+ },
4355
+ {
4356
+ "type": "error",
4357
+ "name": "PriceDeviationTooLarge",
4358
+ "inputs": [
4359
+ {
4360
+ "name": "marketId",
4361
+ "type": "uint128",
4362
+ "internalType": "uint128"
4363
+ },
4364
+ {
4365
+ "name": "price",
4366
+ "type": "uint256",
4367
+ "internalType": "UD60x18"
4368
+ },
4369
+ {
4370
+ "name": "referencePrice",
4371
+ "type": "uint256",
4372
+ "internalType": "UD60x18"
4373
+ },
4374
+ {
4375
+ "name": "maxDeviation",
4376
+ "type": "uint256",
4377
+ "internalType": "UD60x18"
4378
+ }
4379
+ ]
4380
+ },
4381
+ {
4382
+ "type": "error",
4383
+ "name": "UnauthorizedOraclePublisher",
4384
+ "inputs": [
4385
+ {
4386
+ "name": "publisher",
4387
+ "type": "address",
4388
+ "internalType": "address"
4389
+ }
4390
+ ]
4391
+ },
4392
+ {
4393
+ "type": "error",
4394
+ "name": "UnauthorizedOraclePusher",
4395
+ "inputs": [
4396
+ {
4397
+ "name": "pusher",
4398
+ "type": "address",
4399
+ "internalType": "address"
4400
+ }
4401
+ ]
4402
+ },
4403
+ {
4404
+ "type": "error",
4405
+ "name": "UnsupportedOracleDataType",
4406
+ "inputs": [
4407
+ {
4408
+ "name": "dataType",
4409
+ "type": "uint8",
4410
+ "internalType": "uint8"
4411
+ }
4412
+ ]
3934
4413
  }
3935
4414
  ]
3936
4415
  }