@gvnrdao/dh-sdk 0.0.132 → 0.0.144
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/browser/dist/397.browser.js +1 -1
- package/browser/dist/833.browser.js +1 -1
- package/browser/dist/browser.js +6 -6
- package/dist/index.d.mts +610 -251
- package/dist/index.d.ts +610 -251
- package/dist/index.js +1304 -785
- package/dist/index.mjs +1304 -785
- package/package.json +6 -3
package/dist/index.js
CHANGED
|
@@ -12702,73 +12702,70 @@ var init_deployment_addresses = __esm({
|
|
|
12702
12702
|
SEPOLIA_DEPLOYMENT = {
|
|
12703
12703
|
"network": "sepolia",
|
|
12704
12704
|
"chainId": 11155111,
|
|
12705
|
-
"timestamp": "
|
|
12705
|
+
"timestamp": "2026-01-12T18:16:06.851Z",
|
|
12706
12706
|
"deployer": "",
|
|
12707
12707
|
"contracts": {
|
|
12708
|
-
"UpgradeValidator": "
|
|
12708
|
+
"UpgradeValidator": "0x2eE5F81f828C6AC9a8F979327680893C9fd11a2f",
|
|
12709
12709
|
"UCDToken": "0x86060fa5b3e01e003b8afd9c1295f1f444a7dc60",
|
|
12710
12710
|
"UCDController": "0x8956368203475DeECA21bc79F5FDeA249937E20C",
|
|
12711
|
-
"PriceFeedConsumer": "
|
|
12712
|
-
"
|
|
12713
|
-
"
|
|
12714
|
-
"
|
|
12715
|
-
"
|
|
12716
|
-
"
|
|
12717
|
-
"
|
|
12718
|
-
"
|
|
12719
|
-
"
|
|
12720
|
-
"
|
|
12721
|
-
"
|
|
12722
|
-
"
|
|
12723
|
-
"
|
|
12724
|
-
"
|
|
12725
|
-
"PKPValidation": "0x0d448F827b1803865F6D4135Fb5FBcD285D34Aac"
|
|
12711
|
+
"PriceFeedConsumer": "0x6eFB125c2bbC6fAc66a765cd017940b0dE5A9A54",
|
|
12712
|
+
"UCDMintingRewards": "0x2b51EBee507f83B59fbceeaa12AC6F725d19A33f",
|
|
12713
|
+
"PositionManagerCoreModule": "0x3db72154cd37b64194f35a239866b0A3aADd60B5",
|
|
12714
|
+
"TermManagerModule": "0x4Ec79Ca3ef3bAd4a474310e1228a06bCD5a8c5A6",
|
|
12715
|
+
"LoanOperationsManagerModule": "0x2618C73d6F7Bc8eD6CB4Bcf7a769f1ce58f5158c",
|
|
12716
|
+
"CollateralManagerModule": "0x0EDd9206D653de80Ac2df4784750b93490532104",
|
|
12717
|
+
"LiquidationManagerModule": "0x4C4a4E308D3108c5b4fA424A30BaB1E072712B8F",
|
|
12718
|
+
"CircuitBreakerModule": "0x6E6b14412ac206590aB810Df3b5bC7915904eC90",
|
|
12719
|
+
"CommunityManagerModule": "0x93994136a18aFe2e9ee4C8F797408bD1a6F884b7",
|
|
12720
|
+
"AdminModule": "0xa7b8a2b253D28689215B726889062850D44377e5",
|
|
12721
|
+
"PositionManagerViews": "0xd954267B1f78B0aD26184A6aDdAc0C4421fA52F3",
|
|
12722
|
+
"PositionManager": "0xf4E026844c8830a618933324aa098ce278Aa88e1",
|
|
12723
|
+
"OperationAuthorizationRegistry": "0xfAd27cAeD4a31826CC9d8cD11F5E0995274157e0",
|
|
12724
|
+
"PKPValidation": "0xf218a50eF679Dccd64d557ec5F935c928A334109"
|
|
12726
12725
|
}
|
|
12727
12726
|
};
|
|
12728
12727
|
SEPOLIA_CONTRACTS = {
|
|
12729
|
-
"UpgradeValidator": "
|
|
12728
|
+
"UpgradeValidator": "0x2eE5F81f828C6AC9a8F979327680893C9fd11a2f",
|
|
12730
12729
|
"UCDToken": "0x86060fa5b3e01e003b8afd9c1295f1f444a7dc60",
|
|
12731
12730
|
"UCDController": "0x8956368203475DeECA21bc79F5FDeA249937E20C",
|
|
12732
|
-
"PriceFeedConsumer": "
|
|
12733
|
-
"
|
|
12734
|
-
"
|
|
12735
|
-
"
|
|
12736
|
-
"
|
|
12737
|
-
"
|
|
12738
|
-
"
|
|
12739
|
-
"
|
|
12740
|
-
"
|
|
12741
|
-
"
|
|
12742
|
-
"
|
|
12743
|
-
"
|
|
12744
|
-
"
|
|
12745
|
-
"
|
|
12746
|
-
"PKPValidation": "0x0d448F827b1803865F6D4135Fb5FBcD285D34Aac"
|
|
12731
|
+
"PriceFeedConsumer": "0x6eFB125c2bbC6fAc66a765cd017940b0dE5A9A54",
|
|
12732
|
+
"UCDMintingRewards": "0x2b51EBee507f83B59fbceeaa12AC6F725d19A33f",
|
|
12733
|
+
"PositionManagerCoreModule": "0x3db72154cd37b64194f35a239866b0A3aADd60B5",
|
|
12734
|
+
"TermManagerModule": "0x4Ec79Ca3ef3bAd4a474310e1228a06bCD5a8c5A6",
|
|
12735
|
+
"LoanOperationsManagerModule": "0x2618C73d6F7Bc8eD6CB4Bcf7a769f1ce58f5158c",
|
|
12736
|
+
"CollateralManagerModule": "0x0EDd9206D653de80Ac2df4784750b93490532104",
|
|
12737
|
+
"LiquidationManagerModule": "0x4C4a4E308D3108c5b4fA424A30BaB1E072712B8F",
|
|
12738
|
+
"CircuitBreakerModule": "0x6E6b14412ac206590aB810Df3b5bC7915904eC90",
|
|
12739
|
+
"CommunityManagerModule": "0x93994136a18aFe2e9ee4C8F797408bD1a6F884b7",
|
|
12740
|
+
"AdminModule": "0xa7b8a2b253D28689215B726889062850D44377e5",
|
|
12741
|
+
"PositionManagerViews": "0xd954267B1f78B0aD26184A6aDdAc0C4421fA52F3",
|
|
12742
|
+
"PositionManager": "0xf4E026844c8830a618933324aa098ce278Aa88e1",
|
|
12743
|
+
"OperationAuthorizationRegistry": "0xfAd27cAeD4a31826CC9d8cD11F5E0995274157e0",
|
|
12744
|
+
"PKPValidation": "0xf218a50eF679Dccd64d557ec5F935c928A334109"
|
|
12747
12745
|
};
|
|
12748
12746
|
LOCALHOST_DEPLOYMENT = {
|
|
12749
12747
|
"network": "localhost",
|
|
12750
12748
|
"chainId": 31337,
|
|
12751
|
-
"timestamp": "
|
|
12749
|
+
"timestamp": "2026-01-14T14:31:57.573Z",
|
|
12752
12750
|
"deployer": "",
|
|
12753
12751
|
"contracts": {
|
|
12754
12752
|
"UpgradeValidator": "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6",
|
|
12755
12753
|
"UCDToken": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
|
|
12756
12754
|
"UCDController": "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9",
|
|
12757
12755
|
"PriceFeedConsumer": "0x610178dA211FEF7D417bC0e6FeD39F05609AD788",
|
|
12758
|
-
"
|
|
12759
|
-
"
|
|
12760
|
-
"
|
|
12761
|
-
"
|
|
12762
|
-
"
|
|
12763
|
-
"
|
|
12764
|
-
"
|
|
12765
|
-
"
|
|
12766
|
-
"
|
|
12767
|
-
"
|
|
12768
|
-
"
|
|
12769
|
-
"
|
|
12770
|
-
"
|
|
12771
|
-
"PKPValidation": "0x4c5859f0F772848b2D91F1D83E2Fe57935348029"
|
|
12756
|
+
"UCDMintingRewards": "0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0",
|
|
12757
|
+
"PositionManagerCoreModule": "0x9A676e781A523b5d0C0e43731313A708CB607508",
|
|
12758
|
+
"TermManagerModule": "0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1",
|
|
12759
|
+
"LoanOperationsManagerModule": "0xc6e7DF5E7b4f2A278906862b61205850344D4e7d",
|
|
12760
|
+
"CollateralManagerModule": "0x4ed7c70F96B99c776995fB64377f0d4aB3B0e1C1",
|
|
12761
|
+
"LiquidationManagerModule": "0xa85233C63b9Ee964Add6F2cffe00Fd84eb32338f",
|
|
12762
|
+
"CircuitBreakerModule": "0x68B1D87F95878fE05B998F19b66F4baba5De1aed",
|
|
12763
|
+
"CommunityManagerModule": "0x7a2088a1bFc9d81c55368AE168C2C02570cB814F",
|
|
12764
|
+
"AdminModule": "0xc5a5C42992dECbae36851359345FE25997F5C42d",
|
|
12765
|
+
"PositionManagerViews": "0x67d269191c92Caf3cD7723F116c85e6E9bf55933",
|
|
12766
|
+
"PositionManager": "0xc3e53F4d16Ae77Db1c982e75a937B9f60FE63690",
|
|
12767
|
+
"OperationAuthorizationRegistry": "0x8f86403A4DE0BB5791fa46B8e795C547942fE4Cf",
|
|
12768
|
+
"PKPValidation": "0x36C02dA8a0983159322a80FFE9F24b1acfF8B570"
|
|
12772
12769
|
}
|
|
12773
12770
|
};
|
|
12774
12771
|
LOCALHOST_CONTRACTS = {
|
|
@@ -12776,20 +12773,19 @@ var init_deployment_addresses = __esm({
|
|
|
12776
12773
|
"UCDToken": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
|
|
12777
12774
|
"UCDController": "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9",
|
|
12778
12775
|
"PriceFeedConsumer": "0x610178dA211FEF7D417bC0e6FeD39F05609AD788",
|
|
12779
|
-
"
|
|
12780
|
-
"
|
|
12781
|
-
"
|
|
12782
|
-
"
|
|
12783
|
-
"
|
|
12784
|
-
"
|
|
12785
|
-
"
|
|
12786
|
-
"
|
|
12787
|
-
"
|
|
12788
|
-
"
|
|
12789
|
-
"
|
|
12790
|
-
"
|
|
12791
|
-
"
|
|
12792
|
-
"PKPValidation": "0x4c5859f0F772848b2D91F1D83E2Fe57935348029"
|
|
12776
|
+
"UCDMintingRewards": "0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0",
|
|
12777
|
+
"PositionManagerCoreModule": "0x9A676e781A523b5d0C0e43731313A708CB607508",
|
|
12778
|
+
"TermManagerModule": "0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1",
|
|
12779
|
+
"LoanOperationsManagerModule": "0xc6e7DF5E7b4f2A278906862b61205850344D4e7d",
|
|
12780
|
+
"CollateralManagerModule": "0x4ed7c70F96B99c776995fB64377f0d4aB3B0e1C1",
|
|
12781
|
+
"LiquidationManagerModule": "0xa85233C63b9Ee964Add6F2cffe00Fd84eb32338f",
|
|
12782
|
+
"CircuitBreakerModule": "0x68B1D87F95878fE05B998F19b66F4baba5De1aed",
|
|
12783
|
+
"CommunityManagerModule": "0x7a2088a1bFc9d81c55368AE168C2C02570cB814F",
|
|
12784
|
+
"AdminModule": "0xc5a5C42992dECbae36851359345FE25997F5C42d",
|
|
12785
|
+
"PositionManagerViews": "0x67d269191c92Caf3cD7723F116c85e6E9bf55933",
|
|
12786
|
+
"PositionManager": "0xc3e53F4d16Ae77Db1c982e75a937B9f60FE63690",
|
|
12787
|
+
"OperationAuthorizationRegistry": "0x8f86403A4DE0BB5791fa46B8e795C547942fE4Cf",
|
|
12788
|
+
"PKPValidation": "0x36C02dA8a0983159322a80FFE9F24b1acfF8B570"
|
|
12793
12789
|
};
|
|
12794
12790
|
ALL_DEPLOYMENTS = {
|
|
12795
12791
|
sepolia: SEPOLIA_DEPLOYMENT,
|
|
@@ -12832,7 +12828,6 @@ function getBrowserSafeConfig() {
|
|
|
12832
12828
|
CommunityManagerModule: "",
|
|
12833
12829
|
LiquidationManagerModule: "",
|
|
12834
12830
|
UCDToken: "",
|
|
12835
|
-
BTCProofValidator: "",
|
|
12836
12831
|
PriceFeedConsumer: "",
|
|
12837
12832
|
MockUSDC: "",
|
|
12838
12833
|
MockUSDT: ""
|
|
@@ -12908,7 +12903,6 @@ function getSepoliaConfig() {
|
|
|
12908
12903
|
logNetworkConfig("log", "[NetworkConfig] Sepolia contracts:", {
|
|
12909
12904
|
PositionManager: SEPOLIA_CONTRACTS.PositionManager,
|
|
12910
12905
|
UCDToken: SEPOLIA_CONTRACTS.UCDToken,
|
|
12911
|
-
BTCProofValidator: SEPOLIA_CONTRACTS.BTCProofValidator,
|
|
12912
12906
|
PriceFeedConsumer: SEPOLIA_CONTRACTS.PriceFeedConsumer
|
|
12913
12907
|
});
|
|
12914
12908
|
return {
|
|
@@ -12918,6 +12912,7 @@ function getSepoliaConfig() {
|
|
|
12918
12912
|
name: "sepolia",
|
|
12919
12913
|
rpcUrls: [],
|
|
12920
12914
|
litNetwork: "datil",
|
|
12915
|
+
validatorVersion: 9,
|
|
12921
12916
|
contractAddresses: {
|
|
12922
12917
|
positionManager: SEPOLIA_CONTRACTS.PositionManager || "",
|
|
12923
12918
|
positionManagerCore: SEPOLIA_CONTRACTS.PositionManagerCoreModule || "",
|
|
@@ -12932,12 +12927,11 @@ function getSepoliaConfig() {
|
|
|
12932
12927
|
liquidationManager: SEPOLIA_CONTRACTS.LiquidationManagerModule || "",
|
|
12933
12928
|
ucdToken: SEPOLIA_CONTRACTS.UCDToken || "",
|
|
12934
12929
|
ucdController: SEPOLIA_CONTRACTS.UCDController || "",
|
|
12935
|
-
btcProofValidator: SEPOLIA_CONTRACTS.BTCProofValidator || "",
|
|
12936
12930
|
priceFeedConsumer: SEPOLIA_CONTRACTS.PriceFeedConsumer || "",
|
|
12937
12931
|
operationAuthorizationRegistry: SEPOLIA_CONTRACTS.OperationAuthorizationRegistry || ""
|
|
12938
12932
|
},
|
|
12939
12933
|
subgraphs: {
|
|
12940
|
-
diamondHandsUrl: "https://api.studio.thegraph.com/query/65258/diamond-hands/
|
|
12934
|
+
diamondHandsUrl: "https://api.studio.thegraph.com/query/65258/diamond-hands/version/latest"
|
|
12941
12935
|
},
|
|
12942
12936
|
// litNetwork: "datil-test",
|
|
12943
12937
|
debug: true
|
|
@@ -12952,7 +12946,6 @@ function getMainnetConfig() {
|
|
|
12952
12946
|
chainId: 1,
|
|
12953
12947
|
name: "mainnet",
|
|
12954
12948
|
rpcUrls: [
|
|
12955
|
-
"https://eth-mainnet.g.alchemy.com/v2/demo",
|
|
12956
12949
|
"https://mainnet.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161"
|
|
12957
12950
|
],
|
|
12958
12951
|
contractAddresses: {
|
|
@@ -12966,7 +12959,6 @@ function getMainnetConfig() {
|
|
|
12966
12959
|
communityManager: contracts.CommunityManagerModule || "",
|
|
12967
12960
|
liquidationManager: contracts.LiquidationManagerModule || "",
|
|
12968
12961
|
ucdToken: contracts.UCDToken || "",
|
|
12969
|
-
btcProofValidator: contracts.BTCProofValidator || "",
|
|
12970
12962
|
priceFeedConsumer: contracts.PriceFeedConsumer || "",
|
|
12971
12963
|
operationAuthorizationRegistry: contracts.OperationAuthorizationRegistry || ""
|
|
12972
12964
|
},
|
|
@@ -12991,14 +12983,8 @@ function getLocalhostConfig() {
|
|
|
12991
12983
|
);
|
|
12992
12984
|
logNetworkConfig("log", "[NetworkConfig] Localhost contracts:", {
|
|
12993
12985
|
PositionManager: getAddress3("POSITION_MANAGER_ADDRESS", "PositionManager"),
|
|
12994
|
-
PositionManagerCore: getAddress3(
|
|
12995
|
-
|
|
12996
|
-
"PositionManagerCoreModule"
|
|
12997
|
-
),
|
|
12998
|
-
LoanOperationsManagerModule: getAddress3(
|
|
12999
|
-
"LOAN_OPERATIONS_MANAGER_ADDRESS",
|
|
13000
|
-
"LoanOperationsManagerModule"
|
|
13001
|
-
),
|
|
12986
|
+
PositionManagerCore: getAddress3("POSITION_MANAGER_CORE_ADDRESS", "PositionManagerCoreModule"),
|
|
12987
|
+
LoanOperationsManagerModule: getAddress3("LOAN_OPERATIONS_MANAGER_ADDRESS", "LoanOperationsManagerModule"),
|
|
13002
12988
|
TermManagerModule: getAddress3("TERM_MANAGER_ADDRESS", "TermManagerModule"),
|
|
13003
12989
|
UCDToken: getAddress3("UCD_TOKEN_ADDRESS", "UCDToken")
|
|
13004
12990
|
});
|
|
@@ -13009,53 +12995,22 @@ function getLocalhostConfig() {
|
|
|
13009
12995
|
name: "localhost",
|
|
13010
12996
|
rpcUrls: ["http://localhost:8545"],
|
|
13011
12997
|
contractAddresses: {
|
|
13012
|
-
positionManager: getAddress3(
|
|
13013
|
-
|
|
13014
|
-
|
|
13015
|
-
),
|
|
13016
|
-
positionManagerCore: getAddress3(
|
|
13017
|
-
"POSITION_MANAGER_CORE_ADDRESS",
|
|
13018
|
-
"PositionManagerCoreModule"
|
|
13019
|
-
),
|
|
13020
|
-
positionManagerViews: getAddress3(
|
|
13021
|
-
"POSITION_MANAGER_VIEWS_ADDRESS",
|
|
13022
|
-
"PositionManagerViews"
|
|
13023
|
-
),
|
|
12998
|
+
positionManager: getAddress3("POSITION_MANAGER_ADDRESS", "PositionManager"),
|
|
12999
|
+
positionManagerCore: getAddress3("POSITION_MANAGER_CORE_ADDRESS", "PositionManagerCoreModule"),
|
|
13000
|
+
positionManagerViews: getAddress3("POSITION_MANAGER_VIEWS_ADDRESS", "PositionManagerViews"),
|
|
13024
13001
|
simplePsmV2: getAddress3("SIMPLE_PSM_V2_ADDRESS", "SimplePSMV2"),
|
|
13025
|
-
loanOperationsManager: getAddress3(
|
|
13026
|
-
"LOAN_OPERATIONS_MANAGER_ADDRESS",
|
|
13027
|
-
"LoanOperationsManagerModule"
|
|
13028
|
-
),
|
|
13002
|
+
loanOperationsManager: getAddress3("LOAN_OPERATIONS_MANAGER_ADDRESS", "LoanOperationsManagerModule"),
|
|
13029
13003
|
termManager: getAddress3("TERM_MANAGER_ADDRESS", "TermManagerModule"),
|
|
13030
|
-
circuitBreaker: getAddress3(
|
|
13031
|
-
|
|
13032
|
-
|
|
13033
|
-
),
|
|
13034
|
-
communityManager: getAddress3(
|
|
13035
|
-
"COMMUNITY_MANAGER_ADDRESS",
|
|
13036
|
-
"CommunityManagerModule"
|
|
13037
|
-
),
|
|
13038
|
-
liquidationManager: getAddress3(
|
|
13039
|
-
"LIQUIDATION_MANAGER_ADDRESS",
|
|
13040
|
-
"LiquidationManagerModule"
|
|
13041
|
-
),
|
|
13004
|
+
circuitBreaker: getAddress3("CIRCUIT_BREAKER_ADDRESS", "CircuitBreakerModule"),
|
|
13005
|
+
communityManager: getAddress3("COMMUNITY_MANAGER_ADDRESS", "CommunityManagerModule"),
|
|
13006
|
+
liquidationManager: getAddress3("LIQUIDATION_MANAGER_ADDRESS", "LiquidationManagerModule"),
|
|
13042
13007
|
ucdToken: getAddress3("UCD_TOKEN_ADDRESS", "UCDToken"),
|
|
13043
13008
|
ucdController: getAddress3("UCD_CONTROLLER_ADDRESS", "UCDController"),
|
|
13044
|
-
|
|
13045
|
-
|
|
13046
|
-
"BTCProofValidator"
|
|
13047
|
-
),
|
|
13048
|
-
priceFeedConsumer: getAddress3(
|
|
13049
|
-
"PRICE_FEED_CONSUMER_ADDRESS",
|
|
13050
|
-
"PriceFeedConsumer"
|
|
13051
|
-
),
|
|
13052
|
-
operationAuthorizationRegistry: getAddress3(
|
|
13053
|
-
"OPERATION_AUTHORIZATION_REGISTRY_ADDRESS",
|
|
13054
|
-
"OperationAuthorizationRegistry"
|
|
13055
|
-
)
|
|
13009
|
+
priceFeedConsumer: getAddress3("PRICE_FEED_CONSUMER_ADDRESS", "PriceFeedConsumer"),
|
|
13010
|
+
operationAuthorizationRegistry: getAddress3("OPERATION_AUTHORIZATION_REGISTRY_ADDRESS", "OperationAuthorizationRegistry")
|
|
13056
13011
|
},
|
|
13057
13012
|
subgraphs: {
|
|
13058
|
-
diamondHandsUrl: "https://api.studio.thegraph.com/query/65258/diamond-hands/
|
|
13013
|
+
diamondHandsUrl: "https://api.studio.thegraph.com/query/65258/diamond-hands/version/latest"
|
|
13059
13014
|
},
|
|
13060
13015
|
litNetwork: "datil",
|
|
13061
13016
|
debug: true
|
|
@@ -29323,6 +29278,42 @@ async function generateMintAuthorization(positionId, amount, chainId, mode, sign
|
|
|
29323
29278
|
mode
|
|
29324
29279
|
};
|
|
29325
29280
|
}
|
|
29281
|
+
async function generatePaymentAuthorization(positionId, amount, chainId, mode, signer) {
|
|
29282
|
+
const timestamp = calculateNextQuantumTimestamp();
|
|
29283
|
+
const action = "make-payment";
|
|
29284
|
+
const actionHash = ethers_exports.utils.keccak256(ethers_exports.utils.toUtf8Bytes(action));
|
|
29285
|
+
const types = [
|
|
29286
|
+
"bytes32",
|
|
29287
|
+
// positionId
|
|
29288
|
+
"uint256",
|
|
29289
|
+
// timestamp
|
|
29290
|
+
"uint256",
|
|
29291
|
+
// chainId
|
|
29292
|
+
"uint256",
|
|
29293
|
+
// amount
|
|
29294
|
+
"bytes32"
|
|
29295
|
+
// actionHash
|
|
29296
|
+
];
|
|
29297
|
+
const values = [
|
|
29298
|
+
positionId,
|
|
29299
|
+
timestamp,
|
|
29300
|
+
chainId,
|
|
29301
|
+
amount.toString(),
|
|
29302
|
+
actionHash
|
|
29303
|
+
];
|
|
29304
|
+
const messageHash = ethers_exports.utils.solidityKeccak256(types, values);
|
|
29305
|
+
const messageHashBytes = ethers_exports.utils.arrayify(messageHash);
|
|
29306
|
+
const signature2 = await signer.signMessage(messageHashBytes);
|
|
29307
|
+
return {
|
|
29308
|
+
positionId,
|
|
29309
|
+
timestamp,
|
|
29310
|
+
chainId,
|
|
29311
|
+
amount: amount.toString(),
|
|
29312
|
+
action,
|
|
29313
|
+
signature: signature2,
|
|
29314
|
+
mode
|
|
29315
|
+
};
|
|
29316
|
+
}
|
|
29326
29317
|
async function getPKPPublicKeyFromTokenId(pkpTokenId, provider) {
|
|
29327
29318
|
let yellowstoneProvider;
|
|
29328
29319
|
if (provider) {
|
|
@@ -36657,6 +36648,11 @@ var _abi = [
|
|
|
36657
36648
|
name: "BtcPriceTooHigh",
|
|
36658
36649
|
type: "error"
|
|
36659
36650
|
},
|
|
36651
|
+
{
|
|
36652
|
+
inputs: [],
|
|
36653
|
+
name: "CollateralAmountMismatch",
|
|
36654
|
+
type: "error"
|
|
36655
|
+
},
|
|
36660
36656
|
{
|
|
36661
36657
|
inputs: [],
|
|
36662
36658
|
name: "CollateralOverflow",
|
|
@@ -36746,29 +36742,44 @@ var _abi = [
|
|
|
36746
36742
|
},
|
|
36747
36743
|
{
|
|
36748
36744
|
inputs: [],
|
|
36749
|
-
name: "
|
|
36745
|
+
name: "InsufficientBalance",
|
|
36750
36746
|
type: "error"
|
|
36751
36747
|
},
|
|
36752
36748
|
{
|
|
36753
36749
|
inputs: [],
|
|
36754
|
-
name: "
|
|
36750
|
+
name: "IntegrityCheckFailed",
|
|
36755
36751
|
type: "error"
|
|
36756
36752
|
},
|
|
36757
36753
|
{
|
|
36758
36754
|
inputs: [],
|
|
36759
|
-
name: "
|
|
36755
|
+
name: "InvalidAddress",
|
|
36760
36756
|
type: "error"
|
|
36761
36757
|
},
|
|
36762
36758
|
{
|
|
36763
36759
|
inputs: [],
|
|
36764
|
-
name: "
|
|
36760
|
+
name: "InvalidBytes32",
|
|
36761
|
+
type: "error"
|
|
36762
|
+
},
|
|
36763
|
+
{
|
|
36764
|
+
inputs: [],
|
|
36765
|
+
name: "InvalidCollateralAmount",
|
|
36766
|
+
type: "error"
|
|
36767
|
+
},
|
|
36768
|
+
{
|
|
36769
|
+
inputs: [],
|
|
36770
|
+
name: "InvalidInitialization",
|
|
36771
|
+
type: "error"
|
|
36772
|
+
},
|
|
36773
|
+
{
|
|
36774
|
+
inputs: [],
|
|
36775
|
+
name: "InvalidPositionId",
|
|
36765
36776
|
type: "error"
|
|
36766
36777
|
},
|
|
36767
36778
|
{
|
|
36768
36779
|
inputs: [
|
|
36769
36780
|
{
|
|
36770
36781
|
internalType: "uint256",
|
|
36771
|
-
name: "
|
|
36782
|
+
name: "price",
|
|
36772
36783
|
type: "uint256"
|
|
36773
36784
|
},
|
|
36774
36785
|
{
|
|
@@ -36782,22 +36793,12 @@ var _abi = [
|
|
|
36782
36793
|
type: "uint256"
|
|
36783
36794
|
}
|
|
36784
36795
|
],
|
|
36785
|
-
name: "
|
|
36786
|
-
type: "error"
|
|
36787
|
-
},
|
|
36788
|
-
{
|
|
36789
|
-
inputs: [],
|
|
36790
|
-
name: "InvalidBytes32",
|
|
36796
|
+
name: "InvalidPrice",
|
|
36791
36797
|
type: "error"
|
|
36792
36798
|
},
|
|
36793
36799
|
{
|
|
36794
36800
|
inputs: [],
|
|
36795
|
-
name: "
|
|
36796
|
-
type: "error"
|
|
36797
|
-
},
|
|
36798
|
-
{
|
|
36799
|
-
inputs: [],
|
|
36800
|
-
name: "InvalidPositionId",
|
|
36801
|
+
name: "InvalidRequestedExpiryDate",
|
|
36801
36802
|
type: "error"
|
|
36802
36803
|
},
|
|
36803
36804
|
{
|
|
@@ -36842,11 +36843,6 @@ var _abi = [
|
|
|
36842
36843
|
name: "InvalidValidatorSignature",
|
|
36843
36844
|
type: "error"
|
|
36844
36845
|
},
|
|
36845
|
-
{
|
|
36846
|
-
inputs: [],
|
|
36847
|
-
name: "ModuleCallFailed",
|
|
36848
|
-
type: "error"
|
|
36849
|
-
},
|
|
36850
36846
|
{
|
|
36851
36847
|
inputs: [],
|
|
36852
36848
|
name: "MultiplicationOverflow",
|
|
@@ -36981,17 +36977,23 @@ var _abi = [
|
|
|
36981
36977
|
{
|
|
36982
36978
|
indexed: false,
|
|
36983
36979
|
internalType: "uint256",
|
|
36984
|
-
name: "
|
|
36980
|
+
name: "collateralValue",
|
|
36985
36981
|
type: "uint256"
|
|
36986
36982
|
},
|
|
36987
36983
|
{
|
|
36988
36984
|
indexed: false,
|
|
36989
36985
|
internalType: "uint256",
|
|
36990
|
-
name: "
|
|
36986
|
+
name: "quantumTimestamp",
|
|
36987
|
+
type: "uint256"
|
|
36988
|
+
},
|
|
36989
|
+
{
|
|
36990
|
+
indexed: false,
|
|
36991
|
+
internalType: "uint256",
|
|
36992
|
+
name: "confirmedAt",
|
|
36991
36993
|
type: "uint256"
|
|
36992
36994
|
}
|
|
36993
36995
|
],
|
|
36994
|
-
name: "
|
|
36996
|
+
name: "BalanceConfirmed",
|
|
36995
36997
|
type: "event"
|
|
36996
36998
|
},
|
|
36997
36999
|
{
|
|
@@ -37026,37 +37028,6 @@ var _abi = [
|
|
|
37026
37028
|
name: "Initialized",
|
|
37027
37029
|
type: "event"
|
|
37028
37030
|
},
|
|
37029
|
-
{
|
|
37030
|
-
anonymous: false,
|
|
37031
|
-
inputs: [
|
|
37032
|
-
{
|
|
37033
|
-
indexed: true,
|
|
37034
|
-
internalType: "bytes32",
|
|
37035
|
-
name: "positionId",
|
|
37036
|
-
type: "bytes32"
|
|
37037
|
-
},
|
|
37038
|
-
{
|
|
37039
|
-
indexed: false,
|
|
37040
|
-
internalType: "string",
|
|
37041
|
-
name: "checkType",
|
|
37042
|
-
type: "string"
|
|
37043
|
-
},
|
|
37044
|
-
{
|
|
37045
|
-
indexed: false,
|
|
37046
|
-
internalType: "string",
|
|
37047
|
-
name: "reason",
|
|
37048
|
-
type: "string"
|
|
37049
|
-
},
|
|
37050
|
-
{
|
|
37051
|
-
indexed: false,
|
|
37052
|
-
internalType: "uint256",
|
|
37053
|
-
name: "timestamp",
|
|
37054
|
-
type: "uint256"
|
|
37055
|
-
}
|
|
37056
|
-
],
|
|
37057
|
-
name: "IntegrityCheckFailed",
|
|
37058
|
-
type: "event"
|
|
37059
|
-
},
|
|
37060
37031
|
{
|
|
37061
37032
|
anonymous: false,
|
|
37062
37033
|
inputs: [
|
|
@@ -37146,12 +37117,6 @@ var _abi = [
|
|
|
37146
37117
|
internalType: "uint256",
|
|
37147
37118
|
name: "remainingDebt",
|
|
37148
37119
|
type: "uint256"
|
|
37149
|
-
},
|
|
37150
|
-
{
|
|
37151
|
-
indexed: false,
|
|
37152
|
-
internalType: "uint256",
|
|
37153
|
-
name: "newCollateralRatio",
|
|
37154
|
-
type: "uint256"
|
|
37155
37120
|
}
|
|
37156
37121
|
],
|
|
37157
37122
|
name: "PartialPaymentMade",
|
|
@@ -37710,6 +37675,11 @@ var _abi = [
|
|
|
37710
37675
|
internalType: "uint256",
|
|
37711
37676
|
name: "btcPrice",
|
|
37712
37677
|
type: "uint256"
|
|
37678
|
+
},
|
|
37679
|
+
{
|
|
37680
|
+
internalType: "uint256",
|
|
37681
|
+
name: "availableBTCBalance",
|
|
37682
|
+
type: "uint256"
|
|
37713
37683
|
}
|
|
37714
37684
|
],
|
|
37715
37685
|
name: "_performExtensionValidation",
|
|
@@ -37764,25 +37734,6 @@ var _abi = [
|
|
|
37764
37734
|
stateMutability: "view",
|
|
37765
37735
|
type: "function"
|
|
37766
37736
|
},
|
|
37767
|
-
{
|
|
37768
|
-
inputs: [
|
|
37769
|
-
{
|
|
37770
|
-
internalType: "bytes32",
|
|
37771
|
-
name: "positionId",
|
|
37772
|
-
type: "bytes32"
|
|
37773
|
-
}
|
|
37774
|
-
],
|
|
37775
|
-
name: "calculateCollateralRatio",
|
|
37776
|
-
outputs: [
|
|
37777
|
-
{
|
|
37778
|
-
internalType: "uint256",
|
|
37779
|
-
name: "",
|
|
37780
|
-
type: "uint256"
|
|
37781
|
-
}
|
|
37782
|
-
],
|
|
37783
|
-
stateMutability: "view",
|
|
37784
|
-
type: "function"
|
|
37785
|
-
},
|
|
37786
37737
|
{
|
|
37787
37738
|
inputs: [],
|
|
37788
37739
|
name: "circuitBreaker",
|
|
@@ -37830,9 +37781,19 @@ var _abi = [
|
|
|
37830
37781
|
type: "bytes32"
|
|
37831
37782
|
},
|
|
37832
37783
|
{
|
|
37833
|
-
internalType: "
|
|
37834
|
-
name: "
|
|
37835
|
-
type: "
|
|
37784
|
+
internalType: "uint256",
|
|
37785
|
+
name: "quantumTimestamp",
|
|
37786
|
+
type: "uint256"
|
|
37787
|
+
},
|
|
37788
|
+
{
|
|
37789
|
+
internalType: "uint256",
|
|
37790
|
+
name: "btcPrice",
|
|
37791
|
+
type: "uint256"
|
|
37792
|
+
},
|
|
37793
|
+
{
|
|
37794
|
+
internalType: "bytes",
|
|
37795
|
+
name: "liquidationValidatorSignature",
|
|
37796
|
+
type: "bytes"
|
|
37836
37797
|
}
|
|
37837
37798
|
],
|
|
37838
37799
|
name: "commitLiquidation",
|
|
@@ -37853,6 +37814,75 @@ var _abi = [
|
|
|
37853
37814
|
stateMutability: "view",
|
|
37854
37815
|
type: "function"
|
|
37855
37816
|
},
|
|
37817
|
+
{
|
|
37818
|
+
inputs: [
|
|
37819
|
+
{
|
|
37820
|
+
internalType: "bytes32",
|
|
37821
|
+
name: "positionId",
|
|
37822
|
+
type: "bytes32"
|
|
37823
|
+
},
|
|
37824
|
+
{
|
|
37825
|
+
internalType: "bytes32",
|
|
37826
|
+
name: "actionHash",
|
|
37827
|
+
type: "bytes32"
|
|
37828
|
+
},
|
|
37829
|
+
{
|
|
37830
|
+
internalType: "bytes32",
|
|
37831
|
+
name: "authorizedSpendsHash",
|
|
37832
|
+
type: "bytes32"
|
|
37833
|
+
},
|
|
37834
|
+
{
|
|
37835
|
+
internalType: "bytes32",
|
|
37836
|
+
name: "ucdDebtHash",
|
|
37837
|
+
type: "bytes32"
|
|
37838
|
+
},
|
|
37839
|
+
{
|
|
37840
|
+
internalType: "bytes32",
|
|
37841
|
+
name: "contractHash",
|
|
37842
|
+
type: "bytes32"
|
|
37843
|
+
},
|
|
37844
|
+
{
|
|
37845
|
+
internalType: "uint256",
|
|
37846
|
+
name: "btcPrice",
|
|
37847
|
+
type: "uint256"
|
|
37848
|
+
},
|
|
37849
|
+
{
|
|
37850
|
+
internalType: "uint256",
|
|
37851
|
+
name: "mintAmount",
|
|
37852
|
+
type: "uint256"
|
|
37853
|
+
},
|
|
37854
|
+
{
|
|
37855
|
+
internalType: "uint256",
|
|
37856
|
+
name: "mintFee",
|
|
37857
|
+
type: "uint256"
|
|
37858
|
+
},
|
|
37859
|
+
{
|
|
37860
|
+
internalType: "uint256",
|
|
37861
|
+
name: "newCollateral",
|
|
37862
|
+
type: "uint256"
|
|
37863
|
+
},
|
|
37864
|
+
{
|
|
37865
|
+
internalType: "uint256",
|
|
37866
|
+
name: "newDebt",
|
|
37867
|
+
type: "uint256"
|
|
37868
|
+
},
|
|
37869
|
+
{
|
|
37870
|
+
internalType: "uint256",
|
|
37871
|
+
name: "quantumTimestamp",
|
|
37872
|
+
type: "uint256"
|
|
37873
|
+
}
|
|
37874
|
+
],
|
|
37875
|
+
name: "computeMintMessageHash",
|
|
37876
|
+
outputs: [
|
|
37877
|
+
{
|
|
37878
|
+
internalType: "bytes32",
|
|
37879
|
+
name: "",
|
|
37880
|
+
type: "bytes32"
|
|
37881
|
+
}
|
|
37882
|
+
],
|
|
37883
|
+
stateMutability: "pure",
|
|
37884
|
+
type: "function"
|
|
37885
|
+
},
|
|
37856
37886
|
{
|
|
37857
37887
|
inputs: [],
|
|
37858
37888
|
name: "core",
|
|
@@ -37932,6 +37962,11 @@ var _abi = [
|
|
|
37932
37962
|
name: "btcPrice",
|
|
37933
37963
|
type: "uint256"
|
|
37934
37964
|
},
|
|
37965
|
+
{
|
|
37966
|
+
internalType: "uint256",
|
|
37967
|
+
name: "availableBTCBalance",
|
|
37968
|
+
type: "uint256"
|
|
37969
|
+
},
|
|
37935
37970
|
{
|
|
37936
37971
|
internalType: "bytes",
|
|
37937
37972
|
name: "extensionValidatorSignature",
|
|
@@ -37969,80 +38004,13 @@ var _abi = [
|
|
|
37969
38004
|
type: "function"
|
|
37970
38005
|
},
|
|
37971
38006
|
{
|
|
37972
|
-
inputs: [
|
|
37973
|
-
|
|
37974
|
-
internalType: "bytes32",
|
|
37975
|
-
name: "",
|
|
37976
|
-
type: "bytes32"
|
|
37977
|
-
}
|
|
37978
|
-
],
|
|
37979
|
-
name: "getPKPLoanParams",
|
|
37980
|
-
outputs: [
|
|
37981
|
-
{
|
|
37982
|
-
internalType: "uint256",
|
|
37983
|
-
name: "",
|
|
37984
|
-
type: "uint256"
|
|
37985
|
-
},
|
|
37986
|
-
{
|
|
37987
|
-
internalType: "uint256",
|
|
37988
|
-
name: "",
|
|
37989
|
-
type: "uint256"
|
|
37990
|
-
},
|
|
37991
|
-
{
|
|
37992
|
-
internalType: "uint256",
|
|
37993
|
-
name: "",
|
|
37994
|
-
type: "uint256"
|
|
37995
|
-
}
|
|
37996
|
-
],
|
|
37997
|
-
stateMutability: "pure",
|
|
37998
|
-
type: "function"
|
|
37999
|
-
},
|
|
38000
|
-
{
|
|
38001
|
-
inputs: [
|
|
38002
|
-
{
|
|
38003
|
-
internalType: "bytes32",
|
|
38004
|
-
name: "",
|
|
38005
|
-
type: "bytes32"
|
|
38006
|
-
}
|
|
38007
|
-
],
|
|
38008
|
-
name: "getPKPPositionData",
|
|
38007
|
+
inputs: [],
|
|
38008
|
+
name: "getMintMessageHashParameters",
|
|
38009
38009
|
outputs: [
|
|
38010
38010
|
{
|
|
38011
|
-
|
|
38012
|
-
{
|
|
38013
|
-
internalType: "bytes32",
|
|
38014
|
-
name: "positionId",
|
|
38015
|
-
type: "bytes32"
|
|
38016
|
-
},
|
|
38017
|
-
{
|
|
38018
|
-
internalType: "address",
|
|
38019
|
-
name: "borrower",
|
|
38020
|
-
type: "address"
|
|
38021
|
-
},
|
|
38022
|
-
{
|
|
38023
|
-
internalType: "uint256",
|
|
38024
|
-
name: "amount",
|
|
38025
|
-
type: "uint256"
|
|
38026
|
-
},
|
|
38027
|
-
{
|
|
38028
|
-
internalType: "uint32",
|
|
38029
|
-
name: "requestedCollateralRatio",
|
|
38030
|
-
type: "uint32"
|
|
38031
|
-
},
|
|
38032
|
-
{
|
|
38033
|
-
internalType: "uint16",
|
|
38034
|
-
name: "selectedTerm",
|
|
38035
|
-
type: "uint16"
|
|
38036
|
-
},
|
|
38037
|
-
{
|
|
38038
|
-
internalType: "uint40",
|
|
38039
|
-
name: "createdAt",
|
|
38040
|
-
type: "uint40"
|
|
38041
|
-
}
|
|
38042
|
-
],
|
|
38043
|
-
internalType: "struct IPositionManager.PKPPositionData",
|
|
38011
|
+
internalType: "string[]",
|
|
38044
38012
|
name: "",
|
|
38045
|
-
type: "
|
|
38013
|
+
type: "string[]"
|
|
38046
38014
|
}
|
|
38047
38015
|
],
|
|
38048
38016
|
stateMutability: "pure",
|
|
@@ -38056,7 +38024,7 @@ var _abi = [
|
|
|
38056
38024
|
type: "bytes32"
|
|
38057
38025
|
}
|
|
38058
38026
|
],
|
|
38059
|
-
name: "
|
|
38027
|
+
name: "getPositionById",
|
|
38060
38028
|
outputs: [
|
|
38061
38029
|
{
|
|
38062
38030
|
components: [
|
|
@@ -38118,16 +38086,16 @@ var _abi = [
|
|
|
38118
38086
|
inputs: [
|
|
38119
38087
|
{
|
|
38120
38088
|
internalType: "bytes32",
|
|
38121
|
-
name: "
|
|
38089
|
+
name: "pkpId",
|
|
38122
38090
|
type: "bytes32"
|
|
38123
38091
|
}
|
|
38124
38092
|
],
|
|
38125
|
-
name: "
|
|
38093
|
+
name: "getPositionByPkp",
|
|
38126
38094
|
outputs: [
|
|
38127
38095
|
{
|
|
38128
|
-
internalType: "
|
|
38096
|
+
internalType: "bytes32",
|
|
38129
38097
|
name: "",
|
|
38130
|
-
type: "
|
|
38098
|
+
type: "bytes32"
|
|
38131
38099
|
}
|
|
38132
38100
|
],
|
|
38133
38101
|
stateMutability: "view",
|
|
@@ -38289,6 +38257,40 @@ var _abi = [
|
|
|
38289
38257
|
type: "bytes32"
|
|
38290
38258
|
}
|
|
38291
38259
|
],
|
|
38260
|
+
name: "isExtensionPending",
|
|
38261
|
+
outputs: [
|
|
38262
|
+
{
|
|
38263
|
+
internalType: "bool",
|
|
38264
|
+
name: "",
|
|
38265
|
+
type: "bool"
|
|
38266
|
+
}
|
|
38267
|
+
],
|
|
38268
|
+
stateMutability: "view",
|
|
38269
|
+
type: "function"
|
|
38270
|
+
},
|
|
38271
|
+
{
|
|
38272
|
+
inputs: [
|
|
38273
|
+
{
|
|
38274
|
+
internalType: "bytes32",
|
|
38275
|
+
name: "positionId",
|
|
38276
|
+
type: "bytes32"
|
|
38277
|
+
},
|
|
38278
|
+
{
|
|
38279
|
+
internalType: "uint256",
|
|
38280
|
+
name: "btcPrice",
|
|
38281
|
+
type: "uint256"
|
|
38282
|
+
},
|
|
38283
|
+
{
|
|
38284
|
+
internalType: "uint256",
|
|
38285
|
+
name: "quantumTimestamp",
|
|
38286
|
+
type: "uint256"
|
|
38287
|
+
},
|
|
38288
|
+
{
|
|
38289
|
+
internalType: "bytes",
|
|
38290
|
+
name: "liquidationValidatorSignature",
|
|
38291
|
+
type: "bytes"
|
|
38292
|
+
}
|
|
38293
|
+
],
|
|
38292
38294
|
name: "liquidatePosition",
|
|
38293
38295
|
outputs: [
|
|
38294
38296
|
{
|
|
@@ -38337,9 +38339,93 @@ var _abi = [
|
|
|
38337
38339
|
internalType: "uint256",
|
|
38338
38340
|
name: "paymentAmount",
|
|
38339
38341
|
type: "uint256"
|
|
38342
|
+
},
|
|
38343
|
+
{
|
|
38344
|
+
internalType: "uint256",
|
|
38345
|
+
name: "quantumTimestamp",
|
|
38346
|
+
type: "uint256"
|
|
38347
|
+
},
|
|
38348
|
+
{
|
|
38349
|
+
internalType: "uint256",
|
|
38350
|
+
name: "btcPrice",
|
|
38351
|
+
type: "uint256"
|
|
38352
|
+
},
|
|
38353
|
+
{
|
|
38354
|
+
internalType: "bytes",
|
|
38355
|
+
name: "paymentValidatorSignature",
|
|
38356
|
+
type: "bytes"
|
|
38357
|
+
}
|
|
38358
|
+
],
|
|
38359
|
+
name: "makePayment",
|
|
38360
|
+
outputs: [
|
|
38361
|
+
{
|
|
38362
|
+
internalType: "bool",
|
|
38363
|
+
name: "",
|
|
38364
|
+
type: "bool"
|
|
38365
|
+
}
|
|
38366
|
+
],
|
|
38367
|
+
stateMutability: "nonpayable",
|
|
38368
|
+
type: "function"
|
|
38369
|
+
},
|
|
38370
|
+
{
|
|
38371
|
+
inputs: [
|
|
38372
|
+
{
|
|
38373
|
+
internalType: "bytes32",
|
|
38374
|
+
name: "positionId",
|
|
38375
|
+
type: "bytes32"
|
|
38376
|
+
},
|
|
38377
|
+
{
|
|
38378
|
+
internalType: "uint256",
|
|
38379
|
+
name: "mintAmount",
|
|
38380
|
+
type: "uint256"
|
|
38381
|
+
},
|
|
38382
|
+
{
|
|
38383
|
+
internalType: "uint256",
|
|
38384
|
+
name: "mintFee",
|
|
38385
|
+
type: "uint256"
|
|
38386
|
+
},
|
|
38387
|
+
{
|
|
38388
|
+
internalType: "uint256",
|
|
38389
|
+
name: "newDebt",
|
|
38390
|
+
type: "uint256"
|
|
38391
|
+
},
|
|
38392
|
+
{
|
|
38393
|
+
internalType: "uint256",
|
|
38394
|
+
name: "newCollateral",
|
|
38395
|
+
type: "uint256"
|
|
38396
|
+
},
|
|
38397
|
+
{
|
|
38398
|
+
internalType: "uint256",
|
|
38399
|
+
name: "btcPrice",
|
|
38400
|
+
type: "uint256"
|
|
38401
|
+
},
|
|
38402
|
+
{
|
|
38403
|
+
internalType: "bytes32",
|
|
38404
|
+
name: "authorizedSpendsHash",
|
|
38405
|
+
type: "bytes32"
|
|
38406
|
+
},
|
|
38407
|
+
{
|
|
38408
|
+
internalType: "bytes32",
|
|
38409
|
+
name: "ucdDebtHash",
|
|
38410
|
+
type: "bytes32"
|
|
38411
|
+
},
|
|
38412
|
+
{
|
|
38413
|
+
internalType: "bytes32",
|
|
38414
|
+
name: "contractHash",
|
|
38415
|
+
type: "bytes32"
|
|
38416
|
+
},
|
|
38417
|
+
{
|
|
38418
|
+
internalType: "uint256",
|
|
38419
|
+
name: "quantumTimestamp",
|
|
38420
|
+
type: "uint256"
|
|
38421
|
+
},
|
|
38422
|
+
{
|
|
38423
|
+
internalType: "bytes",
|
|
38424
|
+
name: "mintValidatorSignature",
|
|
38425
|
+
type: "bytes"
|
|
38340
38426
|
}
|
|
38341
38427
|
],
|
|
38342
|
-
name: "
|
|
38428
|
+
name: "mintUCD",
|
|
38343
38429
|
outputs: [
|
|
38344
38430
|
{
|
|
38345
38431
|
internalType: "bool",
|
|
@@ -38416,33 +38502,19 @@ var _abi = [
|
|
|
38416
38502
|
},
|
|
38417
38503
|
{
|
|
38418
38504
|
internalType: "uint256",
|
|
38419
|
-
name: "
|
|
38505
|
+
name: "quantumTimestamp",
|
|
38420
38506
|
type: "uint256"
|
|
38421
|
-
}
|
|
38422
|
-
],
|
|
38423
|
-
name: "repayPosition",
|
|
38424
|
-
outputs: [
|
|
38425
|
-
{
|
|
38426
|
-
internalType: "bool",
|
|
38427
|
-
name: "",
|
|
38428
|
-
type: "bool"
|
|
38429
|
-
}
|
|
38430
|
-
],
|
|
38431
|
-
stateMutability: "nonpayable",
|
|
38432
|
-
type: "function"
|
|
38433
|
-
},
|
|
38434
|
-
{
|
|
38435
|
-
inputs: [
|
|
38436
|
-
{
|
|
38437
|
-
internalType: "bytes32",
|
|
38438
|
-
name: "positionId",
|
|
38439
|
-
type: "bytes32"
|
|
38440
38507
|
},
|
|
38441
38508
|
{
|
|
38442
38509
|
internalType: "uint256",
|
|
38443
|
-
name: "
|
|
38510
|
+
name: "btcPrice",
|
|
38444
38511
|
type: "uint256"
|
|
38445
38512
|
},
|
|
38513
|
+
{
|
|
38514
|
+
internalType: "bytes",
|
|
38515
|
+
name: "liquidationValidatorSignature",
|
|
38516
|
+
type: "bytes"
|
|
38517
|
+
},
|
|
38446
38518
|
{
|
|
38447
38519
|
internalType: "uint256",
|
|
38448
38520
|
name: "deadline",
|
|
@@ -38536,6 +38608,34 @@ var _abi = [
|
|
|
38536
38608
|
stateMutability: "view",
|
|
38537
38609
|
type: "function"
|
|
38538
38610
|
},
|
|
38611
|
+
{
|
|
38612
|
+
inputs: [
|
|
38613
|
+
{
|
|
38614
|
+
internalType: "bytes32",
|
|
38615
|
+
name: "positionId",
|
|
38616
|
+
type: "bytes32"
|
|
38617
|
+
},
|
|
38618
|
+
{
|
|
38619
|
+
internalType: "uint256",
|
|
38620
|
+
name: "collateralValue",
|
|
38621
|
+
type: "uint256"
|
|
38622
|
+
},
|
|
38623
|
+
{
|
|
38624
|
+
internalType: "uint256",
|
|
38625
|
+
name: "quantumTimestamp",
|
|
38626
|
+
type: "uint256"
|
|
38627
|
+
},
|
|
38628
|
+
{
|
|
38629
|
+
internalType: "bytes",
|
|
38630
|
+
name: "signature",
|
|
38631
|
+
type: "bytes"
|
|
38632
|
+
}
|
|
38633
|
+
],
|
|
38634
|
+
name: "updateBalance",
|
|
38635
|
+
outputs: [],
|
|
38636
|
+
stateMutability: "nonpayable",
|
|
38637
|
+
type: "function"
|
|
38638
|
+
},
|
|
38539
38639
|
{
|
|
38540
38640
|
inputs: [
|
|
38541
38641
|
{
|
|
@@ -38602,30 +38702,6 @@ var _abi = [
|
|
|
38602
38702
|
stateMutability: "nonpayable",
|
|
38603
38703
|
type: "function"
|
|
38604
38704
|
},
|
|
38605
|
-
{
|
|
38606
|
-
inputs: [
|
|
38607
|
-
{
|
|
38608
|
-
internalType: "bytes32",
|
|
38609
|
-
name: "positionId",
|
|
38610
|
-
type: "bytes32"
|
|
38611
|
-
},
|
|
38612
|
-
{
|
|
38613
|
-
internalType: "uint256",
|
|
38614
|
-
name: "newDebt",
|
|
38615
|
-
type: "uint256"
|
|
38616
|
-
}
|
|
38617
|
-
],
|
|
38618
|
-
name: "updatePosition",
|
|
38619
|
-
outputs: [
|
|
38620
|
-
{
|
|
38621
|
-
internalType: "bool",
|
|
38622
|
-
name: "",
|
|
38623
|
-
type: "bool"
|
|
38624
|
-
}
|
|
38625
|
-
],
|
|
38626
|
-
stateMutability: "nonpayable",
|
|
38627
|
-
type: "function"
|
|
38628
|
-
},
|
|
38629
38705
|
{
|
|
38630
38706
|
inputs: [
|
|
38631
38707
|
{
|
|
@@ -38664,32 +38740,23 @@ var _abi = [
|
|
|
38664
38740
|
},
|
|
38665
38741
|
{
|
|
38666
38742
|
inputs: [
|
|
38743
|
+
{
|
|
38744
|
+
internalType: "bytes4",
|
|
38745
|
+
name: "selector",
|
|
38746
|
+
type: "bytes4"
|
|
38747
|
+
},
|
|
38667
38748
|
{
|
|
38668
38749
|
internalType: "bytes32",
|
|
38669
|
-
name: "
|
|
38750
|
+
name: "messageHash",
|
|
38670
38751
|
type: "bytes32"
|
|
38671
|
-
}
|
|
38672
|
-
],
|
|
38673
|
-
name: "validatePKPLogic",
|
|
38674
|
-
outputs: [
|
|
38675
|
-
{
|
|
38676
|
-
internalType: "bool",
|
|
38677
|
-
name: "",
|
|
38678
|
-
type: "bool"
|
|
38679
|
-
}
|
|
38680
|
-
],
|
|
38681
|
-
stateMutability: "view",
|
|
38682
|
-
type: "function"
|
|
38683
|
-
},
|
|
38684
|
-
{
|
|
38685
|
-
inputs: [
|
|
38752
|
+
},
|
|
38686
38753
|
{
|
|
38687
|
-
internalType: "
|
|
38688
|
-
name: "
|
|
38689
|
-
type: "
|
|
38754
|
+
internalType: "bytes",
|
|
38755
|
+
name: "signature",
|
|
38756
|
+
type: "bytes"
|
|
38690
38757
|
}
|
|
38691
38758
|
],
|
|
38692
|
-
name: "
|
|
38759
|
+
name: "verifyAuthorization",
|
|
38693
38760
|
outputs: [
|
|
38694
38761
|
{
|
|
38695
38762
|
internalType: "bool",
|
|
@@ -38737,6 +38804,11 @@ var _abi = [
|
|
|
38737
38804
|
name: "ucdDebtHash",
|
|
38738
38805
|
type: "bytes32"
|
|
38739
38806
|
},
|
|
38807
|
+
{
|
|
38808
|
+
internalType: "bytes32",
|
|
38809
|
+
name: "contractBundleHash",
|
|
38810
|
+
type: "bytes32"
|
|
38811
|
+
},
|
|
38740
38812
|
{
|
|
38741
38813
|
internalType: "string",
|
|
38742
38814
|
name: "withdrawalAddress",
|
|
@@ -38795,7 +38867,7 @@ var _abi = [
|
|
|
38795
38867
|
type: "function"
|
|
38796
38868
|
}
|
|
38797
38869
|
];
|
|
38798
|
-
var _bytecode = "0x60a080604052346100ea57306080527ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460ff8160401c166100d9576002600160401b03196001600160401b03821601610073575b604051615b7590816100f0823960805181818161192e0152611b2b0152f35b6001600160401b0319166001600160401b039081177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a13880610054565b63f92ee8a960e01b60005260046000fd5b600080fdfe6080604052600436101561001257600080fd5b60003560e01c806301ffc9a714610387578063043fe8fc1461038257806306f89d441461037d578063096ec4b0146103785780630c995dc314610373578063105250411461036e57806316d8887a1461036957806316efd941146103645780631732d3301461035f5780631f0b0fb31461035a578063248a9ca3146103555780632f2ff15d1461035057806336568abe1461034b578063389b0b9b14610346578063393d92cc146103415780634a54e00a1461033c5780634f1ef2861461033757806352d1902d146103325780635c975abb1461032d5780635e4936e8146103285780636068b5d114610323578063667fe2651461031e57806374cb36e61461031957806375b238fc146103145780638d3487551461030f5780638e7d27601461030a5780638ffee9cd1461030557806391d148541461030057806396b9b99d146102fb5780639b91c47a146102f65780639b9d30c1146102f1578063a217fddf146102ec578063a9eadc52146102e7578063aa4fec70146102e2578063ad3cb1cc146102dd578063c12e1291146102d8578063c306b378146102d3578063cdeb3fcf146102ce578063d0e8ce82146102c9578063d547741f146102c4578063d65e880d146102bf578063d8dfeb45146102ba578063d9cb25a2146102b5578063ddccaa3a146102b0578063e6726da8146102ab578063e7f9caa5146102a6578063eaf7762c146102a1578063f005e7671461029c578063f0afc1b814610297578063f2dfbf6614610292578063f2f4eb261461028d578063f851a44014610288578063fb7c6a0f14610283578063fd5252381461027e5763ffa1ad741461027957600080fd5b6135c1565b61354e565b613525565b6134fc565b6134d3565b6134aa565b613441565b613418565b6132fb565b613279565b613106565b612e05565b612da1565b612d78565b612d4f565b612d1b565b612cb7565b612bae565b612aad565b612a05565b6129a9565b612924565b6128fb565b6128cc565b612891565b612330565b61222c565b6121db565b611fec565b611f55565b611e03565b611d4d565b611d24565b611cc1565b611c22565b611ba1565b611b71565b611b18565b6118dc565b611803565b6117da565b6111d2565b61115b565b611120565b6110fa565b610b34565b610af9565b610ad0565b610aa7565b610a0d565b6109df565b610578565b6104d5565b61040c565b346103dd5760203660031901126103dd5760043563ffffffff60e01b81168091036103dd57602090637965db0b60e01b81149081156103cc575b506040519015158152f35b6301ffc9a760e01b149050386103c1565b600080fd5b6001600160a01b031690565b6001600160a01b038116036103dd57565b359061040a826103ee565b565b346103dd5760203660031901126103dd57600435610429816103ee565b6104316146aa565b6001600160a01b0316801561048757600b80546001600160a01b0319811683179091553391906001600160a01b03167f440ec6c0da0791f6d650579df27149ce4ffc4f4fbf63e9a8bcd45dacdbf338a2600080a4005b63e6c4247b60e01b60005260046000fd5b600811156104a257565b634e487b7160e01b600052602160045260246000fd5b9060088210156104a25752565b60208101929161040a91906104b8565b346103dd5760203660031901126103dd576008546040516301be275160e21b8152600480359082015290602090829060249082906001600160a01b03165afa801561057357600090610536575b61053290604051918291826104c5565b0390f35b506020813d60201161056b575b8161055060209383611842565b810103126103dd576105329051610566816129f0565b610522565b3d9150610543565b613702565b346103dd5760403660031901126103dd57600435602435610597614821565b61059f61484b565b6105a761489b565b33600052600a6020526040600020544311156109b8576105c7818361492c565b6105da6105d56006546103e2565b6103e2565b803b156103dd5760405163102d617560e01b81526004810183905260006024820181905290918290604490829084905af18015610573576109a3575b506106256105d56000546103e2565b604051638d34875560e01b81526004810184905290600090829060249082905afa90811561057357600091610988575b50805115610977576080015133906001600160a01b0390610675906103e2565b16036109665761068b6106878361495d565b1590565b61087c57600460206106a16105d56001546103e2565b60405163023b2a9f60e31b815292839182905afa90811561057357600091610937575b506001600160a01b03166106da82303384614b17565b61070760206106ed6105d56001546103e2565b6040518093819263095ea7b360e01b8352600483016138b0565b03816000865af180156105735761074f92602092859261091c575b506107316105d56001546103e2565b600060405180968195829463095ea7b360e01b8452600484016138ca565b03925af180156105735760009260209261079492610901575b506107776105d56001546103e2565b906040519485809481936296ec4b60e41b835289600484016138e5565b03925af1908115610573576000916108d2575b50156108c1576107bb6105d56000546103e2565b604051638d34875560e01b815260048101839052600081602481855afa80156105735760409160009161089e575b50015161088d576107fc6106878361495d565b61087c57803b156103dd57604051637f15208d60e01b815290600090829081838161082a88600483016138f6565b03925af1801561057357610861575b50436108443361370e565b5561084d614918565b610855614887565b60405160018152602090f35b80610870600061087693611842565b80610a9c565b80610839565b6334b110b160e11b60005260046000fd5b630a0b0d7960e01b60005260046000fd5b6108bb91503d806000833e6108b38183611842565b8101906137a2565b386107e9565b633badd6bb60e21b60005260046000fd5b6108f4915060203d6020116108fa575b6108ec8183611842565b81019061389c565b386107a7565b503d6108e2565b61091790843d86116108fa576108ec8183611842565b610768565b61093290843d86116108fa576108ec8183611842565b610722565b610959915060203d60201161095f575b6109518183611842565b81019061387a565b386106c4565b503d610947565b631963d1e760e31b60005260046000fd5b636ec9be1160e01b60005260046000fd5b61099d91503d806000833e6108b38183611842565b38610655565b8061087060006109b293611842565b38610616565b633b53d1db60e01b60005260046000fd5b6040919493926060820195825260208201520152565b346103dd5760203660031901126103dd5760405162461bcd60e51b815280610a0960048201613951565b0390fd5b346103dd5760203660031901126103dd57600435610a2a816103ee565b600754604051631052504160e01b81526001600160a01b0392831660048201529160209183916024918391165afa80156105735761053291600091610a7d575b5060405191829182901515815260200190565b610a96915060203d6020116108fa576108ec8183611842565b38610a6a565b60009103126103dd57565b346103dd5760003660031901126103dd5760206040516000805160206159008339815191528152f35b346103dd5760003660031901126103dd576006546040516001600160a01b039091168152602090f35b346103dd5760003660031901126103dd5760206040517f9792fdc19ab98adfa72ab2fa98d342618c661e01c406979c105b31eda87f5e6f8152f35b346103dd5760403660031901126103dd57602435600435610b53614821565b610b5b61484b565b610b6361489b565b610b716105d56006546103e2565b803b156103dd5760405163102d617560e01b81526004810184905260006024820181905290918290604490829084905af18015610573576110e5575b50610bbc6105d56000546103e2565b604051638d34875560e01b81526004810183905290600090829060249082905afa908115610573576000916110cc575b50610bfa60808201516103e2565b61012082015190610c0a82610498565b610c1b604084015180948787614bb1565b610c276106878561495d565b61087c57336001600160a01b039091160361096657610c4581614cbb565b60046020610c576105d56001546103e2565b60405163023b2a9f60e31b815292839182905afa908115610573576000916110ad575b506040516370a0823160e01b81526001600160a01b03919091169060208180610ca633600483016128e8565b0381855afa801561057357869160009161108e575b501061107d57604051636eb1769f60e11b8152336004820152306024820152602081604481855afa801561057357869160009161105e575b501061104d57600490610d0886303384614b17565b6020610d186105d56001546103e2565b60405163b1d3354f60e01b815293849182905afa9182156105735760009261102c575b5060405163095ea7b360e01b81529060208280610d5b86600483016138b0565b03816000855af190811561057357610d96936020938993611011575b50600060405180968195829463095ea7b360e01b8452600484016138ca565b03925af1801561057357610ff4575b50610db46105d56001546103e2565b9160405163696c86cd60e01b8152602081600481875afa90811561057357610de6928791600093610fd3575b50614d82565b919092602060405180926380fd423960e01b825281600081610e0c8c8c600484016138e5565b03925af190811561057357600091610fb4575b5015610fa3576004906020610e386105d56001546103e2565b60405163100c48d360e21b815293849182905afa801561057357838592610e6794600093610f72575b50614da2565b90610f12575b610e9e575b6000805160206159e083398151915291610e936040519283923397846109c9565b0390a361084d614918565b610eac6105d56000546103e2565b91823b156103dd5760006040518094637f15208d60e01b8252818381610ed58a600483016138f6565b03925af1928315610573576000805160206159e083398151915293610efd575b509150610e72565b806108706000610f0c93611842565b38610ef5565b610f206105d56000546103e2565b803b156103dd5760006040518092637f15208d60e01b8252818381610f488b6004830161390d565b03925af1801561057357610f5d575b50610e6d565b806108706000610f6c93611842565b38610f57565b610f9591935060203d602011610f9c575b610f8d8183611842565b810190613976565b9138610e61565b503d610f83565b63d0806ec760e01b60005260046000fd5b610fcd915060203d6020116108fa576108ec8183611842565b38610e1f565b610fed91935060203d602011610f9c57610f8d8183611842565b9138610de0565b61100c9060203d6020116108fa576108ec8183611842565b610da5565b61102790853d87116108fa576108ec8183611842565b610d77565b61104691925060203d60201161095f576109518183611842565b9038610d3b565b6313be252b60e01b60005260046000fd5b611077915060203d602011610f9c57610f8d8183611842565b38610cf3565b631e9acf1760e31b60005260046000fd5b6110a7915060203d602011610f9c57610f8d8183611842565b38610cbb565b6110c6915060203d60201161095f576109518183611842565b38610c7a565b6110df913d8091833e6108b38183611842565b38610bec565b8061087060006110f493611842565b38610bad565b346103dd5760203660031901126103dd576020611118600435613995565b604051908152f35b346103dd5760403660031901126103dd57611159602435600435611143826103ee565b61115461114f82613995565b6147d9565b615173565b005b346103dd5760403660031901126103dd5760043560243561117b816103ee565b336001600160a01b0382160361119457611159916151f9565b63334bd91960e11b60005260046000fd5b9181601f840112156103dd578235916001600160401b0383116103dd57602083818601950101116103dd57565b346103dd5760a03660031901126103dd576064356004356024356044356084356001600160401b0381116103dd5761120e9036906004016111a5565b611216614821565b61121e61484b565b33600052600a6020526040600020544311156109b85761123d85615288565b611246846152a0565b85156104875764e8d4a51000861080156117cb575b61088d57604051602081019061128681611278878b8a8c88612b92565b03601f198101835282611842565b5190206112976105d5600c546103e2565b926001600160a01b038416156117ba576020916112c86040519485938493636b80155f60e01b8552600485016139d7565b0381855afa9081156105735760009161179b575b501561178a57803b156103dd57604051630e62cc9360e21b8152916000918391829084908290611310908a600484016138e5565b03925af1801561057357611775575b5061132e6105d56004546103e2565b604051634977ff8b60e11b81526004810183905290602090829060249082905afa90811561057357600091611756575b50156117455761137761137083613985565b5460ff1690565b611734576113896105d56000546103e2565b604051638d34875560e01b8152600481018490529390600090859060249082905afa93841561057357600094611719575b506113c860808501516103e2565b610120850151946113d886610498565b6113f76113ed60a083015164ffffffffff1690565b64ffffffffff1690565b91815115610977576001600160a01b0316953387036109665761141981610498565b60028114159081611704575b506116f3578360809161144761143a88613985565b805460ff19166001179055565b611465604051958693849363cdeb3fcf60e01b855260048501613a41565b0381305afa6000816000946000936116b9575b506114d15785611486613af6565b6308c379a0146114b8575b61149d6114a791613985565b805460ff19169055565b633a4f184b60e11b60005260046000fd5b6114c0613b14565b156114915761149d6114a791613985565b926114e06105d56000546103e2565b803b156103dd5760405163fa5fa16360e01b815291600091839182908490829061150e908d600484016138e5565b03925af18015610573576116a4575b5061152c6105d56000546103e2565b91823b156103dd5760006040518094630d7ad17360e41b8252818381611556888d600484016138e5565b03925af1928315610573576115709361168f575b50615303565b9161157f6105d56001546103e2565b60405163b1d3354f60e01b8152602081600481855afa90811561057357600091611670575b50836115ee575b50506115d8600080516020615b20833981519152936115cc61149d87613985565b604051938493846109c9565b0390a3436115e53361370e565b55610855614887565b6001600160a01b0316803b156103dd57836000916116239383604051809681958294633c37699760e21b8452600484016138ca565b03925af1908161165b575b5061164457637101508d60e11b60005260046000fd5b6115d8600080516020615b208339815191526115ab565b80610870600061166a93611842565b3861162e565b611689915060203d60201161095f576109518183611842565b386115a4565b80610870600061169e93611842565b3861156a565b8061087060006116b393611842565b3861151d565b915093506116df915060803d6080116116ec575b6116d78183611842565b810190613a1f565b9492905090939138611478565b503d6116cd565b63a8a168bf60e01b60005260046000fd5b6003915061171181610498565b141538611425565b61172d91943d8091833e6108b38183611842565b92386113ba565b6358c8679f60e01b60005260046000fd5b63559bd01960e01b60005260046000fd5b61176f915060203d6020116108fa576108ec8183611842565b3861135e565b80610870600061178493611842565b3861131f565b636227817160e01b60005260046000fd5b6117b4915060203d6020116108fa576108ec8183611842565b386112dc565b639cef199b60e01b60005260046000fd5b50655af3107a4000861161125b565b346103dd5760003660031901126103dd576001546040516001600160a01b039091168152602090f35b346103dd5760003660031901126103dd576004546040516001600160a01b039091168152602090f35b634e487b7160e01b600052604160045260246000fd5b601f909101601f19168101906001600160401b0382119082101761186557604052565b61182c565b6040519061040a61012083611842565b6040519061040a61014083611842565b6001600160401b03811161186557601f01601f191660200190565b9291926118b18261188a565b916118bf6040519384611842565b8294818452818301116103dd578281602093846000960137010152565b60403660031901126103dd576004356118f4816103ee565b6024356001600160401b0381116103dd57366023820112156103dd576119249036906024816004013591016118a5565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016308114908115611af5575b50611ae457611966614718565b6119746105d56007546103e2565b6001600160a01b038116156104875760206040518092631052504160e01b825281806119a388600483016128e8565b03915afa60009181611ac3575b50611ab5576119bd613af6565b6308c379a014611a4d575b60405162461bcd60e51b815260206004820152605160248201527f41646d696e2076616c69646174696f6e206661696c65643a20556e6b6e6f776e60448201527f206572726f7220286c696b656c7920726571756972652866616c73652920696e6064820152702076616c6964617465557067726164652960781b608482015260a490fd5b611a55613b14565b80611a6057506119c8565b60405178020b236b4b7103b30b634b230ba34b7b7103330b4b632b21d1603d1b6020820152610a0991611a9d908290611278906039830190615341565b60405162461bcd60e51b815291829160048301612995565b1561088d5761115991615358565b611add91925060203d6020116108fa576108ec8183611842565b90386119b0565b63703e46dd60e11b60005260046000fd5b6000805160206159c0833981519152546001600160a01b03161415905038611959565b346103dd5760003660031901126103dd577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163003611ae45760206040516000805160206159c08339815191528152f35b346103dd5760003660031901126103dd57602060ff600080516020615aa083398151915254166040519015158152f35b346103dd5760203660031901126103dd57600854604051630bc926dd60e31b8152600480359082015290602090829060249082906001600160a01b03165afa80156105735761053291600091611c03575b506040519081529081906020820190565b611c1c915060203d602011610f9c57610f8d8183611842565b38611bf2565b346103dd5760c03660031901126103dd576004356024356001600160401b0381116103dd57611c559036906004016111a5565b90916044356001600160401b0381116103dd57611c769036906004016111a5565b93606435939091906001600160401b0385116103dd5761053295611ca1611cb19636906004016111a5565b9390926084359560a43597613b89565b6040519081529081906020820190565b346103dd5760203660031901126103dd5760085460405163667fe26560e01b8152600480359082015290602090829060249082906001600160a01b03165afa80156105735761053291600091610a7d575060405191829182901515815260200190565b346103dd5760003660031901126103dd576005546040516001600160a01b039091168152602090f35b346103dd5760003660031901126103dd576020604051600080516020615ae08339815191528152f35b61040a909291926101008061012083019580518452602081015160208501526040810151604085015260018060a01b03606082015116606085015264ffffffffff6080820151166080850152611dda60a082015160a086019064ffffffffff169052565b60c08181015161ffff169085015260e08181015164ffffffffff169085015201519101906104b8565b346103dd5760203660031901126103dd57611e526000600435611e24613e48565b50611e326105d583546103e2565b6040518080958194638d34875560e01b8352600483019190602083019252565b03915afa90811561057357600091611f3c575b5080519060208101519060408101516080820151611e82906103e2565b60a083015164ffffffffff1660c084015164ffffffffff169160e0850151611eab9061ffff1690565b93610100860151611ec09064ffffffffff1690565b95610120015196611ed088610498565b611ed861186a565b988952602089015260408801526001600160a01b0316606087015264ffffffffff16608086015264ffffffffff1660a085015261ffff1660c084015264ffffffffff1660e0830152611f2e906101008301613e9d565b604051610532819282611d76565b611f4f913d8091833e6108b38183611842565b38611e65565b346103dd5760006040366003190112611fe95760043581602435611f7761476b565b611f7f61484b565b611f89818461553b565b6003546001600160a01b031692833b15611fe757604490836040519586948593630473e93b60e51b8552600485015260248401525af18015610573578290611fd7575b611fd4614887565b80f35b611fe091611842565b3881611fcc565b825b80fd5b346103dd5760e03660031901126103dd57600435612009816103ee565b60243590612016826103ee565b60443591612023836103ee565b60643561202f816103ee565b6084359161203c836103ee565b60a43591612049836103ee565b60c43594612056866103ee565b61205e6146aa565b61206781615555565b61207083615555565b61207987615555565b61208282615555565b61208b85615555565b61209484615555565b61209d86615555565b6120ab6105d56007546103e2565b91823b156103dd57604051638ffee9cd60e01b81526001600160a01b038381166004830152858116602483015289811660448301528281166064830152878116608483015286811660a4830152881660c482015295928660e4815a6000948591f1918215610573576121959861214f6121799661214161215d946121879b61216b986121c6575b506001600160a01b0316613609565b6001600160a01b031661362b565b6001600160a01b031661364d565b6001600160a01b031661366f565b6001600160a01b0316613691565b6001600160a01b03166136b3565b6001600160a01b03166136d5565b6040516007815233907fc5ec6eb3c84a615de1792ae2858fe498e7c3c8e4986fef4ae3cbf1f8d2c68bca90602090a2005b8061087060006121d593611842565b38612132565b346103dd5760403660031901126103dd57602060ff612220602435600435612202826103ee565b600052600080516020615a6083398151915284526040600020613728565b54166040519015158152f35b346103dd5760203660031901126103dd5760043560046122506105d56008546103e2565b60206122606105d56001546103e2565b60405163696c86cd60e01b815293849182905afa908115610573576122b99360409360009361230f575b5083518095819482936358ca394160e01b84526004840160409060009294936060820195825260208201520152565b03915afa801561057357610532916000916122df57506040519081529081906020820190565b612301915060403d604011612308575b6122f98183611842565b810190613ea9565b5038611bf2565b503d6122ef565b61232991935060203d602011610f9c57610f8d8183611842565b913861228a565b346103dd5760403660031901126103dd576004356001600160401b0381116103dd57806004019061016060031982360301126103dd576024356001600160401b0381116103dd576123859036906004016111a5565b61238d614821565b61239561484b565b8335926123a184615288565b60248101356123af81615288565b6044820135916123be83615288565b6064810135916123cd83615288565b60848201926123ee6123e96123e2868c613ec3565b36916118a5565b615594565b6101048301359485156104875764e8d4a5100086108015612882575b61088d578861241a8b9687613ec3565b60a4870135968960c4820135998a60e48401359a8b92610124860161243e91613ec3565b9690956101440161244e90613f03565b976040519b8c9b60208d019e8f9c6124659d613f0d565b03601f19810182526124779082611842565b519020600c54612486906103e2565b61248f906103e2565b906001600160a01b038216156117ba5760405163b538e81760e01b8152634dc8e23d60e11b6004820152606081602481865afa80156105735787926020928a92612855575b506124f36040519485938493636b80155f60e01b8552600485016139fb565b0381855afa90811561057357600091612836575b501561178a57803b156103dd57604051630e62cc9360e21b815291600091839182908490829061253b908d600484016138e5565b03925af1801561057357612821575b506125596105d56006546103e2565b803b156103dd576000604051809263102d617560e01b825281838161258c60048201906000602060408401938281520152565b03925af180156105735761280c575b506125aa6105d56000546103e2565b604051638d34875560e01b8152600481018790529290600090849060249082905afa928315610573576000936127f1575b50825115610977576125f060808401516103e2565b336001600160a01b03909116036109665761260d6106878761495d565b61087c5760408301918251612766575b50505061012001805161262f81610498565b61263881610498565b15159081612746575b81612726575b81612707575b506126f6576126879360209260006126696105d56002546103e2565b9260405197889586948593634dc8e23d60e11b85526004850161400b565b03925af1918215610573576000926126d5575b50816126bf575b610532826126ad614887565b60405191829182901515815260200190565b6106876126cb9161495d565b61087c57386126a1565b6126ef91925060203d6020116108fa576108ec8183611842565b903861269a565b63e047416960e01b60005260046000fd5b600691505161271581610498565b61271e81610498565b14153861264d565b90506002815161273581610498565b61273e81610498565b141590612647565b90506001815161275581610498565b61275e81610498565b141590612641565b9161277661277e926004946155f4565b905190615684565b602061278e6105d56001546103e2565b60405163100c48d360e21b815293849182905afa918215610573576000926127d0575b50106127bf5738808061261d565b635e31938360e11b60005260046000fd5b6127ea91925060203d602011610f9c57610f8d8183611842565b90386127b1565b61280591933d8091833e6108b38183611842565b91386125db565b80610870600061281b93611842565b3861259b565b80610870600061283093611842565b3861254a565b61284f915060203d6020116108fa576108ec8183611842565b38612507565b6128769060603d60601161287b575b61286e8183611842565b810190613f7b565b6124d4565b503d612864565b50655af3107a4000861161240a565b346103dd5760003660031901126103dd5760206040517f75027301df982f5215b4963a854cf9c73219df80cb6acd8f098189c9480c7bbc8152f35b346103dd5760003660031901126103dd57602060405160008152f35b6001600160a01b03909116815260200190565b346103dd5760003660031901126103dd57600b546040516001600160a01b039091168152602090f35b346103dd5760003660031901126103dd5760206040516000805160206159208339815191528152f35b60005b8381106129605750506000910152565b8181015183820152602001612950565b906020916129898151809281855285808601910161294d565b601f01601f1916010190565b9060206129a6928181520190612970565b90565b346103dd5760003660031901126103dd5761053260408051906129cc8183611842565b60058252640352e302e360dc1b602083015251918291602083526020830190612970565b600811156103dd57565b359061040a826129f0565b346103dd5760403660031901126103dd57602435600435612a25826129f0565b600154612a4990612a42906105d5906001600160a01b03166103e2565b33146140d7565b612a54811515614136565b612a626105d56000546103e2565b91823b156103dd57612a8e9260009283604051809681958294637f15208d60e01b84526004840161393b565b03925af1801561057357612a9e57005b80610870600061115993611842565b346103dd576101403660031901126103dd57611159600435612ace816103ee565b602435612ada816103ee565b604435612ae6816103ee565b606435612af2816103ee565b608435612afe816103ee565b60a43590612b0b826103ee565b60c43592612b18846103ee565b60e43594612b25866103ee565b6101043596612b33886103ee565b6101243598612b418a6103ee565b614178565b9080601f830112156103dd578160206129a6933591016118a5565b64ffffffffff8116036103dd57565b359061040a82612b61565b61ffff8116036103dd57565b359061040a82612b7b565b9094939260609260808301968352602083015260408201520152565b346103dd5760603660031901126103dd576004356001600160401b0381116103dd5761014060031982360301126103dd57612be761187a565b6004820135815260248201356020820152604482013560408201526064820135906001600160401b0382116103dd57612c9561012461053294612c33612ca79560043691840101612b46565b6060850152612c44608482016103ff565b6080850152612c5560a48201612b70565b60a0850152612c6660c48201612b70565b60c0850152612c7760e48201612b87565b60e0850152612c896101048201612b70565b610100850152016129fa565b61012082015260243560443591614483565b9060409492945194859485612b92565b346103dd5760203660031901126103dd57600435612cd36146aa565b612cdc81615288565b806000526009602052604060002060ff19815416905533907f81a106317e7bcc4bb0d00469e38615879068b044d72620ca9aec13ad478ccb6c600080a3005b346103dd5760403660031901126103dd57611159602435600435612d3e826103ee565b612d4a61114f82613995565b6151f9565b346103dd5760003660031901126103dd576008546040516001600160a01b039091168152602090f35b346103dd5760003660031901126103dd576002546040516001600160a01b039091168152602090f35b346103dd5760203660031901126103dd57600435612dbe816103ee565b612dc66146aa565b6001600160a01b0316801561048757600c80546001600160a01b031916919091179055005b60609060031901126103dd57600435906024359060443590565b346103dd57612e1336612deb565b919060018060a01b03612e2a6105d56001546103e2565b1680156104875733036130f557612e456105d56000546103e2565b92612e4f846103e2565b1561048757604051638d34875560e01b815260048101849052600081602481885afa908115610573576000916130dc575b50805115610977576001600160801b03831161088d5764ffffffffff821161088d5760c081015164ffffffffff1694803b156103dd576000604051809263fa5fa16360e01b8252818381612ed88a8c600484016138e5565b03925af18015610573576130c7575b5082158015906130ba575b612f8b575b50506000612f2c92612f0c6105d583546103e2565b6040518080968194638d34875560e01b8352600483019190602083019252565b03915afa91821561057357600092612f6e575b5060408201510361088d5764ffffffffff612f6360c08293015164ffffffffff1690565b921691161061088d57005b612f849192503d806000833e6108b38183611842565b9038612f3f565b60408101511561304f575b6101209150018051612fa781610498565b612fb081610498565b15908115613031575b50612fc6575b3880612ef7565b612fd46105d56000546103e2565b91823b156103dd5760006040518094637f15208d60e01b8252818381612ffd876004830161390d565b03925af190811561057357612f2c9360009261301d575b50925050612fbf565b806108708461302b93611842565b38613014565b600191505161303f81610498565b61304881610498565b1438612fb9565b61305d6105d56000546103e2565b803b156103dd576040516390da939b60e01b815292600091849182908490829061308b908b600484016138e5565b03925af191821561057357610120926130a5575b50612f96565b8061087060006130b493611842565b3861309f565b5060408101511515612ef2565b8061087060006130d693611842565b38612ee7565b6130ef913d8091833e6108b38183611842565b38612e80565b63ea8e4eb560e01b60005260046000fd5b346103dd5760403660031901126103dd5760243560043561312561484b565b6131336105d56000546103e2565b604051638d34875560e01b81526004810183905290600090829060249082905afa908115610573576131729160809160009161325e575b5001516103e2565b336001600160a01b0390911603610966576131916105d56001546103e2565b9060206040518093631cce4db560e31b8252816000816131b58988600484016138e5565b03925af19182156105735760009261323d575b50816131da57610532826126ad614887565b6131e86105d56000546103e2565b92833b156103dd57613214936000928360405180978195829463fa5fa16360e01b8452600484016138e5565b03925af19182156105735761053292156126a15780610870600061323793611842565b386126a1565b61325791925060203d6020116108fa576108ec8183611842565b90386131c8565b61327391503d806000833e6108b38183611842565b3861316a565b346103dd576132bb602061328c36612deb565b60085460405163e7f9caa560e01b81529586946001600160a01b039092169385938493909190600485016109c9565b03915afa908115610573576000916132dc575b506040519015158152602090f35b6132f5915060203d6020116108fa576108ec8183611842565b386132ce565b346103dd5760203660031901126103dd5760043561331761476b565b61331f61484b565b61332761489b565b61333081615288565b61333e6105d56003546103e2565b604051633abddd8b60e21b81526004810183905290602090829081600081602481015b03925af1908115610573576000916133f9575b508061338f575b61053290613387614918565b6126ad614887565b61339d6105d56000546103e2565b803b156103dd57604051637f15208d60e01b81529260009184918290849082906133ca9060048301613924565b03925af191821561057357610532926133e4575b5061337b565b8061087060006133f393611842565b386133de565b613412915060203d6020116108fa576108ec8183611842565b38613374565b346103dd5760003660031901126103dd576020604051600080516020615a808339815191528152f35b346103dd5760203660031901126103dd5760405160c081016001600160401b038111828210176118655760009160a091604052828152826020820152826040820152826060820152826080820152015260405162461bcd60e51b815280610a0960048201613951565b346103dd5760003660031901126103dd576003546040516001600160a01b039091168152602090f35b346103dd5760003660031901126103dd576000546040516001600160a01b039091168152602090f35b346103dd5760003660031901126103dd576007546040516001600160a01b039091168152602090f35b346103dd5760003660031901126103dd57600c546040516001600160a01b039091168152602090f35b346103dd5761355c36612deb565b9061356561476b565b61356d61484b565b61357561489b565b82156135b057613361916020916135906105d56003546103e2565b906000604051809681958294631faa4a4760e31b84528a600485016109c9565b637bb0b62160e01b60005260046000fd5b346103dd5760003660031901126103dd5761053260408051906135e48183611842565b60068252650312e302e31360d41b602083015251918291602083526020830190612970565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b519061040a826129f0565b6040513d6000823e3d90fd5b6001600160a01b03166000908152600a6020526040902090565b9060018060a01b0316600052602052604060002090565b81601f820112156103dd5780516137558161188a565b926137636040519485611842565b818452602082840101116103dd576129a6916020808501910161294d565b519061040a826103ee565b519061040a82612b61565b519061040a82612b7b565b6020818303126103dd578051906001600160401b0382116103dd5701610140818303126103dd576137d161187a565b9181518352602082015160208401526040820151604084015260608201519160018060401b0383116103dd5761380f6101209261387194830161373f565b606085015261382060808201613781565b608085015261383160a0820161378c565b60a085015261384260c0820161378c565b60c085015261385360e08201613797565b60e0850152613865610100820161378c565b610100850152016136f7565b61012082015290565b908160209103126103dd57516129a6816103ee565b519081151582036103dd57565b908160209103126103dd576129a69061388f565b6001600160a01b0390911681526000602082015260400190565b6001600160a01b039091168152602081019190915260400190565b908152602081019190915260400190565b90815260408101919061040a9060200160066104b8565b90815260408101919061040a9060200160026104b8565b90815260408101919061040a9060200160056104b8565b90815260408101929161040a91602001906104b8565b60609060208152600a60208201526919195c1c9958d85d195960b21b60408201520190565b908160209103126103dd575190565b6000526009602052604060002090565b600052600080516020615a6083398151915260205260016040600020015490565b908060209392818452848401376000828201840152601f01601f1916010190565b6060906129a6949263389b0b9b60e01b8252602082015281604082015201916139b6565b6060906129a69492634dc8e23d60e11b8252602082015281604082015201916139b6565b91908260809103126103dd578151916020810151916060604083015192015190565b604091949392946060825280516060830152602081015160808301528281015160a0830152613aec610120613a87606084015161014060c08701526101a0860190612970565b60808401516001600160a01b031660e08601529260a081015164ffffffffff1661010086015260c081015164ffffffffff168583015260e081015161ffff1661014086015261010081015164ffffffffff1661016086015201516101808401906104b8565b9460208201520152565b60009060033d11613b0357565b905060046000803e60005160e01c90565b600060443d106129a6576040513d600319016004823e8051916001600160401b0383113d602485011117613b83578183018051909390916001600160401b038311613b7b573d84016003190185840160200111613b7b57506129a692910160200190611842565b949350505050565b92915050565b95969794929793909193613b9b61484b565b613ba3614821565b33600052600a6020526040600020544311156109b857613bda81613bc83688876118a5565b613bd336868e6118a5565b908a615494565b801561174557613bee6105d56004546103e2565b604051634977ff8b60e11b81526004810183905290602090829060249082905afa90811561057357600091613d8e575b501561174557613c326105d56000546103e2565b604051631e1778ad60e11b8152600481018990529096906020816024818b5afa90811561057357600091613d6f575b50613d5e57613c71600b546103e2565b6001600160a01b0381161561048757868b868b613cb68e8b8a613c986105d560209a6103e2565b966040519a8b998a98899863728e8bbb60e01b8a5260048a01613dad565b03915afa90811561057357600091613d3f575b501561088d57602097600094613cf8936040519b8c9a8b998a986306f4597160e21b8a52339260048b01613df3565b03925af190811561057357600091613d20575b5043613d163361370e565b559061040a614887565b613d39915060203d602011610f9c57610f8d8183611842565b38613d0b565b613d58915060203d6020116108fa576108ec8183611842565b38613cc9565b630dd1bc8b60e31b60005260046000fd5b613d88915060203d602011610f9c57610f8d8183611842565b38613c61565b613da7915060203d6020116108fa576108ec8183611842565b38613c1e565b9694906129a6989692613de59594613dd2928a5260a060208b015260a08a01916139b6565b92604088015286830360608801526139b6565b9260808185039101526139b6565b999897939194613e1b60a09896613e359560c08e613e439b96815281602082015201916139b6565b926001808a1b031660408c01528a830360608c01526139b6565b9187830360808901526139b6565b930152565b6040519061012082016001600160401b03811183821017611865576040526000610100838281528260208201528260408201528260608201528260808201528260a08201528260c08201528260e08201520152565b60088210156104a25752565b91908260409103126103dd576129a660208351930161388f565b903590601e19813603018212156103dd57018035906001600160401b0382116103dd576020019181360383136103dd57565b63ffffffff8116036103dd57565b356129a681613ef5565b9b969792956101609d9e9d60808e613f749c976101409f9a63ffffffff9f9a9697613f5098845260208401526040830152606082015201526101608d01916139b6565b9560a08b015260c08a015260e08901526101008801528683036101208801526139b6565b9416910152565b908160609103126103dd5760405190606082016001600160401b0381118382101761186557613fc69160409182528051613fb4816103ee565b8452602081015160208501520161388f565b604082015290565b9035601e19823603018112156103dd570160208101919035906001600160401b0382116103dd5781360383136103dd57565b359061040a82613ef5565b916129a693919260408152833560408201526020840135606082015260408401356080820152606084013560a08201526140ca6140bc6101406140b561406a61405760808a018a613fce565b61016060c08901526101a08801916139b6565b60a089013560e087015260c089013561010087015260e0890135610120870152610100890135838701526140a26101208a018a613fce565b878303603f1901610160890152906139b6565b9601614000565b63ffffffff16610180830152565b60208185039101526139b6565b156140de57565b60405162461bcd60e51b815260206004820152602a60248201527f4f6e6c79206c6f616e206f7065726174696f6e73206d616e616765722063616e6044820152692063616c6c207468697360b01b6064820152608490fd5b1561413d57565b60405162461bcd60e51b8152602060048201526013602482015272125b9d985b1a59081c1bdcda5d1a5bdb881251606a1b6044820152606490fd5b97959391989694929098600080516020615b0083398151915254996141a360ff8c60401c1615151590565b9a6001600160401b031680159081614293575b6001149081614289575b159081614280575b5061426f57600080516020615b0083398151915280546001600160401b03191660011790556141fb998b61424a5761429b565b61420157565b600080516020615b00833981519152805460ff60401b19169055604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a1565b600080516020615b00833981519152805460ff60401b1916600160401b17905561429b565b63f92ee8a960e01b60005260046000fd5b905015386141c8565b303b1591506141c0565b8c91506141b6565b989793929896919094966142ad6157f7565b6142b561570f565b6142bd6157f7565b6142c56157f7565b6142cd615825565b6001600160a01b0316948515610487576001600160a01b0316908115610487576001600160a01b0316988915610487576001600160a01b0316928315610487576001600160a01b0316968715610487576001600160a01b0316958615610487576001600160a01b0316918215610487576001600160a01b0316938415610487576001600160a01b0316958615610487576001600160a01b03891615610487576143a86143f6986143a36143b29661439e6144239e6143996143ad986143946143d49e613609565b61362b565b61364d565b61366f565b613691565b6136b3565b6136d5565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b6143ff81614de6565b5061440981614e7f565b5061441381614f3c565b5061441d81614ff9565b506150b6565b50565b51906001600160581b03821682036103dd57565b91908260409103126103dd576129a6602061445484614426565b9301614426565b634e487b7160e01b600052601160045260246000fd5b9190820180921161447e57565b61445b565b90923033036130f557600261012083015161449d81610498565b6144a681610498565b1461467c575b6144ba6105d56004546103e2565b604080516353f366c760e01b81526004810187905291829060249082905afa9081156105735760009161464b575b506040830180519091614506916001600160581b039091169061571f565b94614525614515878451615791565b9561452087826157b6565b6155c3565b91516145356105d56001546103e2565b60405163100c48d360e21b81529091602082600481865afa908115610573576145679260009261462a575b50856157db565b6146195760206004916040519283809263100c48d360e21b82525afa80156105735761459d916000916145fa575b5086846157db565b6145e9576145c76145c060e06145b6886145cc96615684565b96015161ffff1690565b61ffff1690565b614471565b9061ffff82116145d857565b6319a4c60960e21b60005260046000fd5b631300e8bd60e21b60005260046000fd5b614613915060203d602011610f9c57610f8d8183611842565b38614595565b63e5cace4160e01b60005260046000fd5b61464491925060203d602011610f9c57610f8d8183611842565b9038614560565b61466d915060403d604011614675575b6146658183611842565b81019061443a565b9050386144e8565b503d61465b565b6146926113ed61010084015164ffffffffff1690565b4211156144ac5763088502f160e21b60005260046000fd5b600080516020615ae0833981519152600052600080516020615a6083398151915260205260ff6146e833600080516020615960833981519152613728565b5416156146f157565b63e2517d3f60e01b60005233600452600080516020615ae083398151915260245260446000fd5b60008052600080516020615a6083398151915260205260ff614748336000805160206159a0833981519152613728565b54161561475157565b63e2517d3f60e01b60005233600452600060245260446000fd5b600080516020615900833981519152600052600080516020615a6083398151915260205260ff6147a933600080516020615a20833981519152613728565b5416156147b257565b63e2517d3f60e01b6000523360045260008051602061590083398151915260245260446000fd5b80600052600080516020615a6083398151915260205260ff6147ff336040600020613728565b5416156148095750565b63e2517d3f60e01b6000523360045260245260446000fd5b60ff600080516020615aa0833981519152541661483a57565b63d93c066560e01b60005260046000fd5b6002600080516020615ac08339815191525414614876576002600080516020615ac083398151915255565b633ee5aeb560e01b60005260046000fd5b6001600080516020615ac083398151915255565b600260008051602061594083398151915254146148c657600260008051602061594083398151915255565b60405162461bcd60e51b8152602060048201526024808201527f476c6f62616c5265656e7472616e637947756172643a207265656e7472616e746044820152640818d85b1b60da1b6064820152608490fd5b600160008051602061594083398151915255565b61493590615288565b801561493e5750565b6346f4384b60e01b600052600452600160245260001960445260646000fd5b61496b6105d56000546103e2565b604051638d34875560e01b81526004810183905290600090829060249082905afa90811561057357600091614afc575b5081815103614a5257608001516001600160a01b03906149ba906103e2565b16156149c65750600190565b600080516020615a4083398151915260405180614a3e4282919060608352601060608401526f34b73b30b634b22fb137b93937bbb2b960811b608084015260a06020840152601860a084015277426f72726f7765722061646472657373206973207a65726f60401b60c0840152604060e08401930152565b0390a263e6c4247b60e01b60005260046000fd5b50600080516020615a4083398151915260405180614ae8428291906060835260146060840152730e0dee6d2e8d2dedcbed2c8bedad2e6dac2e8c6d60631b608084015260a06020840152602a60a08401527f506f736974696f6e20494420646f6573206e6f74206d617463682073746f726560c08401526932103837b9b4ba34b7b760b11b60e084015260406101008401930152565b0390a2630a0b0d7960e01b60005260046000fd5b614b1191503d806000833e6108b38183611842565b3861499b565b6040516323b872dd60e01b60208083019182526001600160a01b0394851660248401529490931660448201526064808201959095529384529260009190614b5f608482611842565b519082855af115613702576000513d614ba857506001600160a01b0381163b155b614b875750565b635274afe760e01b60009081526001600160a01b0391909116600452602490fd5b60011415614b80565b9190911561413d578115614c65575115614c26571015614bcd57565b60405162461bcd60e51b815260206004820152602b60248201527f5061796d656e7420616d6f756e74206d757374206265206c657373207468616e60448201526a081d1bdd185b081919589d60aa1b6064820152608490fd5b60405162461bcd60e51b8152602060048201526017602482015276141bdcda5d1a5bdb88191bd95cc81b9bdd08195e1a5cdd604a1b6044820152606490fd5b60405162461bcd60e51b815260206004820152602860248201527f5061796d656e7420616d6f756e74206d7573742062652067726561746572207460448201526768616e207a65726f60c01b6064820152608490fd5b614cc481610498565b60018114159081614d6c575b81614d56575b81614d41575b50614ce357565b60405162461bcd60e51b815260206004820152603060248201527f506f736974696f6e20737461747573206e6f7420656c696769626c6520666f7260448201526f081c185c9d1a585b081c185e5b595b9d60821b6064820152608490fd5b60049150614d4e81610498565b141538614cdc565b9050614d6181610498565b600381141590614cd6565b9050614d7781610498565b600281141590614cd0565b929190830392831161447e5782614d9d6129a69260006155f4565b615684565b9392909160009260009560088110156104a257600414614dcf575b505015614dc8579190565b9150600190565b1015614ddd575b3880614dbd565b60019150614dd6565b60008052600080516020615a6083398151915260205260ff614e16826000805160206159a0833981519152613728565b5416614e795760008052600080516020615a60833981519152602052614e4a816000805160206159a0833981519152613728565b805460ff1916600117905533906001600160a01b031660006000805160206158e08339815191528180a4600190565b50600090565b600080516020615900833981519152600052600080516020615a6083398151915260205260ff614ebd82600080516020615a20833981519152613728565b5416614e7957600080516020615900833981519152600052600080516020615a60833981519152602052614eff81600080516020615a20833981519152613728565b805460ff1916600117905533906001600160a01b03166000805160206159008339815191526000805160206158e0833981519152600080a4600190565b600080516020615ae0833981519152600052600080516020615a6083398151915260205260ff614f7a82600080516020615960833981519152613728565b5416614e7957600080516020615ae0833981519152600052600080516020615a60833981519152602052614fbc81600080516020615960833981519152613728565b805460ff1916600117905533906001600160a01b0316600080516020615ae08339815191526000805160206158e0833981519152600080a4600190565b600080516020615a80833981519152600052600080516020615a6083398151915260205260ff61503782600080516020615a00833981519152613728565b5416614e7957600080516020615a80833981519152600052600080516020615a6083398151915260205261507981600080516020615a00833981519152613728565b805460ff1916600117905533906001600160a01b0316600080516020615a808339815191526000805160206158e0833981519152600080a4600190565b600080516020615920833981519152600052600080516020615a6083398151915260205260ff6150f482600080516020615980833981519152613728565b5416614e7957600080516020615920833981519152600052600080516020615a6083398151915260205261513681600080516020615980833981519152613728565b805460ff1916600117905533906001600160a01b03166000805160206159208339815191526000805160206158e0833981519152600080a4600190565b80600052600080516020615a6083398151915260205260ff615199836040600020613728565b54166151f25780600052600080516020615a608339815191526020526151c3826040600020613728565b805460ff1916600117905533916001600160a01b0316906000805160206158e0833981519152600080a4600190565b5050600090565b80600052600080516020615a6083398151915260205260ff61521f836040600020613728565b5416156151f25780600052600080516020615a6083398151915260205261524a826040600020613728565b805460ff1916905533916001600160a01b0316907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b600080a4600190565b1561528f57565b6379ec0ed760e11b60005260046000fd5b6001811080156152d0575b6152b25750565b6304a45adb60e51b6000526004526001602452603c60445260646000fd5b50603c81116152ab565b9060648202918083046064149015171561447e57565b8181029291811591840414171561447e57565b90600c811461532f5762278d0081029080820462278d00149015171561447e57810180911161447e5790565b506301e13380810180911161447e5790565b906153546020928281519485920161294d565b0190565b6040516352d1902d60e01b81529091906020816004816001600160a01b0387165afa60009181615473575b506153a657634c9c8ce360e01b6000526001600160a01b03831660045260246000fd5b6000805160206159c0833981519152810361545f5750813b1561543d576000805160206159c083398151915280546001600160a01b0319166001600160a01b0384169081179091557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a2805115615423576144239161583c565b50503461542c57565b63b398979f60e01b60005260046000fd5b50634c9c8ce360e01b60009081526001600160a01b0391909116600452602490fd5b632a87526960e21b60005260045260246000fd5b61548d91925060203d602011610f9c57610f8d8183611842565b9038615383565b61549d90615288565b8051156155035760409051106154c7576154b690615594565b806154be5750565b61040a906152a0565b60405163df70480560e01b815260206004820152601360248201527214da59db985d1d5c99481d1bdbc81cda1bdc9d606a1b6044820152606490fd5b60405163df70480560e01b815260206004820152600f60248201526e456d707479207369676e617475726560881b6044820152606490fd5b61554490615288565b8061554c5750565b61040a90615288565b6001600160a01b038116908115615583573b1561556f5750565b630fb15bad60e11b60005260045260246000fd5b63d92e233d60e01b60005260046000fd5b80511561559e5750565b60405163df70480560e01b815260206004820152908190610a09906024830190612970565b6a084595161401484a00000081116155e357156001171561447e57600090565b63128df78360e01b60005260046000fd5b660775f05a0740008111615673576a084595161401484a00000082116155e357801580159081615647575b50615636576129a691615631916152f0565b6152da565b63450d49cd60e01b60005260046000fd5b905061565d57606481600019040482113861561f565b634e487b7160e01b600052601260045260246000fd5b63e9ec682160e01b60005260046000fd5b81156156fe5768327cb2734119d3b7a9601e1b81116156ed577e068db8bac710cb295e9e1b089a027525460aa64c2f837b4a2339c0ebedfa4381116156dc57612710810290808204612710149015171561447e570490565b633da428df60e21b60005260046000fd5b638a94304d60e01b60005260046000fd5b6323d359a360e01b60005260046000fd5b6157176157f7565b6148876157f7565b68327cb2734119d3b7a9601e1b81116156ed5761271082116157805780158015908161576d575b5061575c5761271091615758916152f0565b0490565b6340c0d6e560e11b60005260046000fd5b905061565d578060001904821138615746565b637186728f60e11b60005260046000fd5b9081019081811161447e5781106157a55790565b636be580af60e11b60005260046000fd5b6a084595161401484a000000106155e35768327cb2734119d3b7a9601e1b106156ed57565b9080156157ef576157eb91615684565b1090565b505050600090565b60ff600080516020615b008339815191525460401c161561581457565b631afcd79f60e31b60005260046000fd5b600080516020615940833981519152541561491857565b6000806129a693602081519101845af43d1561587a573d9161585d8361188a565b9261586b6040519485611842565b83523d6000602085013e61587e565b6060915b906158a4575080511561589357602081519101fd5b63d6bda27560e01b60005260046000fd5b815115806158d6575b6158b5575090565b639996b31560e01b60009081526001600160a01b0391909116600452602490fd5b50803b156158ad56fe2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d5e17fc5225d4a099df75359ce1f405503ca79498a8dc46a7d583235a0ee45c16f4a222f146e17d7057e96450fc67f08ce8569fd5cf3b62a23983c4f4b9e497f35cd165352ca420415a2423a5a15f077145431fc21aec9b84cb1b8800541a5c26b16e88c42fd4e48df2dd6a2eabd6bc9aec654ec170056b470819f8892cc6431c1b3eac282bb4080c159156c6faa9df237c5a80b4a568c4661ea2010de1eb2caeb7db2dd08fcb62d0c9e08c51941cae53c267786a0b75803fb7960902fc8ef97d360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6bf041ce7315b71466c179f7fc4077ed77a42f41efde0131e3efff105022d90ecd6c996ba66d0dbb3c38dbaaac7d192f7d41593dd02b55a9147053192322b1d3b615dc3ea5d9654acb949989a0a9587a0da8cd03451c0368cc676ec7c08dd814fe150c42386d13e75f861a07555c8c65c8c90c810c4da557e735871a287ec51c02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268004ad5455c7a5edb25c14b61cc4d6429153aab5507800334ac05d65e9828801bf3cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033009b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00aaae1071a267a66db1d9c0714498307791bc0f693f5b254c861d95ca60503b6da2646970667358221220d2f7f06cd861c383ad08fa87abbc1d38c7b875bcb50757ad808653144887c86064736f6c634300081c0033";
|
|
38870
|
+
var _bytecode = "0x60a080604052346100ea57306080527ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460ff8160401c166100d9576002600160401b03196001600160401b03821601610073575b604051615d5490816100f082396080518181816115dd01526117ed0152f35b6001600160401b0319166001600160401b039081177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a13880610054565b63f92ee8a960e01b60005260046000fd5b600080fdfe6080604052600436101561001257600080fd5b60003560e01c8063018af3091461037757806301ffc9a714610372578063043fe8fc1461036d57806309d2b0ae1461036857806316d8887a1461036357806316efd9411461035e5780631732d33014610359578063248a9ca3146103545780632f2ff15d1461034f57806336568abe1461034a578063393d92cc1461034557806344c8b85214610340578063487c02b41461033b5780634a54e00a146103365780634f1ef2861461033157806352d1902d1461032c578063544ba5af146103275780635c975abb146103225780635e4936e81461031d5780636068b5d11461031857806363ba8cec146103135780636a89edad1461030e5780636b80155f1461030957806374cb36e61461030457806375b238fc146102ff5780638179dc38146102fa5780638ffee9cd146102f557806391d14854146102f05780639b9d30c1146102eb578063a217fddf146102e6578063a9a52888146102e1578063a9eadc52146102dc578063aa4fec70146102d7578063ad3cb1cc146102d2578063b1517664146102cd578063c12e1291146102c8578063c306b378146102c3578063d0e8ce82146102be578063d547741f146102b9578063d65e880d146102b4578063d6810242146102af578063d7d9f4b0146102aa578063d8dfeb45146102a5578063d9cb25a2146102a0578063dc5632531461029b578063dd74ac7a14610296578063ddccaa3a14610291578063e7f9caa51461028c578063f005e76714610287578063f2dfbf6614610282578063f2f4eb261461027d578063f851a44014610278578063fb7c6a0f146102735763ffa1ad741461026e57600080fd5b612fe7565b612fbe565b612f95565b612f6c565b612f43565b612f1a565b612e98565b612b67565b612b1c565b6129ca565b6128c6565b61289d565b612708565b61266f565b612646565b612612565b6125ae565b612515565b61246d565b61240c565b6123c5565b61238b565b612362565b61230e565b6122f2565b6122b7565b612266565b612077565b611f6a565b611ec1565b611e98565b611de0565b611ca0565b611b1e565b611a44565b6119e3565b6119b3565b611833565b6117da565b61158b565b6114b2565b6111a1565b611120565b6110f7565b6110ad565b611072565b61104c565b611011565b610fe8565b610fbf565b610ab9565b610a2d565b6109b0565b6103ae565b9181601f840112156103a9578235916001600160401b0383116103a957602083818601950101116103a957565b600080fd5b346103a95760c03660031901126103a95760843560043560243560643560443560a4356001600160401b0381116103a9576103ed90369060040161037c565b91906103f761429d565b6103ff6142c7565b33600052600a6020526040600020544311156109885761045292869161042483614317565b61042d8661432f565b6104398487898661438a565b610444600c54610a03565b61044d816143a4565b6143c5565b610465610460600454610a03565b610a03565b604051634977ff8b60e11b81526004810184905290602090829060249082905afa90811561085057600091610959575b5015610948576104ae6104a784613084565b5460ff1690565b610937576104c0610460600054610a03565b604051638d34875560e01b81526004810185905290600090829060249082905afa90811561085057600091610916575b506104fe6080820151610a03565b906101208101519561050f87612910565b61052e61052460a084015164ffffffffff1690565b64ffffffffff1690565b92825115610905576001600160a01b0316963388036108f45761055081612910565b600281141590816108df575b506108ce57816105b8869261058460206080960151828b61057e600154610a03565b9261461a565b61059d6105908a613084565b805460ff19166001179055565b60405163102f3b8760e31b81529687948594600486016131fc565b0381305afa600081600094600093610894575b5061062457856105d96132b8565b6308c379a01461060b575b6105f06105fa91613084565b805460ff19169055565b633a4f184b60e11b60005260046000fd5b6106136132d6565b156105e4576105f06105fa91613084565b92610633610460600054610a03565b803b156103a95760405163fa5fa16360e01b8152916000918391829084908290610661908d6004840161334b565b03925af180156108505761087f575b5061067f610460600054610a03565b91823b156103a95760006040518094630d7ad17360e41b82528183816106a9888d6004840161334b565b03925af1928315610850576106c39361086a575b50614754565b916106d2610460600054610a03565b803b156103a9576000604051809263b222bec960e01b82528183816106fb8a8c6004840161334b565b03925af1801561085057610855575b50610719610460600154610a03565b60405163b1d3354f60e01b8152602081600481855afa90811561085057600091610821575b5083610799575b5050610772600080516020615cff833981519152936107666105f087613084565b6040519384938461338c565b0390a34361077f3361302f565b55610788614303565b6040516001815280602081015b0390f35b6001600160a01b0316803b156103a957836000916107ce9383604051809681958294633c37699760e21b845260048401613371565b03925af19081610806575b506107ef57637101508d60e11b60005260046000fd5b610772600080516020615cff833981519152610745565b80610815600061081b936114f1565b80610fb4565b386107d9565b610843915060203d602011610849575b61083b81836114f1565b81019061335c565b3861073e565b503d610831565b613078565b806108156000610864936114f1565b3861070a565b806108156000610879936114f1565b386106bd565b80610815600061088e936114f1565b38610670565b915093506108ba915060803d6080116108c7575b6108b281836114f1565b8101906131da565b94929050909391386105cb565b503d6108a8565b63a8a168bf60e01b60005260046000fd5b600391506108ec81612910565b14153861055c565b631963d1e760e31b60005260046000fd5b636ec9be1160e01b60005260046000fd5b610931913d8091833e61092981836114f1565b810190613102565b386104f0565b6358c8679f60e01b60005260046000fd5b63559bd01960e01b60005260046000fd5b61097b915060203d602011610981575b61097381836114f1565b810190613060565b38610495565b503d610969565b633b53d1db60e01b60005260046000fd5b600435906001600160e01b0319821682036103a957565b346103a95760203660031901126103a95760206001600160e01b03196109d4610999565b16637965db0b60e01b81149081156109f2575b506040519015158152f35b6301ffc9a760e01b149050386109e7565b6001600160a01b031690565b6001600160a01b038116036103a957565b3590610a2b82610a0f565b565b346103a95760203660031901126103a957600435610a4a81610a0f565b610a52614792565b6001600160a01b03168015610aa857600b80546001600160a01b0319811683179091553391906001600160a01b03167f440ec6c0da0791f6d650579df27149ce4ffc4f4fbf63e9a8bcd45dacdbf338a2600080a4005b63e6c4247b60e01b60005260046000fd5b346103a95760a03660031901126103a9576024356004356044356064356084356001600160401b0381116103a957610af590369060040161037c565b610afd61429d565b610b056142c7565b610b0d614909565b610b1b610460600654610a03565b803b156103a95760405163102d617560e01b81526004810188905260006024820181905290918290604490829084905af1801561085057610f9f575b50610b618361432f565b8315610f8e57848491610b9393610b7a8987868661438a565b610b85600c54610a03565b610b8e816143a4565b614492565b610ba1610460600054610a03565b604051638d34875560e01b81526004810185905290600090829060249082905afa90811561085057600091610f75575b50610bdf6080820151610a03565b61012082015190610bef82612910565b610c0060408401518094898961499a565b610c10610c0c87614a99565b1590565b908115610f61575b50610f5057610c2690614b28565b60046020610c38610460600154610a03565b60405163023b2a9f60e31b815292839182905afa90811561085057600091610f31575b506040516370a0823160e01b81526001600160a01b0391909116929060208180610c88336004830161234f565b0381875afa8015610850578791600091610f12575b50108015610ea9575b610e9857600492610cb987303384614bef565b6020610cc9610460600154610a03565b60405163b1d3354f60e01b815295869182905afa93841561085057600094610e77575b5060405163095ea7b360e01b81526001600160a01b03851660048201526000602482015290602082806044810103816000855af190811561085057610d54956020938a93610e5c575b50600060405180988195829463095ea7b360e01b845260048401613371565b03925af19283156108505786602093610d7692610da696610e41575b506134b5565b93610d85610460600154610a03565b9060006040518096819582946322de8a2d60e01b84528c8c60048601611f4e565b03925af190811561085057600091610e22575b5015610e1157610df27f58c8fcf57870633c97de2da7d6e74c7544b530d15779c0d107edd9933747ec519160405191829133968361334b565b0390a3610dfd614986565b610e05614303565b60405160018152602090f35b63d0806ec760e01b60005260046000fd5b610e3b915060203d6020116109815761097381836114f1565b38610db9565b610e5790863d88116109815761097381836114f1565b610d70565b610e7290853d87116109815761097381836114f1565b610d35565b610e9191945060203d6020116108495761083b81836114f1565b9238610cec565b631e9acf1760e31b60005260046000fd5b50604051636eb1769f60e11b8152336004820152306024820152602081604481875afa8015610850578791600091610ee3575b5010610ca6565b610f05915060203d602011610f0b575b610efd81836114f1565b810190613490565b38610edc565b503d610ef3565b610f2b915060203d602011610f0b57610efd81836114f1565b38610c9d565b610f4a915060203d6020116108495761083b81836114f1565b38610c5b565b6334b110b160e11b60005260046000fd5b6001600160a01b0316331415905038610c18565b610f88913d8091833e61092981836114f1565b38610bd1565b630a0b0d7960e01b60005260046000fd5b806108156000610fae936114f1565b38610b57565b60009103126103a957565b346103a95760003660031901126103a9576020604051600080516020615b1f8339815191528152f35b346103a95760003660031901126103a9576006546040516001600160a01b039091168152602090f35b346103a95760003660031901126103a95760206040517f9792fdc19ab98adfa72ab2fa98d342618c661e01c406979c105b31eda87f5e6f8152f35b346103a95760203660031901126103a957602061106a6004356134c7565b604051908152f35b346103a95760403660031901126103a9576110ab60243560043561109582610a0f565b6110a66110a1826134c7565b6148c1565b615016565b005b346103a95760403660031901126103a9576004356024356110cd81610a0f565b336001600160a01b038216036110e6576110ab9161509c565b63334bd91960e11b60005260046000fd5b346103a95760003660031901126103a9576001546040516001600160a01b039091168152602090f35b346103a95760203660031901126103a957600054604051631e1778ad60e11b8152600480359082015290602090829060249082906001600160a01b03165afa80156108505761079591600091611182575b506040519081529081906020820190565b61119b915060203d602011610f0b57610efd81836114f1565b38611171565b346103a95760403660031901126103a9576004356001600160401b0381116103a9578060040161018060031983360301126103a9576024356001600160401b0381116103a9576111f590369060040161037c565b6111fd61429d565b6112056142c7565b82359261121184614317565b61121e6024860135614317565b61122b6044860135614317565b6112386064860135614317565b61125761125261124b60a48801846134e8565b3691611554565b61512b565b610124850135926112678461432f565b611297611273836151d0565b868584611281600c54610a03565b9361128b856143a4565b6101048c0135946144ca565b6112a5610460600654610a03565b803b156103a9576000604051809263102d617560e01b82528183816112d860048201906000602060408401938281520152565b03925af180156108505761149d575b506112f6610460600054610a03565b604051638d34875560e01b8152600481018790529490600090869060249082905afa94851561085057600095611482575b508451156109055761133c6080860151610a03565b336001600160a01b03909116036108f457611359610c0c87614a99565b610f505760e46004970135604086015195602061137a610460600154610a03565b60405163100c48d360e21b81529a8b9182905afa988915610850576113f4996020986113c695610120956113b694600094611463575b50615262565b01516113c181612910565b61529b565b60006113d6610460600254610a03565b926040519788958694859363121f00ad60e21b855260048501613586565b03925af191821561085057600092611442575b508161142c575b6107958261141a614303565b60405191829182901515815260200190565b610c0c61143891614a99565b610f50573861140e565b61145c91925060203d6020116109815761097381836114f1565b9038611407565b61147b9194508c3d8e11610f0b57610efd81836114f1565b92386113b0565b61149691953d8091833e61092981836114f1565b9338611327565b8061081560006114ac936114f1565b386112e7565b346103a95760003660031901126103a9576004546040516001600160a01b039091168152602090f35b634e487b7160e01b600052604160045260246000fd5b601f909101601f19168101906001600160401b0382119082101761151457604052565b6114db565b60405190610a2b610140836114f1565b60405190610a2b610120836114f1565b6001600160401b03811161151457601f01601f191660200190565b92919261156082611539565b9161156e60405193846114f1565b8294818452818301116103a9578281602093846000960137010152565b60403660031901126103a9576004356115a381610a0f565b6024356001600160401b0381116103a957366023820112156103a9576115d3903690602481600401359101611554565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163081149081156117b7575b506117a657611615614800565b611623610460600754610a03565b6001600160a01b03811615610aa85760206040518092631052504160e01b82528180611652886004830161234f565b03915afa60009181611785575b506117775761166c6132b8565b6308c379a014611701575b60405162461bcd60e51b815260206004820152605160248201527f41646d696e2076616c69646174696f6e206661696c65643a20556e6b6e6f776e60448201527f206572726f7220286c696b656c7920726571756972652866616c73652920696e6064820152702076616c6964617465557067726164652960781b60848201528060a481015b0390fd5b6117096132d6565b806117145750611677565b60405178020b236b4b7103b30b634b230ba34b7b7103330b4b632b21d1603d1b60208201526116fd9161175f908290611751906039830190615302565b03601f1981018352826114f1565b60405162461bcd60e51b8152918291600483016123b4565b15610f8e576110ab91615319565b61179f91925060203d6020116109815761097381836114f1565b903861165f565b63703e46dd60e11b60005260046000fd5b600080516020615bdf833981519152546001600160a01b03161415905038611608565b346103a95760003660031901126103a9577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031630036117a6576020604051600080516020615bdf8339815191528152f35b346103a95760a03660031901126103a9576004356024356064356044356001600160401b0382116103a95761186e602092369060040161037c565b93909160006084359261187f614853565b6118876142c7565b61188f614909565b61189888614317565b6118a18361432f565b6118cc818989886118b3888585615455565b6118be600c54610a03565b6118c7816143a4565b614502565b6118fc6118dd610460600354610a03565b946040519889978896879563544ba5af60e01b87528d6004880161365e565b03925af190811561085057600091611994575b508061192a575b61079590611922614986565b61141a614303565b611938610460600054610a03565b803b156103a957604051637f15208d60e01b8152926000918491829084908290611965906004830161368d565b03925af1918215610850576107959261197f575b50611916565b80610815600061198e936114f1565b38611979565b6119ad915060203d6020116109815761097381836114f1565b3861190f565b346103a95760003660031901126103a957602060ff600080516020615c7f83398151915254166040519015158152f35b346103a95760203660031901126103a957600854604051630bc926dd60e31b8152600480359082015290602090829060249082906001600160a01b03165afa8015610850576107959160009161118257506040519081529081906020820190565b346103a95760c03660031901126103a9576004356024356001600160401b0381116103a957611a7790369060040161037c565b90916044356001600160401b0381116103a957611a9890369060040161037c565b93606435939091906001600160401b0385116103a95761079595611ac3611ad396369060040161037c565b9390926084359560a435976136e8565b6040519081529081906020820190565b9060806003198301126103a957600435916024359160443591606435906001600160401b0382116103a957611b1a9160040161037c565b9091565b346103a957611b2c36611ae3565b611b37949394614853565b611b3f6142c7565b611b47614909565b611b5084614317565b8415610aa857838591611b8a93611b668661432f565b611b71868585615455565b611b7c600c54610a03565b611b85816143a4565b61453a565b611b98610460600354610a03565b803b156103a957611bc493600080946040519687958694859363f2ebd41f60e01b85526004850161338c565b03925af1801561085057611be3575b611bdb614986565b6110ab614303565b806108156000611bf2936114f1565b38611bd3565b60005b838110611c0b5750506000910152565b8181015183820152602001611bfb565b90602091611c3481518092818552858086019101611bf8565b601f01601f1916010190565b602081016020825282518091526040820191602060408360051b8301019401926000915b838310611c7357505050505090565b9091929394602080611c91600193603f198682030187528951611c1b565b97019301930191939290611c64565b346103a95760003660031901126103a957610795611cbc6139a2565b611cc4613a94565b611ccd826139de565b52611cd7816139de565b50611ce0613abc565b611ce982613a01565b52611cf381613a01565b50611cfc613ae4565b611d0582613a11565b52611d0f81613a11565b50611d18613b09565b611d2182613a21565b52611d2b81613a21565b50611d34613b2e565b611d3d82613a31565b52611d4781613a31565b50611d50613b59565b611d5982613a41565b52611d6381613a41565b50611d6c613b7f565b611d7582613a51565b52611d7f81613a51565b50611d88613bb1565b611d9182613a61565b52611d9b81613a61565b50611da4613bda565b611dad82613a72565b52611db781613a72565b50611dc0613c04565b611dc982613a83565b52611dd381613a83565b5060405191829182611c40565b346103a95760603660031901126103a957611df9610999565b6044356024356001600160401b0382116103a957611e1d602092369060040161037c565b600c54604051636b80155f60e01b81529586946001600160a01b039092169385938493611e509391929160048601613c32565b03915afa80156108505761079591600091611e79575b5060405191829182901515815260200190565b611e92915060203d6020116109815761097381836114f1565b38611e66565b346103a95760003660031901126103a9576005546040516001600160a01b039091168152602090f35b346103a95760003660031901126103a9576020604051600080516020615cbf8339815191528152f35b9080601f830112156103a957816020611f0593359101611554565b90565b64ffffffffff8116036103a957565b3590610a2b82611f08565b61ffff8116036103a957565b3590610a2b82611f22565b600811156103a957565b3590610a2b82611f39565b9094939260609260808301968352602083015260408201520152565b346103a95760803660031901126103a9576004356001600160401b0381116103a95761014060031982360301126103a957611fa3611519565b6004820135815260248201356020820152604482013560408201526064820135906001600160401b0382116103a95761205161012461079594611fef6120679560043691840101611eea565b606085015261200060848201610a20565b608085015261201160a48201611f17565b60a085015261202260c48201611f17565b60c085015261203360e48201611f2e565b60e08501526120456101048201611f17565b61010085015201611f43565b6101208201526024356044359060643592613c57565b9060409492945194859485611f4e565b346103a95760e03660031901126103a95760043561209481610a0f565b602435906120a182610a0f565b604435916120ae83610a0f565b6064356120ba81610a0f565b608435916120c783610a0f565b60a435916120d483610a0f565b60c435946120e186610a0f565b6120e9614792565b6120f28161572c565b6120fb8361572c565b6121048761572c565b61210d8261572c565b6121168561572c565b61211f8461572c565b6121288661572c565b612136610460600754610a03565b91823b156103a957604051638ffee9cd60e01b81526001600160a01b038381166004830152858116602483015289811660448301528281166064830152878116608483015286811660a4830152881660c482015295928660e4815a6000948591f191821561085057612220986121da612204966121cc6121e8946122129b6121f698612251575b506001600160a01b03166133a2565b6001600160a01b03166133c4565b6001600160a01b03166133e6565b6001600160a01b0316613408565b6001600160a01b031661342a565b6001600160a01b031661344c565b6001600160a01b031661346e565b6040516007815233907fc5ec6eb3c84a615de1792ae2858fe498e7c3c8e4986fef4ae3cbf1f8d2c68bca90602090a2005b806108156000612260936114f1565b386121bd565b346103a95760403660031901126103a957602060ff6122ab60243560043561228d82610a0f565b600052600080516020615c3f83398151915284526040600020613049565b54166040519015158152f35b346103a95760003660031901126103a95760206040517f75027301df982f5215b4963a854cf9c73219df80cb6acd8f098189c9480c7bbc8152f35b346103a95760003660031901126103a957602060405160008152f35b346103a9576101603660031901126103a957610795611ad361014435610124356101043560e43560c43560a435608435606435604435602435600435613d67565b6001600160a01b03909116815260200190565b346103a95760003660031901126103a957600b546040516001600160a01b039091168152602090f35b346103a95760003660031901126103a9576020604051600080516020615b3f8339815191528152f35b906020611f05928181520190611c1b565b346103a95760003660031901126103a95761079560408051906123e881836114f1565b60058252640352e302e360dc1b602083015251918291602083526020830190611c1b565b346103a9576101603660031901126103a95760443561014435602435600435610124356101043560e43560c43560a4356084356064356001600160401b038a116103a9576107959a61246561141a9b369060040161037c565b9a9099613dca565b346103a95760403660031901126103a95760243560043561248d82611f39565b6001546124b1906124aa90610460906001600160a01b0316610a03565b3314613eed565b6124bc811515613f4c565b6124ca610460600054610a03565b91823b156103a9576124f69260009283604051809681958294637f15208d60e01b8452600484016136d2565b03925af180156108505761250657005b8061081560006110ab936114f1565b346103a9576101403660031901126103a9576110ab60043561253681610a0f565b60243561254281610a0f565b60443561254e81610a0f565b60643561255a81610a0f565b60843561256681610a0f565b60a4359061257382610a0f565b60c4359261258084610a0f565b60e4359461258d86610a0f565b610104359661259b88610a0f565b61012435986125a98a610a0f565b613f8e565b346103a95760203660031901126103a9576004356125ca614792565b6125d381614317565b806000526009602052604060002060ff19815416905533907f81a106317e7bcc4bb0d00469e38615879068b044d72620ca9aec13ad478ccb6c600080a3005b346103a95760403660031901126103a9576110ab60243560043561263582610a0f565b6126416110a1826134c7565b61509c565b346103a95760003660031901126103a9576008546040516001600160a01b039091168152602090f35b346103a9576126da6118fc602061268536611ae3565b93829481989392612694614792565b61269c6142c7565b6126a4614909565b6126ad83614317565b6126b68661432f565b6126c1868585615455565b6126cc600c54610a03565b6126d5816143a4565b614572565b6126e8610460600354610a03565b906000604051809681958294637236934f60e11b84528a6004850161338c565b346103a95761271636611ae3565b61272193929361429d565b6127296142c7565b61273285614317565b821561288c578484916127639361274a848785615455565b612755600c54610a03565b61275e816143a4565b6145aa565b612771610460600054610a03565b604051638d34875560e01b815260048101859052909290600081602481875afa90811561085057600091612871575b508051156128605761012001516127b681612910565b6127bf81612910565b61284f57823b156103a95760006040518094637f15208d60e01b82528183816127eb8a600483016136a4565b03925af1928315610850577f07783f66bb7a1367042849627a0e745b947e50de5c98cd9e436eaf66569f6d1a9361283a575b5061282f60405192839242918461338c565b0390a26110ab614303565b806108156000612849936114f1565b3861281d565b63e047416960e01b60005260046000fd5b637bb0b62160e01b60005260046000fd5b61288691503d806000833e61092981836114f1565b386127a0565b63fbd85bc360e01b60005260046000fd5b346103a95760003660031901126103a9576002546040516001600160a01b039091168152602090f35b346103a95760203660031901126103a9576004356128e381610a0f565b6128eb614792565b6001600160a01b03168015610aa857600c80546001600160a01b031916919091179055005b6008111561291a57565b634e487b7160e01b600052602160045260246000fd5b90600882101561291a5752565b610a2b909291926101008061012083019580518452602081015160208501526040810151604085015260018060a01b03606082015116606085015264ffffffffff60808201511660808501526129a160a082015160a086019064ffffffffff169052565b60c08181015161ffff169085015260e08181015164ffffffffff16908501520151910190612930565b346103a95760203660031901126103a957612a1960006004356129eb61423c565b506129f96104608354610a03565b6040518080958194638d34875560e01b8352600483019190602083019252565b03915afa90811561085057600091612b03575b5080519060208101519060408101516080820151612a4990610a03565b60a083015164ffffffffff1660c084015164ffffffffff169160e0850151612a729061ffff1690565b93610100860151612a879064ffffffffff1690565b95610120015196612a9788612910565b612a9f611529565b988952602089015260408801526001600160a01b0316606087015264ffffffffff16608086015264ffffffffff1660a085015261ffff1660c084015264ffffffffff1660e0830152612af5906101008301614291565b60405161079581928261293d565b612b16913d8091833e61092981836114f1565b38612a2c565b346103a95760203660031901126103a9576004356000526009602052602060ff604060002054166040519015158152f35b60609060031901126103a957600435906024359060443590565b346103a957612b7536612b4d565b919060018060a01b03612b8c610460600154610a03565b1680158015612e80575b8015612e76575b610aa8573303612e6557612bb5610460600054610a03565b92612bbf84610a03565b15610aa857604051638d34875560e01b815260048101849052600081602481885afa90811561085057600091612e4c575b50805115610905576001600160801b038311610f8e5764ffffffffff8211610f8e5760c081015164ffffffffff1694803b156103a9576000604051809263fa5fa16360e01b8252818381612c488a8c6004840161334b565b03925af1801561085057612e37575b508215801590612e2a575b612cfb575b50506000612c9c92612c7c6104608354610a03565b6040518080968194638d34875560e01b8352600483019190602083019252565b03915afa91821561085057600092612cde575b50604082015103610f8e5764ffffffffff612cd360c08293015164ffffffffff1690565b9216911610610f8e57005b612cf49192503d806000833e61092981836114f1565b9038612caf565b604081015115612dbf575b6101209150018051612d1781612910565b612d2081612910565b15908115612da1575b50612d36575b3880612c67565b612d44610460600054610a03565b91823b156103a95760006040518094637f15208d60e01b8252818381612d6d87600483016136bb565b03925af190811561085057612c9c93600092612d8d575b50925050612d2f565b8061081584612d9b936114f1565b38612d84565b6001915051612daf81612910565b612db881612910565b1438612d29565b612dcd610460600054610a03565b803b156103a9576040516390da939b60e01b8152926000918491829084908290612dfb908b6004840161334b565b03925af19182156108505761012092612e15575b50612d06565b806108156000612e24936114f1565b38612e0f565b5060408101511515612c62565b806108156000612e46936114f1565b38612c57565b612e5f913d8091833e61092981836114f1565b38612bf0565b63ea8e4eb560e01b60005260046000fd5b5080331415612b9d565b50612e92610460610460600054610a03565b15612b96565b346103a957612eda6020612eab36612b4d565b60085460405163e7f9caa560e01b81529586946001600160a01b0390921693859384939091906004850161338c565b03915afa90811561085057600091612efb575b506040519015158152602090f35b612f14915060203d6020116109815761097381836114f1565b38612eed565b346103a95760003660031901126103a9576020604051600080516020615c5f8339815191528152f35b346103a95760003660031901126103a9576003546040516001600160a01b039091168152602090f35b346103a95760003660031901126103a9576000546040516001600160a01b039091168152602090f35b346103a95760003660031901126103a9576007546040516001600160a01b039091168152602090f35b346103a95760003660031901126103a957600c546040516001600160a01b039091168152602090f35b346103a95760003660031901126103a957610795604080519061300a81836114f1565b600682526518971817189960d11b602083015251918291602083526020830190611c1b565b6001600160a01b03166000908152600a6020526040902090565b9060018060a01b0316600052602052604060002090565b908160209103126103a9575180151581036103a95790565b6040513d6000823e3d90fd5b6000526009602052604060002090565b81601f820112156103a95780516130aa81611539565b926130b860405194856114f1565b818452602082840101116103a957611f059160208085019101611bf8565b5190610a2b82610a0f565b5190610a2b82611f08565b5190610a2b82611f22565b5190610a2b82611f39565b6020818303126103a9578051906001600160401b0382116103a95701610140818303126103a957613131611519565b9181518352602082015160208401526040820151604084015260608201519160018060401b0383116103a95761316f610120926131d1948301613094565b6060850152613180608082016130d6565b608085015261319160a082016130e1565b60a08501526131a260c082016130e1565b60c08501526131b360e082016130ec565b60e08501526131c561010082016130e1565b610100850152016130f7565b61012082015290565b91908260809103126103a9578151916020810151916060604083015192015190565b90926060929594936080835280516080840152602081015160a0840152604081015160c08401526132a96101206132438684015161014060e08801526101c0870190611c1b565b60808401516001600160a01b03166101008701529260a081015164ffffffffff168683015260c081015164ffffffffff1661014087015260e081015161ffff1661016087015261010081015164ffffffffff1661018087015201516101a0850190612930565b95602083015260408201520152565b60009060033d116132c557565b905060046000803e60005160e01c90565b600060443d10611f05576040513d600319016004823e8051916001600160401b0383113d602485011117613345578183018051909390916001600160401b03831161333d573d8401600319018584016020011161333d5750611f05929101602001906114f1565b949350505050565b92915050565b908152602081019190915260400190565b908160209103126103a95751611f0581610a0f565b6001600160a01b039091168152602081019190915260400190565b6040919493926060820195825260208201520152565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b908160209103126103a9575190565b634e487b7160e01b600052601160045260246000fd5b919082039182116134c257565b61349f565b600052600080516020615c3f83398151915260205260016040600020015490565b903590601e19813603018212156103a957018035906001600160401b0382116103a9576020019181360383136103a957565b9035601e19823603018112156103a9570160208101919035906001600160401b0382116103a95781360383136103a957565b908060209392818452848401376000828201840152601f01601f1916010190565b63ffffffff8116036103a957565b3590610a2b8261356d565b91611f0593919260408152833560408201526020840135606082015260408401356080820152606084013560a0820152608084013560c082015261365161364361016061363c6135ef6135dc60a08a018a61351a565b61018060e08901526101c088019161354c565b60c089013561010087015260e0890135610120870152610100890135610140870152610120890135838701526136296101408a018a61351a565b878303603f19016101808901529061354c565b960161357b565b63ffffffff166101a0830152565b602081850391015261354c565b9695949092608094926136889489526020890152604088015260a0606088015260a087019161354c565b930152565b908152604081019190610a2b906020016005612930565b908152604081019190610a2b906020016001612930565b908152604081019190610a2b906020016002612930565b908152604081019291610a2b9160200190612930565b959697949297939091936136fa6142c7565b61370261429d565b33600052600a6020526040600020544311156109885761373981613727368887611554565b61373236868e611554565b908a61546f565b80156109485761374d610460600454610a03565b604051634977ff8b60e11b81526004810183905290602090829060249082905afa908115610850576000916138ed575b501561094857613791610460600054610a03565b604051631e1778ad60e11b8152600481018990529096906020816024818b5afa908115610850576000916138ce575b506138bd576137d0600b54610a03565b6001600160a01b03811615610aa857868b868b6138158e8b8a6137f761046060209a610a03565b966040519a8b998a98899863728e8bbb60e01b8a5260048a0161390c565b03915afa9081156108505760009161389e575b5015610f8e57602097600094613857936040519b8c9a8b998a986306f4597160e21b8a52339260048b01613952565b03925af19081156108505760009161387f575b50436138753361302f565b5590610a2b614303565b613898915060203d602011610f0b57610efd81836114f1565b3861386a565b6138b7915060203d6020116109815761097381836114f1565b38613828565b630dd1bc8b60e31b60005260046000fd5b6138e7915060203d602011610f0b57610efd81836114f1565b386137c0565b613906915060203d6020116109815761097381836114f1565b3861377d565b969490611f059896926139449594613931928a5260a060208b015260a08a019161354c565b926040880152868303606088015261354c565b92608081850391015261354c565b99989793919461397a60a098966139949560c08e6136889b968152816020820152019161354c565b926001808a1b031660408c01528a830360608c015261354c565b91878303608089015261354c565b60405161016091906139b483826114f1565b600a815291601f19018260005b8281106139cd57505050565b8060606020809385010152016139c1565b8051156139eb5760200190565b634e487b7160e01b600052603260045260246000fd5b8051600110156139eb5760400190565b8051600210156139eb5760600190565b8051600310156139eb5760800190565b8051600410156139eb5760a00190565b8051600510156139eb5760c00190565b8051600610156139eb5760e00190565b8051600710156139eb576101000190565b8051600810156139eb576101200190565b8051600910156139eb576101400190565b60405190613aa36040836114f1565b600a8252691c1bdcda5d1a5bdb925960b21b6020830152565b60405190613acb6040836114f1565b600a8252691b5a5b9d105b5bdd5b9d60b21b6020830152565b60405190613af36040836114f1565b60078252666d696e7446656560c81b6020830152565b60405190613b186040836114f1565b60078252661b995dd119589d60ca1b6020830152565b60405190613b3d6040836114f1565b600d82526c1b995dd0dbdb1b185d195c985b609a1b6020830152565b60405190613b686040836114f1565b6008825267627463507269636560c01b6020830152565b60405190613b8e6040836114f1565b60148252730c2eae8d0dee4d2f4cac8a6e0cadcc8e690c2e6d60631b6020830152565b60405190613bc06040836114f1565b600b82526a0eac6c888cac4e890c2e6d60ab1b6020830152565b60405190613be96040836114f1565b600c82526b0c6dedce8e4c2c6e890c2e6d60a31b6020830152565b60405190613c136040836114f1565b601082526f07175616e74756d54696d657374616d760841b6020830152565b611f05949260609263ffffffff60e01b1682526020820152816040820152019161354c565b9192303303612e6557610120830160028151613c7281612910565b613c7b81612910565b14613d39575b600c8303613d2a576301e13380905b613caf82613caa61052461010089015164ffffffffff1690565b614704565b91613cc3613cbd42856134b5565b9161472b565b10613d195760039051613cd581612910565b613cde81612910565b14613d0c575b50613d0693613cf4600454610a03565b92613d00600154610a03565b94615562565b90919293565b421015613d195738613ce4565b6309116a8160e11b60005260046000fd5b613d3383614711565b90613c90565b613d4f61052461010086015164ffffffffff1690565b421115613c815763088502f160e21b60005260046000fd5b99979593919896949290986040519960208b019b8c5260408b015260608a0152608089015260a088015260c087015260e08601526101008501526101208401526101408301526101608201526101608152613dc4610180826114f1565b51902090565b949a999590969198929a979397613ddf61429d565b613de76142c7565b613def614909565b8315610f8e57613e3d848760209d8f9a613e248f8f9d8f9e60009f928893613ea09f8c908f8f613e1e8461432f565b8c61576b565b613e2f600c54610a03565b613e38816143a4565b6145e2565b613e4b610460600154610a03565b986040519c8d9b8c9a8b9963ee3448f960e01b8b5260048b0195926101009794919a9998959261012088019b8852602088015260408701526060860152608085015260a084015260c083015260e08201520152565b03925af190811561085057600091613ece575b5015610f8e57613ec1614986565b613ec9614303565b600190565b613ee7915060203d6020116109815761097381836114f1565b38613eb3565b15613ef457565b60405162461bcd60e51b815260206004820152602a60248201527f4f6e6c79206c6f616e206f7065726174696f6e73206d616e616765722063616e6044820152692063616c6c207468697360b01b6064820152608490fd5b15613f5357565b60405162461bcd60e51b8152602060048201526013602482015272125b9d985b1a59081c1bdcda5d1a5bdb881251606a1b6044820152606490fd5b97959391989694929098600080516020615cdf8339815191525499613fb960ff8c60401c1615151590565b9a6001600160401b0316801590816140a9575b600114908161409f575b159081614096575b5061408557600080516020615cdf83398151915280546001600160401b0319166001179055614011998b614060576140b1565b61401757565b600080516020615cdf833981519152805460ff60401b19169055604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a1565b600080516020615cdf833981519152805460ff60401b1916600160401b1790556140b1565b63f92ee8a960e01b60005260046000fd5b90501538613fde565b303b159150613fd6565b8c9150613fcc565b989793929896919094966140c3615a16565b6140cb6157e7565b6140d3615a16565b6140db615a16565b6140e3615a44565b6001600160a01b0316948515610aa8576001600160a01b0316908115610aa8576001600160a01b0316988915610aa8576001600160a01b0316928315610aa8576001600160a01b0316968715610aa8576001600160a01b0316958615610aa8576001600160a01b0316918215610aa8576001600160a01b0316938415610aa8576001600160a01b0316958615610aa8576001600160a01b03891615610aa8576141be61420c986141b96141c8966141b46142399e6141af6141c3986141aa6141ea9e6133a2565b6133c4565b6133e6565b613408565b61342a565b61344c565b61346e565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b61421581614c89565b5061421f81614d22565b5061422981614ddf565b5061423381614e9c565b50614f59565b50565b6040519061012082016001600160401b03811183821017611514576040526000610100838281528260208201528260408201528260608201528260808201528260a08201528260c08201528260e08201520152565b600882101561291a5752565b60ff600080516020615c7f83398151915254166142b657565b63d93c066560e01b60005260046000fd5b6002600080516020615c9f83398151915254146142f2576002600080516020615c9f83398151915255565b633ee5aeb560e01b60005260046000fd5b6001600080516020615c9f83398151915255565b1561431e57565b6379ec0ed760e11b60005260046000fd5b8015801561437c575b801561436d575b6143465750565b6382d6282f60e01b60005260045264e8d4a51000602452655af3107a400060445260646000fd5b50655af3107a4000811161433f565b5064e8d4a510008110614338565b9290611751613dc492604051948593602085019788611f4e565b6001600160a01b0316156143b457565b639cef199b60e01b60005260046000fd5b604051636b80155f60e01b81526001600160a01b0390911695939092602092849283926143fd9263018af30960e01b60048601613c32565b0381875afa90811561085057600091614473575b501561446257823b156103a9576144429260009283604051809681958294630e62cc9360e21b84526004840161334b565b03925af18015610850576144535750565b806108156000610a2b936114f1565b636227817160e01b60005260046000fd5b61448c915060203d6020116109815761097381836114f1565b38614411565b604051636b80155f60e01b81526001600160a01b0390911695939092602092849283926143fd926304e9585760e11b60048601613c32565b604051636b80155f60e01b81526001600160a01b0390911695939092602092849283926143fd9263121f00ad60e21b60048601613c32565b604051636b80155f60e01b81526001600160a01b0390911695939092602092849283926143fd9263544ba5af60e01b60048601613c32565b604051636b80155f60e01b81526001600160a01b0390911695939092602092849283926143fd926318eea33b60e21b60048601613c32565b604051636b80155f60e01b81526001600160a01b0390911695939092602092849283926143fd92636b40812160e11b60048601613c32565b604051636b80155f60e01b81526001600160a01b0390911695939092602092849283926143fd92630d7d9f4b60e41b60048601613c32565b604051636b80155f60e01b81526001600160a01b0390911695939092602092849283926143fd92632c545d9960e21b60048601613c32565b604051634911e9cd60e01b8152600481019190915291926001600160a01b0316602083602481845afa928315610850576000936146dc575b50604051630180d64960e11b8152600481019290925260209082908180602481015b03915afa908115610850576000916146bd575b50808211156146b357614699916134b5565b905b036146a257565b63896492f560e01b60005260046000fd5b505060009061469b565b6146d6915060203d602011610f0b57610efd81836114f1565b38614687565b6020919350916146fb61467493833d8511610f0b57610efd81836114f1565b93915091614652565b919082018092116134c257565b9062278d0082029180830462278d0014901517156134c257565b908160011b91808304600214901517156134c257565b818102929181159184041417156134c257565b90600c81146147805762278d0081029080820462278d0014901517156134c25781018091116134c25790565b506301e1338081018091116134c25790565b600080516020615cbf833981519152600052600080516020615c3f83398151915260205260ff6147d033600080516020615b7f833981519152613049565b5416156147d957565b63e2517d3f60e01b60005233600452600080516020615cbf83398151915260245260446000fd5b60008052600080516020615c3f83398151915260205260ff61483033600080516020615bbf833981519152613049565b54161561483957565b63e2517d3f60e01b60005233600452600060245260446000fd5b600080516020615b1f833981519152600052600080516020615c3f83398151915260205260ff61489133600080516020615c1f833981519152613049565b54161561489a57565b63e2517d3f60e01b60005233600452600080516020615b1f83398151915260245260446000fd5b80600052600080516020615c3f83398151915260205260ff6148e7336040600020613049565b5416156148f15750565b63e2517d3f60e01b6000523360045260245260446000fd5b6002600080516020615b5f8339815191525414614934576002600080516020615b5f83398151915255565b60405162461bcd60e51b8152602060048201526024808201527f476c6f62616c5265656e7472616e637947756172643a207265656e7472616e746044820152640818d85b1b60da1b6064820152608490fd5b6001600080516020615b5f83398151915255565b91909115613f53578115614a43575115614a0457116149b557565b60405162461bcd60e51b815260206004820152602160248201527f5061796d656e7420616d6f756e74206578636565647320746f74616c206465626044820152601d60fa1b6064820152608490fd5b60405162461bcd60e51b8152602060048201526017602482015276141bdcda5d1a5bdb88191bd95cc81b9bdd08195e1a5cdd604a1b6044820152606490fd5b60405162461bcd60e51b815260206004820152602860248201527f5061796d656e7420616d6f756e74206d7573742062652067726561746572207460448201526768616e207a65726f60c01b6064820152608490fd5b60008054604051638d34875560e01b815260048101849052929190839060249082906001600160a01b03165afa91821561085057600092614b0b575b5081511490811591614aec575b50610f8e57600190565b608001516001600160a01b039150614b0390610a03565b161538614ae2565b614b219192503d806000833e61092981836114f1565b9038614ad5565b614b3181612910565b60018114159081614bd9575b81614bc3575b81614bae575b50614b5057565b60405162461bcd60e51b815260206004820152603060248201527f506f736974696f6e20737461747573206e6f7420656c696769626c6520666f7260448201526f081c185c9d1a585b081c185e5b595b9d60821b6064820152608490fd5b60049150614bbb81612910565b141538614b49565b9050614bce81612910565b600381141590614b43565b9050614be481612910565b600281141590614b3d565b6040516323b872dd60e01b60208083019182526001600160a01b0394851660248401529490931660448201526064808201959095529384529260009190614c376084826114f1565b519082855af115613078576000513d614c8057506001600160a01b0381163b155b614c5f5750565b635274afe760e01b60009081526001600160a01b0391909116600452602490fd5b60011415614c58565b60008052600080516020615c3f83398151915260205260ff614cb982600080516020615bbf833981519152613049565b5416614d1c5760008052600080516020615c3f833981519152602052614ced81600080516020615bbf833981519152613049565b805460ff1916600117905533906001600160a01b03166000600080516020615aff8339815191528180a4600190565b50600090565b600080516020615b1f833981519152600052600080516020615c3f83398151915260205260ff614d6082600080516020615c1f833981519152613049565b5416614d1c57600080516020615b1f833981519152600052600080516020615c3f833981519152602052614da281600080516020615c1f833981519152613049565b805460ff1916600117905533906001600160a01b0316600080516020615b1f833981519152600080516020615aff833981519152600080a4600190565b600080516020615cbf833981519152600052600080516020615c3f83398151915260205260ff614e1d82600080516020615b7f833981519152613049565b5416614d1c57600080516020615cbf833981519152600052600080516020615c3f833981519152602052614e5f81600080516020615b7f833981519152613049565b805460ff1916600117905533906001600160a01b0316600080516020615cbf833981519152600080516020615aff833981519152600080a4600190565b600080516020615c5f833981519152600052600080516020615c3f83398151915260205260ff614eda82600080516020615bff833981519152613049565b5416614d1c57600080516020615c5f833981519152600052600080516020615c3f833981519152602052614f1c81600080516020615bff833981519152613049565b805460ff1916600117905533906001600160a01b0316600080516020615c5f833981519152600080516020615aff833981519152600080a4600190565b600080516020615b3f833981519152600052600080516020615c3f83398151915260205260ff614f9782600080516020615b9f833981519152613049565b5416614d1c57600080516020615b3f833981519152600052600080516020615c3f833981519152602052614fd981600080516020615b9f833981519152613049565b805460ff1916600117905533906001600160a01b0316600080516020615b3f833981519152600080516020615aff833981519152600080a4600190565b80600052600080516020615c3f83398151915260205260ff61503c836040600020613049565b54166150955780600052600080516020615c3f833981519152602052615066826040600020613049565b805460ff1916600117905533916001600160a01b031690600080516020615aff833981519152600080a4600190565b5050600090565b80600052600080516020615c3f83398151915260205260ff6150c2836040600020613049565b5416156150955780600052600080516020615c3f8339815191526020526150ed826040600020613049565b805460ff1916905533916001600160a01b0316907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b600080a4600190565b8051156151355750565b60405163df70480560e01b8152602060048201529081906116fd906024830190611c1b565b9c9798939d9e9d60a08e6151c99c976101609f9a949363ffffffff9f9a96976151a498610180968552602085015260408401526060830152608082015201526101808d019161354c565b9560c08b015260e08a015261010089015261012088015286830361014088015261354c565b9416910152565b803560208201359060408301359260608101359060808101359060a081016151f890826134e8565b60c083013560e0840135906101008501359261012086013594610140870161522090886134e8565b9890976101600135996152328b61356d565b6040519d8e9d60208f019d6152469e61515a565b03601f198101825261525890826114f1565b8051906020012090565b91909181156152955761527d92615278916157f7565b6158a6565b1061528457565b635e31938360e11b60005260046000fd5b50505050565b600881101561291a5780151590816152ec575b816152d6575b816152c1575b5061284f57565b600691506152ce81612910565b1415386152ba565b90506152e181612910565b6002811415906152b4565b90506152f781612910565b6001811415906152ae565b9061531560209282815194859201611bf8565b0190565b6040516352d1902d60e01b81529091906020816004816001600160a01b0387165afa60009181615434575b5061536757634c9c8ce360e01b6000526001600160a01b03831660045260246000fd5b600080516020615bdf83398151915281036154205750813b156153fe57600080516020615bdf83398151915280546001600160a01b0319166001600160a01b0384169081179091557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a28051156153e45761423991615a5b565b5050346153ed57565b63b398979f60e01b60005260046000fd5b50634c9c8ce360e01b60009081526001600160a01b0391909116600452602490fd5b632a87526960e21b60005260045260246000fd5b61544e91925060203d602011610f0b57610efd81836114f1565b9038615344565b9190613dc49061175160405193849260208401968761338c565b61547890614317565b8051156154f55760409051106154b9576154919061512b565b801561549a5750565b6304a45adb60e51b600052600452600160245260001960445260646000fd5b60405163df70480560e01b815260206004820152601360248201527214da59db985d1d5c99481d1bdbc81cda1bdc9d606a1b6044820152606490fd5b60405163df70480560e01b815260206004820152600f60248201526e456d707479207369676e617475726560881b6044820152606490fd5b51906001600160581b03821682036103a957565b91908260409103126103a957611f05602061555b8461552d565b930161552d565b604080516353f366c760e01b815260048101849052939794969195849060249082906001600160a01b03165afa928315610850576000936156f9575b5060408501805190936155db916155be916001600160581b031690615931565b976155ca8986516159a3565b976155d68983836159c8565b6157f7565b925160405163100c48d360e21b81526001600160a01b039092169190602082600481865afa9081156108505761561a926000926156d8575b50856159fa565b6156c75760206004916040519283809263100c48d360e21b82525afa801561085057615650916000916156a8575b5086846159fa565b61569757613caa61567360e06156698861567a966158a6565b96015161ffff1690565b61ffff1690565b9061ffff821161568657565b6319a4c60960e21b60005260046000fd5b631300e8bd60e21b60005260046000fd5b6156c1915060203d602011610f0b57610efd81836114f1565b38615648565b63e5cace4160e01b60005260046000fd5b6156f291925060203d602011610f0b57610efd81836114f1565b9038615613565b61571c91935060403d604011615725575b61571481836114f1565b810190615541565b9050913861559e565b503d61570a565b6001600160a01b03811690811561575a573b156157465750565b630fb15bad60e11b60005260045260246000fd5b63d92e233d60e01b60005260046000fd5b9896919497909392956040519860208a019a7ffa8f74e09e937f69ff6ed56ad5685b576507504860024ea40564c0432ff8034a8c5260408b015260608a0152608089015260a088015260c087015260e08601526101008501526101208401526101408301526101608201526101608152613dc4610180826114f1565b6157ef615a16565b614303615a16565b90660775f05a0740008211615895576a52b7d2dcc80cd2e4000000811161588457811580159081615858575b506158475761583191614741565b6064810290808204606414901517156134c25790565b63450d49cd60e01b60005260046000fd5b905061586e576064826000190404811138615823565b634e487b7160e01b600052601260045260246000fd5b63128df78360e01b60005260046000fd5b63e9ec682160e01b60005260046000fd5b81156159205768327cb2734119d3b7a9601e1b811161590f577e068db8bac710cb295e9e1b089a027525460aa64c2f837b4a2339c0ebedfa4381116158fe5761271081029080820461271014901517156134c2570490565b633da428df60e21b60005260046000fd5b638a94304d60e01b60005260046000fd5b6323d359a360e01b60005260046000fd5b68327cb2734119d3b7a9601e1b811161590f5761271082116159925780158015908161597f575b5061596e576127109161596a91614741565b0490565b6340c0d6e560e11b60005260046000fd5b905061586e578060001904821138615958565b637186728f60e11b60005260046000fd5b908101908181116134c25781106159b75790565b636be580af60e11b60005260046000fd5b660775f05a07400010615895576a52b7d2dcc80cd2e4000000106158845768327cb2734119d3b7a9601e1b1061590f57565b908015615a0e57615a0a916158a6565b1090565b505050600090565b60ff600080516020615cdf8339815191525460401c1615615a3357565b631afcd79f60e31b60005260046000fd5b600080516020615b5f833981519152541561498657565b600080611f0593602081519101845af43d15615a99573d91615a7c83611539565b92615a8a60405194856114f1565b83523d6000602085013e615a9d565b6060915b90615ac35750805115615ab257602081519101fd5b63d6bda27560e01b60005260046000fd5b81511580615af5575b615ad4575090565b639996b31560e01b60009081526001600160a01b0391909116600452602490fd5b50803b15615acc56fe2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d5e17fc5225d4a099df75359ce1f405503ca79498a8dc46a7d583235a0ee45c16f4a222f146e17d7057e96450fc67f08ce8569fd5cf3b62a23983c4f4b9e497f35cd165352ca420415a2423a5a15f077145431fc21aec9b84cb1b8800541a5c26b16e88c42fd4e48df2dd6a2eabd6bc9aec654ec170056b470819f8892cc6431c1b3eac282bb4080c159156c6faa9df237c5a80b4a568c4661ea2010de1eb2caeb7db2dd08fcb62d0c9e08c51941cae53c267786a0b75803fb7960902fc8ef97d360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbccd6c996ba66d0dbb3c38dbaaac7d192f7d41593dd02b55a9147053192322b1d3b615dc3ea5d9654acb949989a0a9587a0da8cd03451c0368cc676ec7c08dd81402dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b6268004ad5455c7a5edb25c14b61cc4d6429153aab5507800334ac05d65e9828801bf3cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033009b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00aaae1071a267a66db1d9c0714498307791bc0f693f5b254c861d95ca60503b6da2646970667358221220bf923774eda538ae7e572ed34d44d75ffa44665884eb85128bc0d128090cf31a64736f6c634300081c0033";
|
|
38799
38871
|
var isSuperArgs = (xs) => xs.length > 1;
|
|
38800
38872
|
var PositionManager__factory = class extends ContractFactory2 {
|
|
38801
38873
|
constructor(...args) {
|
|
@@ -39373,6 +39445,26 @@ var _abi3 = [
|
|
|
39373
39445
|
internalType: "bytes32",
|
|
39374
39446
|
name: "positionId",
|
|
39375
39447
|
type: "bytes32"
|
|
39448
|
+
},
|
|
39449
|
+
{
|
|
39450
|
+
internalType: "uint256",
|
|
39451
|
+
name: "quantumTimestamp",
|
|
39452
|
+
type: "uint256"
|
|
39453
|
+
},
|
|
39454
|
+
{
|
|
39455
|
+
internalType: "uint256",
|
|
39456
|
+
name: "btcPrice",
|
|
39457
|
+
type: "uint256"
|
|
39458
|
+
},
|
|
39459
|
+
{
|
|
39460
|
+
internalType: "uint256",
|
|
39461
|
+
name: "btcAmountSats",
|
|
39462
|
+
type: "uint256"
|
|
39463
|
+
},
|
|
39464
|
+
{
|
|
39465
|
+
internalType: "bytes",
|
|
39466
|
+
name: "liquidationValidatorSignature",
|
|
39467
|
+
type: "bytes"
|
|
39376
39468
|
}
|
|
39377
39469
|
],
|
|
39378
39470
|
name: "calculateLiquidationBonus",
|
|
@@ -39383,7 +39475,7 @@ var _abi3 = [
|
|
|
39383
39475
|
type: "uint256"
|
|
39384
39476
|
}
|
|
39385
39477
|
],
|
|
39386
|
-
stateMutability: "
|
|
39478
|
+
stateMutability: "nonpayable",
|
|
39387
39479
|
type: "function"
|
|
39388
39480
|
},
|
|
39389
39481
|
{
|
|
@@ -39394,9 +39486,14 @@ var _abi3 = [
|
|
|
39394
39486
|
type: "bytes32"
|
|
39395
39487
|
},
|
|
39396
39488
|
{
|
|
39397
|
-
internalType: "
|
|
39398
|
-
name: "
|
|
39399
|
-
type: "
|
|
39489
|
+
internalType: "uint256",
|
|
39490
|
+
name: "quantumTimestamp",
|
|
39491
|
+
type: "uint256"
|
|
39492
|
+
},
|
|
39493
|
+
{
|
|
39494
|
+
internalType: "uint256",
|
|
39495
|
+
name: "btcPrice",
|
|
39496
|
+
type: "uint256"
|
|
39400
39497
|
}
|
|
39401
39498
|
],
|
|
39402
39499
|
name: "commitLiquidation",
|
|
@@ -39410,6 +39507,21 @@ var _abi3 = [
|
|
|
39410
39507
|
internalType: "bytes32",
|
|
39411
39508
|
name: "positionId",
|
|
39412
39509
|
type: "bytes32"
|
|
39510
|
+
},
|
|
39511
|
+
{
|
|
39512
|
+
internalType: "uint256",
|
|
39513
|
+
name: "btcPrice",
|
|
39514
|
+
type: "uint256"
|
|
39515
|
+
},
|
|
39516
|
+
{
|
|
39517
|
+
internalType: "uint256",
|
|
39518
|
+
name: "quantumTimestamp",
|
|
39519
|
+
type: "uint256"
|
|
39520
|
+
},
|
|
39521
|
+
{
|
|
39522
|
+
internalType: "bytes",
|
|
39523
|
+
name: "liquidationValidatorSignature",
|
|
39524
|
+
type: "bytes"
|
|
39413
39525
|
}
|
|
39414
39526
|
],
|
|
39415
39527
|
name: "isLiquidatable",
|
|
@@ -39420,7 +39532,7 @@ var _abi3 = [
|
|
|
39420
39532
|
type: "bool"
|
|
39421
39533
|
}
|
|
39422
39534
|
],
|
|
39423
|
-
stateMutability: "
|
|
39535
|
+
stateMutability: "nonpayable",
|
|
39424
39536
|
type: "function"
|
|
39425
39537
|
},
|
|
39426
39538
|
{
|
|
@@ -39429,6 +39541,16 @@ var _abi3 = [
|
|
|
39429
39541
|
internalType: "bytes32",
|
|
39430
39542
|
name: "positionId",
|
|
39431
39543
|
type: "bytes32"
|
|
39544
|
+
},
|
|
39545
|
+
{
|
|
39546
|
+
internalType: "uint256",
|
|
39547
|
+
name: "btcPrice",
|
|
39548
|
+
type: "uint256"
|
|
39549
|
+
},
|
|
39550
|
+
{
|
|
39551
|
+
internalType: "uint256",
|
|
39552
|
+
name: "quantumTimestamp",
|
|
39553
|
+
type: "uint256"
|
|
39432
39554
|
}
|
|
39433
39555
|
],
|
|
39434
39556
|
name: "liquidatePosition",
|
|
@@ -39451,9 +39573,19 @@ var _abi3 = [
|
|
|
39451
39573
|
},
|
|
39452
39574
|
{
|
|
39453
39575
|
internalType: "uint256",
|
|
39454
|
-
name: "
|
|
39576
|
+
name: "quantumTimestamp",
|
|
39455
39577
|
type: "uint256"
|
|
39456
39578
|
},
|
|
39579
|
+
{
|
|
39580
|
+
internalType: "uint256",
|
|
39581
|
+
name: "btcPrice",
|
|
39582
|
+
type: "uint256"
|
|
39583
|
+
},
|
|
39584
|
+
{
|
|
39585
|
+
internalType: "bytes",
|
|
39586
|
+
name: "liquidationValidatorSignature",
|
|
39587
|
+
type: "bytes"
|
|
39588
|
+
},
|
|
39457
39589
|
{
|
|
39458
39590
|
internalType: "uint256",
|
|
39459
39591
|
name: "deadline",
|
|
@@ -39637,6 +39769,11 @@ var _abi4 = [
|
|
|
39637
39769
|
internalType: "bytes32",
|
|
39638
39770
|
name: "positionId",
|
|
39639
39771
|
type: "bytes32"
|
|
39772
|
+
},
|
|
39773
|
+
{
|
|
39774
|
+
internalType: "uint256",
|
|
39775
|
+
name: "btcPrice",
|
|
39776
|
+
type: "uint256"
|
|
39640
39777
|
}
|
|
39641
39778
|
],
|
|
39642
39779
|
name: "calculateCollateralRatio",
|
|
@@ -39652,7 +39789,7 @@ var _abi4 = [
|
|
|
39652
39789
|
},
|
|
39653
39790
|
{
|
|
39654
39791
|
inputs: [],
|
|
39655
|
-
name: "
|
|
39792
|
+
name: "getOriginationFeeBalance",
|
|
39656
39793
|
outputs: [
|
|
39657
39794
|
{
|
|
39658
39795
|
internalType: "uint256",
|
|
@@ -39664,8 +39801,14 @@ var _abi4 = [
|
|
|
39664
39801
|
type: "function"
|
|
39665
39802
|
},
|
|
39666
39803
|
{
|
|
39667
|
-
inputs: [
|
|
39668
|
-
|
|
39804
|
+
inputs: [
|
|
39805
|
+
{
|
|
39806
|
+
internalType: "bytes32",
|
|
39807
|
+
name: "pkpId",
|
|
39808
|
+
type: "bytes32"
|
|
39809
|
+
}
|
|
39810
|
+
],
|
|
39811
|
+
name: "getPKPActualCollateral",
|
|
39669
39812
|
outputs: [
|
|
39670
39813
|
{
|
|
39671
39814
|
internalType: "uint256",
|
|
@@ -39680,11 +39823,11 @@ var _abi4 = [
|
|
|
39680
39823
|
inputs: [
|
|
39681
39824
|
{
|
|
39682
39825
|
internalType: "bytes32",
|
|
39683
|
-
name: "
|
|
39826
|
+
name: "positionId",
|
|
39684
39827
|
type: "bytes32"
|
|
39685
39828
|
}
|
|
39686
39829
|
],
|
|
39687
|
-
name: "
|
|
39830
|
+
name: "getTotalAuthorizedSats",
|
|
39688
39831
|
outputs: [
|
|
39689
39832
|
{
|
|
39690
39833
|
internalType: "uint256",
|
|
@@ -39797,15 +39940,15 @@ var _abi4 = [
|
|
|
39797
39940
|
name: "authorizedSpendsHash",
|
|
39798
39941
|
type: "bytes32"
|
|
39799
39942
|
},
|
|
39943
|
+
{
|
|
39944
|
+
internalType: "bytes32",
|
|
39945
|
+
name: "ucdDebtHash",
|
|
39946
|
+
type: "bytes32"
|
|
39947
|
+
},
|
|
39800
39948
|
{
|
|
39801
39949
|
internalType: "uint256",
|
|
39802
39950
|
name: "quantumTimestamp",
|
|
39803
39951
|
type: "uint256"
|
|
39804
|
-
},
|
|
39805
|
-
{
|
|
39806
|
-
internalType: "bytes",
|
|
39807
|
-
name: "mintValidatorSignature",
|
|
39808
|
-
type: "bytes"
|
|
39809
39952
|
}
|
|
39810
39953
|
],
|
|
39811
39954
|
name: "mintUCD",
|
|
@@ -39830,33 +39973,19 @@ var _abi4 = [
|
|
|
39830
39973
|
internalType: "uint256",
|
|
39831
39974
|
name: "paymentAmount",
|
|
39832
39975
|
type: "uint256"
|
|
39833
|
-
}
|
|
39834
|
-
],
|
|
39835
|
-
name: "processPartialPayment",
|
|
39836
|
-
outputs: [
|
|
39837
|
-
{
|
|
39838
|
-
internalType: "bool",
|
|
39839
|
-
name: "",
|
|
39840
|
-
type: "bool"
|
|
39841
|
-
}
|
|
39842
|
-
],
|
|
39843
|
-
stateMutability: "nonpayable",
|
|
39844
|
-
type: "function"
|
|
39845
|
-
},
|
|
39846
|
-
{
|
|
39847
|
-
inputs: [
|
|
39976
|
+
},
|
|
39848
39977
|
{
|
|
39849
|
-
internalType: "
|
|
39850
|
-
name: "
|
|
39851
|
-
type: "
|
|
39978
|
+
internalType: "uint256",
|
|
39979
|
+
name: "quantumTimestamp",
|
|
39980
|
+
type: "uint256"
|
|
39852
39981
|
},
|
|
39853
39982
|
{
|
|
39854
39983
|
internalType: "uint256",
|
|
39855
|
-
name: "
|
|
39984
|
+
name: "btcPrice",
|
|
39856
39985
|
type: "uint256"
|
|
39857
39986
|
}
|
|
39858
39987
|
],
|
|
39859
|
-
name: "
|
|
39988
|
+
name: "processPayment",
|
|
39860
39989
|
outputs: [
|
|
39861
39990
|
{
|
|
39862
39991
|
internalType: "bool",
|
|
@@ -39934,6 +40063,21 @@ var _abi4 = [
|
|
|
39934
40063
|
internalType: "uint256",
|
|
39935
40064
|
name: "newDebt",
|
|
39936
40065
|
type: "uint256"
|
|
40066
|
+
},
|
|
40067
|
+
{
|
|
40068
|
+
internalType: "uint256",
|
|
40069
|
+
name: "quantumTimestamp",
|
|
40070
|
+
type: "uint256"
|
|
40071
|
+
},
|
|
40072
|
+
{
|
|
40073
|
+
internalType: "uint256",
|
|
40074
|
+
name: "btcPrice",
|
|
40075
|
+
type: "uint256"
|
|
40076
|
+
},
|
|
40077
|
+
{
|
|
40078
|
+
internalType: "bytes",
|
|
40079
|
+
name: "updateValidatorSignature",
|
|
40080
|
+
type: "bytes"
|
|
39937
40081
|
}
|
|
39938
40082
|
],
|
|
39939
40083
|
name: "updatePosition",
|
|
@@ -41990,6 +42134,46 @@ function convertEthereumSignatureToBitcoinDER(signature2) {
|
|
|
41990
42134
|
return Buffer.from(bip66.encode(r2, s)).toString("hex");
|
|
41991
42135
|
}
|
|
41992
42136
|
|
|
42137
|
+
// src/utils/signature-tempering.utils.ts
|
|
42138
|
+
function temperSignature(signature2) {
|
|
42139
|
+
if (!signature2 || signature2.length < 4) {
|
|
42140
|
+
throw new Error("Invalid signature format for tempering");
|
|
42141
|
+
}
|
|
42142
|
+
if (!signature2.startsWith("0x")) {
|
|
42143
|
+
throw new Error("Signature must start with 0x prefix");
|
|
42144
|
+
}
|
|
42145
|
+
const thirdCharIndex = 2;
|
|
42146
|
+
const originalChar = signature2[thirdCharIndex]?.toLowerCase();
|
|
42147
|
+
if (!originalChar) {
|
|
42148
|
+
throw new Error("Signature too short for tempering");
|
|
42149
|
+
}
|
|
42150
|
+
const hexChars = "0123456789abcdef".split("");
|
|
42151
|
+
const validReplacements = hexChars.filter(
|
|
42152
|
+
(char) => char !== originalChar
|
|
42153
|
+
);
|
|
42154
|
+
const randomIndex = Math.floor(Math.random() * validReplacements.length);
|
|
42155
|
+
const newChar = validReplacements[randomIndex];
|
|
42156
|
+
const tempered = signature2.slice(0, thirdCharIndex) + newChar + signature2.slice(thirdCharIndex + 1);
|
|
42157
|
+
return tempered;
|
|
42158
|
+
}
|
|
42159
|
+
function maybeTemperSignature(signature2, shouldTemper, operationName) {
|
|
42160
|
+
if (!shouldTemper) {
|
|
42161
|
+
return signature2;
|
|
42162
|
+
}
|
|
42163
|
+
const tempered = temperSignature(signature2);
|
|
42164
|
+
if (operationName) {
|
|
42165
|
+
console.warn(
|
|
42166
|
+
`\u26A0\uFE0F [SIGNATURE TEMPERING TEST] ${operationName}: Modified signature character at position 3`
|
|
42167
|
+
);
|
|
42168
|
+
console.warn(` Original (first 20 chars): ${signature2.slice(0, 20)}...`);
|
|
42169
|
+
console.warn(` Tempered (first 20 chars): ${tempered.slice(0, 20)}...`);
|
|
42170
|
+
console.warn(
|
|
42171
|
+
` \u26A0\uFE0F This transaction WILL FAIL - testing signature validation`
|
|
42172
|
+
);
|
|
42173
|
+
}
|
|
42174
|
+
return tempered;
|
|
42175
|
+
}
|
|
42176
|
+
|
|
41993
42177
|
// src/modules/contract/contract-manager.module.ts
|
|
41994
42178
|
var ContractManager = class {
|
|
41995
42179
|
config;
|
|
@@ -42114,7 +42298,6 @@ var ContractManager = class {
|
|
|
42114
42298
|
const requiredAddresses = [
|
|
42115
42299
|
"positionManager",
|
|
42116
42300
|
"ucdToken",
|
|
42117
|
-
"btcProofValidator",
|
|
42118
42301
|
"priceFeedConsumer"
|
|
42119
42302
|
];
|
|
42120
42303
|
const optionalAddresses = [
|
|
@@ -43067,6 +43250,7 @@ function createPKPManager(config) {
|
|
|
43067
43250
|
var LoanCreator = class {
|
|
43068
43251
|
config;
|
|
43069
43252
|
transactionTimeoutMs;
|
|
43253
|
+
pkpValidationRegistryAddressCache;
|
|
43070
43254
|
constructor(config) {
|
|
43071
43255
|
this.config = config;
|
|
43072
43256
|
this.transactionTimeoutMs = config.transactionTimeoutMs || 3e5;
|
|
@@ -43096,7 +43280,54 @@ var LoanCreator = class {
|
|
|
43096
43280
|
if (this.config.debug) {
|
|
43097
43281
|
log.info("\u{1F4DD} Step 1: Creating PKP via LitOps");
|
|
43098
43282
|
}
|
|
43283
|
+
let pkpValidationRegistryAddress;
|
|
43284
|
+
if (this.pkpValidationRegistryAddressCache) {
|
|
43285
|
+
pkpValidationRegistryAddress = this.pkpValidationRegistryAddressCache;
|
|
43286
|
+
} else {
|
|
43287
|
+
const positionManagerResult = this.config.contractManager.getPositionManager();
|
|
43288
|
+
if (!positionManagerResult.success || !positionManagerResult.value) {
|
|
43289
|
+
return failure(
|
|
43290
|
+
new SDKError({
|
|
43291
|
+
message: "Failed to get PositionManager contract",
|
|
43292
|
+
category: "CONTRACT" /* CONTRACT */,
|
|
43293
|
+
severity: "HIGH" /* HIGH */
|
|
43294
|
+
})
|
|
43295
|
+
);
|
|
43296
|
+
}
|
|
43297
|
+
pkpValidationRegistryAddress = await positionManagerResult.value.pkpValidationRegistry();
|
|
43298
|
+
if (!pkpValidationRegistryAddress || pkpValidationRegistryAddress === "0x0000000000000000000000000000000000000000") {
|
|
43299
|
+
return failure(
|
|
43300
|
+
new SDKError({
|
|
43301
|
+
message: "PKPValidationRegistry address not set in PositionManager contract",
|
|
43302
|
+
category: "CONTRACT" /* CONTRACT */,
|
|
43303
|
+
severity: "HIGH" /* HIGH */
|
|
43304
|
+
})
|
|
43305
|
+
);
|
|
43306
|
+
}
|
|
43307
|
+
this.pkpValidationRegistryAddressCache = pkpValidationRegistryAddress;
|
|
43308
|
+
if (this.config.debug) {
|
|
43309
|
+
log.info(`\u2705 Retrieved PKPValidationRegistry from PositionManager: ${pkpValidationRegistryAddress}`);
|
|
43310
|
+
}
|
|
43311
|
+
}
|
|
43099
43312
|
const isServiceMode = this.config.mode === "service";
|
|
43313
|
+
if (isServiceMode && typeof this.config.litOps.updatePkpValidationRegistry === "function") {
|
|
43314
|
+
this.config.litOps.updatePkpValidationRegistry(pkpValidationRegistryAddress);
|
|
43315
|
+
}
|
|
43316
|
+
const { DH_LIT_ACTIONS_DATIL } = await import("@gvnrdao/dh-lit-actions");
|
|
43317
|
+
const certificationCid = DH_LIT_ACTIONS_DATIL.pkpValidator.authorizedCidHex.toLowerCase();
|
|
43318
|
+
if (this.config.debug) {
|
|
43319
|
+
log.info(`\u2705 Using pkpValidator CID for certification: ${certificationCid}`);
|
|
43320
|
+
}
|
|
43321
|
+
if (certificationCid && isServiceMode) {
|
|
43322
|
+
if (typeof this.config.litOps.updateCertificationCid === "function") {
|
|
43323
|
+
this.config.litOps.updateCertificationCid(certificationCid);
|
|
43324
|
+
if (this.config.debug) {
|
|
43325
|
+
log.info(`\u2705 Stored certificationCid in LitOps for validation: ${certificationCid}`);
|
|
43326
|
+
}
|
|
43327
|
+
} else if (this.config.debug) {
|
|
43328
|
+
log.info(`\u26A0\uFE0F LitOps.updateCertificationCid not available (using older lit-ops version)`);
|
|
43329
|
+
}
|
|
43330
|
+
}
|
|
43100
43331
|
if (!isServiceMode && !this.config.litOpsSigner) {
|
|
43101
43332
|
return failure(
|
|
43102
43333
|
new SDKError({
|
|
@@ -43307,10 +43538,15 @@ var LoanCreator = class {
|
|
|
43307
43538
|
BigInt(pkpIdBytes32).toString()
|
|
43308
43539
|
);
|
|
43309
43540
|
console.log("==========================================\n");
|
|
43310
|
-
const validatorVersion = this.config.
|
|
43541
|
+
const validatorVersion = this.config.loanCreationValidatorVersion || 1;
|
|
43542
|
+
const validatorSignature = maybeTemperSignature(
|
|
43543
|
+
pkpData.validatorSignature,
|
|
43544
|
+
this.config.temperSignaturesTest,
|
|
43545
|
+
"createPosition"
|
|
43546
|
+
);
|
|
43311
43547
|
const tx = await positionManager.createPosition(
|
|
43312
43548
|
pkpIdBytes32,
|
|
43313
|
-
|
|
43549
|
+
validatorSignature,
|
|
43314
43550
|
mainnetVaultAddress,
|
|
43315
43551
|
regtestVaultAddress,
|
|
43316
43552
|
request.selectedTerm,
|
|
@@ -43625,7 +43861,9 @@ var LoanQuery = class {
|
|
|
43625
43861
|
// Will be enriched below
|
|
43626
43862
|
}
|
|
43627
43863
|
};
|
|
43628
|
-
const enrichedLoans = await this.enrichLoansWithVaultAddresses([
|
|
43864
|
+
const enrichedLoans = await this.enrichLoansWithVaultAddresses([
|
|
43865
|
+
loanData
|
|
43866
|
+
]);
|
|
43629
43867
|
const enrichedLoan = enrichedLoans[0] || loanData;
|
|
43630
43868
|
if (enrichBalance) {
|
|
43631
43869
|
await this.enrichLoanWithBalance(enrichedLoan);
|
|
@@ -43663,9 +43901,7 @@ var LoanQuery = class {
|
|
|
43663
43901
|
}
|
|
43664
43902
|
return tryCatchAsync(
|
|
43665
43903
|
async () => {
|
|
43666
|
-
const rawLoan = await this.config.graphClient.getDetailedPositionByPkpId(
|
|
43667
|
-
pkpId
|
|
43668
|
-
);
|
|
43904
|
+
const rawLoan = await this.config.graphClient.getDetailedPositionByPkpId(pkpId);
|
|
43669
43905
|
if (!rawLoan) {
|
|
43670
43906
|
return null;
|
|
43671
43907
|
}
|
|
@@ -43693,7 +43929,9 @@ var LoanQuery = class {
|
|
|
43693
43929
|
// Will be enriched below
|
|
43694
43930
|
}
|
|
43695
43931
|
};
|
|
43696
|
-
const enrichedLoans = await this.enrichLoansWithVaultAddresses([
|
|
43932
|
+
const enrichedLoans = await this.enrichLoansWithVaultAddresses([
|
|
43933
|
+
loanData
|
|
43934
|
+
]);
|
|
43697
43935
|
const enrichedLoan = enrichedLoans[0] || loanData;
|
|
43698
43936
|
if (enrichBalance) {
|
|
43699
43937
|
await this.enrichLoanWithBalance(enrichedLoan);
|
|
@@ -43754,7 +43992,9 @@ var LoanQuery = class {
|
|
|
43754
43992
|
skip
|
|
43755
43993
|
);
|
|
43756
43994
|
}
|
|
43757
|
-
const enrichedLoans = await this.enrichLoansWithVaultAddresses(
|
|
43995
|
+
const enrichedLoans = await this.enrichLoansWithVaultAddresses(
|
|
43996
|
+
result.positions
|
|
43997
|
+
);
|
|
43758
43998
|
return {
|
|
43759
43999
|
loans: enrichedLoans,
|
|
43760
44000
|
page,
|
|
@@ -43773,7 +44013,7 @@ var LoanQuery = class {
|
|
|
43773
44013
|
}
|
|
43774
44014
|
/**
|
|
43775
44015
|
* Get loans with BTC balance data from Bitcoin network
|
|
43776
|
-
*
|
|
44016
|
+
*
|
|
43777
44017
|
* Same as getLoans but includes actual Bitcoin balance for each position's vault.
|
|
43778
44018
|
* Queries BTC balances in parallel for performance.
|
|
43779
44019
|
*
|
|
@@ -43787,12 +44027,19 @@ var LoanQuery = class {
|
|
|
43787
44027
|
const skip = page * pageSize;
|
|
43788
44028
|
if (!filters.borrower) {
|
|
43789
44029
|
if (this.config.debug) {
|
|
43790
|
-
log.info(
|
|
44030
|
+
log.info(
|
|
44031
|
+
"\u26A0\uFE0F getLoansWithBtc only supports borrower filter, falling back to getLoans"
|
|
44032
|
+
);
|
|
43791
44033
|
}
|
|
43792
44034
|
return this.getLoans(filters, pagination);
|
|
43793
44035
|
}
|
|
43794
44036
|
if (this.config.debug) {
|
|
43795
|
-
log.info("\u{1F50D} Querying loans with BTC balance data", {
|
|
44037
|
+
log.info("\u{1F50D} Querying loans with BTC balance data", {
|
|
44038
|
+
filters,
|
|
44039
|
+
page,
|
|
44040
|
+
pageSize,
|
|
44041
|
+
skip
|
|
44042
|
+
});
|
|
43796
44043
|
}
|
|
43797
44044
|
return tryCatchAsync(
|
|
43798
44045
|
async () => {
|
|
@@ -43803,7 +44050,9 @@ var LoanQuery = class {
|
|
|
43803
44050
|
filters.orderBy || "createdAt",
|
|
43804
44051
|
filters.orderDirection || "desc"
|
|
43805
44052
|
);
|
|
43806
|
-
const enrichedLoans = await this.enrichLoansWithVaultAddresses(
|
|
44053
|
+
const enrichedLoans = await this.enrichLoansWithVaultAddresses(
|
|
44054
|
+
result.positions
|
|
44055
|
+
);
|
|
43807
44056
|
return {
|
|
43808
44057
|
loans: enrichedLoans,
|
|
43809
44058
|
page,
|
|
@@ -43843,9 +44092,7 @@ var LoanQuery = class {
|
|
|
43843
44092
|
loan.pkpId,
|
|
43844
44093
|
this.config.provider
|
|
43845
44094
|
);
|
|
43846
|
-
const addressesResult = await this.config.bitcoinOperations.deriveAddresses(
|
|
43847
|
-
pkpPublicKey
|
|
43848
|
-
);
|
|
44095
|
+
const addressesResult = await this.config.bitcoinOperations.deriveAddresses(pkpPublicKey);
|
|
43849
44096
|
if (addressesResult.success) {
|
|
43850
44097
|
loan.collateral.vaultAddress = addressesResult.value;
|
|
43851
44098
|
if (this.config.debug) {
|
|
@@ -43857,23 +44104,31 @@ var LoanQuery = class {
|
|
|
43857
44104
|
}
|
|
43858
44105
|
} else {
|
|
43859
44106
|
if (this.config.debug) {
|
|
43860
|
-
log.warn(
|
|
43861
|
-
|
|
43862
|
-
|
|
44107
|
+
log.warn(
|
|
44108
|
+
`\u26A0\uFE0F Failed to derive vault addresses for loan ${loan.id}`,
|
|
44109
|
+
{
|
|
44110
|
+
error: addressesResult.error.message
|
|
44111
|
+
}
|
|
44112
|
+
);
|
|
43863
44113
|
}
|
|
43864
44114
|
}
|
|
43865
44115
|
} catch (error) {
|
|
43866
44116
|
if (this.config.debug) {
|
|
43867
|
-
log.warn(
|
|
43868
|
-
|
|
43869
|
-
|
|
44117
|
+
log.warn(
|
|
44118
|
+
`\u26A0\uFE0F Vault address derivation error for loan ${loan.id}`,
|
|
44119
|
+
{
|
|
44120
|
+
error: error instanceof Error ? error.message : String(error)
|
|
44121
|
+
}
|
|
44122
|
+
);
|
|
43870
44123
|
}
|
|
43871
44124
|
}
|
|
43872
44125
|
})
|
|
43873
44126
|
);
|
|
43874
44127
|
}
|
|
43875
44128
|
if (this.config.debug) {
|
|
43876
|
-
log.info(
|
|
44129
|
+
log.info(
|
|
44130
|
+
`\u2705 Completed vault address enrichment for ${loans.length} loans`
|
|
44131
|
+
);
|
|
43877
44132
|
}
|
|
43878
44133
|
return loans;
|
|
43879
44134
|
}
|
|
@@ -43896,12 +44151,12 @@ var LoanQuery = class {
|
|
|
43896
44151
|
*/
|
|
43897
44152
|
mapStringToStatus(statusString) {
|
|
43898
44153
|
const statusMap = {
|
|
43899
|
-
|
|
43900
|
-
|
|
43901
|
-
|
|
43902
|
-
|
|
43903
|
-
|
|
43904
|
-
|
|
44154
|
+
PENDING_DEPOSIT: 0,
|
|
44155
|
+
ACTIVE: 1,
|
|
44156
|
+
EXPIRED: 2,
|
|
44157
|
+
REPAID: 3,
|
|
44158
|
+
LIQUIDATED: 4,
|
|
44159
|
+
EXTENDED: 5
|
|
43905
44160
|
};
|
|
43906
44161
|
return statusMap[statusString.toUpperCase()] ?? null;
|
|
43907
44162
|
}
|
|
@@ -43909,7 +44164,15 @@ var LoanQuery = class {
|
|
|
43909
44164
|
* Validate if a string is a valid loan status
|
|
43910
44165
|
*/
|
|
43911
44166
|
isValidStatus(statusString) {
|
|
43912
|
-
const validStatuses = [
|
|
44167
|
+
const validStatuses = [
|
|
44168
|
+
"PENDING_DEPOSIT",
|
|
44169
|
+
"ACTIVE",
|
|
44170
|
+
"EXPIRED",
|
|
44171
|
+
"REPAID",
|
|
44172
|
+
"LIQUIDATED",
|
|
44173
|
+
"EXTENDED",
|
|
44174
|
+
"CLOSED"
|
|
44175
|
+
];
|
|
43913
44176
|
return validStatuses.includes(statusString.toUpperCase());
|
|
43914
44177
|
}
|
|
43915
44178
|
/**
|
|
@@ -44405,9 +44668,9 @@ async function getBitcoinAddressesFromPkp(pkpPublicKey) {
|
|
|
44405
44668
|
var BitcoinUtils = class {
|
|
44406
44669
|
static validateAddress(address) {
|
|
44407
44670
|
const base58Pattern = /^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$/;
|
|
44671
|
+
const bech32Pattern = /^(bc1|tb1|bcrt1)[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{11,87}$/;
|
|
44408
44672
|
const isBase58 = base58Pattern.test(address) && address.length >= 26 && address.length <= 35;
|
|
44409
|
-
const
|
|
44410
|
-
const isBech32 = bech32Pattern.test(address);
|
|
44673
|
+
const isBech32 = bech32Pattern.test(address.toLowerCase());
|
|
44411
44674
|
return isBase58 || isBech32;
|
|
44412
44675
|
}
|
|
44413
44676
|
static formatTransaction(hash3, amount, recipient) {
|
|
@@ -44445,33 +44708,212 @@ var BitcoinUtils = class {
|
|
|
44445
44708
|
// src/utils/bitcoin-provider.utils.ts
|
|
44446
44709
|
var import_axios = __toESM(require("axios"));
|
|
44447
44710
|
|
|
44711
|
+
// ../lit-actions/src/modules/lit-action-logger.module.ts
|
|
44712
|
+
var NoOpLogger = class {
|
|
44713
|
+
stepStart(_stepId, _description) {
|
|
44714
|
+
}
|
|
44715
|
+
stepEnd(_stepId, _warnThresholdMs) {
|
|
44716
|
+
}
|
|
44717
|
+
log(_stepId, _message) {
|
|
44718
|
+
}
|
|
44719
|
+
warn(_stepId, _message) {
|
|
44720
|
+
}
|
|
44721
|
+
error(_stepId, _message) {
|
|
44722
|
+
}
|
|
44723
|
+
getElapsed() {
|
|
44724
|
+
return 0;
|
|
44725
|
+
}
|
|
44726
|
+
getRemaining() {
|
|
44727
|
+
return 3e4;
|
|
44728
|
+
}
|
|
44729
|
+
summary() {
|
|
44730
|
+
}
|
|
44731
|
+
getExecutionId() {
|
|
44732
|
+
return "";
|
|
44733
|
+
}
|
|
44734
|
+
isDebugEnabled() {
|
|
44735
|
+
return false;
|
|
44736
|
+
}
|
|
44737
|
+
};
|
|
44738
|
+
var DebugLogger = class {
|
|
44739
|
+
executionId;
|
|
44740
|
+
executionStartTime;
|
|
44741
|
+
stepStartTimes = /* @__PURE__ */ new Map();
|
|
44742
|
+
stepDurations = /* @__PURE__ */ new Map();
|
|
44743
|
+
TIMEOUT_MS = 3e4;
|
|
44744
|
+
// 30 seconds LIT Action timeout
|
|
44745
|
+
actionName;
|
|
44746
|
+
constructor(actionName) {
|
|
44747
|
+
this.actionName = actionName;
|
|
44748
|
+
this.executionStartTime = Date.now();
|
|
44749
|
+
const timestamp = Date.now();
|
|
44750
|
+
const random = Math.random().toString(36).substring(2, 9);
|
|
44751
|
+
this.executionId = `exec_${timestamp}_${random}`;
|
|
44752
|
+
this.logHeader();
|
|
44753
|
+
}
|
|
44754
|
+
/**
|
|
44755
|
+
* Log action header with execution context
|
|
44756
|
+
*/
|
|
44757
|
+
logHeader() {
|
|
44758
|
+
console.log(
|
|
44759
|
+
`[${this.actionName}] ========================================`
|
|
44760
|
+
);
|
|
44761
|
+
console.log(`[${this.actionName}] Execution started`);
|
|
44762
|
+
console.log(`[${this.actionName}] Execution ID: ${this.executionId}`);
|
|
44763
|
+
const isLitNode = typeof globalThis.litNodeContext !== "undefined";
|
|
44764
|
+
if (isLitNode) {
|
|
44765
|
+
console.log(`[${this.actionName}] Context: LIT Node`);
|
|
44766
|
+
console.log(
|
|
44767
|
+
`[${this.actionName}] Node: ${globalThis.litNodeContext?.nodeAddress || "unknown"}`
|
|
44768
|
+
);
|
|
44769
|
+
} else {
|
|
44770
|
+
console.log(`[${this.actionName}] Context: Browser/Test`);
|
|
44771
|
+
}
|
|
44772
|
+
console.log(
|
|
44773
|
+
`[${this.actionName}] ========================================`
|
|
44774
|
+
);
|
|
44775
|
+
}
|
|
44776
|
+
stepStart(stepId, description) {
|
|
44777
|
+
this.stepStartTimes.set(stepId, Date.now());
|
|
44778
|
+
const elapsed = Date.now() - this.executionStartTime;
|
|
44779
|
+
const remaining = this.TIMEOUT_MS - elapsed;
|
|
44780
|
+
console.log(`[Step ${stepId}] ${description}...`);
|
|
44781
|
+
console.log(
|
|
44782
|
+
`[Step ${stepId}] Elapsed: ${elapsed}ms | Remaining: ${remaining}ms`
|
|
44783
|
+
);
|
|
44784
|
+
}
|
|
44785
|
+
stepEnd(stepId, warnThresholdMs = 5e3) {
|
|
44786
|
+
const startTime = this.stepStartTimes.get(stepId);
|
|
44787
|
+
if (!startTime) {
|
|
44788
|
+
console.warn(
|
|
44789
|
+
`[Step ${stepId}] \u26A0\uFE0F stepEnd called without matching stepStart`
|
|
44790
|
+
);
|
|
44791
|
+
return;
|
|
44792
|
+
}
|
|
44793
|
+
const duration = Date.now() - startTime;
|
|
44794
|
+
this.stepDurations.set(stepId, duration);
|
|
44795
|
+
console.log(`[Step ${stepId}] Duration: ${duration}ms`);
|
|
44796
|
+
if (duration > warnThresholdMs) {
|
|
44797
|
+
console.warn(
|
|
44798
|
+
`\u26A0\uFE0F [Step ${stepId}] Took ${duration}ms (> ${warnThresholdMs}ms threshold)`
|
|
44799
|
+
);
|
|
44800
|
+
}
|
|
44801
|
+
const elapsed = Date.now() - this.executionStartTime;
|
|
44802
|
+
const remaining = this.TIMEOUT_MS - elapsed;
|
|
44803
|
+
if (remaining < 5e3) {
|
|
44804
|
+
console.warn(
|
|
44805
|
+
`\u26A0\uFE0F [Step ${stepId}] Time remaining: ${remaining}ms (approaching timeout)`
|
|
44806
|
+
);
|
|
44807
|
+
}
|
|
44808
|
+
}
|
|
44809
|
+
log(stepId, message) {
|
|
44810
|
+
console.log(`[Step ${stepId}] ${message}`);
|
|
44811
|
+
}
|
|
44812
|
+
warn(stepId, message) {
|
|
44813
|
+
console.warn(`\u26A0\uFE0F [Step ${stepId}] ${message}`);
|
|
44814
|
+
}
|
|
44815
|
+
error(stepId, message) {
|
|
44816
|
+
console.error(`\u274C [Step ${stepId}] ${message}`);
|
|
44817
|
+
}
|
|
44818
|
+
getElapsed() {
|
|
44819
|
+
return Date.now() - this.executionStartTime;
|
|
44820
|
+
}
|
|
44821
|
+
getRemaining() {
|
|
44822
|
+
return this.TIMEOUT_MS - this.getElapsed();
|
|
44823
|
+
}
|
|
44824
|
+
summary() {
|
|
44825
|
+
const totalDuration = Date.now() - this.executionStartTime;
|
|
44826
|
+
const remaining = this.TIMEOUT_MS - totalDuration;
|
|
44827
|
+
console.log(
|
|
44828
|
+
`[${this.actionName}] ========================================`
|
|
44829
|
+
);
|
|
44830
|
+
console.log(`[${this.actionName}] Execution Summary`);
|
|
44831
|
+
console.log(`[${this.actionName}] Execution ID: ${this.executionId}`);
|
|
44832
|
+
console.log(
|
|
44833
|
+
`[${this.actionName}] Total time: ${(totalDuration / 1e3).toFixed(2)}s`
|
|
44834
|
+
);
|
|
44835
|
+
console.log(`[${this.actionName}] Time remaining: ${remaining}ms`);
|
|
44836
|
+
if (this.stepDurations.size > 0) {
|
|
44837
|
+
console.log(`[${this.actionName}] Step breakdown:`);
|
|
44838
|
+
for (const [stepId, duration] of this.stepDurations.entries()) {
|
|
44839
|
+
const percent = (duration / totalDuration * 100).toFixed(1);
|
|
44840
|
+
console.log(
|
|
44841
|
+
`[${this.actionName}] Step ${stepId}: ${duration}ms (${percent}%)`
|
|
44842
|
+
);
|
|
44843
|
+
}
|
|
44844
|
+
}
|
|
44845
|
+
if (totalDuration > 2e4) {
|
|
44846
|
+
console.warn(
|
|
44847
|
+
`\u26A0\uFE0F [${this.actionName}] Slow execution: ${(totalDuration / 1e3).toFixed(2)}s (${remaining}ms remaining)`
|
|
44848
|
+
);
|
|
44849
|
+
}
|
|
44850
|
+
if (remaining < 5e3) {
|
|
44851
|
+
console.warn(
|
|
44852
|
+
`\u26A0\uFE0F [${this.actionName}] CRITICAL: Only ${remaining}ms remaining before timeout!`
|
|
44853
|
+
);
|
|
44854
|
+
}
|
|
44855
|
+
console.log(
|
|
44856
|
+
`[${this.actionName}] ========================================`
|
|
44857
|
+
);
|
|
44858
|
+
}
|
|
44859
|
+
getExecutionId() {
|
|
44860
|
+
return this.executionId;
|
|
44861
|
+
}
|
|
44862
|
+
isDebugEnabled() {
|
|
44863
|
+
return true;
|
|
44864
|
+
}
|
|
44865
|
+
};
|
|
44866
|
+
var LitActionLogger = class {
|
|
44867
|
+
/**
|
|
44868
|
+
* Create logger instance
|
|
44869
|
+
* Returns NoOpLogger when disabled (99% case), DebugLogger when enabled
|
|
44870
|
+
* @param actionName - Name of the LIT Action (for logging context)
|
|
44871
|
+
* @param debugAction - Optional override for globalThis.debugAction
|
|
44872
|
+
*/
|
|
44873
|
+
static create(actionName = "LIT Action", debugAction) {
|
|
44874
|
+
const debugEnabled = debugAction ?? globalThis.debugAction ?? false;
|
|
44875
|
+
if (debugEnabled) {
|
|
44876
|
+
return new DebugLogger(actionName);
|
|
44877
|
+
} else {
|
|
44878
|
+
return new NoOpLogger();
|
|
44879
|
+
}
|
|
44880
|
+
}
|
|
44881
|
+
};
|
|
44882
|
+
|
|
44448
44883
|
// ../lit-actions/src/modules/bitcoin-data-provider.module.ts
|
|
44449
44884
|
var BitcoinDataProvider = class {
|
|
44450
44885
|
config;
|
|
44451
44886
|
timeout;
|
|
44887
|
+
logger;
|
|
44452
44888
|
constructor(config) {
|
|
44453
44889
|
this.config = config;
|
|
44454
|
-
this.timeout = config.timeout ||
|
|
44890
|
+
this.timeout = config.timeout || 15e3;
|
|
44891
|
+
this.logger = LitActionLogger.create("BitcoinDataProvider");
|
|
44455
44892
|
}
|
|
44456
44893
|
/**
|
|
44457
44894
|
* Get current Bitcoin block height from provider
|
|
44458
44895
|
*/
|
|
44459
44896
|
async getCurrentBlockHeight() {
|
|
44897
|
+
this.logger.stepStart("0", "getCurrentBlockHeight");
|
|
44460
44898
|
if (this.config.rpcHelper) {
|
|
44461
44899
|
const blockCount = await this.config.rpcHelper.getBlockCount();
|
|
44900
|
+
this.logger.stepEnd("0");
|
|
44462
44901
|
return blockCount;
|
|
44463
44902
|
}
|
|
44464
44903
|
const controller = new AbortController();
|
|
44465
44904
|
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
44466
44905
|
try {
|
|
44467
|
-
const response = await fetch(
|
|
44468
|
-
|
|
44469
|
-
|
|
44470
|
-
|
|
44471
|
-
|
|
44472
|
-
|
|
44906
|
+
const response = await fetch(
|
|
44907
|
+
`${this.config.providerUrl}/blocks/tip/height`,
|
|
44908
|
+
{
|
|
44909
|
+
signal: controller.signal,
|
|
44910
|
+
headers: {
|
|
44911
|
+
Accept: "text/plain",
|
|
44912
|
+
"User-Agent": "Mozilla/5.0 (compatible; DiamondHandsValidator/1.0)",
|
|
44913
|
+
"ngrok-skip-browser-warning": "true"
|
|
44914
|
+
}
|
|
44473
44915
|
}
|
|
44474
|
-
|
|
44916
|
+
);
|
|
44475
44917
|
clearTimeout(timeoutId);
|
|
44476
44918
|
if (!response.ok) {
|
|
44477
44919
|
throw new Error(
|
|
@@ -44483,9 +44925,11 @@ var BitcoinDataProvider = class {
|
|
|
44483
44925
|
if (isNaN(height)) {
|
|
44484
44926
|
throw new Error(`Invalid block height response: ${heightText}`);
|
|
44485
44927
|
}
|
|
44928
|
+
this.logger.stepEnd("0");
|
|
44486
44929
|
return height;
|
|
44487
44930
|
} catch (error) {
|
|
44488
44931
|
clearTimeout(timeoutId);
|
|
44932
|
+
this.logger.stepEnd("0");
|
|
44489
44933
|
if (error.name === "AbortError") {
|
|
44490
44934
|
throw new Error(`Request timeout after ${this.timeout}ms`);
|
|
44491
44935
|
}
|
|
@@ -44499,9 +44943,9 @@ var BitcoinDataProvider = class {
|
|
|
44499
44943
|
* @returns Array of UTXOs
|
|
44500
44944
|
*/
|
|
44501
44945
|
async getUTXOs(address) {
|
|
44502
|
-
|
|
44946
|
+
this.logger.log("0", `Original address: "${address}"`);
|
|
44503
44947
|
const cleanAddress = this.stripNetworkPrefix(address);
|
|
44504
|
-
|
|
44948
|
+
this.logger.log("0", `Cleaned address: "${cleanAddress}"`);
|
|
44505
44949
|
if (this.config.rpcHelper) {
|
|
44506
44950
|
return await this.fetchUTXOsFromRPC(cleanAddress);
|
|
44507
44951
|
}
|
|
@@ -44511,23 +44955,25 @@ var BitcoinDataProvider = class {
|
|
|
44511
44955
|
cleanAddress
|
|
44512
44956
|
);
|
|
44513
44957
|
} catch (error) {
|
|
44514
|
-
|
|
44958
|
+
this.logger.warn("0", `Primary provider failed: ${error.message}`);
|
|
44515
44959
|
if (this.config.fallbackProviders && this.config.fallbackProviders.length > 0) {
|
|
44516
44960
|
const sortedFallbacks = [...this.config.fallbackProviders].sort(
|
|
44517
44961
|
(a, b2) => a.priority - b2.priority
|
|
44518
44962
|
);
|
|
44519
44963
|
for (const fallback of sortedFallbacks) {
|
|
44520
44964
|
try {
|
|
44521
|
-
|
|
44522
|
-
|
|
44965
|
+
this.logger.log(
|
|
44966
|
+
"0",
|
|
44967
|
+
`Trying fallback: ${fallback.name} (${fallback.url})`
|
|
44523
44968
|
);
|
|
44524
44969
|
return await this.fetchUTXOsFromProvider(
|
|
44525
44970
|
fallback.url,
|
|
44526
44971
|
cleanAddress
|
|
44527
44972
|
);
|
|
44528
44973
|
} catch (fallbackError) {
|
|
44529
|
-
|
|
44530
|
-
|
|
44974
|
+
this.logger.warn(
|
|
44975
|
+
"0",
|
|
44976
|
+
`Fallback ${fallback.name} failed: ${fallbackError.message}`
|
|
44531
44977
|
);
|
|
44532
44978
|
continue;
|
|
44533
44979
|
}
|
|
@@ -44615,10 +45061,11 @@ var BitcoinDataProvider = class {
|
|
|
44615
45061
|
* - providerUrl must include full base path (e.g., "http://localhost:3002/api/esplora")
|
|
44616
45062
|
*/
|
|
44617
45063
|
async fetchUTXOsFromProvider(providerUrl, address) {
|
|
45064
|
+
this.logger.stepStart("1", "fetchUTXOsFromProvider");
|
|
44618
45065
|
const endpoint = `${providerUrl}/address/${address}/utxos`;
|
|
44619
|
-
|
|
45066
|
+
this.logger.log("1", `Fetching UTXOs from ${endpoint}`);
|
|
44620
45067
|
const currentBlockHeight = await this.getCurrentBlockHeight();
|
|
44621
|
-
|
|
45068
|
+
this.logger.log("1", `Current block height: ${currentBlockHeight}`);
|
|
44622
45069
|
const controller = new AbortController();
|
|
44623
45070
|
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
44624
45071
|
try {
|
|
@@ -44639,13 +45086,16 @@ var BitcoinDataProvider = class {
|
|
|
44639
45086
|
);
|
|
44640
45087
|
}
|
|
44641
45088
|
const data = await response.json();
|
|
44642
|
-
|
|
44643
|
-
|
|
44644
|
-
JSON.stringify(data, null, 2)
|
|
45089
|
+
this.logger.log(
|
|
45090
|
+
"1",
|
|
45091
|
+
`Raw API Response: ${JSON.stringify(data, null, 2)}`
|
|
44645
45092
|
);
|
|
44646
|
-
|
|
45093
|
+
const utxos = this.parseBlockstreamUTXOs(data, currentBlockHeight);
|
|
45094
|
+
this.logger.stepEnd("1");
|
|
45095
|
+
return utxos;
|
|
44647
45096
|
} catch (error) {
|
|
44648
45097
|
clearTimeout(timeoutId);
|
|
45098
|
+
this.logger.stepEnd("1");
|
|
44649
45099
|
if (error.name === "AbortError") {
|
|
44650
45100
|
throw new Error(`Request timeout after ${this.timeout}ms`);
|
|
44651
45101
|
}
|
|
@@ -44669,22 +45119,27 @@ var BitcoinDataProvider = class {
|
|
|
44669
45119
|
const retryDelay = 500;
|
|
44670
45120
|
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
|
44671
45121
|
try {
|
|
44672
|
-
|
|
45122
|
+
this.logger.log("2", `UTXO query attempt ${attempt}/${maxRetries}...`);
|
|
44673
45123
|
utxos = await this.getUTXOs(address);
|
|
44674
|
-
|
|
45124
|
+
this.logger.log("2", `UTXO query succeeded on attempt ${attempt}`);
|
|
44675
45125
|
lastError = null;
|
|
44676
45126
|
break;
|
|
44677
45127
|
} catch (error) {
|
|
44678
45128
|
lastError = error;
|
|
44679
|
-
|
|
45129
|
+
this.logger.error(
|
|
45130
|
+
"2",
|
|
45131
|
+
`UTXO query failed on attempt ${attempt}: ${error.message}`
|
|
45132
|
+
);
|
|
44680
45133
|
if (attempt < maxRetries) {
|
|
44681
|
-
|
|
45134
|
+
this.logger.log("2", `Waiting ${retryDelay}ms before retry...`);
|
|
44682
45135
|
await new Promise((resolve) => setTimeout(resolve, retryDelay));
|
|
44683
45136
|
}
|
|
44684
45137
|
}
|
|
44685
45138
|
}
|
|
44686
45139
|
if (lastError) {
|
|
44687
|
-
throw new Error(
|
|
45140
|
+
throw new Error(
|
|
45141
|
+
`Failed to query UTXOs after ${maxRetries} attempts: ${lastError.message}`
|
|
45142
|
+
);
|
|
44688
45143
|
}
|
|
44689
45144
|
const totalBalance = utxos.reduce((sum, utxo) => sum + utxo.satoshis, 0n);
|
|
44690
45145
|
const confirmedBalance = utxos.filter((utxo) => utxo.confirmations >= minConfirmations).reduce((sum, utxo) => sum + utxo.satoshis, 0n);
|
|
@@ -44697,6 +45152,72 @@ var BitcoinDataProvider = class {
|
|
|
44697
45152
|
unconfirmedBalance
|
|
44698
45153
|
};
|
|
44699
45154
|
}
|
|
45155
|
+
/**
|
|
45156
|
+
* Get balance for a Bitcoin address (fast, no UTXO details)
|
|
45157
|
+
*
|
|
45158
|
+
* WARNING: This method does NOT validate individual UTXOs.
|
|
45159
|
+
* Use ONLY for non-critical balance display, never for authorization validation.
|
|
45160
|
+
* For authorization/security: ALWAYS use getUTXOSet() with full UTXO validation.
|
|
45161
|
+
*
|
|
45162
|
+
* Uses Esplora /address/:address endpoint to get confirmed balance from chain_stats.
|
|
45163
|
+
*
|
|
45164
|
+
* @param address - Bitcoin address
|
|
45165
|
+
* @returns Balance in satoshis (confirmed balance only)
|
|
45166
|
+
* @throws Error if the request fails or response is invalid
|
|
45167
|
+
*/
|
|
45168
|
+
async getBalance(address) {
|
|
45169
|
+
const cleanAddress = this.stripNetworkPrefix(address);
|
|
45170
|
+
const endpoint = `${this.config.providerUrl}/address/${cleanAddress}`;
|
|
45171
|
+
this.logger.log("3", `Fetching balance from ${endpoint}`);
|
|
45172
|
+
const controller = new AbortController();
|
|
45173
|
+
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
45174
|
+
try {
|
|
45175
|
+
const response = await fetch(endpoint, {
|
|
45176
|
+
signal: controller.signal,
|
|
45177
|
+
headers: {
|
|
45178
|
+
Accept: "application/json",
|
|
45179
|
+
"Content-Type": "application/json",
|
|
45180
|
+
"User-Agent": "Mozilla/5.0 (compatible; DiamondHandsValidator/1.0)",
|
|
45181
|
+
"ngrok-skip-browser-warning": "true"
|
|
45182
|
+
}
|
|
45183
|
+
});
|
|
45184
|
+
clearTimeout(timeoutId);
|
|
45185
|
+
if (!response.ok) {
|
|
45186
|
+
throw new Error(
|
|
45187
|
+
`Bitcoin provider error: ${response.status} ${response.statusText}`
|
|
45188
|
+
);
|
|
45189
|
+
}
|
|
45190
|
+
const data = await response.json();
|
|
45191
|
+
if (!data.chain_stats) {
|
|
45192
|
+
throw new Error("Invalid response: missing chain_stats");
|
|
45193
|
+
}
|
|
45194
|
+
const fundedTxoSum = data.chain_stats.funded_txo_sum;
|
|
45195
|
+
const spentTxoSum = data.chain_stats.spent_txo_sum;
|
|
45196
|
+
if (fundedTxoSum === void 0 || spentTxoSum === void 0) {
|
|
45197
|
+
throw new Error(
|
|
45198
|
+
`Invalid response: missing required fields. funded_txo_sum: ${fundedTxoSum}, spent_txo_sum: ${spentTxoSum}`
|
|
45199
|
+
);
|
|
45200
|
+
}
|
|
45201
|
+
const confirmedBalance = fundedTxoSum - spentTxoSum;
|
|
45202
|
+
const balance = BigInt(confirmedBalance);
|
|
45203
|
+
this.logger.log("3", `Balance: ${balance.toString()} sats`);
|
|
45204
|
+
this.logger.log(
|
|
45205
|
+
"3",
|
|
45206
|
+
` - Funded: ${fundedTxoSum} sats, Spent: ${spentTxoSum} sats`
|
|
45207
|
+
);
|
|
45208
|
+
return balance;
|
|
45209
|
+
} catch (error) {
|
|
45210
|
+
clearTimeout(timeoutId);
|
|
45211
|
+
if (error.name === "AbortError") {
|
|
45212
|
+
throw new Error(`Request timeout after ${this.timeout}ms`);
|
|
45213
|
+
}
|
|
45214
|
+
const errorMessage = error.message || "Unknown error";
|
|
45215
|
+
this.logger.log("3", `Balance fetch failed: ${errorMessage}`);
|
|
45216
|
+
throw new Error(
|
|
45217
|
+
`Failed to fetch Bitcoin balance for address ${cleanAddress}: ${errorMessage}`
|
|
45218
|
+
);
|
|
45219
|
+
}
|
|
45220
|
+
}
|
|
44700
45221
|
/**
|
|
44701
45222
|
* Get transaction with confirmation count
|
|
44702
45223
|
*
|
|
@@ -44725,12 +45246,9 @@ var BitcoinDataProvider = class {
|
|
|
44725
45246
|
const controller = new AbortController();
|
|
44726
45247
|
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
44727
45248
|
try {
|
|
44728
|
-
const response = await fetch(
|
|
44729
|
-
|
|
44730
|
-
|
|
44731
|
-
signal: controller.signal
|
|
44732
|
-
}
|
|
44733
|
-
);
|
|
45249
|
+
const response = await fetch(`${this.config.providerUrl}/tx/${txid}`, {
|
|
45250
|
+
signal: controller.signal
|
|
45251
|
+
});
|
|
44734
45252
|
clearTimeout(timeoutId);
|
|
44735
45253
|
if (!response.ok) {
|
|
44736
45254
|
if (response.status === 404) {
|
|
@@ -45619,9 +46137,15 @@ function loadSDKConfig() {
|
|
|
45619
46137
|
const debugMode = getEnv("DEBUG_SDK") === "true" || environment === "datil";
|
|
45620
46138
|
const runRealIntegrationTests = getEnv("RUN_REAL_INTEGRATION_TESTS") === "true";
|
|
45621
46139
|
const litRelayUrl = getEnv("LIT_RELAY_URL");
|
|
45622
|
-
const ethRpcUrl = getEnv("ETH_RPC_URL")
|
|
45623
|
-
const polygonRpcUrl = getEnv("POLYGON_RPC_URL")
|
|
46140
|
+
const ethRpcUrl = getEnv("ETH_RPC_URL");
|
|
46141
|
+
const polygonRpcUrl = getEnv("POLYGON_RPC_URL");
|
|
45624
46142
|
const pkpMintPrivateKey = getEnv("PKP_MINT_PRIVATE_KEY");
|
|
46143
|
+
if (!ethRpcUrl) {
|
|
46144
|
+
throw new Error("ETH_RPC_URL environment variable is required");
|
|
46145
|
+
}
|
|
46146
|
+
if (!polygonRpcUrl) {
|
|
46147
|
+
throw new Error("POLYGON_RPC_URL environment variable is required");
|
|
46148
|
+
}
|
|
45625
46149
|
const validNetworks = ["datil"];
|
|
45626
46150
|
if (!validNetworks.includes(litNetwork)) {
|
|
45627
46151
|
throw new Error(
|
|
@@ -45675,7 +46199,7 @@ var POSITION_MANAGER_ABI = [
|
|
|
45675
46199
|
// Core position management
|
|
45676
46200
|
"function createPosition(bytes32 pkpId, bytes calldata validatorSignature, address borrower, string calldata vaultAddress, uint256 selectedTermMonths) external returns (bool)",
|
|
45677
46201
|
"function deletePosition(bytes32 positionId) external",
|
|
45678
|
-
"function
|
|
46202
|
+
"function getPositionById(bytes32 positionId) external view returns (tuple(bytes32 positionId, bytes32 pkpId, uint256 ucdDebt, string vaultAddress, address borrower, uint40 createdAt, uint40 lastUpdated, uint16 selectedTerm, uint40 expiryAt, uint8 status))",
|
|
45679
46203
|
"function getUserPositions(address user) external view returns (bytes32[] memory)",
|
|
45680
46204
|
"function calculateCollateralRatio(bytes32 positionId) external view returns (uint256)",
|
|
45681
46205
|
// Access control
|
|
@@ -45683,9 +46207,10 @@ var POSITION_MANAGER_ABI = [
|
|
|
45683
46207
|
"function ADMIN_ROLE() external view returns (bytes32)",
|
|
45684
46208
|
"function paused() external view returns (bool)",
|
|
45685
46209
|
// Core flow transactions
|
|
45686
|
-
"function mintUCD(bytes32 positionId, uint256 mintAmount, uint256 mintFee, uint256 newDebt, uint256 newCollateral, uint256 btcPrice, bytes32 authorizedSpendsHash, uint256 quantumTimestamp, bytes calldata mintValidatorSignature) external returns (bool)",
|
|
46210
|
+
"function mintUCD(bytes32 positionId, uint256 mintAmount, uint256 mintFee, uint256 newDebt, uint256 newCollateral, uint256 btcPrice, bytes32 authorizedSpendsHash, bytes32 ucdDebtHash, bytes32 contractHash, uint256 quantumTimestamp, bytes calldata mintValidatorSignature) external returns (bool)",
|
|
46211
|
+
// PositionManager.mintUCD()
|
|
45687
46212
|
"function repayPosition(bytes32 positionId, uint256 repaymentAmount) external returns (bool)",
|
|
45688
|
-
"function
|
|
46213
|
+
"function makePayment(bytes32 positionId, uint256 paymentAmount, uint256 quantumTimestamp, uint256 btcPrice, bytes calldata paymentValidatorSignature) external returns (bool)",
|
|
45689
46214
|
// addCollateral removed - BTC balance is now queried on-chain via lit-actions with signature validation
|
|
45690
46215
|
"function withdrawBTC(bytes32 positionId, string withdrawalAddress, uint256 networkFee) external returns (bool)",
|
|
45691
46216
|
"function extendPosition(bytes32 positionId, uint256 selectedTerm) external returns (bool)",
|
|
@@ -46645,7 +47170,7 @@ var DiamondHandsGraph = class {
|
|
|
46645
47170
|
first = this.defaultPageSize,
|
|
46646
47171
|
skip = 0
|
|
46647
47172
|
} = filters || {};
|
|
46648
|
-
|
|
47173
|
+
const whereConditions = [];
|
|
46649
47174
|
if (user)
|
|
46650
47175
|
whereConditions.push(`user: "${user.toLowerCase()}"`);
|
|
46651
47176
|
if (stablecoin)
|
|
@@ -46682,7 +47207,7 @@ var DiamondHandsGraph = class {
|
|
|
46682
47207
|
* Get PSM analytics for a date range
|
|
46683
47208
|
*/
|
|
46684
47209
|
async getPSMDailyMetrics(startDate, endDate, first = 30) {
|
|
46685
|
-
|
|
47210
|
+
const whereConditions = [];
|
|
46686
47211
|
if (startDate)
|
|
46687
47212
|
whereConditions.push(`date_gte: "${startDate}"`);
|
|
46688
47213
|
if (endDate)
|
|
@@ -47059,6 +47584,13 @@ var import_dh_lit_ops = require("@gvnrdao/dh-lit-ops");
|
|
|
47059
47584
|
|
|
47060
47585
|
// src/utils/telegram-messaging.utils.ts
|
|
47061
47586
|
var TelegramBot = null;
|
|
47587
|
+
try {
|
|
47588
|
+
if (typeof window === "undefined" && typeof global !== "undefined") {
|
|
47589
|
+
TelegramBot = require("node-telegram-bot-api");
|
|
47590
|
+
}
|
|
47591
|
+
} catch (error) {
|
|
47592
|
+
console.warn("Telegram bot API not available:", error instanceof Error ? error.message : String(error));
|
|
47593
|
+
}
|
|
47062
47594
|
async function sendTelegramMessage(chatId, chatToken, message, threadId) {
|
|
47063
47595
|
try {
|
|
47064
47596
|
const bot = new TelegramBot(chatToken, { polling: false });
|
|
@@ -47083,7 +47615,7 @@ async function sendTelegramMessage(chatId, chatToken, message, threadId) {
|
|
|
47083
47615
|
}
|
|
47084
47616
|
}
|
|
47085
47617
|
function formatMintMessage(mintAmount, loanId, txHash) {
|
|
47086
|
-
return `${mintAmount} UCD was minted for loan id: ${loanId}
|
|
47618
|
+
return `${mintAmount} UCD was minted for loan id: ${loanId} Tx: https://sepolia.etherscan.io/tx/${txHash}`;
|
|
47087
47619
|
}
|
|
47088
47620
|
|
|
47089
47621
|
// src/modules/diamond-hands-sdk.ts
|
|
@@ -47146,7 +47678,12 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
47146
47678
|
network: config.litNetwork || "datil",
|
|
47147
47679
|
signer: config.mode === "standalone" ? config.litOpsSigner : void 0,
|
|
47148
47680
|
serviceEndpoint: isServiceModeConfig(config) ? config.serviceEndpoint : void 0,
|
|
47149
|
-
debug: config.debug
|
|
47681
|
+
debug: config.debug,
|
|
47682
|
+
holderCapacityCreditsLitPrivateKey: config.holderCapacityCreditsLitPrivateKey
|
|
47683
|
+
// TODO Round 2: Add litActionExecution config when added to config.i.ts interface
|
|
47684
|
+
// ...((config as any).litActionExecution ? {
|
|
47685
|
+
// litActionExecution: (config as any).litActionExecution,
|
|
47686
|
+
// } : {}),
|
|
47150
47687
|
});
|
|
47151
47688
|
if (config.debug) {
|
|
47152
47689
|
log.info("\u2705 LitOps initialized", {
|
|
@@ -47238,7 +47775,8 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
47238
47775
|
litActionCid: config.litActionCid || "",
|
|
47239
47776
|
userId: config.contractSigner.address,
|
|
47240
47777
|
debug: config.debug,
|
|
47241
|
-
|
|
47778
|
+
loanCreationValidatorVersion: config.validators.loanCreation,
|
|
47779
|
+
temperSignaturesTest: config.temperSignaturesTest
|
|
47242
47780
|
});
|
|
47243
47781
|
if (!loanCreatorResult.success) {
|
|
47244
47782
|
throw new Error(
|
|
@@ -47467,6 +48005,21 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
47467
48005
|
"[DEBUG] enrichConfigWithNetworkDefaults - output config.serviceEndpoint:",
|
|
47468
48006
|
enrichedConfig.serviceEndpoint
|
|
47469
48007
|
);
|
|
48008
|
+
if (!enrichedConfig.validators) {
|
|
48009
|
+
enrichedConfig.validators = {
|
|
48010
|
+
loanCreation: 1,
|
|
48011
|
+
// Default PKP security validation version
|
|
48012
|
+
minting: 4,
|
|
48013
|
+
// Default business rules validation version
|
|
48014
|
+
payment: 1,
|
|
48015
|
+
// Default payment validation version
|
|
48016
|
+
extension: 4
|
|
48017
|
+
// Default extension validation version
|
|
48018
|
+
};
|
|
48019
|
+
if (config.debug) {
|
|
48020
|
+
log.info("\u2705 Using default validator versions");
|
|
48021
|
+
}
|
|
48022
|
+
}
|
|
47470
48023
|
return enrichedConfig;
|
|
47471
48024
|
}
|
|
47472
48025
|
/**
|
|
@@ -47720,15 +48273,15 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
47720
48273
|
log.info("\u{1F510} Performing LIT Action validation...", {});
|
|
47721
48274
|
}
|
|
47722
48275
|
try {
|
|
47723
|
-
const
|
|
47724
|
-
if (!
|
|
48276
|
+
const position2 = await this.getPosition(request.positionId);
|
|
48277
|
+
if (!position2) {
|
|
47725
48278
|
return {
|
|
47726
48279
|
success: false,
|
|
47727
48280
|
error: `Position ${request.positionId} not found in PositionManager. Please verify the position ID is correct.`
|
|
47728
48281
|
};
|
|
47729
48282
|
}
|
|
47730
48283
|
if (this.config.debug) {
|
|
47731
|
-
log.info(` Position PKP ID: ${
|
|
48284
|
+
log.info(` Position PKP ID: ${position2.pkpId}`);
|
|
47732
48285
|
}
|
|
47733
48286
|
let pkpPublicKey;
|
|
47734
48287
|
let pkpEthAddress;
|
|
@@ -47751,14 +48304,14 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
47751
48304
|
} else {
|
|
47752
48305
|
try {
|
|
47753
48306
|
pkpPublicKey = await getPKPPublicKeyFromTokenId(
|
|
47754
|
-
|
|
48307
|
+
position2.pkpId,
|
|
47755
48308
|
this.getProviderOrThrow()
|
|
47756
48309
|
);
|
|
47757
48310
|
pkpEthAddress = ethers_exports.utils.computeAddress(pkpPublicKey);
|
|
47758
48311
|
pkpCache.set(request.positionId, {
|
|
47759
48312
|
publicKey: pkpPublicKey,
|
|
47760
48313
|
ethAddress: pkpEthAddress,
|
|
47761
|
-
tokenId:
|
|
48314
|
+
tokenId: position2.pkpId
|
|
47762
48315
|
});
|
|
47763
48316
|
if (this.config.debug) {
|
|
47764
48317
|
log.info("\u2705 Retrieved PKP data from contract and cached", {
|
|
@@ -47768,11 +48321,11 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
47768
48321
|
});
|
|
47769
48322
|
}
|
|
47770
48323
|
} catch (error) {
|
|
47771
|
-
const errorMsg = `Failed to retrieve PKP public key for position ${request.positionId}. PKP Token ID: ${
|
|
48324
|
+
const errorMsg = `Failed to retrieve PKP public key for position ${request.positionId}. PKP Token ID: ${position2.pkpId}. Error: ${error instanceof Error ? error.message : String(error)}`;
|
|
47772
48325
|
if (this.config.debug) {
|
|
47773
48326
|
log.error("\u274C PKP public key retrieval failed", {
|
|
47774
48327
|
positionId: request.positionId,
|
|
47775
|
-
pkpId:
|
|
48328
|
+
pkpId: position2.pkpId,
|
|
47776
48329
|
error: error instanceof Error ? error.message : String(error)
|
|
47777
48330
|
});
|
|
47778
48331
|
}
|
|
@@ -47857,7 +48410,7 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
47857
48410
|
litActionResult = await this.litOps.requestMintAuthorization({
|
|
47858
48411
|
authMessage: {
|
|
47859
48412
|
...auth,
|
|
47860
|
-
...mode === "dev" && contracts && { contracts }
|
|
48413
|
+
...mode === "dev" && contracts && { contractAddresses: contracts }
|
|
47861
48414
|
},
|
|
47862
48415
|
userSignature: auth.signature,
|
|
47863
48416
|
...request.customRpcUrl && { customRpcUrl: request.customRpcUrl },
|
|
@@ -47997,6 +48550,11 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
47997
48550
|
if (!signatureBytes.startsWith("0x")) {
|
|
47998
48551
|
signatureBytes = "0x" + signatureBytes;
|
|
47999
48552
|
}
|
|
48553
|
+
const finalSignature = maybeTemperSignature(
|
|
48554
|
+
signatureBytes,
|
|
48555
|
+
this.config.temperSignaturesTest,
|
|
48556
|
+
"requestMintUCD"
|
|
48557
|
+
);
|
|
48000
48558
|
if (this.config.debug) {
|
|
48001
48559
|
log.info(" Calling contract with LIT Action validated parameters:", {
|
|
48002
48560
|
mintAmount: validationResponse.mintAmount,
|
|
@@ -48006,23 +48564,42 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
48006
48564
|
btcPrice: validationResponse.btcPrice,
|
|
48007
48565
|
authorizedSpendsHash: validationResponse.authorizedSpendsHash,
|
|
48008
48566
|
timestamp: validationResponse.timestamp,
|
|
48009
|
-
signatureLength:
|
|
48567
|
+
signatureLength: finalSignature.length
|
|
48010
48568
|
});
|
|
48011
48569
|
}
|
|
48012
|
-
const
|
|
48013
|
-
if (!
|
|
48014
|
-
throw new Error("
|
|
48570
|
+
const positionManagerAddress = this.getContractAddressesOrThrow().positionManager;
|
|
48571
|
+
if (!positionManagerAddress) {
|
|
48572
|
+
throw new Error("PositionManager address not configured");
|
|
48015
48573
|
}
|
|
48016
|
-
const
|
|
48017
|
-
"function mintUCD(bytes32 positionId, uint256 mintAmount, uint256 mintFee, uint256 newDebt, uint256 newCollateral, uint256 btcPrice, bytes32 authorizedSpendsHash, uint256 quantumTimestamp, bytes calldata mintValidatorSignature) external returns (bool)"
|
|
48574
|
+
const positionManagerAbi = [
|
|
48575
|
+
"function mintUCD(bytes32 positionId, uint256 mintAmount, uint256 mintFee, uint256 newDebt, uint256 newCollateral, uint256 btcPrice, bytes32 authorizedSpendsHash, bytes32 ucdDebtHash, bytes32 contractHash, uint256 quantumTimestamp, bytes calldata mintValidatorSignature) external returns (bool)"
|
|
48018
48576
|
];
|
|
48019
|
-
const
|
|
48020
|
-
|
|
48021
|
-
|
|
48577
|
+
const positionManager = new ethers_exports.Contract(
|
|
48578
|
+
positionManagerAddress,
|
|
48579
|
+
positionManagerAbi,
|
|
48022
48580
|
this.getSignerOrThrow()
|
|
48023
48581
|
);
|
|
48024
48582
|
const positionIdBytes32 = this.toBytes32(request.positionId);
|
|
48025
|
-
const
|
|
48583
|
+
const position = await this.getPosition(request.positionId);
|
|
48584
|
+
if (!position) {
|
|
48585
|
+
throw new Error(`Position not found: ${request.positionId}`);
|
|
48586
|
+
}
|
|
48587
|
+
const currentDebt = position.ucdDebt.toString();
|
|
48588
|
+
const ucdDebtHash = ethers_exports.utils.keccak256(
|
|
48589
|
+
ethers_exports.utils.defaultAbiCoder.encode(["uint256"], [currentDebt])
|
|
48590
|
+
);
|
|
48591
|
+
const contractHash = ethers_exports.utils.keccak256(
|
|
48592
|
+
ethers_exports.utils.defaultAbiCoder.encode(
|
|
48593
|
+
["address", "address", "address", "address"],
|
|
48594
|
+
[
|
|
48595
|
+
positionManagerAddress,
|
|
48596
|
+
this.getContractAddressesOrThrow().loanOperationsManager,
|
|
48597
|
+
this.getContractAddressesOrThrow().termManager,
|
|
48598
|
+
this.getContractAddressesOrThrow().ucdController
|
|
48599
|
+
]
|
|
48600
|
+
)
|
|
48601
|
+
);
|
|
48602
|
+
const tx = await positionManager.mintUCD(
|
|
48026
48603
|
positionIdBytes32,
|
|
48027
48604
|
validationResponse.mintAmount,
|
|
48028
48605
|
validationResponse.mintFee,
|
|
@@ -48030,8 +48607,10 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
48030
48607
|
validationResponse.newCollateral,
|
|
48031
48608
|
validationResponse.btcPrice,
|
|
48032
48609
|
validationResponse.authorizedSpendsHash,
|
|
48610
|
+
ucdDebtHash,
|
|
48611
|
+
contractHash,
|
|
48033
48612
|
validationResponse.timestamp,
|
|
48034
|
-
|
|
48613
|
+
finalSignature
|
|
48035
48614
|
);
|
|
48036
48615
|
const receipt = await tx.wait(1, 3e5);
|
|
48037
48616
|
let amountMinted;
|
|
@@ -48106,326 +48685,147 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
48106
48685
|
/**
|
|
48107
48686
|
* Extend position term
|
|
48108
48687
|
*
|
|
48109
|
-
*
|
|
48110
|
-
*
|
|
48688
|
+
* Follows main's security pattern: authorization → LIT validation → contract execution
|
|
48689
|
+
*
|
|
48690
|
+
* @param _positionId - Position identifier
|
|
48691
|
+
* @param _selectedTerm - Extension term in months
|
|
48111
48692
|
* @returns Transaction receipt
|
|
48112
48693
|
*/
|
|
48113
|
-
|
|
48114
|
-
|
|
48115
|
-
|
|
48116
|
-
|
|
48117
|
-
|
|
48694
|
+
async extendPosition(_positionId, _selectedTerm) {
|
|
48695
|
+
throw new Error(
|
|
48696
|
+
"extendPosition not yet implemented - requires requestExtendAuthorization in lit-ops"
|
|
48697
|
+
);
|
|
48698
|
+
}
|
|
48699
|
+
/**
|
|
48700
|
+
* Make a payment on a loan position
|
|
48701
|
+
*
|
|
48702
|
+
* Follows main's security pattern: authorization → LIT validation → contract execution
|
|
48703
|
+
*
|
|
48704
|
+
* @param request - Payment request with position ID and amount
|
|
48705
|
+
* @returns Payment result with transaction details
|
|
48706
|
+
*/
|
|
48707
|
+
async makePayment(request) {
|
|
48708
|
+
this.ensureInitialized();
|
|
48709
|
+
try {
|
|
48118
48710
|
if (this.config.debug) {
|
|
48119
|
-
log.info(
|
|
48120
|
-
|
|
48121
|
-
|
|
48122
|
-
// Validate input parameters
|
|
48123
|
-
if (!positionId || positionId === "0") {
|
|
48124
|
-
throw new Error("positionId is required and must be non-zero");
|
|
48125
|
-
}
|
|
48126
|
-
|
|
48127
|
-
if (selectedTerm <= 0 || selectedTerm > 12) {
|
|
48128
|
-
throw new Error("selectedTerm must be between 1 and 12 months");
|
|
48711
|
+
log.info(`\u{1F4B3} Making payment...`, {});
|
|
48712
|
+
log.info(` Amount: ${request.paymentAmount} UCD`);
|
|
48713
|
+
log.info(` positionId: ${request.positionId}`);
|
|
48129
48714
|
}
|
|
48130
|
-
|
|
48131
|
-
|
|
48132
|
-
|
|
48133
|
-
|
|
48134
|
-
|
|
48715
|
+
if (!request.positionId || request.positionId === "0") {
|
|
48716
|
+
return {
|
|
48717
|
+
success: false,
|
|
48718
|
+
error: "positionId is required and must be non-zero"
|
|
48719
|
+
};
|
|
48135
48720
|
}
|
|
48136
|
-
|
|
48137
|
-
|
|
48138
|
-
|
|
48139
|
-
|
|
48140
|
-
|
|
48721
|
+
if (request.paymentAmount <= 0) {
|
|
48722
|
+
return {
|
|
48723
|
+
success: false,
|
|
48724
|
+
error: "Payment amount must be greater than zero"
|
|
48725
|
+
};
|
|
48141
48726
|
}
|
|
48142
|
-
|
|
48143
|
-
// Get PKP token ID and ETH address (if available)
|
|
48144
|
-
const pkpTokenId = (position as any).pkpTokenId;
|
|
48145
|
-
const pkpEthAddress = (position as any).pkpEthAddress;
|
|
48146
|
-
|
|
48147
|
-
// Generate owner authorization
|
|
48148
|
-
const network = await this.config.provider!.getNetwork();
|
|
48727
|
+
const network = await this.getProviderOrThrow().getNetwork();
|
|
48149
48728
|
const chainId = Number(network.chainId);
|
|
48150
|
-
const mode =
|
|
48151
|
-
const
|
|
48152
|
-
|
|
48153
|
-
const ownerAuth = await generateExtendAuthorization(
|
|
48154
|
-
positionId,
|
|
48155
|
-
selectedTerm,
|
|
48156
|
-
chainId,
|
|
48157
|
-
mode,
|
|
48158
|
-
signer
|
|
48729
|
+
const mode = chainId === 1 || chainId === 137 ? "prod" : "dev";
|
|
48730
|
+
const paymentAmountWei = ethers_exports.utils.parseEther(
|
|
48731
|
+
request.paymentAmount.toString()
|
|
48159
48732
|
);
|
|
48160
|
-
|
|
48161
|
-
|
|
48162
|
-
|
|
48163
|
-
|
|
48164
|
-
|
|
48165
|
-
|
|
48166
|
-
|
|
48167
|
-
|
|
48168
|
-
|
|
48169
|
-
|
|
48170
|
-
},
|
|
48171
|
-
pkpPublicKey,
|
|
48172
|
-
ownerAuth,
|
|
48173
|
-
pkpTokenId,
|
|
48174
|
-
pkpEthAddress
|
|
48175
|
-
);
|
|
48176
|
-
|
|
48177
|
-
if (!authResult.success) {
|
|
48178
|
-
throw new Error(
|
|
48179
|
-
`Authorization failed: ${authResult.error.message}`
|
|
48733
|
+
const contracts = mode === "dev" ? {
|
|
48734
|
+
PositionManager: this.config.contractAddresses?.positionManager || "",
|
|
48735
|
+
LoanOperationsManagerModule: this.config.contractAddresses?.loanOperationsManager || "",
|
|
48736
|
+
TermManagerModule: this.config.contractAddresses?.termManager || "",
|
|
48737
|
+
UCDController: this.config.contractAddresses?.ucdController || ""
|
|
48738
|
+
} : void 0;
|
|
48739
|
+
if (this.config.debug && mode === "dev") {
|
|
48740
|
+
log.info(" Contract addresses for dev mode:", {});
|
|
48741
|
+
log.info(
|
|
48742
|
+
` PositionManager: ${contracts?.PositionManager || "MISSING"}`
|
|
48180
48743
|
);
|
|
48181
|
-
|
|
48182
|
-
|
|
48183
|
-
const authResponse = authResult.value;
|
|
48184
|
-
|
|
48185
|
-
if (!authResponse.approved) {
|
|
48186
|
-
throw new Error(
|
|
48187
|
-
`Extension not approved: ${authResponse.reason || "Unknown reason"}`
|
|
48744
|
+
log.info(
|
|
48745
|
+
` LoanOpsManager: ${contracts?.LoanOperationsManagerModule || "MISSING"}`
|
|
48188
48746
|
);
|
|
48189
|
-
|
|
48190
|
-
|
|
48191
|
-
|
|
48192
|
-
|
|
48193
|
-
|
|
48194
|
-
|
|
48195
|
-
if (!authResponse.btcPrice) {
|
|
48196
|
-
throw new Error("BTC price not provided in authorization response");
|
|
48197
|
-
}
|
|
48198
|
-
|
|
48199
|
-
if (!authResponse.quantumTimestamp) {
|
|
48200
|
-
throw new Error("Quantum timestamp not provided in authorization response");
|
|
48201
|
-
}
|
|
48202
|
-
|
|
48203
|
-
// Call contract extendPosition
|
|
48204
|
-
const contractManager = this.getContractManager();
|
|
48205
|
-
const positionManagerResult = contractManager.getPositionManager();
|
|
48206
|
-
if (!positionManagerResult.success) {
|
|
48207
|
-
throw new Error(
|
|
48208
|
-
`Failed to get PositionManager: ${positionManagerResult.error.message}`
|
|
48747
|
+
log.info(
|
|
48748
|
+
` TermManager: ${contracts?.TermManagerModule || "MISSING"}`
|
|
48749
|
+
);
|
|
48750
|
+
log.info(
|
|
48751
|
+
` UCDController: ${contracts?.UCDController || "MISSING"}`
|
|
48209
48752
|
);
|
|
48210
48753
|
}
|
|
48211
|
-
|
|
48212
|
-
|
|
48213
|
-
|
|
48214
|
-
|
|
48215
|
-
|
|
48216
|
-
|
|
48217
|
-
|
|
48218
|
-
|
|
48219
|
-
|
|
48220
|
-
quantumTimestamp: quantumTimestamp.toString(),
|
|
48221
|
-
hasSignature: !!authResponse.signature,
|
|
48222
|
-
});
|
|
48754
|
+
if (mode === "dev" && contracts) {
|
|
48755
|
+
if (!contracts.PositionManager) {
|
|
48756
|
+
throw new Error("PositionManager address is required for dev mode");
|
|
48757
|
+
}
|
|
48758
|
+
if (!contracts.LoanOperationsManagerModule) {
|
|
48759
|
+
throw new Error(
|
|
48760
|
+
"LoanOperationsManagerModule address is required for dev mode"
|
|
48761
|
+
);
|
|
48762
|
+
}
|
|
48223
48763
|
}
|
|
48224
|
-
|
|
48225
|
-
|
|
48226
|
-
|
|
48227
|
-
|
|
48228
|
-
|
|
48229
|
-
|
|
48230
|
-
|
|
48764
|
+
let bitcoinProviderUrl;
|
|
48765
|
+
if (!bitcoinProviderUrl) {
|
|
48766
|
+
if (this.config.bitcoinProviders && this.config.bitcoinProviders.length > 0) {
|
|
48767
|
+
const firstProvider = this.config.bitcoinProviders[0];
|
|
48768
|
+
if (firstProvider && firstProvider.url) {
|
|
48769
|
+
bitcoinProviderUrl = firstProvider.url;
|
|
48770
|
+
}
|
|
48771
|
+
} else if (this.config.bitcoinRpcUrl) {
|
|
48772
|
+
bitcoinProviderUrl = this.config.bitcoinRpcUrl;
|
|
48773
|
+
}
|
|
48774
|
+
}
|
|
48775
|
+
const signer = this.getSignerOrThrow();
|
|
48776
|
+
const auth = await generatePaymentAuthorization(
|
|
48777
|
+
request.positionId,
|
|
48778
|
+
BigInt(paymentAmountWei.toString()),
|
|
48779
|
+
chainId,
|
|
48780
|
+
mode,
|
|
48781
|
+
signer
|
|
48231
48782
|
);
|
|
48232
|
-
|
|
48233
48783
|
if (this.config.debug) {
|
|
48234
|
-
log.info("
|
|
48235
|
-
|
|
48236
|
-
});
|
|
48784
|
+
log.info(" Payment authorization generated", {});
|
|
48785
|
+
log.info(` Timestamp: ${auth.timestamp}`);
|
|
48786
|
+
log.info(` ChainId: ${auth.chainId}`);
|
|
48787
|
+
log.info(` Mode: ${auth.mode}`);
|
|
48788
|
+
log.info(` Signature: ${auth.signature.substring(0, 20)}...`);
|
|
48789
|
+
}
|
|
48790
|
+
await waitUntilTimestamp(auth.timestamp);
|
|
48791
|
+
validateQuantumTiming(auth.timestamp, 30);
|
|
48792
|
+
return {
|
|
48793
|
+
success: false,
|
|
48794
|
+
error: "makePayment not yet implemented - requires requestPaymentAuthorization in lit-ops"
|
|
48795
|
+
};
|
|
48796
|
+
} catch (error) {
|
|
48797
|
+
let transactionHash;
|
|
48798
|
+
let receipt;
|
|
48799
|
+
if (error?.transaction?.hash) {
|
|
48800
|
+
transactionHash = error.transaction.hash;
|
|
48801
|
+
} else if (error?.transactionHash) {
|
|
48802
|
+
transactionHash = error.transactionHash;
|
|
48803
|
+
} else if (error?.receipt?.transactionHash) {
|
|
48804
|
+
transactionHash = error.receipt.transactionHash;
|
|
48805
|
+
receipt = error.receipt;
|
|
48237
48806
|
}
|
|
48238
|
-
|
|
48239
|
-
const receipt = await tx.wait();
|
|
48240
|
-
|
|
48807
|
+
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
48241
48808
|
if (this.config.debug) {
|
|
48242
|
-
log.
|
|
48243
|
-
|
|
48244
|
-
|
|
48809
|
+
log.error("\u274C Payment failed", {
|
|
48810
|
+
transactionHash: transactionHash || "not available",
|
|
48811
|
+
error: errorMsg
|
|
48245
48812
|
});
|
|
48246
48813
|
}
|
|
48247
|
-
|
|
48248
|
-
|
|
48249
|
-
|
|
48250
|
-
|
|
48251
|
-
|
|
48252
|
-
|
|
48253
|
-
|
|
48254
|
-
|
|
48255
|
-
|
|
48256
|
-
|
|
48257
|
-
|
|
48258
|
-
async partPayment(
|
|
48259
|
-
request: PartialPaymentRequest
|
|
48260
|
-
): Promise<PartialPaymentResult> {
|
|
48261
|
-
this.ensureInitialized();
|
|
48262
|
-
|
|
48263
|
-
try {
|
|
48264
|
-
if (this.config.debug) {
|
|
48265
|
-
log.info(`💳 Making partial payment...`, {});
|
|
48266
|
-
log.info(` Amount: ${request.paymentAmount} UCD`);
|
|
48267
|
-
log.info(` positionId: ${request.positionId}`);
|
|
48268
|
-
}
|
|
48269
|
-
|
|
48270
|
-
// Get contract addresses
|
|
48271
|
-
const contractAddresses = this.getContractAddressesOrThrow();
|
|
48272
|
-
if (!contractAddresses.positionManager) {
|
|
48273
|
-
return {
|
|
48274
|
-
success: false,
|
|
48275
|
-
error: "PositionManager address not configured",
|
|
48276
|
-
};
|
|
48277
|
-
}
|
|
48278
|
-
|
|
48279
|
-
// Get PositionManager contract
|
|
48280
|
-
const contractManager = this.getContractManager();
|
|
48281
|
-
const positionManagerResult = contractManager.getPositionManager();
|
|
48282
|
-
if (!positionManagerResult.success) {
|
|
48283
|
-
return {
|
|
48284
|
-
success: false,
|
|
48285
|
-
error: `Failed to get PositionManager: ${positionManagerResult.error.message}`,
|
|
48286
|
-
};
|
|
48287
|
-
}
|
|
48288
|
-
const positionManager = positionManagerResult.value;
|
|
48289
|
-
|
|
48290
|
-
// Convert position ID to bytes32 format
|
|
48291
|
-
const positionIdBytes32 = this.toBytes32(request.positionId);
|
|
48292
|
-
|
|
48293
|
-
// Convert payment amount to wei
|
|
48294
|
-
const paymentAmountWei = ethers5.utils.parseEther(
|
|
48295
|
-
request.paymentAmount.toString()
|
|
48296
|
-
);
|
|
48297
|
-
|
|
48298
|
-
if (this.config.debug) {
|
|
48299
|
-
log.info("📝 Calling makePartialPayment contract method...");
|
|
48300
|
-
}
|
|
48301
|
-
|
|
48302
|
-
// Call makePartialPayment - convert BigNumber to string for contract call
|
|
48303
|
-
const tx = await positionManager.makePartialPayment(
|
|
48304
|
-
positionIdBytes32,
|
|
48305
|
-
paymentAmountWei.toString()
|
|
48306
|
-
);
|
|
48307
|
-
|
|
48308
|
-
if (this.config.debug) {
|
|
48309
|
-
log.info(`📤 Transaction sent: ${tx.hash}`);
|
|
48310
|
-
log.info("⏳ Waiting for transaction confirmation...");
|
|
48311
|
-
}
|
|
48312
|
-
|
|
48313
|
-
// Wait for transaction receipt using provider (more reliable than tx.wait())
|
|
48314
|
-
const provider = contractManager.getProvider();
|
|
48315
|
-
const timeoutMs = this.config.transactionTimeoutMs || 300000; // Default 5 minutes
|
|
48316
|
-
|
|
48317
|
-
const receipt = await Promise.race([
|
|
48318
|
-
provider.waitForTransaction(tx.hash, 1), // Wait for 1 confirmation
|
|
48319
|
-
new Promise<never>((_, reject) =>
|
|
48320
|
-
setTimeout(
|
|
48321
|
-
() =>
|
|
48322
|
-
reject(
|
|
48323
|
-
new Error(
|
|
48324
|
-
`Transaction timeout after ${timeoutMs}ms. Transaction hash: ${tx.hash}`
|
|
48325
|
-
)
|
|
48326
|
-
),
|
|
48327
|
-
timeoutMs
|
|
48328
|
-
)
|
|
48329
|
-
),
|
|
48330
|
-
]);
|
|
48331
|
-
|
|
48332
|
-
if (!receipt) {
|
|
48333
|
-
return {
|
|
48334
|
-
success: false,
|
|
48335
|
-
error: `Transaction receipt not found for hash: ${tx.hash}`,
|
|
48336
|
-
transactionHash: tx.hash,
|
|
48337
|
-
};
|
|
48338
|
-
}
|
|
48339
|
-
|
|
48340
|
-
if (receipt.status === 0) {
|
|
48341
|
-
return {
|
|
48342
|
-
success: false,
|
|
48343
|
-
error: "Transaction reverted",
|
|
48344
|
-
transactionHash: tx.hash,
|
|
48345
|
-
blockNumber: receipt.blockNumber,
|
|
48346
|
-
};
|
|
48347
|
-
}
|
|
48348
|
-
|
|
48349
|
-
if (this.config.debug) {
|
|
48350
|
-
log.info(`✅ Transaction confirmed in block ${receipt.blockNumber}`);
|
|
48351
|
-
}
|
|
48352
|
-
|
|
48353
|
-
// Return result
|
|
48354
|
-
const result: PartialPaymentResult = {
|
|
48355
|
-
success: true,
|
|
48356
|
-
transactionHash:
|
|
48357
|
-
(receipt as any).transactionHash || (receipt as any).hash,
|
|
48358
|
-
blockNumber: receipt?.blockNumber,
|
|
48359
|
-
blockHash: (receipt as any).blockHash,
|
|
48360
|
-
gasUsed: receipt?.gasUsed?.toString(),
|
|
48361
|
-
effectiveGasPrice:
|
|
48362
|
-
(receipt as any).effectiveGasPrice?.toString() ||
|
|
48363
|
-
(receipt as any).gasPrice?.toString(),
|
|
48364
|
-
positionId: request.positionId,
|
|
48365
|
-
paymentAmountUCD: request.paymentAmount,
|
|
48366
|
-
};
|
|
48367
|
-
|
|
48368
|
-
// Send Telegram notification if configured
|
|
48369
|
-
if (this.config.telegram && result.transactionHash) {
|
|
48370
|
-
const paymentAmount = result.paymentAmountUCD || request.paymentAmount;
|
|
48371
|
-
const loanId = result.positionId || request.positionId;
|
|
48372
|
-
const message = formatPartialPaymentMessage(
|
|
48373
|
-
paymentAmount,
|
|
48374
|
-
loanId,
|
|
48375
|
-
result.transactionHash
|
|
48376
|
-
);
|
|
48377
|
-
await sendTelegramMessage(
|
|
48378
|
-
this.config.telegram.chatId,
|
|
48379
|
-
this.config.telegram.chatToken,
|
|
48380
|
-
message,
|
|
48381
|
-
this.config.telegram.threadId
|
|
48382
|
-
);
|
|
48383
|
-
}
|
|
48384
|
-
|
|
48385
|
-
return result;
|
|
48386
|
-
} catch (error: any) {
|
|
48387
|
-
// Capture transaction hash if available
|
|
48388
|
-
let transactionHash: string | undefined;
|
|
48389
|
-
let receipt: any;
|
|
48390
|
-
|
|
48391
|
-
if ((error as any)?.transaction?.hash) {
|
|
48392
|
-
transactionHash = (error as any).transaction.hash;
|
|
48393
|
-
} else if ((error as any)?.transactionHash) {
|
|
48394
|
-
transactionHash = (error as any).transactionHash;
|
|
48395
|
-
} else if ((error as any)?.receipt?.transactionHash) {
|
|
48396
|
-
transactionHash = (error as any).receipt.transactionHash;
|
|
48397
|
-
receipt = (error as any).receipt;
|
|
48398
|
-
}
|
|
48399
|
-
|
|
48400
|
-
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
48401
|
-
|
|
48402
|
-
if (this.config.debug) {
|
|
48403
|
-
log.error("❌ Partial payment failed", {
|
|
48404
|
-
transactionHash: transactionHash || "not available",
|
|
48405
|
-
error: errorMsg,
|
|
48406
|
-
});
|
|
48407
|
-
}
|
|
48408
|
-
|
|
48409
|
-
const result: PartialPaymentResult = {
|
|
48410
|
-
success: false,
|
|
48411
|
-
error: `Partial payment failed: ${errorMsg}`,
|
|
48412
|
-
};
|
|
48413
|
-
|
|
48414
|
-
if (transactionHash) {
|
|
48415
|
-
result.transactionHash = transactionHash;
|
|
48416
|
-
}
|
|
48417
|
-
|
|
48418
|
-
if (receipt) {
|
|
48419
|
-
result.blockNumber = receipt.blockNumber;
|
|
48420
|
-
result.gasUsed = receipt.gasUsed?.toString();
|
|
48421
|
-
result.effectiveGasPrice =
|
|
48422
|
-
receipt.effectiveGasPrice?.toString() || receipt.gasPrice?.toString();
|
|
48423
|
-
}
|
|
48424
|
-
|
|
48425
|
-
return result;
|
|
48814
|
+
const result = {
|
|
48815
|
+
success: false,
|
|
48816
|
+
error: `Payment failed: ${errorMsg}`
|
|
48817
|
+
};
|
|
48818
|
+
if (transactionHash) {
|
|
48819
|
+
result.transactionHash = transactionHash;
|
|
48820
|
+
}
|
|
48821
|
+
if (receipt) {
|
|
48822
|
+
result.blockNumber = receipt.blockNumber;
|
|
48823
|
+
result.gasUsed = receipt.gasUsed?.toString();
|
|
48824
|
+
result.effectiveGasPrice = receipt.effectiveGasPrice?.toString() || receipt.gasPrice?.toString();
|
|
48426
48825
|
}
|
|
48826
|
+
return result;
|
|
48427
48827
|
}
|
|
48428
|
-
|
|
48828
|
+
}
|
|
48429
48829
|
/**
|
|
48430
48830
|
* Withdraw Bitcoin from a position
|
|
48431
48831
|
*
|
|
@@ -48633,12 +49033,14 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
48633
49033
|
withdrawalAddress,
|
|
48634
49034
|
// SDK interface uses withdrawalAddress
|
|
48635
49035
|
amount: withdrawalAmount.toString(),
|
|
48636
|
-
contracts
|
|
48637
|
-
//
|
|
49036
|
+
contractAddresses: contracts
|
|
49037
|
+
// Match lit-ops interface (contracts → contractAddresses)
|
|
48638
49038
|
},
|
|
48639
49039
|
userSignature: auth.signature,
|
|
48640
49040
|
customRpcUrl,
|
|
48641
|
-
customBitcoinRpcUrl
|
|
49041
|
+
customBitcoinRpcUrl,
|
|
49042
|
+
priceProviders: this.config.priceProviders
|
|
49043
|
+
// Pass price provider API keys
|
|
48642
49044
|
});
|
|
48643
49045
|
if (this.config.debug) {
|
|
48644
49046
|
log.info(` Withdrawal Auth Result (attempt ${attempt}):`, {
|
|
@@ -48800,7 +49202,7 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
48800
49202
|
const positionManagerContract = new ethers_exports.Contract(
|
|
48801
49203
|
this.config.contractAddresses.positionManager,
|
|
48802
49204
|
[
|
|
48803
|
-
"function withdrawBTC((bytes32 positionId, bytes32 actionHash, bytes32 authorizedSpendsHash, bytes32 ucdDebtHash, string withdrawalAddress, uint256 totalDeduction, uint256 newCollateral, uint256 quantumTimestamp, uint256 btcPrice, string utxoTxid, uint32 utxoVout) params, bytes signature) external returns (bool)"
|
|
49205
|
+
"function withdrawBTC((bytes32 positionId, bytes32 actionHash, bytes32 authorizedSpendsHash, bytes32 ucdDebtHash, bytes32 contractBundleHash, string withdrawalAddress, uint256 totalDeduction, uint256 newCollateral, uint256 quantumTimestamp, uint256 btcPrice, string utxoTxid, uint32 utxoVout) params, bytes signature) external returns (bool)"
|
|
48804
49206
|
],
|
|
48805
49207
|
this.config.contractSigner
|
|
48806
49208
|
);
|
|
@@ -48809,6 +49211,7 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
48809
49211
|
actionHash: validationResponse.actionHash,
|
|
48810
49212
|
authorizedSpendsHash: validationResponse.authorizedSpendsHash,
|
|
48811
49213
|
ucdDebtHash: validationResponse.ucdDebtHash,
|
|
49214
|
+
contractBundleHash: validationResponse.contractBundleHash,
|
|
48812
49215
|
withdrawalAddress: validationResponse.destinationAddress,
|
|
48813
49216
|
totalDeduction: validationResponse.totalDeduction,
|
|
48814
49217
|
newCollateral: validationResponse.remainingCollateral,
|
|
@@ -48819,20 +49222,67 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
48819
49222
|
utxoVout: validationResponse.utxoVout
|
|
48820
49223
|
// Real Bitcoin UTXO vout
|
|
48821
49224
|
};
|
|
48822
|
-
|
|
48823
|
-
|
|
48824
|
-
|
|
48825
|
-
|
|
49225
|
+
if (this.config.debug) {
|
|
49226
|
+
log.info("\u{1F4DD} Withdrawal params before transaction:", {
|
|
49227
|
+
positionId: withdrawalParams.positionId,
|
|
49228
|
+
actionHash: withdrawalParams.actionHash,
|
|
49229
|
+
authorizedSpendsHash: withdrawalParams.authorizedSpendsHash,
|
|
49230
|
+
ucdDebtHash: withdrawalParams.ucdDebtHash,
|
|
49231
|
+
contractBundleHash: withdrawalParams.contractBundleHash,
|
|
49232
|
+
withdrawalAddress: withdrawalParams.withdrawalAddress,
|
|
49233
|
+
totalDeduction: withdrawalParams.totalDeduction?.toString(),
|
|
49234
|
+
newCollateral: withdrawalParams.newCollateral?.toString(),
|
|
49235
|
+
quantumTimestamp: withdrawalParams.quantumTimestamp?.toString(),
|
|
49236
|
+
btcPrice: withdrawalParams.btcPrice?.toString(),
|
|
49237
|
+
utxoTxid: withdrawalParams.utxoTxid,
|
|
49238
|
+
utxoVout: withdrawalParams.utxoVout
|
|
49239
|
+
});
|
|
49240
|
+
}
|
|
49241
|
+
let tx;
|
|
49242
|
+
try {
|
|
49243
|
+
tx = await positionManagerContract["withdrawBTC"](
|
|
49244
|
+
withdrawalParams,
|
|
49245
|
+
signatureBytes
|
|
49246
|
+
);
|
|
49247
|
+
} catch (txError) {
|
|
49248
|
+
const txErrorMsg = txError instanceof Error ? txError.message : String(txError);
|
|
49249
|
+
if (this.config.debug) {
|
|
49250
|
+
log.error("\u274C withdrawBTC transaction failed", {
|
|
49251
|
+
error: txErrorMsg,
|
|
49252
|
+
withdrawalParams,
|
|
49253
|
+
signatureBytesLength: signatureBytes.length
|
|
49254
|
+
});
|
|
49255
|
+
}
|
|
49256
|
+
return {
|
|
49257
|
+
success: false,
|
|
49258
|
+
error: `Transaction submission failed: ${txErrorMsg}`
|
|
49259
|
+
};
|
|
49260
|
+
}
|
|
48826
49261
|
if (this.config.debug) {
|
|
48827
49262
|
log.info("\u2705 Transaction submitted, waiting for confirmation:", {
|
|
48828
49263
|
txHash: tx.hash
|
|
48829
49264
|
});
|
|
48830
49265
|
}
|
|
48831
|
-
|
|
49266
|
+
let receipt;
|
|
49267
|
+
try {
|
|
49268
|
+
receipt = await tx.wait();
|
|
49269
|
+
} catch (waitError) {
|
|
49270
|
+
const waitErrorMsg = waitError instanceof Error ? waitError.message : String(waitError);
|
|
49271
|
+
if (this.config.debug) {
|
|
49272
|
+
log.error("\u274C Transaction wait failed", {
|
|
49273
|
+
error: waitErrorMsg,
|
|
49274
|
+
txHash: tx.hash
|
|
49275
|
+
});
|
|
49276
|
+
}
|
|
49277
|
+
return {
|
|
49278
|
+
success: false,
|
|
49279
|
+
error: `Transaction confirmation failed: ${waitErrorMsg}`
|
|
49280
|
+
};
|
|
49281
|
+
}
|
|
48832
49282
|
if (this.config.debug) {
|
|
48833
49283
|
log.info("\u2705 BTC withdrawal confirmed", {
|
|
48834
49284
|
blockNumber: receipt.blockNumber,
|
|
48835
|
-
gasUsed: receipt.gasUsed
|
|
49285
|
+
gasUsed: receipt.gasUsed?.toString() || "unknown"
|
|
48836
49286
|
});
|
|
48837
49287
|
}
|
|
48838
49288
|
return {
|
|
@@ -48842,7 +49292,7 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
48842
49292
|
amountWithdrawn: withdrawalAmount.toString(),
|
|
48843
49293
|
evmTransactionHash: receipt.transactionHash,
|
|
48844
49294
|
blockNumber: receipt.blockNumber,
|
|
48845
|
-
gasUsed: receipt.gasUsed
|
|
49295
|
+
gasUsed: receipt.gasUsed?.toString() || "unknown",
|
|
48846
49296
|
utxoTxid: validationResponse.utxoTxid,
|
|
48847
49297
|
utxoVout: validationResponse.utxoVout
|
|
48848
49298
|
};
|
|
@@ -49115,7 +49565,8 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
49115
49565
|
// Hardhat URL for EVM contract queries
|
|
49116
49566
|
customBitcoinRpcUrl: request.customBitcoinRpcUrl,
|
|
49117
49567
|
// Bitcoin URL for UTXO queries
|
|
49118
|
-
|
|
49568
|
+
contractAddresses: contractsParam
|
|
49569
|
+
// Match lit-ops interface (contracts → contractAddresses)
|
|
49119
49570
|
});
|
|
49120
49571
|
if (!signResult.success) {
|
|
49121
49572
|
return {
|
|
@@ -49800,6 +50251,73 @@ var DiamondHandsSDK = class _DiamondHandsSDK {
|
|
|
49800
50251
|
return "regtest";
|
|
49801
50252
|
}
|
|
49802
50253
|
}
|
|
50254
|
+
/**
|
|
50255
|
+
* Extract error message from LIT Action response
|
|
50256
|
+
* Checks both `error` and `reason` fields and parses nested error structures
|
|
50257
|
+
*
|
|
50258
|
+
* @private
|
|
50259
|
+
* @remarks Production-ready error parser for LIT Protocol responses
|
|
50260
|
+
* Will be integrated into core methods in Round 2
|
|
50261
|
+
*/
|
|
50262
|
+
// @ts-ignore - Method will be used in Round 2 when integrated into core methods
|
|
50263
|
+
extractLitActionError(response) {
|
|
50264
|
+
if (response.error) {
|
|
50265
|
+
try {
|
|
50266
|
+
if (response.error.includes("Response from the nodes:")) {
|
|
50267
|
+
const jsonStart = response.error.indexOf("{");
|
|
50268
|
+
if (jsonStart !== -1) {
|
|
50269
|
+
const jsonStr = response.error.substring(jsonStart);
|
|
50270
|
+
const parsed = JSON.parse(jsonStr);
|
|
50271
|
+
if (parsed.error) {
|
|
50272
|
+
const errorObj = parsed.error;
|
|
50273
|
+
const errorKind = errorObj.errorKind || "";
|
|
50274
|
+
const errorCode = errorObj.errorCode || "";
|
|
50275
|
+
const message = errorObj.message || "";
|
|
50276
|
+
const details = errorObj.details || [];
|
|
50277
|
+
let errorMsg = message;
|
|
50278
|
+
if (errorKind) {
|
|
50279
|
+
errorMsg = `${errorKind}: ${errorMsg}`;
|
|
50280
|
+
}
|
|
50281
|
+
if (errorCode && errorCode !== errorKind) {
|
|
50282
|
+
errorMsg += ` (${errorCode})`;
|
|
50283
|
+
}
|
|
50284
|
+
if (details.length > 0) {
|
|
50285
|
+
errorMsg += ` - ${details.join(", ")}`;
|
|
50286
|
+
}
|
|
50287
|
+
if (response.failedStep) {
|
|
50288
|
+
errorMsg += ` (Failed at step: ${response.failedStep})`;
|
|
50289
|
+
}
|
|
50290
|
+
return errorMsg;
|
|
50291
|
+
}
|
|
50292
|
+
}
|
|
50293
|
+
}
|
|
50294
|
+
if (response.error.includes("timeout") || response.error.includes("Timeout")) {
|
|
50295
|
+
let timeoutMsg = "LIT Action execution timed out";
|
|
50296
|
+
if (response.error.includes("didn't respond within")) {
|
|
50297
|
+
const match2 = response.error.match(/didn't respond within (\d+s?)/);
|
|
50298
|
+
if (match2) {
|
|
50299
|
+
timeoutMsg += ` (timeout after ${match2[1]})`;
|
|
50300
|
+
}
|
|
50301
|
+
}
|
|
50302
|
+
if (response.failedStep) {
|
|
50303
|
+
timeoutMsg += ` at step ${response.failedStep}`;
|
|
50304
|
+
}
|
|
50305
|
+
return timeoutMsg;
|
|
50306
|
+
}
|
|
50307
|
+
if (response.error.length > 0 && response.error !== "undefined") {
|
|
50308
|
+
return response.error;
|
|
50309
|
+
}
|
|
50310
|
+
} catch (parseError) {
|
|
50311
|
+
if (response.error.length > 0) {
|
|
50312
|
+
return response.error;
|
|
50313
|
+
}
|
|
50314
|
+
}
|
|
50315
|
+
}
|
|
50316
|
+
if (response.reason) {
|
|
50317
|
+
return response.reason;
|
|
50318
|
+
}
|
|
50319
|
+
return "Unknown reason";
|
|
50320
|
+
}
|
|
49803
50321
|
// ============================================================================
|
|
49804
50322
|
// PRIVATE HELPER METHODS
|
|
49805
50323
|
// ============================================================================
|
|
@@ -50140,9 +50658,10 @@ var AuthParamsValidation;
|
|
|
50140
50658
|
return validateExtendTerm(params);
|
|
50141
50659
|
case "close":
|
|
50142
50660
|
return validateClosePosition(params);
|
|
50143
|
-
default:
|
|
50661
|
+
default: {
|
|
50144
50662
|
const _exhaustive = params;
|
|
50145
50663
|
return [`Unknown authorization type: ${_exhaustive.type}`];
|
|
50664
|
+
}
|
|
50146
50665
|
}
|
|
50147
50666
|
}
|
|
50148
50667
|
AuthParamsValidation2.validate = validate5;
|