@gearbox-protocol/sdk 3.0.0-vfour.39 → 3.0.0-vfour.40
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/cjs/sdk/index.cjs +1159 -34
- package/dist/cjs/sdk/index.d.ts +699 -48
- package/dist/esm/sdk/index.d.mts +699 -48
- package/dist/esm/sdk/index.mjs +1158 -34
- package/package.json +1 -1
package/dist/cjs/sdk/index.cjs
CHANGED
|
@@ -17715,6 +17715,1054 @@ var routerV3Abi = [
|
|
|
17715
17715
|
}
|
|
17716
17716
|
];
|
|
17717
17717
|
|
|
17718
|
+
// src/sdk/abi/v310.ts
|
|
17719
|
+
var iCreditFacadeV310Abi = [
|
|
17720
|
+
{
|
|
17721
|
+
type: "function",
|
|
17722
|
+
name: "acl",
|
|
17723
|
+
inputs: [],
|
|
17724
|
+
outputs: [
|
|
17725
|
+
{
|
|
17726
|
+
name: "",
|
|
17727
|
+
type: "address",
|
|
17728
|
+
internalType: "address"
|
|
17729
|
+
}
|
|
17730
|
+
],
|
|
17731
|
+
stateMutability: "view"
|
|
17732
|
+
},
|
|
17733
|
+
{
|
|
17734
|
+
type: "function",
|
|
17735
|
+
name: "botList",
|
|
17736
|
+
inputs: [],
|
|
17737
|
+
outputs: [
|
|
17738
|
+
{
|
|
17739
|
+
name: "",
|
|
17740
|
+
type: "address",
|
|
17741
|
+
internalType: "address"
|
|
17742
|
+
}
|
|
17743
|
+
],
|
|
17744
|
+
stateMutability: "view"
|
|
17745
|
+
},
|
|
17746
|
+
{
|
|
17747
|
+
type: "function",
|
|
17748
|
+
name: "botMulticall",
|
|
17749
|
+
inputs: [
|
|
17750
|
+
{
|
|
17751
|
+
name: "creditAccount",
|
|
17752
|
+
type: "address",
|
|
17753
|
+
internalType: "address"
|
|
17754
|
+
},
|
|
17755
|
+
{
|
|
17756
|
+
name: "calls",
|
|
17757
|
+
type: "tuple[]",
|
|
17758
|
+
internalType: "struct MultiCall[]",
|
|
17759
|
+
components: [
|
|
17760
|
+
{
|
|
17761
|
+
name: "target",
|
|
17762
|
+
type: "address",
|
|
17763
|
+
internalType: "address"
|
|
17764
|
+
},
|
|
17765
|
+
{
|
|
17766
|
+
name: "callData",
|
|
17767
|
+
type: "bytes",
|
|
17768
|
+
internalType: "bytes"
|
|
17769
|
+
}
|
|
17770
|
+
]
|
|
17771
|
+
}
|
|
17772
|
+
],
|
|
17773
|
+
outputs: [],
|
|
17774
|
+
stateMutability: "nonpayable"
|
|
17775
|
+
},
|
|
17776
|
+
{
|
|
17777
|
+
type: "function",
|
|
17778
|
+
name: "closeCreditAccount",
|
|
17779
|
+
inputs: [
|
|
17780
|
+
{
|
|
17781
|
+
name: "creditAccount",
|
|
17782
|
+
type: "address",
|
|
17783
|
+
internalType: "address"
|
|
17784
|
+
},
|
|
17785
|
+
{
|
|
17786
|
+
name: "calls",
|
|
17787
|
+
type: "tuple[]",
|
|
17788
|
+
internalType: "struct MultiCall[]",
|
|
17789
|
+
components: [
|
|
17790
|
+
{
|
|
17791
|
+
name: "target",
|
|
17792
|
+
type: "address",
|
|
17793
|
+
internalType: "address"
|
|
17794
|
+
},
|
|
17795
|
+
{
|
|
17796
|
+
name: "callData",
|
|
17797
|
+
type: "bytes",
|
|
17798
|
+
internalType: "bytes"
|
|
17799
|
+
}
|
|
17800
|
+
]
|
|
17801
|
+
}
|
|
17802
|
+
],
|
|
17803
|
+
outputs: [],
|
|
17804
|
+
stateMutability: "payable"
|
|
17805
|
+
},
|
|
17806
|
+
{
|
|
17807
|
+
type: "function",
|
|
17808
|
+
name: "contractType",
|
|
17809
|
+
inputs: [],
|
|
17810
|
+
outputs: [
|
|
17811
|
+
{
|
|
17812
|
+
name: "",
|
|
17813
|
+
type: "bytes32",
|
|
17814
|
+
internalType: "bytes32"
|
|
17815
|
+
}
|
|
17816
|
+
],
|
|
17817
|
+
stateMutability: "view"
|
|
17818
|
+
},
|
|
17819
|
+
{
|
|
17820
|
+
type: "function",
|
|
17821
|
+
name: "creditManager",
|
|
17822
|
+
inputs: [],
|
|
17823
|
+
outputs: [
|
|
17824
|
+
{
|
|
17825
|
+
name: "",
|
|
17826
|
+
type: "address",
|
|
17827
|
+
internalType: "address"
|
|
17828
|
+
}
|
|
17829
|
+
],
|
|
17830
|
+
stateMutability: "view"
|
|
17831
|
+
},
|
|
17832
|
+
{
|
|
17833
|
+
type: "function",
|
|
17834
|
+
name: "debtLimits",
|
|
17835
|
+
inputs: [],
|
|
17836
|
+
outputs: [
|
|
17837
|
+
{
|
|
17838
|
+
name: "minDebt",
|
|
17839
|
+
type: "uint128",
|
|
17840
|
+
internalType: "uint128"
|
|
17841
|
+
},
|
|
17842
|
+
{
|
|
17843
|
+
name: "maxDebt",
|
|
17844
|
+
type: "uint128",
|
|
17845
|
+
internalType: "uint128"
|
|
17846
|
+
}
|
|
17847
|
+
],
|
|
17848
|
+
stateMutability: "view"
|
|
17849
|
+
},
|
|
17850
|
+
{
|
|
17851
|
+
type: "function",
|
|
17852
|
+
name: "degenNFT",
|
|
17853
|
+
inputs: [],
|
|
17854
|
+
outputs: [
|
|
17855
|
+
{
|
|
17856
|
+
name: "",
|
|
17857
|
+
type: "address",
|
|
17858
|
+
internalType: "address"
|
|
17859
|
+
}
|
|
17860
|
+
],
|
|
17861
|
+
stateMutability: "view"
|
|
17862
|
+
},
|
|
17863
|
+
{
|
|
17864
|
+
type: "function",
|
|
17865
|
+
name: "emergencyLiquidators",
|
|
17866
|
+
inputs: [],
|
|
17867
|
+
outputs: [
|
|
17868
|
+
{
|
|
17869
|
+
name: "",
|
|
17870
|
+
type: "address[]",
|
|
17871
|
+
internalType: "address[]"
|
|
17872
|
+
}
|
|
17873
|
+
],
|
|
17874
|
+
stateMutability: "view"
|
|
17875
|
+
},
|
|
17876
|
+
{
|
|
17877
|
+
type: "function",
|
|
17878
|
+
name: "expirable",
|
|
17879
|
+
inputs: [],
|
|
17880
|
+
outputs: [
|
|
17881
|
+
{
|
|
17882
|
+
name: "",
|
|
17883
|
+
type: "bool",
|
|
17884
|
+
internalType: "bool"
|
|
17885
|
+
}
|
|
17886
|
+
],
|
|
17887
|
+
stateMutability: "view"
|
|
17888
|
+
},
|
|
17889
|
+
{
|
|
17890
|
+
type: "function",
|
|
17891
|
+
name: "expirationDate",
|
|
17892
|
+
inputs: [],
|
|
17893
|
+
outputs: [
|
|
17894
|
+
{
|
|
17895
|
+
name: "",
|
|
17896
|
+
type: "uint40",
|
|
17897
|
+
internalType: "uint40"
|
|
17898
|
+
}
|
|
17899
|
+
],
|
|
17900
|
+
stateMutability: "view"
|
|
17901
|
+
},
|
|
17902
|
+
{
|
|
17903
|
+
type: "function",
|
|
17904
|
+
name: "forbiddenTokenMask",
|
|
17905
|
+
inputs: [],
|
|
17906
|
+
outputs: [
|
|
17907
|
+
{
|
|
17908
|
+
name: "",
|
|
17909
|
+
type: "uint256",
|
|
17910
|
+
internalType: "uint256"
|
|
17911
|
+
}
|
|
17912
|
+
],
|
|
17913
|
+
stateMutability: "view"
|
|
17914
|
+
},
|
|
17915
|
+
{
|
|
17916
|
+
type: "function",
|
|
17917
|
+
name: "isEmergencyLiquidator",
|
|
17918
|
+
inputs: [
|
|
17919
|
+
{
|
|
17920
|
+
name: "",
|
|
17921
|
+
type: "address",
|
|
17922
|
+
internalType: "address"
|
|
17923
|
+
}
|
|
17924
|
+
],
|
|
17925
|
+
outputs: [
|
|
17926
|
+
{
|
|
17927
|
+
name: "",
|
|
17928
|
+
type: "bool",
|
|
17929
|
+
internalType: "bool"
|
|
17930
|
+
}
|
|
17931
|
+
],
|
|
17932
|
+
stateMutability: "view"
|
|
17933
|
+
},
|
|
17934
|
+
{
|
|
17935
|
+
type: "function",
|
|
17936
|
+
name: "liquidateCreditAccount",
|
|
17937
|
+
inputs: [
|
|
17938
|
+
{
|
|
17939
|
+
name: "creditAccount",
|
|
17940
|
+
type: "address",
|
|
17941
|
+
internalType: "address"
|
|
17942
|
+
},
|
|
17943
|
+
{
|
|
17944
|
+
name: "to",
|
|
17945
|
+
type: "address",
|
|
17946
|
+
internalType: "address"
|
|
17947
|
+
},
|
|
17948
|
+
{
|
|
17949
|
+
name: "calls",
|
|
17950
|
+
type: "tuple[]",
|
|
17951
|
+
internalType: "struct MultiCall[]",
|
|
17952
|
+
components: [
|
|
17953
|
+
{
|
|
17954
|
+
name: "target",
|
|
17955
|
+
type: "address",
|
|
17956
|
+
internalType: "address"
|
|
17957
|
+
},
|
|
17958
|
+
{
|
|
17959
|
+
name: "callData",
|
|
17960
|
+
type: "bytes",
|
|
17961
|
+
internalType: "bytes"
|
|
17962
|
+
}
|
|
17963
|
+
]
|
|
17964
|
+
}
|
|
17965
|
+
],
|
|
17966
|
+
outputs: [
|
|
17967
|
+
{
|
|
17968
|
+
name: "reportedLoss",
|
|
17969
|
+
type: "uint256",
|
|
17970
|
+
internalType: "uint256"
|
|
17971
|
+
}
|
|
17972
|
+
],
|
|
17973
|
+
stateMutability: "nonpayable"
|
|
17974
|
+
},
|
|
17975
|
+
{
|
|
17976
|
+
type: "function",
|
|
17977
|
+
name: "lossLiquidator",
|
|
17978
|
+
inputs: [],
|
|
17979
|
+
outputs: [
|
|
17980
|
+
{
|
|
17981
|
+
name: "",
|
|
17982
|
+
type: "address",
|
|
17983
|
+
internalType: "address"
|
|
17984
|
+
}
|
|
17985
|
+
],
|
|
17986
|
+
stateMutability: "view"
|
|
17987
|
+
},
|
|
17988
|
+
{
|
|
17989
|
+
type: "function",
|
|
17990
|
+
name: "maxDebtPerBlockMultiplier",
|
|
17991
|
+
inputs: [],
|
|
17992
|
+
outputs: [
|
|
17993
|
+
{
|
|
17994
|
+
name: "",
|
|
17995
|
+
type: "uint8",
|
|
17996
|
+
internalType: "uint8"
|
|
17997
|
+
}
|
|
17998
|
+
],
|
|
17999
|
+
stateMutability: "view"
|
|
18000
|
+
},
|
|
18001
|
+
{
|
|
18002
|
+
type: "function",
|
|
18003
|
+
name: "maxQuotaMultiplier",
|
|
18004
|
+
inputs: [],
|
|
18005
|
+
outputs: [
|
|
18006
|
+
{
|
|
18007
|
+
name: "",
|
|
18008
|
+
type: "uint256",
|
|
18009
|
+
internalType: "uint256"
|
|
18010
|
+
}
|
|
18011
|
+
],
|
|
18012
|
+
stateMutability: "view"
|
|
18013
|
+
},
|
|
18014
|
+
{
|
|
18015
|
+
type: "function",
|
|
18016
|
+
name: "multicall",
|
|
18017
|
+
inputs: [
|
|
18018
|
+
{
|
|
18019
|
+
name: "creditAccount",
|
|
18020
|
+
type: "address",
|
|
18021
|
+
internalType: "address"
|
|
18022
|
+
},
|
|
18023
|
+
{
|
|
18024
|
+
name: "calls",
|
|
18025
|
+
type: "tuple[]",
|
|
18026
|
+
internalType: "struct MultiCall[]",
|
|
18027
|
+
components: [
|
|
18028
|
+
{
|
|
18029
|
+
name: "target",
|
|
18030
|
+
type: "address",
|
|
18031
|
+
internalType: "address"
|
|
18032
|
+
},
|
|
18033
|
+
{
|
|
18034
|
+
name: "callData",
|
|
18035
|
+
type: "bytes",
|
|
18036
|
+
internalType: "bytes"
|
|
18037
|
+
}
|
|
18038
|
+
]
|
|
18039
|
+
}
|
|
18040
|
+
],
|
|
18041
|
+
outputs: [],
|
|
18042
|
+
stateMutability: "payable"
|
|
18043
|
+
},
|
|
18044
|
+
{
|
|
18045
|
+
type: "function",
|
|
18046
|
+
name: "openCreditAccount",
|
|
18047
|
+
inputs: [
|
|
18048
|
+
{
|
|
18049
|
+
name: "onBehalfOf",
|
|
18050
|
+
type: "address",
|
|
18051
|
+
internalType: "address"
|
|
18052
|
+
},
|
|
18053
|
+
{
|
|
18054
|
+
name: "calls",
|
|
18055
|
+
type: "tuple[]",
|
|
18056
|
+
internalType: "struct MultiCall[]",
|
|
18057
|
+
components: [
|
|
18058
|
+
{
|
|
18059
|
+
name: "target",
|
|
18060
|
+
type: "address",
|
|
18061
|
+
internalType: "address"
|
|
18062
|
+
},
|
|
18063
|
+
{
|
|
18064
|
+
name: "callData",
|
|
18065
|
+
type: "bytes",
|
|
18066
|
+
internalType: "bytes"
|
|
18067
|
+
}
|
|
18068
|
+
]
|
|
18069
|
+
},
|
|
18070
|
+
{
|
|
18071
|
+
name: "referralCode",
|
|
18072
|
+
type: "uint256",
|
|
18073
|
+
internalType: "uint256"
|
|
18074
|
+
}
|
|
18075
|
+
],
|
|
18076
|
+
outputs: [
|
|
18077
|
+
{
|
|
18078
|
+
name: "creditAccount",
|
|
18079
|
+
type: "address",
|
|
18080
|
+
internalType: "address"
|
|
18081
|
+
}
|
|
18082
|
+
],
|
|
18083
|
+
stateMutability: "payable"
|
|
18084
|
+
},
|
|
18085
|
+
{
|
|
18086
|
+
type: "function",
|
|
18087
|
+
name: "partiallyLiquidateCreditAccount",
|
|
18088
|
+
inputs: [
|
|
18089
|
+
{
|
|
18090
|
+
name: "creditAccount",
|
|
18091
|
+
type: "address",
|
|
18092
|
+
internalType: "address"
|
|
18093
|
+
},
|
|
18094
|
+
{
|
|
18095
|
+
name: "token",
|
|
18096
|
+
type: "address",
|
|
18097
|
+
internalType: "address"
|
|
18098
|
+
},
|
|
18099
|
+
{
|
|
18100
|
+
name: "repaidAmount",
|
|
18101
|
+
type: "uint256",
|
|
18102
|
+
internalType: "uint256"
|
|
18103
|
+
},
|
|
18104
|
+
{
|
|
18105
|
+
name: "minSeizedAmount",
|
|
18106
|
+
type: "uint256",
|
|
18107
|
+
internalType: "uint256"
|
|
18108
|
+
},
|
|
18109
|
+
{
|
|
18110
|
+
name: "to",
|
|
18111
|
+
type: "address",
|
|
18112
|
+
internalType: "address"
|
|
18113
|
+
},
|
|
18114
|
+
{
|
|
18115
|
+
name: "priceUpdates",
|
|
18116
|
+
type: "tuple[]",
|
|
18117
|
+
internalType: "struct PriceUpdate[]",
|
|
18118
|
+
components: [
|
|
18119
|
+
{
|
|
18120
|
+
name: "priceFeed",
|
|
18121
|
+
type: "address",
|
|
18122
|
+
internalType: "address"
|
|
18123
|
+
},
|
|
18124
|
+
{
|
|
18125
|
+
name: "data",
|
|
18126
|
+
type: "bytes",
|
|
18127
|
+
internalType: "bytes"
|
|
18128
|
+
}
|
|
18129
|
+
]
|
|
18130
|
+
}
|
|
18131
|
+
],
|
|
18132
|
+
outputs: [
|
|
18133
|
+
{
|
|
18134
|
+
name: "seizedAmount",
|
|
18135
|
+
type: "uint256",
|
|
18136
|
+
internalType: "uint256"
|
|
18137
|
+
}
|
|
18138
|
+
],
|
|
18139
|
+
stateMutability: "nonpayable"
|
|
18140
|
+
},
|
|
18141
|
+
{
|
|
18142
|
+
type: "function",
|
|
18143
|
+
name: "pause",
|
|
18144
|
+
inputs: [],
|
|
18145
|
+
outputs: [],
|
|
18146
|
+
stateMutability: "nonpayable"
|
|
18147
|
+
},
|
|
18148
|
+
{
|
|
18149
|
+
type: "function",
|
|
18150
|
+
name: "setDebtLimits",
|
|
18151
|
+
inputs: [
|
|
18152
|
+
{
|
|
18153
|
+
name: "newMinDebt",
|
|
18154
|
+
type: "uint128",
|
|
18155
|
+
internalType: "uint128"
|
|
18156
|
+
},
|
|
18157
|
+
{
|
|
18158
|
+
name: "newMaxDebt",
|
|
18159
|
+
type: "uint128",
|
|
18160
|
+
internalType: "uint128"
|
|
18161
|
+
},
|
|
18162
|
+
{
|
|
18163
|
+
name: "newMaxDebtPerBlockMultiplier",
|
|
18164
|
+
type: "uint8",
|
|
18165
|
+
internalType: "uint8"
|
|
18166
|
+
}
|
|
18167
|
+
],
|
|
18168
|
+
outputs: [],
|
|
18169
|
+
stateMutability: "nonpayable"
|
|
18170
|
+
},
|
|
18171
|
+
{
|
|
18172
|
+
type: "function",
|
|
18173
|
+
name: "setEmergencyLiquidator",
|
|
18174
|
+
inputs: [
|
|
18175
|
+
{
|
|
18176
|
+
name: "liquidator",
|
|
18177
|
+
type: "address",
|
|
18178
|
+
internalType: "address"
|
|
18179
|
+
},
|
|
18180
|
+
{
|
|
18181
|
+
name: "allowance",
|
|
18182
|
+
type: "uint8",
|
|
18183
|
+
internalType: "enum AllowanceAction"
|
|
18184
|
+
}
|
|
18185
|
+
],
|
|
18186
|
+
outputs: [],
|
|
18187
|
+
stateMutability: "nonpayable"
|
|
18188
|
+
},
|
|
18189
|
+
{
|
|
18190
|
+
type: "function",
|
|
18191
|
+
name: "setExpirationDate",
|
|
18192
|
+
inputs: [
|
|
18193
|
+
{
|
|
18194
|
+
name: "newExpirationDate",
|
|
18195
|
+
type: "uint40",
|
|
18196
|
+
internalType: "uint40"
|
|
18197
|
+
}
|
|
18198
|
+
],
|
|
18199
|
+
outputs: [],
|
|
18200
|
+
stateMutability: "nonpayable"
|
|
18201
|
+
},
|
|
18202
|
+
{
|
|
18203
|
+
type: "function",
|
|
18204
|
+
name: "setLossLiquidator",
|
|
18205
|
+
inputs: [
|
|
18206
|
+
{
|
|
18207
|
+
name: "newLossLiquidator",
|
|
18208
|
+
type: "address",
|
|
18209
|
+
internalType: "address"
|
|
18210
|
+
}
|
|
18211
|
+
],
|
|
18212
|
+
outputs: [],
|
|
18213
|
+
stateMutability: "nonpayable"
|
|
18214
|
+
},
|
|
18215
|
+
{
|
|
18216
|
+
type: "function",
|
|
18217
|
+
name: "setTokenAllowance",
|
|
18218
|
+
inputs: [
|
|
18219
|
+
{
|
|
18220
|
+
name: "token",
|
|
18221
|
+
type: "address",
|
|
18222
|
+
internalType: "address"
|
|
18223
|
+
},
|
|
18224
|
+
{
|
|
18225
|
+
name: "allowance",
|
|
18226
|
+
type: "uint8",
|
|
18227
|
+
internalType: "enum AllowanceAction"
|
|
18228
|
+
}
|
|
18229
|
+
],
|
|
18230
|
+
outputs: [],
|
|
18231
|
+
stateMutability: "nonpayable"
|
|
18232
|
+
},
|
|
18233
|
+
{
|
|
18234
|
+
type: "function",
|
|
18235
|
+
name: "treasury",
|
|
18236
|
+
inputs: [],
|
|
18237
|
+
outputs: [
|
|
18238
|
+
{
|
|
18239
|
+
name: "",
|
|
18240
|
+
type: "address",
|
|
18241
|
+
internalType: "address"
|
|
18242
|
+
}
|
|
18243
|
+
],
|
|
18244
|
+
stateMutability: "view"
|
|
18245
|
+
},
|
|
18246
|
+
{
|
|
18247
|
+
type: "function",
|
|
18248
|
+
name: "underlying",
|
|
18249
|
+
inputs: [],
|
|
18250
|
+
outputs: [
|
|
18251
|
+
{
|
|
18252
|
+
name: "",
|
|
18253
|
+
type: "address",
|
|
18254
|
+
internalType: "address"
|
|
18255
|
+
}
|
|
18256
|
+
],
|
|
18257
|
+
stateMutability: "view"
|
|
18258
|
+
},
|
|
18259
|
+
{
|
|
18260
|
+
type: "function",
|
|
18261
|
+
name: "unpause",
|
|
18262
|
+
inputs: [],
|
|
18263
|
+
outputs: [],
|
|
18264
|
+
stateMutability: "nonpayable"
|
|
18265
|
+
},
|
|
18266
|
+
{
|
|
18267
|
+
type: "function",
|
|
18268
|
+
name: "version",
|
|
18269
|
+
inputs: [],
|
|
18270
|
+
outputs: [
|
|
18271
|
+
{
|
|
18272
|
+
name: "",
|
|
18273
|
+
type: "uint256",
|
|
18274
|
+
internalType: "uint256"
|
|
18275
|
+
}
|
|
18276
|
+
],
|
|
18277
|
+
stateMutability: "view"
|
|
18278
|
+
},
|
|
18279
|
+
{
|
|
18280
|
+
type: "function",
|
|
18281
|
+
name: "weth",
|
|
18282
|
+
inputs: [],
|
|
18283
|
+
outputs: [
|
|
18284
|
+
{
|
|
18285
|
+
name: "",
|
|
18286
|
+
type: "address",
|
|
18287
|
+
internalType: "address"
|
|
18288
|
+
}
|
|
18289
|
+
],
|
|
18290
|
+
stateMutability: "view"
|
|
18291
|
+
},
|
|
18292
|
+
{
|
|
18293
|
+
type: "event",
|
|
18294
|
+
name: "AddCollateral",
|
|
18295
|
+
inputs: [
|
|
18296
|
+
{
|
|
18297
|
+
name: "creditAccount",
|
|
18298
|
+
type: "address",
|
|
18299
|
+
indexed: true,
|
|
18300
|
+
internalType: "address"
|
|
18301
|
+
},
|
|
18302
|
+
{
|
|
18303
|
+
name: "token",
|
|
18304
|
+
type: "address",
|
|
18305
|
+
indexed: true,
|
|
18306
|
+
internalType: "address"
|
|
18307
|
+
},
|
|
18308
|
+
{
|
|
18309
|
+
name: "amount",
|
|
18310
|
+
type: "uint256",
|
|
18311
|
+
indexed: false,
|
|
18312
|
+
internalType: "uint256"
|
|
18313
|
+
}
|
|
18314
|
+
],
|
|
18315
|
+
anonymous: false
|
|
18316
|
+
},
|
|
18317
|
+
{
|
|
18318
|
+
type: "event",
|
|
18319
|
+
name: "CloseCreditAccount",
|
|
18320
|
+
inputs: [
|
|
18321
|
+
{
|
|
18322
|
+
name: "creditAccount",
|
|
18323
|
+
type: "address",
|
|
18324
|
+
indexed: true,
|
|
18325
|
+
internalType: "address"
|
|
18326
|
+
},
|
|
18327
|
+
{
|
|
18328
|
+
name: "borrower",
|
|
18329
|
+
type: "address",
|
|
18330
|
+
indexed: true,
|
|
18331
|
+
internalType: "address"
|
|
18332
|
+
}
|
|
18333
|
+
],
|
|
18334
|
+
anonymous: false
|
|
18335
|
+
},
|
|
18336
|
+
{
|
|
18337
|
+
type: "event",
|
|
18338
|
+
name: "Execute",
|
|
18339
|
+
inputs: [
|
|
18340
|
+
{
|
|
18341
|
+
name: "creditAccount",
|
|
18342
|
+
type: "address",
|
|
18343
|
+
indexed: true,
|
|
18344
|
+
internalType: "address"
|
|
18345
|
+
},
|
|
18346
|
+
{
|
|
18347
|
+
name: "targetContract",
|
|
18348
|
+
type: "address",
|
|
18349
|
+
indexed: true,
|
|
18350
|
+
internalType: "address"
|
|
18351
|
+
}
|
|
18352
|
+
],
|
|
18353
|
+
anonymous: false
|
|
18354
|
+
},
|
|
18355
|
+
{
|
|
18356
|
+
type: "event",
|
|
18357
|
+
name: "FinishMultiCall",
|
|
18358
|
+
inputs: [],
|
|
18359
|
+
anonymous: false
|
|
18360
|
+
},
|
|
18361
|
+
{
|
|
18362
|
+
type: "event",
|
|
18363
|
+
name: "LiquidateCreditAccount",
|
|
18364
|
+
inputs: [
|
|
18365
|
+
{
|
|
18366
|
+
name: "creditAccount",
|
|
18367
|
+
type: "address",
|
|
18368
|
+
indexed: true,
|
|
18369
|
+
internalType: "address"
|
|
18370
|
+
},
|
|
18371
|
+
{
|
|
18372
|
+
name: "liquidator",
|
|
18373
|
+
type: "address",
|
|
18374
|
+
indexed: true,
|
|
18375
|
+
internalType: "address"
|
|
18376
|
+
},
|
|
18377
|
+
{
|
|
18378
|
+
name: "to",
|
|
18379
|
+
type: "address",
|
|
18380
|
+
indexed: false,
|
|
18381
|
+
internalType: "address"
|
|
18382
|
+
},
|
|
18383
|
+
{
|
|
18384
|
+
name: "remainingFunds",
|
|
18385
|
+
type: "uint256",
|
|
18386
|
+
indexed: false,
|
|
18387
|
+
internalType: "uint256"
|
|
18388
|
+
}
|
|
18389
|
+
],
|
|
18390
|
+
anonymous: false
|
|
18391
|
+
},
|
|
18392
|
+
{
|
|
18393
|
+
type: "event",
|
|
18394
|
+
name: "OpenCreditAccount",
|
|
18395
|
+
inputs: [
|
|
18396
|
+
{
|
|
18397
|
+
name: "creditAccount",
|
|
18398
|
+
type: "address",
|
|
18399
|
+
indexed: true,
|
|
18400
|
+
internalType: "address"
|
|
18401
|
+
},
|
|
18402
|
+
{
|
|
18403
|
+
name: "onBehalfOf",
|
|
18404
|
+
type: "address",
|
|
18405
|
+
indexed: true,
|
|
18406
|
+
internalType: "address"
|
|
18407
|
+
},
|
|
18408
|
+
{
|
|
18409
|
+
name: "caller",
|
|
18410
|
+
type: "address",
|
|
18411
|
+
indexed: true,
|
|
18412
|
+
internalType: "address"
|
|
18413
|
+
},
|
|
18414
|
+
{
|
|
18415
|
+
name: "referralCode",
|
|
18416
|
+
type: "uint256",
|
|
18417
|
+
indexed: false,
|
|
18418
|
+
internalType: "uint256"
|
|
18419
|
+
}
|
|
18420
|
+
],
|
|
18421
|
+
anonymous: false
|
|
18422
|
+
},
|
|
18423
|
+
{
|
|
18424
|
+
type: "event",
|
|
18425
|
+
name: "PartiallyLiquidateCreditAccount",
|
|
18426
|
+
inputs: [
|
|
18427
|
+
{
|
|
18428
|
+
name: "creditAccount",
|
|
18429
|
+
type: "address",
|
|
18430
|
+
indexed: true,
|
|
18431
|
+
internalType: "address"
|
|
18432
|
+
},
|
|
18433
|
+
{
|
|
18434
|
+
name: "token",
|
|
18435
|
+
type: "address",
|
|
18436
|
+
indexed: true,
|
|
18437
|
+
internalType: "address"
|
|
18438
|
+
},
|
|
18439
|
+
{
|
|
18440
|
+
name: "liquidator",
|
|
18441
|
+
type: "address",
|
|
18442
|
+
indexed: true,
|
|
18443
|
+
internalType: "address"
|
|
18444
|
+
},
|
|
18445
|
+
{
|
|
18446
|
+
name: "repaidDebt",
|
|
18447
|
+
type: "uint256",
|
|
18448
|
+
indexed: false,
|
|
18449
|
+
internalType: "uint256"
|
|
18450
|
+
},
|
|
18451
|
+
{
|
|
18452
|
+
name: "seizedCollateral",
|
|
18453
|
+
type: "uint256",
|
|
18454
|
+
indexed: false,
|
|
18455
|
+
internalType: "uint256"
|
|
18456
|
+
},
|
|
18457
|
+
{
|
|
18458
|
+
name: "fee",
|
|
18459
|
+
type: "uint256",
|
|
18460
|
+
indexed: false,
|
|
18461
|
+
internalType: "uint256"
|
|
18462
|
+
}
|
|
18463
|
+
],
|
|
18464
|
+
anonymous: false
|
|
18465
|
+
},
|
|
18466
|
+
{
|
|
18467
|
+
type: "event",
|
|
18468
|
+
name: "StartMultiCall",
|
|
18469
|
+
inputs: [
|
|
18470
|
+
{
|
|
18471
|
+
name: "creditAccount",
|
|
18472
|
+
type: "address",
|
|
18473
|
+
indexed: true,
|
|
18474
|
+
internalType: "address"
|
|
18475
|
+
},
|
|
18476
|
+
{
|
|
18477
|
+
name: "caller",
|
|
18478
|
+
type: "address",
|
|
18479
|
+
indexed: true,
|
|
18480
|
+
internalType: "address"
|
|
18481
|
+
}
|
|
18482
|
+
],
|
|
18483
|
+
anonymous: false
|
|
18484
|
+
},
|
|
18485
|
+
{
|
|
18486
|
+
type: "event",
|
|
18487
|
+
name: "WithdrawCollateral",
|
|
18488
|
+
inputs: [
|
|
18489
|
+
{
|
|
18490
|
+
name: "creditAccount",
|
|
18491
|
+
type: "address",
|
|
18492
|
+
indexed: true,
|
|
18493
|
+
internalType: "address"
|
|
18494
|
+
},
|
|
18495
|
+
{
|
|
18496
|
+
name: "token",
|
|
18497
|
+
type: "address",
|
|
18498
|
+
indexed: true,
|
|
18499
|
+
internalType: "address"
|
|
18500
|
+
},
|
|
18501
|
+
{
|
|
18502
|
+
name: "amount",
|
|
18503
|
+
type: "uint256",
|
|
18504
|
+
indexed: false,
|
|
18505
|
+
internalType: "uint256"
|
|
18506
|
+
},
|
|
18507
|
+
{
|
|
18508
|
+
name: "to",
|
|
18509
|
+
type: "address",
|
|
18510
|
+
indexed: false,
|
|
18511
|
+
internalType: "address"
|
|
18512
|
+
}
|
|
18513
|
+
],
|
|
18514
|
+
anonymous: false
|
|
18515
|
+
},
|
|
18516
|
+
{
|
|
18517
|
+
type: "event",
|
|
18518
|
+
name: "WithdrawPhantomToken",
|
|
18519
|
+
inputs: [
|
|
18520
|
+
{
|
|
18521
|
+
name: "creditAccount",
|
|
18522
|
+
type: "address",
|
|
18523
|
+
indexed: true,
|
|
18524
|
+
internalType: "address"
|
|
18525
|
+
},
|
|
18526
|
+
{
|
|
18527
|
+
name: "token",
|
|
18528
|
+
type: "address",
|
|
18529
|
+
indexed: true,
|
|
18530
|
+
internalType: "address"
|
|
18531
|
+
},
|
|
18532
|
+
{
|
|
18533
|
+
name: "amount",
|
|
18534
|
+
type: "uint256",
|
|
18535
|
+
indexed: false,
|
|
18536
|
+
internalType: "uint256"
|
|
18537
|
+
}
|
|
18538
|
+
],
|
|
18539
|
+
anonymous: false
|
|
18540
|
+
}
|
|
18541
|
+
];
|
|
18542
|
+
var iCreditFacadeV310MulticallAbi = [
|
|
18543
|
+
{
|
|
18544
|
+
type: "function",
|
|
18545
|
+
name: "addCollateral",
|
|
18546
|
+
inputs: [
|
|
18547
|
+
{
|
|
18548
|
+
name: "token",
|
|
18549
|
+
type: "address",
|
|
18550
|
+
internalType: "address"
|
|
18551
|
+
},
|
|
18552
|
+
{
|
|
18553
|
+
name: "amount",
|
|
18554
|
+
type: "uint256",
|
|
18555
|
+
internalType: "uint256"
|
|
18556
|
+
}
|
|
18557
|
+
],
|
|
18558
|
+
outputs: [],
|
|
18559
|
+
stateMutability: "nonpayable"
|
|
18560
|
+
},
|
|
18561
|
+
{
|
|
18562
|
+
type: "function",
|
|
18563
|
+
name: "addCollateralWithPermit",
|
|
18564
|
+
inputs: [
|
|
18565
|
+
{
|
|
18566
|
+
name: "token",
|
|
18567
|
+
type: "address",
|
|
18568
|
+
internalType: "address"
|
|
18569
|
+
},
|
|
18570
|
+
{
|
|
18571
|
+
name: "amount",
|
|
18572
|
+
type: "uint256",
|
|
18573
|
+
internalType: "uint256"
|
|
18574
|
+
},
|
|
18575
|
+
{
|
|
18576
|
+
name: "deadline",
|
|
18577
|
+
type: "uint256",
|
|
18578
|
+
internalType: "uint256"
|
|
18579
|
+
},
|
|
18580
|
+
{
|
|
18581
|
+
name: "v",
|
|
18582
|
+
type: "uint8",
|
|
18583
|
+
internalType: "uint8"
|
|
18584
|
+
},
|
|
18585
|
+
{
|
|
18586
|
+
name: "r",
|
|
18587
|
+
type: "bytes32",
|
|
18588
|
+
internalType: "bytes32"
|
|
18589
|
+
},
|
|
18590
|
+
{
|
|
18591
|
+
name: "s",
|
|
18592
|
+
type: "bytes32",
|
|
18593
|
+
internalType: "bytes32"
|
|
18594
|
+
}
|
|
18595
|
+
],
|
|
18596
|
+
outputs: [],
|
|
18597
|
+
stateMutability: "nonpayable"
|
|
18598
|
+
},
|
|
18599
|
+
{
|
|
18600
|
+
type: "function",
|
|
18601
|
+
name: "compareBalances",
|
|
18602
|
+
inputs: [],
|
|
18603
|
+
outputs: [],
|
|
18604
|
+
stateMutability: "nonpayable"
|
|
18605
|
+
},
|
|
18606
|
+
{
|
|
18607
|
+
type: "function",
|
|
18608
|
+
name: "decreaseDebt",
|
|
18609
|
+
inputs: [
|
|
18610
|
+
{
|
|
18611
|
+
name: "amount",
|
|
18612
|
+
type: "uint256",
|
|
18613
|
+
internalType: "uint256"
|
|
18614
|
+
}
|
|
18615
|
+
],
|
|
18616
|
+
outputs: [],
|
|
18617
|
+
stateMutability: "nonpayable"
|
|
18618
|
+
},
|
|
18619
|
+
{
|
|
18620
|
+
type: "function",
|
|
18621
|
+
name: "increaseDebt",
|
|
18622
|
+
inputs: [
|
|
18623
|
+
{
|
|
18624
|
+
name: "amount",
|
|
18625
|
+
type: "uint256",
|
|
18626
|
+
internalType: "uint256"
|
|
18627
|
+
}
|
|
18628
|
+
],
|
|
18629
|
+
outputs: [],
|
|
18630
|
+
stateMutability: "nonpayable"
|
|
18631
|
+
},
|
|
18632
|
+
{
|
|
18633
|
+
type: "function",
|
|
18634
|
+
name: "onDemandPriceUpdates",
|
|
18635
|
+
inputs: [
|
|
18636
|
+
{
|
|
18637
|
+
name: "updates",
|
|
18638
|
+
type: "tuple[]",
|
|
18639
|
+
internalType: "struct PriceUpdate[]",
|
|
18640
|
+
components: [
|
|
18641
|
+
{
|
|
18642
|
+
name: "priceFeed",
|
|
18643
|
+
type: "address",
|
|
18644
|
+
internalType: "address"
|
|
18645
|
+
},
|
|
18646
|
+
{
|
|
18647
|
+
name: "data",
|
|
18648
|
+
type: "bytes",
|
|
18649
|
+
internalType: "bytes"
|
|
18650
|
+
}
|
|
18651
|
+
]
|
|
18652
|
+
}
|
|
18653
|
+
],
|
|
18654
|
+
outputs: [],
|
|
18655
|
+
stateMutability: "nonpayable"
|
|
18656
|
+
},
|
|
18657
|
+
{
|
|
18658
|
+
type: "function",
|
|
18659
|
+
name: "setBotPermissions",
|
|
18660
|
+
inputs: [
|
|
18661
|
+
{
|
|
18662
|
+
name: "bot",
|
|
18663
|
+
type: "address",
|
|
18664
|
+
internalType: "address"
|
|
18665
|
+
},
|
|
18666
|
+
{
|
|
18667
|
+
name: "permissions",
|
|
18668
|
+
type: "uint192",
|
|
18669
|
+
internalType: "uint192"
|
|
18670
|
+
}
|
|
18671
|
+
],
|
|
18672
|
+
outputs: [],
|
|
18673
|
+
stateMutability: "nonpayable"
|
|
18674
|
+
},
|
|
18675
|
+
{
|
|
18676
|
+
type: "function",
|
|
18677
|
+
name: "setFullCheckParams",
|
|
18678
|
+
inputs: [
|
|
18679
|
+
{
|
|
18680
|
+
name: "collateralHints",
|
|
18681
|
+
type: "uint256[]",
|
|
18682
|
+
internalType: "uint256[]"
|
|
18683
|
+
},
|
|
18684
|
+
{
|
|
18685
|
+
name: "minHealthFactor",
|
|
18686
|
+
type: "uint16",
|
|
18687
|
+
internalType: "uint16"
|
|
18688
|
+
}
|
|
18689
|
+
],
|
|
18690
|
+
outputs: [],
|
|
18691
|
+
stateMutability: "nonpayable"
|
|
18692
|
+
},
|
|
18693
|
+
{
|
|
18694
|
+
type: "function",
|
|
18695
|
+
name: "storeExpectedBalances",
|
|
18696
|
+
inputs: [
|
|
18697
|
+
{
|
|
18698
|
+
name: "balanceDeltas",
|
|
18699
|
+
type: "tuple[]",
|
|
18700
|
+
internalType: "struct BalanceDelta[]",
|
|
18701
|
+
components: [
|
|
18702
|
+
{
|
|
18703
|
+
name: "token",
|
|
18704
|
+
type: "address",
|
|
18705
|
+
internalType: "address"
|
|
18706
|
+
},
|
|
18707
|
+
{
|
|
18708
|
+
name: "amount",
|
|
18709
|
+
type: "int256",
|
|
18710
|
+
internalType: "int256"
|
|
18711
|
+
}
|
|
18712
|
+
]
|
|
18713
|
+
}
|
|
18714
|
+
],
|
|
18715
|
+
outputs: [],
|
|
18716
|
+
stateMutability: "nonpayable"
|
|
18717
|
+
},
|
|
18718
|
+
{
|
|
18719
|
+
type: "function",
|
|
18720
|
+
name: "updateQuota",
|
|
18721
|
+
inputs: [
|
|
18722
|
+
{
|
|
18723
|
+
name: "token",
|
|
18724
|
+
type: "address",
|
|
18725
|
+
internalType: "address"
|
|
18726
|
+
},
|
|
18727
|
+
{
|
|
18728
|
+
name: "quotaChange",
|
|
18729
|
+
type: "int96",
|
|
18730
|
+
internalType: "int96"
|
|
18731
|
+
},
|
|
18732
|
+
{
|
|
18733
|
+
name: "minQuota",
|
|
18734
|
+
type: "uint96",
|
|
18735
|
+
internalType: "uint96"
|
|
18736
|
+
}
|
|
18737
|
+
],
|
|
18738
|
+
outputs: [],
|
|
18739
|
+
stateMutability: "nonpayable"
|
|
18740
|
+
},
|
|
18741
|
+
{
|
|
18742
|
+
type: "function",
|
|
18743
|
+
name: "withdrawCollateral",
|
|
18744
|
+
inputs: [
|
|
18745
|
+
{
|
|
18746
|
+
name: "token",
|
|
18747
|
+
type: "address",
|
|
18748
|
+
internalType: "address"
|
|
18749
|
+
},
|
|
18750
|
+
{
|
|
18751
|
+
name: "amount",
|
|
18752
|
+
type: "uint256",
|
|
18753
|
+
internalType: "uint256"
|
|
18754
|
+
},
|
|
18755
|
+
{
|
|
18756
|
+
name: "to",
|
|
18757
|
+
type: "address",
|
|
18758
|
+
internalType: "address"
|
|
18759
|
+
}
|
|
18760
|
+
],
|
|
18761
|
+
outputs: [],
|
|
18762
|
+
stateMutability: "nonpayable"
|
|
18763
|
+
}
|
|
18764
|
+
];
|
|
18765
|
+
|
|
17718
18766
|
// src/sdk/constants/addresses.ts
|
|
17719
18767
|
var ADDRESS_0X0 = "0x0000000000000000000000000000000000000000";
|
|
17720
18768
|
var NOT_DEPLOYED = "0xNOT DEPLOYED";
|
|
@@ -18584,8 +19632,8 @@ var CreditConfiguratorContract = class extends BaseContract {
|
|
|
18584
19632
|
}
|
|
18585
19633
|
};
|
|
18586
19634
|
|
|
18587
|
-
// src/sdk/market/
|
|
18588
|
-
var
|
|
19635
|
+
// src/sdk/market/CreditFacadeV300Contract.ts
|
|
19636
|
+
var CreditFacadeV300Contract = class extends BaseContract {
|
|
18589
19637
|
state;
|
|
18590
19638
|
constructor(sdk, { creditFacade, creditManager }) {
|
|
18591
19639
|
super(sdk, {
|
|
@@ -18611,16 +19659,23 @@ var CreditFacadeContract = class extends BaseContract {
|
|
|
18611
19659
|
isPaused: creditFacade.isPaused
|
|
18612
19660
|
};
|
|
18613
19661
|
}
|
|
18614
|
-
|
|
18615
|
-
|
|
18616
|
-
|
|
18617
|
-
|
|
18618
|
-
|
|
18619
|
-
|
|
18620
|
-
|
|
18621
|
-
|
|
18622
|
-
|
|
18623
|
-
|
|
19662
|
+
liquidateCreditAccount(ca, to, calls) {
|
|
19663
|
+
return this.createRawTx({
|
|
19664
|
+
functionName: "liquidateCreditAccount",
|
|
19665
|
+
args: [ca, to, calls]
|
|
19666
|
+
});
|
|
19667
|
+
}
|
|
19668
|
+
closeCreditAccount(ca, calls) {
|
|
19669
|
+
return this.createRawTx({
|
|
19670
|
+
functionName: "closeCreditAccount",
|
|
19671
|
+
args: [ca, calls]
|
|
19672
|
+
});
|
|
19673
|
+
}
|
|
19674
|
+
multicall(ca, calls) {
|
|
19675
|
+
return this.createRawTx({
|
|
19676
|
+
functionName: "multicall",
|
|
19677
|
+
args: [ca, calls]
|
|
19678
|
+
});
|
|
18624
19679
|
}
|
|
18625
19680
|
parseFunctionParams(params) {
|
|
18626
19681
|
switch (params.functionName) {
|
|
@@ -18661,6 +19716,82 @@ var CreditFacadeContract = class extends BaseContract {
|
|
|
18661
19716
|
}
|
|
18662
19717
|
};
|
|
18663
19718
|
|
|
19719
|
+
// src/sdk/market/CreditFacadeV310Contract.ts
|
|
19720
|
+
var CreditFacadeV310Contract = class extends BaseContract {
|
|
19721
|
+
state;
|
|
19722
|
+
constructor(sdk, { creditFacade, creditManager }) {
|
|
19723
|
+
super(sdk, {
|
|
19724
|
+
...creditFacade.baseParams,
|
|
19725
|
+
name: `CreditFacadeV310(${creditManager.name})`,
|
|
19726
|
+
// Add multicall strictly for parsing, but use only creditFacadeV3Abi in types, so only this part is visible to typescript elsewhere
|
|
19727
|
+
abi: [...iCreditFacadeV310Abi, ...iCreditFacadeV310MulticallAbi]
|
|
19728
|
+
});
|
|
19729
|
+
this.state = {
|
|
19730
|
+
...this.contractData,
|
|
19731
|
+
maxQuotaMultiplier: Number(creditFacade.maxQuotaMultiplier),
|
|
19732
|
+
expirable: creditFacade.expirable,
|
|
19733
|
+
isDegenMode: creditFacade.degenNFT !== ADDRESS_0X0,
|
|
19734
|
+
degenNFT: creditFacade.degenNFT,
|
|
19735
|
+
expirationDate: Number(creditFacade.expirationDate),
|
|
19736
|
+
maxDebtPerBlockMultiplier: Number(creditFacade.maxDebtPerBlockMultiplier),
|
|
19737
|
+
botList: creditFacade.botList,
|
|
19738
|
+
minDebt: creditFacade.minDebt,
|
|
19739
|
+
maxDebt: creditFacade.maxDebt,
|
|
19740
|
+
currentCumulativeLoss: 0n,
|
|
19741
|
+
maxCumulativeLoss: 0n,
|
|
19742
|
+
forbiddenTokenMask: creditFacade.forbiddenTokenMask,
|
|
19743
|
+
isPaused: creditFacade.isPaused
|
|
19744
|
+
};
|
|
19745
|
+
}
|
|
19746
|
+
liquidateCreditAccount(ca, to, calls) {
|
|
19747
|
+
return this.createRawTx({
|
|
19748
|
+
functionName: "liquidateCreditAccount",
|
|
19749
|
+
args: [ca, to, calls]
|
|
19750
|
+
});
|
|
19751
|
+
}
|
|
19752
|
+
closeCreditAccount(ca, calls) {
|
|
19753
|
+
return this.createRawTx({
|
|
19754
|
+
functionName: "closeCreditAccount",
|
|
19755
|
+
args: [ca, calls]
|
|
19756
|
+
});
|
|
19757
|
+
}
|
|
19758
|
+
multicall(ca, calls) {
|
|
19759
|
+
return this.createRawTx({
|
|
19760
|
+
functionName: "multicall",
|
|
19761
|
+
args: [ca, calls]
|
|
19762
|
+
});
|
|
19763
|
+
}
|
|
19764
|
+
parseFunctionParams(params) {
|
|
19765
|
+
switch (params.functionName) {
|
|
19766
|
+
case "openCreditAccount": {
|
|
19767
|
+
const [onBehalfOf, calls, referralCode] = params.args;
|
|
19768
|
+
return [
|
|
19769
|
+
this.addressLabels.get(onBehalfOf),
|
|
19770
|
+
this.sdk.parseMultiCall([...calls]).join(","),
|
|
19771
|
+
`${referralCode}`
|
|
19772
|
+
];
|
|
19773
|
+
}
|
|
19774
|
+
case "closeCreditAccount": {
|
|
19775
|
+
const [creditAccount, calls] = params.args;
|
|
19776
|
+
return [
|
|
19777
|
+
this.addressLabels.get(creditAccount),
|
|
19778
|
+
this.sdk.parseMultiCall([...calls]).join(",")
|
|
19779
|
+
];
|
|
19780
|
+
}
|
|
19781
|
+
case "liquidateCreditAccount": {
|
|
19782
|
+
const [creditAccount, to, calls] = params.args;
|
|
19783
|
+
return [
|
|
19784
|
+
this.addressLabels.get(creditAccount),
|
|
19785
|
+
this.addressLabels.get(to),
|
|
19786
|
+
this.sdk.parseMultiCall([...calls]).join(",")
|
|
19787
|
+
];
|
|
19788
|
+
}
|
|
19789
|
+
default:
|
|
19790
|
+
return void 0;
|
|
19791
|
+
}
|
|
19792
|
+
}
|
|
19793
|
+
};
|
|
19794
|
+
|
|
18664
19795
|
// src/sdk/market/CreditManagerContract.ts
|
|
18665
19796
|
var CreditManagerContract = class extends BaseContract {
|
|
18666
19797
|
state;
|
|
@@ -18738,8 +19869,6 @@ var CreditFactory = class {
|
|
|
18738
19869
|
creditManager;
|
|
18739
19870
|
creditFacade;
|
|
18740
19871
|
creditConfigurator;
|
|
18741
|
-
// TODO:
|
|
18742
|
-
// adapterFactory: AdapterFactory;
|
|
18743
19872
|
constructor(sdk, marketData, index) {
|
|
18744
19873
|
const { creditManagers, pool, emergencyLiquidators } = marketData;
|
|
18745
19874
|
const creditManager = creditManagers[index];
|
|
@@ -18751,7 +19880,11 @@ var CreditFactory = class {
|
|
|
18751
19880
|
collateralTokens.map((t, i) => [t, liquidationThresholds[i]])
|
|
18752
19881
|
);
|
|
18753
19882
|
this.creditManager = new CreditManagerContract(sdk, creditManager, pool);
|
|
18754
|
-
|
|
19883
|
+
if (creditManager.creditFacade.baseParams.version < 310) {
|
|
19884
|
+
this.creditFacade = new CreditFacadeV300Contract(sdk, creditManager);
|
|
19885
|
+
} else {
|
|
19886
|
+
this.creditFacade = new CreditFacadeV310Contract(sdk, creditManager);
|
|
19887
|
+
}
|
|
18755
19888
|
this.creditConfigurator = new CreditConfiguratorContract(
|
|
18756
19889
|
sdk,
|
|
18757
19890
|
creditManager,
|
|
@@ -20520,15 +21653,11 @@ var CreditAccountsService = class extends SDKConstruct {
|
|
|
20520
21653
|
if (!recipient) {
|
|
20521
21654
|
throw new Error("liquidate account: assets recipient not specied");
|
|
20522
21655
|
}
|
|
20523
|
-
return cm.creditFacade.
|
|
20524
|
-
|
|
20525
|
-
|
|
20526
|
-
|
|
20527
|
-
|
|
20528
|
-
[...priceUpdates, ...preview.calls]
|
|
20529
|
-
],
|
|
20530
|
-
description: `fully liquidate ${account.creditAccount}`
|
|
20531
|
-
});
|
|
21656
|
+
return cm.creditFacade.liquidateCreditAccount(
|
|
21657
|
+
account.creditAccount,
|
|
21658
|
+
recipient,
|
|
21659
|
+
[...priceUpdates, ...preview.calls]
|
|
21660
|
+
);
|
|
20532
21661
|
}
|
|
20533
21662
|
/**
|
|
20534
21663
|
* Closes credit account or sets debt to zero (but keep account)
|
|
@@ -20552,11 +21681,7 @@ var CreditAccountsService = class extends SDKConstruct {
|
|
|
20552
21681
|
recipient,
|
|
20553
21682
|
slippage
|
|
20554
21683
|
);
|
|
20555
|
-
return cm.creditFacade.
|
|
20556
|
-
functionName: operation === "close" ? "closeCreditAccount" : "multicall",
|
|
20557
|
-
args: [ca.creditAccount, calls],
|
|
20558
|
-
description: `${operation} account ${ca.creditAccount}`
|
|
20559
|
-
});
|
|
21684
|
+
return operation === "close" ? cm.creditFacade.closeCreditAccount(ca.creditAccount, calls) : cm.creditFacade.multicall(ca.creditAccount, calls);
|
|
20560
21685
|
}
|
|
20561
21686
|
/**
|
|
20562
21687
|
* Internal wrapper for CreditAccountCompressor.getCreditAccounts + price updates wrapped into multicall
|
|
@@ -21347,10 +22472,9 @@ var GearboxSDK = class _GearboxSDK {
|
|
|
21347
22472
|
return this;
|
|
21348
22473
|
}
|
|
21349
22474
|
parseLogs(logs) {
|
|
21350
|
-
|
|
21351
|
-
|
|
21352
|
-
|
|
21353
|
-
});
|
|
22475
|
+
for (const log of logs) {
|
|
22476
|
+
this.contracts.get(log.address)?.parseLog(log);
|
|
22477
|
+
}
|
|
21354
22478
|
}
|
|
21355
22479
|
/**
|
|
21356
22480
|
* Converts contract call into some human-friendly string
|
|
@@ -21884,7 +23008,8 @@ exports.ConvexV1BaseRewardPoolAdapterContract = ConvexV1BaseRewardPoolAdapterCon
|
|
|
21884
23008
|
exports.ConvexV1BoosterAdapterContract = ConvexV1BoosterAdapterContract;
|
|
21885
23009
|
exports.CreditAccountsService = CreditAccountsService;
|
|
21886
23010
|
exports.CreditConfiguratorContract = CreditConfiguratorContract;
|
|
21887
|
-
exports.
|
|
23011
|
+
exports.CreditFacadeV300Contract = CreditFacadeV300Contract;
|
|
23012
|
+
exports.CreditFacadeV310Contract = CreditFacadeV310Contract;
|
|
21888
23013
|
exports.CreditFactory = CreditFactory;
|
|
21889
23014
|
exports.CreditManagerContract = CreditManagerContract;
|
|
21890
23015
|
exports.Curve2AssetsAdapterContract = Curve2AssetsAdapterContract;
|